LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Boot Slackware on NVME SSD? (https://www.linuxquestions.org/questions/slackware-14/boot-slackware-on-nvme-ssd-4175586404/)

jkaidor 08-06-2016 12:03 AM

Boot Slackware on NVME SSD?
 
Hello,

I celebrated the release of 14.2 by building a new PC to run it. It's a mini-ITX board with a Xeon E3-1241, 32G of ECC RAM and a 512G Samsung 950PRO M2 SSD. This last is giving me heartburn.

The complete Slackware install happens, but then Lilo refuses to install itself. It complains that it can't handle the SSD device.

Somebody else asked similar:
https://www.linuxquestions.org/quest...ks-4175567831/

It looks like it ain't gonna work. Anybody know a workaround? Use
Slackware with a different bootloader? I downloaded the Lilo source and found the spot where it complains.... I suppose I could try adding that particular major # (259 ) to the "approved" list in geometry.c.

If all else fails, I could boot Slackware off a memory stick, and tell it to use the root directory on the fast SSD. Ick.

Thoughts? These NVME SSDs are only going to get more & more popular.
They're a bit pricy now, but they will come down... And they're over 3 times as fast as SATA SSDs.

- Jerryk

kjhambrick 08-06-2016 04:33 AM

jkaidor --

I agree about the NVMe devices -- they're already here !

I've got a pair of the 500GB Samsung 950 Pros in my Laptop as secondary drives where they work VERY well ( speed wise ).

As for booting Slackware from an NVMe ...

1. This guy:

https://rlaanemets.com/post/show/computer-upgrade

was able to boot an NVMe using syslinux installed in /boot/ on his 'old drive' ...

No direct help there but he does show how he used syslinux to 'auto-boot' Slackware installed in /root/ on the NVMe.

IOW, you should be able to boot into your new NVMe from a small USB Disk with syslinux to get things going.

2. And here's a question on the Arch Forum where booting directly via the EFI Shell is mentioned for a Non-Dual-Boot System:

https://bbs.archlinux.org/viewtopic.php?id=209653

Then, after you're up and running ...

3. This Stack Exchange post:

http://unix.stackexchange.com/questi...alling-debiavn

has a solution for Debian + grub-efi-amd64 and was adapted from this Debian Wiki Article ( #4 ) :

https://wiki.debian.org/InstallingDe...CIe_SSD/jessie

Maybe #1 or #2 will get you going where you could explore #3 and #4 ?

I am not sure what's contained in grub-efi-amd64.deb nor how entangled it may be with systemd but that is left as an 'exercise for the reader' :)

HTH, at least a little bit, I am still trying unlearn my old 1980 IBM-PC BIOS Habits and to wrap my old-fart brain-cells around all the new HW / SW tech :)

-- kjh

jkaidor 08-06-2016 10:27 AM

This worked:
https://rlaanemets.com/post/show/computer-upgrade
The syslinux instructions are near the bottom of the page.

After getting dumped into a root command line after setup...

I created a text file /boot/extlinux.conf:
-------- snip -----------
DEFAULT linux
SAY Now booting the kernel from SYSLINUX
LABEL linux
KERNEL vmlinuz
APPEND ro root=/dev/nvme0n1p1
-------- endsnip ------

And ran extlinux --install /boot

And then did a magic dd to get the generic syslinux code into the mbr:

cd /usr/share/syslinux
dd bs=440 conv=notrunc if=mbr.bin of=/dev/nvme0n1

...and then rebooted, and it Just Worked. Yay!

I still have a *lot* of work to do. I have been refining my server
for many years, and everything will need to be ported to this new machine.

Newer, higher tech makes this server simpler than the old one. I used to do all sorts of tricks with
multiple disks and partitions to make things faster. /home on a different device than /bin,/usr/bin etc. None of that is necessary with an SSD.
Just one big partition for everything. Except for a swap partition, which I am including out of an abundance of caution, although I do not
anticipate running out of physical RAM with 32G.

- Jerryk

slalik 08-06-2016 10:41 AM

I use 14.2 booted from NVMe disk, Samsung 950 in a Lenovo notebook and an Intel disk in a desktop computer (self-assembled).

I use UEFI and elilo. There is a minor problem with the installer that simply doesn't search for a EFI partition on an NVMe disk. I wrote how I worked around this problem here.

trxdraxon 08-07-2016 01:23 AM

Quote:

Originally Posted by jkaidor (Post 5586976)
This worked:
https://rlaanemets.com/post/show/computer-upgrade
The syslinux instructions are near the bottom of the page.

After getting dumped into a root command line after setup...

I created a text file /boot/syslinux.conf:
-------- snip -----------
DEFAULT linux
SAY Now booting the kernel from SYSLINUX
LABEL linux
KERNEL vmlinuz
APPEND ro root=/dev/nvme0n1p1
-------- endsnip ------

And ran extlinux --install /boot

And then did a magic dd to get the generic syslinux code into the mbr:

cd /usr/share/syslinux
dd bs=440 conv=notrunc if=mbr.bin of=/dev/nvme0n1

...and then rebooted, and it Just Worked. Yay!

I still have a *lot* of work to do. I have been refining my server
for many years, and everything will need to be ported to this new machine.

Newer, higher tech makes this server simpler than the old one. I used to do all sorts of tricks with
multiple disks and partitions to make things faster. /home on a different device than /bin,/usr/bin etc. None of that is necessary with an SSD.
Just one big partition for everything. Except for a swap partition, which I am including out of an abundance of caution, although I do not
anticipate running out of physical RAM with 32G.

- Jerryk


Thank you for this. I too just built myself a new machine with a NVME SSD and had the same issue and your post worked like a charm except that your syslinux.conf should be extlinux.conf. Just got Slackware installed and running updates and installing everything I need.

Wiser Slacker 08-07-2016 02:07 AM

i did my install by PXE boot from an raspberrry pi ... lol

have had no problems so far ...

jkaidor 08-07-2016 07:31 AM

Quote:

Originally Posted by trxdraxon (Post 5587262)
Thank you for this. I too just built myself a new machine with a NVME SSD and had the same issue and your post worked like a charm except that your syslinux.conf should be extlinux.conf.

*** Ooops. You're welcome. I just changed it to extlinux.conf.

- Jerry

kjhambrick 08-07-2016 08:56 AM

Thanks all !

When I received this new laptop, Sager had installed Win10 on one of the NVMe Cards -- it worked well and was Pretty-Dang-Quick.

I hit a wall trying to install to the other NVMe Card, chickened out and installed SlackWare64 Current on one of the Samsung 850 Pro SSDs instead and set up the pair of NVMe Disks as 'secondary'.

I now see three ways that I could have booted Slackware Current from an NVMe Card ( syslinux ala jkaidor or elilo ala slalik or PXE boot ala Wiser Slacker ).

Thanks again !

This Thread is a 'keeper'

-- kjh

kjhambrick 08-07-2016 09:47 AM

jkaidor --

If you consider your NVMe Install issue solved, it may help other users if you mark the Thread as SOLVED.

I usually start my LQ searches for fixes with 'Threads Marked SOLVED' and I'll bet that others do too.

Thanks !

-- kjh

jkaidor 08-07-2016 08:48 PM

Quote:

Originally Posted by kjhambrick (Post 5587380)
jkaidor --

If you consider your NVMe Install issue solved, it may help other users if you mark the Thread as SOLVED.

*** I have so marked it. - Jerry

Wiser Slacker 08-08-2016 09:40 PM

maybe it helps ...
 
Hi,

if you want to boot lilo to an nvme - where the other devices are changed, may be you put in some more sata drives - i did it this way:

My Problem had been that the device order did change when i put in another hd ...

1. i do install lilo into the mbr of that disk i want to boot from ...

2. give the boot statement by the line below to lilo.conf
boot = /dev/disk/by-id/ata-PLEXTOR_PX-G256M6e_Pxxxxxxxxx

3. than you should use the following statement to tell the kernel where the root disk is
Code:

  lilo.conf
  # Linux bootable partition on SSD2
  image = /boot/vmlinuz
    addappend = " root=PARTUUID=abcdefgh-02"    # here second partition
    label = Slack14
    read-only
  # Linux bootable partition SSD2 ends

blkid should give you the right "PARTUUID"

4. you should use the form of LABEL= or maybe /dev/disk/by-xxxxyyyyyzzzzz in fstab

5. tell the bios witch device you want to start from


now you are total free from any device order the bios tell to your booting os (here slackware ;) )
as i said before - the initial booting could be done by any device (maybe pxe as i do) witch is able to start the installer

all needed tools are already in the slackware installer

greetings
W.Slacker

bassmadrigal 08-09-2016 06:39 AM

Quote:

Originally Posted by Wiser Slacker (Post 5588233)
Code:

    addappend = " root=PARTUUID=abcdefgh-02"    # here second partition

Just so you know, you don't need to have it as an addappend. You can just use:

Code:

root = "PARTUUID=abcdefgh-02"
EDIT: Based on Wiser Slacker's post below, this may not be true for PARTUUID=, however, it will work if using UUID= or LABEL=.

Wiser Slacker 08-09-2016 09:51 AM

i have written:
Quote:

# root = "PARTUUID=abcdefgh-02" # Illegal 'root=' specification
into my lilo.conf - i think it didn't work - i have tried many combinations ...

to make it clear DON't use the
Quote:

root =
outside of the kernel line !!
the results are different !
and they may not do what you want or think off !!

bassmadrigal 08-09-2016 10:20 AM

Quote:

Originally Posted by Wiser Slacker (Post 5588455)
i have written:


into my lilo.conf - i think it didn't work - i have tried many combinations ...

Huh, maybe it doesn't support PARTUUID=. I do know it supports LABEL= and UUID= (I'm using the UUID variant on my lilo.conf), so I guess I wrongly assumed it would support PARTUUID=.

Wiser Slacker 08-09-2016 10:53 AM

i have had a look into kernelsource ...

/usr/src/linux/init/do_mounts.c

so with this option, i told here before, you don't need any initrd, the needed "device tree" was created by the kernel itself and LILO don't need to interpret any UUID's - the PARTUID is found by the kernel while booting and could be found in any disk partition table - ok. i just try "table msdos" yet ...

while lilo did write something like 0810 or 0820 into the kernels head before, for finding its partitions, it don't have to write these infos into the kernel now, but the kernel get its info from command line ....

and as i said - lilo seemed not to want your root option ... ok. you know ..

to keep it clear -
if you tell lilo-instaler to "interpret" what it should write into the boot loader it did that by following the /disk-by/ ... way and found the device ID - that could be wrong (after reboot) if you change any disks in your pc - so the kernel later can't find its root partition !

these are the most misinterpreted problems while booting any os's - the internet is full of those people who can't get its machines to boot ... mostly with windooofs

bassmadrigal 08-09-2016 11:57 AM

The /dev/disk/by-*/ IDs should not change if the underlying hardware or disk order is changed. So, they can be successfully referenced. However, I'm not sure which ones would need initrds.

After further research, I found that PARTUUID and PARTLABEL are only available for disks formatted using GPT. They are not available for disks using MBR. I've only used GPT on disks that are too large for MBR, so I have some disks that support PARTUUID (all my storage drives that are 3TB and larger) and some that don't (including my main 480GB SSD since it was small enough to use MBR). I assumed PARTUUID and PARTLABEL had similar support in lilo, but it seems that is not the case, and lilo only contains support for UUID and LABEL to be called directly under the root option. If you want to use PARTUUID or PARTLABEL, you will need to use the addappends option as in your example.

So, if your primary boot drive and root OS drive are using the MBR partition table, you can't use PARTUUID without converting your disk to GPT. UUID will work regardless of the partition table, although, as has been discussed previously, it does require an initrd.

Wiser Slacker 08-09-2016 02:20 PM

sorry but you do make the same error like many people around too,


Quote:

Originally Posted by bassmadrigal (Post 5588503)
The /dev/disk/by-*/ IDs should not change if the underlying hardware or disk order is changed. So, they can be successfully referenced.

these are only symbolik links witch are created by udev witch are created after boot

Quote:

Originally Posted by bassmadrigal (Post 5588503)
However, I'm not sure which ones would need initrds.

i dont know either

Quote:

Originally Posted by bassmadrigal (Post 5588503)
After further research, I found that PARTUUID and PARTLABEL are only available for disks formatted using GPT. They are not available for disks using MBR. I've only used GPT on disks that are too large for MBR, so I have some disks that support PARTUUID (all my storage drives that are 3TB and larger) and some that don't (including my main 480GB SSD since it was small enough to use MBR). I assumed PARTUUID and PARTLABEL had similar support in lilo, but it seems that is not the case, and lilo only contains support for UUID and LABEL to be called directly under the root option. If you want to use PARTUUID or PARTLABEL, you will need to use the addappends option as in your example.

So, if your primary boot drive and root OS drive are using the MBR partition table, you can't use PARTUUID without converting your disk to GPT. UUID will work regardless of the partition table, although, as has been discussed previously, it does require an initrd.

sorry - you are wrong here ...
1. i never ever have formated any disk knowingly with gpt ...
2. you may try this on the oldest lilo you have ...
Quote:

>lilo -T vol-ID

BIOS Volume ID

0x80 abcdefgh
0x81 01234567

Volume ID's are all unique.

the first numbers are used by lilo to deteckt witch one is the first and witch the maybe second disk
to know that the symlinks always point to the same point is no help when detecting the root device while booting, because these first numbers may change !

only the second two numbers dont change ... these numbers do the kernel itself could use to deteckt its root filesystem.

lilo standard just uses 0x80 or 0x81 to give them to kernel because these numbers came from bios these could change ...

lilo cant know of what number it is next time, and if you give that to kernel the kernel dont know either !

please read the lilo manual carefuly, and maybe the kernel docs, the safest way to boot to the paritions you want is posted in my example above ;)

and as i said before this is the reason for the most boot problems out there !!

bassmadrigal 08-09-2016 03:23 PM

Quote:

Originally Posted by Wiser Slacker (Post 5588556)
these are only symbolik links witch are created by udev witch are created after boot

Yes, they are symbolic links, but they're based on the information in the hardware. While the location that the link points to might change, lilo doesn't care about that. When you reference /dev/disk/by-id/, while it may point to a drive under /dev/, the /dev/disk/by-id/, for all intents and purposes, is the drive. You run lilo when the drives are mapped, so it doesn't care what you reference, as long as it eventually points to a disk.

Quote:

Originally Posted by Wiser Slacker (Post 5588556)
sorry - you are wrong here ...

Then tell me why none of my MBR disks have a PARTUUID?

Code:

jbhansen@craven-moorhead:~$ ls -la /dev/disk/by-partuuid/
total 0
drwxr-xr-x 2 root root 120 Jul 31 13:17 ./
drwxr-xr-x 8 root root 160 Jul 31 13:17 ../
lrwxrwxrwx 1 root root  10 Jul 31 17:18 3b24267b-838a-4468-ab80-af66cb245c97 -> ../../sde1
lrwxrwxrwx 1 root root  10 Jul 31 17:18 468a6e66-39e3-4072-8997-0550dd12ad8e -> ../../sdb1
lrwxrwxrwx 1 root root  10 Jul 31 17:18 62c372af-e868-4571-8ab4-db612c0fb38f -> ../../sdc1
lrwxrwxrwx 1 root root  10 Jul 31 17:18 aa42adff-e074-45ce-9e1a-07dd8e37d554 -> ../../sdd1
jbhansen@craven-moorhead:~$ ls -la /dev/disk/by-uuid/
total 0
drwxr-xr-x 2 root root 200 Jul 31 13:17 ./
drwxr-xr-x 8 root root 160 Jul 31 13:17 ../
lrwxrwxrwx 1 root root  10 Jul 31 17:18 226f1db3-2f14-4862-9998-8be1e8f7cdc9 -> ../../sda3
lrwxrwxrwx 1 root root  10 Jul 31 17:18 23bce2c2-996d-449e-89cc-0e5029cc6d8d -> ../../sda2
lrwxrwxrwx 1 root root  10 Jul 31 17:18 2ef6e776-c2eb-4e56-bc7e-dfe083559d8f -> ../../sdf1
lrwxrwxrwx 1 root root  10 Jul 31 17:18 5f466dd0-2434-46ba-a276-6eee7647da9d -> ../../sde1
lrwxrwxrwx 1 root root  10 Jul 31 17:18 bc4538e5-9387-4e5c-877b-d15744acb6ce -> ../../sda1
lrwxrwxrwx 1 root root  10 Jul 31 17:18 cae38214-71f3-4678-bf78-3e836e7a4022 -> ../../sdd1
lrwxrwxrwx 1 root root  10 Jul 31 17:18 cd554cf8-c346-4bd5-ba6a-84ac99af571f -> ../../sdc1
lrwxrwxrwx 1 root root  10 Jul 31 17:18 ebdab491-caf6-4ae7-9672-67ed3bb3d665 -> ../../sdb1

As you can see, only sdb1, sdc1, sdd1, and sde1 have PARTUUIDs. If we look at sda1-3 and sdf1, we'll see they're MBR while sdb1-sde1 are all GPT.

Apologies... apparently, while PARTUUID (and PARTLABEL) is only part of the GPT spec, the kernel will generate a PARTUUID for non-GPT partitions too (just as UUIDs are not part of the NTFS spec, but they're still provided). This ability to provide MBR partitions with PARTUUIDs was added in the 3.8 kernel. That is why when you view blkid, the MBR partitions' PARTUUID is much shorter than the GPT partitions, because it isn't a real UUID. Luckily, it doesn't change (without changing the partitions), so it should still be fine to use as a reference.

Code:

root@craven-moorhead:~# blkid
/dev/sdb1: UUID="ebdab491-caf6-4ae7-9672-67ed3bb3d665" TYPE="ext4" PARTUUID="468a6e66-39e3-4072-8997-0550dd12ad8e"
/dev/sdc1: UUID="cd554cf8-c346-4bd5-ba6a-84ac99af571f" TYPE="ext4" PARTUUID="62c372af-e868-4571-8ab4-db612c0fb38f"
/dev/sdd1: UUID="cae38214-71f3-4678-bf78-3e836e7a4022" TYPE="ext4" PARTUUID="aa42adff-e074-45ce-9e1a-07dd8e37d554"
/dev/sde1: UUID="5f466dd0-2434-46ba-a276-6eee7647da9d" TYPE="ext4" PARTUUID="3b24267b-838a-4468-ab80-af66cb245c97"
/dev/sdf1: UUID="2ef6e776-c2eb-4e56-bc7e-dfe083559d8f" TYPE="ext4" PARTUUID="71b70c68-01"
/dev/sda1: UUID="bc4538e5-9387-4e5c-877b-d15744acb6ce" TYPE="swap" PARTUUID="6f47c81b-01"
/dev/sda2: UUID="23bce2c2-996d-449e-89cc-0e5029cc6d8d" TYPE="ext4" PARTUUID="6f47c81b-02"
/dev/sda3: UUID="226f1db3-2f14-4862-9998-8be1e8f7cdc9" TYPE="ext4" PARTUUID="6f47c81b-03"

You can actually see where they get the base for the PARTUUID for MBR disks using fdisk. And then the number after the dash is the partition number (although, I don't have any logical partitions to see how those are labeled).

Code:

jbhansen@craven-moorhead:~$ sudo fdisk -l /dev/sda | grep identifier
Disk identifier: 0x6f47c81b

The UUID will change with any formatting, whereas, the PARTUUID will only change if you change the partitions of the drive.

TL;DNR

It used to be required to use UUIDs or LABELs, in conjunction with an initrd, to boot a system that might have disks devices changing order. GPT added PARTUUID and PARTLABEL within its spec that allows referencing the disk without requiring an initrd. The 3.8 kernel added generated PARTUUIDs based on the Disk Identifier and partition number for non-GPT partitions. So, any system using 3.8 and newer can boot using PARTUUIDs without requiring an initrd. :thumbsup:

@Wise Slacker, thanks for the nudge for me to fully research this and figure out what is going on.

Wiser Slacker 08-09-2016 07:06 PM

ok. ;)
hope you get it now ...
it took me one day to let lilo do what i want it to do -
so i now can put my 4x1Terra => Raid5 disks into the new machine when i need it ...
while my boot disk (nvme) seemed always be the last one in system, because it is bound by pci to the system and would be discovered at last ...
there in no switch like "pci first" in the bios anymore ...

i have always had different disks for system and data since they are "so cheap" - lol

bassmadrigal 08-09-2016 09:53 PM

I think the big issue is people have been using UUIDs for years, and PARTUUID is a relatively new addition to Linux. I don't know when GPT was introduced, but, for most, it wasn't really needed until drives surpassed the 2TB mark. And the first 3TB drive wasn't introduced until 2010. Even then, it probably wasn't likely that people were using them for their boot drives, so they wouldn't even need to know about it. Then, to add "PARTUUID" support for MBR devices, the 3.8 kernel wasn't released until 2013, only 9 months before 14.1 was released.

So, PARTUUIDs are still relatively new to the Linux world, and it seems like a lot of documentation hasn't properly caught up to provide the right info (at least, not completely). I had to go to several sites and try several different commands on my computer to determine the information provided above. (I may try and generate a page on the slackwiki for it.)

But, PARTUUIDs are not part of the MBR, it is just something generated by the kernel using the Device Identifier, so I was correct that MBR devices don't support it. We're just lucky that the kernel developers found a way around it :)

TracyTiger 08-09-2016 11:38 PM

Documentation
 
Quote:

Originally Posted by bassmadrigal (Post 5588780)
So, PARTUUIDs are still relatively new to the Linux world, and it seems like a lot of documentation hasn't properly caught up to provide the right info (at least, not completely). I had to go to several sites and try several different commands on my computer to determine the information provided above. (I may try and generate a page on the slackwiki for it.)

@bassmadrigal Thank you for taking the time to explore and understand this subject and include it in this thread.

I encourage you to document this recently gained knowledge in the online Slackware docs. Many of us will appreciate the time you spend to do this.

Of course Wiser Slacker and others contributed to the information in this thread. I'm just encouraging bassmadrigal to document it as he indicated he may be inclined to do so.

bormant 08-10-2016 12:16 AM

Please note that PARTUUID on MBR disk:
1) can help with disk order changes (disk has the ID)
2) cannot help with reordered partitions on the disk (they uses numbers and not IDs)

Second scenario may be actual for Win10 August 2016 anniversary update.

bassmadrigal 08-10-2016 08:47 AM

@Wiser Slacker, do you use lilo? If so, how do you manage the "boot" variable. Since this references the drive itself and not a partition, UUIDs, labels, PARTUUIDs, and PARTLABELs won't work. Do you just use /dev/disk/by-id/? If so, does that not require an initrd?

I'm trying to compile information for a wiki article covering this topic.

bormant 08-10-2016 09:46 AM

Quote:

Originally Posted by bassmadrigal (Post 5588966)
@Wiser Slacker, do you use lilo? If so, how do you manage the "boot" variable. Since this references the drive itself and not a partition, UUIDs, labels, PARTUUIDs, and PARTLABELs won't work. Do you just use /dev/disk/by-id/? If so, does that not require an initrd?

boot = ...
is actual only at moment when "lilo" command is running. It points the device where lilo will write boot code. So when a machine boots it selects boot device, loads boot code from mbr (written there by lilo command), boot code loads a kernel and initrd and transfers control to kernel, when kernel gets control the bootloader code has done. So boot sequention have no time for "boot =" :-)

bassmadrigal 08-10-2016 09:56 AM

Quote:

Originally Posted by bormant (Post 5588991)
boot = ...
is actual only at moment when "lilo" command is running. It points the device where lilo will write boot code. So when a machine boots it selects boot device, loads boot code from mbr (written there by lilo command), boot code loads a kernel and initrd and transfers control to kernel, when kernel gets control the bootloader code has done. So boot sequention have no time for "boot =" :-)

Ah, so that parameter is irrelevant during the actual boot process? It's only used when running lilo to write everything to the MBR of that boot drive?

If that's the case, thanks!

Wiser Slacker 08-10-2016 12:01 PM

re: Hi,

Quote:

Originally Posted by bassmadrigal (Post 5588997)
Ah, so that parameter is irrelevant during the actual boot process? It's only used when running lilo to write everything to the MBR of that boot drive?

If that's the case, thanks!

and so it is with the

'root = '

statement not inside the kernel commandline,
it "maybe" just point to the rigt point when INITIALISING the bootloader,
it maybe wrong when the bootloading process itself is running.

you may be right that the form of what (UUID , PARTUID , or others, .. ) the kernel commandline can detect without an initrd, ramdisk, or else, - has been changed in the last years ...

but the bootloading process was always the same (till ueffi) ...

the bootloader can only give a statical value to the starting kernal or os, it is known as devise id and is build out of to bytes - major and minor numbers ...

hope it helps ...

Wiser Slacker 08-10-2016 12:09 PM

Quote:

Originally Posted by bormant (Post 5588813)
Please note that PARTUUID on MBR disk:
1) can help with disk order changes (disk has the ID)
2) cannot help with reordered partitions on the disk (they uses numbers and not IDs)

Second scenario may be actual for Win10 August 2016 anniversary update.

so i think one should use UUID's to find the right patition in kernel commandline,
and in fstab also - like other distributions do

bassmadrigal 08-10-2016 02:45 PM

Quote:

Originally Posted by TracyTiger (Post 5588804)
I encourage you to document this recently gained knowledge in the online Slackware docs. Many of us will appreciate the time you spend to do this.

Ok, I spent most of today working on this. It isn't done, but I need to be done with it for now. So I saved the page with a disclaimer at the top to not use it yet. Feel free to provide any feedback here on it (good or bad -- I have tough skin ;) ) and I'll try to incorporate it within the next few days as I finalize everything.

How to configure lilo.conf and fstab with persistent naming

Wiser Slacker 08-10-2016 11:11 PM

Quote:

Originally Posted by bassmadrigal (Post 5589109)
Ok, I spent most of today working on this. It isn't done, but I need to be done with it for now. So I saved the page with a disclaimer at the top to not use it yet. Feel free to provide any feedback here on it (good or bad -- I have tough skin ;) ) and I'll try to incorporate it within the next few days as I finalize everything.

How to configure lilo.conf and fstab with persistent naming

please do read my editings in the posts before (maybe again) - i have try to write it more precicely ...

after reading your howto - i have seen that you have not totaly understand the thing ...
the importent thing is to place the statement INTO or OUTSIDE of the kernel commandline ... NOT it's NAMES ...

it will give you different results !!!
you can test that by looking into
cat /proc/cmdline
Quote:

auto BOOT_IMAGE=MyServer ro root=804 vt.default_utf8=0 elevator=noop
thats what lilo did !!

or this

cat /proc/cmdline
Quote:

auto BOOT_IMAGE=Slack14 ro vt.default_utf8=0 elevator=noop raid=noautodetect root=PARTUUID=12345678-02
and maybe to prevent further discussions - the PARTUID exist as long as winNT exist ... its a time stamp - do have a look at this http://thestarman.pcministry.com/asm/mbr/STDMBR.htm

Quote:

LABEL and UUID
To use Labels and UUIDs, you need to use an initrd. It won't work without it.
is WRONG also - have a look into the kernel boot code - sorry i told you that before also

/usr/src/linux/init/do_mounts.c
Quote:

/*
* Convert a name into device number. We accept the following variants:
*
* 1) <hex_major><hex_minor> device number in hexadecimal represents itself
* no leading 0x, for example b302.
* 2) /dev/nfs represents Root_NFS (0xff)
* 3) /dev/<disk_name> represents the device number of disk
* 4) /dev/<disk_name><decimal> represents the device number
* of partition - device number of disk plus the partition number
* 5) /dev/<disk_name>p<decimal> - same as the above, that form is
* used when disk name of partitioned disk ends on a digit.
* 6) PARTUUID=00112233-4455-6677-8899-AABBCCDDEEFF representing the
* unique id of a partition if the partition table provides it.
* The UUID may be either an EFI/GPT UUID, or refer to an MSDOS
* partition using the format SSSSSSSS-PP, where SSSSSSSS is a zero-
* filled hex representation of the 32-bit "NT disk signature", and PP
* is a zero-filled hex representation of the 1-based partition number.
* 7) PARTUUID=<UUID>/PARTNROFF=<int> to select a partition in relation to
* a partition with a known unique id.
* 8) <major>:<minor> major and minor number of the device separated by
* a colon.
*
* If name doesn't have fall into the categories above, we return (0,0).
* block_class is used to check if something is a disk name. If the disk
* name contains slashes, the device name has them replaced with
* bangs.
*/

dev_t name_to_dev_t(const char *name)
{


;)

bassmadrigal 08-10-2016 11:36 PM

Quote:

Originally Posted by Wiser Slacker (Post 5589270)
after reading your howto - i have seen that you have not totaly understand the thing ...
the importent thing is to place the statement INTO or OUTSIDE of the kernel commandline ... NOT it's NAMES ...

I'm not understanding what you mean. Can you post one of my examples and then post what it should be?

Wiser Slacker 08-11-2016 12:07 AM

wrong
Quote:

image = /boot/vmlinuz-generic-3.10.17
initrd = /boot/initrd-3.10.17.gz
#root = /dev/sda2
root = "UUID=23bce2c2-996d-449e-89cc-0e5029cc6d8d"
#root = "LABEL=Mylabelhere"
label = Slack-generic
read-only
this gives NOT a static number
Quote:

auto BOOT_IMAGE=MyServer ro root=804 vt.default_utf8=0 elevator=noop
both labels UUID= and LABEL= do find its way into kernel commandline


right
Quote:

image = /boot/vmlinuz
addappend = " root=PARTUUID=6f47c81b-02"
#root =
this gives a commandline to the kernel:
Quote:

auto BOOT_IMAGE=Slack14 ro vt.default_utf8=0 elevator=noop raid=noautodetect root=PARTUUID=6f47c81b-02

bassmadrigal 08-11-2016 09:39 AM

I am thinking you're not understanding things. The way I put UUIDs is the correct way to do it with lilo.conf. I am successfully using it in my computer right now. Others have successfully done it with labels. I've helped several people set up their lilo.conf files with UUIDs. As I wrote in the article, PARTUUIDs are not properly supported in lilo (unlike regular UUIDs), so you need to use the addappend option, but you do not need it for UUIDs (if you're using an initrd). If you're trying to do it without an initrd, it might be completely different (and might get the output you found), but the way I wrote it there most definitely works.

There is even a perl script included with lilo called lilo-uuid-diskid (it's under /sbin/) that will go through and convert your lilo.conf to use UUIDs in the format I listed. You can view the script here and between lines 443 and 447 it will show an example of what it does, which is the format I provided.

Also, to further iterate that this method works (without an append), if I view my /proc/cmdline, I get:

Code:

BOOT_IMAGE=Slack-4.4.13 ro root=UUID=23bce2c2-996d-449e-89cc-0e5029cc6d8d vt.default_utf8=0
That particular boot is done with the following stanza:

Code:

image = /boot/vmlinuz-generic-4.4.13
initrd = /boot/initrd-4.4.13.gz
root = "UUID=23bce2c2-996d-449e-89cc-0e5029cc6d8d"
label = Slack-4.4.13
read-only

My computer boots up properly every time. And when I first implemented UUIDs in my lilo.conf, I then played around with my drive order to ensure it worked, and when I swapped cables for my first and sixth drive, it still booted, although, my main OS drive was now /dev/sdf2 instead of /dev/sda2. It worked exactly as it should.

What you're probably seeing is when you use UUIDs without an initrd, which isn't supported. I specifically mentioned in the article that an initrd is required if using LABEL or UUID. The reason an initrd is required is because of what you quoted out of /usr/src/linux/init/do_mounts.c. As you can see, it doesn't support using UUIDs specifically (the only mention of UUID is under the PARTUUID section). It needs the environment provided by the initrd to use the UUID. If the environment isn't there, the kernel doesn't know what to mount and you end up with a kernel panic.

Quote:

Originally Posted by Wiser Slacker (Post 5589270)
and maybe to prevent further discussions - the PARTUID exist as long as winNT exist ... its a time stamp - do have a look at this http://thestarman.pcministry.com/asm/mbr/STDMBR.htm

As for your comment about PARTUIDs (not sure if this was a misspelling since that term did not exist in your link) existing since winNT, that is probably something other than the PARTUUIDs that exist now (notice the extra U). UID stands for Unique IDentifier, but there is no standard on what that means. That is why with WinNT systems, according to you, it is a timestamp. UUIDs are universally unique, which means there needs to be a standard. That standard is a 128bit value that is comprised of 32 characters. GPT stands for GUID Partition Table, and GUID *is* a 128bit UUID. The whole partition table was designed around using universally unique identifiers for partitions, which are referenced using PARTUUIDs. As I mentioned, PARTUUIDs are only included with GPT partitions. They, flatout, don't exist for MBR tables. However, some clever people found a way to take the drive identifier and attach the partition name to allow referencing specific drives and partitions without PARTUUIDs under the PARTUUID label (this is why your MBR drives don't show up under /dev/disk/by-partuuid/ -- because they don't exist, but you can view the fake "PARTUUID" under blkid). But this wasn't implemented until the 3.8 kernel. If you were to try this on an older kernel, you wouldn't have any PARTUUIDs listed in blkid for your MBR devices and you'd have to use UUIDs and an initrd like old times.

This whole thing is just like how the NTFS "UUID" is not an actual UUID, but is still able to be referenced as one.

Wiser Slacker 08-11-2016 10:59 AM

re: Hi, ;)

Quote:

Originally Posted by bassmadrigal (Post 5589408)
Also, to further iterate that this method works (without an append), if I view my /proc/cmdline, I get:

Code:

BOOT_IMAGE=Slack-4.4.13 ro root=UUID=23bce2c2-996d-449e-89cc-0e5029cc6d8d vt.default_utf8=0
That particular boot is done with the following stanza:

Code:

image = /boot/vmlinuz-generic-4.4.13
initrd = /boot/initrd-4.4.13.gz
root = "UUID=23bce2c2-996d-449e-89cc-0e5029cc6d8d"
label = Slack-4.4.13
read-only


i have had a look into lilo source code and the change log ...

Quote:

Changes from version 22.7.3 to 22.8 (16-Feb-2007) John Coffman

Boot Installer
--------------
- Move configuration information (-X) to a separate procedure.
(lilo.c)
- Fix type decl problem in LVM _IOR/RW macros. (geometry.c)
- Add DEV_DISK_DIR and edit source to use it. (config.h,
device.c, geometry.c)
- Change handling of 'device-mapper' depending upon DEVMAPPER
option. (device.c, geometry.c)
- Modify 'scan_dir' to stay out of hidden directories. (device.c)
- Add 'nodevcache' option to configuration file. (cfg.c, lilo.c)
- Add sync() before boot sector write to compensate for 2.6 kernel
bug in partition buffering code. (bsect.c)
- Allow 'root="UUID=xyz"' syntax. (bsect.c)
this leads into the bsect.c (version of lilo-24.2)
Code:

if ((root = cfg_get_strg(cf_kernel,"root")) || (root = cfg_get_strg(
      cf_options,"root")))  {
        if (!strcasecmp(root,"current")) {
            if (stat("/",&st) < 0) pdie("stat /");
            sprintf(strchr(options,0),"root=%x ",(unsigned int) st.st_dev);
        }
        else if (strlen(root)>12 && !strncmp(root,"/dev/mapper/",12)) {
            sprintf(strchr(options,0),"root=%s ", root);
        }
        else if (strlen(root)>6 && !strncmp(root,"LABEL=",6)) {
            sprintf(strchr(options,0),"root=%s ", root);
        }
        else if (strlen(root)>5 && !strncmp(root,"UUID=",5)) {
            sprintf(strchr(options,0),"root=%s ", root);
        }
        else {
            sprintf(strchr(options,0),"root=%x ",dev_number(root));
        }
      }

and i can see that lilo rearly took these too words and put them into kernel commandline by itself, because i have never used this before, and have had trying this with PARTUUID= witch doesn't work, i dont know it before.

so i have learned it today ... ;)

thank you

bormant 08-11-2016 11:29 AM

may be simple patch for bsect.c is a good idea
Code:

if ((root = cfg_get_strg(cf_kernel,"root")) || (root = cfg_get_strg(
      cf_options,"root")))  {
        if (!strcasecmp(root,"current")) {
            if (stat("/",&st) < 0) pdie("stat /");
            sprintf(strchr(options,0),"root=%x ",(unsigned int) st.st_dev);
        }
        else if (strlen(root)>12 && !strncmp(root,"/dev/mapper/",12)) {
            sprintf(strchr(options,0),"root=%s ", root);
        }
        else if (strlen(root)>9 && !strncmp(root,"PARTUUID=",9)) {
            sprintf(strchr(options,0),"root=%s ", root);
        }

        else if (strlen(root)>6 && !strncmp(root,"LABEL=",6)) {
            sprintf(strchr(options,0),"root=%s ", root);
        }
        else if (strlen(root)>5 && !strncmp(root,"UUID=",5)) {
            sprintf(strchr(options,0),"root=%s ", root);
        }
        else {
            sprintf(strchr(options,0),"root=%x ",dev_number(root));
        }
      }


bassmadrigal 08-11-2016 11:34 AM

Quote:

Originally Posted by bormant (Post 5589438)
may be simple patch for bsect.c is a good idea
Code:

if ((root = cfg_get_strg(cf_kernel,"root")) || (root = cfg_get_strg(
      cf_options,"root")))  {
        if (!strcasecmp(root,"current")) {
            if (stat("/",&st) < 0) pdie("stat /");
            sprintf(strchr(options,0),"root=%x ",(unsigned int) st.st_dev);
        }
        else if (strlen(root)>12 && !strncmp(root,"/dev/mapper/",12)) {
            sprintf(strchr(options,0),"root=%s ", root);
        }
        else if (strlen(root)>9 && !strncmp(root,"PARTUUID=",9)) {
            sprintf(strchr(options,0),"root=%s ", root);
        }

        else if (strlen(root)>6 && !strncmp(root,"LABEL=",6)) {
            sprintf(strchr(options,0),"root=%s ", root);
        }
        else if (strlen(root)>5 && !strncmp(root,"UUID=",5)) {
            sprintf(strchr(options,0),"root=%s ", root);
        }
        else {
            sprintf(strchr(options,0),"root=%x ",dev_number(root));
        }
      }


That might definitely be worth routing up to Pat since he stated he will maintain lilo after the most recent developer decided to finish the project at the end of 2015.

EDIT: I wonder if support could be added for PARTLABEL as well (I am not good enough with C to know how to add it), although, that is limited to solely GPT partitioned drives.

bormant 08-11-2016 12:11 PM

Quote:

I wonder if support could be added for PARTLABEL as well
Good catch...
Code:

# zcat lilo.root.partuud.diff.gz
--- ./src/bsect.c.orig        2011-06-22 11:09:44.000000000 +0400
+++ ./src/bsect.c        2016-08-11 20:07:50.973712769 +0300
@@ -1092,6 +1092,12 @@
        else if (strlen(root)>12 && !strncmp(root,"/dev/mapper/",12)) {
            sprintf(strchr(options,0),"root=%s ", root);
        }
+        else if (strlen(root)>10 && !strncmp(root,"PARTLABEL=",10)) {
+            sprintf(strchr(options,0),"root=%s ", root);
+        }
+        else if (strlen(root)>9 && !strncmp(root,"PARTUUID=",9)) {
+            sprintf(strchr(options,0),"root=%s ", root);
+        }

        else if (strlen(root)>6 && !strncmp(root,"LABEL=",6)) {
            sprintf(strchr(options,0),"root=%s ", root);
        }

Code:

# diff -u lilo.SlackBuild{.orig,}
--- lilo.SlackBuild.orig        2016-08-11 19:47:37.951483801 +0300
+++ lilo.SlackBuild        2016-08-11 19:50:57.723323256 +0300
@@ -22,7 +22,7 @@
 
 
 VERSION=${VERSION:-24.2}
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-3}
 
 # Automatically determine the architecture we're building on:
 if [ -z "$ARCH" ]; then
@@ -48,6 +48,7 @@
 chown -R root:root .
 
 zcat $CWD/lilo.ignore.usable.memory.above.4G.diff.gz | patch -p1 --verbose || exit 1
+zcat $CWD/lilo.root.partuud.diff.gz | patch -p1 --verbose || exit 1
 
 make || exit 1
 make -i install DESTDIR=$PKG || exit 1


bassmadrigal 08-11-2016 12:43 PM

Quote:

Originally Posted by bormant (Post 5589456)
Good catch...
Code:

[color=green]+        else if (strlen(root)>10 && !strncmp(root,"PARTLABEL=",10)) {
  --snip--
+        else if (strlen(root)>9 && !strncmp(root,"PARTUUID=",9)) {


Out of random curiosity, how do you determine the number? Based on what I could find online about that line, I'm assuming it is checking if the string length is greater than 10 and

I think I just figured it out. First it's checking if the string is longer than the characters used for the definition (in PARTUUID=, it is 9 characters, plus the actual UUID after), then it checks if the first 9 characters actually equals PARTUUID= (if it doesn't, it moves on to the next else if statement).

Thanks for making me continue to learn on this thread ;)

kjhambrick 08-11-2016 01:02 PM

Good Stuff !

These are excellent enhancements for LILO.

This Arch Doc helped me 'get it' Arch Persistent block device naming

Thanks for helping make Slackware better for all !

-- kjh

bassmadrigal 08-11-2016 01:36 PM

Quote:

Originally Posted by kjhambrick (Post 5589489)
This Arch Doc helped me 'get it' Arch Persistent block device naming

I used that wiki heavily when I was switching my computer over to UUIDs. It (and the few linked pages there) taught me a lot of what I know about UUIDs and how the interact with lilo.conf and fstab. Hopefully once I finish the slackwiki page, it can be a good enough reference for Slackers that they don't need to visit the Arch page.

Wiser Slacker 08-11-2016 06:32 PM

sorry for disturbing your party ...

Quote:

Originally Posted by bassmadrigal
PARTLABEL=

but i can't find any reference to this 'PARTLABEL=' in the kernel code, so i don't think that the kernel could find its root partition by this naming.

maybe with an initrd - i dont know - i have never used that.

ok. i shut up now

bassmadrigal 08-11-2016 08:19 PM

Quote:

Originally Posted by Wiser Slacker (Post 5589595)
but i can't find any reference to this 'PARTLABEL=' in the kernel code, so i don't think that the kernel could find its root partition by this naming.

maybe with an initrd - i dont know - i have never used that.

I'll do some testing in a VM before I finalize the wiki page.

bormant 08-12-2016 04:03 AM

@bassmadrigal,
as I can see for now 'PARTLABEL='
1) is unusable by kernel itself (see name_to_dev_t() from kernel's init/do_mounts.c), as "LABEL=" and "UUID=" too, and
2) is unusable by initrd. initrd's init script uses sbin/findfs to resolve "LABEL=" and "UUID=" to device name. As for 14.2 mkinitrd 1.4.8 uses BusyBox v1.20.2. It's findfs says:
Code:

BusyBox v1.20.2 (2016-06-20 15:25:34 CDT) multi-call binary.

Usage: findfs LABEL=label or UUID=uuid

Find a filesystem device based on a label or UUID

As we can see it doesn't know anything about PARTLABEL=.

So, for now "PARTLABEL=" is unusable by the kernel itself and by the initrd's init.

bassmadrigal 08-12-2016 08:33 AM

Sounds good. Where would we look to see if the fstab still supports it?

bormant 08-12-2016 08:53 AM

@bassmadrigal,
/etc/fstab is a config file of mount command, so

man mount -- for commandline support,
man fstab -- for support in /etc/fstab.

They (LABEL=, UUID=, PARTLABEL=, PATUUID=) are mentioned there.

bassmadrigal 08-12-2016 10:59 AM

Quote:

Originally Posted by bormant (Post 5589844)
@bassmadrigal,
/etc/fstab is a config file of mount command, so

man mount -- for commandline support,
man fstab -- for support in /etc/fstab.

They (LABEL=, UUID=, PARTLABEL=, PATUUID=) are mentioned there.

Good point. I had thought about that after I posted, but I was already in bed.

Daedra 08-13-2016 06:05 AM

Just out of curiosity for those who have the Samsung 950 Pro M.2. These things are ridiculously fast spec wise but on a regular desktop machine do you notice a real difference from a standard SSD?

kjhambrick 08-13-2016 07:23 AM

Quote:

Originally Posted by Daedra (Post 5590225)
Just out of curiosity for those who have the Samsung 950 Pro M.2. These things are ridiculously fast spec wise but on a regular desktop machine do you notice a real difference from a standard SSD?

Daedra --

Yes, for our IO-Bound Data Conversion Scripts I do see a difference between the Samsung SM951 M.2 and the Samsung 850 Pro.

Our Data Conversion App is nothing more than a set of sequential scripts that prepare a series of Delimited Text Files from a Legacy Business Basic System, then do Field-by-Field diffs on the sets of Current-vs-Previous Files ( pretty IO-Intensive ).

I've got a pair of NVMe's and another pair of SSD's on my Laptop but I've never installed the App on one-of-each to benchmark the difference.

My development instance of the App is installed and runs on an NVMe and it certainly finishes more quickly on my Laptop's NVMe Drive than 'anywhere else' even where they're running SSD Drives and especially on Boxes with Mechanical Drives .

I've noticed that there is not much difference between I3, I5, I7 CPUs but the HDD interface makes a HUGE difference.

One thing on 'my list' is to benchmark our DataFlow App on SATA HDD, SATA SSD, PCIe SSD, and NVMe SSD with similar CPUs to see what I really gain.

But that list is long and it seems to grow with time rather than shrink :)

Anyhow, anecdotally, yes they do run faster, depending on what you're doing.

And the way things are going, the PCIe / NVMe interface is coming soon to a Laptop near you :)

-- kjh

bassmadrigal 08-17-2016 08:13 AM

Ok, sorry for the delay, but I have finally finished the article. I will leave the FIXME portion at the top for a day or two to give you guys (and gals) an opportunity to go through and make any suggestions and/or corrections.

I welcome any feedback, either good or bad, on the article.

How to configure fstab and lilo.conf with persistent naming

kjhambrick 08-17-2016 11:56 AM

bassmadrigal --

I looked at your new HowTo this morning.

Very nice !

Thank you.

-- kjh


All times are GMT -5. The time now is 07:30 AM.