Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-30-2011, 01:01 PM   #1
Registered: Oct 2010
Posts: 99

Rep: Reputation: 1
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 ??
Old 11-30-2011, 01:06 PM   #2
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975
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.
Old 11-30-2011, 07:01 PM   #3
LQ Newbie
Registered: Aug 2005
Location: California
Distribution: Debian, Ubuntu, NetBSD, OS X
Posts: 25

Rep: Reputation: 15
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.
Old 12-01-2011, 01:48 PM   #4
Registered: May 2010
Distribution: Ubuntu
Posts: 72

Rep: Reputation: 18
I'm with DOSJockey382.

Try to create a symbolic link.
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...
Old 12-25-2011, 05:09 PM   #5
Registered: May 2009
Location: Leeds Uk
Distribution: Linux Mint 18
Posts: 110

Rep: Reputation: 12
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.
Old 12-26-2011, 06:40 AM   #6
David the H.
Bash Guru
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian + kde 4 / 5
Posts: 6,834

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
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.

Last edited by David the H.; 12-26-2011 at 06:43 AM. Reason: minor wording change


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
pseudo terminals: /dev/ptmx <-> /dev/pts/ vs. /dev/ptyp <-> /dev/ttyp rtspitz Linux - Software 2 12-02-2011 03:07 PM
Change name of /dev/sda kaboom Linux - Software 7 02-02-2006 10:05 AM
Change /dev Designation? Cicatriz Linux - Newbie 4 03-11-2005 01:57 PM
contents of /dev change at every boot? rgiggs Slackware 2 07-03-2004 12:33 AM
how to change /dev/hdd to /dev/zip in Suse 9.0 scarah Linux - Hardware 9 01-15-2004 04:33 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:07 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration