Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
My main drive is a 300GB SATA drive.
By default it had 1 recovery partition and the rest of the drive was taken up with WinXP on another partition, filling the rest of the drive.
So I left the recovery partition as is and shrunk the winxp one.
I the created 2 primary partitions, one for swap and the other one to be used as an extended partition, using the rest of the disk, ready for me to split into logical partitions for my distros and stuff.
So basically, at the moment, my disk is set out like this -
Code:
sda1 - WinXP 15GB
sda3 - swap 512MB
sda4 - Extended
- sda5 - shared 25GB
- sda6 - kanotix 20GB
- sda7 - openSUSE 20GB
- Free Space 210GB
sda2 - Recovery 6GB - at the end of the disk
I have been trying to create more logical drives in the extended but both suse and gparted will only let me create 1 partiton of 15GB and no bigger and if I do that and try to create another, they say I have the maximum amount of primary partitions (which I do, 4) and the I need to create an extended partition. But I have one, with lots of free space.
I tried deleting the swap partition and recreating it to use as another extended partition but it didnt work, won't let me add another extended partition or any logical ones.
So at the moment things look like this -
Code:
sda1 - WinXP 15GB
sda4 - Extended
- sda5 - shared 25GB
- sda6 - kanotix 20GB
- sda7 - openSUSE 20GB
- unallocated 14.77GB
sda3 - 177.17MB
sda2 - Recovery 6GB - at the end of the disk
I feel like I've really messed something up here (or suse did, which I used for the initial partitioning).
Output of fdisk -l
Code:
Disk /dev/sda: 300.0 GB, 300069052416 bytes
255 heads, 63 sectors/track, 36481 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 2115 16988706 7 HPFS/NTFS
/dev/sda2 35695 36481 6321577+ c W95 FAT32 (LBA)
/dev/sda3 12566 35694 185783692+ 83 Linux
/dev/sda4 2116 12565 83939625 f W95 Ext'd (LBA)
/dev/sda5 2116 5381 26226112 c W95 FAT32 (LBA)
/dev/sda6 5381 8027 21253995 83 Linux
/dev/sda7 8027 10637 20972794+ 83 Linux
/dev/sda8 10638 11943 10490413+ 83 Linux
Partition table entries are not in disk order
Ideally that is exactly what I would like to do but it's not gonna be easy.
I really don't understand how thinigs got so messed up to start with. I have used many different partitioning tools with no problems (other than accidentally deleting the wrong partition a couple of times).
At the moment, my kanotix partition contains kanotix, (suprisingly) which I've just got working pretty much perfectly, plus all my backups and important stuff from my old drive.
My second "proper" backup drive failed on me yesterday, just after copying all the backups from the kanotix partition.
So now I have nothing to copy all the stuff to.
On top of this, the comp came with windows installed but no install disc, just the recovery partition so they must stay choose what (and luckily, they both seem unaffected by the messy partitions).
I did experiment with using partimage on the winxp partition but 3 images and restorations on a different (bigger) partition failed.
It looks like I may have no choice though, I did find a way to get all that space back and allow me to make more partitions but with all the messed up ordering and everything I can only imagine it's gonna give me some problems at some point.
So assuming I delete all the partitions and just keep the xp and recovery partitions.
This leaves me with a 15GB ntfs partition (sda1) at the start of the disk and a 6 or 7GB recovery partition (sda2) at the very end of the disk.
Is it a good idea to try to move the recovery partition to follow on from the windows one? At least the partitions will be in a proper order (sda1, sda2, sda3 etc) instead of mixed up if I leave the recovery partition at the end (sda1, sda3, sda2 etc).
When I orignally made the extended partition I did direct it to use the whole of the remaining disk so I wonder if sda2 at the end of the disk screwed up it's calculations?
The biggest issue I see here is that the extended partition stops at 12565. This means that the space from 12565 to 35695 is inaccessible--ie fdisk will not let you make any more partitions. I don't know for sure how this happens---it happened to me the other day, but I fixed it.....fdisk will not change the size of the extended partition directly--in fact, it does not even show it. You CAN change it using QTParted or (I think) GParted.
Note that in normal mode, fdisk counts in units of 8225280 bytes--thus the apparent overlap my not be real. In fdisk, use the "u" command to change the units to sectors. If there is overlap in the SECTOR count, that would not be good....
Like uselpa have said. I suggest using Norton Ghost and do a partition to image of each partition, but do not do a disk copy. Then create partitions with the desire size. Use DVD instead of CD if you do not have enough hard drives laying around to shuffle your data around.
Yes, four primary partitions is the max, but there is a catch. If you want to put more than 4 partitions, one of the primary partitions have to be extended to fill the whole entire unused space. This means an extended partition is actually a primary partition that contains logical partitions which are real partitions contained in extended partition.
Use cfdisk instead of fdisk. The fdisk manual recommends using cfdisk anyways.
Yes, four primary partitions is the max, but there is a catch. If you want to put more than 4 partitions, one of the primary partitions have to be extended to fill the whole entire unused space. This means an extended partition is actually a primary partition that contains logical partitions which are real partitions contained in extended partition.
Actually, it's more like this: The first sector has space for four partition entries. If you want more partitions, one of these is a POINTER to another sector which contains two entries: a partition and another pointer. One poster observed that the whole thing is really more like a linked list. If you were to look at a map of the disk you would never see logical partitions contained in extended partitions.
It is a shortcoming in some partitioning programs that won't let you see whe is really going on--and which allows the first extended partition to have a bad end value such that you can't make more logical partitions.
QTParted does not have these issues.
Well thanks for all the responses.
I been very busy since my last post and just got back online so I have already been messing around before I saw the suggestions.
So here's what I've been up to.
I had a rummage around amongst some old stuff and managed to find an old 10GB hard drive.
I copied over all my important stuff and used partimage to make images of both the recovery partition and my kanotix install, I didn't bother with win xp since I wasn't touching that partition in any way. Somehow it all managed to fit on the disk.
I used gparted on the kanotix cd to delete all partitions except the winxp one and the recovery one.
I then moved the recovery partition from the end of the disk to follow on from winxp.
Next I created an extended partition and a few logical partitions for my distros and swap and stuff.
I then used partimage to restore the kanotix image to the new partition and copied over all my important stuff on to the new shared partition and reinstalled suse.
As far as I can tell everything seems to be in order now. I am writing this from the restored kanotix install, it booted up fine though there was some error on boot but I didn't catch it. I'll look into it but everything seems to be working.
All other partitions, including the recovery one seem to be fine as well.
The partition table is now much tidier and I did a few dry runs in gparted and the suse
partitioner without applying and they were both letting me use up all the remaining disk space, but I'm leaving it empty for the time being.
Actually, it's more like this: The first sector has space for four partition entries. If you want more partitions, one of these is a POINTER to another sector which contains two entries: a partition and another pointer. One poster observed that the whole thing is really more like a linked list. If you were to look at a map of the disk you would never see logical partitions contained in extended partitions.
It is a shortcoming in some partitioning programs that won't let you see whe is really going on--and which allows the first extended partition to have a bad end value such that you can't make more logical partitions.
QTParted does not have these issues.
Sure do it your way. There is a very high chance that data loss will occur. If do it my way, data loss is little to none and new partition table will be better than before.
What I am saying in my previous post, if there are 4 primary partitions listed and want to add more partitions. You have to delete one of the primary partitions to create multiple partitions because an extended partition is stated as an primary partition. My previous post has nothing to do with sector linking or the nitty gritty specs of partitions.
Sure do it your way. There is a very high chance that data loss will occur. If do it my way, data loss is little to none and new partition table will be better than before.
What I am saying in my previous post, if there are 4 primary partitions listed and want to add more partitions. You have to delete one of the primary partitions to create multiple partitions because an extended partition is stated as an primary partition. My previous post has nothing to do with sector linking or the nitty gritty specs of partitions.
I do not recommend getting upset about this---and I did not question the wisdom of your method. I was only clarifying how extended partitions actually work........
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.