2014年4月1日火曜日

How to move rootfs to external usb storage

Move RootFS to External USB Storage (Bookworm)

Move RootFS to External USB Storage (Bookworm)

This guide explains how to move the root filesystem (rootfs) of a Raspberry Pi running Bookworm to an external USB storage device.

1. Prepare Your External USB Storage

sudo fdisk /dev/sdX
# Create a new partition (type Linux) and format it
sudo mkfs.ext4 /dev/sdX1

Replace /dev/sdX with the actual device name of your USB storage.

2. Mount the USB Storage

sudo mkdir /mnt/usb
sudo mount /dev/sdX1 /mnt/usb

3. Copy RootFS to USB

sudo rsync -aAXv / --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} /mnt/usb

4. Modify Boot Configuration

sudo nano /boot/cmdline.txt

Change the root= parameter to point to your USB device, e.g., root=/dev/sdX1.

5. Reboot the Raspberry Pi

sudo sync
sudo reboot

Your Raspberry Pi should now boot from the external USB storage. 🚀

0 件のコメント:

コメントを投稿