Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
Wat het doet
fsck DEVICE calls the checker for the file system type (for ext4: e2fsck). Run it on unmounted file systems only. At boot, systemd runs fsck for ext4 lines with a non-zero 6th field in fstab. For XFS use xfs_repair (fsck.xfs does nothing).
Zo schrijf je het
fsck [-lsAVRTMNP] [-C [FD]] [-t TYPE] [FS-OPTIONS] DEVICE...
e2fsck [-pacnyrdfkvtDFV] [-b SUPERBLOCK] [-B BLOCKSIZE] DEVICEOpties 31
Meest gebruikt
fsck (front end)
e2fsck / fsck.ext4
Niets past bij dit filter.
Voorbeelden 10
$ als gewone gebruiker# als root (of met sudo)
1Check an ext4 file system
umount /backup fsck.ext4 -f /dev/vdb3-f forces a full check.
2Check only, change nothing
e2fsck -fn /dev/vdb3See the problems first.
3Repair everything without questions
e2fsck -fy /dev/vdb3For many errors; check backups first.
4Use a backup superblock
When the main superblock is broken.
5With progress
e2fsck -f -C 0 /dev/vgdata/lvwebProgress bar for big disks.
6Dry run of fsck for fstab
fsck -A -NShows the checks it would run.
7Before shrinking (required)
e2fsck -f /dev/vgfiles/lvdocs; resize2fs /dev/vgfiles/lvdocs 3Gresize2fs asks for a fresh check.
8XFS? Use xfs_repair
fsck.xfs /dev/vdb1Does nothing; xfs_repair is the tool.
9Force a check at the next boot
tune2fs -C 100 -c 20 /dev/vdb3Mount count above the max = check at boot (for fstab entries with pass 2).
10Find bad blocks on an old disk
e2fsck -fc /dev/vdb3Read test with badblocks.
Niets past bij dit filter.
Let op
- Running fsck on a mounted file system can destroy it.
Exitcodes
0 :: No errors. 1 :: Errors were corrected. 2 :: Corrected; reboot needed. 4 :: Errors left uncorrected. 8 :: Operational error. 16 :: Usage error. 32 :: Cancelled by the user. 128 :: Shared library error.