4

I would like to change the name of sda to Arch. How do I do that? I used e2label but it only works on filesystems and not on the raw disk.

nishant@arch ~ % lsblk -o name,mountpoint,label,size,uuid
NAME   MOUNTPOINT LABEL                SIZE UUID
sda               Lubuntu 14.10 i386 298.1G 2014-10-22-18-35-29-00
├─sda1 /boot      ArchBoot              99M 185f7c65-f7d0-48b0-88c2-ad47b843111f
└─sda2 /          ArchHome             298G 66404f2f-d171-4558-a842-485d2a28214d
sr0                                   1024M 
  • 1
    Hmm that's kind of weird. It seems some leftover of a Lubuntu iso (that is previously on the drive) remains. What fstype does sda has if you add fstype to -o? I bet it's iso9660? You probably want to run wipefs skilfully on sda to wipe the iso9660 signature while keeping your partition table intact. Dry run it with -a -n and see what's the proper -t you need (-t iso9660?). – Tom Yan Feb 13 '16 at 9:45
  • Its iso9660? I don't want to mess up. Do you mean wipefs -a -n /dev/sda first? It says the resource is busy. – Nishant Feb 13 '16 at 10:27
  • 1
    Yeah to see what signature it TRIES (-n) to erase, and then add an appropriate -t as mentioned as a filter and run again. If the verbose output shows that it runs as how you desired, then remove the -n to make it actually work. – Tom Yan Feb 13 '16 at 11:07
  • You probably need to do it with some live cd/usb, since it's your system drive. – Tom Yan Feb 13 '16 at 11:08
  • Alright Thanks. I will do this when I down my system! Its mostly up all the time. – Nishant Feb 15 '16 at 20:51
1

Since the switch to systemd it is actually not possible to change the default kernel device names anymore afaik. All that we can do is to create custom device symlinks with a udev rule. To do that, create a file in /etc/udev/rules.d/ named something like 80-custom.rules. The precise name doesn't matter as long as it matches the convention. In that file add the line:

KERNEL=="sda", SYMLINK+="arch"

Then after the next reboot, the system will create a symlink /dev/arch which points to /dev/sda.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.