0

Fedora 25

Hey guys,

I've just cloned my 120gb SSD to a 240gb SSD, and would like to extend my root partition.

It seems this isn't as easy as I was hoping and could use some assistance!

fdisk -l

Disk /dev/sda: 223.6 GiB, 240057409536 bytes, 468862128 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
Disklabel type: dos
Disk identifier: 0xd09196e4

Device     Boot     Start       End   Sectors  Size Id Type
/dev/sda1  *         2048   2099199   2097152    1G 83 Linux
/dev/sda2         2099200  18636799  16537600  7.9G 82 Linux swap / Solaris
/dev/sda3        18636800 123494399 104857600   50G 83 Linux
/dev/sda4       123494400 250068991 126574592 60.4G  5 Extended
/dev/sda5       123496448 250068991 126572544 60.4G 83 Linux

(parted) print

Model: ATA KINGSTON SA400S3 (scsi)
Disk /dev/sda: 240GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type      File system     Flags
 1      1049kB  1075MB  1074MB  primary   ext4            boot
 2      1075MB  9542MB  8467MB  primary   linux-swap(v1)
 3      9542MB  63.2GB  53.7GB  primary   xfs
 4      63.2GB  128GB   64.8GB  extended
 5      63.2GB  128GB   64.8GB  logical   xfs

df -h

Filesystem                  Size  Used Avail Use% Mounted on
devtmpfs                    7.9G     0  7.9G   0% /dev
tmpfs                        12G   16K   12G   1% /dev/shm
tmpfs                       7.9G  1.1M  7.9G   1% /run
tmpfs                       7.9G     0  7.9G   0% /sys/fs/cgroup
/dev/sda3                    50G   12G   39G  24% /
/dev/sda1                   976M   85M  825M  10% /boot
/dev/sda5                    61G  408M   60G   1% /home

I've tried xfs_growfs but nothing changes, gparted (live usb boot) doesn't allow me to change the size. I know I have 4 active partitions, but unsure how to get past this limitation (is it a limitation?)

I tried following https://askubuntu.com/questions/492054/how-to-extend-my-root-partition with no success as well.

I'm sure I'm doing something stupid, but I can't see it.

Any help would be much appreciated!

New contributor
Alex L is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
1

Let's start with the obvious fact that Fedora 25 is EOL.

It looks like you cannot grow sda3 because there's no free space contiguous to that partition (marks are mine):

/dev/sda3        18636800 *123494399* 104857600   50G 83 Linux
/dev/sda4       *123494400* 250068991 126574592 60.4G  5 Extended

It also looks like you are not using sda4 for anything at all (from the output of df). If this is the case (and note that if you actually use it but it wasn't mounted when you run df I can't know it), you can:

  1. take a complete backup of the system
  2. delete sda4
  3. after that, you can delete the sda3 partition. This step sounds scary, but you are only deleting the partition definition
  4. re-create sda3 using its original start (18636800) and use sda4's end (250068991)
  5. save the changes
  6. grow the filesystem

That said, depending on the complexity of the installation with regards to installed software, and assuming this is a desktop installation, I would instead recommend the following actions to avoid further problems down the line:

  1. generate a manifest of the packages currently installed for future reference
  2. generate a backup of your /home partition and/or interesting or customised configuration files (configuration management systems can help reproduce custom setups)
  3. install a fresh Fedora 29, there are too many bugfixes and improvements to ignore compared to a very old and EOLed Fedora 25
  4. when installing, partition your new disk using GPT
  5. take advantage of LVM2 for the rest of the disk, you can keep /boot in a separate partition. Using logical volumes completely avoids the problem you are having now.
  6. check the list of packages from #1 and reinstall anything you need (using current versions)
  7. restore your /home (pay attention to permissions and SELinux labels when doing so)
  8. test the system

It's worth the effort.

Your Answer

Alex L is a new contributor. Be nice, and check out our Code of Conduct.

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.