scollins15
Posts: 15
Joined: Fri Aug 30, 2013 3:12 pm

Pi 3B+ won't boot (added 4 MiB block between boot and rootfs)

Tue Jul 31, 2018 4:21 pm

I have struggled with using the Stretch Lite image from the Raspberry Pi website with the Pi 3 B+. Some background in the past there were issues with SD card corruption on the Pi 1 which I tried to limit by having a read only partition. To do this correctly I needed to add a 4MB block between the end of the boot and rootfs partition. Else it is possible inadvertant writes may happen in a read only partition when trying to write to a neighboring read/write partition.

In the past I have been able to take the stock image from raspberry pi and put it on an SD card. Which obviously still works and boots in the Pi 3B+. I would then zip up each partition as follows:

Code: Select all

sudo dd if=/dev/sdb1 of=bootPartition
sudo dd if=/dev/sdb2 of=rootPartition
Next using fdisk in Linux I would create a new SD card with 2 partitions as follows:

Code: Select all

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): 
Using default response p
Partition number (1-4, default 1): 
Using default value 1
First sector (2048-31116287, default 2048): 8192
Last sector, +sectors or +size{K,M,G} (8192-31116287, default 31116287): 131072

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): c
Changed system type of partition 1 to c (W95 FAT32 (LBA))

Command (m for help): n
Partition type:
   p   primary (1 primary, 0 extended, 3 free)
   e   extended
Select (default p): 
Using default response p
Partition number (1-4, default 2): 
Using default value 2
First sector (2048-31116287, default 2048): 139264
Last sector, +sectors or +size{K,M,G} (139264-31116287, default 31116287): 7632895

Command (m for help): t
Partition number (1-4): 2 
Hex code (type L to list codes): 83

Command (m for help): p

Disk /dev/sdb: 15.9 GB, 15931539456 bytes
64 heads, 32 sectors/track, 15193 cylinders, total 31116288 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
Disk identifier: 0x4d3ee428

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            8192      131072       61440+   c  W95 FAT32 (LBA)
/dev/sdb2          139264     7632895     3746816   83  Linux

Command (m for help):w 
Once I have my card formatted with the correct sized and spaced partitions I use the following to write the data from the stock image to the SD card.

Code: Select all

sudo dd if=/bootPartition of=/dev/sdb1
sudo dd of=/rootPartition if=/dev/sdb2
The result is the SD card will not boot completely in the RPi 3B+. The following error is returned:

Code: Select all

kernel panic-not syncing: VFS: unable to mount root fs on unknown-block(179,2)
I assume I have forgotten a step or part of my process from the past...Maybe I am getting old and forgetful!

Scot

epoch1970
Posts: 3783
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Pi 3B+ won't boot (added 4 MiB block between boot and rootfs)

Tue Jul 31, 2018 5:37 pm

scollins15 wrote:
Tue Jul 31, 2018 4:21 pm
sudo dd of=/rootPartition if=/dev/sdb2
A little eyestrain, maybe?
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

scollins15
Posts: 15
Joined: Fri Aug 30, 2013 3:12 pm

Re: Pi 3B+ won't boot (added 4 MiB block between boot and rootfs)

Wed Aug 01, 2018 12:29 pm

epoch1970 wrote:
Tue Jul 31, 2018 5:37 pm
scollins15 wrote:
Tue Jul 31, 2018 4:21 pm
sudo dd of=/rootPartition if=/dev/sdb2
A little eyestrain, maybe?
Sorry, typing error on my part. I did in fact have them correct when I executed the command. I have tried this several times with no luck. Thanks

fbe
Posts: 526
Joined: Thu Aug 17, 2017 9:08 pm

Re: Pi 3B+ won't boot (added 4 MiB block between boot and rootfs)

Wed Aug 01, 2018 6:33 pm

Did you verify that the output of

Code: Select all

lsblk -o NAME,PARTUUID
matches with the contents of cmdline.txt on your new boot partition and /etc/fstab on your new root partition?
Last edited by fbe on Thu Aug 02, 2018 7:28 pm, edited 1 time in total.

scollins15
Posts: 15
Joined: Fri Aug 30, 2013 3:12 pm

Re: Pi 3B+ won't boot (added 4 MiB block between boot and rootfs)

Wed Aug 01, 2018 6:57 pm

The solution that worked for me was to change cmdline.txt to have root=/dev/mmcblk0 and to change the fstab file to have that as well. Both were using a UUID that was defined in the cmdline.txt file and for some reason or another it wouldn't boot completely. Although it did boot prior to moving the partitions with that same setting using the UUID.

Sounds like you were on to it...Thanks for the input.

DirkS
Posts: 9961
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Pi 3B+ won't boot (added 4 MiB block between boot and rootfs)

Wed Aug 01, 2018 8:10 pm

