[SBC HACK] How to move a root from SD card to external drive

This forum is for discussion about general software issues.

[SBC HACK] How to move a root from SD card to external drive

Postby jyno » Mon Nov 29, 2021 1:26 pm

How to move a root from SD card to external drive on Raspberry Pi [15 August 2020]

1. Introduction
Raspberry Pi is known for how it wears off the SD cards. Thankfully you can move the root off the SD card to an external drive and leave there just a boot partition. I'm gonna use a [s]SystemD[/s]GNU/Linux distribution for that.

2. Moving / to an external drive
I assume that you have your drive partitioned already. Create the temporary directories for a SD card's boot and root partitions and for a drive. Mount the partitions and issue a command cp -a path/to/sdcard/root/* path/to/drive. -a stands for archive. Which recursively copies everything preserving all the attributes and links.

2.1. If you're doing a fresh install
Then you just install it right on a drive. And then move files from /boot to a SD card's boot partition. Like that: mv path/to/boot/* path/to/sdcard. Keep in mind that the boot partition should be formatted in FAT32.

3. cmdline.txt
In a cmdline.txt. file we need to change root= part. Now it'll look like root=/dev/mmcblk0p2 rw rootwait, and we need to put our drive's root partition instead of that, e.g. root=/dev/sda1 rw rootwait.

Source: http://arav.i2p/stuff/article/rpi_root_ ... rnal_drive
jyno
 
Posts: 67
Joined: Wed May 05, 2021 4:37 pm

Re: [SBC HACK] How to move a root from SD card to external d

Postby Bellamy112 » Thu Dec 23, 2021 5:08 pm

Thanks. This issue is more thoroughly explored in viewtopic.php?f=65&t=15629
world of solitaire
Bellamy112
 
Posts: 1
Joined: Thu Dec 23, 2021 5:06 pm


Return to General

Who is online

Users browsing this forum: No registered users and 3 guests