Debian This forum is for the discussion of Debian Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
03-14-2010, 12:29 PM
|
#1
|
LQ Newbie
Registered: Dec 2007
Posts: 27
Rep:
|
to mount external drives on startup
I want all my external drives mounted when I start OS.
I don't want to do it for a specific external drive. I want my external drives mounted by default.
Do you have an idea? Does linux have such a configuration I can change?
Or do I have to write a script?
|
|
|
03-14-2010, 12:51 PM
|
#2
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
Yes you can, but it can cause boot failure if an external drive isn't present when you boot up. You can simply add and entry for it in /etc/fstab. Use the UUID number or LABEL instead of a temporal device node such as /dev/sdb1.
Here is an example:
sudo /sbin/blkid /dev/sdb3
/dev/sdb3: UUID="71836867-346e-4809-b05a-655565c59531" TYPE="ext3"
/dev/disk/by-id/scsi-SATA_WDC_WD3200BEKT-_WD-WXC0A8966517-part3 /home/jschiwal/hd2 ext3 acl,user_xattr 0 0
or
UUID=71836867-346e-4809-b05a-655565c59531 /home/jschiwal/hd2 ext3 acl,user_xattr 0 0
Use the values pertaining to your drive and mount point.
I would add the options "noauto,user" for an external drive. It wouldn't mount at boot, but it would allow the owner to mount the device without su'ing to root. You could use the mount command to your ~/.profile or ~/.bash_login file. That will defer mounting them until you log in.
I have two nfs shares I mount this way. In my ~/.bash_login,
grep /mnt/elite/podcasts /etc/mtab || mount /mnt/elite/podcasts >/dev/null 2>&1
grep /mnt/elite/Download /etc/mtab || mount /mnt/elite/Download >/dev/null 2>&1
In my ~/.bash_logout, I unmount them.
grep /mnt/elite/Download /etc/mtab && umount /mnt/elite/Download >/dev/null 2>&1
grep /mnt/elite/podcasts /etc/mtab && umount /mnt/elite/podcasts >/dev/null 2>&1
|
|
0 members found this post helpful.
|
03-14-2010, 04:36 PM
|
#3
|
LQ Newbie
Registered: Dec 2007
Posts: 27
Original Poster
Rep:
|
I know it, but I ask for is different.
I repeat:
I don't want to do it for a specific external drive. I want my external drives mounted by default.
I am searching for this answer because I don't like the causalities of fstab method.
|
|
|
03-15-2010, 12:06 PM
|
#4
|
Member
Registered: Apr 2009
Distribution: debian gnu/linux
Posts: 798
Rep:
|
gnome-volume-manager doesn't do it?
|
|
|
03-15-2010, 12:24 PM
|
#5
|
Senior Member
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233
|
maybe automounter? i thought most modern distributions using KDE or gnome automatically mounted media such as usb drives or cdroms when inserted?
|
|
|
03-15-2010, 12:28 PM
|
#6
|
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
|
Quote:
Originally Posted by kutlu
Does linux have such a configuration I can change?
Or do I have to write a script?
|
I am not aware of any such configuration (that doesn't mean there isn't one).
If your OS implements udev, you could write udev rules to call a script.
|
|
|
03-15-2010, 12:37 PM
|
#7
|
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
|
Quote:
Originally Posted by frieza
maybe automounter? i thought most modern distributions using KDE or gnome automatically mounted media such as usb drives or cdroms when inserted?
|
autofs (automounter?) does not mount drives until they are accessed.
Using Xfce on Slackware 13.0, Thunar (Xfce's file system browser (a.k.a file manager) shows inserted drives greyed out and they are not mounted until browsed.
|
|
|
03-15-2010, 03:21 PM
|
#8
|
LQ Newbie
Registered: Dec 2007
Posts: 27
Original Poster
Rep:
|
Quote:
Originally Posted by catkin
autofs (automounter?) does not mount drives until they are accessed.
Using Xfce on Slackware 13.0, Thunar (Xfce's file system browser (a.k.a file manager) shows inserted drives greyed out and they are not mounted until browsed.
|
and this is exactly what my problem is.
thanks for clearification.
I do not like external disk mount failures, and fstab configurations which have to be written for each disk.
the way hald mounts drives is less problematic than fstab does.
Up to now, linux was perfect for my computer and disks which were online all the time. But I want my computer "restartable" and my expernals "plug-unplugable" now.
This is also an important request from developers.
|
|
|
03-15-2010, 10:29 PM
|
#9
|
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
|
Quote:
Originally Posted by kutlu
But I want my computer "restartable" and my expernals "plug-unplugable" now.
|
The first is achievable with custom programming.
The second is inherently difficult. Removing write caching would help but what if write-to-device was happening at the time of unplugging? And if the writing process re-tried it would write to the file system containing the mount point ... tricky!
The writeable CD/DVD ejection design is better than USB in this respect, allowing the user to request rejection any time (hardware or software eject button) but ejection is under software control and happens after unmounting.
|
|
|
All times are GMT -5. The time now is 04:18 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|