ubuntu xchange /dev/sda with /dev/sdb

I want to change /dev/sda to /dev/sdb and /dev/sdb to /dev/sda .

I used following steps :

sudo hdparm -I /dev/sda | grep -A 2 Model

 

If anyone’s interested, I created a file called 10-local.rules in /etc/udev/rules.d:

# If the kernel matches a device as sda, change it to sdb.
 KERNEL=="sda", NAME="sdb"
# Vice versa.
 KERNEL=="sdb", NAME="sda"

 

#Add ID_SERIAL and other variables into the environment
ACTION=="add", KERNEL=="/dev/[sh]d[a-z]", IMPORT{program}="ata_id --export $tempnode"
#Add symlink to hard drive
KERNEL=="/dev/[sh]d[a-z]", ENV{ID_SERIAL}=="WD-WCANU1937055", SYMLINK+="timsdisks/500gb_a"

 

Reference :

http://stackoverflow.com/questions/18422500/how-do-you-swap-dev-sda-with-dev-sdb
The second possibility is to change UDEV rules. The rules will be processed during system boot, and guarantee you a permanently consistent behavior. A good guide on these rules ca be found here: http://www.reactivated.net/writing_udev_rules.html

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s