How to get Linux onto a non-approved laptop
- Reference: 1658505610
- News link: https://www.theregister.co.uk/2022/07/22/linux_nonapproved_laptop/
- Source link:
The Reg FOSS desk recently [1]reported on this year's Ubuntu laptop from Dell. It's a good thing to have major vendors shipping kit that is approved and certified for Linux, but it doesn't help if you have a non-approved model. We recently battled with such a machine – this is the report from the front line. For reference, it's a Dell Latitude 5420, UEFI, Core i5, SSD only, USB-C, and USB-3.
We are going to assume that your laptop comes with Windows pre-installed, simply because most of them do. Apple laptops are a whole other world of suffering, and since the Intel ones are on the way out and the sole [2]distro for Arm-powered kit isn't quite there yet, we'll leave that for another day.
[3]
The first few things you should do are easier under Windows, though, so don't wipe it just yet. In fact, we suggest that you don't wipe it at all. As a general principle, unless you're very short of space, we recommend dual-booting. You can shrink a Windows C drive down quite a lot, and having a fallback OS to hand can be handy in emergencies.
[4]
[5]
Secondly, if it's a company machine, check with the IT department that you're allowed to do this. Many won't let you, and it's not worth losing your job.
Before you touch anything, we suggest preparing a [6]Ventoy USB key with the ISO file of your Linux distro of choice, and also a copy of the ISO installer for your version of Windows from the Microsoft [7]downloads page . [8]The oft-handy SystemRescue wouldn't go amiss, either.
Step 1: Update your firmware
For convenience, we'll call this the BIOS, even though on a new box, it's almost certainly UEFI. Determine the exact model number. A very easy way to do this that a surprising number of people overlook is just to turn the thing upside-down and look for a sticker on the base. Then look on the maker's website for the latest BIOS, and compare that to the current one. If you boot Linux off a USB key, the command dmidecode -s bios-version will usually tell you.
How to update it varies wildly from one brand to another. You might be able to download and run a Windows app, or download a file and write it to a blank USB key then boot from it, or just copy a file onto USB and read it from within the BIOS itself. It varies. Google for that machine's BIOS hotkeys, because they vary a lot: it might be Esc , Del , F1 , F2 , F10 , F12 or even a combination. Ideally, the two you need are the key combo to enter the BIOS setup, and if possible, the one to pick a boot device.
Step 2: Make sure Linux can see, and read, your disks
As The Reg FOSS desk favors old ThinkPads with full-travel keyboards, this 2021 model came as a bit of a shock. For instance, it has a power button where the Delete key should be, because apparently product designers don't type.
What was more of a surprise was that Linux couldn't read its hard disk. It didn't even know that there was one.
[9]
We found that the machine shipped with an encrypted hard disk, using Windows 10's Bitlocker, even though we'd never set a password. Your vendor might publish [10]instructions on how to disable this. If not, Microsoft [11]does . Disable it and wait for the job to finish.
Even so, Linux couldn't see the disk. Although this is a slimline laptop with a single SSD slot, Dell ships it configured for RAID with Intel's "Rapid Storage Technology" driver. This means third-party OSes can't [12]see the drive. While it is easy to change this in the BIOS, the snag is that Windows then will not boot.
So don't change the BIOS setting yet. First, boot Windows and set it to start in Safe Mode. Open an Admin-mode command prompt, and enter this command: bcdedit /set {current} safeboot minimal
Then you can go into the BIOS and change the setting to normal AHCI mode. Windows will load in Safe Mode, and detect and install the new storage driver. Reboot to check it works, then disable Safe Mode again from an Admin command prompt: bcdedit /deletevalue {current} safeboot
Kudos to "LinuxSecurityFreak" for the second answer to this issue on [13]StackExchange .
After this, Windows should boot normally.
Step 3: Shrink Windows
Now you can do a little housekeeping in Windows to make some space. A hibernation file in an OS you don't use is a waste of disk space, and disabling it also disables Windows' "Fast Boot" mode which stops Linux mounting the disk. Again, open an Admin command prompt and type: powercfg /h off
If the machine has been used for a while, it's a good plan to run a disk check. Open an Admin command prompt again, and type: chkdsk c: /f
Answer yes with a Y, and then reboot.
We also recommend running Disk Cleanup twice. First time, run it in normal mode, tick all the boxes, and let it do its job. Then run it again, click "Clean up system files" and run it again . Second time typically takes a lot longer, but cleans up more stuff, including hard-to-remove stubborn stains such as Windows Update backups.
[14]
The rest is somewhat at your discretion. If you don't expect to ever need Windows much, you can do an extra-thorough job. For instance, use Control Panel to uninstall every optional extra in sight, then PowerShell to [15]remove all the "modern" apps.
Step 4: Remove any surplus partitions
Windows usually tends to come with a "recovery partition", but since you can reinstall using the ISO file from Microsoft, you don't really need it. Just make sure that you know which is your UEFI System Partition (or ESP for short), and your main Windows partition (the C: drive). You need to keep the ESP, and we recommend keeping your C: drive.
Top tip: Make a note on paper of what's where, the order and the sizes, and volume labels, if any. You might not need it, but if you do, it can be a life-saver.
You can use Windows' Disk Management to check and to shrink the C drive. We just press the Windows key and R , type diskmgmt.msc and then hit Return, but whatever way suits you.
If any partitions don't have drive letters, now is a good time to assign letters to them, then quit Disk Management and use Explorer to see what's on them. Go through all your drives, check there's nothing on them, and if there is, move it to your C drive or to a backup disk.
[16]Dell and Ubuntu certify latest model of XPS 13 ultrabook
[17]Tavis Ormandy ports WordPerfect for UNIX to Linux
[18]Yocto Project gets big backer and second LTS release – but what is it?
[19]Rocky Linux 9 and its new build service enter the ring
Right-click the main Windows partition and choose "Shrink". The function is very conservative, and often won't shrink the drive much, but if you have a big disk that may not matter.
Or, of course, you can do this in Linux itself. Boot your preferred distro and run the GParted tool that every live medium has pre-installed. Remove all partitions except the C drive and the ESP.
Step 5: Make your Linux partitions
Any distro's installation program will make partitions for you, but we recommend making them in advance using GParted . It's easier and more flexible.
UEFI machines usually have the hard disk partitioned using [20]GPT . BIOS-based systems, even 64-bit ones, usually used MBR, which can only handle a maximum of four primary partitions per drive – but one (and only one) of them could be an extended partition, containing secondary partitions or, as DOS called them, "logical drives". GPT eliminates this: there are no extended or secondary partitions any more, and you can have up to 128 partitions per disk. (Hint: don't.)
The minimal setup for most Linux distros is one big partition. If you want to be able to hibernate under Linux, you will also need a swap partition at least as big as your computer's RAM.
We recommend a separate partition for /home , but that's getting fancy. In the old days, 16GB for the root partition (where the OS lives) was plenty, but now, with bloated Snap and Flatpak packages closing in on all sides, 64GB is more reasonable.
If you make your partitions with GParted, again, make a note of what is going where. We format them as ext4 as a general rule, except any swap partition which has its own option for that role.
If you're using a fancy distro with Btrfs and snapshots, such as openSUSE, Gecko Linux or Spiral Linux, at least quadruple that allowance – but to be honest, in that case you're better off using the distro's own partitioning function.
Step 6: Install and go
Once you have made your destination partition or partitions, and you have a note of which ones they are, run your installation program. When you get to the partitioning screen, pick "something else" or whatever your installer calls the custom-partitioning option.
Pick your ESP and tell the installer to mount it in the right place: that's usually /boot/efi . Pick the root partition and mount it at / . If you made them, pick the home partition and mount it at /home , and choose the swap partition and select "use as swap" or words to that effect.
That should be it. Install, update, enjoy. ®
Bootnote
Over a decade ago, this still-damp hatchling freelance vulture wrote the Reg Guide to Linux , which is still there: parts [21]one , [22]two , and [23]three . You might find it useful, or at least amusing, to read that too, especially if you're using an older machine. Much has changed in the interim, but the guidance on cleaning up Windows cruft still has something to offer.
Get our [24]Tech Resources
[1] https://www.theregister.com/2022/07/21/dell_xps_ubuntu_2204/
[2] https://www.theregister.com/Tag/Asahi%20Linux/
[3] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2YtseAqVdnKcLX5UfTBTAswAAAQg&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0
[4] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44YtseAqVdnKcLX5UfTBTAswAAAQg&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[5] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33YtseAqVdnKcLX5UfTBTAswAAAQg&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0
[6] https://www.theregister.com/2021/12/10/friday_foss_fest/
[7] https://www.microsoft.com/en-gb/software-download/windows10ISO
[8] https://www.theregister.com/2022/01/24/systemrescue/
[9] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44YtseAqVdnKcLX5UfTBTAswAAAQg&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[10] https://www.dell.com/support/kbdoc/en-uk/000125409/how-to-enable-or-disable-bitlocker-with-tpm-in-windows#TOC06
[11] https://docs.microsoft.com/en-us/powershell/module/bitlocker/disable-bitlocker?view=windowsserver2019-ps
[12] https://community.spiceworks.com/topic/2337884-can-t-see-an-nvme-ssd-on-a-latitude-5420-with-minitool-partition-manager-12
[13] https://superuser.com/questions/1280141/switch-raid-to-ahci-without-reinstalling-windows-10
[14] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33YtseAqVdnKcLX5UfTBTAswAAAQg&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0
[15] https://www.askvg.com/guide-how-to-remove-all-built-in-apps-in-windows-10/
[16] https://www.theregister.com/2022/07/21/dell_xps_ubuntu_2204/
[17] https://www.theregister.com/2022/07/20/wordperfect_for_unix_for_linux/
[18] https://www.theregister.com/2022/07/20/yocto_project_4/
[19] https://www.theregister.com/2022/07/18/rocky_linux_9/
[20] https://www.howtogeek.com/193669/whats-the-difference-between-gpt-and-mbr-when-partitioning-a-drive/
[21] https://www.theregister.com/2010/06/21/reg_linux_guide_1/
[22] https://www.theregister.com/2010/06/23/reg_linux_guide_2/
[23] https://www.theregister.com/2010/06/24/reg_linux_guide_3/
[24] https://whitepapers.theregister.com/
Re: Old linux person here....do not understand......
And it seems an awful lot of faff to ensure it will.
Re: Old linux person here....do not understand......
Better to wipe Window, install Linux and then, if you do need it, install Windows in a VM.
Re: Old linux person here....do not understand......
That is fine if you just need an app or two, but a VM can't update the system's firmware, it can't update external devices' firmware, it can't configure hardware, and so on.
Also, a VM won't activate from a license key in the firmware.
There are useful things Windows on bare metal can do, even if you run Linux 99% of the time.
If it is there, free and activated and legal, then it's foolish to throw it away unless you desperately need the space, IMHO.
Re: Old linux person here....do not understand......
I can update my firmware from Linux
https://itsfoss.com/update-firmware-ubuntu/
Re: Old linux person here....do not understand......
https://fwupd.org/ - Dell have gone nearly all in on this.
In the past I have formatted my swap as FAT32 and booted FreeDOS. Nowadays /boot is FAT32 for EFI and ideal for calling BIOS flashers (oooeeer missus!) Slap your package (fnarrr) in /boot/firmware for example and use the built in BIOS updater. HPEs often have an updater that will download direct from the mothership via a handy internet.
Re: Old linux person here....do not understand......
[Author here]
Well, as I go on to say, I generally recommend leaving Windows in place. Disk space is cheap and abundant now, and it can be handy for things like upgrading firmware. It is still better for some things, including gaming. If you can afford the space, keep it.
Linux does have tools for this now, but they are not universally reliable: not all vendors publish updates in Linux format, and the Linux tools might not be able to handle firmware in external devices such as docking stations.
I've also seen machines with multiple screens on the docking station, where Windows is needed to configure them initially. After that, Linux can use them, but if you reconfigure the monitors -- move one to a different port, say -- you need Windows to configure that.
One of my work machines in a previous role was unable to boot Linux from hard disk in UEFI mode, unless Windows was present and handling an ESP. Linux on its own couldn't do it. Two of us spend days trying to no avail.
Re: Old linux person here....do not understand......
I too have learned the hard way that if space allows, I am better off leaving Windows in place. Usually I will never need it, but there's no way to tell ahead of time whether I will or not.
Re: Old linux person here....do not understand......
Last machine I had with windows on it shrank the partition and left it for a couple of years. Accidentally booted into it one day it decided to update itself. Killed that and went over to linux. Needed to update a tomtom so went to windows and it was completely screwed.
Re: Old linux person here....do not understand......
SSD disk space is neither abundant or cheap. A lot of laptops come with a small SSD drive expecting us to use the cloud. How big is Windows OS these days?
On my Lenovo Yoga I blew Windows away and installed Ubuntu with full disk encryption. Biggest issue was the new sleep modes. Gave up and went for hibernation instead, uses no power and still starts pretty quickly. Though not sleep-wake instant on.
Re: Old linux person here....do not understand......
I just got a new machine, some not-quite-brand-spanking-new Thinkpad. I put in a 1 TB SSD and it was not too stupidly expensive. There would be a ton of space on the SSD it came with - except I'm now ripping all my CDs to flac, and since my NAS is not yet up and running I have everything on the new machine...
I will keep the Windooze installation for now - though I do not expect I'll ever need it.
Re: Old linux person here....do not understand......
You would be surprised how many 256GB laptops are around - my company tried to replace with one of them my actual laptop.... until while under my oversight they tried to move my data to the new one and it filled the disk completely... some large applications, VMs and test datasets may need a lot of space...
Safemode -> AHCI -> Safemode?
So, Windows won't boot at all if AHCI is selected BEFORE persisting Windows into Safemode?
Certain non-approved Lenovo models (I have one) came with rapid storage set ON. I dd'd the OEM HDD to a larger SSD and then connected the drive, then disabled rapid storage. If I disabled rapid storage before swapping the drives, it wouldn't POST*. Apparently disabling it and leaving the same drive in (at least with the same serial/key) is a big no-no. This was a lesson learned that made me open that laptop to hard reset the BIOS. At no point did I boot into Windows... straight out of the e-bay box to KUbuntu. Later on I did test it and Windows boots fine from GRUB although, it barked about a different UUID or something on first boot (don't remember... don't care).
* bless the net as I don't think I would of figured out to disable it AFTER connecting the new drive :-/
Re: Safemode -> AHCI -> Safemode?
(Note: I'm vastly simplifying things here.)
It's a different storage driver; Rapid Storage acts as a RAID controller rather than a traditional SATA or IDE storage controller, and it presents itself quite differently to the OS; if the OS is aware of it (usually by having the storage driver installed) then there's no problems. Same thing with AHCI, although windows 7(or 8, can't remember) and later have a built-in driver for it, but won't load it if the BIOS doesn't have it turned on.
This is technical debt from pre-windows 10/8 days, where you had to provide a storage driver just to install windows to begin with (the infamous "Press F6 to provide a storage driver disk".
Feel free to correct me if I'm wrong about it- It's been a while since I've had to muck around with that.
"We recommend a separate partition for /home, but that's getting fancy."
Fancy? Just a basic requirement. What it means is that if you want to try various distros or need to reinstall your existing distro* you don't lose your home directories. Getting fancy is adding /usr/local and /opt directories although Snap and Flatpak tend to replace those, probably at the expense of a lot of duplication.
One thing to be aware of is that, in Debian derivatives at least, some or your data may live in /var. MariaDb data and, if you use it, Apache web server data live there. You don't really want to lose those on a reinstall so I recommend a separate /srv partition as well and force those onto it.
* Less likely now that upgrades don't usually need a complete reinstall.
Ooh, separate home or not. My problem is that if the distros come with different software versions there is no guarantee that the files stored in /home/$USER are actually compatible. In fact I recall trashing some things. I prefer to have a /userdata partition that contains the, well, data that is not reliant to software versions. Getting everything set up correctly can be quite a faff, but ~/.config and the like are then distribution dependent, which feels quite a bit safer.
I do second the /srv partition. Helps a ton.
(and I find flatpak and snap a horrible solution and tend to avoid them)
Dell laptops
So an unlabbelled (*) black button where the delete key should be is the on/off button.
*Every time you try to operate on of these weird black controls that are labelled in black on a black background, a little black light lights up black to let you know you've done it.
Backwards
Title
I Already Lived This Dream...
...on a Lenovo ThinkPad T14.
It took FOREVER to figure out how to disable BitLocker (they don't make it easy), Including a couple of recovery boots courtesy of my Microsoft 365 account.
But we made it in the end. Linux Mint Una just rocks.
There's a very good reason to wipe out Windows and isolate it in a VM; I tried dual booting once and for a time it worked, but when Windows screwed up as it inevitable does, it took out the bootloader and partition table with it. That was it. From then on, Linux is the only OS and a copy of Windows 10 is confined to a VM where it can be a flaky as always without taking down the real PC. There is only one network share on the host that the Windows VM can write to, which has several backups, and is not critical for the system's operation.
Windows booting on real hardware on my computers? Dream on MICROS~1 :P
Dual booting is still a pain in the A. I've spent more time fiddling around with dual boot problems than I did installing the other OS.
Pre-installed
We are going to assume that your laptop comes with Windows pre-installed, simply because most of them do
Er nope. I got one from [1]FrameWork so I could be sure it would work with linux and if anything were to go wrong with it I can fix it without too much hassle.
[1] https://frame.work
A few simple steps
1) Nuke Windows
2) Fix BIOS etc
3) Install Linux
4) Start working
Some of us have been doing that for years in order to remove the windows virus from our machines.
Ok, I have one copy of W10 somewhere. It is on an SSD that came with the last SFF server I bought. I swapped it out and that box now runs Amal Linux. I'll probably wipe that W10 drive one of these days. I'll never run it on any device I own.
"and having a fallback OS to hand can be handy in emergencies."
So either two Linuxes or a Linux and a BSD.
This article is a bit weird.
The issue being that you have a "non-approved" laptop running just Windows. Compared to an "approved" laptop running just Linux.
And yet the author does a lot of faffing in order to keep the Windows partition, when the "approved" laptop doesn't have the Windows partition in the first place?
Nah, just blast away the criminal spyware and whack Linux (or BSD) on it. This stuff really isn't so hard these days.
Old linux person here....do not understand......
Quote: "This means third-party OSes can't see the drive. While it is easy to change this in the BIOS, the snag is that Windows then will not boot."
Please explain "snag"......