Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Help with partitions [Solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
trom
n00b
n00b


Joined: 08 May 2006
Posts: 2

PostPosted: Sat Dec 23, 2006 12:04 am    Post subject: Help with partitions [Solved] Reply with quote

I have laptop that was preloaded with Windows XP. I wanted to keep the windows partition intact, so I used partition magic to resize the original ntfs partition at the beginning of the drive and created an extended partition to install gentoo on. Everything installed and worked perfectly for gentoo, but Windows crashes whenever I try to boot to it.

I then tried to check the partitions with parted, and I get this output:
Code:

 $ sudo parted
GNU Parted 1.7.1
Using /dev/hda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Error: Can't have a partition outside the disk!
(parted)


while fdisk tells me this:
Code:

$ sudo fdisk -l
Warning: ignoring extra data in partition table 5
Warning: ignoring extra data in partition table 5

Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1         765     6144831    7  HPFS/NTFS
/dev/hda2             766        9729    72003330    f  W95 Ext'd (LBA)
/dev/hda5             766         778      104391   83  Linux
/dev/hda6             779        1995     9775521   83  Linux
/dev/hda7            1996        3212     9775521   83  Linux
/dev/hda8            3213        3335      987966   83  Linux
/dev/hda9            3336        3944     4891761   83  Linux
/dev/hda10           3945        9468    44371467   83  Linux
/dev/hda11           9469        9729     2096482+  83  Linux


I tried to search for a solution/explanation for this at the time, but I eventually gave up and forgot about. I have now run with these partitions on gentoo for months without any problems. I would now like to change the partition structure, but I am unsure about what to do with this error.

I will probably end up backing everything up and reinstall, but does anyone know what caused this so I can avoid doing it again?

Thanks.


Last edited by trom on Sat Dec 23, 2006 1:50 am; edited 1 time in total
Back to top
View user's profile Send private message
Gentree
Watchman
Watchman


Joined: 01 Jul 2003
Posts: 5350
Location: France, Old Europe

PostPosted: Sat Dec 23, 2006 1:26 am    Post subject: Reply with quote

Quote:
Everything installed and worked perfectly for gentoo, but Windows crashes whenever I try to boot to it.
OK, everything working normally so far :lol:

parted and fdisk use different units , I think parted is rounding the end of hda11 up to a larger unit or rounding the disk size down and seeing it as stepping outside.

looks like the last one does not finish on a cylinder boundary, PM just sqeezed as much as possible in there.

you could try gparted (similar to partition magic) and see if you can resize hda11 a tad smaller. It may bleat because it uses parted libs anyway.

If that fails man resize2fs or delete and recreate that last entry. NOTE you can remove a partition table entry without wiping the data , just make sure you recreate it with exactly the same starting point.

probably best to login as root for this sort of thing rather than sudoing (that is what the super-user account is for).

I'm assuming that you can do without hda11 long enough to resize it since you'll need to umount it.

If not grab a liveCD, Knoppix for example.

Obviously back up anything important on there first and best back up the partition table itself.

something like dd-ing the first 512 bytes of /dev/hda to a floppy file or a usb device, check that out for yourself , I'm a bit tired and dont wont to mislead you with a bum post. I've posted about that and others have as well so you should have no trouble finding it . You could also use dd command to back up hda11 if you have enough space somewhere.

deleting and recreating hda11 is probably the simplest and best way . Just double check everything as you go and make sure you know how to restore the partition table from a liveCD before diving in, just in case.


8)
_________________
Linux, because I'd rather own a free OS than steal one that's not worth paying for.
Gentoo because I'm a masochist
AthlonXP-M on A7N8X. Portage ~x86
Back to top
View user's profile Send private message
trom
n00b
n00b


Joined: 08 May 2006
Posts: 2

PostPosted: Sat Dec 23, 2006 1:49 am    Post subject: Reply with quote

Thanks for the advice. Actually, hda11 is my swap partition, just mislabeled. I deleted and recreated it, and now all is well. I was afraid it was complaining about the extended partition, and I would have to redo the whole thing. Anyway, that was easy, thanks a lot.
Back to top
View user's profile Send private message
Gentree
Watchman
Watchman


Joined: 01 Jul 2003
Posts: 5350
Location: France, Old Europe

PostPosted: Sat Dec 23, 2006 2:19 am    Post subject: Reply with quote

glad it was so easy.

just for reference , if it had been the extended you could have removed each logical in turn , recreated the extd. with the same start point and filled in the logicials with exactly the same start and end except the last one.

This needs to be done by using fdisk or sfdisk which have finer units. parted will likely round things and get them wrong (hence lose you the whole lot) unless it was setup with parted in the first place, and yours ain't.

It sounds scary but these tools just change the partition table not the contents of the partitions. So with a bit of care you can reconstruct things and retain all your files intact.

8)
_________________
Linux, because I'd rather own a free OS than steal one that's not worth paying for.
Gentoo because I'm a masochist
AthlonXP-M on A7N8X. Portage ~x86
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum