/ Published in: Bash
this can obviously be easily adapted to any other device names. Some commands in here are redundant but all together are more likely to work.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
(make sure both devices are unmounted) # cat /proc/partitions # cd /dev # rm sda,sdb # mknod /dev/sda b # fill with major and minor devices obtained from /proc/partitions for sdb # mknod /dev/sdb b 8 0 # verify these major, minor values for sda in /proc/partitions # partprobe /dev/sda # hdparm -z /dev/sda # sfdisk -R /dev/sda # blockdev --rereadpt /dev/sda (repeat the last 4 commands for sdb) Alternatively and to make it permanent: create the file /etc/udev/rules.d/10-local.rules with the following content: KERNEL=="sda", NAME="sdb" KERNEL=="sdb", NAME="sda" (end of file) and then: # service udev restart # udevadm control --reload-rules # udevadm trigger