Moving arch to a larger microSD

This forum is for topics specific to the Raspberry Pi and Arch Linux ARM

Moving arch to a larger microSD

Postby grandcanyon » Sat Dec 16, 2023 5:46 am

I have bought a larger microSD and I want to move my arch aarch64 linux install to the larger microSD and of course take advantage of the larger disk. Does anyone have a tutorial on how to do this?
grandcanyon
 
Posts: 39
Joined: Tue Jan 18, 2022 1:46 am

Re: Moving arch to a larger microSD

Postby graysky » Sat Dec 16, 2023 9:01 am

Just partition the new uSD as you wish (see official guide) then using an uSD reader on another system, make a backup tarball of the old one and extract it to the new one. if you have a uSD reader that allows for two cards you could just mount the partitions and rsync their contents directly. Let's assume you want to do one at a time (to retain the tarball as a backup).

For example, to backup the old card on your other linux machine (as root):
[code]
cd /some_place_with_plenty_of_space
mkdir boot root
mount /dev/sdx2 root
mount /dev/sdx1 root/boot
cd root
bsdtar cfp /scratch/foo.tar --exclude 'var/cache/pacman/pkg/*'
sync
cd ..
umount boot root[/code]

Now you can insert the new card and partition it (again see the official guide) and (as root):
[code]
mount /dev/sdx1 boot
mount /dev/sdx2 root
bsdtar xpf foo.tar -C root
sync
mv root/boot/* boot
umount root boot
[/code]
graysky
Developer
 
Posts: 1731
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000

Re: Moving arch to a larger microSD

Postby grandcanyon » Thu Dec 21, 2023 4:08 am

Thanks for the help

bsdtar cfp /scratch/foo.tar --exclude 'var/cache/pacman/pkg/*'

This line said nothing to add so I ended up doing bsdtar in boot and root and then moved them over and uncompressed.

The higher speed card (Samsung EndurancePro) has made a bigger difference than I thought it would. I don't get screen lags as much anymore.
grandcanyon
 
Posts: 39
Joined: Tue Jan 18, 2022 1:46 am

Re: Moving arch to a larger microSD

Postby graysky » Thu Dec 21, 2023 8:30 am

Ah, I missed 2 steps (cd root then bsdtar... then cd ..) I edited my post adding them. Glad you're up and running. Yes, quality uSD cards make all the difference.
graysky
Developer
 
Posts: 1731
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 9 guests