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 09-23-2004, 09:08 PM   #1
kersten78
Member
 
Registered: Nov 2003
Location: Minneapolis, MN
Distribution: Slackware, Debian, Gentoo, openSuSE
Posts: 358

Rep: Reputation: 33
mounting CD, CDRW... /dev/cdrom -> /dev/hda


I read a bunch of threads about mounting CD's and I couldn't find anything to help me out.
My cdrw drive is /dev/hda and my cdrom is /dev/hdc.
What I want to do is change the pointer for /dev/cdrom to point at /dev/hdc, and I want to add a device /dev/cdrw that points to /dev/hda.
Is this possible? I tried creating a symlink /dev/cdrw that points to /dev/hda, but when I try to mount it I get "mount: special device hda doesn't exist." Is the /dev/cdrom more than just a symlink? From the way it looks, I should be able to create the /dev/cdrw symlink, include it in fstab, and mount away...but it doesn't work. Any ideas?
 
Old 09-23-2004, 09:19 PM   #2
kersten78
Member
 
Registered: Nov 2003
Location: Minneapolis, MN
Distribution: Slackware, Debian, Gentoo, openSuSE
Posts: 358

Original Poster
Rep: Reputation: 33
Uh oh. I may have screwed up my /dev/hda and /dev/hdc. When I looked at man ln, it said that the correct syntax was:
ln [source] [destination], so I did:
ln -s /dev/hda /dev/cdrw
ln -s /dev/hdc /dev/cdrom
But when I check the permissions for /dev/hda and /dev/hdc, they're listed as lrwxrwxrwx, like somehow they became links. The rest of the dev/hd* have permissions brw-rw----

heh. hahaha. this seems like it may be a problem.... since my /dev/cdrom is also a lrwxrwxrwx link pointing right back at /dev/hdc. Same with /dev/cdrw pointing to /dev/hda. Hooray for recursive symlinks (or special devices according to mount). Anyone have any idea how I might restore my /dev/hdc and /dev/hda back to their proper states?
-Kris
 
Old 09-23-2004, 09:42 PM   #3
kodon
Member
 
Registered: Jul 2004
Location: [jax][fl][usa]
Distribution: Slackware64-current
Posts: 796

Rep: Reputation: 31
which kernel are you using?
are hotplug and udev enabled?
 
Old 09-23-2004, 10:02 PM   #4
kersten78
Member
 
Registered: Nov 2003
Location: Minneapolis, MN
Distribution: Slackware, Debian, Gentoo, openSuSE
Posts: 358

Original Poster
Rep: Reputation: 33
Using 2.4.26, hotplug is disabled, and I'm not sure about udev... I don't think so.
 
Old 09-23-2004, 10:19 PM   #5
kodon
Member
 
Registered: Jul 2004
Location: [jax][fl][usa]
Distribution: Slackware64-current
Posts: 796

Rep: Reputation: 31
and you are just looking to correct your permissions?


does chmod not work?
 
Old 09-23-2004, 11:17 PM   #6
kersten78
Member
 
Registered: Nov 2003
Location: Minneapolis, MN
Distribution: Slackware, Debian, Gentoo, openSuSE
Posts: 358

Original Poster
Rep: Reputation: 33
No, the problem is in the first character of the permission. The usual "b" has been replaced by "l". Meaning that the original /dev/hda and /dev/hdc block device files have been replaced by sym links, rendering them useless. There is no longer a /dev file referring to either of my CD drives, just the recursive links:
/dev/hda <--> /dev/cdrw
/dev/hdc <--> /dev/cdrom

I need to find out if there's a way to restore the original /dev/hda and /dev/hdc files. I've found some references to the /dev/MAKEDEV script by googling, but from what I can tell, it's only for making links or new devices. Although, ls -l does list some of the settings for /dev files. Instead of the file size, ls -l shows two numbers representing the major and minor device number (used for kernel IO).
If someone could post the results of:
Code:
ls -l /dev/hd[a,c]
I may be able to rebuild the files using the mknod command. (I guess it's another option for building a device file, according to my googling. You just need the major and minor device numbers).
Thanks for the help.
 
Old 09-23-2004, 11:46 PM   #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
A crazy type solution would be to enable udev and reboot. Udev makes all the devices at boot time.
 
Old 09-23-2004, 11:47 PM   #8
kodon
Member
 
Registered: Jul 2004
Location: [jax][fl][usa]
Distribution: Slackware64-current
Posts: 796

Rep: Reputation: 31
BCD-F520D CD-ROM, ATAPI CD/DVD-ROM drive:
brw-rw---- 1 root cdrom 22, 0 2004-09-20 20:24 /dev/hdc

YAMAHA CRW2200E, ATAPI CD/DVD-ROM drive:
brw-rw---- 1 root cdrom 22, 64 2004-09-20 20:24 /dev/hdd
 
Old 09-23-2004, 11:49 PM   #9
kersten78
Member
 
Registered: Nov 2003
Location: Minneapolis, MN
Distribution: Slackware, Debian, Gentoo, openSuSE
Posts: 358

Original Poster
Rep: Reputation: 33
Ok, it's all fixed. mknod worked. I just had to google to find the right major and minor device numbers. I did have to change the group of both files however--they were both created in the root group rather than disk group
Then I made the proper symlinks:
/dev/cdrw -> /dev/hda
/dev/cdrom -> /dev/hdc

What's weird though, is my fstab. I had to leave the devices listed as /dev/hda and /dev/hdc. When I had them listed as /dev/cdrom and /dev/cdrw in fstab and issued a "mount cdrom" or "mount cdrw" I got an error: device hda not listed in fstab blah blah.
Anyway, it all works with a simple "mount cdrom" or "mount cdrw" Beautiful. Now to see if I can mount them as anything other than root.
 
Old 09-23-2004, 11:53 PM   #10
kersten78
Member
 
Registered: Nov 2003
Location: Minneapolis, MN
Distribution: Slackware, Debian, Gentoo, openSuSE
Posts: 358

Original Poster
Rep: Reputation: 33
LOL at the crazy type solution. That probably would have been easier...I've never even heard of udev... oh well.
And I lied about "mount cdrom" haha that only works when I'm in the /dev directory. I gave up root privileges and thought I broke it again....until I realized that I wasn't in the /dev directory anymore. Working like a charm...thanks for the help everybody.
 
  


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
I cannot access EITHER CD drive! And there's no /dev/hdc or /dev/hdd or /dev/cdrom! Dmalic Linux - Hardware 13 11-18-2005 07:11 PM
/dev/hda under lilo.conf even thoug my HD is under /dev/hdb Basel Slackware 8 10-27-2005 06:00 PM
dd if=/dev/hda of=dev/hdb taking forever to complete fechin Linux - Hardware 7 06-19-2005 12:04 AM
How can I boot either one of my hard drives /dev/hda or /dev/hdb, I have RH9 and FC2 omogunkristi Linux - General 1 06-21-2004 05:11 AM
mounting 2 ide-scsi devices /dev/cdrom and /dev/cdrom1 issue penguin123 Linux - Hardware 3 09-26-2003 08:36 PM

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

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