LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-11-2006, 08:24 AM   #1
stevielawson
Member
 
Registered: Sep 2004
Location: Scotland
Posts: 41

Rep: Reputation: 15
questions re mount points


I've been studying various postings and, in particularly, Shilo's excellent Slackware installation guide regarding mounting drives/fstab/mt etc, and wonder if someone can answer these questions for me.
Here's an extract from Shilo's guide:
Quote:
I also had to create /mnt/cd-rw, /mnt/dvd-rom, /dev/cd-rw, and /dev/dvd-rom. The devices I created are links to /dev/hdc and /dev/hdd . To give you an example of how I did this, you can use a command like "ln -s /dev/hdc /dev/hdd ". While we are working on the optical drives, nows a good time to make sure that /dev/dvd and /dev/cdrom point where you want them to. Also, check to see that users have permission to use all of those devices.
I understand creating /mnt/cd-rw, /mnt/dvd-rom but how do I go about "creating links to /dev/hdc and /dev/hdd"?

How do you make sure /dev/dvd and /dev/cdrom point to hdc and hdd?

And finally, how do I make sure all users have permission to use all of those devices?

Sorry if these questions are totally obvious but I'm going round in a few circles trying to configure my cd-rw and dvd-rom drives properly.
 
Old 01-11-2006, 09:35 AM   #2
MMYoung
Member
 
Registered: Apr 2004
Location: Arkansas
Distribution: Ubuntu 8.10
Posts: 365

Rep: Reputation: 30
Quote:
Originally Posted by stevielawson
I understand creating /mnt/cd-rw, /mnt/dvd-rom but how do I go about "creating links to /dev/hdc and /dev/hdd"?

How do you make sure /dev/dvd and /dev/cdrom point to hdc and hdd?
What he's talking about, IIRC, are "symlinks". These have to be created by root. So either open a terminal and log in as root, or if you haven't started X just log in as root and type in:
Code:
ln -s /dev/hdc /dev/cdrom
ln -s /dev/hdd /dev/dvd
Now you will have two symlinks in /dev and you can make sure they are pointing to the correct location by:
Code:
ls -l /dev/cdrom
ls -l /dev/dvd
These are, of course, examples and your configuration my be a little different.
Quote:
Originally Posted by stevielawson
And finally, how do I make sure all users have permission to use all of those devices?
In this instance I think the proper way to assign user permissions it through the entry in /etc/fstab. For example:

/dev/cdrom /mnt/cdrom auto noauto,user,ro 0 0

This sets the mount point for /dev/cdrom (the symlink in /dev that points to /dev/hdc) as /mnt/cdrom. The next auto sets the filesystem to autodetect (you could safely put iso9660 here if all you ever put in the device are CD's). Noauto in the next grouping tells the kernel not to mount the filesystem at boot, user means that any user can mount and unmount the filesystem, and ro means read-only. the 0 0 in the next grouping is about how the kernel treats the filesystem when booting (dumping and fschk'ing and such).

HTH,
MMYoung
 
Old 01-11-2006, 11:37 AM   #3
shilo
Senior Member
 
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132

Rep: Reputation: 50
This can be confusing, especially because it depends on whether or not you are using UDEV.

If you are using a 2.4.x kernel, you will do what MMYoung suggested, though there is one important clarification needed. Let's just deal with one drive first. For the other, you will just repeat (changing the relevant parts).

SO, I have a CD-ROM and it is recognized as /dev/hdc. First, I decide where I want to mount that CD-ROM. I'll choose /mnt/cdrom. Create that if it doesn't already exist:

Code:
mkdir /mnt/cdrom
Now, create the symlink:

Code:
ln -s /dev/hdc /dev/cdrom
Now, edit /etc/fstab to look like this:

