LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Partitioning problem (max amount of primary partitions) (https://www.linuxquestions.org/questions/linux-newbie-8/partitioning-problem-max-amount-of-primary-partitions-676369/)

th3_tr00p3r 10-14-2008 06:05 PM

Partitioning problem (max amount of primary partitions)
 
I currently have Ubunutu 8.04 installed on my computer. My partitions are as such:

/
/swap
/home
/files

The hard drive still has free space on it, however when I went to gparted to create another partition it tells me I have the max amount of primary partitions. I now relaize that I need to created an extended partition however I have 4 primary already. Is it possible to remeove the /home partition so I could do this? Or would removing the /home parition some how mess up my installation?

Total-MAdMaN 10-14-2008 06:15 PM

You'll have to edit /etc/fstab to point to the new /home partition, but other than that you shouldn't have any problems. Just make sure you back up any important files that you want to keep (remember to check the hidden files too).

jailbait 10-14-2008 06:15 PM

If you remove the /home directory then you can run as root but you cannot run as user. So you could log in as root and back up /home someplace. Then you could delete /home and do whatever you intend to do with extended partitions. Once you have the partitions straight you then restore /home someplace in your new partition scheme.

When you do the backup you should backup everything because there is a good change of screwing up your system when you set up your new partitions.

I recommend that you do your repartitioning from a liveCD. That way if you screw up the repartitioning you won't take the system down that you are working from.

--------------------
Steve Stites

jay73 10-14-2008 06:19 PM

Wouldn't it be more convenient to delete the swap partition, create the extended and re-create swap inside extended?

syg00 10-14-2008 06:20 PM

Depends on where the free space is located - could get a lot more complicated. Maybe not. Let's see the output from "sudo fdisk -l"

th3_tr00p3r 10-18-2008 03:03 PM

Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xc58437ed

Device Boot Start End Blocks Id System
/dev/sda1 * 1 15298 122881153+ 7 HPFS/NTFS
/dev/sda2 15299 38913 189687487+ 7 HPFS/NTFS

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00098f56

Device Boot Start End Blocks Id System
/dev/sdb1 1 4255 34178256 83 Linux
/dev/sdb2 4256 11550 58597087+ 83 Linux
/dev/sdb3 11551 11793 1951897+ 82 Linux swap / Solaris
/dev/sdb4 11794 26381 117178110 83 Linux

Disk /dev/sdc: 30.0 GB, 30005821440 bytes

255 heads, 63 sectors/track, 3648 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x20202020

Device Boot Start End Blocks Id System
/dev/sdc1 1 10 80293+ 0 Empty
/dev/sdc2 11 3648 29222235 b W95 FAT32



I looked in the fstab file, how would I need to edit it this to point the /home to a different location if I chose to do that?

Total-MAdMaN 10-18-2008 03:10 PM

Quote:

Originally Posted by th3_tr00p3r (Post 3314902)
I looked in the fstab file, how would I need to edit it this to point the /home to a different location if I chose to do that?

Change the first column of the line mentioning /home to reference the new /home partition.

syg00 10-18-2008 04:00 PM

Of course, Ubuntu uses UUID - that will change if a partition is re-formatted. Also applies to the swap if that is moved to a logical. Makes the fstab change(s) a little more "interesting".
You are fortunate that all the free space exists at the "end" of the disk - if it is sdb4 that can be (safely) deleted, then all the free space can be allocated as an extended partition. Logicals can then be created at will.

jay73 10-18-2008 06:35 PM

Quote:

You are fortunate that all the free space exists at the "end" of the disk
I'm afraid I don't see why that would matter. On modern hardware, an extended partition can be placed anywhere: before, int between or after any primary partitions.

syg00 10-18-2008 07:05 PM

True - but it can't span dis-contiguous extents. So if you have separate free space extents (interspersed between primaries), you can wind up in the same bind as the OP - free space that is unreachable.

jay73 10-18-2008 07:17 PM

Ah, OK, now I see what you mean. I never thought of that because with only 4 partitions, you can do pretty much anything, although some scenarios will involve quite a bit of shuffling around.


All times are GMT -5. The time now is 07:34 AM.