LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-21-2003, 11:42 PM   #1
rickenbacherus
Member
 
Registered: Mar 2003
Location: colorado springs. colorado
Distribution: Debian-Sid 2.6.24-rt1
Posts: 290

Rep: Reputation: 30
fstab, device names, mnt points, symlinks


My system:
hda-Primary/Master-20G ide
hdb-CD-R-Primary/Slave
hdc-DVD-Secondary/Master

Are the following 2 statements correct?
Since hdb invokes scsi emulation hdb is also known as sr0 & sr0 is also known as scd0 & scd0 is also known as sda. The same is true of hdc=sr1=scd1=sdb. hmmmm....Why so many references to the same drive? What tells me to use /sr0 instead of /scd0 for example?.

Maybe I don't fully understand what fstab does; each line has to have a device name of course-but which device name, does the mount point go there too?-first or second? What about symlinks? Are there any hard and fast rules for fstab. I'm missing something easy here.

I don't seem to relate well to info pages and man pages. Once I understand what I'm doing I can go there for reference but to learn how to use something...... I guess I prefer visual representations. Anybody seen a chart/diagram for symlinks & devices & etc.?

I'd shore 'preciate it could sumbuddy dumb it down for me! All the other kids are compiling kernels and I can't get past this!!
 
Old 03-22-2003, 12:57 AM   #2
mcleodnine
Senior Member
 
Registered: May 2001
Location: Left Coast - Canada
Distribution: s l a c k w a r e
Posts: 2,731

Rep: Reputation: 45
Re: fstab, device names, mnt points, symlinks

Quote:
Originally posted by rickenbacherus
My system:
hda-Primary/Master-20G ide
hdb-CD-R-Primary/Slave
hdc-DVD-Secondary/Master

Are the following 2 statements correct?

Since hdb invokes scsi emulation hdb is also known as sr0 & sr0 is also known as scd0 & scd0 is also known as sda. The same is true of hdc=sr1=scd1=sdb. hmmmm....Why so many references to the same drive? What tells me to use /sr0 instead of /scd0 for example?.
ide-scsi requires a kernel parameter (usually invoked by lilo or grub) such as 'hdb=ide-scsi'. 'ide-scsi' is required to let your cd recording software talk to your CD-R/W drives. Loading the module ide-scsi will not automatically make all IDE devices SCSI-ish and I've never used it for a plain old hard disk. Not even sure if it's a good idea to do so.
Quote:

Maybe I don't fully understand what fstab does; each line has to have a device name of course-but which device name, does the mount point go there too?-first or second? What about symlinks? Are there any hard and fast rules for fstab. I'm missing something easy here.

'fstab' tells the kernel where to mount the devices and reads like this (in this order) block device, mount point, filesystem type, mount options, dump, and pass (the latter two items are used for dump and fsck order - see the man pages 'man fstab' for more info).

The links in the /dev directory seem odd af first but are actaully quite handy when things change on your system. Say for example you have a cdrom drive on /dev/hdc. You tell /etc/fstab and all your software that uses the cdrom to look for it at /dev/hdc and everything works fine. But when you make a change in your system, say moving your cdrom to /dev/hdd, all applications that use the cdrom (and your /etc/fstab) will have to be told where you moved it to. But if you were using a link to your cdrom drive (/dev/cdrom -> /dev/hdc) and you told you software to use /dev/cdrom, all you need to change is the link /dev/cdrom -> /dev/hdd. The same holds true for other devices, like a mouse or a modem. Using /dev/mouse means that if you were to buy a flashy new cordless optical vibrating USB chromed mouse you would only need to change the link /dev/mouse to point to the device under the /dev filesystem.
Quote:

I don't seem to relate well to info pages and man pages. Once I understand what I'm doing I can go there for reference but to learn how to use something...... I guess I prefer visual representations. Anybody seen a chart/diagram for symlinks & devices & etc.?

