[SOLVED] Do I need to consolidate free space before I shrink my / partition?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Do I need to consolidate free space before I shrink my / partition?
Currently I have Mint Linux 19 installed on a 2TB hard drive. I will be cloning the installation to a 500GB SSD in the next few days. My installation takes about 75GB at the moment (I just moved 700GB of files to a separate data drive).
To resize the partition I will be booting a "Live" installation USB stick and running gparted. Later on I will clone from the 2TB HDD to the 500GB SSD.
[edit] I just discovered that the disk utility in Mint can shrink the volume without the need for booting a "live" installation. Should I do this? [/edit]
What I want to know is if I should consolidate free space before resizing, or will gprarted move files if they are at the end of the 2TB drive so that the fit on the 500GB drive?
Is there anything I should know or do during this process?
It's very unclear what you mean. Are you doing your own bespoke distro for strangers to install? Are you creating template for other machines in your home/company? Are you doing your own bespoke distro for you to install in other places, adjusting as needed?
If your cloning procedure can't handle the target partition being smaller than the source, don't use that procedure.
Simply copying your data (as you apparently already have for your data drive) is the best solution. Writing "unused" blocks needlessly to a SSD is a really bad idea.
Even the EFI partition can be just copied - for the boot entries you'll need run grub-install and possibly update-grub too. No idea how Win10 will react if you have that (EFI).
For common Linux filesystems (say ext4) you can resize on-the-fly - including the root. Note this is not true of xfs. Likewise the swap has to be managed separately if you are planning on resizing that.
Nothing is ever as straightforrward as it first seems ...
What I want to know is if I should consolidate free space before resizing
not necessary in my experience; i think it has to do with how journaling filesystems handle these things physically.
anyhow, if you shrink the partition gparted will do whatever is required.
To resize the partition I will be booting a "Live" installation USB stick and running gparted. Later on I will clone from the 2TB HDD to the 500GB SSD.
[edit] I just discovered that the disk utility in Mint can shrink the volume without the need for booting a "live" installation. Should I do this? [/edit]
What I want to know is if I should consolidate free space before resizing, or will gprarted move files if they are at the end of the 2TB drive so that the fit on the 500GB drive?
Is there anything I should know or do during this process?
Thanks!
I can't say for sure with Linux Mint, but I assume the answer is "no" based on my experience. Defragmenting the partition is part of the resize process. At least it is in Mageia. I'm pretty sure resizing would not work if defragmenting/copying was not part of the process.
There could also be potential effects from resizing an encrypted partition.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.