[SOLVED] To move an installed distro on a partition into another
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
How can we move a perfectly installed distro on a partition into another which is readily prepared to sufficiently contain the OS' size ?
It is best to use a backup/clone utility that preserves the Volume UUID, since Grub and other boot loaders typically default to looking for the partition with same UUID it was configured to look for.
I use Image for UEFI, but there are other backup utilities that do similar/same. It will make a compressed image of all allocated space, it will not include free space. A Linux installation using 10GB of space in a 200GB partition typically renders an image file around 4GB. Then create new partition of same or larger size anywhere on the drive and plaster the image there.
On an EFI system, I don't need to do anything else with many Linux, just go ahead and boot it and expand the file system if the partition was enlarged. If I need to move it to a smaller partition, I shrink it first using Gparted Live for Linux and Windows disk management for Windows etc.
Some Linux however, will require the need to boot another installed OS or a live Linux to reinstall the boot loader in order to boot it after it's been relocated. All depends on your system setup/firmware (for UEFI).
EDIT: BTW, in the past, Windows was required to be first OS on first drive, or it's boot partition if it's separate. Not sure if that still applies with GPT partitioning.
BTW, in the past, Windows was required to be first OS on first drive, or it's boot partition if it's separate. Not sure if that still applies with GPT partitioning.
That hasn't been the case since windows 95 but windows boot files still need to be on a primary partition. Discussed at the two links below. With GPT, all partitions are primary.
The need to install windows first has always been the case until UEFI installs became common and even now it is easiest to install windows first to avoid having its installer overwrite (reformat) your efi partition
Not too long ago, here in this forum, members were complaining about having two WinRE partitions. The easiest way to install Linux on a Windows machine was to shrink Windows partition creating a gap between Windows 10 and the WinRE partition to house Linux. Then a cumulative update came around, shrunk Windows some more and created a new WinRE partition right beside Windows where it was expected to be.
Again, not sure if that is still the case as I don't see any complaints regarding extra WinRE partitions anymore. But Microsoft has it's rules, I don't know of any computer manufacturer that offers out of the box multi-boot computers. So if you are not multi-booting, Windows rules are not an issue.
$ sudo cp -a /path/to/source/* /path/to/destination
I've replaced many hard drives like this, plain 'cp -a' does the job. Not sure why they use '-afv' in their example. This method has advantages over imaging, the new partition(s) can be different size and use different filesystem. Faster, too.
[CODE]Not sure why they use '-afv' in their example.
cp options.
-a == archive
-v == verbose
-f == force
verbose if I want to see the file names as the copy progresses.
force to remove & replace a destination file if it cannot be overwritten.
archive to keep timestamps, ownership and other attributes.
You have a definite talent to miss the point and make useless posts.
I didn't say I do not know what these switches do, I said I see no reason to use -v and -f.
The way I understand it, and my recollections of such are vague but in the past it was necessary to use the -f option to avoid having to confirm for every file separately. This is not required anymore, at least for root/sudo anyway.
At least that's what I'm led to believe, but recently I got stumped working from Gentoo live installer which has no desktop and no user account, it boots to a root prompt. It was asking for confirmation of every file being dealt with and I was like: WTF?. Took a good 10 minutes to figure out I needed the -f option that I haven't used in years from a root prompt.
And the -v option...
No different than a disco ball, lots of amazement in front of your eyes. People pay good money for disco balls, don't cost nothing to add the -v option.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.