LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Help required to re-partition drives (https://www.linuxquestions.org/questions/linux-newbie-8/help-required-to-re-partition-drives-929260/)

Cinnamint 02-14-2012 05:35 AM

Help required to re-partition drives
 
Greetings,

I re-did my machine a little while ago, first putting Fedora 16 on, and then Mint 12. It's a 150gb hdd. For Fedora I partitioned during setup myself, as previously I'd used default settings and ended up with LVM. I messed up somehow and allocated 50gb to root, only 2gb to home (2gb swap which is fine). I let Mint install using its default options.

I need more space for fedora's home partition and 50gb is too much for fedora file system, so I would to re-allocate that space to fedora's home. First step was to shrink the file system partition, which I did fine in gparted, down to 20gb. But now I'm stuck with unallocated space that I can't seem to re-allocate anywhere useful :(

From lsblk I get the following:

NAME MAJ:MIN RM SIZE RO MOUNTPOINT
sda 8:0 0 149.1G 0
├─sda1 8:1 0 500M 0
├─sda2 8:2 0 19.5G 0
├─sda3 8:3 0 2G 0
├─sda4 8:4 0 1K 0
├─sda5 8:5 0 2G 0
├─sda6 8:6 0 93.7G 0 /
└─sda7 8:7 0 1011M 0 [SWAP]

From gparted (I've got a screenshot but don't see anywhere to upload it?) the info is:
sda1 - ext4 500mb (boot)
sda2 - ext4 - 19.5gb (fedora root)
unallocated -30gb
sda3 - swap - 2gb (fedora swap)
sda4 - extended
- sda5 - ext4 - 2gb (fedora home)
- sda6 - ext4 - 94gb (I'm guessing mint home+root)
- sda7 - swap - 1gb (mint swap?)

(not sure if it's clear above, but sda5, 6 and 7 are all on sda4? I don't know how that happened)

Is there any way for me to get that unallocated space usable? Without re-installing everything, that is :/ Only thing I seem to be able to do with it is make the fedora root 50gb as it was.

Help appreciated!

syg00 02-14-2012 06:03 AM

Let's see the output of (as root) "fdisk -l" (lower case ell).
gparted should allow you to move things around, but let's see where things are actually (physically) located before offering advice "from the hip".

Cinnamint 02-14-2012 10:27 AM

fdisk -l gives us:
Code:

Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000686f2

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *        2048    1026047      512000  83  Linux
/dev/sda2        1026048    41986047    20480000  83  Linux
/dev/sda3      105883648  110012415    2064384  82  Linux swap / Solaris
/dev/sda4      110014462  312580095  101282817    5  Extended
/dev/sda5      110014464  114110463    2048000  83  Linux
/dev/sda6      114112512  310507519    98197504  83  Linux
/dev/sda7      310509568  312580095    1035264  82  Linux swap / Solaris

Disk /dev/sdb: 2000.4 GB, 2000398843904 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907028992 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x4f3e4998

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1  *          64  3907024064  1953512000+  7  HPFS/NTFS/exFAT


EDDY1 02-14-2012 12:31 PM

Using gparted-live move sda3 to the left, then resize or move sda4 to the left also.

syg00 02-14-2012 03:44 PM

Adding a little detail.
The "extended" partition (sda4) is a container for logical partitions (sda5/6/7 etc). As it adds flexibility, it generally makes sense to add extra/free space to it. To enlarge any partition, the free space must be contiguous (next to) the partition being enlarged. So there may be a need to move other partitions first (think sliding block game).
Given you want to enlarge the /home, do as suggested, but make sure you enlarge sda4 by moving the left-hand boundary left. This will "move" the free space next to sda5 which can then be enlarged. Do this one operation at a time so you can see what happens - use the "Apply" button each time.

Cinnamint 02-15-2012 06:13 AM

Thank you kindly, will attempt moving later when I get home.

Cinnamint 02-16-2012 04:33 AM

Thank you for your help, the moving as described worked perfectly.


All times are GMT -5. The time now is 02:36 AM.