• ChaoticNeutralCzech@feddit.de
    link
    fedilink
    English
    arrow-up
    2
    arrow-down
    1
    ·
    edit-2
    1 year ago

    You are right that there is a way to do this post-installation but I have been down this rabbit hole 4 times and all I can say is:

    Nope nope nope. This is actually more pain.

    Why? Shrinking the C: drive is difficult or damn near impossible when Windows is installed on it, which is why I always install Windows to a smaller partition (120 GiB as I don’t play modern games) and move user folders to D:, and then leave some space for E: or Linux.

    Disk Management will only let you shrink the disk by a very small amount. This is because Windows has a lot of “unmoveable files”. You need to disable recovery, virtual memory and hibernation to get a chance at shrinking that partition, and you may need to run all kinds of defrag commands. I did this on 4 PCs and the first 3 times, this was enough.

    In the 4th case, just this week, I became sick and got stuck at my grandma’s place far from home. I needed a Linux installation badly, but there was only a laptop with 40 out of 220 GiB free after cleanup, and just a single partition (with Windows preinstalled, of course). It did not want to budge and reported 0 MB shrinkable space. I tried every trick mentioned online before resorting to buying Aomei Partition Assistant. It queued the action of shrinking the drive by 20 GiB (alleged minimum for Mint) and estimated 18 minutes to complete the operation. It told me it cannot do that while Windows was running so it gave me the option to use WinPE or PreOS mode. WinPE did not work so I retried with PreOS. The computer booted into VGA text mode and this appeared on the screen:

        ============== AOMEI Partition Assistant PreOS Mode ==============
        
        The program is executing, please wait...
        Operation 1 of 1
            Resizing Partition
            
            Hard Disk:              1
            Drive Letter:           C:
            File System:            NTFS
            Partition Label:        OS
            Size:                   220.46GB => 200.45GB
    
        Total:0 %, Current:0 %
    

    This was on the screen for about an hour, and the PC was apparently under load with fans spinning. The program might be stuck but could how could I tell? I eventually forced the computer to shut down. I hadn’t made a backup because I did not have a large external drive (would have installed Linux on part of that, instead). Was my grandma’s only computer ruined? Would I be stuck for 2 weeks without a computer?

    Luckily, the PreOS program ultimately had no effect on the drive, and I managed to negotiate a refund from Aomei. Then I realized I could boot into Recovery Mode and try diskpart from Command Prompt there, which miraculously worked. Also pretty tense because it did not give any indication of progress, just threw control back to me when it finished. I was relieved when I successfully booted into Windows on that shrunk partition. Other than having to enter Windows Safe Mode to disable RAID storage in BIOS, the Linux installation went fine.


    So this is why you install Windows on a reasonably small partition or resize it before using a preinstalled copy. This is not useful just for Linux but when you want to upgrade to an SSD (as I did with my parents’ and the other grandparents’ computer), you only want the system partition there so you don’t need to buy a bigger drive; also wear leveling will work better if the drive is not close to full, and HDDs are easierbto recover if they fail. With separate OS and data partitions, you just use Clonezilla or something to clone the Windows (C:) partition to the SSD bit-by-bit, then disconnect the old drive and fix boot using a Windows recovery medium (necessary because of Microsoft’s shenanigans), make changes to the boot order and now you’re booting from an SSD with a fallback copy on the HDD!

    To be clear, I also prefer GUI utilities (except when automation is needed of course). But diskpart is pretty easy - it’s essentially a state machine with built-in help so it’s very noob-friendly for a CLI program. And you just saw that it can save hours of hassle.

    • Honytawk@lemmy.zip
      link
      fedilink
      English
      arrow-up
      1
      arrow-down
      1
      ·
      1 year ago

      Or you just don’t partition at all.

      Never had a problem with it in the last 15 years on Windows. You can usually fix the OS with some command lines. And if you can’t, you just reinstall and Windows will move all your files into a Windows.old folder.

      • ChaoticNeutralCzech@feddit.de
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        That’s not good use of space, storage is still expensive where I live (partly because of piracy tax). A simple copy to “Windows.old” will not save the bootloader so it won’t really work as a backup – it’s dead space now. Your OS partition (and the EFI one) must be copied bitwise if you need to back them up (but as you correctly mentioned, you probably don’t).

        It makes a lot of sense to separate installation and data, especially when the PC will get used by old people (who are more likely to screw up something badly) or power users. And making backups of data is as easy as robocopy D: F:\Backup /mir. Yes, I also have lots of experience using and managing Windows PCs in my family and work.