(SOLVED) Installing Linux on an M.2 SSD

That's what I've been starting to think. Tough break. Glad you have the Easy2Boot to make troubleshooting uhh easier...

How old is the PC? If I remember correctly, it's an OEM that your work issued to you. If it's not too old, an RMA may be in order. Usually companies have quite good repair/maintenance plans with their chosen hardware vendor.

The whole idea here is that when you mkfs.btrfs /dev/sda, you're not installing to a partition defined by GPT, DOS or any other partition table. This becomes a problem because it allows BTRFS to use every last sector on the disk but you've used the first few sectors for GRUB. If btrfs wants to write to those sectors, you'll be stuck without a bootloader. My advice?

sgdisk /dev/sda

create a 1MB BIOS boot on /dev/sda1 and use the rest of the device for /dev/sda2 and use btrfs on it. I can't say a partitionless disk has ever bitten me personally, because I don't put bootloaders on them, but it's happened to someone I know.

Up to you. My vote is to reconfigure it all, but I know you've been working on this for the better part of two weeks.

I'm curious what MSI has to say about the board. Have they said anything about the board's UEFI capabilities?

Honestly, I've never been super concerned with BIOS speed. I actually prefer a slow bios so I have time (my monitors are slow to wake) to hit the BIOS key since I'm always tweaking it.

That's interesting about swap files on btrfs. Have a look at this github repo. Basically the script creates a file of the desired size, sets no-cow (chattr +C), loop mounts the file and formats the loop device as swap. Pretty cool, but there has to be a reason for BTRFS not supporting swap.

Apparently swap relies on a function that BTRFS doesn't currently support. Source: BTRFS FAQ

Yeah, I never hibernate my PC's. It was nice when we didn't have SSD, but now with fast disk, it's cleaner to just boot and reopen programs. Time cost is seconds at most.

Yeah...

It's a PC which I selected the parts myself. We aren't a large enough company to deal with OEMs to be honest. It's brand new.

I'm not understanding.

you've used the first few sectors for GRUB

Did grub-install do that?

I found this while researching this:
https://bbs.archlinux.org/viewtopic.php?pid=1300101#p1300101

AFAIK btrfs leaves the first 64 KiB empty. You can use that to install a boot loader with btrfs support.

I can't find a source for that, but I did do a test. Having formatted both my SSD and HDD entirely as BtrFS, I output the first 64KB of the HDD (no bootloader) to a text file, then I output the next 64KB. The first 64KB appear to be empty while the next 64KB appear to be formatted in a specific way but also empty (nano thought it was a Mac format while it didn't comment on the first 64KB's size).

Not conclusive at all, but I would figure that implies the first 64KB aren't formatted.

Re: I found a source.

http://linux-btrfs.vger.kernel.narkive.com/EgoOKEP1/64kb-boot-sector-gap

Yep. Worried my boss might go "... are you still working on that?" lol

I'm fine with it as it is tbh.

Support has been down right atrocious. Here is the log:

  • Type Problem Note
  • MSI Tech
    make sure all SATA port drive has been unplug and make sure the controller has been set to AHCI mode.
  • End User
    What am I supposed to do with that information?
  • MSI Tech
    On-Board SATA ā€¢ IntelĀ® Z170 Express Chipset ā€¢ 6 x SATA 6Gb/s ports* (2 ports reserved for SATA Express port) ā€¢ 1 x M.2 Key M Socket supports type 2280/2260/2242 storage devices in both PCIE Gen3 x4 & SATA mode* - Supports PCIe 3.0 x4 and SATA 6Gb/s standards, 4.2cm/ 6cm/ 8cm length M.2 SSD cards - Supports PCIe 3.0 x4 NVMe Mini-SAS SSD with Turbo U.2 Host Card** ā€¢ 1 x SATAe port (PCIe 3.0 x2)*** ā€¢ Support RAID 0, RAID1, RAID 5 and RAID 10 for SATA storage devices. ā€¢ Supports IntelĀ® Smart Response Technology for Intel Coreā„¢ processors. * SATA1~2 ports will be unavailable when installing the M.2 SATA interface module in M.2 slot. SATA3~4 ports will be unavailable when installing the M.2 PCIe interface module in M.2 slot. ** The Turbo U.2 Host Card is not included, please purchase separately. *** SATAe port is backward compatible with SATA.
  • End User
    If I install it with BIOS, it works. If I install it with UEFI, it does not work.
  • End User
    I install it to the M.2 Drive. It will not boot.
  • MSI Tech.
    how does not work? Can't install windows 10 to the M.2 drive?
  • End User
    It did not work after following your instructions. I did however disable Windows 7 OS in the Windows Configuration settings as I'm not installing Windows 7.
  • MSI Tech.
    load the bios setup default setting, perform fresh/clean OS installation to the M.2 drive with the additional HDD been removed and only leave the M.2 alone and retest.
  • End User
    I did. The system does not boot from the device. I've installed it to both the M.2 drive and the SATA drive. Neither will boot UEFI.
  • MSI Tech.
    you have to install the OS onto the M.2 drive in order to boot off to.
  • End User
    I have already stated that I did not do that. I install the OS. It does not boot. I did not change anything after installation.
  • MSI Tech.
    you can't adjust these settings after the OS has already been installed.
  • End User
    I have reinstalled the Operating System multiple times after having set Secure Boot to off and the BIOS to UEFI boot mode only (not Legacy+UEFI). It still does not work.
  • MSI Tech.
    you will need to perform fresh/clean OS installation after the setting has been set in order to work.
  • End User
    The system will not boot into UEFI for any operating system I install. In the BIOS screen, under Settings > System Status, it lists SATA 1 as my M.2 SSD (Samsung 850 Evo 500GB), and it lists my HDD (Hitachi HDS722 2TB) as SATA 6. It will not list either drive under the UEFI Hard Disk option. I do not have a UEFI Hard Disk BBS Priorities menu under Settings > Boot. I have tried disabling Secure Boot and other options under Windows OS Configuration, but that has not helped. I have tried to install Arch Linux and Windows 10. I have tried both on my SSD and my HDD. No combination I've tried will use UEFI. I would've attached my BIOS Config backup file, if there were a way to even do that. I don't mean Overclock profiles. I mean general BIOS settings. The tag line on the side of the box is "Making your life easier is our business." My experience with this motherboard has been the opposite of that.

