LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices

Reply
 
Search this Thread
Old 11-30-2011, 12:01 PM   #1
mmhs
Member
 
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, 12:06 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,384

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
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, 06:01 PM   #3
DOSJockey382
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, 12:48 PM   #4
Lobinho
Member
 
Registered: May 2010
Distribution: Ubuntu
Posts: 67

Rep: Reputation: 17
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
 
Old 12-25-2011, 04:09 PM   #5
rayfward
Member
 
Registered: May 2009
Location: Leeds Uk
Distribution: Linux Ubuntu
Posts: 87

Rep: Reputation: 4
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
 
Old 12-26-2011, 05:40 AM   #6
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
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 05:43 AM. Reason: minor wording change
 
  


Reply


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


All times are GMT -5. The time now is 12:44 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration