Modify

Opened 8 years ago

Closed 8 years ago

Last modified 4 years ago

#6955 closed defect (obsolete)

Mount options not honoured when using /etc/config/fstab and usb-storage

Reported by: Angus <gus@…> Owned by: cshore
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Kamikaze 8.09
Keywords: Cc:

Description

I've found what I consider to be a fairly serious bug in 8.0.9. Mount options in /etc/fstab are not honoured by the hotplug script at /sbin/usb-storage .

In my case, this meant that while my disk in /etc/fstab (generated from /etc/config/fstab) had
/dev/sda1 /mnt/usbdrive ext3 rw,sync,noatime,nodiratime 0 0

It was mounted as
/dev/sda1 on /mnt/usbdrive type ext3 (rw,errors=continue,data=ordered)

In my case, this was a magnetic disk so lack of noatime meant it never span down. This bug is more severe (IMHO) when people are mounting usb sticks, where missing noatime will contribute to wear.

I'll attach my replacement /sbin/usb-storage, and a patch to 8.09. I've changed it to use 'mount -a' whenever the hotplugged device is already mentioned in /etc/fstab.

The patch changes behaviour in two other minor ways.

1) A usb device with 'noauto' set in /etc/fstab will no longer mount itself when plugged in (I figure this is a bugfix as well.)
2) Devices with a mount point set in /etc/fstab will no longer be additionally symlinked to /mnt/usbdrive (this could be added back easily, it just seemed like a kludge for people who do not use /etc/config/fstab)

The bug still exists for any mount points specified by label or UUID in /etc/fstab, as the hotplug script only greps for the device name when checking if it exists or not.

... I know this has totally changed in the trunk, /sbin/usb-storage no longer exists and (I hope) the bug is no longer present, although I haven't had a chance to look yet. But it seems like a reasonably severe bug to have in the current release, so I thought I'd report it.

Attachments (2)

usb-storage.patch (1.0 KB) - added by Angus <gus@…> 8 years ago.
usb-storage (915 bytes) - added by Angus <gus@…> 8 years ago.
Replacement /sbin/usb-storage (suitable for an installed system)

Download all attachments as: .zip

Change History (6)

Changed 8 years ago by Angus <gus@…>

Changed 8 years ago by Angus <gus@…>

Replacement /sbin/usb-storage (suitable for an installed system)

comment:1 Changed 8 years ago by Angus <gus@…>

I forgot to mention that this is all prone to a race condition. On my Asus WL-500GP, at least, the order is 1) /etc/rc.d/S20fstab runs and generates /etc/fstab, calls 'mount -a' which mounts nothing then 2) USB comes online and hotplug script runs for usb-storage devices.

If there is hardware where usb comes online quicker, then the hotplug script (even my patched one) will run before /etc/fstab is regenerated. This means that changes to /etc/config/fstab will take two reboots before they take effect.

The solution to this would seem to be changing S20fstab so it runs before hotplug is started (hotplug is started in S10boot, so it would need to be farmed out to its own init script.)

comment:2 Changed 8 years ago by florian

  • Owner changed from developers to cshore
  • Status changed from new to assigned

comment:3 Changed 8 years ago by cshore

  • Resolution set to obsolete
  • Status changed from assigned to closed

8.09 is EOL'd and this bug no longer exists in trunk/Backfire. Therefore closing as obsolete.

comment:4 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.