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

Re: moving (and losing?) partitions with cfdisk



I've read up a bit from the Partition-Rescue mini-howto, and am not
feeling so panicked any more.  My understanding is that cfdisk would
have *only* changed the partition table, which resides on the MBR. 
And since I haven't accessed the portion of the disk for which I
changed the partition table, there should be no data loss.  All I have
to do is restore the partition table to its original state, and
everything will be just as it was.  Its recommended course of action,
*if* you have a copy of your original partition table, is to delete
all your partitions and re-create them using fdisk.

I am tempted to use cfdisk to delete the two logical partitions I
created then try to mount /home, (still from knoppix) to see if that
reverses the changes.  If not, there are instructions in that howto
for figuring out where your partition starts and ends, which looks
annoying but possible.  I think the smartest thing for me to do right
now is sleep on it, see what advice those on this list have, then do
it with a fresh mind in the morning.

Mike, thank you for your replies - they are coming only to me, not to
the list, just in case that is unintentional.

It didn't take any time at all to write the changes I made in cfdisk,
just a second or two.  So perhaps it moved the location of the
partitions without moving the data?

Here is the output of fdisk -u and fdisk -u -l:

knoppix@ttyp0[knoppix]$ sudo fdisk -l

Disk /dev/hda: 15 heads, 63 sectors, 62016 cylinders
Units = cylinders of 945 * 512 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hda1   *     54181     62015   3702037+   c  Win95 FAT32 (LBA)
/dev/hda2   *     43847     54180   4882815   83  Linux
/dev/hda3             1     43846  20717203+   5  Extended
/dev/hda5   *         1      9720   4592195+  83  Linux
/dev/hda6   *      9720     11787    976626   83  Linux
/dev/hda7         11787     42788  14648413+  83  Linux
/dev/hda8         42789     43846    499873+  82  Linux swap

Partition table entries are not in disk order
knoppix@ttyp0[knoppix]$ sudo fdisk -u -l

Disk /dev/hda: 15 heads, 63 sectors, 62016 cylinders
Units = sectors of 1 * 512 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hda1   *  51200100  58604174   3702037+   c  Win95 FAT32 (LBA)
/dev/hda2   *  41434470  51200099   4882815   83  Linux
/dev/hda3            63  41434469  20717203+   5  Extended
/dev/hda5   *       126   9184516   4592195+  83  Linux
/dev/hda6   *   9184580  11137831    976626   83  Linux
/dev/hda7      11137833  40434659  14648413+  83  Linux
/dev/hda8      40434723  41434469    499873+  82  Linux swap

Partition table entries are not in disk order
knoppix@ttyp0[knoppix]$


(I'm including Mike's last message below for the archives, as it has
some useful info in it)

2006/2/17, Mike McCarty <mike.mccarty@sbcglobal.net>:
> Levi Waldron wrote:
> > 2006/2/17, Mike McCarty <mike.mccarty@sbcglobal.net>:
> >
> >>First step before messing with partitions: do a backup.
> >>Second step before messing with partitions: save your MBR on a floppy.
> >>Third step before messing with partitions: save the first sector
> >>of each partition on a floppy.
> >
> >
> > I have backups at home of everything important on the home partition,
> > but I'm on the road right now and it will be very annoying if I have
> > to resort to that...  more info than needed though :).  Point taken,
> > backup backup backup.  The MBR didn't seem like a big deal to me
> > because I don't have a floppy, and figured I could always rebuild it
> > from Knoppix.  I didn't know about saving the first sector of each
> > partition - thank you an I will in the future.
>
> The first sector of each partition is the Boot Record
> for that partition, sometimes also called the BPB,
> though that's rather dated and not actually applicable
> for non-MSDOS partitions.
>
> First thing I did with my machine after I got it home
> was add a floppy disc drive. Dunno why they don't come
> with 'em any more.
>
> >>I dunno what you have in your MBR for boot code, but
> >>I don't see how you created two more if you have a
> >>"normal" setup. With a normal setup, you can only
> >>have up to four partitions, one of which can be
> >>"extended" and have logical partitions in it.
> >>You already had three partitions, so how did you
> >>add two more? I suppose that hda5 and hda6 are inside
> >>of an extended partition you created before. Or are
> >>you using LVM? If you use LVM, I can't help you much
> >>if at all.
> >>
> >>What does fdisk say?
> >>What were the start/end addresses before you changed the PT?
>
> The stuff to look at is the start/end disc addresses for the
> partitions, and the types. What I see here does not indicate
> that you simply moved some partitions down, unless cfdisk
> actually copied a bunch of data. That would have taken a
> significant amount of time. E.g. to copy /home to hda7 would
> require copying 15 GB which would take several minutes.
>
> I hope you understand that I'm sitting here reading this stuff
> and trying to make some sense of it. I know you are on
> tenterhooks, but I haven't gone away.
>
> Anyway, it'll take a little while to figure out what is likely
> to have happened. I'm not real familiar with cfdisk.
>
> Also, there may be others out there more familiar with cfdisk
> who can help.
>
> Hang in there. As Red Green says, "We're all in this together,
> and I'm pullin' for you."
>
> Anyway, just sent this note so you wouldn't feel abandoned
> or lost, at least not just yet.
>
> Mike
> --
> p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
> This message made from 100% recycled bits.
> You have found the bank of Larn.
> I can explain it for you, but I can't understand it for you.
> I speak only for myself, and I am unanimous in that!
>



Reply to: