LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-15-2005, 04:04 PM   #1
Navyblue
Member
 
Registered: Jul 2005
Posts: 161

Rep: Reputation: 30
hda and hdb automounts nicely, but sda does not


Hi guys,

I was using Ubuntu 5.04 for AMD 64 and now switched to the 32 bit version. Both my IDE and SATA disks used to automount fine. To the best of my knowledge I did not do anything different.

During startup, my IDE drives automounts nicely. However for my SATA drive, during startup the system would complain that it couldn't find the volume. However, Konqueror is able to detect them, and I can login as root to mount those drives and they would be mounted according to the path I have specified in /etc/fstab.

The same thing goes with USB drives, it detects them but not mount them, fortunately I don't need to login as root to do this.

Here is my /etc/fstab:

Code:
proc            /proc           proc    defaults        0       0
/dev/hda1       /               ext3    defaults,errors=remount-ro 0       1
/dev/hda5       /home           ext3    defaults        0       2
/dev/hda6       /storage/linux  ext3    defaults        0       2
/dev/hda7       /tmp            ext3    defaults        0       2
/dev/hda8       none            swap    sw              0       0
/dev/hdb1       /storage/transfer	vfat    umask=000
/dev/sda6       /storage/win-programs	vfat    umask=000
/dev/sda7       /storage/win-games	vfat    umask=000
/dev/sda8       /storage/win-storage	vfat    umask=000

/dev/hdc        /media/dvdrom	udf,iso9660 ro,user,noauto  0       0
/dev/hdd        /media/cdrw	udf,iso9660 ro,user,noauto  0       0
/dev/fd0        /media/fdd	auto    rw,user,noauto  0       0
Now what's wrong with these sdx? The hdx just work and the format appeared identical to me.

Thanks.
 
Old 08-15-2005, 04:20 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
prepend the umask for the sda entries with a default,
 
Old 08-16-2005, 03:12 AM   #3
Navyblue
Member
 
Registered: Jul 2005
Posts: 161

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by Tinkster
prepend the umask for the sda entries with a default,
Just did that and it remains the same.

Btw, the error message during startup is:

Code:
mount: special device /dev/sda6 does not exist
mount: special device /dev/sda7 does not exist
mount: special device /dev/sda8 does not exist
It seems like the drive is not detected but Konqueror sees it and is able to mount it.
 
Old 08-16-2005, 08:12 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,931

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
Typically USB and SATA modules are not included in the initial ram disk (initrd) and therefore get loaded after the boot process mounts the filesystems via fstab. This is why you can see it in Konqueror but fails during boot.

You can add the noauto option to the fstab file so the filesystems are not mounted during bootup. Also adding the user option will let your regular users mount the filesystems too.

If you want the drives mounted at boot you can add the modules to the initrd or since Ubuntu does not use a rc.local file you can add a startup script to /etc/init.d and link to the runlevel directory. Use update-rc.d to create the proper links to rcN.d directories. Using a high number will ensure the script runs last. The defaults option automatically configures runlevels 2-5. If you look in one of the rcN.d directories you will find files like s##scriptname. The s## is the order in which the files are executed.

For example:
update-rc.d foo defaults 50
 
Old 08-16-2005, 02:05 PM   #5
Navyblue
Member
 
Registered: Jul 2005
Posts: 161

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by michaelk
Typically USB and SATA modules are not included in the initial ram disk (initrd) and therefore get loaded after the boot process mounts the filesystems via fstab. This is why you can see it in Konqueror but fails during boot.

You can add the noauto option to the fstab file so the filesystems are not mounted during bootup. Also adding the user option will let your regular users mount the filesystems too.

If you want the drives mounted at boot you can add the modules to the initrd or since Ubuntu does not use a rc.local file you can add a startup script to /etc/init.d and link to the runlevel directory. Use update-rc.d to create the proper links to rcN.d directories. Using a high number will ensure the script runs last. The defaults option automatically configures runlevels 2-5. If you look in one of the rcN.d directories you will find files like s##scriptname. The s## is the order in which the files are executed.

For example:
update-rc.d foo defaults 50
Thanks a lot for your help.

Would you mind if you elaborate more on it? (pardon me for being a newbie)

Assuming that I am going the route of putting a startup script to /etc/init.d.

How do I add a startup script to /etc/init.d? Can I just name it anyhow I like? Or this file is just a link to a script somewhere in /rcN.d?

How do I make the script in /rcN.d? Which directory should I put it in? for the s##scriptname, what number would you suggest me putting? Again can I name it anyhow I like?

Thanks again.
 
Old 08-16-2005, 06:13 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,931

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
The script can be named anything. You do not need to create a script in any rcN.d directory because that is what the update-rc.d utility does.

Create a script to mount the SATA drive partitions using any text editor. You need to be root to save files in /etc.

Code:
#!/bin/sh
mount /storage/win-games
mount /storage/win-programs
Save it to /etc/init.d directory. You can name it anything. i.e. my_script
Change its permissions. This will change the permissions and allow the script to execute:

chmod 755 my_script

To create the links in rcN.d:
update-rc.d my_script defaults 99

The 99 will cause this script to execute last. If you look in the rc2.d,rc3.d, rc4.d directories you should see a link called s99my_script.

Last edited by michaelk; 08-16-2005 at 06:16 PM.
 
Old 08-17-2005, 02:30 AM   #7
Navyblue
Member
 
Registered: Jul 2005
Posts: 161

Original Poster
Rep: Reputation: 30
Thanks for your patient step-by-step explaination. It now works perfectly.

What about the USB drive? How do I automount it when I insert it?

Thanks.
 
Old 08-21-2005, 12:53 PM   #8
Navyblue
Member
 
Registered: Jul 2005
Posts: 161

Original Poster
Rep: Reputation: 30
Anyone?
 
  


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
found problem now how to change from hda to sda bird603568 Slackware 29 10-28-2005 12:18 PM
Help me read hdb & sda from desktop icon m_lp_ql_m Linux - General 7 08-31-2005 09:19 AM
hda? sda? what do i have? nr5 Linux - Newbie 12 02-24-2005 07:50 PM
Can I swap hda and hdb? snatale1 Linux - Hardware 1 03-10-2004 02:23 AM
moving the HD from hdb to hda NGraphiX Linux - General 2 10-07-2002 05:23 PM


All times are GMT -5. The time now is 04:24 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration