3

I have noticed that in dmesg and syslog i have something like that:

EXT4-fs warning (device sda3): ext4_dx_add_entry: Directory index full!

I have checked df -i too:

Filesystem            Inodes   IUsed   IFree IUse% Mounted on
/dev/sda3            182943744 27534820 155408924   16% /

And i see that IUse% is 16%. I rebooted that server but it's happened again. I check where i have too much files and the biggest number was 3200 files in one folder. Is it to much?

I have found in Google - that i can try fsck but how can i do it on mount system. Is not possible i think or it could crash my data.

Do you have some idea?

Thank you very much for help.

Rafal

Rafał Kamiński
  • 187
  • 2
  • 5
  • 15
  • 1
    Take a look at XFS's developer Dave Chinner presentation of `delaylog` option (available @ utube), and `mkfs.xfs` then. ;) – poige Feb 27 '13 at 13:00
  • I've found it (https://www.youtube.com/watch?v=FegjLbCnoBw) i will look. Do you think xfs will not have problem with that? – Rafał Kamiński Feb 27 '13 at 13:06
  • Chinner does at least. I can't guarantee it but since the moment "delaylog" appeared, there almost weren't any reason to not use XFS. For EXT4 they were, indeed: http://poige.livejournal.com/584439.html – poige Feb 27 '13 at 13:11
  • Poige - have you changed ext4 to xfs? It has better perfomance for big numbers of files? – Rafał Kamiński Feb 27 '13 at 14:21
  • 1
    Yeah, quite a long ago. Actually I use XFS primarily since it's the best one for concurrent write pattern, but I also use Btrfs and others, cause there's no one ideal FS that would suit all needs. But XFS is close to it now, yep. ;) – poige Feb 27 '13 at 14:34
  • Do you know why i have log like Disk is full, but df -i show only 16%? – Rafał Kamiński Mar 01 '13 at 12:46
  • Directory index != Disk. – poige Mar 01 '13 at 13:19
  • Disk on that server: Filesystem Size Used Avail Use% Mounted on /dev/sda3 2.8T 1.8T 880G 67% / But inodes: Filesystem Inodes IUsed IFree IUse% Mounted on /dev/sda3 182943744 27540938 155402806 16% / Should I have to be afraid? Or it could be wait some time because is not grow up? – Rafał Kamiński Mar 01 '13 at 14:23
  • See my contact info, if you need assistance. – poige Mar 01 '13 at 14:35

2 Answers2

2

I have found in Google - that i can try fsck but how can i do it on mount system. Is not possible i think or it could crash my data.

Yes, this is what I would recommend. Sounds like you might have filesystem corruption.

fsck cannot repair a filesystem which is mounted. You'll need to either boot and stop the boot process before your filesystem gets mounted to run fsck (this may or may not be possible depending on your configuration) or boot from different media (like an installer disc or LiveCD) to check and repair your root filesystem.

Josh
  • 9,001
  • 27
  • 78
  • 124
0

I have found in Google - that i can try fsck but how can i do it on mount system. Is not possible i think or it could crash my data.

There are a few different options and they all require a reboot. Option #3 below is my favorite because it gives me the most control, but it depends on your console access.

But first, read the warnings:

Warning #1: Make sure you backup your data before running fsck, sometimes fsck can make maters worse!

Warning #2: If this is in a datacenter and you don't have some remote console access (like iDRAC, iLO, iKVM, etc) then have someone ready to help at the console. Sometimes forcing a fsck at boot will prompt for user input on error and require user intervention---and you don't want to get locked out!

If it is the root partition (and in your cased it is) then #1 or #2 might work:

  1. You could try touch /forcefsck and reboot
  2. or edit the kernel command line in grub at boot time (or if without console access edit grub.cfg directly) and add fsck.mode=force and optionally fsck.repair=yes and let systemd-fsck do it.
    • If you edited grub.cfg directly, then put it back when you're done!

If it is not the root partition (or if #1,#2 above don't work) then you need console access:

  1. Boot to init=/bin/sh mode and bypass everything:
    • First edit the kernel command line in grub at boot time and add init=/bin/sh
    • When it boots it will probably boot to a prompt like this: bash-4.2#
    • You may need to set path: PATH=/sbin:/bin:/usr/sbin:/usr/bin
    • You can then test fsck as follows: fsck.ext4 -fn /dev/your/device
    • If the number of errors look not too scary, run a repair: fsck.extr -fy /dev/your/device
  2. Use a Live CD as in this answer
KJ7LNW
  • 131
  • 3