Btrfs and learning...

So I went ahead and installed two SSDs in my laptop in order to set up a BtrFS raid. (These SSD’s - samsung 870 - are “blacklisted” so Btrfs shouldn’t try to do anything with them that they can’t handle.) I did the install 3x with similar end results.

I started install… “Expert Partitioner based on current proposal” (which was a single btrfs partition on sda with EFI boot partition and a swapfile). I “edited Btrfs” to “add devices” and added the second SSD (sdb) to the Btrfs with “defaults” for raid. Install went fine (downloading updates during install). But then the system wouldn’t boot (reported no bootable disk). I’ve never seen this behavior before - is there a trick I’m missing here with Btrfs? The setup seems correct with sda having boot/swap partitions and sdb just a Btrfs partition.

In order to boot now, I have to select BIOS esc/F9 (HP ZBook 15 FHD 15.6" Work Station Laptop NoteBook; Core i7-4700MQ; 16GB Ram; Nvidia Quadro K610M) during POST to enter “select boot device” and then select “boot from EFI file” - the BIOS finds the HD and FS and I navigate to the opensuse grub64 EFI file and select that - then the system usually boots correctly. I’m wondering what’s the issue with Btrfs and booting?

The system also periodically slows to a crawl for a few minutes as the btrfs.scrub (etc.) utilities run. I don’t believe Btrfs should slow the system like this! But I guess that’s a separate issue…

Right now my bios is selected to regard “EFI boot + legacy boot” - when I select “EFI only” it won’t boot (but I installed it in “EFI + legacy” mode. I don’t think changing modes is allowed except during initial install.)

Is this an SSD issue? Don’t know. Not enough well-digested information online to diagnose. So I bought two rotating drives and may reinstall to test.

It looks like hybrid SSHDs are super expensive - but I presume these would be faster than just bare rotating drives only. (The things we go through to get a checksumming FS! lol! )

Ideas Appreciated!!

PS: There’s also an issue with Btrfs and “bare metal” SSDs (not sure if it also applies to HDs). If install fails, I had to GParted the drives and create new partition tables (GPT) - that is, take them back to bare metal - b/c YaST install would not deal with the remains of the Btrfs RAID correctly. I got errors associated with missing partitions and unbootability. (Sorry I didn’t document these carefully!)

Hi
I guess the question is RAID to what end?

Not sure linux supports SSHD’s easier to use a caching device (eg bcache) or if the SSHD’s SSD can be used for this…

I could be related to the blacklisted devices libata being more cautious perhaps.

Can you show the following output;


parted -l
efibootmgr -v

I would not have enabled Legacy, maybe that is part of the boot issue, but above should provide information.

  1. Don’t use rotating drives unless you have a very good reason for doing so. HDDs are great for backup
  2. Use a plain drive such as the Samsung SSD 850 EVO or newer. Almost any brand now works great
  3. If supported by your system use NVME x4 drives
  4. In the BIOS disable legacy support (CSM) and use UEFI only
  5. When installing openSUSE use btrfs with defaults for system partition
  6. With bootloader uncheck ‘secure boot support’ and check ‘probe foreign OS’

To my experience sticking to the above eliminates some 99% of issues encountered.

Thank you very much for the reply! The raid was mostly to avoid dealing with data filling up individual partitions. It’s really nice not to have to move data around - just having one big “partition.” Also makes backing-up very straightforward; I’m “challenged” in this regard, so it’s a big help. I had also thought that the raid would help with the self-error-correction of btrfs but all that is still not clear in my mind - I think the only way that would be possible (with ssd’s) is to have raid1 - a complete mirror ssd.

The booting problem was completely unexpected and not mentioned in any btrfs sites/threads I can find - but I have noticed opensuse slowly getting trickier and trickier to install/update (for instance, lately it has EFI-related issues picking up an existing win7 install and showing win available for boot in GRUB - but that’s a separate laptop and issue…).

All this, of course, is making me wonder about Btrfs…

I didn’t enable legacy boot - “EFI + legacy” mode was the default on this laptop and has been that way since 42.2. (BTW: in the dump below, I had to remove the sandisk to get boot, but I removed it during GRUB, so I guess that’s why it shows up… the system wouldn’t boot from EFI with the sandisk plugged in.)

So…

# parted -l
Model: ATA Samsung SSD 870 (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name  Flags
 1      1049kB  525MB   524MB   fat16                 boot, esp
 2      525MB   1998GB  1998GB  btrfs
 3      1998GB  2000GB  2148MB  linux-swap(v1)        swap

Model: ATA Samsung SSD 870 (scsi)
Disk /dev/sdb: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags: 

Number  Start  End     Size    File system  Flags
 1      0.00B  2000GB  2000GB  btrfs

# efibootmgr -v
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000,0001
Boot0000* Notebook Hard Drive   BBS(HD,,0x0).......................................................................
Boot0001* USB Hard Drive 1 - SanDisk Ultra Fit  BBS(HD,,0x900).......................................................................

Thank you!
I was thinking that I should try reinstalling with “EFI only” in BIOS.
There appear to be issues with SSD’s still reported on the Btrfs homepage(s). It almost reads as if Btrfs development has stalled a bit in that regard.
Rotating drives appears to be the only “guaranteed” way to get self-error-correction with Btrfs (from Btrfs home page).
I did learn about avoiding “secure boot support” (the hard way!). But thanks for mentioning it!

  • I’ve never seen OpenSuSE self-enable “secure boot support” before! But, oddly, this install with Btrfs raid, it did self-enable it. I had to manually disable it. WEIRD!! (This may be an glitch in the installer code?)

BTW: I’ve been installing/using OS on many machines/servers since OS11 or thereabouts. I’m listed as an “Explorer Penguin” b/c I didn’t update my profile when this forum changed it’s website a year or so ago. (OTOH - I never really became a guru or a wizard or anything like that.)

Also:

df: /run/user/1000/doc: Operation not permitted
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        7.5G     0  7.5G   0% /dev
tmpfs           7.5G  276M  7.2G   4% /dev/shm
tmpfs           7.5G  9.9M  7.5G   1% /run
tmpfs           7.5G     0  7.5G   0% /sys/fs/cgroup
/dev/sda2       3.7T  784G  2.9T  22% /
/dev/sda2       3.7T  784G  2.9T  22% /.snapshots
/dev/sda2       3.7T  784G  2.9T  22% /tmp
/dev/sda2       3.7T  784G  2.9T  22% /root
/dev/sda2       3.7T  784G  2.9T  22% /boot/grub2/i386-pc
/dev/sda2       3.7T  784G  2.9T  22% /boot/grub2/x86_64-efi
/dev/sda2       3.7T  784G  2.9T  22% /var
/dev/sda2       3.7T  784G  2.9T  22% /opt
/dev/sda2       3.7T  784G  2.9T  22% /home
/dev/sda2       3.7T  784G  2.9T  22% /srv
/dev/sda2       3.7T  784G  2.9T  22% /usr/local
/dev/sda1       500M  328K  500M   1% /boot/efi
tmpfs           1.5G   28K  1.5G   1% /run/user/1000

~> lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0  1.8T  0 disk 
├─sda1   8:1    0  500M  0 part /boot/efi
├─sda2   8:2    0  1.8T  0 part /usr/local
└─sda3   8:3    0    2G  0 part [SWAP]
sdb      8:16   0  1.8T  0 disk 

/dev/sda1: SEC_TYPE="msdos" UUID="--------------" TYPE="vfat" PARTUUID="4abc73fb----------------------------------------"
/dev/sda2: UUID="14a57504------------------" UUID_SUB="e385c59d-------------------" TYPE="btrfs" PARTUUID="166090b6---------------------"
/dev/sda3: UUID="32bf01f5-------------------" TYPE="swap" PARTUUID="4128283b-8-------------------"
/dev/sdb: UUID="14a57504-----------------" UUID_SUB="2a1121fe-1a81-----------------------" TYPE="btrfs"


Hi
So it’s just missing the efi entry… Boot the system as per your current method, then as root user;


efibootmgr -c -L "opensuse" -l "\\EFI\\opensuse\\grubx64.efi"

It should set that new entry as default.

Thank you very much!! Is it necessary to do a clean reboot then do the efibootmgr thing immediately after?

Hmmm… install went fine - so did the Yast installer get confused? Or did some btrfs.trim/scrub/etc. operation mess something up?

I can’t think of any other possible reasons the efi entry is missing… (I installed OS about 6 days ago.).

It might be related to Yast install since it also has issues with setting up a btrfs raid if the drives have remnants of a prior btrfs raid on them (I wound up doing several repeated installs to get to where I am). I found I had to GParted the drives and create a new GPT on each of them, between each install try, to avoid that.

Double backslashes, huh?


         ...
        -i | --iface name     create a netboot entry for the named interface
        -l | --loader name     (defaults to "\efi\linux\grub.efi")
        -L | --label label     Boot manager display label (defaults to "Linux")
        -m | --mirror-below-4G t|f mirror memory below 4GB
         ...

Hi
Yes to escape the special char :wink: It will be only one in the final output.

Thanks - that’s what I thought, and it explains the double-quotes, I suppose. :shame: (even though the --help didn’t show the escape and it had double-quotes… so confusing!)

Hi
So now booting as expected?

Malcom: I’m really surprised that didn’t help!

Now:

# efibootmgr -v
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000
Boot0000* Notebook Hard Drive   BBS(HD,,0x0).......................................................................

Before my test reboot I executed the line you gave me…

efibootmgr -c -L “opensuse” -l “\EFI\opensuse\grubx64.efi”

And I saw that grubx64.efi was listed as #3 (with that SanDisk as #2). It changed to Notebook Hard Drive on reboot! (but with a couple of failed tries in between)

The failed tries:

  • tried setting EFI only in BIOS: “No Bootable Image - computer will shut down”
  • switched back to EFI + legacy
  • tried booting normally: “No operating system installed…”
  • tried BIOS F9 boot into “Notebook Hard Drive:” “No operating system installed”
  • BIOS F9 boot selecting “boot from EFI file” (as I have been doing) (it booted and here I am)

So, I’ll try executing the command again (not sure how to change the boot order with that efibootmgr command) but this time w/o changing bios at all.

# efibootmgr -c -L "opensuse" -l "\\EFI\\opensuse\\grubx64.efi"
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0001,0000
Boot0000* Notebook Hard Drive
Boot0001* opensuse
# efibootmgr -v
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0001,0000
Boot0000* Notebook Hard Drive   BBS(HD,,0x0).......................................................................
Boot0001* opensuse      HD(1,GPT,4abc73fb-52a5-496f-a639-3b62fe525174,0x800,0xfa000)/File(\EFI\opensuse\grubx64.efi)

Tried messing around - but no change on boot - except I have to let boot fail before the F9 “boot from EFI file” option will work.

# efibootmgr -v
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000
Boot0000* Notebook Hard Drive   BBS(HD,,0x0).......................................................................
Boot0001* opensuse      HD(1,GPT,4abc73fb-52a5-496f-a639-3b62fe525174,0x800,0xfa000)/File(\EFI\opensuse\grubx64.efi)
Boot0002* opensuse      HD(1,GPT,4abc73fb-52a5-496f-a639-3b62fe525174,0x800,0xfa000)/File(\EFI\opensuse\grubx64.efi)
Boot0003* opensuse      HD(1,GPT,4abc73fb-52a5-496f-a639-3b62fe525174,0x800,0xfa000)/File(\EFI\opensuse\grubx64.efi)

I think it’s time to reinstall. I’m torn between these options: (after setting EFI-only in BIOS)

  1. installing a btrfs-raid
  2. installing to a single drive and setting up the raid after the install
    …might have to try both… :\

…first rsync everything to a big external drive… :slight_smile:

ACTUALLY - now that I think about it - I don’t know if the 870 SSD’s from Samsung are actually black-listed - I think someone told me that the 850’s are. They got that info from a web page that seemed to have some source code listed (or at least the headers). Does anyone know where this information was listed? This could be pretty important b/c if btrfs knows about 850’s but not about 870’s… that could be an issue.

Hi
It depends all sorts of different devices and reasons… see libata-core.c (line 3774 onwards) ;
linux/drivers/ata/libata-core.c at master · torvalds/linux · GitHub