LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-30-2013, 07:34 AM   #1
hcgrant
Member
 
Registered: Feb 2004
Location: UK Hertfordshire
Distribution: Opensuse 15.3 leap plus RaspberryPi OS ,Vista and loadsa little Raspberry Pis
Posts: 57

Rep: Reputation: 15
Smile Mounting USB Drive to a user defined point


I would like to be able to have my portable usb drive to be mounted to a defined location ... /RemStorage.

I put the following line into fstab ..
/dev/sde2 /RemStorage ext3 defaults 1 2

This works fine if I boot with the usb drive connected, if its not then everything goes pearshaped and the system goes into some repair ? mode

Without that line in fstab the drive gets mounted at /mnt/sde2 and will also automount as /mnt/sde2

I know this is a bit trivial but is there some way ..hotplug configuration maybe ... to make the system mount the usb drive to the point I want .../RemStorage ? And how does it get mounted to /mnt/sde2 anyway?
I could make /RemStorage a symlink to /mnt/sde2 I know but ;-)))

All thoughts gratefully received

Im using opensuse 12.2 64 bit
 
Old 05-30-2013, 10:00 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
Hotplug events are controlled by udev rules. The rules are located somewhere like /etc/ude/udev.conf, or in /etc/udev/rules.d. Do some research in your Opensuse documentation on how to write udev rules that identify the device by uuid instead of /dev/sde6. The uuid is unique to the device, whether it be disk partition are removable device.

Once the udev rule is written to identify the device, you can then write the entry in /etc/fstab, using the same uuid instead of /dev/sde6, and your desired mount point.

I hope this helps.
 
1 members found this post helpful.
Old 05-30-2013, 11:08 AM   #3
Philip Lacroix
Member
 
Registered: Jun 2012
Distribution: Slackware
Posts: 441

Rep: Reputation: 574Reputation: 574Reputation: 574Reputation: 574Reputation: 574Reputation: 574
Do you have something on your device that the system needs and is looking for when booting? I ask, because this might explain why things are going wrong when the disk is not there.

Anyway, in order to have your device unequivocally identified by the system you should put its UUID in fstab, instead of /dev/sde2. You can see such identifier using the blkid command. Like:

Code:
#~ blkid /dev/sde2
You'll get something like this:

Code:
/dev/sde2: UUID="<some-ID>" TYPE="ext3"
Put UUID=<some-ID> (without quotes) in /etc/fstab, where /dev/sde2 is now. The system will recognize the device unambiguously and will not mount anything else on that mount point, unless it is specified elswhere.

Best regards,
Philip

Last edited by Philip Lacroix; 05-30-2013 at 11:25 AM.
 
1 members found this post helpful.
Old 05-30-2013, 06:05 PM   #4
hcgrant
Member
 
Registered: Feb 2004
Location: UK Hertfordshire
Distribution: Opensuse 15.3 leap plus RaspberryPi OS ,Vista and loadsa little Raspberry Pis
Posts: 57

Original Poster
Rep: Reputation: 15
Thanks for the replies Philip and bigrigdriver.

Ill have a look at the udev documentation.

I used blkid and started to create a fstab entry.
But then I saw there was already an entry in my fstab to mount a device to /mnt/sde2! lol! Not put there by me!
What is interesting though is that there was also a flag "nofail" in place of "defaults" for that entry. So I think that flag is preventing the absence of the usb drive causing a boot failure.
Ive now changed that entry to mount to /RemStorage and all is well! :-)

Thanks again for your replies.
 
  


Reply



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
[SOLVED] user mounting of USB drive... Habitual Slackware 6 07-30-2012 08:42 PM
External Drive Mounting to Wrong Point Even Though It's In fstab Ubuntu 8.10 rjensen Linux - Hardware 5 01-21-2009 07:03 PM
Problem mounting a drive via mount point under home CelticBlues Linux - Newbie 8 06-18-2008 10:30 AM
Static mount point for USB drive vm_devadas Linux - Server 1 05-16-2007 09:43 AM
Automount: No mount point defined? ShakeNBake Linux - Laptop and Netbook 0 10-19-2003 06:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:40 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration