LoginSignup
0
0

raspberry pi 5 を USBハードディスクに直接焼いたraspberry pi OSから起動 ; ubuntu も同じ手法でいけます

Last updated at Posted at 2023-12-26

ケースがやっと手に入り 今は

1.jpg

1.png

2.jpg

実際の運用は 転落しても壊れないように

11.jpg

底面から見ると
2.jpg

電源にご注意

5V 3A電源で ubuntu を立ち上げようとすると

1.jpg

で先に進めないので 5A電源をもっとくのが無難です(他のlinuxで修正する方法はありますけどねー)

chrome がこの速さです

ファンやラズパイケース到着前は

r5.jpg

スクリーンショット_2023-12-27_06-34-34.png


https://www.raspberrypi.com/software/

Raspberry Pi Imager

SDカードではなく このUSBハードディスクに 直接焼付ました

なんと
これだけでUSBハードディスクから 立ち上がります


もう 
https://www.pc-koubou.jp/magazine/52103
に かかれてるような

SD Card Copier」を 使わなくていいです


1.jpg

IMG_20231227_053248_copy_1024x768.jpg

 update は

IMG_20231227_053417_copy_1024x768.jpg

自分のいつものLINUXとくらべても 十二分に早い

X-1)日本語入力

# aptitude search fcitx-mozc
i   fcitx-mozc                      - Mozc engine for fcitx - Client of the Moz
p   fcitx-mozc:armhf                - Mozc engine for fcitx - Client of the Moz
i A fcitx-mozc-data                 - Mozc input method - data files for fcitx 
v   fcitx-mozc-data:armhf           -                 


X-2)更新されるパッケージがありません

aptitude upgrade
インストール・削除・更新されるパッケージがありません。

X-3) fdisk -l

Disk /dev/ram0: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 16384 bytes
I/O size (minimum/optimal): 16384 bytes / 16384 bytes


Disk /dev/ram1: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 16384 bytes
I/O size (minimum/optimal): 16384 bytes / 16384 bytes


Disk /dev/ram2: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 16384 bytes
I/O size (minimum/optimal): 16384 bytes / 16384 bytes


Disk /dev/ram3: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 16384 bytes
I/O size (minimum/optimal): 16384 bytes / 16384 bytes


Disk /dev/ram4: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 16384 bytes
I/O size (minimum/optimal): 16384 bytes / 16384 bytes


Disk /dev/ram5: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 16384 bytes
I/O size (minimum/optimal): 16384 bytes / 16384 bytes


Disk /dev/ram6: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 16384 bytes
I/O size (minimum/optimal): 16384 bytes / 16384 bytes


Disk /dev/ram7: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 16384 bytes
I/O size (minimum/optimal): 16384 bytes / 16384 bytes


Disk /dev/ram8: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 16384 bytes
I/O size (minimum/optimal): 16384 bytes / 16384 bytes


Disk /dev/ram9: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 16384 bytes
I/O size (minimum/optimal): 16384 bytes / 16384 bytes


Disk /dev/ram10: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 16384 bytes
I/O size (minimum/optimal): 16384 bytes / 16384 bytes


Disk /dev/ram11: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 16384 bytes
I/O size (minimum/optimal): 16384 bytes / 16384 bytes


Disk /dev/ram12: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 16384 bytes
I/O size (minimum/optimal): 16384 bytes / 16384 bytes


Disk /dev/ram13: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 16384 bytes
I/O size (minimum/optimal): 16384 bytes / 16384 bytes


Disk /dev/ram14: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 16384 bytes
I/O size (minimum/optimal): 16384 bytes / 16384 bytes


Disk /dev/ram15: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 16384 bytes
I/O size (minimum/optimal): 16384 bytes / 16384 bytes


Disk /dev/sda: 119.24 GiB, 128035676160 bytes, 250069680 sectors
Disk model: Generic         
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x3b8d1a25

Device     Boot   Start       End   Sectors  Size Id Type
/dev/sda1          8192   1056767   1048576  512M  c W95 FAT32 (LBA)
/dev/sda2       1056768 125045423 123988656 59.1G 83 Linux

X-4)cat /etc/fstab

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


## X-3) blkid

#blkid /dev/sda1
/dev/sda1: LABEL_FATBOOT="bootfs" LABEL="bootfs" UUID="EF6E-C078" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="3b8d1a25-01"
root@raspberrypi:/home/u5

