After Googling for a while, it looks like I have to use:
/sbin/xfs_repair /dev/mapper/VolGroup-lv_root
I burned a Live CD of OpenSuse, boot with it and run the command -> permisson denied…
Do I need special parameter to xfs_repair ???
Maybe I have to 'su - root" but I prefer to wait for a NethServer advice from a pro.
@MichaelKohne Restoring from backup, of course. You shouldn’t get anywhere near this level of hell unless you haven’t got backups. – Michael Hampton♦May 19 '16 at 7:31
I have backups, so I restored the complete content of the directory containing the corrupted file.
-Return message from the restoration: “Restored to the original position”.
-The corrupted file is still there with the restored original file and, both have the exact same name:
# ls -ls cur/
ls: unable to access cur/.file_name:2,Sac: The structure needs cleaning
total 8
8 -rw------- 1 vmail clamupdate 6471 15 juin 2012 .file_name:2,Sac:2,Sac
? -????????? ? ? ? ? ? .file_name:2,Sac:2,Sac
#
I think I will have to go “near this level of hell”
Again, thank you very much for your answer. I will keep you informed,
I can confirm that the NethServer (rarely) needs a repair, and when it does, xfs_repair on an unmounted system WORKS !!!
XFS will not do an automatic FS-check like Ext4 does during boot. (I still consider XFS better than Ext4 in almost all cases).
Doing a Proxmox image before is prudent (My NethServers run almost ALL in Proxmox), otherwise a clone with eg clonezilla is a very good (and safe) idea.
I use SystemRescueCD, that has sofar worked well (3 times used on different servers).
Here, LVM is recognized from the start, you only need to run this:
xfs_repair /dev/mapper/VolGroup-lv_root
This is fairly fast, even for a large filesystem.
Note: After the power outage which caused this at one of my clients, the client finally bought a new UPS (The old one had died a year earlier at 11 years of age)!
You can use the Rescue option booting the NethServer (or CentOS) CD.
When presented with the option to find the system and mount the rootfs you could go to a shell, start raid, lvm etc and then run xfs_repair.
Or, easier, use rescue option to mount / read-only and run xfs_repair -d /dev/mapper/VolGroup-lv_root
BTW, I needed this only once (and I see a lot of NethServer), xfs is really robust.
The 3 NethServers all were involved in either a Power Outage, or in one case a NAS Outage (Replaced by warranty), but the System working, but badly corrupted FileSystem.
The system worked, but no access to Server-manager or updates (Even with yum update!).
File, Mail and even NextCloud worked.
xfs_repair repared that 500 GB virtual system without any issues!
I still prefer using SystemRescueCD, as that starts RAID and LVM, but does not mount them.
xfs_repair needs to run on an unmounted system to repair it, just saves a few steps…
Amusing sidenote:
At the time the NAS died early in the morning at the hotel, there were 100 guests to a conference titeled “The risks of digitalization” - and Internet wasn’t working due to the outage…
Those are the moments you need and are really glad for fast recovery!
Always glad to be able to help others who use FOSS!
PS: The first time it happened, since everything “seemed” to work, except backup, I didn’t notice how severe the problem actually was…
Several other tries failed, my trusty SystemRescueCD saved the day easily!