Yesterday 'emerge -uvDN world' failed due to write failure to /usr/portage. 'df -i' and fsstat showed, that there are no free inodes: root@lynx:/usr/portage_lynx(31)# fsstat /dev/mapper/vg-portage | head FILE SYSTEM INFORMATION -------------------------------------------- File System Type: Ext2 Volume Name: Volume ID: fda13279ed481d90c44d78198bc86f5e Last Written at: 2015-11-13 08:10:31 (CET) Last Checked at: 2015-11-12 21:01:35 (CET) Last Mounted at: 2015-09-01 09:24:54 (CEST) root@lynx:/usr/portage_lynx(32)# fsstat /dev/mapper/vg-portage | head -n 37 FILE SYSTEM INFORMATION -------------------------------------------- File System Type: Ext2 Volume Name: Volume ID: fda13279ed481d90c44d78198bc86f5e Last Written at: 2015-11-13 08:10:31 (CET) Last Checked at: 2015-11-12 21:01:35 (CET) Last Mounted at: 2015-09-01 09:24:54 (CEST) Unmounted Improperly Last mounted on: /mnt/gentoo_new/usr/portage_lynx Source OS: Linux Dynamic Structure Compat Features: Ext Attributes, Resize Inode, Dir Index InCompat Features: Filetype, Read Only Compat Features: Sparse Super, Large File, METADATA INFORMATION -------------------------------------------- Inode Range: 1 - 200705 Root Directory: 2 Free Inodes: 0 CONTENT INFORMATION -------------------------------------------- Block Range: 0 - 2097151 Block Size: 1024 Reserved Blocks Before Block Groups: 1 Free Blocks: 1551029 BLOCK GROUP INFORMATION -------------------------------------------- Number of Block Groups: 256 Inodes per group: 784 Blocks per group: 8192 It seem that yesterday about 6000 files are written to /usr/portage/metadata/md5-cache/sec-policy and to /usr/portage/metadata/md5-cache/python root@lynx:/usr/portage_lynx(39)# echo 'echo $(ls -a "$1" | wc -l) $1' > /tmp/count_em_$$ root@lynx:/usr/portage_lynx(40)# chmod 700 /tmp/count_em_$$ root@lynx:/usr/portage_lynx(41)# find . -mount -type d -print0 | xargs -0 -n1 /tmp/count_em_$$ | sort -n | tail -n4 1888 ./metadata/md5-cache/dev-perl 2155 ./metadata/glsa 2772 ./metadata/md5-cache/dev-python 3259 ./metadata/md5-cache/sec-policy root@lynx:/usr/portage_lynx(52)# ll -t metadata/md5-cache/sec-policy | head -3 total 3257 -rw-r--r-- 1 root root 737 Nov 11 04:55 selinux-xscreensaver-9999 -rw-r--r-- 1 root root 874 Nov 11 04:55 selinux-xserver-2.20140311-r5 root@lynx:/usr/portage_lynx(53)# ll -t metadata/md5-cache/sec-policy | tail -3 -rw-r--r-- 1 root root 924 Nov 11 04:53 selinux-accountsd-2.20141203-r7 -rw-r--r-- 1 root root 924 Nov 11 04:53 selinux-accountsd-2.20141203-r8 -rw-r--r-- 1 root root 926 Nov 11 04:53 selinux-accountsd-2.20141203-r9 root@lynx:/usr/portage_lynx(54)# ll -t metadata/md5-cache/dev-python/ | head -3 total 8810 -rw-r--r-- 1 root root 2531 Nov 12 12:39 unidecode-0.04.18 -rw-r--r-- 1 root root 3563 Nov 12 12:39 xlwt-1.0.0 root@lynx:/usr/portage_lynx(57)# ll -t metadata/md5-cache/dev-python/ | tail -40 | head -n 4 -rw-r--r-- 1 root root 444 Nov 11 04:40 cheetah-docs-0.9.16_alpha1 -rw-r--r-- 1 root root 748 Nov 11 03:08 SchemaObject-0.5.3 -rw-r--r-- 1 root root 729 Oct 13 04:42 winpdb-1.4.8 -rw-r--r-- 1 root root 600 Oct 13 04:42 webpy-0.37 Is this large number of files to be expected? I do not have any selinux package installed. Can I delete the files under /usr/portage/metadata/md5-cache/sec-policy? root@lynx:/usr/portage_lynx(60)# df -T /usr/portage Filesystem Type 1K-blocks Used Available Use% Mounted on /dev/mapper/vg-portage ext2 2046355 495326 1446172 26% /usr/portage_lynx root@lynx:/usr/portage_lynx(61)# df -i /usr/portage Filesystem Inodes IUsed IFree IUse% Mounted on /dev/mapper/vg-portage 200704 200704 0 100% /usr/portage_lynx Should I reformat my filesystem?
(In reply to Juergen Rose from comment #0) > Is this large number of files to be expected? Yes, it's perfectly normal. > I do not have any selinux > package installed. Can I delete the files under > /usr/portage/metadata/md5-cache/sec-policy? Yes, but that some things (like emerge --searchdesc) will trigger metadata generation in /var/cache/edb/deb unless you also delete /usr/portage/sec-policy. > root@lynx:/usr/portage_lynx(60)# df -T /usr/portage > Filesystem Type 1K-blocks Used Available Use% Mounted on > /dev/mapper/vg-portage ext2 2046355 495326 1446172 26% /usr/portage_lynx > root@lynx:/usr/portage_lynx(61)# df -i /usr/portage > Filesystem Inodes IUsed IFree IUse% Mounted on > /dev/mapper/vg-portage 200704 200704 0 100% /usr/portage_lynx > > > Should I reformat my filesystem? Yes, and use a smaller bytes-per-inode setting. Note some filesystems such as xfs and btrfs do not have the "fixed number of inodes" limitation.
Thanks Zac Medico, after reformating /usr/portage with ('mkfs.ext2 -b1024 -N400000 /dev/mapper/vg-portage' or 'mkfs.ext2 -b1024 -i2048'), 'tune2fs -O dir_index -c100 -i100 /dev/mapper/vg-portage' I have now 399360 or 2097152 inodes and /usr/portage is again writable.