Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 1698  / 2 Years ago, wed, november 16, 2022, 4:57:34

On my workstation after boot, sometimes the name for my same harddisk in linux changes from /dev/sdg/ to /dev/sdi/

How can I make this fixed, that the UUID is mounted exactly with the name /dev/sda for example?



The problem comes from making a virtual machine from a raw file:



VBoxManage internalcommands createrawvmdk -filename ~/.VirtualBox/win7.vmdk -rawdisk /dev/sdg -partitions 2,3 -mbr ~/.VirtualBox/FAKE.mbr -relative


If now the name /dev/sdg changes to /dev/sdi my virtual machine has troubles to start...


More From » mount

 Answers
0

The answer is to use a udev rule:



KERNEL=="sd[a-z][0-9]", SUBSYSTEM=="block", SUBSYSTEMS=="scsi", ATTRS{model}=="Crucial_CT480M50", SYMLINK+="bootdevice%n"
KERNEL=="sd?", SUBSYSTEM=="block", SUBSYSTEMS=="scsi", ATTRS{model}=="Crucial_CT480M50", SYMLINK+="bootdevice"


in a file /etc/udev/rules.d/mybootdevice.rules



(how to adapt the attributes to fit your devive look here : here)



Then restart udev:



sudo udevadm trigger


Then there will be a /dev/bootdevice



which is persistent after every boot!


[#23281] Thursday, November 17, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tusmuumu

Total Points: 195
Total Questions: 122
Total Answers: 104

Location: Oman
Member since Tue, Feb 7, 2023
1 Year ago
;