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.
Use a surface cleaner first. You wanna get the majority of the crud broken up and off first, wiping towards the middle then go get the whole thing with a glass cleaner using a microfiber cloth if you don’t have a squeegee.
- Write down GUID for sda6
- copy sda5 contents somewhere
- dd sda6 to sda2
- delete sda6
- change the GUID for sda2 to the one written down
- fsck sda6 to fix size
- make sda1’s type EFI
- copy sda5 contents to sda1
- delete sda5
- you can now resize whatever is left (if your partition tool doesn’t have resize, just delete and recreate with the same starting sector, again you have to keep GUID for root and fsck it to fix size)
deleted by creator
mb, updated
Very ingenious approach too!
Kinda already covered by others here, but my summary:
You won’t have partitions nicely numbered from 1~3 unless you start again.
1 - Backup
2 - Check the backup
3 - Boot from GParted Live (feel free to use another live distro with gparted on)
4- Delete sda1, sda2, sda3 & sda4
5- Move sda5 to the beginning of the drive and resize down to 512MB
6- Slide sda6 & sda7 down next to sda5. I like to have 1MB gap between all partitions to deal with future issues (sometimes restoring a partition might nip the next one)
7- resize /home to fill the rest of the drive
8- redo another backup
If you wanted, you can apply each of those steps and then reboot to check it’s all working, then you’ll gain confidence in what’s happening for the future.
I also advise doing a health scan of your drive to check it’s SMART parameters. Something like smartmontools (with gsmartcontrol if you like a GUI). Then you’ll know if the drive’s going to die during all that data moving…
Step two-and-a-half is to install Ventoy on a usb stick once and then you can simply copy over any iso files you’ll every need and get a neat boot menu (plus persistent storage position) from Ventoy. Like a scroll wheel on a mouse, there is no going back after having tried it.
Yeah, I don’t disagree, I just wanted to keep it focused on their partitions.
Personally, I have everything I need on a persistent bootable Arch stick - that basically has everything to fix & rebuild any device I’m working on.
I would simply delete sda1 and sda2, then that whole part will be available as 1. Format as ext4.
If you play games with steam you could then use it as a space to put games. Steam handles it for you. When you add a disk via Steam settings, it will be listed as an option.
Moving partitions is a tedious task and doesn’t always pan out, I personally wouldn’t risk it. Let it be a thing to do if you would ever reinstall completely for whatever reason and start fresh then.
Also, backup backup backup.
I am assuming everything other than the two ext4 partitions will have to go.
Your /dev/sda5 the FAT32 mounted at /boot/efi has to stay too! That’s your EFI System Partition, it’s essential for the boot chain.
What you can do is delete the “Microsoft” directory that’s on there, but definitely keep the one named after your distribution!
Everything with a lock means it’s mounted and in use. sda1, sda2, sda3 and sda4 should be safe to format, however as others have mentioned, booting into a live environment is the best course of action as it lets you freely move or extend partitions.
I suggest finding a thumb drive and flashing Gparted onto it.
Personally I’d just boot into a live environment so the SSD isn’t in use, backup important things, then wipe windows partitions and resize /home to use the rest of the space on the disk
How would you resize
/homeupwards with/boot/efistanding in the middle?You can freely move partitions/free space when the partition is unmounted. That’s why the last guy recommended a live disk, so that all your partitions would be unmounted.
It is worth noting you can only move partitions into a empty space larger enough for the full partition. Its a copy/delete process not a shift process.
In this case it should work. Delete first two windows partitions. Then move the Linux boot to first part. Then move the root partition Then move the home partition Then finally expand the home partition to the rest of the disk.
You will probably need to fix grub and do an initfs(?) Since the order of partitions have changed.
Careful with wiping anything with the “boot” flag. That can backfire very badly depending on how your system is set up. Those are small anyways so i would just leave them and only kill the ntfs partitions and combine that space into an extra partition that you can store stuff in.
Resizing partitions is messy so if you want a clean setup with one big home partition i would just reinstall. You could also copy everything in the home partition to a backup drive and just try out resizing. If it breaks you can create a new home partition and copy everything back.
I have been wondering about this. People recommend backing up
/homeand then reinstalling very casually, eg many recommend a new install when the new Debian stable is released every two years. My personal files and most of my user setup are stored in/homebut wouldn’t many customisations be stored in/? I have been tweaking things for nearly a year to get everything working. I wouldn’t want to spend ages to reinstall applications (flatpaks and all) and re-create my working setup. People being so relaxed about nuking their setup tells me I may be missing something here.your customizations should usually go in /etc and /usr/local so you could back those up. your distro ought to have a guide on backing up your package selection. but yeah i don’t enjoy wiping everything and starting over
ah, OK it’s not just me then. I find the prospect of having to reinstall Debian on my main work machine every two years is scary. I’d rather have the messy partitioning for the rest of my life :)
if it helps i’ve been using the same install of gentoo since 2007. the hard drives, cpu, ram, init system, and everything else changed but it’s still that same install. or is it? vsauce music
Very reassuring. The Ship of Theseus approach has been working for me for decades.
Honestly, those who reinstall constantly feel like people that don’t take care of their stuff as they should. There’s no need to reinstall.
I’ve been thinking of reinstalling my endeavourOS install to arch just because at the point I’m at, it’s basically arch, but the system print shows endeavour, and low key pisses me off. It’s such an incredibly stupid reason to reinstall, I want everything just like I have it currently, but changing the files so they think the system is arch sounds… Something I definitely shouldn’t do. Dammit.
Honestly, those who reinstall constantly feel like people that don’t take care of their stuff as they should. There’s no need to reinstall.
I’d take that with a pinch of salt. Over years, systems can get quite crufty and by my own experience, things like GNOME can break from upgrades even under Debian. A reinstall can tidy things up.
The easiest solution is to format windows partition and mount it as separate mount point (for example /mnt/extra) and use it for storing any large files you have (movies, songs, books, photos, backups, downloaded files …)
Before you do anything, backup /home.
You can reinstall your system while preserving and expanding your /home partition; this is probably the cleanest and safest way to sort your disk. It allows you to move the boot and filesystem partitions to the start of the disk while keeping /home untouched, and then separately resize /home to fill the rest of the drive. You could not reinstall and manually move the partition but it’s slow and riskier when messing with a boot and main filesystem partition; much easier to start again tbh.
I’d get a USB and install Ventoy on it. Ventoy is a great bootable USB tool that lets you drop multiple different bootable ISOs on it (instead of reflashing the drive every time) & pick one at boot; great for installs and also to keep around as a recovery drive. I’d then put on it an ISO file of your preferred linux distro, and also a separate ISO file of a good live distro for recovery. GParted Live is particularly good USB live distro for this because resizing the partition is the aim, but almost any good USB Live Distro will do
I’d then boot up the USB drive and select the ISO for your Linux distro’s installer. During install, in the partition section, I’d then use the partition tool in your installer. Dlete all the windows partitions (sda1, sda2, sda3 and sda4), and then delete the exisiting boot (/boot/efi) and root file system (/) and create new ones at the beginning of the disk: 1gb /boot/efi and 85gb / system partiton as you have now, and ensure the existing /home partition is kept and mounted as /home in the new install. You’ll have loads of free unpartitioned space; leave that for now.
After the system is reinstalled, I’d boot in, check everything is ok, and then restart and boot the USB again, this time selecting GParted Live. Then with GParted Live, I’d resize the /home partition to fill all the empty space.
But as I said, before you do anything, backup /home. Also before you do anything you can use a partition tool now (like KDE Partition or Gparted) to add a label/name to your /home drive so there is no confusion when you use use the Linux installer or Gparted later. But it should be clear from the size alone.
I would delete the first two partitions and put a new partition there to use as /home. Then expand / where /home was.
It’s easy to expand a partition towards the end of the disk. I would not recommend expanding one towards the start of the disk. That would have to move all of the data. It’s slow and much more likely to cause problems.
I wouldn’t suggest messing with a boot partition unless you are comfortable using a live boot disk to reinstall the bootloader if something goes wrong.
Yes, that looks safe enough. I am not sure what I would do with a 300GB
/though. Isn’t that wasted space?You could also actually just use it. Just because it is physically located on the root disk doesn’t mean you can’t add some directories and give your user full access to them.
I usually have a
/mnt/scratch, usually on another disk (hence mnt). Or you could make another steam library in/opt/. Steam can have multiple data locations.The purists might yell at you, but it is your system. If you have space to spare in root use it, just remember what is where if you need/want to reinstall at some point.
Edit: or just nuke the NTFS partition, and use that partition as extra storage. Usually you don’t need that much in root, and if you do you can always symlink to another dir to get around it. Just remember to copy anything that might be useful from the ntfs!
User/<foo>has a lot of data, I would copy at least that. Reading ntfs data is not a problem from linux, writing is more hit and miss.If you install a few Flatpak packages, it will fill it up quickly. You could also make a games directory.
Boot a live image from USB, copy /home to a separate physical disk preserving ownerships and permissions, and save anything from the windows partitions that you want you keep. Once you’ve verified the copy is good delete all the original partitions on the screenshot.
From here you install from scratch. You’ll appreciate it later when things aren’t a jumbled mess.
If you have any kind of ssd install the OS to that instead, then use that spinning drive for /home. If you have two ssd drives do /home on the second one and use the spinning one for longer term storage like music or videos or the like.
Also don’t put your swap partition on an ssd, use the spinning drive for it so you’re not wearing out the ssd. You can do a swap file instead of a partition if you miss the windows way. 😆
I agree with this approach. It results in the cleanist install that does not require setting up everything from scratch.
You can even backup your / as well if you want to copy some configs from the current install.
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.
I’d rather have a single large
/homepartition, 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
fstabsays 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 0Swapfile 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.
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.
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.
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.
that is an odd layout, even for a windows system with linux added later.
what’s the actual order of the partitions on disk?
The sda1 and sda2 partitions seem safe to format. Just be sure that you really copied everything you need from there. Like others said, better not to mess with the boot partitions
If you want to increase the space of the linux partitions, insead of creating a new extra partition, that may be a bit tricky in that layout, but one thing you can do is (from a live boot) is:
1- delete both windows partitions and create a new ext4 one with ~530gb
2 - clone your /home partition into there and change the fstab to point to the new partition
3- manually check if all your files were safely copied, just to be sure
4 - delete the old /home and expand the size of the / partition into ityou will end with a / partition with ~300gb and a /home of ~530gb
This looks fairly straightforward. I have done (1) already. It’s not great that
/will be that big, wasting around 200GB but the setup is definitely better than now and the risk is minimal.





