quick way to change rootfs(tested on rock64)

Guides and tutorials for various stuff. Posted by DietPi users.
Post Reply
ihitmani
Posts: 7
Joined: Mon Aug 27, 2018 10:27 pm

quick way to change rootfs(tested on rock64)

Post by ihitmani » Tue Sep 04, 2018 3:39 pm

1. prepare external drive, make separate partition with ext4 I used GPT table
2. connect drive to the working board, and do next:
- change existing disk LABEL by using: tune2fs /dev/mmcblk1p7 -L "linux-root1"
- change existing PARTLABEL by : gdisk /dev/mmcblk1. Press c, and choose 7 number, after enter root1;
3 do the reverse for your usb drive:
- change disk LABEL by using: tune2fs /dev/sda1 -L "linux-root"
- change PARTLABEL by : gdisk /dev/sda1. Press c, and choose 7 number, after enter root;
4 mount drive, and move your existing root data : rsync -rav --info=progress2 / /mnt
4. reboot

User avatar
MichaIng
Legend
Posts: 1626
Joined: Sat Nov 18, 2017 5:21 pm

Re: quick way to change rootfs(tested on rock64)

Post by MichaIng » Wed Sep 05, 2018 9:31 am

Many thanks for this! So on next boot, the USB drive will be used as rootfs, just because of disk label being linux-root?

This is really an easy solution which we could implement into dietpi-drive_manager.
But needs testing on which devices these steps only work.
E.g. I am pretty sure on RPi the rootfs entry in /boot/cmdline.txt will be always respected. Ordoids have their boot.ini. I will try it on VM (x86_84).

User avatar
DrewG
Posts: 14
Joined: Mon Jan 09, 2017 2:58 am
Location: Alberta, Canada

Re: quick way to change rootfs(tested on rock64)

Post by DrewG » Sun Oct 14, 2018 8:59 pm

ihitmani wrote:
Tue Sep 04, 2018 3:39 pm
1. prepare external drive, make separate partition with ext4 I used GPT table
2. connect drive to the working board, and do next:
- change existing disk LABEL by using: tune2fs /dev/mmcblk1p7 -L "linux-root1"
- change existing PARTLABEL by : gdisk /dev/mmcblk1. Press c, and choose 7 number, after enter root1;
3 do the reverse for your usb drive:
- change disk LABEL by using: tune2fs /dev/sda1 -L "linux-root"
- change PARTLABEL by : gdisk /dev/sda1. Press c, and choose 7 number, after enter root;
4 mount drive, and move your existing root data : rsync -rav --info=progress2 / /mnt
4. reboot
Have you been able to get this to work on the pine64?

I have been unable to get older methods to work to transfer the rootFS from the SD card to the USB. There have been some changes in how DietPi seems to reading the sd card and I am not linux savvy enough to be able to figure it out on my own.

This used to work on with my pine64, however I am unable to get it to work now.
viewtopic.php?f=15&t=1639&p=7010#p6988

I can tell that the rock64 uses a bit of a file system compared to the pine64 from what I've read here and else where but a lot of it is globl-d-gook to me. Any help would be great.

Thanks

- Drew

Post Reply