Announcement

Collapse
No announcement yet.

Kubuntu 21.10 - getting rid of unused partitions

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Kubuntu 21.10 - getting rid of unused partitions

    Hi everyone. New user to Kubuntu 21.10, just getting everything set up for my switch from windoze to linux. Wasn't sure which subforum to put this in. Mods, please either move this topic to the right place, or let me know. Thanks.

    Originally I was on Win10 64x, then tried switching to elementary OS by just shrinking the C: partition and adding whatever partitions elementary needed. I then installed Kubuntu, and it just took part of my C: drive, too. What I want to do is delete every partition that's not being used by Kubuntu and recover the space to my home directory. Don't forget that means I need to delete the old elementary OS partitions I created before giving up on that one before switching to Kubuntu, as well as recovering some unallocated space.

    My main concern is getting it to boot properly after making the changes. Right now, root is on /dev/sda4, but if I delete the Windows 10 partitions, won't that make my root on /dev/sda2? By doing that, won't that confuse the OS, or at least GRUB? Is it safe to delete the extra partitions, or should I just format them and shrink them all down to like 10MB each?

    I'm currently using KDE Partition Manager 21.08.1. Following is a shot of my current setup.

    Thanks for your help in this matter. On a side note, I'll be looking at backup solutions next, and expect to have questions. Should I post them here in Software as long as it's not related to a specific app?

    Click image for larger version

Name:	dxTPi27.jpg
Views:	243
Size:	61.1 KB
ID:	657821



    #2
    Dolphin shows me a file on root called swapfile that is 2 GB in size. I'm guessing that Kubuntu doesn't use a swap partition at all, and it's safe to delete (or format and shrink) everything except sda4 and sda8.

    Related question: is it safe to format or delete sda1 since that's likely where the boot info is stored? I really want to streamline and secure my system and keep it for the long term, but I'm new. Dangit.

    Comment


      #3
      Kubuntu uses a small Swapfile if you don't create a Swap partition during install.

      After I bought my machine I deleted all the Windows system and recovery partitions and used a Live Linux Mint USB stick (Gnome Partition Editor) to merge them into my Linux partitions.

      If you feel your swap is too small you can enlarge it. I used this guide to delete and create a larger file:

      https://www.linuxuprising.com/2018/0...d-of-swap.html
      Constant change is here to stay!

      Comment


        #4
        Originally posted by Beerislife View Post
        ...
        If you feel your swap is too small you can enlarge it. I used this guide to delete and create a larger file:

        https://www.linuxuprising.com/2018/0...d-of-swap.html
        Wow cool, thanks! I changed my swapfile from 2 to 8 GB. That'll probably help me out a lot, as I just installed GIMP.

        Comment


          #5
          Originally posted by unknowable View Post
          if I delete the Windows 10 partitions, won't that make my root on /dev/sda2
          By doing that, won't that confuse the OS, or at least GRUB?
          No, not a problem. By default Linux and grub use UUIDs (universally unique ids) to find partitions. To check what they are you can run (in a console)
          Code:
          sudo blkid
          If you want to see the gory details, you could look in /etc/fstab, or /boot/grub.cfg (very gory). /dev/sda1, the ntfs "Recovery" partition, can be used to boot if you want to reset the computer by reinstalling Windows.
          Is it safe to delete the extra partitions...
          Yes, just don't delete the "EFI System Partition". You may be tempted to shuffle them around, for example to get the space used by sda1, and that can be slightly tricky, I would suggest good backups; for example, a power outage in the middle of moving a partition might leave a mess.

          I wonder what the 200 GiB fat32 partition is for. Maybe you used that to access data easily from both Kubuntu and Windows. Fat32 is much more easily borked than modern journalling file systems, so it's not ideal if you don't need the access from Windows.

          If you're not familiar with swap partitions, and your computer has plenty of memory, say 8 GB, I suggest you don't need one. I'm told these days Linux automatically uses a swap file if it really has to.

          The easiest and perhaps the quickest way would be to wipe everything and reinstall Kubuntu. Kubuntu can be installed in 10 or 20 minutes or so, and you could easily spend that long shuffling partitions around. But you'd have to set everything up again; it took me over a month last time I did that, not quick at all.
          Regards, John Little

          Comment


            #6
            Originally posted by jlittle View Post
            No, not a problem. By default Linux and grub use UUIDs (universally unique ids) to find partitions.

            If you want to see the gory details, you could look in /etc/fstab, or /boot/grub.cfg (very gory). /dev/sda1, the ntfs "Recovery" partition, can be used to boot if you want to reset the computer by reinstalling Windows.

            Yes, just don't delete the "EFI System Partition". You may be tempted to shuffle them around, for example to get the space used by sda1, and that can be slightly tricky, I would suggest good backups; for example, a power outage in the middle of moving a partition might leave a mess.
            Wow, that's great news! I don't have to worry about partition labels. So you're saying I can completely remove everything except sda2 and sda8, right? I don't even have to do anything, just delete the partitions and expand the remaining partitions' sizes, right? With the EFI partiton only taking up less than a hundred MB, that means I should be able to set sda8 to the remaining portion of the drive, right? So I can just give all the reclaimed space to /dev/sda8 and I'll have almost the entire drive for everything I want to install, yes?

            I guess in a worst case scenario, some of that data might be on parts of the drive that would keep me from reclaiming it all at once. I might have to reclaim, reboot, defrag, then resize the partition. Might take some time, but it would definitely be easier than reinstalling Kubuntu. I've been at it day and night for several days trying to get my only system running right.


            Originally posted by jlittle View Post
            I wonder what the 200 GiB fat32 partition is for. Maybe you used that to access data easily from both Kubuntu and Windows. Fat32 is much more easily borked than modern journalling file systems, so it's not ideal if you don't need the access from Windows.
            Oh man, I have no idea. Other than the OS's I mentioned, I've been thru like 4 or 5 different operating systems by installing to a thumb drive, booting to test the system, then finding that it wouldn't work for me. I could mount that 200 GB partition and find out, but I know it's not part of this linux install and that's the only thing that matters to me. I don't care what it *was*, I just want the space back.

            Originally posted by jlittle View Post
            If you're not familiar with swap partitions, and your computer has plenty of memory, say 8 GB, I suggest you don't need one. I'm told these days Linux automatically uses a swap file if it really has to.

            The easiest and perhaps the quickest way would be to wipe everything and reinstall Kubuntu. Kubuntu can be installed in 10 or 20 minutes or so, and you could easily spend that long shuffling partitions around. But you'd have to set everything up again; it took me over a month last time I did that, not quick at all.
            Yah, earlier Beerislife advised me on resizing the swap file that Kubuntu uses by default. It was apparently set to only 2 GB, but I like more since I do video and graphic editing, and keep several apps open at once pretty much all the time.

            I am *definitely* not reinstalling. Like I said, I've been through half a dozen OS's in the last week, and this one I've spent quite a bit of time learning how to configure this one for my needs. Thanks for the tip though.

            Oh, and I'm very sorry for simply repeating back to you what you just said in the form of a question. I was listening, I did read all of it clearly, it's just that I'm brand new and I'm making some serious system changes. I just want to be sure that I'm doing every step perfectly, since my linux partitions are not backed up. Your patience is greatly appreciated. Thank you for your help and understanding.


            EDIT
            ________________________________________

            You were pretty clear in your statements, so I went ahead and did it. I just deleted all the extra partitions, and I'll reboot in just a sec. Thanks again.
            Last edited by unknowable; Nov 05, 2021, 02:14 AM.

            Comment


              #7
              Ok, it rebooted! They're still labelled as sda2 and sda8, but now I have over 700 GB free. The thing is, for some reason I can't merge the space into the existing partitions, either one of them. I tried in KDE Partition Manager, GParted, and Disks. I notice though, that the entire linux filesystem is not even taking up 60 GB. Does that mean I can just backup the partitions, wipe the drive, then recover the partitions and gain all that space?

              Thanks for you help, jlittle. You're a lifesaver.

              Comment


                #8
                Firstly, for video editing a swap partition would be recommended, I'd suggest the size of your RAM. If you run out of swap with that, a couple of years ago I would have said time to get more RAM, but with chip shortages and high prices... I wonder how well video editing works with a lot of swap on an NVMe.

                Secondly, I don't think you can move the partition the OS is running from. A way around that is to boot from a live USB. You likely have a Kubuntu install USB, and that will do. Boot from it and choose something like "try Kubuntu", then the partition manager should be able to move/resize things.

                All this partition stuff is a drag. Rather than partitions, I use btrfs subvolumes, and usually only bother with partitions on old drives. I have several Linux installs in the same btrfs, on a smallish but fast SSD. Even that's starting to look like an old approach, more up to date is to have one big host with lots of virtual machines.
                Regards, John Little

                Comment


                  #9
                  Originally posted by jlittle View Post
                  Firstly, for video editing a swap partition would be recommended, I'd suggest the size of your RAM. If you run out of swap with that, a couple of years ago I would have said time to get more RAM, but with chip shortages and high prices... I wonder how well video editing works with a lot of swap on an NVMe.
                  Yah, I doubt I'll have any issues. I only do a very little light editing and play a bunch of old emulator games like MAME and PCSXR. My old Win10 system was only 4 GB RAM, but this new one is 8 GB, and I set an 8GB swapfile. Should be fine for what little stuff I mess with.

                  Originally posted by jlittle View Post
                  Secondly, I don't think you can move the partition the OS is running from. A way around that is to boot from a live USB. You likely have a Kubuntu install USB, and that will do. Boot from it and choose something like "try Kubuntu", then the partition manager should be able to move/resize things.
                  ...
                  Oh. Dangit. I've been spending all this time trying to setup a drive imaging app on my hard drive and getting ready to move stuff around to allow for this. I already have a Kubuntu USB thumb drive set up from installing the OS the other day. I can just boot off of that, and I'll be done in a few minutes. Cool, well thanks again. I'll report back here when I get this issue resolved.

                  Comment


                    #10
                    Alright! It took all day to move the partitions around since I had unallocated space both before and after both the root and boot partitions, but now I have a 100MB boot partition and a ~930GB root partition. Now I'm going to copy all of my media files off of the 2TB external drive, delete my old backup from said drive, then image what I have currently installed back to the same drive. Then I'll have all of my media both free on the 2TB drive, compressed in a backup on the same drive, and also loaded directly onto my internal drive. Then I can delete one copy, have one local and one backed up.

                    I guess it really doesn't matter if the imaging program destroys the destination drive on the first backup. I'll already have it locally. I guess now I just need to copy the data over and find a good backup program. I guess now something like Clonezilla would be an acceptable choice. You have any recommendations? I guess now my needs have changed a little, and I'm easier going on what I need. I still want an app that will do scheduled, encrypted, incremental backups to my 2TB USB drive. It still needs to keep the destination drive cleaned up for me by deleting old backups. I guess that's it.

                    Comment


                      #11
                      Can I, for a one time use without scheduling, just backup the /boot/efi/ and root directories using KDE Partition Manager? It would certainly be simple to find a solution that just involves dif-copying those two partitions on a regular basis to an external drive.

                      On a side note, I checked into NAS as you suggested, jlittle. I really want to stick with a local solution simply because I may not have internet access in an emergency situation like a hard drive failure. Just to be really careful, I want on-site backups for now. If there's a catastrophe that causes both my hard drives to fail at the same time (like a house fire,) I'll probably have more important things to worry about than just my data. I'll look more into NAS in the future someday I'm sure, but for now I want everything local. Sorry, but thanks for the suggestion.

                      That leaves me with a couple of thumb drives, a 1TB drive, and a 2TB drive. It only seems sensible to me to use the 1TB drive for everyday use and the 2TB drive for backup. If anyone has a better idea, please let me know. Thank you again for your attention and assistance. I'm learning a whole dang lot, and it's because of you and people just like you. Thank you.

                      EDIT
                      _____________________________________________

                      Obviously I would have to reboot to do that. Any Kubuntu iso will be both bootable to trial mode as well as having KPM installed and ready to use. If I can just copy the partitions, it would be easiest to do it that way, at least for a one time solution. No compression, no filesystem checks, no encryption, but for a one time use, acceptable.

                      _____________________________________________

                      END EDIT
                      Last edited by unknowable; Nov 05, 2021, 06:28 PM.

                      Comment


                        #12
                        Originally posted by unknowable View Post
                        ...If there's a catastrophe that causes both my hard drives to fail at the same time (like a house fire,) I'll probably have more important things to worry about than just my data. I'll look more into NAS in the future someday I'm sure, but for now I want everything local.
                        I worked with someone who worked for years on his own side project. Then his flat got ripped off, taking his computer and the backup media sitting next to it.

                        Regards, John Little

                        Comment

                        Working...
                        X