View previous topic :: View next topic |
Author |
Message |
blubberbaer Tux's lil' helper
Joined: 15 Mar 2016 Posts: 81
|
Posted: Tue Oct 08, 2019 8:49 pm Post subject: [solved] Sakaki-Gentoo-Build on rpi4, system on hdd |
|
|
Hey forum,
i'm fiddling around with the sakaki gentoo image for an rpi4. I want to boot it from sd-card and mount the root file system from hdd.
I've managed to get the serial console up and running. It shows lots of stuff, but it stops here
Code: |
[ 2.772389] mmc0: SDHCI controller on fe340000.emmc2 [fe340000.emmc2] using ADMA
[ 2.784180] scsi 0:0:0:0: Direct-Access WDC WD50 00LPCX-24VHAT0 01.0 PQ: 0 ANSI: 6
[ 2.789729] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[ 2.794234] of_cfs_init
[ 2.797958] sd 0:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/466 GiB)
[ 2.797971] sd 0:0:0:0: [sda] 4096-byte physical blocks
[ 2.798596] sd 0:0:0:0: [sda] Write Protect is off
[ 2.799103] sd 0:0:0:0: [sda] Cache data unavailable
[ 2.801990] of_cfs_init: OK
[ 2.804937] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 2.851129] mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
[ 2.863689] sd 0:0:0:0: [sda] Optimal transfer size 4194304 bytes
[ 2.895308] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[ 2.928150] random: fast init done
[ 3.833281] sda: sda2 sda3
[ 3.847682] sd 0:0:0:0: [sda] Attached SCSI disk
[ 3.882260] mmc0: new ultra high speed DDR50 SDHC card at address 0001
[ 3.889999] mmc1: new high speed SDIO card at address 0001
[ 3.896899] mmcblk0: mmc0:0001 00000 29.8 GiB
[ 3.902641] mmcblk0: p1
[ 3.946325] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)
[ 3.954095] VFS: Mounted root (ext4 filesystem) readonly on device 8:2.
[ 4.003527] devtmpfs: mounted
[ 4.010040] Freeing unused kernel memory: 1088K
[ 4.014727] Run /sbin/init as init process
[ 6.590759] random: crng init done
|
showing only the last few lines ....
My controller of my hdd keeps blinking for a while but stops doing so after a few seconds. After I added a missing /dev directory on the root directory on hdd, devtmpfs was mounted. I forgot to rsync it from sdd to hdd, while copying the sakaki image from sd-card to hdd. This means, rpi4 knows about my rootfs beeing on the harddrive, doesn't it ?
well some more information:
Code: |
dwc_otg.lpm_enable=0 root=PARTUUID=b64acb16-bcd4-4186-bafb-3af036ad2b16 rootfstype=ext4 rootwait elevator=deadline fsck.repair=yes console=ttyAMA0,115200 console=tty1
|
from cmdline.txt which is on my sd-card
Code: |
PARTUUID=7a0c8bb0-01 /boot vfat defaults 0 2
PARTUUID=b64acb16-bcd4-4186-bafb-3af036ad2b16 / ext4 defaults,noatime 0 1
#/var/cache/swap/swap1 none swap sw 0 0
|
which is my /etc/fstab on my harddrive.
and finally the output of blkid
Code: |
/dev/sdc2: LABEL="PI4ROOT" UUID="23d5dc4a-81b3-4260-b200-10e95f7cf7ae" TYPE="ext4" PARTUUID="b64acb16-bcd4-4186-bafb-3af036ad2b16"
/dev/sdb1: SEC_TYPE="msdos" LABEL="boot" UUID="B176-EFEE" TYPE="vfat" PARTUUID="7a0c8bb0-01"
|
They are named sdc2 (hdd) and sdb1 (sd-card) because right now both are plugged into my laptop ...
Do you have any hints, on how to push my rpi4 a littly further than
Code: |
[ 6.590759] random: crng init done
|
Many thanks in advance ...
blubberbaer
Last edited by blubberbaer on Wed Oct 09, 2019 3:30 pm; edited 1 time in total |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54627 Location: 56N 3W
|
Posted: Tue Oct 08, 2019 9:10 pm Post subject: |
|
|
blubberbaer,
Are you trying to use a serial console all the way to a login prompt and beyond?
You will need to edit /etc/inittab on your Pi root partition for that.
It contains
Code: | # TERMINALS
#x1:12345:respawn:/sbin/agetty 38400 console linux
c1:12345:respawn:/sbin/agetty 38400 --noclear tty1 linux
c2:2345:respawn:/sbin/agetty 38400 tty2 linux
c3:2345:respawn:/sbin/agetty 38400 tty3 linux
c4:2345:respawn:/sbin/agetty 38400 tty4 linux
c5:2345:respawn:/sbin/agetty 38400 tty5 linux
c6:2345:respawn:/sbin/agetty 38400 tty6 linux
# SERIAL CONSOLES
#s0:12345:respawn:/sbin/agetty -L 115200 ttyS0 vt100
#s1:12345:respawn:/sbin/agetty -L 115200 ttyS1 vt100 |
So the serial consoles are commented out and the console is on tty1.
Uncomment the s0 line and point it to ttyAMA0 rather than ttyS0
There is another wart. The baud rate is/was tied to the CPU clock.
You may need in config.txt so the Pi baud rate does not change.
It will still change with thermal throttling, so to use a serial console, you need CPU cooling.
Code: | [ 3.954095] VFS: Mounted root (ext4 filesystem) readonly on device 8:2. |
device 8:2 is the kernel major and minor device numbers for /dev/sda2 so thats a good sign. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Sakaki Guru
Joined: 21 May 2014 Posts: 409
|
Posted: Wed Oct 09, 2019 11:14 am Post subject: |
|
|
Hi blubberbaer,
I run one of my RPi4s here that way myself (bootfs on microSD, SSD on USB via adaptor for rootfs) and it works pretty well.
The RPi4 doesn't seem to play nicely with all USB to HDD adaptors on its USB3 ports however, so, if you haven't already, try booting with your HDD adaptor on one of the USB2 ports instead, to see if that improves things. If it does, there are some quirks etc. you can apply to (hopefully) make USB3 useable. _________________ Regards,
sakaki |
|
Back to top |
|
|
blubberbaer Tux's lil' helper
Joined: 15 Mar 2016 Posts: 81
|
Posted: Wed Oct 09, 2019 3:29 pm Post subject: |
|
|
Hey Forum,
thanks for your replies ..... the problem is solved. the directory /proc was missing, too
So here is a small summary:
1) I've created a sd-card with sakakis gentoo image, following the guide on
https://github.com/sakaki-/gentoo-on-rpi-64bit
2) I've created two partitions on a harddrive:
Quote: |
Device Start End Sectors Size Type
/dev/sda2 2048 972677119 972675072 463.8G Linux filesystem
/dev/sda3 972677120 976773119 4096000 2G Linux swap
|
sda1 is missing, but I will add it, when booting from harddrive is functional, to use it as my /boot-partition.
3) I've mounted both sd-card rootfs and sda2 on two different mountpoints. Modifying the hints from
https://djlab.com/2013/02/cloning-a-live-linux-system-with-rsync-over-ssh/ i've copied the sd-card rootfs content to my sda2-partition.
Quote: |
rsync -aHxv --numeric-ids --progress /mnt/<mp-sd-card-rootfs>/ /mnt/<mp-sda2>/ --exclude=/dev --exclude=/proc --exclude=/sys --exclude=/tmp
|
4) Using gparted i deleted the rootfs-partition of my sd-card to make shure it will not interfere.
5) I've modified /boot/cmdline.txt
Quote: |
dwc_otg.lpm_enable=0 root=PARTUUID=<SOMEUUID_SDA2> rootfstype=ext4 rootwait elevator=deadline fsck.repair=yes console=ttyAMA0,115200 console=tty1 boot_delay=5
|
the PARTUUID belongs to sda2 and can be found with blkid.
6) I've modified /etc/fstab on my sda2-partition
Quote: |
PARTUUID=<SOMEUUID_SDCARD_BOOT> /boot vfat defaults 0 2
PARTUUID=<SOMEUUID_SDA2> / ext4 defaults,noatime 0 1
#/var/cache/swap/swap1 none swap sw 0 0
|
Booting failed ;-(
Step 3) is not quite correct. /dev, /proc, /sys, /tmp - dirs were not created thus the pi4 did not boot. After creating them, everything went fine ....
BTW, the usb2sata adapter i'm using is from renkforce, Manufacturer no.: RF-3999093 .
Concerning serial console:
My config.txt contains the following lines:
Quote: |
enable_uart=1
dtoverlay=disable-bt
|
My inittab
Quote: |
s0:12345:respawn:/sbin/agetty -L 115200 ttyAMA0 vt100
|
Thats did the trick, didn't try the hint from NeddySeagoon.
Regards and many many thanks,
blubberbaer |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|