LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 04-11-2011, 01:17 PM   #1
thedatapusher
LQ Newbie
 
Registered: Mar 2011
Posts: 16

Rep: Reputation: Disabled
fstab no longer working for external drive


The company I am at was having trouble with mounting their archive drives (USB External G-Drives) and being able to write to them. The design stations that will be writing to the drives are Red Hat Enterprise. The rest of the computers that will be accessing these files for housekeeping will be OSX machines. I have decided on using hfsplus which was recomended by Design Station Developer) as the file system with a single partition named "Archive." Now there will be multiple archive drives being plugged into these systems. But only 1 at a time. Basically a 2 terabyte drive will be plugged in, archived to and then removed. Next time we need to archive there will be a new 2 terabyte drive plugged in. rinse repeat. I will maintain the process of formatting them and labeling them all "Archive."

Ok now that that is out of the way, here are the issues.

I edited fstab to mount the drive to /mnt/Archive:
/dev/sdd3 /mnt/Archive hfsplus user,rw,noauto,noexec 0 0

I also wrote to very basic shell scripts to simply mount and unmount the drives for the user.

Now I ran multiple tests and all worked. Not an issue.

But to hedge my bets I decided to change the fstab to use LABEL instead of /dev/sdd3 just incase the system decided to use another sdd(1-4). Plus since all archive drives will be named Archive, wouldn't going by label be better than device or UUID which could change? After changing to LABEL, every time I would plug in the drive, it would mount it to /mnt/Archive1 instead of the previous /mnt/Archive. In addition, none of the settings I had established in fstab were being applied. Specifically rw access to the mount. In fact, I could tell my line in fstab wasn't being referenced since it was creating it's own "managed" entry via fstab-sync.

Ok so that was a no-go so I decided to go back to what was originally working. Well no luck there either. Even though it was working perfectly before, it doesn't want to set the mount when it is plugged in. All i want is for it to set /dev/sdd3 to /mnt/Archive and allow rw access without having to sudo chmod the directory every time. Then once the user clicks the shell script it mounts for them and they can access the drive and archive. Keep in mind this was working before.

When I tail /messages I see that it hangs:


Code:
kernel: usb 1-7: new high speed USB device using address 3
kernel: Initializing USB Mass Storage driver...
kernel: scsi7 : SCSI emulation for USB Mass Storage devices
kernel:   Vendor: Ext Hard  Model:  Disk             Rev:     
kernel:   Type:   Direct-Access                      ANSI SCSI revision: 02
kernel: SCSI device sdd: 3907029168 512-byte hdwr sectors (2000399 MB)
kernel: sdd: assuming drive cache: write through
kernel: SCSI device sdd: 3907029168 512-byte hdwr sectors (2000399 MB)
kernel: sdd: assuming drive cache: write through
kernel:  sdd: [mac] sdd1 sdd2 sdd3 sdd4
kernel: Attached scsi disk sdd at scsi7, channel 0, id 0, lun 0
kernel: Attached scsi generic sg7 at scsi7, channel 0, id 0, lun 0,  type 0
kernel: usbcore: registered new driver usb-storage
kernel: USB Mass Storage support registered.
scsi.agent[6908]: disk at /devices/pci0000:00/0000:00:1d.7/usb1/1-7/1-7:1.0/host7/target7:0:0/7:0:0:0
Then it just hangs indefinitely. Before it would always say "fstab-sync[12415]: added mount point /mnt/Archive for /dev/sdd3" right after the scsi.agent listed above.

It's like it sees the drive being attached and it goes through the process... it just stops before the last, most important part of adding the mount point.

Any idea why this is happening and how I can fix this?

Thanks and sorry for the long post
 
Old 04-11-2011, 04:12 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
I have no idea why the problem is occurring, but I can suggest a fix. The secret lies in udev rules.

You can write a custom udev rule to mount the drive when it's plugged in, and to umount when it's unplugged. However, since this is enterprise related, it might be the safer procedure to continue to umount by running the script before unplugging. I don't know the state of development in re udev and hotplug/hotunplug of storage devices, and what the risk of data corruption might be for unplugging an external drive while it's mounted.

The udev rule can be written to persistently mount the external drive to a chosen mount point. /etc/fstab doesn't enter into the picture. The drive will be automatically mounted where desired (no need for the mount script).

You can also write the udev rule in such a way that an entry in /etc/fstab will mount the device at the chosen mount point. However, the device must be plugged in at boot time to avoid unnecessary error messages. And you, as an administrator, don't need to spend your time chasing unnecessary errors in the logs.

Here are three sites to get you started on udev:
http://www.redhat.com/magazine/002dec04/features/udev/
https://wiki.archlinux.org/index.php/Udev
http://blog.hulihanapplications.com/...names-in-linux
 
Old 04-12-2011, 11:21 PM   #3
thedatapusher
LQ Newbie
 
Registered: Mar 2011
Posts: 16

Original Poster
Rep: Reputation: Disabled
I was looking at UDEV and HAL before your response. Sounds great EXCEPT it is impossible to boot the system with th drive attached. There can be no Drive attached when the system is booted. So does this throw UDEV out the window, or is there a workaround.

Thanks
 
  


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
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
GRUB from External USB Drive is not working dan_filimon Linux - General 4 11-16-2007 08:49 AM
mounting external hard drive in /etc/fstab Micro420 Linux - Newbie 1 11-07-2006 05:12 AM
WD2000JD sata hard drive no longer working VeriCoder Linux - Hardware 1 08-31-2006 10:40 AM
DVD drive no longer working neocookie Linux - Newbie 11 12-19-2005 05:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 03:48 PM.

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