Operating System - HP-UX
1835986 Members
2001 Online
110088 Solutions
New Discussion

How to link /dev/cdrom to /dev/dsk/c3t2d0. So I can use mount /dev/cdrom /cdrom

 
SOLVED
Go to solution
Joe Profaizer
Super Advisor

How to link /dev/cdrom to /dev/dsk/c3t2d0. So I can use mount /dev/cdrom /cdrom

I forgot how to link or set up /dev/cdrom to take place of my actual cdrom device file (/dev/dsk/c3t2d0). Do I just cp /dev/dsk/c2t2d0 /dev/cdrom?

I just cant remember how to do this and I know it's any easy linking or command.

Please assist.
8 REPLIES 8
Marco Santerre
Honored Contributor
Solution

Re: How to link /dev/cdrom to /dev/dsk/c3t2d0. So I can use mount /dev/cdrom /cdrom

No you just have to perform a normal symbolic link command

ln -s /dev/cdrom /dev/dsk/c3t2d0

That's it
Cooperation is doing with a smile what you have to do anyhow.
A. Clay Stephenson
Acclaimed Contributor

Re: How to link /dev/cdrom to /dev/dsk/c3t2d0. So I can use mount /dev/cdrom /cdrom

First do an ls -l of /dev/dsk/c3t2d0 and note the major and minor device numbers.

e.g.
brw-r----- 1 bin sys 31 0x022000 date /dev/dsk/c2t2d0

Now, use the mknod command to create a block device with the same major/minor device number tuple.

mknod /dev/cdrom b 31 0x022000

You might also want to create the raw (character) device node as well. Do as ls -l of /dev/rdsk/c2t2d0 and again nore the device numbers.

mknod /dev/rcdrom c 188 0x022000 (or whatever the appropriate major/minor values are)
If it ain't broke, I can fix that.
Patrick Wallek
Honored Contributor

Re: How to link /dev/cdrom to /dev/dsk/c3t2d0. So I can use mount /dev/cdrom /cdrom

Mario's got it backwards:

# ln -s /dev/dsk/c3t2d0 /dev/dsk/cdrom

I also do:

# ln -s /dev/rdsk/c3t2d0 /dev/rdsk/cdrom
John Poff
Honored Contributor

Re: How to link /dev/cdrom to /dev/dsk/c3t2d0. So I can use mount /dev/cdrom /cdrom

Hi,

I agree with Clay. I'd make /dev/dsk/cdrom by doing the 'mknod' instead of the symlink.

JP
John Meissner
Esteemed Contributor

Re: How to link /dev/cdrom to /dev/dsk/c3t2d0. So I can use mount /dev/cdrom /cdrom

Yes when linking files this is the propper syntax

ln -s realfile linked_file
ln [options] [filename] [linkname]
All paths lead to destiny
Marco Santerre
Honored Contributor

Re: How to link /dev/cdrom to /dev/dsk/c3t2d0. So I can use mount /dev/cdrom /cdrom

Sorry, I often get confused with the order in my mind.. I guess I hold way too much information than what my memory can actually hold.. hehe
Cooperation is doing with a smile what you have to do anyhow.
Frank Slootweg
Honored Contributor

Re: How to link /dev/cdrom to /dev/dsk/c3t2d0. So I can use mount /dev/cdrom /cdrom

I advise to make a *hard* link, i.e. not a soft/symbolic link, i.e. leave of the "-s" option.

Hard links are also used for other device files, like /dev/rmt/0m and since all /dev files are on the same filesystem, a soft/symbolic link is not needed.

Clay and John, *why* do you prefer mknod? IMO it can only lead to problems when one for example changes (remove/re-add) one device file and forgets to change the other(s).

John Poff
Honored Contributor

Re: How to link /dev/cdrom to /dev/dsk/c3t2d0. So I can use mount /dev/cdrom /cdrom

Hi Frank,

My point was simply that given the choice between creating a symlink or using mknod to create the device file, I would choose mknod.

I agree with you that a hard link would work as well, but wouldn't you still face a problem if the device changes, even with a hard link?

JP