Re: Mount external USB disk at boot up

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

 



Walter Garcia-Fontes wrote:
> I have an external 250 GB hard disk that I use for backup. I use Gnome
> and when I log into Gnome it automounts. But if I am not
> logged in Gnome it is not mounted. I'd like to have it mounted all the
> time. I'd like to be able to get the backups running even if no user
> is logged in. 
> 
> I have it formatted with ext3. 
> 
You could use gnome-mount from the command line to mount it. I am
not sure how it would work from a backup script with no user logged
in. Maybe something like (untested):

if ( ! (grep /mnt/Backup /proc/mounts > /dev/null)) ; then
  mount /dev/sdb1 /media/Backup
fi

or

if ( ! (grep /mnt/Backup /proc/mounts > /dev/null)) ; then
  gnome-mount -d /dev/sdb1
fi

or

if ( ! (grep /mnt/Backup /proc/mounts > /dev/null)) ; then
  gnome-mount -d /dev/sdb1 --mount-point /media/Backup
fi

> One way I understand it can be done is to enter a line in /etc/fstab. 
> I entered the following line:
> 
> /dev/sdb1            /media/Backup           ext3    auto,hotplug,defaults 1 
> 
> (I have a physical /media/Backup dir created with the right
> permissions). 
> 
I could be wrong, but I didn't think that hotplug was a valid
option. If you want to be able to mount it manually, the noauto
option should be used in place of the auto option. That way, the
system will not try and mount it at boot time. Otherwise you would
have problems booting if the drive was not plugged in.

> but I got an error at the bootup process telling me that the filesytem
> was not ready, it didn't like that line. What is the right syntax for
> the fstab line? (I also tried once to put LABEL=Backup insted of
> /dev/sdb1 since this is the label of the disk and it froze completely
> at that line, had to boot in with live cd and erase manually). 
> 
> I understand that there is also a way of using autofs to have the disk
> be mounted automatically when I try to access it, but I haven't been
> able to figure out how to configure it (change the /etc/auto.master
> file?).
> 
> Thanks for any suggestions.
> 
You could add one of these to /etc/auto.master

/media/Backup    -fstype=auto        :/dev/sdb1
/media/Backup    -fstype=ext3        :/dev/sdb1

Mikkel
-- 

  Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux