Page 1 of 1

Seven minutes to boot from ext4 with no safefile or savedir

Posted: Wed Dec 18, 2024 10:35 pm
by libertas

Hi,

FatDog is booting from an USB stick that has three partitions:

Code: Select all

# fdisk -l /dev/sda
Disk /dev/sda: 58.59 GiB, 62914560000 bytes, 122880000 sectors
Disk model: ProductCode     
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: xxxxxxxxxxxxxxxxxxxxx

Device        Start       End  Sectors  Size Type
/dev/sda1      2048   5070847  5068800  2.4G EFI System
/dev/sda2   5070848  51726335 46655488 22.2G Linux filesystem
/dev/sda3  51726336 122877951 71151616 33.9G Linux filesystem

sda3 is a cryptsetup encrypted LUKS container.

In sda1, EFI/boot/refind.conf, I've setup several FatDog boot entries, and one late EasyOS Daedalus.

Two of the boot entries that don't try to load any savedir are these:

Code: Select all

menuentry "Fatdog64 Linux FATDOG_LIVE no save dir" {
    icon /EFI/boot/icons/os_fatdog.png
    volume FATDOG_LIVE
    initrd \FD901/initrd
    loader /FD901/vmlinuz
}

menuentry "Fatdog64 Linux PUPPIES no save dir" {
    icon /EFI/boot/icons/os_fatdog.png
    volume PUPPIES
    initrd \FD901/initrd
    loader /FD901/vmlinuz
}

Code: Select all

# parted -l
Model: VendorC ProductCode (scsi)
Disk /dev/sda: 62.9GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name         Flags
 1      1049kB  2596MB  2595MB  fat32        FATDOG_LIVE  boot, esp
 2      2596MB  26.5GB  23.9GB  ext4         PUPPIES
 3      26.5GB  62.9GB  36.4GB               SESSIONS

When booting from the first entry, the FATDOG_LIVE, loading vmlinuz (and showing another line below it) takes about twenty seconds.

These are the files at sda1/FD901:

Code: Select all

# ls -l /mnt/sda1/FD901/
total 861620
-rwxr-x--- 1 root root 663115776 Aug 17 10:16 initrd
-rwxr-x--- 1 root root  19666944 Aug 17 10:16 initrd-nano
-rwxr-x--- 1 root root 190308352 May 25  2024 java-jdk-22.0.1+8-x64.sfs
-rwxr-x--- 1 root root   9202176 Aug 17 10:16 vmlinuz

When using the second entry, booting from the ext4 sda2, loading vmlinuz (and showing another line below it) takes SEVEN minutes!

Code: Select all

# ls -l /mnt/sda2/FD901/
total 861624
-rw-r--r-- 1 root root 663115776 Aug 17 10:16 initrd
-rw-r--r-- 1 root root  19666944 Aug 17 10:16 initrd-nano
-rwxr-xr-x 1 root root 190308352 May 25  2024 java-jdk-22.0.1+8-x64.sfs
-rw-r--r-- 1 root root   9202176 Aug 17 10:16 vmlinuz

I'd like have the system boot from sda2, not from the EFI partition.
What is wrong with this delay of seven minutes?


Re: Seven minutes to boot from ext4 with no safefile or savedir

Posted: Wed Dec 18, 2024 11:23 pm
by p310don

Code: Select all

menuentry "Fatdog64 Linux FATDOG_LIVE no save dir" {
    icon /EFI/boot/icons/os_fatdog.png
    volume FATDOG_LIVE
    initrd \FD901/initrd
    loader /FD901/vmlinuz

Code: Select all

title FD9.1  (sda1/)
  uuid abcd1234efgh5678
  kernel /vmlinuz   mergeinitrd1=local:/initrd 
  initrd /initrd-nano

The top is your boot stanza, the bottom is mine. The initrd-nano is a tiny initrd designed to alleviate that super long boot time.

BUT, also notice the \ in your initrd line, probably should be / not \


Re: Seven minutes to boot from ext4 with no safefile or savedir

Posted: Fri Dec 20, 2024 12:34 pm
by libertas
p310don wrote: Wed Dec 18, 2024 11:23 pm

Code: Select all

menuentry "Fatdog64 Linux FATDOG_LIVE no save dir" {
    icon /EFI/boot/icons/os_fatdog.png
    volume FATDOG_LIVE
    initrd \FD901/initrd
    loader /FD901/vmlinuz

Code: Select all

title FD9.1  (sda1/)
  uuid abcd1234efgh5678
  kernel /vmlinuz   mergeinitrd1=local:/initrd 
  initrd /initrd-nano

The top is your boot stanza, the bottom is mine. The initrd-nano is a tiny initrd designed to alleviate that super long boot time.

BUT, also notice the \ in your initrd line, probably should be / not \

Hi @p310don,

Thanks for your help.
I'll try what you suggested.
But, in both ways, either booting from the vfat EFI partition or from the ext4 partition, initrd is used and the difference in boot time is enormous.

What boot software are you using?

Regarding the \ vs / path separators, I think I read some years ago that they should be \, as it was defined in accordance to Microsoft way of doing things.
Maybe I got it wrong in my memory...


Re: Seven minutes to boot from ext4 with no safefile or savedir

Posted: Fri Dec 20, 2024 2:45 pm
by p310don

From my discussions with @jamesbond the problem lies from and issue with EXT4 partitions and grub4dos bootloader. For a normal initrd grub4dos works fine, but Fatdog uses a humongous initrd, which causes issues with slow boot.
Switching to the initrd-nano solves the problem. My PC boots in about ten seconds with nano, about ten minutes without it.


Re: Seven minutes to boot from ext4 with no safefile or savedir

Posted: Fri Dec 20, 2024 10:13 pm
by Keef

When I decided to reformat the partition Fatdog is on to ext4, boot time went up to 3 minutes. Using the 'small' initrd, it is back to normal.


Re: Seven minutes to boot from ext4 with no safefile or savedir

Posted: Sat Dec 21, 2024 3:59 pm
by fatdoguser
p310don wrote: Fri Dec 20, 2024 2:45 pm

From my discussions with @jamesbond the problem lies from and issue with EXT4 partitions and grub4dos bootloader. For a normal initrd grub4dos works fine, but Fatdog uses a humongous initrd, which causes issues with slow boot.
Switching to the initrd-nano solves the problem. My PC boots in about ten seconds with nano, about ten minutes without it.

Past slow booting humongous initrd's for me have been resolved by rebuilding the initrd (you may have to redo several times before getting one that boots (relatively) quickly). Don't know the cause, suspect it might be some boundary alignment factor with grub4dos.


Re: Seven minutes to boot from ext4 with no safefile or savedir

Posted: Sat Dec 21, 2024 8:43 pm
by step

@libertas, just to add to the answers others gave, this FAQ article https://distro.ibiblio.org/fatdog/web/f ... nitrd.html discusses both rebuilding the initrd, and the nano-initrd option.