Apologies for this question but I am very new to Linux. When I installed my Fedora distribution I only allocated 20GB of my hard drive space for its partition. I recently used GParted and tried to increase the size of the partition to around 40GB. I was under the impression that I was successful but today I tried to create a directory and I got the following error message:

mkdir: cannot create directory ‘b_scripts’: No space left on device

I checked the space on my disk and found out that I had used 20GB on my fedora-root.

derrick@dazza >> df -h 
Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                 1.9G     0  1.9G   0% /dev
tmpfs                    1.9G  253M  1.7G  14% /dev/shm
tmpfs                    1.9G  1.5M  1.9G   1% /run
tmpfs                    1.9G     0  1.9G   0% /sys/fs/cgroup
/dev/mapper/fedora-root   20G   19G     0 100% /
tmpfs                    1.9G  128K  1.9G   1% /tmp
tmpfs                    386M   20K  386M   1% /run/user/42
tmpfs                    386M   28K  386M   1% /run/user/1000

Is a partition different from a Filesystem? How come there are only 20GB in total allocated to my fedora-root? What is my solution? How do I increase the size of my fedora-root Filesystem so that it is more than 20GB Size?

  • Could you exchange the df -h output with the one of df -hT. Also add the output of lvdisplay, cat /etc/crypttab and parted -l.
    – Thomas
    Jul 30 '17 at 18:29

In this case, your file system is on the LV(Logical Volumne), which is on the partition. If you expand the partition, your LV will not be expanded.

Please run these commands :

pvresize <device name> <-- This will let the Physical Volume know that the partition it is on has been expanded.

And :

lvextend -l +100%FREE /dev/mapper/fedora-root <Physical Volume name> <-- This will extend the LV.

resize2fs /dev/mapper/fedora-root

PS: You can find the Physical Volume name using the command pvs

Thank you @Dani_l for the edit suggestions.

  • 2
    Better to use lvextend -l +100%FREE and you forgot resize2fs at the end (or the xfs or btrfs or ... equivalent. need output of mount to know which fs is used).
    – Dani_l
    Jul 30 '17 at 19:47
  • I have carried out the steps and at the lvextend command gave me this result which indicates that it worked. Size of logical volume fedora/root changed from 19.53 GiB (5000 extents) to 46.97 GiB (12025 extents). However at the resize2fs I get resize2fs 1.43.3 (04-Sep-2016) Usage: resize2fs [-d debug_flags] [-f] [-F] [-M] [-P] [-p] device [-b|-s|new_size] [-z undo_file] which means I'm missing some options but I'm not sure which since I'm not too familiar with the language for example device Jul 30 '17 at 21:30
  • Can you show me the output of df -Th , if it worked, mark it as correct. Jul 30 '17 at 21:31
  • devtmpfs devtmpfs 1.9G 0 1.9G 0% /dev tmpfs tmpfs 1.9G 96M 1.8G 5% /dev/shm tmpfs tmpfs 1.9G 1.5M 1.9G 1% /run tmpfs tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup /dev/mapper/fedora-root ext4 20G 19G 0 100% / tmpfs tmpfs 1.9G 128K 1.9G 1% /tmp tmpfs tmpfs 386M 20K 386M 1% /run/user/42 tmpfs tmpfs 386M 28K 386M 1% /run/user/1000 I suspect the last command didn't work. Jul 30 '17 at 21:35
  • 1
    Run resize2fs /dev/mapper/fedora-root Jul 30 '17 at 21:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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