You are not logged in.

#1 2015-09-17 11:08:55

CaptainKirk
Member
Registered: 2009-06-07
Posts: 393

e2fsck Reports Errors

My file system seems often to be slow, so I wanted to check for fragmentation. e2fsck appears to report that there's almost no fragmentation, but it has a list of other errors which are not entirely clear to me. This is what I see:

[kirk@arch ~]$ sudo cat /etc/fstab
# 
# /etc/fstab: static file system information
#
# <file system>	<dir>	<type>	<options>	<dump>	<pass>
# UUID=6e433e45-f41a-423a-96fe-28e05d3b458f
/dev/sda2           	/         	ext4      	rw,relatime,data=ordered	0 1

# UUID=4e2ff47c-4c2c-4b33-929c-9364d317f39d
/dev/sda4           	/home     	ext4      	rw,relatime,data=ordered	0 2

# UUID=3db7ebaf-b1de-4711-ba04-326573f4f714
/dev/sda3           	/srv      	ext4      	rw,relatime,data=ordered	0 2

# UUID=89a7c749-1c9e-4563-a00e-121c6d5d3161
/dev/sda1           	/boot     	ext4      	rw,relatime,data=ordered	0 2

# Swap File:

/home/swapfile none swap defaults 0 0

[kirk@arch ~]$ sudo lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 465.8G  0 disk 
├─sda1   8:1    0 282.4M  0 part /boot
├─sda2   8:2    0  18.6G  0 part /
├─sda3   8:3    0  93.1G  0 part /srv
└─sda4   8:4    0 353.7G  0 part /home
sdb      8:16   0 931.5G  0 disk 
├─sdb1   8:17   0 282.4M  0 part 
├─sdb2   8:18   0  18.6G  0 part 
├─sdb3   8:19   0 205.2G  0 part 
├─sdb4   8:20   0     1K  0 part 
└─sdb5   8:21   0 210.9G  0 part 
[kirk@arch ~]$ sudo e2fsck -fn /dev/sda4
e2fsck 1.42.12 (29-Aug-2014)
Warning!  /dev/sda4 is mounted.
Warning: skipping journal recovery because doing a read-only filesystem check.
Pass 1: Checking inodes, blocks, and sizes
Deleted inode 22284144 has zero dtime.  Fix? no

Inodes that were part of a corrupted orphan linked list found.  Fix? no

Inode 22290837 was part of the orphaned inode list.  IGNORED.
Inode 22292987 was part of the orphaned inode list.  IGNORED.
Inode 22298629 was part of the orphaned inode list.  IGNORED.
Pass 2: Checking directory structure
Entry '67F66B967D992E3C091FA2413FF79C674B2D8A11' in /kirk/.cache/mozilla/firefox/lseubyst.default-1395521110423/cache2/entries (3805492) has deleted/unused inode 3815922.  Clear? no

Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Block bitmap differences:  +(5935463--5935607) -(6289955--6289957) -(8254570--8254572) -8708606 -(15340358--15340359) -(89208400--89208407)
Fix? no

Free blocks count wrong for group #181 (3381, counted=3526).
Fix? no

Free blocks count wrong for group #468 (39, counted=36).
Fix? no

Free blocks count wrong (15186593, counted=15174401).
Fix? no

Inode bitmap differences:  +14 -11788 -3815922 -3815924 -22284144 -22290837 -22292987 -22298629
Fix? no

Free inodes count wrong for group #0 (0, counted=1).
Fix? no

Free inodes count wrong for group #1 (4597, counted=4596).
Fix? no

Free inodes count wrong for group #465 (107, counted=105).
Fix? no

Free inodes count wrong (22718503, counted=22715003).
Fix? no


/dev/sda4: ********** WARNING: Filesystem still has errors **********

/dev/sda4: 464857/23183360 files (0.7% non-contiguous), 77539216/92725809 blocks
[kirk@arch ~]$ sudo e2fsck -fn /dev/sda2
e2fsck 1.42.12 (29-Aug-2014)
Warning!  /dev/sda2 is mounted.
Warning: skipping journal recovery because doing a read-only filesystem check.
Pass 1: Checking inodes, blocks, and sizes
Inodes that were part of a corrupted orphan linked list found.  Fix? no

Inode 261229 was part of the orphaned inode list.  IGNORED.
Inode 261696 was part of the orphaned inode list.  IGNORED.
Deleted inode 262775 has zero dtime.  Fix? no

Inode 264682 was part of the orphaned inode list.  IGNORED.
Inode 275597 is in use, but has dtime set.  Fix? no

Inode 275597, i_blocks is 276305238049761, should be 0.  Fix? no

Inode 391012 was part of the orphaned inode list.  IGNORED.
Inode 391391 was part of the orphaned inode list.  IGNORED.
Inode 391394 was part of the orphaned inode list.  IGNORED.
Inode 391395 was part of the orphaned inode list.  IGNORED.
Inode 440691 was part of the orphaned inode list.  IGNORED.
Inode 474022 was part of the orphaned inode list.  IGNORED.
Inode 1043234 was part of the orphaned inode list.  IGNORED.
Inode 1044458 was part of the orphaned inode list.  IGNORED.
Inode 1047176 was part of the orphaned inode list.  IGNORED.
Inode 1048443 was part of the orphaned inode list.  IGNORED.
Inode 1050215 was part of the orphaned inode list.  IGNORED.
Inode 1060862 was part of the orphaned inode list.  IGNORED.
Inode 1061427 was part of the orphaned inode list.  IGNORED.
Inode 1069590 was part of the orphaned inode list.  IGNORED.
Inode 1071641 was part of the orphaned inode list.  IGNORED.
Inode 1076680 was part of the orphaned inode list.  IGNORED.
Inode 1116765 was part of the orphaned inode list.  IGNORED.
Inode 1126533 was part of the orphaned inode list.  IGNORED.
Inode 1126534 was part of the orphaned inode list.  IGNORED.
Pass 2: Checking directory structure
Inode 275597 (/var/lib/pacman/oldsync/extra.db) is an illegal character device.
Clear? no

