You are not logged in.

#1 2014-12-07 07:26:40

victl
Member
Registered: 2014-12-07
Posts: 25

[SOLVED]After doing 'resize2fs',free space of all filesystem become 0!

Here is the output of command 'df':

Filesystem     1K-blocks     Used Available Use% Mounted on
/dev/sda1       20511356 19752988         0 100% /
dev              3983420        0   3983420   0% /dev
run              3986136      704   3985432   1% /run
tmpfs            3986136        0   3986136   0% /dev/shm
tmpfs            3986136        0   3986136   0% /sys/fs/cgroup
tmpfs            3986136        0   3986136   0% /var/tmp
tmpfs            6291456        8   6291448   1% /tmp
/dev/sda2       88283240 83859216         0 100% /home
tmpfs             797228        0    797228   0% /run/user/0
tmpfs             797228        0    797228   0% /run/user/1000

As you can see, the two major partitions / and /home( that is /dev/sda1 and /dev/sda2) are not full, but their 'Available' space is 0, and 'Use%' is 100%!
How could this to happen?
I have just used the 'resize2fs -pM' to shrink the /home, and make some space for an additional /user partition. What happened is just shown above, that's weird.
These partitions are absolutely writable, I can delete files/directories and 'touch files', but cannot write a single bit into them. Here is the /etc/fstab:

#
# /etc/fstab: static file system information
#
# <file system> <dir>   <type>  <options>       <dump>  <pass>
# /dev/sda1
UUID=397e83b2-9f37-4b41-8f82-fe21b97e7f74       /               ext4            rw,relatime,data=ordered     0 1

# /dev/sda2
UUID=7fb4c1ea-2df1-4c1d-984b-bb6ad0e39978       /home           ext4            rw,relatime,data=ordered     0 2

# /dev/sda3
UUID=4fb831a4-c9b6-48a6-915c-82fb2a00e3e7       none            swap            defaults     0 0

# tmpfs
tmpfs          /tmp             tmpfs              defaults,mode=1777,size=6G           0  0
tmpfs          /var/tmp             tmpfs              defaults,mode=1777           0  0
# /dev/sda1
UUID=397e83b2-9f37-4b41-8f82-fe21b97e7f74       /               ext4            rw,relatime,data=ordered     0 1

# /dev/sda2
UUID=7fb4c1ea-2df1-4c1d-984b-bb6ad0e39978       /home           ext4            rw,relatime,data=ordered     0 2

Last edited by victl (2014-12-07 16:55:31)

Offline

#2 2014-12-07 07:31:19

victl
Member
Registered: 2014-12-07
Posts: 25

Re: [SOLVED]After doing 'resize2fs',free space of all filesystem become 0!

Oh, there is another point I forgot to mention: In fact, I can "write" into the filesystem, by installing something using yaourt, the system accept my command very well, and indeed succeed in installing.

Offline

#3 2014-12-07 10:17:16

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: [SOLVED]After doing 'resize2fs',free space of all filesystem become 0!

Please insert a few [code ] tags; this is pretty unreadable. Do you have enough inodes left? Have a look at `df -i`.

Last edited by Spider.007 (2014-12-07 10:17:35)

Offline

#4 2014-12-07 15:37:33

victl
Member
Registered: 2014-12-07
Posts: 25

Re: [SOLVED]After doing 'resize2fs',free space of all filesystem become 0!

Spider.007 wrote:

Please insert a few [code ] tags; this is pretty unreadable. Do you have enough inodes left? Have a look at `df -i`.

I nodes is sufficient. The whole thing happens right after I executed the command 'resize2fs -pM /dev/sda2'. Thank you for replying

Offline

#5 2014-12-07 15:43:05

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [SOLVED]After doing 'resize2fs',free space of all filesystem become 0!

From the ext4 ArchWiki page:

By default 5% of a filesystem will be flagged as reserved for root user to avoid fragmentation.

https://wiki.archlinux.org/index.php/ex … ved_blocks

Your filesystem is 96.3% full -- I think the rest of the space is occupied by the reserved blocks.

Offline

#6 2014-12-07 15:57:08

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: [SOLVED]After doing 'resize2fs',free space of all filesystem become 0!

offtopic:

https://wiki.archlinux.org/index.php/Tmpfs wrote:

Some directories where tmpfs is commonly used are /tmp, /var/lock and /var/run. Do not use it on /var/tmp, because that folder is meant for temporary files that are preserved across reboots.

Also; your fstab contains 2 mounts that are specified twice, if that's not a copy/paste error I'd correct that too

Last edited by Spider.007 (2014-12-07 15:58:02)

Offline

#7 2014-12-07 15:58:06

TE
Member
Registered: 2014-06-21
Posts: 78

Re: [SOLVED]After doing 'resize2fs',free space of all filesystem become 0!

Correct - it's reserved space. Use tune2fs to adjust the reserved percentage (the '-m X' flag). Be aware that on a really full drive the reserved space is used to facilitate the concept of keeping write blocks together (think of it as scratch space), once you get above 95% and you kill the reserved blocks then your writes will fragment more since there's no scratch space for it to use.

Offline

#8 2014-12-07 16:00:39

victl
Member
Registered: 2014-12-07
Posts: 25

Re: [SOLVED]After doing 'resize2fs',free space of all filesystem become 0!

Head_on_a_Stick wrote:

From the ext4 ArchWiki page:

By default 5% of a filesystem will be flagged as reserved for root user to avoid fragmentation.

https://wiki.archlinux.org/index.php/ex … ved_blocks

Your filesystem is 96.3% full -- I think the rest of the space is occupied by the reserved blocks.

But I can still install new packages into the partition( which means it's writable). What I can't do is direct write into it(e.g.  Using vi)
Thant you for helping!

Offline

#9 2014-12-07 16:04:06

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: [SOLVED]After doing 'resize2fs',free space of all filesystem become 0!

victl wrote:
Head_on_a_Stick wrote:

From the ext4 ArchWiki page:

By default 5% of a filesystem will be flagged as reserved for root user to avoid fragmentation.

https://wiki.archlinux.org/index.php/ex … ved_blocks

Your filesystem is 96.3% full -- I think the rest of the space is occupied by the reserved blocks.

But I can still install new packages into the partition( which means it's writable). What I can't do is direct write into it(e.g.  Using vi)
Thant you for helping!

So... what? You run pacman as root which means it has extra privileges. You probably run vi as a user that doesn't have that privilege..

Offline

#10 2014-12-07 16:58:25

victl
Member
Registered: 2014-12-07
Posts: 25

Re: [SOLVED]After doing 'resize2fs',free space of all filesystem become 0!

Thank you all guys! Just as you said, it's that 5% reserved storage that caused the issue.

But unfortunately, I've made a even worse mistake, maybe I'll state it in another post

Offline

Board footer

Powered by FluxBB