Page 1 of 1

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

Posted: Mon Sep 28, 2009 9:47 pm
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?)

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

Posted: Mon Sep 28, 2009 11:10 pm
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:

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

Posted: Tue Sep 29, 2009 9:03 am
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!

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

Posted: Tue Sep 29, 2009 10:20 pm
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.

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

Posted: Tue Sep 29, 2009 10:26 pm
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.

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

Posted: Wed Sep 30, 2009 9:01 am
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.)

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

Posted: Wed Sep 30, 2009 10:36 am
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.

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

Posted: Wed Sep 30, 2009 2:15 pm
by XeonX369
Thanks to all who have helped, I believe that I found what I needed.