two or three tricks for installing Linux as a second OS on a Windows box

Most computers come with Microsoft Windows. If you insist on buying a computer without Windows, you have less choice and may have to pay more. Besides, once in a blue moon Windows is useful. To install Linux, you can either blow away Windows (easy!) or your can install Linux beside Windows. If you want to install Linux beside Windows, you usually have to get Windows to relinquish some disk space. (Alternatively you might be able to add another disk.) Windows has a way of reducing the size of a volume but it is unwilling to relocate a structure that is in the middle of the volume. So it is only willing to give up slightly less than half of the volume. I use gparted (ntfresize is underneath) to shrink a Windows NTFS volume, because I always want to shrink in to less than 50% of its original size. I do this from a live Linux flash drive. Here are the tricks that are not so obvious: - if Windows is using bitlocker, you need to turn that off in Windows. Otherwise gparted cannot do anything with the partition. Our newest computer came with bitlocker enabled (with no password). That's probably a good idea but not for us. After bitlocker is turned off, gparted can operate. Perhaps you can turn it on again after resizing. I don't know. (On Windows: Settings: Privacy & Security: Device Encryption) - By default, Windows assumes that it can leave the filesystem in an inconsistent state when it shuts down. It assumes that you'll boot Windows again when you power the system up. Apparently this speeds things up a little bit. This is very unhealthy if you are going to boot Linux next, especially if you are going to run gparted to muck with the NTFS filesystem. You can fix this by going to Windows' Control Panel (which is something different from Settings), Power Settings, and untick "turn on fast startup (recommended)". It is slightly tricky because you have to click some option to allow you to change the fast startup option. Sheesh. - (old advice; may be obsolete; I don't wish to find out the hard way that it is still needed.) After you have resized the NTFS partition, reboot to Windows. Don't do anything else with the disk in Linux first. Why: it used to be the case that gparted got something slightly wrong in the NTFS partition, something that a Windows boot fixed silently. After booting Windows, you can reboot to a Linux install medium safely.

https://github.com/tuxera/ntfs-3g/wiki/Manual ... as an Administrator the [Microsoft] Windows command which disables both hibernation and fast restarting : powercfg /h off If your MS system uses Bitlocker, you may want to verify that you can access the drive(s) using Linux... https://www.system-rescue.org/Detailed-packages-list/ dislocker 0.7.3-2 gparted 1.3.1-1 gptfdisk 1.0.8-1 https://superuser.com/questions/376533/how-to-access-a-bitlocker-encrypted-d... re: backing up partition tables... https://www.partimage.org/manual/Backing-up-the-partition-table/ http://www.rodsbooks.com/gdisk/mbr2gpt.html When presented with a new system, before running for the first time I back up the partition tables and disk, using above method and using clonezilla ( https://clonezilla.org/). https://clonezilla.org/screenshots/?in_path=/00_Clonezilla I then make a second backup using the proprietary built-in backup. https://www.howtogeek.com/howto/1838/using-backup-and-restore-in-windows-7/ https://www.howtogeek.com/356063/how-to-fully-restore-macos-from-a-time-mach... If using MS, you may want to grab the latest ISO images... https://www.microsoft.com/en-us/software-download/windows10ISO https://github.com/WoeUSB/WoeUSB "A MS Windows USB installation media preparer for GNU+Linux" I go into a little more detail at my blog https://youcanlinux.wordpress.com/2022/03/05/backup/ regards, Daniel Villarreal On Fri, Mar 4, 2022 at 4:27 PM D. Hugh Redelmeier via talk <talk@gtalug.org> wrote:
... If you want to install Linux beside Windows, [free] some disk space. ([and/or]... add another disk.) ... I use gparted ... to shrink a Windows NTFS volume...
Here are the tricks ...
- if Windows is using bitlocker, you need to turn that off in Windows.
.... - ... Windows ... leave[s] the filesystem in an inconsistent state when it shuts down.... ... Windows' Control Panel ... Power Settings, and untick "turn on fast startup ...
- (old advice; may be obsolete... After resizing ... , reboot to [MS]. Don't do anything else with the disk in Linux first... After booting [MS], you can reboot to a Linux install medium safely.

I used to dual-boot, but now I use separate Linux computer. If I need to copy files, I use ssh/scp in WSL Ubuntu. Samba is proper answer, but can't be bothered. Less headache, and I'm not getting younger. --William On 3/4/22 11:27 AM, D. Hugh Redelmeier via talk wrote:
Most computers come with Microsoft Windows. If you insist on buying a computer without Windows, you have less choice and may have to pay more. Besides, once in a blue moon Windows is useful.
To install Linux, you can either blow away Windows (easy!) or your can install Linux beside Windows.
If you want to install Linux beside Windows, you usually have to get Windows to relinquish some disk space. (Alternatively you might be able to add another disk.)
Windows has a way of reducing the size of a volume but it is unwilling to relocate a structure that is in the middle of the volume. So it is only willing to give up slightly less than half of the volume.
I use gparted (ntfresize is underneath) to shrink a Windows NTFS volume, because I always want to shrink in to less than 50% of its original size. I do this from a live Linux flash drive.
Here are the tricks that are not so obvious:
- if Windows is using bitlocker, you need to turn that off in Windows. Otherwise gparted cannot do anything with the partition.
Our newest computer came with bitlocker enabled (with no password). That's probably a good idea but not for us.
After bitlocker is turned off, gparted can operate.
Perhaps you can turn it on again after resizing. I don't know.
(On Windows: Settings: Privacy & Security: Device Encryption)
- By default, Windows assumes that it can leave the filesystem in an inconsistent state when it shuts down. It assumes that you'll boot Windows again when you power the system up. Apparently this speeds things up a little bit.
This is very unhealthy if you are going to boot Linux next, especially if you are going to run gparted to muck with the NTFS filesystem.
You can fix this by going to Windows' Control Panel (which is something different from Settings), Power Settings, and untick "turn on fast startup (recommended)". It is slightly tricky because you have to click some option to allow you to change the fast startup option. Sheesh.
- (old advice; may be obsolete; I don't wish to find out the hard way that it is still needed.) After you have resized the NTFS partition, reboot to Windows. Don't do anything else with the disk in Linux first. Why: it used to be the case that gparted got something slightly wrong in the NTFS partition, something that a Windows boot fixed silently. After booting Windows, you can reboot to a Linux install medium safely. --- Post to this mailing list talk@gtalug.org Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk

On 2022-03-07 07:39, William Park via talk wrote:
I used to dual-boot, but now I use separate Linux computer. If I need to copy files, I use ssh/scp in WSL Ubuntu.
For those times when you need to copy files and you are on the Windows machine you could use WinSCP. -- Cheers! Kevin. http://www.ve3syb.ca/ | "Nerds make the shiny things that https://www.patreon.com/KevinCozens | distract the mouth-breathers, and | that's why we're powerful" Owner of Elecraft K2 #2172 | #include <disclaimer/favourite> | --Chris Hardwick

On Mon, Mar 07, 2022 at 11:28:15AM -0500, Kevin Cozens via talk wrote:
On 2022-03-07 07:39, William Park via talk wrote:
I used to dual-boot, but now I use separate Linux computer. If I need to copy files, I use ssh/scp in WSL Ubuntu.
For those times when you need to copy files and you are on the Windows machine you could use WinSCP.
But you want a bash shell on windows anyhow, so WSL makes the perfect CLI on windows. I even have samba setup, and never use it, I just scp. winscp is a nice tool, but it's no match for a linux shell. -- Len Sorensen

| From: Lennart Sorensen via talk <talk@gtalug.org> | But you want a bash shell on windows anyhow, so WSL makes the perfect | CLI on windows. | | I even have samba setup, and never use it, I just scp. | | winscp is a nice tool, but it's no match for a linux shell. Without checking, I would guess that WinSCP is a few megabytes of disk space but WSL is a few gigabytes. I think that for the few times I use it, scp on PowerShell is OK, saving disk space over WSL. I do use WinSCP too. (In the last couple of years I've even started to use the Gnome Files program fairly regularly!) For me the disk space for WSL effectively comes from Linux because I don't generally have a Windows-only computer and I try to give most of the space to Linux. I haven't really found WSL very useful. I understand that others do find it useful.

On Tue, Mar 08, 2022 at 09:53:14AM -0500, D. Hugh Redelmeier via talk wrote:
Without checking, I would guess that WinSCP is a few megabytes of disk space but WSL is a few gigabytes.
I think that for the few times I use it, scp on PowerShell is OK, saving disk space over WSL.
I do use WinSCP too. (In the last couple of years I've even started to use the Gnome Files program fairly regularly!)
For me the disk space for WSL effectively comes from Linux because I don't generally have a Windows-only computer and I try to give most of the space to Linux. I haven't really found WSL very useful. I understand that others do find it useful.
WSL is useful enough that my laptop no longer has a linux install. I have dedicated linux machines in the house, but for my laptop windows with WSL works just fine and avoids the hassle of dealing with the linux drivers when it comes to suspend and the dual intel/nvidia video chip setup and such. And I can play my games. So since what I do is run a web browser, play some games, and run a bash shell to do whatever command line stuff I need, it just seems to work better. I find graphical programs hugely annoying for file management compared to a CLI, so gnome has nothing useful to offer me, and winscp is just too much trouble with all that clicking. powershell's syntax is just too weird and verbose for me to bother looking at. -- Len Sorensen

I have no experience with WSL but I've been reading up on it as I think my main computer should probably be less than ten years old. With Windows 11 it sounds like WSL now has a full kernel. So I guess that would take disk space, but it sounds like a pretty complete implementation. On my existing computer, I am using less than a third of the original disk space. Since new machines always have moar, I suspect I can live with WSL gobbling up its footprint. I agree that PowerShell is wrong. And I use both GUI and CLI for file management - I'm not sure if I'm a Luddite or not. Is there anything else, in particular, we should be cautious about with Windows 11 and WSL? <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Virus-free. www.avg.com <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> On Wed, Mar 9, 2022 at 8:42 AM Lennart Sorensen via talk <talk@gtalug.org> wrote:
On Tue, Mar 08, 2022 at 09:53:14AM -0500, D. Hugh Redelmeier via talk wrote:
Without checking, I would guess that WinSCP is a few megabytes of disk space but WSL is a few gigabytes.
I think that for the few times I use it, scp on PowerShell is OK, saving disk space over WSL.
I do use WinSCP too. (In the last couple of years I've even started to use the Gnome Files program fairly regularly!)
For me the disk space for WSL effectively comes from Linux because I don't generally have a Windows-only computer and I try to give most of the space to Linux. I haven't really found WSL very useful. I understand that others do find it useful.
WSL is useful enough that my laptop no longer has a linux install. I have dedicated linux machines in the house, but for my laptop windows with WSL works just fine and avoids the hassle of dealing with the linux drivers when it comes to suspend and the dual intel/nvidia video chip setup and such. And I can play my games. So since what I do is run a web browser, play some games, and run a bash shell to do whatever command line stuff I need, it just seems to work better.
I find graphical programs hugely annoying for file management compared to a CLI, so gnome has nothing useful to offer me, and winscp is just too much trouble with all that clicking.
powershell's syntax is just too weird and verbose for me to bother looking at.
-- Len Sorensen --- Post to this mailing list talk@gtalug.org Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk

On Wed, Mar 09, 2022 at 09:57:09AM -0500, Warren McPherson wrote:
I have no experience with WSL but I've been reading up on it as I think my main computer should probably be less than ten years old. With Windows 11 it sounds like WSL now has a full kernel. So I guess that would take disk space, but it sounds like a pretty complete implementation. On my existing computer, I am using less than a third of the original disk space. Since new machines always have moar, I suspect I can live with WSL gobbling up its footprint.
I agree that PowerShell is wrong. And I use both GUI and CLI for file management - I'm not sure if I'm a Luddite or not.
Is there anything else, in particular, we should be cautious about with Windows 11 and WSL?
Well both windows 10 and 11 have WSL1 and WSL2. WSL1 (the only one I have ever used myself) emulates a linux kernel to handle system calls, and uses the windows network stack. WSL2 runs a full linux kernel with it's own network stack (so it has to get it's own IP address as far as I understand it, although reading about it seems to indicate it uses NAT by default, but the IP address is not the same as the windows host, unlike WSL1) but does mean you can do things like run docker and other things that require a proper linux kernel, and avoids some of the bugs that have hit the emulated kernel (basicly things that they hadn't implemented fully yet in some cases). WSL1 has really really slow disk IO, while WSL2 is supposed to run perfectly normal speed. Doing a git checkout on WSL1 can be painful. :) WSL1 makes it easy to access the windows filesystem from linux, not sure how that works in WSL2. WSL1 has much faster windows file access than WSL2. Also WSL1 can launch windows executables from linux, which WSL2 can not as far as I know. WSL2 can apparently cause some memory issues for now (they are working on it apparently) in that the page cache memory is not returned to windows until WSL2 is shut down, so they say that a long session can lead to a lot of memory being tied up. WSL2 is supposed to support X11 and wayland apps if you are running windows 11 build 22000 or higher. WSL1 does not, although you can use a windows X server to do it (I use one called X410). I should give WSL2 a try at some point. -- Len Sorensen

Another option for some is the Windows Subsystem for Linux <https://docs.microsoft.com/en-us/windows/wsl/> which I demo'd at an earlier GTALUG meeting. No boot issues, fewer graphics and PulseAudio problems, and it works fairly well for the light loads I have given it. Evan Leibovitch, Toronto Canada @evanleibovitch / @el56 On Fri, Mar 4, 2022 at 11:27 AM D. Hugh Redelmeier via talk <talk@gtalug.org> wrote:
Most computers come with Microsoft Windows. If you insist on buying a computer without Windows, you have less choice and may have to pay more. Besides, once in a blue moon Windows is useful.
To install Linux, you can either blow away Windows (easy!) or your can install Linux beside Windows.
If you want to install Linux beside Windows, you usually have to get Windows to relinquish some disk space. (Alternatively you might be able to add another disk.)
Windows has a way of reducing the size of a volume but it is unwilling to relocate a structure that is in the middle of the volume. So it is only willing to give up slightly less than half of the volume.
I use gparted (ntfresize is underneath) to shrink a Windows NTFS volume, because I always want to shrink in to less than 50% of its original size. I do this from a live Linux flash drive.
Here are the tricks that are not so obvious:
- if Windows is using bitlocker, you need to turn that off in Windows. Otherwise gparted cannot do anything with the partition.
Our newest computer came with bitlocker enabled (with no password). That's probably a good idea but not for us.
After bitlocker is turned off, gparted can operate.
Perhaps you can turn it on again after resizing. I don't know.
(On Windows: Settings: Privacy & Security: Device Encryption)
- By default, Windows assumes that it can leave the filesystem in an inconsistent state when it shuts down. It assumes that you'll boot Windows again when you power the system up. Apparently this speeds things up a little bit.
This is very unhealthy if you are going to boot Linux next, especially if you are going to run gparted to muck with the NTFS filesystem.
You can fix this by going to Windows' Control Panel (which is something different from Settings), Power Settings, and untick "turn on fast startup (recommended)". It is slightly tricky because you have to click some option to allow you to change the fast startup option. Sheesh.
- (old advice; may be obsolete; I don't wish to find out the hard way that it is still needed.) After you have resized the NTFS partition, reboot to Windows. Don't do anything else with the disk in Linux first. Why: it used to be the case that gparted got something slightly wrong in the NTFS partition, something that a Windows boot fixed silently. After booting Windows, you can reboot to a Linux install medium safely. --- Post to this mailing list talk@gtalug.org Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk
participants (7)
-
D. Hugh Redelmeier
-
Daniel Villarreal
-
Evan Leibovitch
-
Kevin Cozens
-
Lennart Sorensen
-
Warren McPherson
-
William Park