Code:
/dev/cdrom  /mnt/cdrom  iso9660  noauto,user,ro  0 0
Let's look at that line for a moment. We see that I used "iso9660" where MMYoung used "auto". The optical device will be using iso9660, so that is a valid choice. MMYoung's use of auto works equally well, though. It is a matter of preference. It's early, and I'm having trouble remembering if some DVDs use a different filesystem, so maybe auto is actually the better choice.

Next thing to note is that I have used "user". You can replace that with "users" if you like. I actually prefer "users". The difference is this: If you are using "user" and user A mounts the device, only user A (or root) can umount the device. If user A left for the day, you may have issues. If you are using "users", then a device mounted by user A can be umounted by anyone.

The most important thing to note, though, is that you haven't dealt with permissions yet. People get confused. /etc/fstab gives the user permission to mount the device. Your user still needds permission to work with the device. Also important is that permissions on symlinks don't really count:

Code:
shilo@shilo2:~$ ls -l /dev/cdrom
lrwxrwxrwx  1 root root 3 2006-01-11 08:25 /dev/cdrom -> hdc
See, the permissions look to be wide open. But the "l" indicates that this is a symbolic link, therefore the permissions of the actual device are what is used.

I don't have a stock setup, but I believe that you will find, /dev/hdc comes with permissions/ownership such that all that is needed is to add the user to the "cdrom" group. This should be sufficient. Alternatively, you can use a combination of chmod and chown to give the premissions and ownership to /dev/hdc. I think it's much easier to add the user to the "cdrom" group, though.

If you don't know how to add the user to the "cdrom" group, all you have to do is edit /etc/group, adding the user name after cdrom, like this:

Code:
cdrom::19:shilo,lori,joe,casey
Now, if you are running a 2.4.x kernel, you should be all set (reboot for good luck, later, learn to do it without rebooting).

If you are running a 2.6.x kernel, things may be different. It will depend on if you are running UDEV. If you are running UDEV, creating symlinks manually (as described above) will drive you CRAZY if you don't know that /dev gets re-created every time you boot. That means your symli9nks get lost.

PV has a little bit of code that is supposed to take care of symlinks in /etc/udev/rules/make_extra_nodes.sh that looks like:

Code:
# If we can, add a default /dev/cdrom and /dev/dvd link:
#cd_num=0
#dvd_num=0
#if /bin/ls -l /dev | grep -wq cdrom ; then
#  ( cd $udev_root
#    /bin/ls -l * | grep -w cdrom | cut -f 2 -d : | cut -f 2 -d ' ' | while read optical_device ; do
#      # It has to be a cdrom.  Assign consecutive numbers to drives.
#      if [ "$cd_num" = "0" ]; then
#        ln -sf $optical_device cdrom
#        ln -sf $optical_device cdrom0
#      else
#        ln -sf $optical_device cdrom${cd_num}
#      fi
#      cd_num=$(($cd_num + 1))
#      # If it's a DVD, set that link as well:
#      if grep -iq dvd /proc/ide/$optical_device/model ; then
#        if [ "$dvd_num" = "0" ]; then
#          ln -sf $optical_device dvd
#          ln -sf $optical_device dvd0
#        else
#          ln -sf $optical_device dvd${dvd_num}
#        fi
#	dvd_num=$(($dvd_num + 1))
#      fi
#    done
#    unset optical_device
#  )
#fi
#unset cd_num
#unset dvd_num
Noite that mine is all commented out. That's because I don't like it. It may work well for you, in which case, leave it alone. If it doesn't work well for you, comment it out (like I did). You will then need to create a file called /etc/udev/rules.d/local.rules with something like:

Code:
KERNEL="hdc", SYMLINK="dvd dvdrw cdroms/dvdrw cdroms/cdrom0"
KERNEL="hdd", SYMLINK="cdrom dvdrom cdroms/dvdrom cdroms/cdrom1"
Either way should work.
 
Old 01-11-2006, 01:11 PM   #4
MMYoung
Member
 
Registered: Apr 2004
Location: Arkansas
Distribution: Ubuntu 8.10
Posts: 365

Rep: Reputation: 30
Quote:
Originally Posted by shilo
This can be confusing, especially because it depends on whether or not you are using UDEV.
I was working under the assumption that the OP was using the stock kernel installed by Slackware. If he/she is using a 2.6 kernel and /etc/rc.d/rc.udev is starting at boot, it does get a "little" more complicated as you posted.
Quote:
Originally Posted by shilo
Let's look at that line for a moment. We see that I used "iso9660" where MMYoung used "auto". The optical device will be using iso9660, so that is a valid choice. MMYoung's use of auto works equally well, though. It is a matter of preference. It's early, and I'm having trouble remembering if some DVDs use a different filesystem, so maybe auto is actually the better choice.
DVD's actually use the UDF filesystem, which is why I chose auto as my "cdrom" is actually a DVD/CD writer/reader. I first started to put iso9660 in my post but opted for auto just in case the OP had a DVD/CD drive.
Quote:
Originally Posted by shilo
Next thing to note is that I have used "user". You can replace that with "users" if you like. I actually prefer "users". The difference is this: If you are using "user" and user A mounts the device, only user A (or root) can umount the device. If user A left for the day, you may have issues. If you are using "users", then a device mounted by user A can be umounted by anyone.
I used to use "users" but for the life of me now I can't remember why I started using "user". Users is a much better choice, IMHO. (runs off to edit /etc/fstab)

Also I've found that the new /etc/udev/scripts/make_extra_nodes.sh does a "decent" job of setting up both of my CD/DVD devices. If on the other hand you want to set up your own rules in /etc/udev/rules.d you will need to comment it out. Might be best, as a start and if the OP is using a 2.6 kernel, to see if it works to his/her liking, or at least works . Then he/she might want to delve into the arcane art of udev rule writing. Again just a suggestion.

BTW, I forgot to mention the group permissions issue, good catch.

Later,
MMYoung
 
Old 01-11-2006, 06:06 PM   #5
stevielawson
Member
 
Registered: Sep 2004
Location: Scotland
Posts: 41

Original Poster
Rep: Reputation: 15
Shilo/MMYoung...
Thanks for the detailed advice - I'll get to work on this over the next few days and post back when I've had some success.
BTW, I'm using the stock 2.4.31 kernel, so Shilo - your first suggestions are the most relevant.
And BTW again MMYoung - I'm a bloke!
Regards,
Steve
 
Old 01-14-2006, 05:45 PM   #6
stevielawson
Member
 
Registered: Sep 2004
Location: Scotland
Posts: 41

Original Poster
Rep: Reputation: 15
Just a note to say thanks to Shilo and MMYoung for their help - my DVD-ROM is now successfully mounted with no major drama! I followed Shilo's advice for the 2.4.31 kernel and it worked a treat.
I have one minor question to follow up with - my CD-RW was detected and set-up during my v10.2 installation but it was wrongly identified as a straightforward CDROM. Does this matter? I'd test it with K3B but I don't have any spare blank disks at the moment.
Thanks again guys - major kudos for the patience with a total command line newbie.
 
Old 01-15-2006, 02:59 AM   #7
shilo
Senior Member
 
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132

Rep: Reputation: 50
Probably doesn't matter. Mostly depends on what you mean when you say "identified." If you are basing that on the autonatically generated fstab entry, it doesn't matter. Scan /var/log/dmesg to see the real story.
 
  


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
need help with mount points! rmanocha Linux - Hardware 2 10-26-2003 03:23 PM
help with mount points rmanocha Linux - Software 12 10-26-2003 01:32 PM
SCRIPT: check if auto-mount mount-points are still mounted markus1982 Linux - Software 0 05-25-2003 05:48 AM
Mount Points? Mr_Floppy4 Linux - General 2 10-14-2002 10:03 PM
mount points... Jeffrey Linux - General 6 02-24-2001 12:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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