LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   change /dev/sdc2 name (http://www.linuxquestions.org/questions/linux-newbie-8/change-dev-sdc2-name-916404/)

mmhs 11-30-2011 01:01 PM

change /dev/sdc2 name
 
hi guys i have a simple question

how can i change /dev/sdc2 to /dev/mhs ??

and how can change eth0 name ??

acid_kewpie 11-30-2011 01:06 PM

Why would you want to?? you an add names by tuning udev rules if you NEED to, but I find that very hard to believe. If it's an ext filesystem, just use e2label to set a label on the partition and mount it from that.

Don't fight things unless you have a very good reason. It just makes life much harder.

DOSJockey382 11-30-2011 07:01 PM

I don't know if this will get the job done for your needs, but you can always make a symbolic link with your new names to the old established /dev references. You've seen /dev/dvd or /dev/cdrom or something similar. Those are nothing but symbolic links to the actual /dev/sd##. That way you don't have to really change any config, but still have the option of additional reference names for the same device.

Lobinho 12-01-2011 01:48 PM

I'm with DOSJockey382.

Try to create a symbolic link.
Code:

ln -s /dev/sdc2 /dev/mhs
ln -s /dev/eth0 /dev/yourCustomDeviceName

This will keep the original link (/dev/eth0) intact, and avoid any other eventual problem with programs that uses /dev/eth0...

http://linux.about.com/od/commands/l/blcmdl1_ln.htm

rayfward 12-25-2011 05:09 PM

Use Udev rules. It uses device id's to create aliases same as ln but automatically at boot time
Take a look at this. There are some nice examples.
http://reactivated.net/writing_udev_rules.html

David the H. 12-26-2011 06:40 AM

While it is possible to simply create a symlink, many, if not most, distros these days put /dev on a virtual RAM filesystem, and any changes you make will be lost on the next reboot.

The proper way to change a device entry is to use a udev rule. And even then it's generally better to leave the original as-is and tell it to simply create a symlink to it with the name you want.


All times are GMT -5. The time now is 02:40 PM.