The one cool thing I've found with this motherboard is that it has a feature to where if you hold the Power button for 4 seconds, it goes straight to the BIOS setup screen, so no amount of "fast booting" can keep you from it.

That's neat. Thanks. :D

Same. It's either off or on thanks to SSDs and UEFI boot.

Edit: Using gdisk on either the SSD or HDD also reports that there is an MBR but an invalid/corrupt GPT.

That's cool one way or another. New companies are fun. See what MSI says. I don't really have much advice for you on this front.

Interesting. You should be fine then.

If you want to see the data better, use hexdump or ghex or something. You'll be able to see some data that way.

True. If you don't have much time, it's fine, especially considering what you found about the first 64KiB.

Holy shit. That's quite something. I would recommend trying a supervisor or something. I knew MSI was so/so with support, but I didn't realize they were no help at all.

That's damn nice. I'll have to see if ASUS has something like that. I'm mostly ASUS boards.

Glad I can help.

I wonder why that is. I'll have to look into it.

1 Like

Yeah, I noticed that hexdump command in a thread I was reading. That source pretty much confirms it though. :D Very useful to know about hexdump though.

Yeah... See, it's from bottom to top. Meaning, multiple replies in, he just replies with a copy/pasted list of the motherboard specifications. Pretty ridiculous.

Literally every message on the MSI site for this has broken english and notable typos. Even the emails do. It's.... disconcerting.

And you have to save and submit each of these as notes on a trouble ticket. It's not a direct chat. Pretty obtuse to use.

Funny thing regarding that. I have an ASUS X99 Deluxe at home. The most trouble I've ever had with a system for similar reasons.

Even if it's not normally bad for normal users, for me, it was hell. Remember how I mentioned I'd reinstalled Arch like 8 times with UEFI trying to figure out why it wouldn't boot? That was on this motherboard. It literally took months to figure out what the issue was. Partially my fault, but that implementation of UEFI is ridiculous.

UEFI shenanigans (auto-deletes entries if you boot the PC without the drive attached and doesn't re-create them)

Booting with a custom made keyboard plugged into any of the onboard USB ports causes the system to hang on boot. Using the supplied USB 3.0 PCI-e card works fine though. It works fine on other machines. It's just my machine and this motherboard.

There are other issues I've had that I've forgotten since they happened a year ago, but I deeply regret getting this motherboard.

I personally feel like ASUS falls into the same trap as other companies who produce everything. The best quality you can expect is "ok". Most of it works, but from what I've seen, little is exceptional.

Having owned a monitor, router, motherboard, and GPU from them, the thing I'm happiest with is by far the router. But it's a bit of a premium product, so I'd expect it to be (RT-68U). Then again, the Deluxe mobo is premium, but I guess since it's not RoG, it just had to be worse off in some way.

Sorry to rant. I've had so much trouble with these things, it just gets to me sometimes.

:)

I would guess gdisk just looks at the section after the first 64KB, and if something is there, it calls it a GPT.

Apparently, part of what limits MBR to 4 primary partitions is the 64KB space limitation. GPT expands this by using the next 2MB after that, which is usually reserved and kept from the file system partitions. That's what allows GPT to have up to 128 partitions, and can expand by going beyond that 2MB.

This used to be a problem because some programs would use that for things and write to it whether something was there or not. So you could destroy your disk partition layout just by using a program that didn't know better.

I'm just parroting what I've picked up in researching this. It's pretty interesting though.

I'd hope gdisk would be smarter than just "if something is in that 2MB, it's GPT", but that part is just my guess.

To troubleshoot this I would deconnect the second drive, and see what output F11 (boot menu) gives me. Then go from there.

Some tips from my own experience (UEFI can be very tricky):
- Once done installing Arch, check using efibootmgr whether a boot entry was added to EFI
- Beware: having a FAT32 partition is not enough for EFI! Make sure the esp flag is set properly for the partition. I have the feeling you might be missing this flag on your EFI partition.
- On your motherboard, you should have the option to add an EFI entry manually. If you chose that option, does it detect the M.2?
- If it does, you can browse to the folder containing grubx64.efi or bootx64.efi and point to it manually. Then see what happens when trying to boot from it that way.

1 Like

So I checked my trouble ticket today being the first day back at work after the holidays.

So it doesn't support booting from the M.2 using UEFI. Wow. What a waste of time.

I now have the system booting from the M.2 using BIOS/GPT, so I guess it works out in the end, but my goodness.

Solved