FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 02-05-2010, 08:09 PM
Arthur Marsh
 
Default auto-mounting disks that might not be present (e.g. usb drives)

Dave Thayer wrote, on 05/02/10 16:01:

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,short name=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,


Like:

UUID=4823-93A9 /mnt/usb8gig vfat
defaults,users,uid=65534,gid=65534,umask=000,flush ,shortname=win95,noauto
0 0


(all on the one line)


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)


OK, man 5 crontab shows that @reboot can be used instead of the first 5
fields of /etc/crontab


Last question is, what guarantee is there that the device file will have
been generated (assuming that the USB drive is present) before the
@reboot cron event is run?


incron might be able to help, but I haven't yet fully understood how to
set up incron.


Thanks for your help!

Arthur.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 02-05-2010, 09:37 PM
Richard Hector
 
Default auto-mounting disks that might not be present (e.g. usb drives)

On Sat, 2010-02-06 at 07:39 +1030, Arthur Marsh wrote:

> Last question is, what guarantee is there that the device file will have
> been generated (assuming that the USB drive is present) before the
> @reboot cron event is run?

The standard mount script is run in runlevel S, which is entered before
the numbered runlevels which is where cron is started. So I'm guessing
if the device is there in time to be mounted from fstab, it will be
there before cron runs.

Richard



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 02-06-2010, 12:44 AM
Arthur Marsh
 
Default auto-mounting disks that might not be present (e.g. usb drives)

Richard Hector wrote, on 06/02/10 09:07:

On Sat, 2010-02-06 at 07:39 +1030, Arthur Marsh wrote:

Last question is, what guarantee is there that the device file will have
been generated (assuming that the USB drive is present) before the
@reboot cron event is run?


The standard mount script is run in runlevel S, which is entered before
the numbered runlevels which is where cron is started. So I'm guessing
if the device is there in time to be mounted from fstab, it will be
there before cron runs.

Richard


Thanks, that turned out to be the case and appears to work well.

Arthur.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 06:46 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org