blkid /dev/sda2

/dev/sda2: LABEL="rootfs" UUID="4aa56689-dcb4-4759-90e6-179beae559ac" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="3b8d1a25-02"



X-10) ubuntu

おなじく USBハードディスクに直接焼きます

u1.jpg

しかし
u2.jpg

とありますが、現在はうまくいきません
ibus-mozc いれないといけないかも?

予想どうりでした

インスト時は

IMG_20231229_115650.jpg
 
と MOZC関係がはいってません
それで ibus-mozc を インストールしました。

ibus-setup して調整し、再ログインした途端

IMG_20231229_115929.jpg

と日本語OKとなりました

ubuntuでは


root@ppppp:/home/u5# fdisk -l
Disk /dev/loop0: 4 KiB, 4096 bytes, 8 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 /dev/loop1: 68.53 MiB, 71860224 bytes, 140352 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 /dev/loop2: 226.68 MiB, 237686784 bytes, 464232 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 /dev/loop3: 475.09 MiB, 498163712 bytes, 972976 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 /dev/loop4: 91.69 MiB, 96141312 bytes, 187776 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 /dev/loop5: 9.49 MiB, 9953280 bytes, 19440 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 /dev/loop6: 35.52 MiB, 37240832 bytes, 72736 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 /dev/loop7: 416 KiB, 425984 bytes, 832 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 /dev/sda: 223.57 GiB, 240057409536 bytes, 468862128 sectors
Disk model: 240C            
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x1a9550ca

Device     Boot   Start       End   Sectors   Size Id Type
/dev/sda1  *       2048   1050623   1048576   512M  c W95 FAT32 (LBA)
/dev/sda2       1050624 312581774 311531151 148.5G 83 Linux


Disk /dev/loop8: 69.07 MiB, 72429568 bytes, 141464 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


----------------


# cat /etc/fstab 
LABEL=writable	/	ext4	discard	0	1
LABEL=system-boot	/boot/firmware	vfat	defaults	0	1


-------------

# df
Filesystem     1K-blocks    Used Available Use% Mounted on
tmpfs             813048    3484    809564   1% /run
/dev/sda2      153189240 7309912 139553908   5% /
tmpfs            4065224       0   4065224   0% /dev/shm
tmpfs               5120      12      5108   1% /run/lock
/dev/sda1         516204  108181    408024  21% /boot/firmware
tmpfs             813044    2516    810528   1% /run/user/1000


---------

# ls /boot/firmware/
README                        boot.scr.bak      initrd.img.bak
bcm2710-rpi-2-b.dtb           bootcode.bin      overlays
bcm2710-rpi-2-b.dtb.bak       bootcode.bin.bak  start.elf
bcm2710-rpi-3-b-plus.dtb      cmdline.txt       start.elf.bak
bcm2710-rpi-3-b-plus.dtb.bak  config.txt        start4.elf
bcm2710-rpi-3-b.dtb           fixup.dat         start4.elf.bak
bcm2710-rpi-3-b.dtb.bak       fixup.dat.bak     start4cd.elf
bcm2710-rpi-cm3.dtb           fixup4.dat        start4cd.elf.bak
bcm2710-rpi-cm3.dtb.bak       fixup4.dat.bak    start4db.elf
bcm2710-rpi-zero-2-w.dtb      fixup4cd.dat      start4db.elf.bak
bcm2710-rpi-zero-2-w.dtb.bak  fixup4cd.dat.bak  start4x.elf
bcm2710-rpi-zero-2.dtb        fixup4db.dat      start4x.elf.bak
bcm2710-rpi-zero-2.dtb.bak    fixup4db.dat.bak  start_cd.elf
bcm2711-rpi-4-b.dtb           fixup4x.dat       start_cd.elf.bak
bcm2711-rpi-4-b.dtb.bak       fixup4x.dat.bak   start_db.elf
bcm2711-rpi-400.dtb           fixup_cd.dat      start_db.elf.bak
bcm2711-rpi-400.dtb.bak       fixup_cd.dat.bak  start_x.elf
bcm2711-rpi-cm4.dtb           fixup_db.dat      start_x.elf.bak
bcm2711-rpi-cm4.dtb.bak       fixup_db.dat.bak  uboot_rpi_3.bin
bcm2711-rpi-cm4s.dtb          fixup_x.dat       uboot_rpi_4.bin
bcm2711-rpi-cm4s.dtb.bak      fixup_x.dat.bak   uboot_rpi_arm64.bin
bcm2712-rpi-5-b.dtb           hat_map.dtb       vmlinuz
bcm2712-rpi-5-b.dtb.bak       hat_map.dtb.bak   vmlinuz.bak
boot.scr                      initrd.img


