WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Moving SD install to USB  (Read 282 times)

Offline themagicm

  • Newbie
  • *
  • Posts: 8
Moving SD install to USB
« 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?   


Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 8149
Re: Moving SD install to USB
« Reply #1 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

Offline themagicm

  • Newbie
  • *
  • Posts: 8
Re: Moving SD install to USB
« Reply #2 on: August 04, 2020, 08:19:50 AM »
aaaah ok!  Thanks!  I'll give it a shot.

Offline themagicm

  • Newbie
  • *
  • Posts: 8
Re: Moving SD install to USB
« Reply #3 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?

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 618
Re: Moving SD install to USB
« Reply #4 on: August 04, 2020, 09:47:54 AM »
cmdline.txt on the first partition.

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 618
Re: Moving SD install to USB
« Reply #5 on: August 04, 2020, 09:48:32 AM »
cmdline3.txt on the first partition.

Offline themagicm

  • Newbie
  • *
  • Posts: 8
Re: Moving SD install to USB
« Reply #6 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.

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 618
Re: Moving SD install to USB
« Reply #7 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

Offline themagicm

  • Newbie
  • *
  • Posts: 8
Re: Moving SD install to USB
« Reply #8 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.

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 618
Re: Moving SD install to USB
« Reply #9 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


Offline themagicm

  • Newbie
  • *
  • Posts: 8
Re: Moving SD install to USB
« Reply #10 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!