Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: themagicm on August 04, 2020, 07:41:56 AM

Title: Moving SD install to USB
Post by: themagicm on August 04, 2020, 07:41:56 AM
I am playing around with my Pi4 which boots from USB.  I did a dd and copied my working SD image direct to USB.  When I boot from USB it drops to a prompt. 
/etc/fstab looks correct but the drives in there are not mounted.  I'm assuming somewhere there is something hardcoded and expecting mmnblk0px instead of sda/sdb?

What do I need to update to get it to boot off of usb?   

Title: Re: Moving SD install to USB
Post by: Rich on August 04, 2020, 08:14:49 AM
Hi themagicm
You need to add a  waitusb  boot code to your boot loaders config file:
http://tinycorelinux.net/faq.html#pendrives
Title: Re: Moving SD install to USB
Post by: themagicm on August 04, 2020, 08:19:50 AM
aaaah ok!  Thanks!  I'll give it a shot.
Title: Re: Moving SD install to USB
Post by: themagicm on August 04, 2020, 09:43:41 AM
aaaah ok!  Thanks!  I'll give it a shot.

Ok, I guess I'm an idiot.  I cannot seem to find which file to edit.  Is there a /boot directory that has the file in there?
Title: Re: Moving SD install to USB
Post by: Paul_123 on August 04, 2020, 09:47:54 AM
cmdline.txt on the first partition.
Title: Re: Moving SD install to USB
Post by: Paul_123 on August 04, 2020, 09:48:32 AM
cmdline3.txt on the first partition.
Title: Re: Moving SD install to USB
Post by: themagicm on August 04, 2020, 10:01:32 AM
cmdline.txt on the first partition.

Ok, I can find that if I manually mount the USB partitions.  Its as if the USB partitions are not being mounted which I believe is whats causing the problem.

If I do a mount -a, it doesnt mount whats in /etc/fstab.  But if I:

mount /dev/sda1
mount /dev/sda2

then I can see my partitions.
Title: Re: Moving SD install to USB
Post by: Paul_123 on August 04, 2020, 10:34:06 AM
The boot partition is purposely not mounted.   The raspberry pi reads that partition by itself, and then loads the initramfs and the linux kernel.  The kernel needs time for the USB subsystem to get loaded and for the drive to become recognisable.

I've seen some USB devices take up to 10 seconds to powerup and become recognisable, but 4-6sec is more common.   Add "waitusb=15" to the command line, then after boot, read dmesg, and look at the timestamp as to when the kernel sees /dev/sda2.......then you can lower your wait time to closer to that value.

Paul
Title: Re: Moving SD install to USB
Post by: themagicm on August 04, 2020, 10:39:59 AM
aaah ok.  I mounted /dev/sda1 and edited cmdline.txt and added waitusb=30.  Still no difference.  Drops to a prompt.
Title: Re: Moving SD install to USB
Post by: Paul_123 on August 04, 2020, 11:24:40 AM
cmdline3.txt   piCore11  has a separate command line file

rpi0-2 use cmdline.txt
rpi3-4 use cmdline3.txt

Title: Re: Moving SD install to USB
Post by: themagicm on August 04, 2020, 01:05:10 PM
LOL!  Of course!  It was right there infront of me.  Thanks!

That did it.

Now to install java 8.  Off to google.   Thanks for the assist!