--------------

# cat /boot/firmware/README 
==================
The Boot Partition
==================

This file belongs to the boot partition of the Ubuntu Server for Raspberry Pi.
This partition is usually mounted at /boot/firmware at runtime (in contrast to
RaspiOS where it is typically mounted on /boot).

The files on this partition are described in the following sections, firstly
the user-editable files, followed by non-user-editable.


config.txt
==========

Contains the bootloader configuration. This is primarily of interest for
adding device-tree overlays and parameters to describe any hardware attached
to the system which cannot be auto-detected. Most official HATs should be
automatically recognized, but some third-party devices may need a "dtoverlay"
line added to the end of this file.

This file also tells the bootloader the location of the kernel (vmlinuz; see
below), and initial ramdisk (initrd; see below) but, in general, there is no
need to modify these settings.

The format of the file is roughly ini-like and is described fully at:

https://www.raspberrypi.com/documentation/computers/config_txt.html


cmdline.txt
===========

The Linux kernel command line. This typically defines the location of the root
partition; you may need to edit this if you are using alternate media for your
root storage. It also specifies the available login consoles including any
serial consoles. On Ubuntu Server, it is also useful for specifying remote
seeds for cloud-init by appending something like:

ds=nocloud-net;seedfrom=http://10.0.0.2:8000/

Where 10.0.0.2:8000 is an HTTP server serving alternative meta-data, user-data,
and (optionally) vendor-data files. Please note network-config is *not* sourced
from remote seeds.

It is worth noting that the command line specified here is further augmented by
the bootloader (start*.elf; see below) before it is passed to the Linux kernel.
To see the "final" command line at runtime, query /proc/cmdline.

The format of the file is a single line (or more precisely anything beyond the
first line is ignored), and is described fully at:

https://docs.kernel.org/admin-guide/kernel-parameters.html


network-config
==============

The initial netplan configuration for the network.

The format of this file is YAML, in the form expected by netplan which is
documented at:

https://netplan.io/

Examples for wifi and ethernet are included, but you may also configure bonds,
bridges, etc. in this file.


meta-data
=========

The meta-data of the cloud-init seed. This mostly exists to define the
identifier of the instance, but also to specify that the data-source in this
case is entirely local (the user-data file; see below). If you wish to use a
remote data-source with cloud-init, you can override this and specify that
source by appending something like the following to cmdline.txt:

ds=nocloud-net;seedfrom=http://10.0.0.2:8000/

Where 10.0.0.2:8000 is an HTTP server serving alternate meta-data, user-data,
and (optionally) vendor-data files. Please note that network-config will *not*
be read from remote data-sources; only the local one will be applied.

The format of this file is YAML, and is documented at:

https://cloudinit.readthedocs.io/en/latest/topics/instancedata.html


user-data
=========

The user-data of the cloud-init seed. This can be used to customize numerous
aspects of the system upon first boot, from the default user, the default
password, whether or not SSH permits password authentication, import of SSH
keys, the keyboard layout, the system hostname, package installation, creation
of arbitrary files, etc. Numerous examples are included (mostly commented) in
the default user-data.

The format of this file is YAML, and is documented at:

https://cloudinit.readthedocs.io/en/latest/topics/modules.html
https://cloudinit.readthedocs.io/en/latest/topics/examples.html


bootcode.bin (non-editable)
===========================

This is the second stage bootloader used on all models of Pi prior to the Pi 4
(i.e. the 2B, 3B, 3B+, 3A+, Zero 2W, CM3, and CM3+). On the Pi 4 (and later)
this is replaced by the onboard boot EEPROM.

This file is sourced from the linux-firmware-raspi package and written to the
boot partition by the flash-kernel process.


start*.elf, fixup*.dat (non-editable)
=====================================

This is the tertiary bootloader used on all models of Pi. This is the
executable that loads the Linux kernel (see vmlinuz below) and initramfs (see
initrd.img below), and then launches the Linux kernel passing it the address of
the initramfs. The bootloader is (mostly) configured by the config.txt (see
above) which specifies the location of the kernel and initramfs to load.

These files are sourced from the linux-firmware-raspi package and written to
the boot partition by the flash-kernel process.


vmlinuz (non-editable)
======================

This is the compressed Linux kernel which is loaded, unpacked, and executed
by the start*.elf bootloader.

This file is sourced from some variant of the linux-image-*VERSION*-raspi
package and written to the boot partition by the flash-kernel process.


initrd.img (non-editable)
=========================

This is the "initial ramdisk" which the Linux kernel executes first. It
contains all modules and utilities necessary to find and mount to the "real"
root partition. Its content can be inspected with the "unmkinitramfs" tool, and
its generation can be influenced by the configuration files under
/etc/initramfs-tools/.

This file is generated by the utilities in the initramfs-tools package (in
particular mkinitramfs), and written to the boot partition by the flash-kernel
process.


bcm*.dtb (non-editable)
=======================

These are the "device-tree" files which describe the hardware of a particular
model of Raspberry Pi. The device-tree to load is automatically determined by
the bootloader (start*.elf), which also modifies the device-tree (e.g. fixing
up the amount of memory on the Pi 4) before passing it to the Linux kernel.


overlays/*.dtbo (non-editable)
==============================

This directory contains "device-tree overlays" which supplement the "base"
device-tree passed to the Linux kernel. Some overlays are loaded automatically
(e.g. via the HAT specification). Others must be specified manually with
"dtoverlay=" lines in config.txt (see above). Device trees may also be
customized with parameters which may be specified as "dtparam=" lines in
config.txt.



でした

ubuntuのCPU温度は

https://qiita.com/tetsu_koba/items/4b81b32eead391a685c3
にならうと

$ sensors
cpu_thermal-virtual-0
Adapter: Virtual device
temp1:        +43.5°C  

rpi_volt-isa-0000
Adapter: ISA adapter
in0:              N/A

でした。
GPUヒートシンクンクの転用なのでまずまずか

key.jpg

ができるので がさバル きーぼーボードを持っていかなくとも なんとかなります

X-11)pi5 に manjaro linux 早く来い

manjaro.jpg

https://manjaro.org/download/
待てば海路の日和あり 

X-12)マニュアル

X-13)バックアップ 〜 クローン

これは
https://blog.goo.ne.jp/a-storm/e/616403c75c544d4c5aaefdeeb4147093
をつかえばいいです

この前にgpartedで縮小してからでもいいです。。

X-14)arch linux (gnome 起動まで)

Photo Marker_20240114_053724.jpg

長くなるので 

をご覧ください

X-15)Rpi5では 10年以上前の 非cups な プリンター Brother DCP-J925N です

Connection: ipp://BRN001BA98AC0C7.local:631/ipp/port1

ufw 扱いにくいので firewalld をインストールして

./comment-out.bat firewalld-rule.bat 
firewall-cmd --reset-to-defaults
firewall-cmd --permanent --zone=public --add-rich-rule="rule family="ipv4" source address="192.168.117.0/24" port protocol="tcp" port="22" accept"
firewall-cmd --permanent --add-service=mdns
firewall-cmd --permanent --add-service=ipp
firewall-cmd --reload
echo '-----------------------------'
firewall-cmd --list-all --zone=public



でなんとか印刷できてます

X-16)CPU温度

CPU-おんど.bat
while true
do
date "+%H-%M:%S"
sensors | grep temp1
echo
echo
echo '------------'
sleep 30
done

X-17)ubuntu の場合

# ./comment-out.bat /boot/firmware/config.txt 
[all]
kernel=vmlinuz
cmdline=cmdline.txt
initramfs initrd.img followkernel
[pi4]
max_framebuffers=2
arm_boost=1
[all]
dtparam=audio=on
dtparam=i2c_arm=on
dtparam=spi=on
disable_overscan=1
[cm4]
dtoverlay=dwc2,dr_mode=host
[all]
dtoverlay=vc4-kms-v3d
camera_auto_detect=1
display_auto_detect=1
arm_64bit=1
dtoverlay=dwc2



# ./comment-out.bat /boot/firmware/cmdline.txt 
zswap.enabled=1 zswap.zpool=z3fold zswap.compressor=zstd multipath=off dwc_otg.lpm_enable=0 console=tty1 root=LABEL=writable rootfstype=ext4 rootwait fixrtc quiet splash

X-18)

X-19)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0