Gentoo Archives: gentoo-user

From: Mick <michaelkintzios@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] problems with partition table
Date: Sun, 25 Feb 2007 15:19:22
Message-Id: 200702251512.46097.michaelkintzios@gmail.com
In Reply to: [gentoo-user] problems with partition table by JC D
1 On Sunday 25 February 2007 14:05, JC D wrote:
2 > Hi!
3 >
4 > I think I have a serious problem with my partition table. I did all the
5 > partitions with fdisk but may be not right, or somewhen screwed my
6 > partition table up. I want to use a graphical tool like gparted also doing
7 > some changes on my fat32 partition. But when I installed gparted I got an
8 > empty partition table with nothing than
9 >
10 > unallocated 55.89 GB (my disk is an 60 GB Hitachi)
11 >
12 > nothing else!!!
13
14 Did you write/save the partition table after your changes? Did you reboot
15 thereafter? I make some suggestions below but they come with the health
16 warning attached that I have no responsibility if it doesn't work.
17
18 > Here is my outpu from
19 > # fdisk -l
20 >
21 > fdisk -l
22 >
23 > Disk /dev/hda: 60.0 GB, 60011642880 bytes
24 > 255 heads, 63 sectors/track, 7296 cylinders
25 > Units = cylinders of 16065 * 512 = 8225280 bytes
26 >
27 > Device Boot Start End Blocks Id System
28 > /dev/hda1 * 1 1913 15361888+ 7 HPFS/NTFS
29 > Partition 1 does not end on cylinder boundary.
30
31 This is in itself is not a problem. If you create/resize partitions based on
32 MB you may or may not hit a clean cylinder boundary. Do your resizing in
33 cylinders and the end result will coincide with their boundaries.
34
35 > /dev/hda2 1914 4208 18427027+ c W95 FAT32 (LBA)
36 > Partition 2 does not end on cylinder boundary.
37 > /dev/hda3 5100 7296 17637480 f W95 Ext'd (LBA)
38 > Partition 3 does not end on cylinder boundary.
39
40 Look what has happened here, your extended partition starts at cyl 5100, while
41 your first logical partition starts at cyl 4208. I'd say that neither are
42 correct. I suggest that you resize your extended partition hda3 to start at
43 cyl 4209, i.e. straight after the end of the previous primary partition
44 (hda2).
45
46 > /dev/hda4 4208 5099 7164990 83 Linux
47
48 Here you need to change the beginning of this partition to be straight after
49 the end of the previous primary partition and at the beginning of the
50 extended partition. So, hda4 should start at cyl 4209.
51
52 > /dev/hda5 * 5100 5108 68008+ 83 Linux
53
54 This is good, but you do not need the boot flag. As a matter of fact it may
55 confuse your WinXP bootloader and Linux does not need it.
56
57 > /dev/hda6 5108 5173 521608+ 82 Linux swap /
58
59 This is not good as it overlaps the end of the previous partition. hda6
60 should start at cyl 5109.
61
62 > Solaris /dev/hda7 5173 7296 17047768+ 83 Linux
63 >
64 > Partition table entries are not in disk order
65
66 That's because they were created at a chronological sequence which do not
67 reflect their physical order on the disk. Not really important.
68
69 > This seems wrong to me. Also parted says something with overlapping
70 > partitions and its right I think. Is there any chance to repair this
71 > without destroying the whole installation? I have backuped my installation
72 > with rsync and also did save my mbr:
73 >
74 > dd if=/dev/hda of=/backup/mbr512.img bs=512 count=1
75 >
76 > and
77 >
78 > dd if=/dev/hda of=/backup/mbr446.img bs=446 count=1
79
80 Since you have a backup the worst that can happen is to correct the partitions
81 as suggested above and discover that your OS cannot read them! In that case
82 reformat them and use your back up to restore the data.
83
84 An alternative approach is to restore your partition table to a previous
85 version and with it the previous boundaries of your partitions. After I was
86 faced with a borked partition table too, I used testdisk to recover and
87 restore previous partition table entries.
88
89 http://www.cgsecurity.org/wiki/TestDisk
90
91 HTH.
92 --
93 Regards,
94 Mick