raspberry pi 4: Both Raspberry Pi OS and ubuntu boot with just a USB hard disk

11.jpg

1.png And now I'm changing to xfce4, which has multiple workspaces

This xfce4 change is https://qiita.com/tyokai/items/20e3fd2ebf36be6d0f7f

By the way, the startup scenery of only USB is as follows

At the beginning of the video, you can see that the micro SD card is not stuck. https://www.youtube.com/watch?v=hN6YwbfSHOw

Raspberry Pi 4 Raspberry Pi 4 is connected to ** ngff attached to SATA adapter ** through USB3 port.

In this USB3.0 + ngff environment

# hdparm -t /dev/sda2
/dev/sda2:
 Timing buffered disk reads: 972 MB in  3.00 seconds = 323.86 MB/sec
I get a great number



# fdisk -l /dev/sda
Disk /dev/sda: 59.6 GiB, 64023257088 bytes, 125045424 sectors
Device         Start       End   Sectors  Size Type
/dev/sda1   **2048**    526335    524288  256M Microsoft basic data
/dev/sda2     526336 115869695 115343360   55G Linux filesystem
/dev/sda3  115869696 125045390   9175695  4.4G Linux swap


# free
              total        used        free      shared  buff/cache   available
Mem:        1858340      432344      760548      201936      665448     1129788
Swap:       4587840           0     4587840
And memory 2G Raspberry Pi 4


# ./comment-out.bat /etc/dphys-swapfile
CONF_SWAPSIZE=0
so
# ps ax| grep  dphys-swapfile
 1229 pts/0    S+     0:00 grep dphys-swapfile
So dphys-swapfile is not working




I saw https://www.youtube.com/watch?v=o5DeLXaYNZM
The theme of Darwin's arrival is that animals are their own, even if they fall down.seedI will do my best to protect
Therefore, one day the human species must escape the Earth and migrate to another Earth-like planet X somewhere in this universe.
For that purpose, the current science will not do anything.
Engineering makes the idea of physics a substance
However, even if only humans are on Planet X, it is not like being on a rocky island in the sea. Human cannot live unless both animals and plants are entangled with bacteria. The earth is the life form https://www.youtube.com/watch?v=I8Np1s86qLA


Below is the main topic


2020-08-20-raspios-buster-armhf.Burn in img to micro SD card and start from now on
After that

The rest is just

https://www.tomshardware.com/how-to/boot-raspberry-pi-4-usb It's a malt whiskey that just follows and doesn't add anything

sudo apt update
sudo apt full-upgrade
sudo rpi-update

Reboot

sudo rpi-eeprom-update -d -a

Reboot

sudo raspi-config

After this**Original text**Please follow the


If you are not sure about the original text, please refer to the following as well.

IMG_20201014_185700646.jpg

IMG_20201014_185722793.jpg

IMG_20201014_185736683.jpg

IMG_20201014_185752360.jpg

IMG_20201014_185809430.jpg

IMG_20201014_185920643.jpg

IMG_20201014_185926319.jpg

IMG_20201014_185942319.jpg

IMG_20201014_190002870.jpg

What about this result?

# df
Filesys 1K-Block can be used can be used%Mount position
/dev/root         76136324 4160332 68065384    6% /
devtmpfs            823384       0   823384    0% /dev
tmpfs               955480       0   955480    0% /dev/shm
tmpfs               955480   16940   938540    2% /run
tmpfs                 5120       4     5116    1% /run/lock
tmpfs               955480       0   955480    0% /sys/fs/cgroup
/dev/sda1           258095   55024   203072   22% /boot
tmpfs               191096       0   191096    0% /run/user/1000



# cat /etc/fstab 
proc            /proc           proc    defaults          0       0
PARTUUID=44bd4930-01  /boot           vfat    defaults          0       2
PARTUUID=44bd4930-02  /               ext4    defaults,noatime  0       1
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that




root@raspberrypi:/home/pi# blkid /dev/sda1
/dev/sda1: LABEL_FATBOOT="boot" LABEL="boot" UUID="6284-658D" TYPE="vfat" PARTUUID="44bd4930-01"

root@raspberrypi:/home/pi# blkid /dev/sda2
/dev/sda2: LABEL="rootfs" UUID="3a324232-335f-4617-84c3-d4889840dc93" TYPE="ext4" PARTUUID="44bd4930-02"




