MacsandaPi
Posts: 103
Joined: Tue Dec 30, 2014 7:44 pm

Booting into external HD stalls at splash screen

Sun Mar 18, 2018 10:41 pm

I have a first-generation Pi 2B and want to run the OS from an attached USB hard drive. I followed the steps in this post from RonR: viewtopic.php?f=29&t=193157 and was successful in getting it to run for the first few reboots.

However, now it boots into the "Welcome to Raspberry Pi Desktop" splash screen and then stalls after the splash screen disappears. The boot process stops with a small cursor blinking in the upper left of a black screen and the desktop never appears.

Other details: the external USB has its own power supply. The OS is the latest (Stretch 2018-03-13).

Help please.

RonR
Posts: 1199
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Booting into external HD stalls at splash screen

Mon Mar 19, 2018 12:21 am

Did you make any changes or do any updates after it was working properly? Some changes and updates require that the SD card's boot partition (/dev/mmcblk0p1) be mounted on /boot.

You might want to consider using usb-boot for future USB installations:

viewtopic.php?f=29&t=196778

MacsandaPi
Posts: 103
Joined: Tue Dec 30, 2014 7:44 pm

Re: Booting into external HD stalls at splash screen

Mon Mar 19, 2018 2:02 am

Did you make any changes or do any updates after it was working properly? Some changes and updates require that the SD card's boot partition (/dev/mmcblk0p1) be mounted on /boot.
Yes, after the initial successful boot, I made configuration changes (localization, interface, memory split, etc,) that required rebooting. How would one know if the SD's boot partition should be mounted on /boot?
You might want to consider using usb-boot for future USB installations:

viewtopic.php?f=29&t=196778
I wanted to try usb-boot, but I couldn't find an application to open it. I was using Linux Mint for all of the initial preparations of the hard drive and SD card. When I tried to open the usb-boot file, I got a pop-up message saying, "Could not open usb-boot. Archive type not supported."

RonR
Posts: 1199
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Booting into external HD stalls at splash screen

Mon Mar 19, 2018 2:13 am

MacsandaPi wrote:
Mon Mar 19, 2018 2:02 am
How would one know if the SD's boot partition should be mounted on /boot?
It's safe to always mount the SD's boot partition on /boot. usb-boot makes the appropriate change to fstab to mount it on each startup.
I wanted to try usb-boot, but I couldn't find an application to open it.
usb-boot is contained in the usb-boot.zip archive file. It's a standard ZIP file. Under Linux, unzip will extract usb-boot from usb-boot.zip.

MacsandaPi
Posts: 103
Joined: Tue Dec 30, 2014 7:44 pm

Re: Booting into external HD stalls at splash screen

Mon Mar 19, 2018 5:51 pm

I thought of one more detail that might be relevant: available space on the external hard drive.

The drive I'm using has a capacity of 160 GB. I used GParted to put one partition on the drive and formatted it as Ext4. I then used Etcher to flash the Raspbian OS zip file to the hard drive. This resulted in two volumes on the drive: rootfs and boot. When I ran

Code: Select all

df -h
it showed something like 5 GB of space used, but the remaining supposedly available 155 GB weren't identified.

Could the problem of the boot sequence stalling after several reboots be due to insufficient space on the hard drive (even though there should be well over 100 GB available)?

It should be obvious that I don't know what I'm doing with this attempt to run the Pi from an external hard drive...hence my appeal for help, guidance, direction as a beginner. Thank you.

RonR
Posts: 1199
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Booting into external HD stalls at splash screen

Mon Mar 19, 2018 6:27 pm

MacsandaPi wrote:
Mon Mar 19, 2018 5:51 pm
The drive I'm using has a capacity of 160 GB. I used GParted to put one partition on the drive and formatted it as Ext4. I then used Etcher to flash the Raspbian OS zip file to the hard drive. This resulted in two volumes on the drive: rootfs and boot. When I ran

Code: Select all

df -h
it showed something like 5 GB of space used, but the remaining supposedly available 155 GB weren't identified.

