https://wiki.archlinux.org/api.php?action=feedcontributions&user=Zarathustra&feedformat=atomArchWiki - User contributions [en]2024-03-29T15:53:11ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Fsck&diff=240431Fsck2012-12-15T17:34:25Z<p>Zarathustra: /* Check Later */</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:File systems]]<br />
[[ru:Fsck]]<br />
{{Article summary start}}<br />
{{Article summary text|Information on how to use fsck.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Ext4}}<br />
{{Article summary wiki|Btrfs}}<br />
{{Article summary wiki|fstab}}<br />
{{Article summary end}}<br />
<br />
[[Wikipedia:Fsck|fsck]] stands for ''"file system check"'' and it is used to check and optionally repair one or more Linux file systems. Normally, the fsck program will try to handle filesystems on different physical disk drives in parallel to reduce the total amount of time needed to check all of the filesystems (see: {{ic|man fsck}}).<br />
<br />
The [[Arch Boot Process|Arch Linux boot process]] conveniently takes care of the fsck procedure for you and will check all relevant partitions on your drive(s) automatically on every boot. Hence, there is usually no need to resort to the command-line unless necessary.<br />
<br />
== Check Now ==<br />
<br />
To check all the relevant partitions immediately, run:<br />
<br />
# shutdown -Fr now<br />
<br />
The command '''shutdown''' brings down the system in a secure manner, '''-F''' forces fsck to be safely invoked on a reboot, '''-r''' causes the system to reboot after shutdown, and '''now''' shuts down the system immediately.<br />
<br />
== Check Later ==<br />
<br />
Another method would be to create a {{ic|forcefsck}} file on the partition you wish to check later. For example, for the root partition it would be:<br />
<br />
# touch /forcefsck<br />
<br />
When you're ready, reboot and fsck will do the rest. And don't worry, this file will be removed automatically when the process is finished.<br />
<br />
<br />
If you want to cancel a running fsck-check during boottime, (like in Ubuntu with ESC) you have to create a file called e2fsck.conf in /etc/, and add the following lines:<br />
[options]<br />
allow_cancellation = true<br />
<br />
Now you should be able to cancel a running fsck-ckeck with control + C.<br />
<br />
== Other fsck tricks ==<br />
<br />
A list of all available options can be found by running:<br />
<br />
# fsck -h<br />
<br />
To ''automatically'' repair damaged portions, run:<br />
<br />
{{Warning|This will not ask if you want to repair it, as the answer is '''Yes''' when you run it.}}<br />
<br />
# fsck -a<br />
<br />
To make ''no changes'' to the filesystem (opposite of the above, meaning the answer is '''No''' when asked about fixing errors), run:<br />
<br />
# fsck -n<br />
<br />
=== Changing check frequency ===<br />
<br />
By default, fsck checks a filesystem every 30 boots (counted individually for each partition). To change the frequency of checking, run:<br />
<br />
# tune2fs -c 20 /dev/sda1<br />
<br />
In this example, {{ic|20}} is the number of boots between two checks.<br />
<br />
Note that {{ic|1}} would make it scan at every boot, while {{ic|0}} would stop scanning altogether.<br />
<br />
{{Tip|If you wish to see the frequency number and the current mount count for a specific partition, use:<br />
# dumpe2fs -h /dev/sda1 <nowiki>|</nowiki> grep -i 'mount count'<br />
}}<br />
<br />
=== fstab options ===<br />
<br />
[[fstab]] is a system configuration file and is used to tell the Linux kernel which partitions (file systems) to mount and where on the file system tree.<br />
<br />
A typical {{ic|/etc/fstab}} entry may look like this:<br />
<br />
/dev/sda1 / ext4 defaults 0 '''1'''<br />
/dev/sda2 /other ext4 defaults 0 '''2'''<br />
/dev/sda3 /win ntfs-3g defaults 0 '''0'''<br />
<br />
The 6th column (in bold) is the fsck option.<br />
<br />
* 0 = Do not check.<br />
* 1 = First file system (partition) to check; {{ic|/}} (root partition) should be set to 1.<br />
* 2 = All other filesystems to be checked.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Can't run fsck on a separate /usr partition ===<br />
<br />
# Make sure you have the required [https://wiki.archlinux.org/index.php/Mkinitcpio#.2Fusr_as_a_separate_partition hooks] in {{ic|/etc/mkinitcpio.conf}} and that you remembered to re-generate your initramfs image after editing this file. <br />
# Make sure that the bootloader has {{ic|ro}} on the "APPEND" line in {{ic|/boot/syslinux/syslinux.cfg}} (for Syslinux). GRUB doesn't need one; it is added automatically when you generate a .cfg. For an explanation as to why you ''need'' "ro", see [https://bbs.archlinux.org/viewtopic.php?pid=1114554#p1114554 this] post. <br />
# Check your [[fstab]]! Only the root partition needs "1" at the end, everything else should have either "2" or "0". Carefully inspect it for other typos, as well.</div>Zarathustrahttps://wiki.archlinux.org/index.php?title=Fsck&diff=240430Fsck2012-12-15T17:33:54Z<p>Zarathustra: /* Check Later */</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:File systems]]<br />
[[ru:Fsck]]<br />
{{Article summary start}}<br />
{{Article summary text|Information on how to use fsck.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Ext4}}<br />
{{Article summary wiki|Btrfs}}<br />
{{Article summary wiki|fstab}}<br />
{{Article summary end}}<br />
<br />
[[Wikipedia:Fsck|fsck]] stands for ''"file system check"'' and it is used to check and optionally repair one or more Linux file systems. Normally, the fsck program will try to handle filesystems on different physical disk drives in parallel to reduce the total amount of time needed to check all of the filesystems (see: {{ic|man fsck}}).<br />
<br />
The [[Arch Boot Process|Arch Linux boot process]] conveniently takes care of the fsck procedure for you and will check all relevant partitions on your drive(s) automatically on every boot. Hence, there is usually no need to resort to the command-line unless necessary.<br />
<br />
== Check Now ==<br />
<br />
To check all the relevant partitions immediately, run:<br />
<br />
# shutdown -Fr now<br />
<br />
The command '''shutdown''' brings down the system in a secure manner, '''-F''' forces fsck to be safely invoked on a reboot, '''-r''' causes the system to reboot after shutdown, and '''now''' shuts down the system immediately.<br />
<br />
== Check Later ==<br />
<br />
Another method would be to create a {{ic|forcefsck}} file on the partition you wish to check later. For example, for the root partition it would be:<br />
<br />
# touch /forcefsck<br />
<br />
When you're ready, reboot and fsck will do the rest. And don't worry, this file will be removed automatically when the process is finished.<br />
<br />
<br />
If you want to cancel a running fsck-check during boottime, (like in Ubuntu with ESC) you have to create a file called e2fsck.conf in /etc/, and add the following lines:<br />
# [options]<br />
# allow_cancellation = true<br />
<br />
Now you should be able to cancel a running fsck-ckeck with control + C.<br />
<br />
== Other fsck tricks ==<br />
<br />
A list of all available options can be found by running:<br />
<br />
# fsck -h<br />
<br />
To ''automatically'' repair damaged portions, run:<br />
<br />
{{Warning|This will not ask if you want to repair it, as the answer is '''Yes''' when you run it.}}<br />
<br />
# fsck -a<br />
<br />
To make ''no changes'' to the filesystem (opposite of the above, meaning the answer is '''No''' when asked about fixing errors), run:<br />
<br />
# fsck -n<br />
<br />
=== Changing check frequency ===<br />
<br />
By default, fsck checks a filesystem every 30 boots (counted individually for each partition). To change the frequency of checking, run:<br />
<br />
# tune2fs -c 20 /dev/sda1<br />
<br />
In this example, {{ic|20}} is the number of boots between two checks.<br />
<br />
Note that {{ic|1}} would make it scan at every boot, while {{ic|0}} would stop scanning altogether.<br />
<br />
{{Tip|If you wish to see the frequency number and the current mount count for a specific partition, use:<br />
# dumpe2fs -h /dev/sda1 <nowiki>|</nowiki> grep -i 'mount count'<br />
}}<br />
<br />
=== fstab options ===<br />
<br />
[[fstab]] is a system configuration file and is used to tell the Linux kernel which partitions (file systems) to mount and where on the file system tree.<br />
<br />
A typical {{ic|/etc/fstab}} entry may look like this:<br />
<br />
/dev/sda1 / ext4 defaults 0 '''1'''<br />
/dev/sda2 /other ext4 defaults 0 '''2'''<br />
/dev/sda3 /win ntfs-3g defaults 0 '''0'''<br />
<br />
The 6th column (in bold) is the fsck option.<br />
<br />
* 0 = Do not check.<br />
* 1 = First file system (partition) to check; {{ic|/}} (root partition) should be set to 1.<br />
* 2 = All other filesystems to be checked.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Can't run fsck on a separate /usr partition ===<br />
<br />
# Make sure you have the required [https://wiki.archlinux.org/index.php/Mkinitcpio#.2Fusr_as_a_separate_partition hooks] in {{ic|/etc/mkinitcpio.conf}} and that you remembered to re-generate your initramfs image after editing this file. <br />
# Make sure that the bootloader has {{ic|ro}} on the "APPEND" line in {{ic|/boot/syslinux/syslinux.cfg}} (for Syslinux). GRUB doesn't need one; it is added automatically when you generate a .cfg. For an explanation as to why you ''need'' "ro", see [https://bbs.archlinux.org/viewtopic.php?pid=1114554#p1114554 this] post. <br />
# Check your [[fstab]]! Only the root partition needs "1" at the end, everything else should have either "2" or "0". Carefully inspect it for other typos, as well.</div>Zarathustrahttps://wiki.archlinux.org/index.php?title=Fsck&diff=240429Fsck2012-12-15T17:32:55Z<p>Zarathustra: /* Check Later */</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:File systems]]<br />
[[ru:Fsck]]<br />
{{Article summary start}}<br />
{{Article summary text|Information on how to use fsck.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Ext4}}<br />
{{Article summary wiki|Btrfs}}<br />
{{Article summary wiki|fstab}}<br />
{{Article summary end}}<br />
<br />
[[Wikipedia:Fsck|fsck]] stands for ''"file system check"'' and it is used to check and optionally repair one or more Linux file systems. Normally, the fsck program will try to handle filesystems on different physical disk drives in parallel to reduce the total amount of time needed to check all of the filesystems (see: {{ic|man fsck}}).<br />
<br />
The [[Arch Boot Process|Arch Linux boot process]] conveniently takes care of the fsck procedure for you and will check all relevant partitions on your drive(s) automatically on every boot. Hence, there is usually no need to resort to the command-line unless necessary.<br />
<br />
== Check Now ==<br />
<br />
To check all the relevant partitions immediately, run:<br />
<br />
# shutdown -Fr now<br />
<br />
The command '''shutdown''' brings down the system in a secure manner, '''-F''' forces fsck to be safely invoked on a reboot, '''-r''' causes the system to reboot after shutdown, and '''now''' shuts down the system immediately.<br />
<br />
== Check Later ==<br />
<br />
Another method would be to create a {{ic|forcefsck}} file on the partition you wish to check later. For example, for the root partition it would be:<br />
<br />
# touch /forcefsck<br />
<br />
When you're ready, reboot and fsck will do the rest. And don't worry, this file will be removed automatically when the process is finished.<br />
<br />
<br />
If you want to cancel a running fsck-check during boottime, (like in Ubuntu with ESC) you have to create a file called e2fsck.conf in /etc/, and add the following lines:<br />
#[options]<br />
#allow_cancellation = true<br />
<br />
Now you should be able to cancel a running fsck-ckeck with control + C.<br />
<br />
== Other fsck tricks ==<br />
<br />
A list of all available options can be found by running:<br />
<br />
# fsck -h<br />
<br />
To ''automatically'' repair damaged portions, run:<br />
<br />
{{Warning|This will not ask if you want to repair it, as the answer is '''Yes''' when you run it.}}<br />
<br />
# fsck -a<br />
<br />
To make ''no changes'' to the filesystem (opposite of the above, meaning the answer is '''No''' when asked about fixing errors), run:<br />
<br />
# fsck -n<br />
<br />
=== Changing check frequency ===<br />
<br />
By default, fsck checks a filesystem every 30 boots (counted individually for each partition). To change the frequency of checking, run:<br />
<br />
# tune2fs -c 20 /dev/sda1<br />
<br />
In this example, {{ic|20}} is the number of boots between two checks.<br />
<br />
Note that {{ic|1}} would make it scan at every boot, while {{ic|0}} would stop scanning altogether.<br />
<br />
{{Tip|If you wish to see the frequency number and the current mount count for a specific partition, use:<br />
# dumpe2fs -h /dev/sda1 <nowiki>|</nowiki> grep -i 'mount count'<br />
}}<br />
<br />
=== fstab options ===<br />
<br />
[[fstab]] is a system configuration file and is used to tell the Linux kernel which partitions (file systems) to mount and where on the file system tree.<br />
<br />
A typical {{ic|/etc/fstab}} entry may look like this:<br />
<br />
/dev/sda1 / ext4 defaults 0 '''1'''<br />
/dev/sda2 /other ext4 defaults 0 '''2'''<br />
/dev/sda3 /win ntfs-3g defaults 0 '''0'''<br />
<br />
The 6th column (in bold) is the fsck option.<br />
<br />
* 0 = Do not check.<br />
* 1 = First file system (partition) to check; {{ic|/}} (root partition) should be set to 1.<br />
* 2 = All other filesystems to be checked.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Can't run fsck on a separate /usr partition ===<br />
<br />
# Make sure you have the required [https://wiki.archlinux.org/index.php/Mkinitcpio#.2Fusr_as_a_separate_partition hooks] in {{ic|/etc/mkinitcpio.conf}} and that you remembered to re-generate your initramfs image after editing this file. <br />
# Make sure that the bootloader has {{ic|ro}} on the "APPEND" line in {{ic|/boot/syslinux/syslinux.cfg}} (for Syslinux). GRUB doesn't need one; it is added automatically when you generate a .cfg. For an explanation as to why you ''need'' "ro", see [https://bbs.archlinux.org/viewtopic.php?pid=1114554#p1114554 this] post. <br />
# Check your [[fstab]]! Only the root partition needs "1" at the end, everything else should have either "2" or "0". Carefully inspect it for other typos, as well.</div>Zarathustra