I'd shore 'preciate it could sumbuddy dumb it down for me! All the other kids are compiling kernels and I can't get past this!!
 
Old 03-23-2003, 07:49 AM   #3
rickenbacherus
Member
 
Registered: Mar 2003
Location: colorado springs. colorado
Distribution: Debian-Sid 2.6.24-rt1
Posts: 290

Original Poster
Rep: Reputation: 30
Re: Re: fstab, device names, mnt points, symlinks

Thanks mcleodnine for clarifying a few things for me. I'm getting closer.
My cdrom is scd0 and my dvd is scd1. If I plug these variables into xine everything works fine so I am certain that scd0 & scd1 are correct but as you stated:
Quote:
Originally posted by mcleodnine
when you make a change in your system, say moving your cdrom to /dev/hdd, all applications that use the cdrom (and your /etc/fstab) will have to be told where you moved it to. But if you were using a link to your cdrom drive (/dev/cdrom -> /dev/hdc) and you told you software to use /dev/cdrom, all you need to change is the link /dev/cdrom -> /dev/hdd.
With that in mind I have then created these links:

ln -s scd0 /dev/cdrom
ln -s scd1 /dev/dvd

and the following shows that I did in fact create the links:

ls -a /dev/cdrom
. . . scd0
ls -a /dev/dvd
. . . scd1

--I'm not sure what the '. . .' means.

Here are the corresponding lines from fstab
/dev/cdrom /mnt/cdrom iso9660defaults,ro,user,noexec,noauto 0 0
/dev/dvd /mnt/dvd iso9660 defaults,ro,user,noexec,noauto 0 0

If I put /dev/cdrom & /dev/dvd into xine it won't work.
If I try to mount /dev/cdrom or /dev/dvd with data disks in them I get the 'not a valid block device' error. I think it's my fstab that's incorrect but I don't know how to fix it. Thanks again for any help.

edit - maybe this is of some help
root@cromag:# ls -al /dev/cdrom
total 36
drwxr-xr-x 2 root root 4096 Mar 22 20:31 .
drwxr-xr-x 12 root root 32768 Mar 22 20:08 ..
lrwxrwxrwx 1 root root 4 Mar 22 20:31 scd0 -> scd0
root@cromag:# ls -al /dev/dvd
total 36
drwxr-xr-x 2 root root 4096 Mar 22 20:31 .
drwxr-xr-x 12 root root 32768 Mar 22 20:08 ..
lrwxrwxrwx 1 root root 4 Mar 22 20:31 scd1 -> scd1

Last edited by rickenbacherus; 03-23-2003 at 08:07 AM.
 
Old 03-23-2003, 07:57 AM   #4
mcleodnine
Senior Member
 
Registered: May 2001
Location: Left Coast - Canada
Distribution: s l a c k w a r e
Posts: 2,731

Rep: Reputation: 45
ln -s /dev/scd0 /dev/cdrom
 
Old 03-23-2003, 08:20 AM   #5
rickenbacherus
Member
 
Registered: Mar 2003
Location: colorado springs. colorado
Distribution: Debian-Sid 2.6.24-rt1
Posts: 290

Original Poster
Rep: Reputation: 30
OK I linked them the same way you did and here I am:

root@cromag:~# ls -al /dev/scd0
brw-rw---- 1 root lpadmin 11, 0 May 31 2001 /dev/scd0
root@cromag:~# ls -al /dev/cdrom
total 36
drwxr-xr-x 2 root root 4096 Mar 23 07:06 .
drwxr-xr-x 12 root root 32768 Mar 22 20:08 ..
lrwxrwxrwx 1 root root 9 Mar 23 07:06 scd0 -> /dev/scd0
root@cromag:~# ls -al /dev/scd1
brw-rw---- 1 root lpadmin 11, 1 May 31 2001 /dev/scd1
root@cromag:~# ls -al /dev/dvd
total 36
drwxr-xr-x 2 root root 4096 Mar 23 07:06 .
drwxr-xr-x 12 root root 32768 Mar 22 20:08 ..
lrwxrwxrwx 1 root root 9 Mar 23 07:06 scd1 -> /dev/scd1

Still not right though is it?

thanks again mcleodnine
 
Old 03-23-2003, 09:15 AM   #6
mcleodnine
Senior Member
 
Registered: May 2001
Location: Left Coast - Canada
Distribution: s l a c k w a r e
Posts: 2,731

Rep: Reputation: 45
yeah that looks right.... do they work when you use the actual /dev/scd0 instead of /dev/cdrom?
 
Old 03-23-2003, 12:23 PM   #7
rickenbacherus
Member
 
Registered: Mar 2003
Location: colorado springs. colorado
Distribution: Debian-Sid 2.6.24-rt1
Posts: 290

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by mcleodnine
do they work when you use the actual /dev/scd0 instead of /dev/cdrom?
Correct- xine works if I use /dev/scd0 & /dev/scd1. Xine will not work with /dev/cdrom or /dev/dvd
With data disks inserted I cannot mount either drive like this:.

root@cromag:/home/glenn# mount /dev/dvd /mnt/dvd
mount: /dev/dvd is not a block device
root@cromag:/home/glenn# mount /dev/cdrom /mnt/cdrom
mount: /dev/cdrom is not a block device
root@cromag:/home/glenn#

This doesn't work either:
mount -t auto /dev/dvd /mnt/dvd

But I can mount them like this:

root@cromag:~# mount /dev/scd1 /mnt/dvd
mount: block device /dev/scd1 is write-protected, mounting read-only

Here are fstab lines
/dev/cdrom /mnt/cdrom iso9660 defaults,ro,user,noexec,noauto 0 0
/dev/dvd /mnt/dvd iso9660 defaults,ro,user,noexec,noauto

This doesn't seem right to me:
root@cromag:~# ls -al /dev/cdrom
total 36
drwxr-xr-x 2 root root 4096 Mar 23 07:06 .<-is this normal?
drwxr-xr-x 12 root root 32768 Mar 23 09:20 ..<-is this normal?
lrwxrwxrwx 1 root root 9 Mar 23 07:06 scd0 -> /dev/scd0


Thank you for your help.
 
Old 03-24-2003, 05:29 AM   #8
mcleodnine
Senior Member
 
Registered: May 2001
Location: Left Coast - Canada
Distribution: s l a c k w a r e
Posts: 2,731

Rep: Reputation: 45
ok... 'rm /dev/dvd' and 'rm /dev/cdrom'

then try...

'ln -s /dev/scd0 /dev/cdrom'
'ln -s /dev/scd1 /dev/dvd'
 
Old 03-24-2003, 06:06 AM   #9
rickenbacherus
Member
 
Registered: Mar 2003
Location: colorado springs. colorado
Distribution: Debian-Sid 2.6.24-rt1
Posts: 290

Original Poster
Rep: Reputation: 30
eureka!
I removed all the links, relinked and now everything seems to be hunky -dory. Not sure what I had jammed up but removing the links seemed to do the trick. Thanks mcleodnine for your help- mucho appreciado hombre'

oops- almost forgot, I also removed the cdrom & dvd directories, recreated them and then relinked.

Last edited by rickenbacherus; 03-24-2003 at 06:23 AM.
 
  


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
fstab changes and symlinks gone after reboot in FC3 GKid Fedora 1 03-15-2005 11:55 AM
moving mount points in fstab s_siouris Linux - General 1 01-27-2005 08:48 AM
/etc/fstab - /mnt/cdrom d1l2w3 Linux - Hardware 10 01-08-2005 08:33 PM
Logical device names and instant names Gins Linux - General 8 11-30-2004 08:17 PM
Screwed up mnt points with mandrake control center mitchmiller Mandriva 5 02-26-2004 05:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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