Bootsector on usb

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
Zacariaz
Member
Member
Posts: 1069
Joined: Tue May 22, 2007 2:36 pm
Contact:

Bootsector on usb

Post by Zacariaz »

Seriously, i find it really hard to understand why i cant find anything on the net about how to write a bootsector to an usb mbr.

Anyway, i am sure one of you can halp, i only hope it wont take too long :D
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post by Brynet-Inc »

Well... OpenBSD treats such devices just like any other hardrive.. (One can use disklabel etc..)

Code: Select all

umass0 at uhub1 port 1 configuration 1 interface 0
umass0: LEXR PLUG DRIVE LEXR PLUG DRIVE, rev 1.10/0.01, addr 2
umass0: using SCSI over Bulk-Only
scsibus2 at umass0: 2 targets
sd0 at scsibus2 targ 1 lun 0: <LEXAR, DIGITAL FILM, /W1.> SCSI2 0/direct removable
sd0: 123MB, 123 cyl, 64 head, 32 sec, 512 bytes/sec, 251904 sec total
You could use the dd command to write the bootsector.. Although booting the USB device will require that your BIOS supports it..

If you're using Windows, Next time mention that in your initial post..
Last edited by Brynet-Inc on Fri May 25, 2007 3:52 pm, edited 1 time in total.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
Zacariaz
Member
Member
Posts: 1069
Joined: Tue May 22, 2007 2:36 pm
Contact:

Post by Zacariaz »

Being the noob i am, i fo course use windows, sorry i didnt mention it. I did however find something that seems to be usefull, i am about to test it now.
User avatar
Zacariaz
Member
Member
Posts: 1069
Joined: Tue May 22, 2007 2:36 pm
Contact:

Post by Zacariaz »

It worked (i think) so that is great, however if anyone know how to use partcopy or something simular for it, i would be very interested.
User avatar
inflater
Member
Member
Posts: 1309
Joined: Thu Sep 28, 2006 10:32 am
Location: Slovakia
Contact:

Post by inflater »

It worked (i think) so that is great, however if anyone know how to use partcopy or something simular for it, i would be very interested.
I use PARTCOPY from unreleased PortixOS 0.4 pre-r. III as a installing program for RSFS. If you need help with it, just PM me and I will try to help you.
Being the noob i am, i fo course...
Please don't use the word "noob", it's harsh and embarrasing too. No one is a "noob" in the whole world, even a little baby, that just learned how to walk. ;)

inflater
My web site: http://inflater.wz.cz (Slovak)
Derrick operating system: http://derrick.xf.cz (Slovak and English :P)
User avatar
Zacariaz
Member
Member
Posts: 1069
Joined: Tue May 22, 2007 2:36 pm
Contact:

Post by Zacariaz »

inflater wrote:Please don't use the word "noob", it's harsh and embarrasing too. No one is a "noob" in the whole world, even a little baby, that just learned how to walk. ;)
I agree that "noob" is a "not very nice" word/expression.
Even though i have installed debian, i havent yet succeeded setting up my wireless network, and that is with hours an hours of great help from the irc channels, so seemingly i am a "linux n**b"
xsix
Member
Member
Posts: 59
Joined: Tue Oct 24, 2006 10:52 am

Post by xsix »

the fact to have a fun with PARTCOPY is easy. Syntax is partcopy _Starting byte_ _Length_ _Device_ _Starting_byte_of_a_device. To write a bootsector on a floppy you can use partcopy boot.bin 0 200 -f0 0. 0 means that you're writing to the first(or actually if we count 0..n then to the 0th) sector, 200 means 512 in decimal, so it is the bootloader length, F0 means Floppy A. F1 means Floppy B, and so on(try to check out readme.txt) and the last zero means the byte from where to start the writing on a device
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Post by Alboin »

