1

I'd like to reduce the size of my "main partition" for making dual boot possible. The thing is: most files are stored on that partition.

Can I reduce the partition to a size that still all files on the actual partition can stay on it because it'll be still large enough? Will the files be reorganised if they're in an area where the new partition will be? Or will resizing a partition erase all data in the partition?

  • Dual-booting which OS? Be warned that trying to add Windows as a dual boot after installing Linux is problematic, to say the least. If not Windows, no response needed. – K7AAY Feb 6 at 21:15
2

You can re-size a partition that has data on it. To do that, I recommend using a tool like parted or gparted, which will change the filesystem properties correctly, as well as re-sizing the partition.

But, it is strongly recommended that you back-up your data before you try to do this. There is always a risk of losing data when you change partitions on your drive (e.g. if something goes wrong and the process gets interrupted). So, if any of the data is critical, back it up first.

  • For checking purposes wether everyything went fine, I guess, a checksum of the most uplevel directory would be a fast and reliable way to check after resizing wether any of the files has changed...? – Nepumuk Feb 6 at 20:56
  • 1
    Backup is a very good idea. You also can't resize the partition you boot from, so plan to make a LiveUSB with parted/gparted/othertool on it, and boot from that LiveUSB before commencing the resize. – K7AAY Feb 6 at 21:18
  • @Nepumuk I haven't tried that myself, so can't really comment on it. Usually I would just check the top-level directories and/or verify that the total size of the files is still the same. The e2fsck tool can be used to check that the filesystem is still ok. How to verify after re-sizing might be a good follow-up question to ask. – Time4Tea Feb 6 at 21:25
  • @Tiem4Tea like Get checksum of directory on bash? – Nepumuk Feb 8 at 17:49
  • The file-specific physical location would also be interesting for repartitioning as the files next to the partition border could be selectively moved then... – Nepumuk Feb 9 at 20:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.