DD Tool (Preserve Patition Information[Floppy/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
XeonX369
Member
Member
Posts: 29
Joined: Mon Sep 28, 2009 1:12 pm

DD Tool (Preserve Patition Information[Floppy/USB])

Post by XeonX369 »

if I am using the DD tool, how exactly would I preserve the partition information on a floppy disk ... on a USB flash-drive. I do use Bochs as my current emulator for testing, but sometimes I really would like to boot on an actual machine using the machine's BIOS and such. All help would be appreciated, step, by step or just a general explanation (where does this information reside on the bootsector/MBR?)
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: DD Tool (Preserve Patition Information[Floppy/USB])

Post by Combuster »

A floppy has no partitions. On devices that do, you can select the partition you want to write to (like /dev/sda1) and the partition table will not get modified.

If that doesn't help, there's always the seek=xxx and skip=xxx and conv=notrunc, look them up in the manual :wink:
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
XeonX369
Member
Member
Posts: 29
Joined: Mon Sep 28, 2009 1:12 pm

Re: DD Tool (Preserve Patition Information[Floppy/USB])

Post by XeonX369 »

What I am meaning to say is:

how would I go about doing that. I have tried to read the manual, but I can't figure out how I would use the command arguments, and I can't find where to information is located. I have tried the /dev/sdb1 (a partition on my USB drive) but I can't get it to boot from there. It seems it will only boot if I set it to /dev/sdb (the MBR), but then I loose the partition table for my device, which I need to store the kernel on.

Please help!
User avatar
scgtrp
Member
Member
Posts: 30
Joined: Sat Mar 28, 2009 7:32 pm

Re: DD Tool (Preserve Patition Information[Floppy/USB])

Post by scgtrp »

You have your kernel... in the partition table?

Anyway, try setting the partition bootable/active/whatever your partitioning tool calls it. The MBR is probably looking for that and not finding it.
kubeos
Member
Member
Posts: 138
Joined: Tue Jan 30, 2007 2:31 pm
Location: Kamloops BC, CANADA
Contact:

Re: DD Tool (Preserve Patition Information[Floppy/USB])

Post by kubeos »

I don't know anything about DD.. but

In order for your usb drive to boot anything, it needs a partition set as active, as well as a bootloader at the start of that partition. I assume linux has something like 'fdisk' for messing with the partition table. Then use dd to put the bootsector at the first sector of the active partition.
XeonX369
Member
Member
Posts: 29
Joined: Mon Sep 28, 2009 1:12 pm

Re: DD Tool (Preserve Patition Information[Floppy/USB])

Post by XeonX369 »

Sorry for the confusion. I should have explained myself better. I have a USB flashdrive, currently formatted with one (1) ext2 partition. I need to have my operating system Kernel placed on this partition, and I need to have my bootsector copied to the disk.

I have tried various methods such as copying it to sdb itself, to copying to the partition sdb1. I have had no progress.

The method of copying it to sdb doesn't work, as it appears to make the drive unreadable (does this over-write the partition information), and the method of coping to the partition sdb1 just doesn't work at all (it won't boot).

I really do need this help, as I haven't been able to get anywhere beyond this (my kernel takes up 1 MB and I plan on expanding it rapidly so floppy is out of the question.)
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: DD Tool (Preserve Patition Information[Floppy/USB])

Post by Combuster »

Have you even bothered to look up where the partition table is located, and hence, what not to overwrite?

There is no point in using DD (or anything else) if you don't know what you are doing with it.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
XeonX369
Member
Member
Posts: 29
Joined: Mon Sep 28, 2009 1:12 pm

Re: DD Tool (Preserve Patition Information[Floppy/USB])

Post by XeonX369 »

Thanks to all who have helped, I believe that I found what I needed.
Post Reply