Zacariaz wrote:
inflater wrote:Please don't use the word "noob", it's harsh and embarrasing too. No one is a "noob" in the whole world, even a little baby, that just learned how to walk. ;)
I agree that "noob" is a "not very nice" word/expression.
Even though i have installed debian, i havent yet succeeded setting up my wireless network, and that is with hours an hours of great help from the irc channels, so seemingly i am a "linux n**b"
Blah. If you're new to Linux use an easier distro like Ubuntu. Save Debian and Gentoo for a cold winter's eve after you've become proficient in the world of Linux.
C8H10N4O2 | #446691 | Trust the nodes.
User avatar
Zacariaz
Member
Member
Posts: 1069
Joined: Tue May 22, 2007 2:36 pm
Contact:

Post by Zacariaz »

xsix wrote:the fact to have a fun with PARTCOPY is easy. Syntax is partcopy _Starting byte_ _Length_ _Device_ _Starting_byte_of_a_device. To write a bootsector on a floppy you can use partcopy boot.bin 0 200 -f0 0. 0 means that you're writing to the first(or actually if we count 0..n then to the 0th) sector, 200 means 512 in decimal, so it is the bootloader length, F0 means Floppy A. F1 means Floppy B, and so on(try to check out readme.txt) and the last zero means the byte from where to start the writing on a device
I did check out the README and it offert little help. I think the main problem is that partcopy want device number, and using windows, as i am, it is ofcourse all about drive letters.

Another problem did come to my attention though, when i took tha chance and tryed to fill in the right syntax. Seemingly windows wouldnt allow writing to the mbr, nomatter the device.
User avatar
inflater
Member
Member
Posts: 1309
Joined: Thu Sep 28, 2006 10:32 am
Location: Slovakia
Contact:

Post by inflater »

Zacariaz wrote:
xsix wrote:the fact to have a fun with PARTCOPY is easy. Syntax is partcopy _Starting byte_ _Length_ _Device_ _Starting_byte_of_a_device. To write a bootsector on a floppy you can use partcopy boot.bin 0 200 -f0 0. 0 means that you're writing to the first(or actually if we count 0..n then to the 0th) sector, 200 means 512 in decimal, so it is the bootloader length, F0 means Floppy A. F1 means Floppy B, and so on(try to check out readme.txt) and the last zero means the byte from where to start the writing on a device
I did check out the README and it offert little help. I think the main problem is that partcopy want device number, and using windows, as i am, it is ofcourse all about drive letters.

Another problem did come to my attention though, when i took tha chance and tryed to fill in the right syntax. Seemingly windows wouldnt allow writing to the mbr, nomatter the device.
Reboot in MSDOS then, by using some bootable dos diskette, if it is possible. Check if you haven't activated some BIOS protections like "Boot Sector Virus Protection" stuff. But hey, isn't writing to the MBR a bit risky? :)

inflater
My web site: http://inflater.wz.cz (Slovak)
Derrick operating system: http://derrick.xf.cz (Slovak and English :P)
xsix
Member
Member
Posts: 59
Joined: Tue Oct 24, 2006 10:52 am

Post by xsix »

yeah, by rewriting the mbr on your hd you will cause windows to **** up and not to boot. use virtual machines with virtual hard drives, or connect old hard drive to the PC and use that disk on virtual machine. VMware allows you to use physical drive as virtual, you can do whatever you want, read, write, sector by sector etc(i've used my 3.2gb hd in the summer with VMware, and it was working as well as hell!).
User avatar
crackers
Member
Member
Posts: 27
Joined: Wed Nov 15, 2006 6:31 am

Post by crackers »

xsix wrote:yeah, by rewriting the mbr on your hd you will cause windows to **** up and not to boot. use virtual machines with virtual hard drives, or connect old hard drive to the PC and use that disk on virtual machine. VMware allows you to use physical drive as virtual, you can do whatever you want, read, write, sector by sector etc(i've used my 3.2gb hd in the summer with VMware, and it was working as well as hell!).
Yes, but old HDDs and virtual disks don't have all this stuff that u can play with (passwords, AAM, logs and so on) :D
xsix
Member
Member
Posts: 59
Joined: Tue Oct 24, 2006 10:52 am

Post by xsix »

yup, it don't but the first task is to make a full working read/write/delete/format functions and only then do those nasty tricks, i think. i know it's more interesting to make some SMART specific functions than doing READ or WRITE function on ATA. But how much you are going to use it? yes, to know your HD temperature is exciting but it's more exciting to read data from it
Post Reply