TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: USENET.16@SCOTTSONLINE.OR
from: KEES NUYT
date: 2019-10-24 16:09:00
subject: Re: problem moving root t

On Thu, 24 Oct 2019 10:35:44 +0100, Mike Scott
 wrote:

> Hi; thanks for your patience.
>
> I've redone the rsync (nothing interesting changed), changed cmdline.txt
> on the card (with rootwait and rootdelay=15), and edited fstab (on the
> new HD partition). Still the same kernel panic. It looks increasingly as
> though although the HD is detected correctly, there's a problem reading
> it at that point.
>
> Looks like I'll have to sacrifice another system's backup disk to get a
> spare usb drive to try in place of this one. Tedious :-{

You could try to copy the root partition using dd.

$ sudo dd if=/dev/mmcblk0p2 of=/dev/sda2 bs=1M

I had good results with that.
The destination partition has to be at least as big as the
source partition. When the SD card is bigger than the root
partition on the HD or SSD, you have to avoid trouble by
removing
   init=/usr/lib/raspi-config/init_resize.sh
from cmdline.txt prior to the first boot, so the root partitiion
on the SD card is not expanded.

After the dd, the new root filesystem can be expanded with
resize2fs.

Before (destination already partitioned) :
$ lsblk
NAME         SIZE TYPE MOUNTPOINT
sda        232.9G disk
+-sda1       256M part /media/pi/SSDBOOT
+-sda2      14.8G part /media/pi/ssdroot
+-sda3       218G part /media/pi/{some_GUID}
mmcblk0     29.7G disk
+-mmcblk0p1  256M part /boot
+-mmcblk0p2  5.6G part /

After:
pi@raspberrypi:~ $ lsblk
NAME         SIZE TYPE MOUNTPOINT
sda        232.9G disk
+-sda1       256M part /media/pi/SSDBOOT
+-sda2      14.8G part /
+-sda3       218G part /extra
mmcblk0     29.7G disk
+-mmcblk0p1  256M part /boot
+-mmcblk0p2  5.6G part /media/pi/sdroot

Notes:
-sda1 is meant to keep a copy of /boot
-sda2 is root and swap
-sda2 is an extra partition for home and data, so a new Raspbian
install can leave those alone.

--
Regards,
Kees Nuyt

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.