WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

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

Offline themagicm

  • Newbie
  • *
  • Posts: 8
Moving SD install to USB
« on: August 04, 2020, 10: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: 11591
Re: Moving SD install to USB
« Reply #1 on: August 04, 2020, 11: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, 11: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, 12:43:41 PM »
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: 1243
Re: Moving SD install to USB
« Reply #4 on: August 04, 2020, 12:47:54 PM »
cmdline.txt on the first partition.

Offline Paul_123

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

Offline themagicm

  • Newbie
  • *
  • Posts: 8
Re: Moving SD install to USB
« Reply #6 on: August 04, 2020, 01:01:32 PM »
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: 1243
Re: Moving SD install to USB
« Reply #7 on: August 04, 2020, 01:34:06 PM »
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, 01:39:59 PM »
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: 1243
Re: Moving SD install to USB
« Reply #9 on: August 04, 2020, 02:24:40 PM »
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, 04: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!