Could the problem of the boot sequence stalling after several reboots be due to insufficient space on the hard drive (even though there should be well over 100 GB available)?
Partitioning and formatting any USB drive or SD card before writing a Raspbian image to it is unnecessary and accomplishes nothing since the Raspbian image overwrites everything (including the partition table). The initial size of the partitions and the filesystem formats will be those defined by the Raspbian image. You need to run raspi-config to expand the root filesystem size to use the full capacity of the drive.

Note that raspi-config does not know how to resize Raspbian when it's running from a USB drive.

I've posted a fix-rc.zip archive (download/file.php?id=19959) that contains two solutions to this problem:

1. raspi-config-usb makes a temporary copy of raspi-config, patches it to work, runs the temporary copy, then deletes the temporary copy.

2. patch-rc copies raspi-config to raspi-config-original and patches raspi-config to work.

Once you're running from the USB drive, run raspi-config-usb to expand the root filesystem to the full capacity of the drive.
MacsandaPi wrote:
Mon Mar 19, 2018 5:51 pm
It should be obvious that I don't know what I'm doing with this attempt to run the Pi from an external hard drive...hence my appeal for help, guidance, direction as a beginner. Thank you.
It's certainly a bit confusing and can be overwhelming to a newcomer, which is why I posted usb-boot to make it simple:

viewtopic.php?f=29&t=196778

MacsandaPi
Posts: 103
Joined: Tue Dec 30, 2014 7:44 pm

Re: Booting into external HD stalls at splash screen

Mon Mar 19, 2018 8:13 pm

Thank you for taking the time to reply. In fact, it was your post (viewtopic.php?f=29&t=196778) that prompted me to try this external hard drive with my early Pi 2B and Stretch.

It seems that I now need to use your usb-boot script to solve the problem I'm having. I was able to open the usb-boot.zip file using the "unzip" command, but now what?

1. How do I actually use usb-boot? Run as a bash script after making it executable with chmod? Then the run command would be?

Code: Select all

./usb-boot.sh
2. When is the usb-boot script to be run? After plugging in both the SD card (with Stretch on it) and the USB hard drive?

3. Similar questions regarding the use of fix-rc.zip archive. How to use it and ...when? I'm very uncertain about how to use fix-rc and when it's to be run...right after first boot into Stretch? Before the first boot? Are the two solutions dealt with by fix-rc accomplished by running the script only once?

Sorry I need this degree of hand-holding, but I'm not very linux-savvy. However, a step-by-step description of how and when to use usb-boot and fix-rc scripts would likely be a welcome addition to your post (viewtopic.php?f=29&t=196778) by other newbies too.

Anyway, thank you again for trying to help me get Stretch running reliably on the external hard drive. Your efforts are really appreciated.

RonR
Posts: 1199
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Booting into external HD stalls at splash screen

Mon Mar 19, 2018 8:39 pm

1. Using Etcher, write a fresh copy of Raspbian to an SD card and boot it.

2. Connect only the USB HD to the Pi

3. Run usb-boot (extracted from usb-boot.zip):

Code: Select all

sudo ./usb-boot
4. When prompted, select Yes to 'Replicate BOOT/ROOT contents from /dev/mmcblk0 to /dev/sda?'

5. When usb-boot completes, reboot:

Code: Select all

sudo shutdown -r now
6. You should now be running from the USB HD.

7. Run raspi-config-usb (extracted from fix-rc.zip):

Code: Select all

sudo ./raspi-config-usb
8. Select '7 Advanced Options' followed by ' A1 Expand Filesystem'

9. Reboot

10. You should now be running from the USB HD with the root partition using all available HD space.

MacsandaPi
Posts: 103
Joined: Tue Dec 30, 2014 7:44 pm

Re: Booting into external HD stalls at splash screen

Tue Mar 20, 2018 12:10 am

Many thanks for providing good detail on using your usb-boot and fix-rc scripts. They directions you provided were very helpful! I doubt that I would have figured out how to use the script on my own.

I ran usb-boot and it completed with the following message:
BOOT/ROOT contents replicated from /dev/mmcblk0 to /dev/sda
./usb-boot: line 191 [: 971da60b: unary operator expected]
I then rebooted, but after the reboot, the process stalled with the screen showing four raspberry icons at the top left and the following two lines:.
[4.410396] sd 0:0:0:0: [sda] No Caching mode page found
[4.416004] sd 0:0:0:0: [sda] Assuming drive cache: write through
A blinking cursor follows on the next line, but nothing progresses beyond that point..

Do the screen messages offer any clue to you as to the problems that are preventing the system to boot into the USB drive? Or is it time for me to give up on this project? :(

RonR
Posts: 1199
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Booting into external HD stalls at splash screen

Tue Mar 20, 2018 1:53 am

MacsandaPi wrote:
Tue Mar 20, 2018 12:10 am
I ran usb-boot and it completed with the following message:
BOOT/ROOT contents replicated from /dev/mmcblk0 to /dev/sda
./usb-boot: line 191 [: 971da60b: unary operator expected]
I just downloaded and ran usb-boot and don't get any errors. There is the possibility of an obscure case where line 191 could produce that message due to the lack of quotes around a variable on that line, but no real problem should result from that message being displayed. I've uploaded a new usb-boot.zip file if you wish to give it another try.
MacsandaPi wrote:
Tue Mar 20, 2018 12:10 am
I then rebooted, but after the reboot, the process stalled with the screen showing four raspberry icons at the top left and the following two lines:.
[4.410396] sd 0:0:0:0: [sda] No Caching mode page found
[4.416004] sd 0:0:0:0: [sda] Assuming drive cache: write through
A blinking cursor follows on the next line, but nothing progresses beyond that point..

Do the screen messages offer any clue to you as to the problems that are preventing the system to boot into the USB drive?
I run my Pi's headless here via SSH, so I can't test with a monitor. I did load up a Raspbian Desktop image and ran it on a USB drive, accessing it via VNC, and didn't find any problems. I also noticed that the root partition is 100% full. If you log in via SSH and run raspi-config-usb, you might be better off.
MacsandaPi wrote:
Tue Mar 20, 2018 12:10 am
Or is it time for me to give up on this project? :(
I'm rapidly running out of ideas and haven't received any reports of problems from others to date.

MacsandaPi
Posts: 103
Joined: Tue Dec 30, 2014 7:44 pm

Re: Booting into external HD stalls at splash screen

Tue Mar 20, 2018 4:46 pm

Progress, of sorts:

1. I was able to boot into the external hard drive after editing cmdline.txt with the root=PARTUUID number of the hard drive.

2. I then ran your raspi-config-usb script to expand the filesystem and then rebooted.

3. The “Welcome to the Raspberry Pi Desktop” splash screen appeared but instead of progressing to the desktop, “pi@raspberrypi:~$ “ with a flashing blinking cursor is shown in the upper left corner of the screen, as if waiting for a command from me to proceed. I tried “startx”, and lots of text scrolled by, but ended with “pi@raspberrypi:~$” and blinking cursor as before.

Any suggestions as to how should I proceed to get the desktop to display? There must be a terminal command that would work, but I don't know it. "Startx" used to work with earlier versions of Raspbian, but apparently not with Stretch.

RonR
Posts: 1199
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Booting into external HD stalls at splash screen

Tue Mar 20, 2018 5:02 pm

MacsandaPi wrote:
Tue Mar 20, 2018 4:46 pm
Any suggestions as to how should I proceed to get the desktop to display?
I don't use Raspbian Desktop other than occasional testing, and then I access it over the LAN from my PC using VNC (no keyboard, mouse, or monitor attached to the Pi). In this environment, the desktop displays normally for me running from either an SD card or a USB drive. Hopefully, someone more familiar with using Raspbian Desktop will chime in with some suggestions.

Return to “Beginners”