1

I want to install Ubuntu as my new main OS but is still have tons of Windows files that I need to transfer over. By thing ahead, I noticed that I might want to resize Ubuntu's portion size after doing that so It can take up most of my space, but RN I don't have enough space to do that. currently, windows take up 80% of my disk, but I want Ubuntu to do so not windows. So is it possible to resize my Ubuntu partition after installing it so it can use up the available space after transferring?

  • It is not impossible, but how easy it is, depends on the specific partition layout. – mikewhatever Jul 03 '22 at 21:02
  • 1
    Welcome to AU. What I would do is invest in a big enough external drive to back everything up carefully before you do anything like this... you risk losing data if you do what you are trying. Any moving of partitions carries some risk - a power outage at the wrong moment could completely break your system. You should obviously have backups anyway; this will make the whole process much easier: copy everything to external drive, then (probably) easiest just to reinstall both OSs from scratch then copy your files back over. – Will Jul 03 '22 at 21:25
  • Yes it is possible to resize the Ubuntu system partition after installing Ubuntu. Your will have to do it from the Ubuntu installation USB, using the Try Ubuntu option. – user68186 Jul 03 '22 at 21:53
  • See how to resize partition? for more. Remember, if your encrypt your Ubuntu partition during installation, it will be very very hard to resize it later. – user68186 Jul 03 '22 at 22:00
  • 1
    Does this answer your question? How to resize partitions? – karel Jul 04 '22 at 04:41
  • If your project involves resizing a Windows drive, use Windows Disk Management to do the job. – C.S.Cameron Jul 04 '22 at 14:44

1 Answers1

1

Firstly, this is probably not the answer you want, but it's the answer you need if you want to keep your data.

This is potentially dangerous. As Will pointed out in the comments, partition resizing is a sensitive process and something like a power outage at the exact right (wrong?) moment will wreak havoc on your data. More than that, resizing partitions isn't exactly reliable all the time - I've destroyed or nearly destroyed partitions trying to fiddle around with my disk.

While it's potentially possible to mess with partitions after they're created, it's best to pretend like you're living with the limitations of DOS when it comes to partitioning - get your partitions right the first time, and don't touch it again unless you're going to start from scratch. If you absolutely have to fiddle with your partitions, copy all your data to an external drive first, or you're begging for trouble. (Ask me how I learned this...)

Additionally, if you're going to shrink Windows and grow Ubuntu, you can't just take space from one and give it to the other. Partitions have to be continuous, so what's going to happen is you're going to have to shrink Windows, move Ubuntu over into the empty space so that the space is now at the end of the Ubuntu partition rather than at the beginning, then grow Ubuntu. This is going to do a TON of writes to your disk, which will shorten its lifespan a bit. Now, if you're on a large-capacity brand-new SSD or HDD, that might not be a problem for you, but if you're using an older system with a smaller storage device, this might be a problem for you.

The best way to do this, IMO, is to buy an external hard drive (you can get them for really cheap at Best Buy - look for WD EasyStore drives). Get a decent-sized one, one that's larger than the drive (or drives) that's in your computer. (So if you have a 1 TB drive, get at least a 2 TB external drive.)

Next, reformat it with the tool of your choice (GNOME Disks, GParted, KDE Partition Manager, etc.), creating a single ext4 partition.

The next step will be to change the permissions on it so that you can copy data to and from it without needing root privileges. Open a terminal, and run lsblk to find your external HDD's drive ID - you should be able to recognize the drive by its size.

Once you have the drive ID, run this command:

sudo mount /dev/<driveID>1 /mnt

So if the drive ID for your external drive was "sdx", for instance, you'd run sudo mount /dev/sdx1 /mnt. (Note that your drive ID will almost certainly be different.)

With that done, run this command to "unlock" the partition so you can write to it without root privileges:

sudo chmod 0777 /mnt

Now that you have that done, open a file manager, and navigate to /mnt. You should see a folder named "lost+found" here - if so, everything's working as planned. Make two folders here - one called "Windows", and the other called "Ubuntu".

Next, open your Windows partition in the file manager, and select everything there. Yes, that's correct, every single thing. Windows is notorious for scattering data all over the place in its file system (your files are in C:\Users\User\Documents, oh but wait configuration goes in the AppData hidden folder, OR sometimes it goes in C:\ProgramData, and also these particular programs store data in C:<whatever>... AAAAA!!!), so the only way to be sure you got everything... is to get everything. So select every single file and folder on your Windows partition, and copy it into the Windows folder of your external drive. This will probably take a while, so go bring some good into your world while you're waiting for your system to finish up with your copy.

Once that's finally over, go to your Home folder in Ubuntu, show hidden files, and grab all of the files and folders in your home folder and copy them to the Ubuntu folder on the external drive. On most systems, this will be sufficient to get everything, however there may be some programs that insist on storing data in weird areas of the system (sort of like Windows!) - virt-manager is the only program I know of that does this. So just look through your data when you're done and make sure you aren't missing anything, and think hard about anything you might be might be missing so you don't lose important stuff.

Once that's done, make sure to rescue any passwords and other authentication data out of any web browsers, password managers, or other authentication software you use. If you have authentication data like this in your Windows partition, I'd boot into Windows, open your browsers, password managers, and whatever else, and copy the authentication data directly out of them, so you can be 100% sure you got it. Do the same in Ubuntu for safety's sake.

Now that you're done backing up your system, your choice of what to do next is yours. Personally, I'd install Ubuntu from scratch, erasing the entire disk at this point. If that's not what you're going for, you can try to mess with your partitions, but be prepared to have to clean install anyway if something goes wrong, and be aware that you're wearing out your disk faster than normal by doing the required partition move. If you're OK with that, then at this point, do whatever you want to your partitions. Worst case scenario, you have a total backup plan in place.

To resize and move partitions, you can boot from a live Ubuntu ISO, and use a partition manager like GParted or KDE Partition manager. The process should be relatively straightforward - just right-click on the partition you want to change, click whatever button achieves your desired goal, and tweak your partitions however you want.

ArrayBolt3
  • 3,129