i_file_acl_hi for inode 275597 (/var/lib/pacman/oldsync/extra.db) is 52285, should be zero.
Clear? no

Entry 'extra.db' in /var/lib/pacman/oldsync (267476) has an incorrect filetype (was 1, should be 0).
Fix? no

Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Inode 275597 ref count is 21392, should be 1.  Fix? no

Pass 5: Checking group summary information
Block bitmap differences:  -(239819--240125) -(335815--335913) -(395116--395309) -(398173--398297) -(1247807--1247815) -(1486422--1486841) -(1613336--1613341) -(1773116--1773159) -(1775407--1775476) -(1855550--1855583) -(1860816--1860824) -(1875966--1876662) -(3309555--3309561) -(4014307--4014531) -(4233526--4233527) -(4295398--4295403) -(4491968--4491981) -(4524632--4524650) -(4604323--4604368) -(4704561--4704633) -(4743283--4743353) -(4829226--4829334)
Fix? no

Free blocks count wrong (1175432, counted=1123847).
Fix? no

Inode bitmap differences:  -261229 -261696 -262775 -264682 -391012 -391391 -(391394--391395) -440691 -474022 -1043234 -1044458 -1047176 -1048443 -1050215 -1060862 -1061427 -1069590 -1071641 -1076680 -1116765 -(1126533--1126534)
Fix? no

Free inodes count wrong (888752, counted=888276).
Fix? no


/dev/sda2: ********** WARNING: Filesystem still has errors **********

/dev/sda2: 332848/1221600 files (0.8% non-contiguous), 3708328/4883760 blocks
[kirk@arch ~]$ 

Here is the disk usage:

[kirk@arch ~]$ df -ah
Filesystem      Size  Used Avail Use% Mounted on
proc               0     0     0    - /proc
sys                0     0     0    - /sys
dev             1.9G     0  1.9G   0% /dev
run             1.9G  1.1M  1.9G   1% /run
/dev/sda2        19G   14G  3.4G  81% /
securityfs         0     0     0    - /sys/kernel/security
tmpfs           1.9G   20M  1.9G   2% /dev/shm
devpts             0     0     0    - /dev/pts
tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup
cgroup             0     0     0    - /sys/fs/cgroup/systemd
pstore             0     0     0    - /sys/fs/pstore
cgroup             0     0     0    - /sys/fs/cgroup/cpuset
cgroup             0     0     0    - /sys/fs/cgroup/freezer
cgroup             0     0     0    - /sys/fs/cgroup/cpu,cpuacct
cgroup             0     0     0    - /sys/fs/cgroup/net_cls
cgroup             0     0     0    - /sys/fs/cgroup/blkio
cgroup             0     0     0    - /sys/fs/cgroup/devices
cgroup             0     0     0    - /sys/fs/cgroup/memory
systemd-1          -     -     -    - /proc/sys/fs/binfmt_misc
mqueue             0     0     0    - /dev/mqueue
hugetlbfs          0     0     0    - /dev/hugepages
debugfs            0     0     0    - /sys/kernel/debug
tmpfs           1.9G  140K  1.9G   1% /tmp
binfmt_misc        0     0     0    - /proc/sys/fs/binfmt_misc
configfs           0     0     0    - /sys/kernel/config
/dev/sda1       266M   37M  211M  15% /boot
/dev/sda4       349G  291G   41G  88% /home
/dev/sda3        92G   23G   65G  26% /srv
tmpfs           382M   24K  382M   1% /run/user/1000
fusectl            0     0     0    - /sys/fs/fuse/connections
gvfsd-fuse         0     0     0    - /run/user/1000/gvfs
[kirk@arch ~]$ cat /proc/swaps
Filename				Type		Size	Used	Priority
/home/swapfile                          file		1048572	87692	-1

Two questions:

1. Do I need to lower my disk space usage? Does Linux need more free space than that? (I think I am OK, but I prefer a second opinion)
2. Should I run fsck on boot? And is that generally safe?

Thank you.

Offline

#2 2015-09-17 12:45:57

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: e2fsck Reports Errors

You ran fsck on a mounted system. That could have destroyed the filesystem. You are supposed to unmount the filesystem first. Normally you have the init system fsck before it is mounted at boot. Or you boot from a live image and fsck without mounting.

I think the -n option made it readonly so nothing was actually lost and only errors were reported. Run fsck with the partition unmounted and see if the errors persist.


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#3 2015-09-17 14:22:54

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: e2fsck Reports Errors

CaptainKirk wrote:

1. Do I need to lower my disk space usage? Does Linux need more free space than that? (I think I am OK, but I prefer a second opinion)

Linux doesn't necessarily need any free space, but if your root fs gets 100% full you would notice some issues, e.g. log files couldn't be written etc.
With ext2/3/4, 5% of your disk space will be reserved by default to keep your system running in case the filesystem gets full, and maybe to prevent fragmentation by some degree.

In theory, half-empty filesystem would probably be faster than half-full though, due to less seek times and fragmentation.

CaptainKirk wrote:

2. Should I run fsck on boot? And is that generally safe?

By default ext* filesystems should get fscked every 30 mounts, or after some period of time has passed since last fsck.
fsck should happen during boot before mounting the filesystem, so yes that should definitely be safe.

Last edited by ooo (2015-09-17 14:31:43)

Offline

Board footer

Powered by FluxBB