[opensuse] Leap 42.2: how to use /dev/disk/by-id in initrd and grub2?
Hello: I would like to use disk names according to /dev/disk/by-id entries in my grub2 config and initrd image files instead of uuids in Leap 42.2 How to configure grub2 and mkinitrd/dracut to use those? I have set GRUB_DISABLE_LINUX_UUID=true in /etc/default/grub file and run grub2-mkconfig -o /boot/grub2/grub.cfg, still there are several lines in boot/grub2/grub.cfg showing uuids of my disks. I also looked at dracut manual but could not find anything regarding disk-id. I've run mkinitrd and it resulted dracut: Stored kernel commandline: dracut: resume=UUID=ac583745-0aa6-4b59-98ab-96d7bd1d7664 dracut: root=UUID=88e3e501-edac-4b4c-bff8-bc52ba8952f2 I want root=/dev/disk/by-id/..... instead of these. Thanks, Istvan -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 07/09/2017 06:11 PM, Istvan Gabor wrote:
Hello:
I would like to use disk names according to /dev/disk/by-id entries in my grub2 config and initrd image files instead of uuids in Leap 42.2 How to configure grub2 and mkinitrd/dracut to use those?
I have set GRUB_DISABLE_LINUX_UUID=true in /etc/default/grub file and run grub2-mkconfig -o /boot/grub2/grub.cfg, still there are several lines in boot/grub2/grub.cfg showing uuids of my disks.
I also looked at dracut manual but could not find anything regarding disk-id. I've run mkinitrd and it resulted
dracut: Stored kernel commandline: dracut: resume=UUID=ac583745-0aa6-4b59-98ab-96d7bd1d7664 dracut: root=UUID=88e3e501-edac-4b4c-bff8-bc52ba8952f2
I want root=/dev/disk/by-id/..... instead of these.
Thanks,
Istvan
Have you checked /etc/default/grub? e.g. GRUB_CMDLINE_LINUX_DEFAULT="resume=/dev/sda8 splash=silent quiet showopts" -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2017-07-10 05:30, David C. Rankin wrote:
Have you checked
/etc/default/grub? e.g.
GRUB_CMDLINE_LINUX_DEFAULT="resume=/dev/sda8 splash=silent quiet showopts"
And what happens when the bios changes sda8 and it becomes sdb8? You would access the wrong disk. Yes, that disk change happens on my computer. -- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" at Telcontar)
On 07/10/2017 08:42 AM, Carlos E. R. wrote:
And what happens when the bios changes sda8 and it becomes sdb8? You would access the wrong disk.
Yes, that disk change happens on my computer.
Ironically, that is what the OpenSuSE Leap 42.2 install generate :) -- David C. Rankin, J.D.,P.E.
On 2017-07-11 06:52, David C. Rankin wrote:
On 07/10/2017 08:42 AM, Carlos E. R. wrote:
And what happens when the bios changes sda8 and it becomes sdb8? You would access the wrong disk.
Yes, that disk change happens on my computer.
Ironically, that is what the OpenSuSE Leap 42.2 install generate :)
I don't remember. I just looked at a 42.3 install (virtual) and it is not the case: carlos@linux-vsyq:~> cat /proc/cmdline BOOT_IMAGE=/boot/vmlinuz-4.4.75-1-default root=UUID=f857e907-ff51-4281-ba76-ba61a05e64e1 resume=/dev/disk/by-label/swap_1 On a 42.2 virtual install I see (I might have modified it, but I doubt it, it still has splash=silent): linux-s4ef:~ # cat /proc/cmdline BOOT_IMAGE=/boot/vmlinuz-4.4.27-2-default root=UUID=bf665f67-0dc3-4c72-914b-7075c566798c resume=/dev/disk/by-uuid/1bed4421-315e-461f-8e51-caf45e3daed5 splash=silent quiet showopts And a 42.1 virtual install: carlos@linux-qblt:~> cat /proc/cmdline BOOT_IMAGE=/boot/vmlinuz-4.4.19-1-default root=UUID=cf0633dc-1339-4edf-9adc-2a771e7ddb51 resume=/dev/disk/by-label/Swap splash=silent quiet showopts -- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" at Telcontar)
On 11/07/17 05:23 AM, Carlos E. R. wrote:
And a 42.1 virtual install:
carlos@linux-qblt:~> cat /proc/cmdline BOOT_IMAGE=/boot/vmlinuz-4.4.19-1-default root=UUID=cf0633dc-1339-4edf-9adc-2a771e7ddb51 resume=/dev/disk/by-label/Swap splash=silent quiet showopts
Indeed! FDisk (or equivalent) should let you label your disk partitions. Personally I find that using named partitions makes then easier to comprehend. Just make sure that you DO name them according to their function.<=== IMPORTANT! For me, right now, on this machine: # cat /proc/cmdline BOOT_IMAGE=/vmlinuz-4.12.0-2.g7c5c393-default root=/dev/mapper/vgmain-vROOT4 resume=/dev/disk/by-label/SWAP splash=silent quiet showopts elevator=cfq For reasons lost long ago in dim, misty aeons associated with drive long dead, and probably associated with debugging early releases of BtrFS, I have a /boot and SWAP on real partitions, though everything else has migrated to LVM. I know full well that I could easily migrate SWAP to LVM, but why bother? I could migrate boot to LVM, even incorporate it into the ROOTFS, but what I have works and there are other things, more interesting this, to play abound with. The whole LVM setup encourages naming of the <strike>partitions</strike> Logical Volumes. -- A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting frowned upon? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 07/11/2017 04:23 AM, Carlos E. R. wrote:
On a 42.2 virtual install I see (I might have modified it, but I doubt it, it still has splash=silent):
linux-s4ef:~ # cat /proc/cmdline BOOT_IMAGE=/boot/vmlinuz-4.4.27-2-default root=UUID=bf665f67-0dc3-4c72-914b-7075c566798c resume=/dev/disk/by-uuid/1bed4421-315e-461f-8e51-caf45e3daed5 splash=silent quiet showopts
There must be some logic in yast/partitioning that will put the by-id names in if you use custom partitioning. I know for a fact that grub did default to by-id in my case (I'd pulled the win10 drive and put a blank in for the install and then had to move the install one drive down when I reinstalled the win10 drive) In this case I had to comment out what yast included by default and I changed to by-uuid to insure there was no possibility of confusion by yast on subsequent grub updates writing the bootloader to the win10 SSD. So I have the history in /etc/default/grub, e.g. # GRUB_CMDLINE_LINUX_DEFAULT="resume=/dev/sda8 splash=silent quiet showopts" GRUB_CMDLINE_LINUX_DEFAULT="resume=/dev/disk/by-uuid/3cadab5b-13b4-4dce-84d3-05e2070f741c splash=silent quiet showopts" It may be worth looking at what yast/partitioning does by default when you use Expert and create a single primary and partition on extended/logical partitions. -- David C. Rankin, J.D.,P.E.
On 2017-07-13 10:05, David C. Rankin wrote:
On 07/11/2017 04:23 AM, Carlos E. R. wrote:
On a 42.2 virtual install I see (I might have modified it, but I doubt it, it still has splash=silent):
linux-s4ef:~ # cat /proc/cmdline BOOT_IMAGE=/boot/vmlinuz-4.4.27-2-default root=UUID=bf665f67-0dc3-4c72-914b-7075c566798c resume=/dev/disk/by-uuid/1bed4421-315e-461f-8e51-caf45e3daed5 splash=silent quiet showopts
There must be some logic in yast/partitioning that will put the by-id names in if you use custom partitioning. I know for a fact that grub did default to by-id in my case (I'd pulled the win10 drive and put a blank in for the install and then had to move the install one drive down when I reinstalled the win10 drive) In this case I had to comment out what yast included by default and I changed to by-uuid to insure there was no possibility of confusion by yast on subsequent grub updates writing the bootloader to the win10 SSD. So I have the history in /etc/default/grub, e.g.
# GRUB_CMDLINE_LINUX_DEFAULT="resume=/dev/sda8 splash=silent quiet showopts" GRUB_CMDLINE_LINUX_DEFAULT="resume=/dev/disk/by-uuid/3cadab5b-13b4-4dce-84d3-05e2070f741c splash=silent quiet showopts"
It may be worth looking at what yast/partitioning does by default when you use Expert and create a single primary and partition on extended/logical partitions.
I don't think the kernel line can be related to using the expert partitioner or not. I can't think of a valid reason for yast using /dev/sda8, anyway, unless it inherits the line from an older install. All those vmware installs I sampled I had to use the expert partitioner at some point. -- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" at Telcontar)
10.07.2017 02:11, Istvan Gabor пишет:
Hello:
I would like to use disk names according to /dev/disk/by-id entries in my grub2 config and initrd image files instead of uuids in Leap 42.2 How to configure grub2 and mkinitrd/dracut to use those?
grub2 does not have anything similar. It can only identify filesystems by UUID or as fallback by creating unique file on a filesystem and searching for it.
I have set GRUB_DISABLE_LINUX_UUID=true in /etc/default/grub file and run grub2-mkconfig -o /boot/grub2/grub.cfg, still there are several lines in boot/grub2/grub.cfg showing uuids of my disks.
Without knowing what these several lines are it is impossible to give any comment.
I also looked at dracut manual but could not find anything regarding disk-id. I've run mkinitrd and it resulted
dracut: Stored kernel commandline: dracut: resume=UUID=ac583745-0aa6-4b59-98ab-96d7bd1d7664 dracut: root=UUID=88e3e501-edac-4b4c-bff8-bc52ba8952f2
I want root=/dev/disk/by-id/..... instead of these.
You can't use default grub-mkconfig scripts for it; they either add UUID or canonical device name. Either add this line manually or repace /etc/grub.d/10_linux with your version. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (5)
-
Andrei Borzenkov
-
Anton Aylward
-
Carlos E. R.
-
David C. Rankin
-
Istvan Gabor