LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 03-14-2010, 12:29 PM   #1
kutlu
LQ Newbie
 
Registered: Dec 2007
Posts: 27

Rep: Reputation: 15
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?
 
Old 03-14-2010, 12:51 PM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
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.
Old 03-14-2010, 04:36 PM   #3
kutlu
LQ Newbie
 
Registered: Dec 2007
Posts: 27

Original Poster
Rep: Reputation: 15
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.
 
Old 03-15-2010, 12:06 PM   #4
j1alu
Member
 
Registered: Apr 2009
Distribution: debian gnu/linux
Posts: 798

Rep: Reputation: Disabled
gnome-volume-manager doesn't do it?
 
Old 03-15-2010, 12:24 PM   #5
frieza
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,104

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
maybe automounter? i thought most modern distributions using KDE or gnome automatically mounted media such as usb drives or cdroms when inserted?
 
Old 03-15-2010, 12:28 PM   #6
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,551
Blog Entries: 28

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by kutlu View Post
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.
 
Old 03-15-2010, 12:37 PM   #7
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,551
Blog Entries: 28

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by frieza View Post
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.
 
Old 03-15-2010, 03:21 PM   #8
kutlu
LQ Newbie
 
Registered: Dec 2007
Posts: 27

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by catkin View Post
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.
 
Old 03-15-2010, 10:29 PM   #9
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,551
Blog Entries: 28

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by kutlu View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
external ext3 drives always mount as read-only! Gilrad Linux - Software 6 06-28-2008 12:06 AM
Red Hat: Can't mount external hard drives anymore. Was rebooted without unmounting jwhitman Linux - General 5 04-21-2008 05:33 PM
freespire-how to automatically mount drives at startup Hpjunior Linspire/Freespire 5 12-05-2006 10:03 AM
mount drives at startup zchoyt Linux - Newbie 4 07-26-2005 03:43 PM
How To Mount The Windows Drives In Linux at Startup KnowledgeSeeker Linux - Software 2 09-24-2004 06:13 PM


All times are GMT -5. The time now is 08:34 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration