LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 01-28-2013, 02:41 PM   #1
rnturn
Member
 
Registered: Jan 2003
Location: Illinois (Chicago area)
Distribution: Red Hat (8.0), SuSE (10.x, 11.x, 12.2), Solaris (8-10), Tru64
Posts: 949

Rep: Reputation: 51
Trouble mounting USB device in OpenSUSE 12.2


Or, perhaps I should say: trouble mounting a USB device where I want it mounted

Background: I've been happily mounting USB drives on OpenSUSE 11.x for a long time. After creating a udev rule and a suitable line in /etc/fstab, I can merely insert a USB drive and it shows up mounted in a predictable place, say, /media/cruzer or /media/attache.

Now: On OpenSUSE 12.2, the system automatically mounts the drive on some odd mount point that seems to be the serial number of the device: /media/79AA-12CD or something completely non-intuitive like that.

I tried copying over the udev rules from an 11.x system, modifying /etc/fstab, and having udev reread the rules. When I do this I get the USB mount behavior I'm looking for. BUT this only works for the duration of the current boot. And... when the system is rebooted, it hangs. Removing the lines for the USB devices in /etc/fstab solves the hanging problem.

Now the biggest difference between the two systems is, of course, 12.2 is using systemd. I suspect the problem I'm encountering is related to systemd though I can't quite tell why the system startup processes should be hanging (other than it's getting hung up on there not being anything accessible on the USB bus to mount). There are no obvious messages on the console that indicate that the system is waiting for something; it just sits there.

What is the mechanism for being able to have USB drives mounted on a nicely predictable mount point that I define and not one that uses some oddball hexadecimal string?

Any pointers to helpful READMEs and/or HOWTOs are most welcome.

TIA,

Rick
 
Old 01-28-2013, 05:59 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,783

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
After taking a quick look at the OpenSuse Reference Manual, sections 12.7 and 12.8, I don't see any significant changes to the udev rule structure to account for your problems. You may want to compare your udev rule to the examples in the section 12.7. If you use the device-by-uuid example in both the udev rule and /etc/fstab, you should be able to fix your udev rule to mount persistently at the same mount point.
 
Old 01-29-2013, 02:40 PM   #3
rnturn
Member
 
Registered: Jan 2003
Location: Illinois (Chicago area)
Distribution: Red Hat (8.0), SuSE (10.x, 11.x, 12.2), Solaris (8-10), Tru64
Posts: 949

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by bigrigdriver View Post
You may want to compare your udev rule to the examples in the section 12.7. If you use the device-by-uuid example in both the udev rule and /etc/fstab, you should be able to fix your udev rule to mount persistently at the same mount point.
I suppose it's possible that there have been some minor syntax changes in the udev rules that have caused the current problem. I'll do some testing this evening to see what's happening on 12.2 and compare the results to what's working on the 11.x systems. Not having things mounted where I would like them is currently merely annoying (but it's making it a pain to implement some directory synchronization I've been trying to implement when files are transported between systems using the USB drive).

I'm still a little mystified by the fstab entries for the USB devices causing the boot to hang. If it was merely a timeout problem I could live with that (though I'd like to shorten the timeout). When I break out of the startup sequence while it's hanging, I get a message noting that I can issue "systemd default" (or something like that; I'm going from memory) but when I enter the root password and try that command the startup still hangs. So breaking out and editing the /etc/fstab to comment out the USB device entries is the only thing I've found that allows the startup to complete. Of course, when I do that the mounts don't work as desired. I guess I've got some more reading to do about systemd. I've only been using 12.2 for a couple of months or so and I'm still discovering new things.
 
Old 01-29-2013, 11:57 PM   #4
rnturn
Member
 
Registered: Jan 2003
Location: Illinois (Chicago area)
Distribution: Red Hat (8.0), SuSE (10.x, 11.x, 12.2), Solaris (8-10), Tru64
Posts: 949

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by bigrigdriver View Post
After taking a quick look at the OpenSuse Reference Manual, sections 12.7 and 12.8, I don't see any significant changes to the udev rule structure to account for your problems.
I'm not sure if you would consider it significant or not but the "NAME=" directive now seems to be invalid when used as I had been using it under 11.x. Removing that from the udev rules at least got the rules recognized and the symbolic links that are referred to in /etc/fstab created correctly.

But that wasn't enough to get USB devices mounted as I was hoping. I notice that the USB mount points in /etc/fstab must now use the "noauto" option where "auto" worked fine under 11.x. Without this change the boot process would still hang.

I created mount points under /media for the USB drives and rebooted. When a USB drive was inserted, the mount failed as the subdirectory under /media appears to have been cleaned out as part of the boot process. Recreating the mount point subdirectories under /mnt and modifying /etc/fstab to reflect the new mount points now has the USB drives mounting using names that are more human-readable. (Now I'm off to retrofit the 11.x systems so the USB drives are mounted in the same place on all systems.)
 
Old 01-30-2013, 01:29 AM   #5
John VV
Guru
 
Registered: Aug 2005
Posts: 13,041

Rep: Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740
if you do not need it to mount to a specific custom named folder

just plug it in
and let it auto mount to /media/??????

Last edited by John VV; 01-30-2013 at 01:30 AM.
 
Old 01-30-2013, 05:13 PM   #6
jefro
Guru
 
Registered: Mar 2008
Posts: 11,714

Rep: Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439
You can fix the mount by (device, common name, uuid or such) in Yast I think. I assume you had this/these devices attached when you installed the system.
 
Old 01-30-2013, 05:51 PM   #7
John VV
Guru
 
Registered: Aug 2005
Posts: 13,041

Rep: Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740
or use udev
this is a fairly good tutorial
http://www.reactivated.net/writing_udev_rules.html
the usbhdd section
http://www.reactivated.net/writing_u...example-usbhdd

for my 3TB drive i use
udev to lock it to /dev/hdc ( it is always pluged in so it was hdc anyway )
then a fstab line to mount it in a custom location
 
Old 01-31-2013, 11:59 AM   #8
rnturn
Member
 
Registered: Jan 2003
Location: Illinois (Chicago area)
Distribution: Red Hat (8.0), SuSE (10.x, 11.x, 12.2), Solaris (8-10), Tru64
Posts: 949

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by John VV View Post
if you do not need it to mount to a specific custom named folder

just plug it in
and let it auto mount to /media/??????
Even if I could guarantee that the UUID would be the same across all systems where this USB drive might be plugged in -- and it probably is -- something like "79AA-12CD" isn't something I'm likely to remember. (Plus it's a more of a PITA to type than something like "cruzer" is.) Especially if I had two or more USB drives plugged in simultaneously (which isn't that uncommon, actually).
 
Old 01-31-2013, 12:06 PM   #9
rnturn
Member
 
Registered: Jan 2003
Location: Illinois (Chicago area)
Distribution: Red Hat (8.0), SuSE (10.x, 11.x, 12.2), Solaris (8-10), Tru64
Posts: 949

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by jefro View Post
You can fix the mount by (device, common name, uuid or such) in Yast I think.
If it's modifiable in YaST I must have missed it; I'll take another look. It might be a useful thing in the future.

Quote:
I assume you had this/these devices attached when you installed the system.
No these are portable USB drives that are moved between multiple systems. They would not be visible when the systems were built.

--
Rick
 
Old 01-31-2013, 12:34 PM   #10
rnturn
Member
 
Registered: Jan 2003
Location: Illinois (Chicago area)
Distribution: Red Hat (8.0), SuSE (10.x, 11.x, 12.2), Solaris (8-10), Tru64
Posts: 949

Original Poster
Rep: Reputation: 51
[SOLVED] Trouble mounting USB device in OpenSUSE 12.2

Quote:
Originally Posted by John VV View Post
I've seen those before. Anyway, the rules I have in place on the 11.x systems (based on info found in those tutorials, BTW) worked on the 12.2 system once I removed the "NAME=" directive. So I think many of the examples in those tutorials that employ that directive might now be broken. (So watch out!) The other weird thing was that, on 12.2, the /media directory appears to be cleared at boot time so I couldn't use that as a location for the mount points I was looking to create. "/mnt" works fine. (Until they decide to do something odd in 13.1. )

Quote:
for my 3TB drive i use
udev to lock it to /dev/hdc ( it is always pluged in so it was hdc anyway )
then a fstab line to mount it in a custom location
And that's my next project. I have one of those external SATA docking stations that I use with several disks for backup devices. I'll need to set up rules so that all of these disks wind up looking like "/dev/backup" or something like that and mounted on "/mnt/backup" so that backup scripts always know where the backup files should be written.

I'm calling this problem "solved". (At least for my needs.) Thanks, all, for the hints and comments that got me thinking of different places to look to tell what was going wrong.

--
Rick
 
Old 01-31-2013, 02:12 PM   #11
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 1,545

Rep: Reputation: 238Reputation: 238Reputation: 238
Couldn't you just delete the entries. And when udev creates them for you, you can go modify what it assumed to suit your needs. It is annoying when udev creates a new eth# for a different machine when I boot my USB version of linux. Since I have to modify my firewall script with the new device name before I can run it. If it's assuming those from the UUID you can create custom UUID's with mkfs as long as the value is HEX. But you can do many interesting names in HEX. ba55c1ef feed deaf cafe beef and others.
 
Old 01-31-2013, 02:55 PM   #12
rnturn
Member
 
Registered: Jan 2003
Location: Illinois (Chicago area)
Distribution: Red Hat (8.0), SuSE (10.x, 11.x, 12.2), Solaris (8-10), Tru64
Posts: 949

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by Shadow_7 View Post
Couldn't you just delete the entries. And when udev creates them for you, you can go modify what it assumed to suit your needs.
Maybe. I'm satisfied with the udev solution I've come up with.
Quote:
It is annoying when udev creates a new eth# for a different machine when I boot my USB version of linux. Since I have to modify my firewall script with the new device name before I can run it.
You could try modifying your firewall script to reference a shell variable, say "ETHDEV", as it sets up your iptables rules. When you know what the network device name is, run the script using
Code:
ETHDEV=whatever-the-ethernet-device-is  /usr/local/sbin/my_firewall_rules
(Fill in your firewall path/script name.)

I, too, found the udev network device renaming annoying when I was trying to add a second network controller in some systems. I had all sorts of odd configuration problems (and all kinds of "network not accessible" type errors) until I figured out that I could swap the device names in the "persistent-net.rules" file.

Quote:
If it's assuming those from the UUID you can create custom UUID's with mkfs as long as the value is HEX. But you can do many interesting names in HEX. ba55c1ef feed deaf cafe beef and others.
I think that would be almost as confusing as the strings that the system is coming up with. I'd have figure out how to put P-touch labels on my little USB drives. I do like the "ba55clef" name though. There should be a smiley for that. Maybe "7:".

--
Rick
 
1 members found this post helpful.
  


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
Trouble mounting external usb hard drive in openSuSe 10.2 birdofprey Linux - Hardware 3 04-19-2007 12:02 AM
Weird USB mounting issue on OpenSuse. 10.2 Larry42 Linux - General 1 03-16-2007 02:38 PM
External USB HD Issues--Mounting w/OpenSuSE 10.2 Dieselashi Linux - Hardware 8 02-05-2007 01:28 AM
trouble mounting USB Newtonx Linux - Hardware 5 12-06-2006 02:30 PM
mounting a USB device issey *BSD 6 03-01-2006 03:16 AM


All times are GMT -5. The time now is 02:07 AM.

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