You are not logged in.

#1 2021-12-09 18:42:57

virgult
Member
Registered: 2021-12-09
Posts: 2

Installing Arch on a MicroSD then copying it over to the main HD?

Hi all,

Arch user from 10 years ago here... I haven't used Arch in such a long time that I've practically regressed down to a newbie! I've installed Arch on to a Virtualbox VM just to familiarise myself with the new Arch ways (a lot has changed!!! or maybe I've forgotten it all), and I want to migrate from Fedora to Arch. However, since I'd like to have it on my work laptop, I can't afford to have that machine down until everything is correctly up and running. And I'd like to do only one install, as a full Arch install all the way to GUI and drivers can take a good couple of days. So I'd like to spare myself the "install once on a USB stick, then install again on the hard drive".

So, I'd like to try and perform all the installation tasks onto some sort of removable media, which I can configure exactly as I would my main drive (an NVMe SSD): GPT table, EFI boot, the bootloader I want, etc... Then, ideally, once I am 100% happy with that installation I'd like to "clone" it onto my main drive.

Now, I imagine it can't be as easy as just DD'ing the whole contents from one device to the other, then resizing the main partitions?

Could someone more experienced than me give me an overview of all the trouble I could encounter, and how I could fix it? Is the DD even actually going to work? Is the block alignment going to be OK? Is the bootloader going to go "hey, that's a different drive, wth?" and would I need to refresh it?

I really tried googling this, but any keyword combination would just bring me to a load of "install Arch on removable media" pages. That's the easy part. The hard part is the one above. big_smile

Any advice appreciated! Thank you!

Virgult

Last edited by virgult (2021-12-09 18:45:53)

Offline

#2 2021-12-09 19:05:23

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,493
Website

Re: Installing Arch on a MicroSD then copying it over to the main HD?

dd could be used, in theory, but it would be slow, and would require a fair bit of adjustment after the fact.  And some of those adjustments may not be practical (some may not even be possible depending on several unknowns).  For example, you'd almost certainly want to expand the partitions - if you only need to expand the last one on the disk, that would be too much trouble, but it's still needless hassle.  If you needed to expand any others, you'd be in for a lot of misery (as other partitions would have to be moved).  Further, dd is slooooow.  There is no need to copy every (literal) bit of a mostly-empty partition.

You'd be far far better off using rsync.  This would require the extra step of partitioning the final destination disk and creating filesystems, but this is trivial.  Then just rsync the content from the microSD to the HDD partitions.  You will then have to adjust / reconfigure / reinstall the boot loader and adjust the fstab.

That said, I'd not even bother with this.  If you want to do a dry run on the microSD, go for it.  Once you have everything the way you want, the steps to do an actual install on the HDD should take no time at all.  1) Do the base install, 2) get the list of explicitly installed packages from the microSD system and install that list on the HDD, 3) copy over any configs or even your entire user directory (assuming users created on both systems have the same id, there'd be no need to even chown anything).  That's that.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2021-12-09 19:08:26

virgult
Member
Registered: 2021-12-09
Posts: 2

Re: Installing Arch on a MicroSD then copying it over to the main HD?

Wise words, Trilby, wise words. smile

Thanks, I really like your solution of mirroring the package list and keeping a tally of the changed config files. May just be the way to go!

Last edited by virgult (2021-12-09 19:08:54)

Offline

#4 2021-12-09 19:22:31

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,493
Website

Re: Installing Arch on a MicroSD then copying it over to the main HD?

You'll likely want to check out seconds 2.5 and 2.6 below:

https://wiki.archlinux.org/title/Pacman … d_packages


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB