Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Moving system from ssd to sd card
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
erg_samowzbudnik
Apprentice
Apprentice


Joined: 09 Sep 2011
Posts: 211
Location: European sticks

PostPosted: Sat Feb 25, 2023 6:35 pm    Post subject: Moving system from ssd to sd card Reply with quote

I'm having an issue moving system from ssd to sd card.

My procedure is as follows:

1. Make a stage4 using mkstage4 utility:
Code:
mkstage4 -t /mnt/gentoo rpi_stage4

2. Prepare sd card with three partitions, boot, swap and root, create filesystems (vfat, swap, ext4)
3. mount /dev/mmcblk0p3 at /mnt/gentoo
4. Extract stage4 with:
Code:
tar <stage4-file> xvjpf --xattrs-include='*.*' --numeric-owner --strip-components=2

5. Edit /mnt/gentoo/etc/fstab replacing UUIDs with /dev/mmcblk0p{1,2,3}
6. remove content of /mnt/gentoo/boot
7. mount /dev/mmcblk0p1 at /mnt/gentoo/boot
8. Copy /boot files from the ssd /boot to /mnt/gentoo/boot
9. Edit /mnt/gentoo/boot/cmdline.txt replacing root=PARTUID with root=/dev/mmcblk0p3 (and rootdelay=60 with rootwait - does it matter?)
10. umount sd card partitions, move sd to rpi (3B) and power up.

On the system running of the ssd, ip of eth0 is configured as static and there's sshd running and I can ssh to it. When I power rpi of the sd card, it doesn't respond to ping.

(I do not have HDMI screen available atm.)

I suppose it doesn't boot. I have missed something, what could it be?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54358
Location: 56N 3W

PostPosted: Sat Feb 25, 2023 7:10 pm    Post subject: Reply with quote

erg_samowzbudnik,

That looks OK.

Either rootdelay=60 or rootwait should work.
rootdelay=60 is preferred until it works as the kernel will wait 60s they try to mount root, regardless of it being ready or not.
When its not ready, you get a useful panic message.

rootwait will wait forever, which is good when it works as it should be a lot less than 60 sec.

Does your kernel still have SD card support?

As you don't have a screen available, do you have a USB to serial port doda that will suit the Pi?
You need to see whats going one.

Is the disk lable MSDOS or EFI?
Both work with an up to date bootcode.bin
Is the bootable flag set on the boot partition. That used to matter?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pingtoo
l33t
l33t


Joined: 10 Sep 2021
Posts: 939
Location: Richmond Hill, Canada

PostPosted: Sat Feb 25, 2023 7:25 pm    Post subject: Reply with quote

erg_samowzbudnik,

Let's analyse this situation :?

Your premise is that moving ssd contents exactly as is to sd should be successful for only deference is rootfs location from kernel point of view.

In my mind your steps are correct and I agree with your idea, that only different should be rootfs location.

At the moment your test indicate boot from SD the result is not "pingable". So
  • Have you review if your network cable connected correctly?
  • Have you try to reseat your SD card to make sure its contact will?
  • Did you leave only SD and remove the SSD connect?
  • What was you PI led situation after power on?
  • Was ethernet socket leds lit after sometime you believe your boot sequence finish?
  • Have you review your /boot/config.txt?


eventually best way to diagnostic this situation is attach a display. so if you are not able to attach HTMI monitor, will you able to attach serial connection?

If you need further diagnostic, please share contents on SD
  • We need to know if boot partition have right type as in "fdisk -l /dev/mmcblk0"
  • content of boot patition as in "ls -l <mountpoint_of_/dev/mmc0blk0p1>"
  • content of config.txt
  • cpntent of cmdline.txt
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Sun Feb 26, 2023 2:33 am    Post subject: Reply with quote

I had a similar problem with Archlinux on Odroid-Xu4. I had change root=UUID to root=/dev/mmcblk0p1 as kernel parameter in Uboot and fstab. I think the Linux kernel do not recognise device files names at the early boot stage. Sometimes it was booting sometime not even with an initramfs. Put back root=UUID make it work.

I think that most filesystem tools create a UUID at the same time than the filesystem. It's always available to boot with.
_________________
Paul
Back to top
View user's profile Send private message
erg_samowzbudnik
Apprentice
Apprentice


Joined: 09 Sep 2011
Posts: 211
Location: European sticks

PostPosted: Sun Feb 26, 2023 7:41 am    Post subject: Reply with quote

Thank you! Got it to a 'pingable' state, even 'ssh-able'!

@NeddySeagoon: thanks for pointing out bootable flag thing, was not on, and for explaining rootwait/rootdelay. rootwait it is then

@pingtoo: thanks for making me check formatting of the SD card ... :

Code:
fdisk -l /dev/mmcblk0
Disk /dev/mmcblk0: 29.72 GiB, 31914983424 bytes, 62333952 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xfc0b0ec6

Device         Boot   Start      End  Sectors  Size Id Type
/dev/mmcblk0p1 *       2048   264191   262144  128M 83 Linux
/dev/mmcblk0p2       264192  4458495  4194304    2G 83 Linux
/dev/mmcblk0p3      4458496 62333951 57875456 27.6G 83 Linux



Changed it to:
Code:
fdisk -l /dev/mmcblk0
Disk /dev/mmcblk0: 29.72 GiB, 31914983424 bytes, 62333952 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xfc0b0ec6

Device         Boot   Start      End  Sectors  Size Id Type
/dev/mmcblk0p1 *       2048   264191   262144  128M  c W95 FAT32 (LBA)
/dev/mmcblk0p2       264192  4458495  4194304    2G 82 Linux swap / Solaris
/dev/mmcblk0p3      4458496 62333951 57875456 27.6G 83 Linux



And voila! little green eth led starts happily blinking :)

@Logicien: what works for me is root=PARTUUID in /boot/cmdline.txt, fstab seems happy with UUID's
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum