Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5424

Raspberry Pi OS • Re: Help with new setup - moving off SD onto raid1 nvme

$
0
0
Regardless of the bootable status of various rpi nvme implementations don't forget to take into account the fact if you "commission" a set of raid drives at the same time, they're gonna wear out at the same time. This is of particular concern with solid state. The "smartmontools" wear attribute varies according to manufacturer: my crucial ssd's use attribute 202 for instance whereas the pair of "XPG SPECTRIX S40G" in my PC yield nothing useful: well there is "Percentage Used" but as it's been sat at zero since forever methinks that's a waste of text. Consequently the second xpg is sat unused. It exists solely for me to restore my PC onto when the first one fails. (Knowing my luck the first xpg will fail in a way which prevents the second xpg from being used so I'll have to take the PC to bits anyway).

Long winded way of me saying I don't think raid is useful on solid state for domestic use because nobody is going to replace half their working disks six months down the line to avoid the above. Consequently, run on one nvme and rsync the first to the second periodically. Or, as you seem to know lvm, here's my PC..

Code:

foo@sdu:~$ sudo parted /dev/nvme0n1 p freeModel: XPG SPECTRIX S40G (nvme)Disk /dev/nvme0n1: 256GBSector size (logical/physical): 512B/512BPartition Table: gptDisk Flags: Number  Start   End     Size    File system  Name  Flags        17.4kB  1049kB  1031kB  Free Space 1      1049kB  256MB   255MB   fat32        efi   boot, esp 2      256MB   64.0GB  63.7GB               sdu   lvm 3      64.0GB  128GB   64.0GB               sdu   lvm        128GB   256GB   128GB   Free Space
..enough for the OS. The data volume group (sdu_data) is elsewhere but could easily be partition 4 above.

The tool 'sdm' can create an lvm image. After pestering @bls months ago to add lvm support, it's only this weekend I've been able to look into it. I did this to a thumb drive..

Code:

foo@pi20:/wrk $ sudo parted /dev/sda p freeModel:  USB  SanDisk 3.2Gen1 (scsi)Disk /dev/sda: 123GBSector size (logical/physical): 512B/512BPartition Table: gptDisk Flags: Number  Start   End     Size    File system  Name  Flags        17.4kB  4194kB  4177kB  Free Space 1      4194kB  541MB   537MB   fat32              msftdata 2      541MB   5943MB  5402MB                     lvm        5943MB  123GB   117GB   Free Space
..for a lite version 64bit bookworm. Loosely something like this..

Code:

#!/bin/bashARC="2024-03-15-raspios-bookworm-arm64-lite.img.xz"IMG="T/z.img"DEV="/dev/sda": ${E:="echo"}mkdir -p T || exit 1[ -f "$IMG" ] || {        xzcat --verbose "$ARC" > "$IMG"        $E sdm --extend "$IMG" --xmb 1024 || exit 1}$E sdm --customize "$IMG" --batch \        --plugin user:"adduser=foo|uid=1001|password=oof" \        --plugin disables:piwiz \        || exit 1lsscsi | grep "$DEV"[ $? -eq 0 ] && {        $E sdm --burn "$DEV" --hostname pi20 --convert-root lvm "$IMG"}

Statistics: Posted by swampdog — Mon Jun 24, 2024 3:50 am



Viewing all articles
Browse latest Browse all 5424

Trending Articles