scollins15 wrote:
Wed Aug 01, 2018 6:57 pm
The solution that worked for me was to change cmdline.txt to have root=/dev/mmcblk0 and to change the fstab file to have that as well. Both were using a UUID that was defined in the cmdline.txt file and for some reason or another it wouldn't boot completely. Although it did boot prior to moving the partitions with that same setting using the UUID.

Sounds like you were on to it...Thanks for the input.
Have you tried using PARTUUID?

fbe
Posts: 526
Joined: Thu Aug 17, 2017 9:08 pm

Re: Pi 3B+ won't boot (added 4 MiB block between boot and rootfs)

Wed Aug 01, 2018 8:20 pm

As I understand it - yes, but with invalid values. gparted created new partitions and the old values from the original Raspbian image didn't work anymore.

DirkS
Posts: 9961
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Pi 3B+ won't boot (added 4 MiB block between boot and rootfs)

Wed Aug 01, 2018 9:58 pm

fbe wrote:
Wed Aug 01, 2018 8:20 pm
As I understand it - yes, but with invalid values. gparted created new partitions and the old values from the original Raspbian image didn't work anymore.
They should show up with 'sudo blkid'

scollins15
Posts: 15
Joined: Fri Aug 30, 2013 3:12 pm

Re: Pi 3B+ won't boot (added 4 MiB block between boot and rootfs)

Thu Aug 02, 2018 3:20 pm

DirkS wrote:
Wed Aug 01, 2018 8:10 pm
scollins15 wrote:
Wed Aug 01, 2018 6:57 pm
The solution that worked for me was to change cmdline.txt to have root=/dev/mmcblk0 and to change the fstab file to have that as well. Both were using a UUID that was defined in the cmdline.txt file and for some reason or another it wouldn't boot completely. Although it did boot prior to moving the partitions with that same setting using the UUID.

Sounds like you were on to it...Thanks for the input.
Have you tried using PARTUUID?
The original image file from the Raspberry Pi site used had the following:

Code: Select all

$ cat /boot/cmdline.txt 
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=4d3ee428-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet init=/usr/lib/raspi-config/init_resize.sh

$ cat /etc/fstab
proc            /proc           proc    defaults          0       0
PARTUUID=4d3ee428-01  /boot           vfat    defaults          0       2
PARTUUID=4d3ee428-02  /               ext4    defaults,noatime  0       1
I stated this incorrectly when I said it was using the UUID, when in fact it was the PARTUUID as stated above. Anyhow this didn't work.
DirkS wrote:
fbe wrote:
Wed Aug 01, 2018 8:20 pm
As I understand it - yes, but with invalid values. gparted created new partitions and the old values from the original Raspbian image didn't work anymore.
They should show up with 'sudo blkid'
This was the smoking gun. See output below:

Code: Select all

$ sudo blkid
/dev/mmcblk0: PTUUID="000a5026" PTTYPE="dos"
/dev/mmcblk0p1: LABEL="boot" UUID="3725-1C05" TYPE="vfat" PARTUUID="000a5026-01"
/dev/mmcblk0p2: LABEL="rootfs" UUID="fd695ef5-f047-44bd-b159-2a78c53af20a" TYPE="ext4" PARTUUID="000a5026-02"
Thanks @DirkS it is all better now :mrgreen:

DirkS
Posts: 9961
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Pi 3B+ won't boot (added 4 MiB block between boot and rootfs)

Thu Aug 02, 2018 5:57 pm

scollins15 wrote:
Thu Aug 02, 2018 3:20 pm
Thanks @DirkS it is all better now :mrgreen:
Great!

User avatar
aqk
Posts: 8
Joined: Wed Jan 13, 2016 12:41 am

Re: Pi 3B+ won't boot (added 4 MiB block between boot and rootfs)

Fri Aug 03, 2018 2:04 am

I'm currently having boot problems also ( see my thread here)
Attached is a snapshot of the Gparted info. Isn't ~400Meg of free area kinda low for a linux rootfs partition?
.....
Image

User avatar
rpdom
Posts: 15370
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Pi 3B+ won't boot (added 4 MiB block between boot and rootfs)

Fri Aug 03, 2018 6:51 am

aqk wrote:
Fri Aug 03, 2018 2:04 am
Isn't ~400Meg of free area kinda low[/b] for a linux rootfs partition?
Perfectly normal for a freshly created Raspbian SD card which hasn't completed its first boot yet. On the first (successful) boot the filesystem automatically gets expanded to use all of the unused space on the card.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23874
Joined: Sat Jul 30, 2011 7:41 pm

Re: Pi 3B+ won't boot (added 4 MiB block between boot and rootfs)

Fri Aug 03, 2018 9:55 am

aqk wrote:
Fri Aug 03, 2018 2:04 am
I'm currently having boot problems also ( see my thread here)
Attached is a snapshot of the Gparted info. Isn't ~400Meg of free area kinda low for a linux rootfs partition?
.....
Image
Please don't hijack other threads with new questions. Simply start a new thread, and keep to that thread rather than duplicating over multiple threads.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

Return to “Troubleshooting”