You are not logged in.

#1 2020-05-11 13:04:53

Feature
Member
Registered: 2019-08-29
Posts: 14

[SOLVED] Different partition sizes by 'df' and 'fdisk', No space left

My storage ran out. I had two partitions of Arch. Using cfdisk. I removed one of them and extended current to maximal size. Now cfdisk and fdisk -l tell me that I have a much space left, but eventually I catch errors "No space left on device" and df -h tells it's really no space left. New partition 67G I made recently, it doesn't affect anything
df -h:

Filesystem      Size  Used Avail Use% Mounted on
dev             3.9G     0  3.9G   0% /dev
run             3.9G  1.1M  3.9G   1% /run
/dev/sda2        85G   73G  7.7G  91% /
tmpfs           3.9G   97M  3.8G   3% /dev/shm
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
tmpfs           4.0G  6.8M  4.0G   1% /tmp
tmpfs           788M   36K  788M   1% /run/user/1000

df -hi:

Filesystem     Inodes IUsed IFree IUse% Mounted on
dev              983K   468  982K    1% /dev
run              985K   765  985K    1% /run
/dev/sda2        5.5M  598K  4.9M   11% /
tmpfs            985K   125  985K    1% /dev/shm
tmpfs            985K    18  985K    1% /sys/fs/cgroup
tmpfs            985K    25  985K    1% /tmp
tmpfs            985K    51  985K    1% /run/user/1000

fdisk -l:

Disk /dev/sda: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Hitachi HTS54505
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: 0x097093b2

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1  *       104448 210029362 209924915 100.1G  7 HPFS/NTFS/exFAT
/dev/sda2       350472192 976773167 626300976 298.7G 83 Linux

cfdisk:

                                                                    Disk: /dev/sda
                                                Size: 465.78 GiB, 500107862016 bytes, 976773168 sectors
                                                          Label: dos, identifier: 0x097093b2

    Device               Boot                         Start                 End            Sectors            Size          Id Type
    Free space                                         2048              104447             102400             50M
    /dev/sda1            *                           104448           210029362          209924915          100.1G           7 HPFS/NTFS/exFAT
    Free space                                    210030592           350472191          140441600             67G
>>  /dev/sda2                                     350472192           976773167          626300976          298.7G          83 Linux                   

Last edited by Feature (2020-05-11 14:05:54)

Offline

#2 2020-05-11 13:17:00

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,048

Re: [SOLVED] Different partition sizes by 'df' and 'fdisk', No space left

"Free space" in cfdisk is space on the disk that's not occupied by any partition.
"Avail" in df is space that the filesystem allows you to address on the partition.

I assume you wanted to grow the sda2 partition by those 67GB (which are *NOT* allocated by any partition right now!)
That's gonna be tricky and essentiall require you to backup the data on sda2, repartition the disk, create a new filesystem and restore the backup onto the bigger disk.
Growing the partition to the other side is much simpler but not an option here.

Alternatively you could just make a new partition for those 67GB and move the OS there (then make sda2 /home and mount into the new root partition because /home is likely what consumes most of the disk)

Offline

#3 2020-05-11 13:17:07

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: [SOLVED] Different partition sizes by 'df' and 'fdisk', No space left

How did you extend /dev/sda2? I suspect that the partition has the right size, but the filesystem doesn't know about it.

In addition and for science, post lsblk.

EDIT: seth, check the numbers again, something doesn't add up here, no matter the free space.

Last edited by Awebb (2020-05-11 13:18:34)

Offline

#4 2020-05-11 13:22:34

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,048

Re: [SOLVED] Different partition sizes by 'df' and 'fdisk', No space left

Ah, sda2 is only at 85GB - well in that case it's gonna be easy indeed.

Offline

#5 2020-05-11 13:38:26

Feature
Member
Registered: 2019-08-29
Posts: 14

Re: [SOLVED] Different partition sizes by 'df' and 'fdisk', No space left

seth wrote:

"Free space" in cfdisk is space on the disk that's not occupied by any partition.
"Avail" in df is space that the filesystem allows you to address on the partition.

I assume you wanted to grow the sda2 partition by those 67GB (which are *NOT* allocated by any partition right now!)
That's gonna be tricky and essentiall require you to backup the data on sda2, repartition the disk, create a new filesystem and restore the backup onto the bigger disk.
Growing the partition to the other side is much simpler but not an option here.

Alternatively you could just make a new partition for those 67GB and move the OS there (then make sda2 /home and mount into the new root partition because /home is likely what consumes most of the disk)

You can not mention 67G free space, I've made it after I had troubles with /dev/sda2

Offline

#6 2020-05-11 13:40:47

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,048

Re: [SOLVED] Different partition sizes by 'df' and 'fdisk', No space left

Well, *you* mentioned it ;-)

It's actually what threw me off, but I've already conceded that the problem is just that you forgot to resize the FS:
https://wiki.archlinux.org/index.php/Pa … partitions

Offline

#7 2020-05-11 13:47:55

Feature
Member
Registered: 2019-08-29
Posts: 14

Re: [SOLVED] Different partition sizes by 'df' and 'fdisk', No space left

Awebb wrote:

How did you extend /dev/sda2? I suspect that the partition has the right size, but the filesystem doesn't know about it.

In addition and for science, post lsblk.

EDIT: seth, check the numbers again, something doesn't add up here, no matter the free space.

I used cfdisk to extend /dev/sda2. If I remember right, a while ago a partition structure was

/dev/sda1    167G   HPFS/NTFS/exFAT
/dev/sda2   ~215G   Linux
/dev/sda3    85G    Linux(current /dev/sda2)

So using cfdisk I freed that ^ /dev/sda2 that was before my current partition. Then I extended them. It's risky, but before I had no troubles with such operation


lsblk

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 465.8G  0 disk 
├─sda1   8:1    0 100.1G  0 part 
└─sda2   8:2    0 298.7G  0 part /
sr0     11:0    1  1024M  0 rom  

Offline

#8 2020-05-11 13:59:40

Feature
Member
Registered: 2019-08-29
Posts: 14

Re: [SOLVED] Different partition sizes by 'df' and 'fdisk', No space left

seth wrote:

Well, *you* mentioned it ;-)

It's actually what threw me off, but I've already conceded that the problem is just that you forgot to resize the FS:
https://wiki.archlinux.org/index.php/Pa … partitions

I thought cfdisk should be performed this operation.
Probably, you're right. I think it's not safe to resize fs partition when it's your operation one. I did it via resize2fs and df -h now shows I have 197G avail. I try to populate data to ensure it works. Report in next post whether it working or not

Offline

#9 2020-05-11 14:03:10

Feature
Member
Registered: 2019-08-29
Posts: 14

Re: [SOLVED] Different partition sizes by 'df' and 'fdisk', No space left

Yes, it works. Thank you Awebb. Thank you Seth. I mark it as solved. I really thought cfdisk will do all the work

Offline

#10 2020-05-11 14:11:07

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: [SOLVED] Different partition sizes by 'df' and 'fdisk', No space left

I used to teach some sort of an "IT for dummies" class.

HDD = backyard
partition = trash can
file system = trash can liner

They then spent the rest of the evening debating what the data equivalent of a raccoon might be.

Offline

#11 2020-05-11 14:13:25

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,048

Re: [SOLVED] Different partition sizes by 'df' and 'fdisk', No space left

Bleach bit.

Offline

Board footer

Powered by FluxBB