FS#12334 - [initscripts] ext3 partitions on external USB harddisks aren't autochecked (correctly) at boot time
Attached to Project:
Arch Linux
Opened by Heiko Baums (cyberpatrol) - Wednesday, 03 December 2008, 23:06 GMT
Last edited by Roman Kyrylych (Romashka) - Monday, 06 September 2010, 16:44 GMT
Opened by Heiko Baums (cyberpatrol) - Wednesday, 03 December 2008, 23:06 GMT
Last edited by Roman Kyrylych (Romashka) - Monday, 06 September 2010, 16:44 GMT
|
Details
Description:
ext3 partitions on external USB harddisks aren't (correctly) autochecked by fsck at boot time. These are my fstab entries for my USB harddisk: UUID=38db5cc2-8e5c-40dc-8498-be4450691ffe /mnt/hdd1 ext3 noatime,noauto 0 4 UUID=f872467d-a0a0-47aa-a604-922790674f23 /mnt/hdd2 ext3 noauto,noatime,users,exec 0 5 This is the message I get during boot: :: Checking Filesystems [BUSY] /dev/hda4: clean: 270211/550528 files, 1727108/2200905 blocks /dev/hda2: clean: 504024/3662848 files, 2249754/7325640 blocks /dev/hda3: clean: 51823/14663680 files, 7355952/29298543 blcks ***************** FILESYSTEM CHECK FAILED **************** * * * Please repair manually and reboot. Note that the root * * file system is currently mounted read-only. To remount * * it read-write type: mount -n -o remount,rw / * * When you exit the maintenance shell the system will * * reboot automatically. * ************************************************************ Give root password for maintenance (or type Control-D to continue): After typing Ctrl-D the system reboots. The partitions on my external harddisk are in fact clean, because I've checked them manually before I changed the passno values > 0 in /etc/fstab, and on Gentoo they are also autochecked at boot time. If I change pass to 0 for both partitions the system boots without any problems, and these partitions can be mounted without a hitch. |
This task depends upon
Closed by Roman Kyrylych (Romashka)
Monday, 06 September 2010, 16:44 GMT
Reason for closing: No response
Additional comments about closing: No response in 6 months. There is a "sleep" hook in mkinitcpio now, and there are hooks support on [initscripts], workarounds can be used. Please reopen if necessary.
Monday, 06 September 2010, 16:44 GMT
Reason for closing: No response
Additional comments about closing: No response in 6 months. There is a "sleep" hook in mkinitcpio now, and there are hooks support on [initscripts], workarounds can be used. Please reopen if necessary.
I have no idea why this delay exists for USB storage, but it is annoying in many places, especially because the only workaround I know is inserting arbitrary sleep calls.
Relying on this behaviour is not a proper solution by any means.
I hadn't had usb in the hooks.
This is what http://wiki.archlinux.org/index.php/Configuring_mkinitcpio says about the usb hook:
Hook: USB
Installation: Adds USB modules to the image. Use this if your root device is on a USB mass storage device.
Runtime: Loads USB modules. You will need the udev or modload hook unless you specify the needed modules manually (see MODULES section below).
Because I don't have a root device on my external USB harddisk, I thought this isn't necessary. When I installed Archlinux I was new to Archlinux and mkinitcpio, so I had to rely on the wiki.
I changed the wiki to this:
Installation: Adds USB modules to the image. Use this if your root device is on a USB mass storage device or if your USB mass storage device needs to be accessed otherwise (checked, mounted, etc.) at boot time.
Please correct my English. I know it's not the best. ;-)
:: Running Hook [usb]
:: Running Hook [keymap]
:: Loading keymap...done.
:: Running Hook [filesystems]
:: Loading root filesystem module...ext3
Waiting for devices to settle...scsi 0:0:0:0: Direct-Access SAMSUNG HD501LJ PQ: 0 ANSI: 2
Driver 'sd' needs updating - please use bus_type methods
sd 0:0:0:0: [sda] 976773168 512-byte hardware sectors (500108 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] 976773168 512-byte hardware sectors (500108 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Assuming drive cache: write through
sda: sda1 sda2
sd 0:0:0:0: [sda] Attached SCSI disk
done.
:: Initramfs Completed - control passing to kinit
See especially this: "Waiting for devices to settle..."
But there's also this message: "Driver 'sd' needs updating - please use bus_type methods"
I don't know, what that means. Maybe it's a different issue in mkinitcpio.
The question is, if this has to be done in the initramfs or if this could be done somehow else in the initscripts.
In my opinion the cleanest and probably fastest method is the usb hook. I haven't checked it yet, but I think the few modules don't make the initrd image so much bigger.
Another option would be to move the fsck part in rc.sysinit down. But this is not possible, because the partitions have to be checked before they are mounted rw.
Add this line to /etc/modprobe.conf (if USB is enabled in initramfs, then this file also has to be added there):
options usb-storage delay_use=0
In the meantime I don't need my external harddisk for daily use anymore, because I needed to buy a new mainboard, CPU and therefore a new and of course bigger harddisk. So now I need my external harddisk only as a backup medium.
And the fs_passno field in fstab can be indeed set to 0 for ext3 partitions from what I read here: http://www.ibm.com/developerworks/linux/library/l-fs7.html
It's because ext3 seems to check and fix the consistency of the filesystem by itself, and therefore doesn't need an explicit fsck anymore.
It can be read in forums and wikis once in a while, that fs_passno can be 0, but usually it's not explained why. So I wasn't sure about this and just tried to set fs_passno to >0. But now I think it's not necessary.
Nevertheless there are other filesystems, which need an explicit fsck and therefore need your workaround.
http://www.pastie.org/625895
http://projects.archlinux.org/initscripts.git/commit/?id=cfabb85924f35c636550609b332d088aaae9941f
If so, should this now be closed?