For historical reasons, I've had a /space partition for several machines now. It's used for large media archives, buffering towards other servers (which only grab stuff every now and then), cold storage and the like.
Linux
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
- 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)
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.
Amen. I took your advice and Ventoy really saved the day. Without it and its option 2 (grub2) no live USB booted.
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.
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.
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.
The one word of caution here if the bootloader is stored in these partitions you mentioned in which case it could render their system unbootable which would require some fixing. The safest would be like another commenter mentioned to only format the ntfs partition after doing a backup of course.
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 /home and 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 /home but 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.
Yeah there's a fair bit outside of home people don't mention. Basically any system-level stuff: fstab mounts, all your system packages, /opt installs, config tweaks you had to do. It tales some time to get set back up after a while on the same install.
After having to reinstall a couple times myself I now don't touch anything outside of /home by hand. It's all scripted so that I can copy /home, run the script, and be back up and running. Well, theoretically, there's usually a hiccup or two. But the peace of mind knowing it's all (self) documenting is quite nice. Not for everybody of course.
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
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.
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 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!
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.
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.
Repartitioning done but I still get the Windows option in the bootloader menu. It's not the default so not a problem but it's a little annoying.
It still shows up because the windows boot partition is still there.
If you're using grub, you can add GRUB_DISABLE_OS_PROBER=true to /etc/default/grub and run update-grub. That will remove other operating systems from the grub boot menu.
This did it. Previously /boot/grub/grub.cfg mentioned Windows on sda3 but now it doesn't. The partition is still there of course but at least I don't see the grub menu entry. Many thanks!
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.
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 /home upwards with /boot/efi standing 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.
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.
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 ...)
In the end, I went for something like this. I moved /home to the larger partition I created out of the Windows partitions and I will use the old, smaller /home as separate storage.
The problem now is how I can remove Windows from the bootloader. There is no Windows partition left anyway.
It depends how your boot is setup
If you intially get the uefi boot (usually black screen) then try to search "removing entries from uefi boot in Linux"
If you directly get colorful screen then it could be grub and in this case u search for grub instead of uefi
But it also could be something else that is neither grub nor uefi, you really need to find out first what is your bootloader
Apparently, the easy way is to install Grub Customizer, but I don’t like PPAs so I disabled the OS Prober instead. The partition is still there but at least I don't see the grub entry.
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.
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 fat32 formated partitions are EFI System Partitions used to boot your PC. I assume that sda3 is the one Windows created, while a later Linux install created sda5 as an alternative. Yet sda5 doesn't seem to be really used (with that cute 9MB used), so your Linux boot stuff -including a bootloader that would allow you to start Windows (or you picking directly from EFI?)- is probably all sitting alongside Windows' EFI stuff in sda3.
In fact I wouldn't touch anything there without some backup.
I have changed the partitions and all seems to work but I still get the bootloader menu with the Windows option even though there is no Windows partition. Not a huge problem, but it is a little annoying I can't remove references to Windows without risking breaking my setup.
Unfortunately, your existing /home and the ntfs partitions you could remove are in completely non-contiguous regions, so you cannot easily just combine the space. If I were you, I would switch to LVM piece-meal. Ideally, you'd have some other medium were you can temporarily store the current contents of /home while your repartition the drive. Then combine sda2 and sda7 into a volume group and pull just one logical volume out of it for the new /home.
Otherwise, create a new volume group with only sda2 in it (just overwrite the existing ntfs filesystem) using vgcreate, create a logical on top of that using lvcreate, make a filesystem in that using mkfs.ext4, I would add the -m 0 parameter for a non-root filesystem, mount that somewhere under /mnt/, move or copy over all the contents from /home to that mountpoint, taking care to replicate file owners and permissions (I would just use cp -a), then once this is done (and you've double-checked that it is because at the next step you can lose data if you're not careful), umount /home, extend the volume group to include sda7 using vgextend, enlarge the logical volume for the new /home to the maximum using lvresize, enlarge the ext4 filesystem in there to the maximum possible using resize2fs, finally editing /etx/fstab to use that new logical volume as /home and remounting /home.
I think that's a good plan. With a backup, moving step-by-step and some reading it's difficult to get it horribly wrong. If the new /home doesn't work while the old /home is unmounted, I will just have to backtrack. Minimising risk sounds like a project though.
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 it
you 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.