root@raspberrypi:/home/pi# ls -l /
76 in total
drwxr-xr-x 2 root root 4096 August 20 19:36 bin
drwxr-xr-x 3 root root 3584 January 1 1970 boot
drwxr-xr-x 3 root root 4096 January 1 1970 boot.bak
drwxr-xr-x 18 root root 3880 October 14 18:57 dev
drwxr-xr-x 109 root root 4096 October 14 18:51 etc
drwxr-xr-x 3 root root 4096 August 20 19:31 home
drwxr-xr-x 17 root root 4096 October 14 18:39 lib
drwx------2 root root 16384 August 20 19:53 lost+found
drwxr-xr-x 3 root root 4096 October 14 18:56 media
drwxr-xr-x 2 root root 4096 August 20 19:26 mnt
drwxr-xr-x 4 root root 4096 August 20 19:38 opt
dr-xr-xr-x 172 root root 0 January 1 1970 proc
drwx------4 root root 4096 October 14 18:54 root
drwxr-xr-x 28 root root 840 October 14 19:11 run
drwxr-xr-x 2 root root 4096 August 20 19:36 sbin
drwxr-xr-x 2 root root 4096 August 20 19:26 srv
dr-xr-xr-x 12 root root 0 January 1 1970 sys
drwxrwxrwt 11 root root 4096 October 14 19:11 tmp
drwxr-xr-x 11 root root 4096 August 20 19:38 usr
drwxr-xr-x 11 root root 4096 August 20 19:54 var




root@raspberrypi:/home/pi# cat /boot/cmdline.txt 
console=serial0,115200 console=tty1 root=PARTUUID=44bd4930-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles


Everything is a nod result

What I did after this

1) Clone 80GB to 160GB with duplicator

2) Inflate with gparted

3)
systemctl stop dphys-swapfile
systemctl disable dphys-swapfile


cat /etc/fstab 
proc            /proc           proc    defaults          0       0
PARTUUID=44bd4930-01  /boot           vfat    defaults          0       2
PARTUUID=44bd4930-02  /               ext4    defaults,noatime  0       1
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that
/dev/sda3 		swap           swap    defaults,noatime 0 2



4)apt install xfce4


5)
apt install sddm 
sddm --example-config > /etc/sddm.conf 
systemctl enable sddm 


head /etc/sddm.conf
[Autologin]
# Whether sddm should automatically log back into sessions when they exit
Relogin=false
# Name of session file for autologin session (if empty try last logged in)
Session=
# Username for autologin session
User=pi





When making a clone, it will not work if it is UUID


# ./comment-out.bat /boot/cmdline.txt 
console=serial0,115200 console=tty1 root=/dev/sda2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles



# ./comment-out.bat /etc/fstab 
proc            /proc           proc    defaults          0       0
/dev/sda1  	/boot           vfat    defaults          0       2
/dev/sda2  	/               ext4    defaults,noatime  0       1
/dev/sda3 	swap           swap    defaults,noatime 0 2





Only those who understand ** Dangerous ** sdb to sdc clone script


./comment-out.bat ./rpi4-douki.bat-shuusei 
-------------------
umount /mb1
umount /mb2
umount /mc1
umount /mc2

fdisk -l

echo '----------------'
echo '----------------'
echo '----------------'

mkdir -p /mb1
mkdir -p /mb2
mkdir -p /mc1
mkdir -p /mc2

mount /dev/sdb1 /mb1
mount /dev/sdb2 /mb2
mount /dev/sdc1 /mc1
mount /dev/sdc2 /mc2

echo '----------------'
echo '----------------'
echo '----------------'

df

read X
echo $X

rsync -avHx --delete /mb1/  /mc1/
rsync -avHx --delete /mb2/  /mc2/

echo '----------------'
echo '----------------'
echo '----------------'

df

cat /mc1/cmdline.txt
cat /mc2/etc/fstab


rpi4 has no room to connect to HDMI on the monitor (already occupied by manjarolinux)

In ** vnc over ssh ** below 11.png In other words, ** xfce4 Raspberry Pi 4 ** is coming in manjar linux.

ubuntu (USB hard disk only)

Much better than Raspberry Pi OS

The instrument is as follows https://raspberry-akita.blogspot.com/2020/10/raspberry-pi-4-sdusb.html

How it works without a micro SD card ** https://youtu.be/DmvVvbR0oAA

Recommended Posts

raspberry pi 4: Both Raspberry Pi OS and ubuntu boot with just a USB hard disk
Ubuntu Server 20.04.1 Autoinstall with USB boot
Install Docker on Raspberry Pi 4 and Raspberry Pi OS 64bit
Just plug in the storage and power to run the Raspberry Pi (Ubuntu Server Edition)
Play down with Raspberry PI4 as a server. Part 2
Build a NAS with DLNA function at the speed of a second with Raspberry Pi and Docker Compose
Graph the sensor information of Raspberry Pi in Java and check it with a web browser