[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: auto-mounting disks that might not be present (e.g. usb drives)

On Wed, Feb 03, 2010 at 11:01:00PM +1030, Arthur Marsh wrote:
> In my case I have:
> UUID=4823-93A9  /mnt/usb8gig        vfat
> defaults,users,uid=65534,gid=65534,umask=000,shortname=win95
> 0     2
> (all on one line)
> If I change that trailing "2" to a zero, no fsck should be performed.
> I would like to have automatic mounting with fsck if the drive is
> present when the machine is booted, and automatic mounting without
> fsck if the drive is plugged in after the machine is booted.
> Is this possible with any of the standard Debian tools and config
> files, or will it require yet-another-script?

How about if you leave your fstab set up for no automount and no fsck,
and then use a @reboot cronjob to fsck and mount the device if the
device node is present. For instance, in /etc/crontab you could try:

@reboot root test -L /dev/disk/by-uuid/4823-93A9 && fsck.vfat -a
/dev/disk/by-uuid/4823-93A9 && mount /mnt/usb8gig

(all on one line, with terminating newline)



Dave Thayer           | Whenever you read a good book, it's like the 
Denver, Colorado USA  | author is right there, in the room talking to 
dave@thayer-boyle.com | you, which is why I don't like to read 
                      | good books. - Jack Handey "Deep Thoughts"

Reply to: