Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Architectures & Platforms Gentoo on ARM
  • Search

Moving system from ssd to sd card

Gentoo on all things ARM. Both 32 bit and 64 bit.
Tell about your hardware and CHOST.
Problems with crossdev targeting ARM hardware go here too.
Post Reply
  • Print view
Advanced search
5 posts • Page 1 of 1
Author
Message
erg_samowzbudnik
Apprentice
Apprentice
User avatar
Posts: 257
Joined: Fri Sep 09, 2011 3:10 pm
Location: European sticks

Moving system from ssd to sd card

  • Quote

Post by erg_samowzbudnik » Sat Feb 25, 2023 6:35 pm

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: Select all

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: Select all

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?
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56088
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Sat Feb 25, 2023 7:10 pm

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.
Top
pingtoo
Advocate
Advocate
User avatar
Posts: 2182
Joined: Fri Sep 10, 2021 8:37 pm
Location: Richmond Hill, Canada

  • Quote

Post by pingtoo » Sat Feb 25, 2023 7:25 pm

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
Top
Logicien
Veteran
Veteran
User avatar
Posts: 1555
Joined: Fri Sep 16, 2005 8:04 am
Location: Montréal

  • Quote

Post by Logicien » Sun Feb 26, 2023 2:33 am

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
Top
erg_samowzbudnik
Apprentice
Apprentice
User avatar
Posts: 257
Joined: Fri Sep 09, 2011 3:10 pm
Location: European sticks

  • Quote

Post by erg_samowzbudnik » Sun Feb 26, 2023 7:41 am

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: Select all

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: Select all

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
Top
Post Reply
  • Print view

5 posts • Page 1 of 1

Return to “Gentoo on ARM”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic