USB drive not getting automatically mounted during startup. Help!
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
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.
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.
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?
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.
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.