LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 05-07-2010, 07:34 PM   #1
Arodef
Member
 
Registered: Apr 2004
Distribution: Centos, Fedora
Posts: 125

Rep: Reputation: 17
USB drive not getting automatically mounted during startup. Help!


I added a 1TB USB drive to a Red Hat 5.3 system. I added the following line to the /etc/fstab to automount the drive at startup:

Code:
/dev/sdc1		/mnt/external		ext3	defaults	0 0
If I manually the mount the drive (mount /mnt/external), I can access and read/write to the external USB drive without any issues. My problem is that during the startup process after a reboot, the drive is not being mounted automatically. I've included the startup capture below. I've bolded the sections dealing with the external drive, the error is:

Mounting local filesystems: mount: special device /dev/sdc1 does not exist
[FAILED]

It also fails at:

Mounting other filesystems: mount: special device /dev/sdc1 does not exist
[FAILED]


Once I login, I can mount the drive manually and it will work. The drive is at /dev/sdc1 so I know the location is not the problem.

From looking at the startup capture, there is a section where the lines begin with "sdc:" which I bolded as well. It appears the USB drive at /dev/sdc1 comes online after that, however since the OS had tried to mount it before /dev/sdc1 came online, the drive does not get automatically mounted. At least that's my guess on why the USB drive is not being mounted automatically.

How do I fix it so the USB drive gets successfully mounted automatically at startup during the "Mount local filesystems" or "Mounting other filesystems" check rather than getting those ugly FAILED messages?

Thanks for any help!

Startup capture:
Code:
INIT: version 2.86 booting
		Welcome to Red Hat Enterprise Linux Server
		Press 'I' to enter interactive startup.
Setting clock  (utc): Fri May  7 16:59:14 PDT 2010 [  OK  ]
Starting udev: [  OK  ]
Loading default keymap (us): [  OK  ]
Setting hostname ibmMaster:  [  OK  ]
Setting up Logical Volume Management:   /dev/hda: open failed: No medium found
  2 logical volume(s) in volume group "VolGroup00" now active
[  OK  ]
Checking filesystems
Checking all file systems.
[/sbin/fsck.ext3 (1) -- /] fsck.ext3 -a /dev/VolGroup00/LogVol00 
/dev/VolGroup00/LogVol00: clean, 195325/365756416 files, 13089600/365748224 blocks
[/sbin/fsck.ext3 (1) -- /boot] fsck.ext3 -a /dev/sda1 
/boot: clean, 34/26104 files, 15628/104388 blocks
[  OK  ]
Remounting root filesystem in read-write mode:  [  OK  ]
Mounting local filesystems:  mount: special device /dev/sdc1 does not exist
[FAILED]
Enabling local filesystem quotas:  [  OK  ]
Enabling /etc/fstab swaps:  [  OK  ]
INIT: Entering runlevel: 3
Entering non-interactive startup
Applying Intel CPU microcode update: [  OK  ]
Starting monitoring for VG VolGroup00:   /dev/hda: open failed: No medium found
  2 logical volume(s) in volume group "VolGroup00" monitored
[  OK  ]
Starting background readahead: [  OK  ]
Checking for hardware changes [  OK  ]
Turning off network shutdown. Starting iSCSI daemon: [  OK  ]
[  OK  ]
Bringing up loopback interface:  udevd-event[1854]: wait_for_sysfs: waiting for '/sys/devices/pci0000:00/0000:00:1d.7/usb1/1-1/1-1:1.0/host2/target2:0:0/2:0:0:0/ioerr_cnt' failed
[  OK  ]
Bringing up interface eth0:  
Determining IP information for eth0... done.
[  OK  ]
Starting auditd: [  OK  ]
Starting system logger: [  OK  ]
Starting kernel logger: [  OK  ]
Starting irqbalance: [  OK  ]
iscsid (pid 1964 1963) is running...
Setting up iSCSI targets: iscsiadm: No records found!
[  OK  ]
Starting portmap: [  OK  ]
Starting NFS statd: [  OK  ]
Starting RPC idmapd: [  OK  ]
Starting system message bus: [  OK  ]
Starting Bluetooth services:[  OK  ][  OK  ]
Mounting other filesystems:  mount: special device /dev/sdc1 does not exist
[FAILED]
Starting PC/SC s.mart card daemonready
 (pcscd): SCSI device sdc: 1953525168 512-byte hdwr sectors (1000205 MB)
sdc: Write Protect is off
sdc: assuming drive cache: write through
SCSI device sdc: 1953525168 512-byte hdwr sectors (1000205 MB)
sdc: Write Protect is off
sdc: assuming drive cache: write through
sd 2:0:0:0: Attached scsi disk sdc
sd 2:0:0:0: Attached scsi generic sg2 type 0
[  OK  ]
Starting hidd: [  OK  ]
<snip>
Code:
 fdisk -l /dev/sdc

Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1      121601   976760001   83  Linux
 
Old 05-08-2010, 02:33 AM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Quote:
Code:
Mounting other filesystems:  mount: special device /dev/sdc1 does not exist
[FAILED]
Starting PC/SC s.mart card daemonready
 (pcscd): SCSI device sdc: 1953525168 512-byte hdwr sectors (1000205 MB)
sdc: Write Protect is off
sdc: assuming drive cache: write through
SCSI device sdc: 1953525168 512-byte hdwr sectors (1000205 MB)
sdc: Write Protect is off
sdc: assuming drive cache: write through
sd 2:0:0:0: Attached scsi disk sdc
sd 2:0:0:0: Attached scsi generic sg2 type 0
/dev/sdc does not exist at the time linux is trying to mount it - probably the drive is still spinning up. Delaying the mount is the usual workaround.

http://ubuntuforums.org/archive/inde...t-1021719.html
http://fixunix.com/debian/131598-mou...ms-failed.html

Note - we would not normally want to mount a usb drive at boot unless we are booting off it or it has a root partition we want to use. We would usually let it get automounted just after login using udev. This also avoids problems should you boot while the drive is not plugged in.
 
1 members found this post helpful.
Old 05-08-2010, 11:47 AM   #3
Arodef
Member
 
Registered: Apr 2004
Distribution: Centos, Fedora
Posts: 125

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by Simon Bridge View Post
/dev/sdc does not exist at the time linux is trying to mount it - probably the drive is still spinning up. Delaying the mount is the usual workaround.

http://ubuntuforums.org/archive/inde...t-1021719.html
http://fixunix.com/debian/131598-mou...ms-failed.html

Note - we would not normally want to mount a usb drive at boot unless we are booting off it or it has a root partition we want to use. We would usually let it get automounted just after login using udev. This also avoids problems should you boot while the drive is not plugged in.
Thanks for the links, I'll give those recommendations a try. I'm actually experimenting with having some important directories reside on the USB drive, ex: mysql directory and web server directory, so I need the usb drive mounted at boot. I didn't show it in my code above, but the mysqld and httpd services also fail to startup since the drive isn't available. Thanks.
 
Old 05-10-2010, 02:04 AM   #4
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Well then, you could delay the startup of those services until after the drive is mounted - that would involve putting the instructions in a script to be executed after boot, just to be certain.
 
1 members found this post helpful.
Old 05-10-2010, 03:12 PM   #5
Arodef
Member
 
Registered: Apr 2004
Distribution: Centos, Fedora
Posts: 125

Original Poster
Rep: Reputation: 17
I tried the recommendations in those links above but the files mentioned in the ubuntuforums link don't exist on my Red Hat system. It's too bad too since his problem matches the exact one I'm facing. Do you how to add such a delay to a Red Hat system?

Last edited by Arodef; 05-11-2010 at 12:39 PM.
 
Old 05-11-2010, 03:36 AM   #6
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Quote:
Originally Posted by Arodef View Post
I tried the recommendations in those links above but the files mentioned in the ubuntuforums link don't exit on my Red Hat system. It's too bad too since his problem matches the exact one I'm facing. Do you how to add such a delay to a Red Hat system?
All free software is available for all distros... they may not all have tidy packages for it though.

What you want to do would probably involve modifying source code anyway. Have fun.
 
Old 05-11-2010, 05:59 AM   #7
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
You could put something like this in /etc/rc.d/rc.local
Code:
(
    sleep 10
    mount /dev/sdc1 /mnt/external
    /etc/rc.d/rc.mysql
)&
Notes:
  1. The ( )& starts a backgrounded subshell, allowing rc.local to continue and allowing the boot process to complete without delay.
  2. rc.mysql is a guess; adjust as required.
  3. The boot message output on what is the console during boot and becomes virtual terminal 1 when boot completes may not look very pretty.
  4. IDK RedHat so have not been able to take account of any relevant RedHat specifics.
 
1 members found this post helpful.
Old 05-17-2010, 07:58 PM   #8
Arodef
Member
 
Registered: Apr 2004
Distribution: Centos, Fedora
Posts: 125

Original Poster
Rep: Reputation: 17
Okay, I found the correct file in Red Hat to edit: /etc/rc.sysinit. I added the sleep 10 statement below and now the USB drive mounts at the 'Mounting other filesystems' step. It still fails at the 'Mounting local filesystem' before it but it does mount later on. The line I added is bolded below. Thanks to everyone for their input!

Code:
# Mount all other filesystems (except for NFS and /proc, which is already
# mounted). Contrary to standard usage,
# filesystems are NOT unmounted in single user mode.
sleep 10
if [ "$READONLY" != "yes" ] ; then
        action $"Mounting local filesystems: " mount -a -t nonfs,nfs4,smbfs,ncpfs,cifs,gfs -O no_netdev
else
        action $"Mounting local filesystems: " mount -a -n -t nfs4,smbfs,ncpfs,cifs,gfs -O no_netdev
fi
 
Old 05-18-2010, 12:24 AM   #9
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
The solution adopted has two disadvantages: the error message "Mounting local filesystems: mount: special device /dev/sdc1 does not exist" and the 10 second boot delay introduced by the sleep command in /etc/rc.sysinit.

Both these disadvantages can be avoided by
  • Modifying fstab for sdc1, adding "noauto" to the 4th field (without the quotes).
  • Moving the sdc1 mount to /etc/rc.d/rc.local as illustrated in this post. There may be no need for the sleep because rc.local is run at almost the end of the boot process.
  • Removing the normal MySQL boot script link(s), that is the symbolic link(s) listed by /bin/ls -l /etc/rc.d/rc[0-6S].d/S*mysql*, usually /etc/rc.d/rc3.dS98mysql. This is necessary because MySQL cannot start until scd1 is mounted.
There is a detailed description of the RedHat boot process here.
 
1 members found this post helpful.
  


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
he usb is not automatically mounted, abd_bela Debian 2 02-25-2009 01:41 AM
Is there ANY way for a proper shut down if USB has crashed with a mounted USB drive? TTL_2 Linux - Hardware 2 09-24-2008 08:04 AM
Can not access mounted USB drive Honkeychops Mandriva 5 03-06-2006 12:59 PM
how come usb flash drive doesn't get auto mounted? darkhatter Fedora 5 02-26-2006 08:04 PM
how to automatically partition and format drive if absent at startup chrisplinux Linux - Hardware 2 12-19-2003 12:36 PM

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

All times are GMT -5. The time now is 06:28 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