Results 1 to 7 of 7

Thread: How to let udev mount my USB drive with 'noatime' mount option?

  1. #1
    Join Date
    Jun 2006
    Location
    $ pwd _
    Beans
    3,999
    Distro
    Ubuntu 12.10 Quantal Quetzal

    How to let udev mount my USB drive with 'noatime' mount option?

    Is it possible to (have udev auto-)mount an external drive with certain mount options?

    My backup drive is USB, JFS formatted. I just need it auto-mounted with 'noatime' mount option. I read the instructions here but its way over my head.

    Currently, I'm working around this issue with an FSTAB entry and mounting the partition manually:
    Code:
    <UUID>     /media/Backup     jfs     defaults,user,noatime,noauto    0   0
    * If I leave out noauto, it get boot time warning that reads 'partition does not exist'.

    I'd really like udev auto mount it. Any help is much appreciated.

  2. #2
    Join Date
    Sep 2007
    Beans
    138

    Re: How to let udev mount my USB drive with 'noatime' mount option?

    ACTION=="add", KERNEL=="sd[a-z][0-9]", PROGRAM=="/lib/udev/vol_id -t %N", RESULT=="vfat", RUN+="/bin/mount -t vfat -o rw,noauto,flush,quiet,nodev,nosuid,noexec,noatime,dmask=000,fmask=111 /dev/%k /mnt/usb%n", OPTIONS="last_rule"
    From the wiki you linked to.

  3. #3
    Join Date
    Feb 2007
    Beans
    443

    Re: How to let udev mount my USB drive with 'noatime' mount option?

    This one is a hal policy -- so it should work if you use hal to automount drives.

    No idea if this will work, but it might -- I just changed a ntfs policy that I had on my system, I don't actually have any jfs hotpluggable filesystem to test it on. It needs to go somewhere in /etc/hal/fdi/policy (as something like 10-jfs_usb.fdi). You'll need to restart hal (and remove the entry you created in fstab).

    <?xml version="1.0" encoding="UTF-8"?>
    <deviceinfo version="0.2">
    <device>
    <match key="volume.fstype" string="jfs">
    <match key="@block.storage_device:storage.hotpluggable" bool="true">
    <append key="volume.mount.valid_options" type="strlist">noatime</append>
    </match>
    </match>
    </device>
    </deviceinfo>

  4. #4
    Join Date
    Jun 2006
    Location
    $ pwd _
    Beans
    3,999
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: How to let udev mount my USB drive with 'noatime' mount option?

    Thanks fwojciec for the pointer. I didn't knew it is HAL thought it'd be udev. I'll find out more about this.

    EDIT: Searched for HAL in the wiki and found it. Thanks again.
    Last edited by kpkeerthi; November 20th, 2008 at 05:04 PM.

  5. #5
    Join Date
    Jun 2006
    Location
    $ pwd _
    Beans
    3,999
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: How to let udev mount my USB drive with 'noatime' mount option?

    Quote Originally Posted by cammin View Post
    From the wiki you linked to.
    Thanks. But that didn't make any sense to me.

  6. #6
    Join Date
    Jun 2006
    Location
    $ pwd _
    Beans
    3,999
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: How to let udev mount my USB drive with 'noatime' mount option?

    Following the guidelines at http://wiki.archlinux.org/index.php/HAL, I created a file /usr/share/hal/fdi/policy/10osvendor/10-custom-mount-options.fdi with the following content:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <deviceinfo version="0.2">
            <device>
                    <match key="block.is_volume" bool="true">
                            <match key="@block.storage_device:storage.hotpluggable" bool="true">
                                    <merge key="volume.policy.mount_option.noatime" type="bool">true</merge>
                            </match>
                            <match key="@block.storage_device:storage.removable" bool="true">
                                    <merge key="volume.policy.mount_option.noatime" type="bool">true</merge>
                            </match>
                    </match>
            </device>
    </deviceinfo>
    And then restarted HAL. Even tried reboot. But my drives still won't mount with noatime. Any help is much appreciated?

    (Asked around in official arch forums. The forum seems pretty much dead )

  7. #7
    Join Date
    Jun 2006
    Location
    $ pwd _
    Beans
    3,999
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: How to let udev mount my USB drive with 'noatime' mount option?

    [:bump:]

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •