Re: moving (and losing?) partitions with cfdisk
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.
> 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?
Here's my partition table now, in a couple different formats:
cfdisk 2.11u
Disk Drive: /dev/hda
Size: 30005821440 bytes, 30.0 GB
Heads: 15 Sectors per Track: 63 Cylinders: 62016
Name Flags Part Type FS Type [Label] Size (MB)
------------------------------------------------------------------------------
hda5 Boot Logical Linux 4702.45*
hda6 Boot Logical Linux 1000.10*
hda7 NC Logical Linux ext3 [/home] 14999.98*
hda8 Logical Linux swap 511.91
hda2 Boot Primary Linux ext3 [/] 5000.01
hda1 Boot Primary Win95 FAT32 (LBA) 3790.89
Primary Free Space 0.49
Partition Table for /dev/hda
First Last
# Type Sector Sector Offset Length Filesystem Type (ID) Flags
-- ------- -------- --------- ------ --------- ---------------------- ---------
3 Primary 0 41434469 63 41434470 Extended (05) None (00)
5 Logical 63* 9184516* 63 9184454* Linux (83) Boot (80)
6 Logical 9184517*11137831* 63 1953315 Linux (83) Boot (80)
7 Logical 11137832*40434659 1#29296828* Linux (83) None (00)
8 Logical 40434660 41434469 63 999810 Linux swap (82) None (00)
2 Primary 41434470 51200099 0 9765630 Linux (83) Boot (80)
1 Primary 51200100 58604174 0 7404075 Win95 FAT32 (LBA) (0C) Boot (80)
Primary 58604175 58605119 0 945 Free Space None (00)
I didn't print the partition table before the changes, but it would
have looked like this, gotten by deleting the two new partitions in
cfdisk (without saving the changes):
cfdisk 2.11u
Disk Drive: /dev/hda
Size: 30005821440 bytes, 30.0 GB
Heads: 15 Sectors per Track: 63 Cylinders: 62016
Name Flags Part Type FS Type [Label] Size (MB)
------------------------------------------------------------------------------
Pri/Log Free Space 5702.57*
hda5 NC Logical Linux ext3 [/home] 14999.98*
hda6 Logical Linux swap 511.91
hda2 Boot Primary Linux ext3 [/] 5000.01
hda1 Boot Primary Win95 FAT32 (LBA) 3790.89
Primary Free Space 0.49
Partition Table for /dev/hda
First Last
# Type Sector Sector Offset Length Filesystem Type (ID) Flags
-- ------- -------- --------- ------ --------- ---------------------- ---------
Pri/Log 0 11137831* 0#11137832* Free Space None (00)
3 Primary 11137832*41434469 0 30296638* Extended (05) None (00)
5 Logical 11137832*40434659 1#29296828* Linux (83) None (00)
6 Logical 40434660 41434469 63 999810 Linux swap (82) None (00)
2 Primary 41434470 51200099 0 9765630 Linux (83) Boot (80)
1 Primary 51200100 58604174 0 7404075 Win95 FAT32 (LBA) (0C) Boot (80)
Primary 58604175 58605119 0 945 Free Space None (00)
> Well, you are the one who did things. Did you keep a written
> log of your actions and what happened?
The exact actions I took were to run boot into knoppix, then:
cfdisk /dev/hda
move cursor onto unused space
n (new partition)
l (logical)
Size (in MB): 1000
e (end)
move cursor onto unused space
n (new partition)
l (logical)
Size (in MB): 4702.47 (all the remaining space)
e (end)
I mounted the root partition and changed hda5 and hda6 to hda7 and
hda8, and ran update-grub while chrooted into the root partition
(which I later realized was unnecessary, since the root partition
didn't change).
One thing I noticed is that the home partition now has the flag "NC"
which I don't think it had before. Also, I got a warning that since I
had more than one bootable partition (I now have four), DOS MBR could
not read this. I didn't worry about it, since I'm using GRUB.
> I recommend that you not exit Knoppix until either you are
> reasonably satisfied that you are fixed up, or until
> you give up in despair. Hopefully, with a little help,
> you can get back where you were.
>
> We're here to help, if we can.
THANK you. I will remain in knoppix until said conditions.
Reply to: