LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Change name of /dev/sda (https://www.linuxquestions.org/questions/linux-software-2/change-name-of-dev-sda-410434/)

kaboom 02-01-2006 11:16 AM

Change name of /dev/sda
 
Is it possible to change name of a device on /dev/sda to (for example) /dev/sdz ?

Or how can i give a certain device /dev/sdx ? Instead of the automatic creation of devices when installing an OS (like RHE3).

Thnks!

rylan76 02-01-2006 12:21 PM

Quote:

Originally Posted by kaboom
Is it possible to change name of a device on /dev/sda to (for example) /dev/sdz ?

Or how can i give a certain device /dev/sdx ? Instead of the automatic creation of devices when installing an OS (like RHE3).

Thnks!

I think you can use symlinks for this. I. e. not actually renaming the physical device, just making a symlink to it with the name you want to call it.

I, for example, wanted to do this to get MPlayer and Xine working for watching / playing DVD's. MPlayer wanted a /dev/dvd device to read DVD's, but I had no such device in my default setup. So I became root, and did the following:

cd /dev
ln -s /dev/dvd /dev/hdc1

This meant that effectively I "renamed" my IDE DVD drive (/dev/hdc1) to /dev/dvd as far as MPlayer was concerned, thus "renaming" /dev/hdc1 to /dev/dvd.

Hope this helps...

kaboom 02-02-2006 03:03 AM

Thanks Stefan, but this is the problem:

I have a linux server with /dev/sda and /dev/sdb (SATA discs)
Now i want to connect an external SCSI disc, but Linux gives this disc also /dev/sda, so problems!
So renaming will not be a solution, i just want that Linux makes it /dev/sdz or whatever.

THANKS!

vangelis 02-02-2006 06:00 AM

if you do a ls -l sg* in /dev it should normally print you sga to sgh
if not then you should create them by typing in the /dev directory
./MAKEDEV sg

it has more to do but I don't remember it exactly right now you should better google for '/dev/makedev scsi'
it should give you many tutorials

Emerson 02-02-2006 06:07 AM

In case you are using udev - Writing udev rules.

peter_89 02-02-2006 07:46 AM

Is there really a reason for you to do this?

Emerson 02-02-2006 07:59 AM

Quote:

Originally Posted by peter_89
Is there really a reason for you to do this?

To do what?
If an external device is always named same it enables user to use automated scripts on that device. Like automounting and so on.

caspervn 02-02-2006 09:05 AM

I think the problem is major and mirror number. You should read text in /usr/src/<kernle-version>/Documentation/devices.txt


All times are GMT -5. The time now is 05:40 AM.