From 0c0f93fcc37d02d9ab6d159f964da378d424199e Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 19 Aug 2010 15:33:45 +0200 Subject: fsck: improve whole-disk check, detect stacked devices The current heuristic for conversion from partition to whole-disk is based on device names. It's pretty poor. This patch replaces this code with blkid_devno_to_wholedisk(). This solution is based on /sys FS and it works for arbitrary partitioned devices. The another problem is the way how fsck determines stacked devices. The current code checks device name for "md" prefix only. It does not care about DM, dm-ccypt, and so on. This patch uses /sys/block/.../slaves/, but it does not fully resolves dependencies between all devices. The method is simple -- fsck does not check stacked devices in parallel with any other device. Signed-off-by: Karel Zak --- fsck/fsck.8 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'fsck/fsck.8') diff --git a/fsck/fsck.8 b/fsck/fsck.8 index 027fb3fed..9cf80785d 100644 --- a/fsck/fsck.8 +++ b/fsck/fsck.8 @@ -200,6 +200,11 @@ If there are multiple filesystems with the same pass number, fsck will attempt to check them in parallel, although it will avoid running multiple filesystem checks on the same physical disk. .sp +.B fsck +does not check stacked devices (RAIDs, dm-crypt, ...) in parallel with any other +device. See below for FSCK_FORCE_ALL_PARALLEL setting. The /sys filesystem is +used to detemine dependencies between devices. +.sp Hence, a very common configuration in .I /etc/fstab files is to set the root filesystem to have a @@ -366,10 +371,10 @@ program's behavior is affected by the following environment variables: .B FSCK_FORCE_ALL_PARALLEL If this environment variable is set, .B fsck -will attempt to run all of the specified filesystems in parallel, -regardless of whether the filesystems appear to be on the same -device. (This is useful for RAID systems or high-end storage systems -such as those sold by companies such as IBM or EMC.) +will attempt to run all of the specified filesystems in parallel, regardless of +whether the filesystems appear to be on the same device. (This is useful for +RAID systems or high-end storage systems such as those sold by companies such +as IBM or EMC.) Note that the fs_passno value is still used. .TP .B FSCK_MAX_INST This environment variable will limit the maximum number of file system -- cgit v1.2.3-55-g7522