[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dump fdisk data to TXT file



Err... oops, I've just realised it's not quite as simple as all that.

The one 'dd' command will only backup the MBR, which contains the main
partition table.  If you've only got primary partitions on your disk, it
will suffice - but if you have extended partitions, you'll also have to
backup the first sector of the extended partition (/dev/hda? where ? is the
number of the extended partition).  Restoring would then be a two step
process - restore the MBR to /dev/hda, then restore the partition table of
the extended partition.

It's all starting to look a little complicated, and I'm afraid I still can't
really see the point.

    - Kevin.

From: "Kevin Easton" <s3159795@student.anu.edu.au>
To: "Russell Coker" <russell@coker.com.au>; <debian-user@lists.debian.org>
Sent: Saturday, April 14, 2001 4:29 AM
Subject: Re: dump fdisk data to TXT file


> If you want to dump the "fdisk data" (by which I guess you mean the hard
> disk partition table) to a file, you can either:
>
>     * Do what others have suggested (fdisk -l /dev/hda > hda.fdisk) - this
> will give you a readable text version of your partition table, but you
can't
> use this to directly reconstruct the partition table with fdisk.
>
>     * Use the command:
> dd if=/dev/hda of=hda.mbr bs=512 count=1
> to create a binary file hda.mbr containing the Master Boot Record of the
> disk /dev/hda.  This won't be human readable, but you will be able to use
it
> to restore the partition table with the same command, interchanging the
> "/dev/hda" and "hda.mbr".
>
> CAVEATS:
> 1) Be extraordinarily careful with this.  If you miskey, you can quite
> easily corrupt the information stored on your hard disk.
> 2) If you ever restore the partition table with the backup of the Master
> Boot Record, it will also restore a (almost certainly now broken) lilo
MBR.
> You'll quite probably have to reinstall lilo, and possibly do much more
> reconstruction work besides to get back to a booting, working system.
> 3) There's not actually very many situations when this would be all that
> useful.  It's quite rare for the partition table to get hosed without
other
> data on the disk suffering a similar fate.
>
> I hope this helps, at any rate.
>
>     Cheers,
>     - Kevin.
>
> From: "Russell Coker" <russell@coker.com.au>
> To: <debian-user@lists.debian.org>
> Sent: Thursday, April 12, 2001 11:23 PM
> Subject: dump fdisk data to TXT file
>
>
> > Is there a program in Debian to dump the fdisk data to a file?
> >
> > I would like to do `fdisk-dump /dev/hda > /etc/hda.fdisk` so that if the
> > partition table gets corrupted I can do
> > `fdisk-restore /dev/hda < /etc/hda.fdisk` .  Is there any software in
> Debian
> > that allows such operations?
> >
> > --
> > http://www.coker.com.au/bonnie++/     Bonnie++ hard drive benchmark
> > http://www.coker.com.au/postal/       Postal SMTP/POP benchmark
> > http://www.coker.com.au/projects.html Projects I am working on
> > http://www.coker.com.au/~russell/     My home page
> >
> >
> > --
> > To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
> > with a subject of "unsubscribe". Trouble? Contact
> listmaster@lists.debian.org
> >
> >
>
>
> --
> To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact
listmaster@lists.debian.org
>
>



Reply to: