0

I had Windows 7 and shrunk the partition, creating a new one (plus swap) for Ubuntu, then I installed Ubuntu. I am enjoying it so much I'm considering using it a lot more than I expected. The problem is the Ubuntu partition could be bigger (30Gb on a 1Tb hard drive), which is OK to a certain extent seeing as most of my Windows partition is full of games.

So my question is: can I safely shrink my windows partition, then expand my Ubuntu partition, copy over files and repeat until I'm satisfied? (probably until I use Windows only for games that don't work on Ubuntu) Also, if I finally decide to get rid of Windows, can I just remove it and expand the Ubuntu partition so it takes up the whole hard drive? If so, what do I need to worry about?

Thank you.

Mabd
  • 3
  • ___ Yes you can. If your partition to be primary. – Shakiba Moshiri Apr 25 '16 at 18:53
  • As long as you are using Windows do not shrink too much. Windows only works well with 30% free in the NTFS partition. At 10% free a defrag can take forever. I do prefer to have smaller system partitions, although Windows need a lot more, and larger data partitions. I typically use 25GB for Ubuntu's / (root), but have all data in my /mnt/data. When still using XP years ago I had a shared NTFS data partition also. While SSD & HDD, you can do similar on one drive. http://askubuntu.com/questions/524943/dual-boot-with-ssd-and-hdd-storage – oldfred Apr 25 '16 at 21:24

1 Answers1

1

Short Answer

Yes, your plan is workable

Medium Answer

There's no such thing as "safe" (in an absolute way) when dealing with partition-resizing operations. Your plan, in particular, will necessarily involve moving the start point of at least one partition, and that's always a bit risky. Be sure to have adequate backups before moving or resizing partitions.

Long Answer

Instead of expanding the current partition, you may want to consider creating a separate /home partition for use in the space you create when you shrink the Windows partition, as described here:

How to Create a seperate partition for home after accidentally installing ubuntu under single / partition

This will enable you to skip at least one round of partition-moving/resizing-from-the-start (assuming Ubuntu comes after Windows now), and it provides several other advantages.

You might even consider using a Logical Volume Manager (LVM) setup, at least for new space like your /home partition. The immediate advantage of LVM for you is that you can expand it without moving anything. For instance, suppose you end up doing three rounds of shrinking the Windows partition and moving the space to Ubuntu. With LVM, in each of these steps, you would:

  1. Shrink the Windows partition
  2. Create a new partition in that space
  3. Add that new partition to the LVM
  4. Expand the /home logical volume within the LVM

Steps #2-4 are all quick and low in risk, compared to moving and resizing a conventional partition, which is much slower and riskier.

The drawback to this approach is that the resulting filesystem will be fragmented, which will degrade performance, at least if it's on a conventional hard disk. This shouldn't be a big deal if your LVM consumes just a couple of partitions, but it could be a problem if you go through half a dozen rounds of resizing and re-allocating.

Another option you might look into, at least if you know you want to re-allocate a significant chunk of space right away, is to back up all the files you want to move to another physical disk, delete them from the original, do your re-partitioning in one big chunk, and then restore the files from the backup. This has the advantage of doing it all at once, which will have benefits whether you use LVM or conventional partitions. If you don't currently have enough backup storage to handle this task, GO GET IT NOW!!!! Backups are NOT a luxury.

Rod Smith
  • 44,284
  • 7
  • 63
  • 105
  • An excellent answer.

    Even after you take backups, make sure they work! As the old saying goes, "you have backups, but do you have restores?" :)

    – JayEye Apr 27 '16 at 19:23
  • Thank you very much for the detailed answer! I ended up just doing the shrinking/resizing "normally". I made sure I was able to do it all in one go and was expecting to have to fix the boot after moving the Ubuntu partition to the left. All went perfectly well, though. I'll probably keep Windows as I play games, but I've migrated over all my other stuff to Ubuntu and still have plenty of space on both partitions. – Mabd Apr 30 '16 at 14:50