After nine months of not having booted my Windows even once, I think it’s time to wipe the Windows related partitions once and for all and claim the space. The problem is I think the way my partitions are structured, it may not be that easy. I am assuming everything other than the two ext4 partitions will have to go. What do you think? r/linux4noobs -

Someone even suggested I nuked the whole thing and started again, which would be the absolute last resort and only when I ran out of space.

  • IsoKiero@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    5
    ·
    24 hours ago

    Well, moving partitions is at least a bit tricky and somewhat unreliable. So, unless you do a full repartitioning you will have sda1 with 520GB(ish). Current /home partition you can extend to fill the ~550MB from end of the drive.

    Then it’s up to you what you want to do with that 520GB. One option would be to build LVM (or zfs if you wish, LVM likely makes more sense on your case) setup from that and current /home partition and that way you could have ~850GB logical partition for home. Or you can just format the new sda1 as ext4 and mount it to /home/youruser/Media or whatever and have your home directory data split to two different partitions.

    But whatever you decide, when messing around with partitions make absolutely sure that your backups are in good shape. One small error somewhere and your data might be gone, or at very least you need to learn how to rebuild partition tables. Also when changing partitions check that your fstab uses UUIDs instead of device paths or your system may not boot cleanly. Broken fstab is fairly simple to fix, but it’s easier to check that while the system is up and running.

    • Stopwatch1986@lemmy.mlOP
      link
      fedilink
      arrow-up
      1
      ·
      22 hours ago

      I’d rather have a single large /home partition, and the LVM method sounds less risky if I find out how to do it safely. I am sure I read somewhere that LVM is the clean way to manage partitions.

      I see my fstab says the following, so it’s UUIDs although I am not sure about that /swapfile:

      # / was on /dev/sda6 during installation
      UUID=9178d5fa-87a7-4e65-ba88-726f41c84186   /                        ext4   errors=remount-ro   0 1 
      # /boot/efi was on /dev/sda5 during installation
      UUID=0B9E-D68E                              /boot/efi                vfat   umask=0077          0 1 
      # /home was on /dev/sda8 during installation
      UUID=0a3aa38a-1673-4064-b573-9a090be7f3cb   /home                    ext4   defaults            0 2 
      # swap was on /dev/sda7 during installation
      # UUID=ca915564-2474-4399-ae6c-b4d9b73e69d1 none            swap    sw              0       0
      #
      # added swapfile
      /swapfile                                   none                     swap   sw                  0 0 
      /dev/sdb1                                   /media/myuser/backintime   ext4   nofail              0 0 
      
      • IsoKiero@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        2
        ·
        edit-2
        12 hours ago

        Swapfile refers to a file at /. As long as you have rootfs there’s a place to put that swap file too, so no worries there. Usually there’s a separate partition for swap, but that works too.

        So, what you need to do is remove sda1 and sda2 windows partitions. That’ll leave you ~520GB of unallocated space at the start of the drive. Create a partition there and set it to ‘Linux LVM’ -type. Then create LVM ‘filesystem’ on that partition, or more accurately, assign that partition as an LVM physical volume with ‘pvcreate’. After that you need to create a volume group with ‘vgcreate’. Now you’ll have 520GB allocated to LVM. Create new partition for your home with ‘lvcreate’, use all the space if you like, but at least as big as your current consumption on /home. Then create an filesystem on it and mount it as /mnt/newhome (or whatever).

        Log out with your main user and make sure there’s no processes running on that user afterwards. Then you can copy data from current home to newhome and unmount the now old home (sda8). Change fstab so that your new home will be mounted on /home (blkid to get UUID and change that to fstab). Mount new home in it’s proper place, old home partition will be unmounted at this stage. Verify that everything works.

        Now you can change your current sda8, a.k.a. old home, to Linux LVM-type, assign that as LVM physical volume and extend your volume group with vgextend to include the another partition. And now with lvextend you can expand your brand new home directory to that ~850GB total.

        But, as I mentioned, make sure that you have your backups in good shape. These steps, if done incorrectly, will destroy your data. That’s also why I’m being somewhat vague on the instructions, you’ll need to understand what you’re doing. There’s plenty of information to push you in the right direction, but trust me, it’s better for you to take a minute or two and read documentation so that you’re actually confident on the steps.

        • Remus86@lemmy.zip
          link
          fedilink
          arrow-up
          2
          ·
          20 hours ago

          I don’t know if LVM acts the same as btrfs, but in order for my root snapshots to work, I couldn’t have the swapfile directly in /. It has to be made in /swap/swapfile to work. Just something to be aware of.

        • Stopwatch1986@lemmy.mlOP
          link
          fedilink
          arrow-up
          1
          ·
          20 hours ago

          It will take some reading but this sounds like a good long-term solution. Perhaps LVM should be the default. And there should be a live USB GUI method that would make the process less scary and safer. Thanks.

          • IsoKiero@sopuli.xyz
            link
            fedilink
            English
            arrow-up
            1
            ·
            12 hours ago

            Oops. I had a wrong command there at the start on text, vgcreate is for creating volume group, not lvcreate. I edited it. That would just be a syntax error of sorts, nothing would happen with a wrong command.

            USB GUI method is called ‘installer’ ;) Messing around with partitions is inherently a dangerous thing to do, no matter if you use a GUI or CLI. Today tools like fdisk or parted are pretty good at protecting yourself from yourself, but it’s still just one wrong command and your partition table is broken which will be a pain in the rear to fix.

            About the default setting, there’s plenty of reasons to not choose LVM, even if it is pretty neat. For example if you have a smaller drive on a laptop it usually doesn’t add much to even have multiple partitions at all. And also LVM has a small overhead compared to ‘raw’ partitions, so if you need to squeeze the last drop of disk-io out of the system LVM might not be the right choise. Or you might prefer zfs or brtfs. All solutions have their own pros and cons.