PDA

View Full Version : Reset device numbering after removing device? /dev/sda, sdb, sdc, etc



spockswhitepants
January 19th, 2015, 05:09 PM
I had a hardware RAID array on /dev/sdb (looks like a single disk to linux). I added another drive and transfered the data off (sdc). Now I removed the array and I am left with sda and sdc with sdb being the non-existant array. Is there a way to free up sdb and force sdc to move to sdb?

Jonor
January 23rd, 2015, 08:27 PM
Try temporarily removing the other drive, booting, then adding it again.

nerdtron
January 25th, 2015, 08:10 AM
I had a hardware RAID array on /dev/sdb (looks like a single disk to linux). I added another drive and transfered the data off (sdc). Now I removed the array and I am left with sda and sdc with sdb being the non-existant array. Is there a way to free up sdb and force sdc to move to sdb?

sda, sdb, or sdc means they are on the sata port 1, port 2, and port 3, You can move the new hard drive to the same port as the /dev/sdb.

bab1
January 25th, 2015, 09:34 AM
sda, sdb, or sdc means they are on the sata port 1, port 2, and port 3, You can move the new hard drive to the same port as the /dev/sdb.
This is not nessesaraly true. The device name is assigned by the kernel as it is enumerated (found). If you where to add a usb flash, ssd or hard drive the device name can change.

The OP could assign the names (sda, sdb, etc.) using udev rules ( see here (http://stackoverflow.com/questions/18422500/how-do-you-swap-dev-sda-with-dev-sdb), but there really is no reason to do that. The partitions (sda1, sdb2, etc.) should referred to by their UUID (blkid) or assigned a lablel. The device name assigned by the kernal is only relevent to the kernel, which manages that information internally.