Raspberrypi 5 und 4Tb nvme-SSD und Pineberry bottom HAT
sudo apt-get update
sudo apt-get upgrade
sudo apt install gparted gdisk dosfstools mtools iotop htop -y
( falls noch nicht ,.. install oh-my-zsh )
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
mmcblk0 179:0 0 29.5G 0 disk
├─mmcblk0p1 179:1 0 512M 0 part /boot/firmware
└─mmcblk0p2 179:2 0 29G 0 part /
nvme0n1 259:0 0 3.6T 0 disk
├─nvme0n1p1 259:1 0 200M 0 part
└─nvme0n1p2 259:2 0 3.6T 0 part
Partitionieren
sudo cgdisk /dev/nvme0n1
Partition 1
- First sector → Enter
- Size in sectors or {KMGTP} → 512M
- Hex code or GUID → 0700
- Enter new partition name → bootfs
- Jetzt mit dem Cursor unten auf free space navigieren!
Partition 2
- First sector → Enter
- Size in sectors or {KMGTP} → Enter
- Hex code or GUID → Enter
- Enter new partition name → rootfs
Part. # Size Partition Type Partition Name
----------------------------------------------------------------
1007.0 KiB free space
1 512.0 MiB Microsoft basic data bootfs
2 3.6 TiB Linux filesystem rootfs
839.5 KiB free space
Prüfen
sudo sgdisk -p /dev/nvme0n1
Disk /dev/nvme0n1: 7814037168 sectors, 3.6 TiB
Model: Fanxiang S660 4TB
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 7BC06852-CADB-4BE5-9EA2-662730922969
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 7814037134
Partitions will be aligned on 2048-sector boundaries
Total free space is 3693 sectors (1.8 MiB)
Number Start (sector) End (sector) Size Code Name
1 2048 1050623 512.0 MiB 0700 bootfs
2 1050624 7814035455 3.6 TiB 8300 rootfs
sudo reboot
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
mmcblk0 179:0 0 29.5G 0 disk
├─mmcblk0p1 179:1 0 512M 0 part /boot/firmware
└─mmcblk0p2 179:2 0 29G 0 part /
nvme0n1 259:0 0 3.6T 0 disk
├─nvme0n1p1 259:1 0 512M 0 part
└─nvme0n1p2 259:2 0 3.6T 0 part
Formatieren
sudo mkfs.vfat /dev/nvme0n1p1 -n bootfs -v
mkfs.fat 4.2 (2021-01-31)
Auto-selecting FAT32 for large filesystem
mkfs.fat: Warning: lowercase labels might not work properly on some systems
/dev/nvme0n1p1 has 64 heads and 32 sectors per track,
hidden sectors 0x2000;
logical sector size is 512,
using 0xf8 media descriptor, with 1048576 sectors;
drive number 0x80;
filesystem has 2 32-bit FATs and 8 sectors per cluster.
FAT size is 1024 sectors, and provides 130812 clusters.
There are 32 reserved sectors.
Volume ID is e82ef657, volume label bootfs.
sudo mkfs.ext4 /dev/nvme0n1p2 -L rootfs -v
mke2fs 1.47.0 (5-Feb-2023)
fs_types for mke2fs.conf resolution: 'ext4'
Discarding device blocks: done
Filesystem label=rootfs
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
244162560 inodes, 976623104 blocks
48831155 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=3124756480
29805 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Filesystem UUID: e60c2e38-853d-4df6-9848-a730e7e84484
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848, 512000000, 550731776, 644972544
Allocating group tables: done
Writing inode tables: done
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done
Mounten
sudo mkdir klonboot
sudo mkdir klonfs
sudo mount /dev/nvme0n1p1 /klonboot
sudo mount /dev/nvme0n1p2 /klonfs
Klonen
sudo rsync -rltDv --numeric-ids --info=progress2 /boot/firmware/ /klonboot
sudo rsync -axHAWXSv --numeric-ids --info=progress2 / /klonfs
fstab anpassen
lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL,PARTUUID
NAME FSTYPE SIZE MOUNTPOINT LABEL PARTUUID
mmcblk0 29.5G
├─mmcblk0p1 vfat 512M /boot/firmware bootfs ccf43481-01
└─mmcblk0p2 ext4 29G / rootfs ccf43481-02
nvme0n1 3.6T
├─nvme0n1p1 vfat 512M /klonboot bootfs a65da01e-f259-4250-a968-edac1cdeb20d
└─nvme0n1p2 ext4 3.6T /klonfs rootfs 144c2490-ce9b-4298-8b78-cb11e060df3c
sudo nano /klonfs/etc/fstab
proc /proc proc defaults 0 0
PARTUUID=a65da01e-f259-4250-a968-edac1cdeb20d /boot/firmware vfat defaults 0 2
PARTUUID=144c2490-ce9b-4298-8b78-cb11e060df3c / ext4 defaults,noatime 0 1
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that
cmdline.txt anpassen
sudo nano /klonboot/cmdline.txt
console=serial0,115200 console=tty1 root=PARTUUID=144c2490-ce9b-4298-8b78-cb11e060df3c rootfstype=ext4 fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles cfg80211.ieee80211_regdom=DE
Finale
sudo umount /klonboot && sudo umount /klonfs
sudo poweroff
SD karte entfernen und von SSD starten :)