USB oder SD-Karte mit f2fs formatieren

Einrichtung, Nutzung und Hilfe zu RaspberryMatic (OCCU auf Raspberry Pi)

Moderatoren: jmaus, Co-Administratoren

Benutzeravatar
aksnet
Beiträge: 48
Registriert: 28.02.2016, 13:26
Hat sich bedankt: 1 Mal
Danksagung erhalten: 1 Mal

Re: USB oder SD-Karte mit f2fs formatieren

Beitrag von aksnet » 27.03.2024, 07:54

Ich habe heute auch mal wieder einen USB-Stick an die CCU angeschlossen und ihn mit F2FS formatiert. Die Schritte teile ich gerne:

Ausgangslage:
- FAT32 USB Stick an den Raspberry Pi mit Raspberrymatic anschließen
- SSH aktivieren: Startseite > Einstellungen > Systemsteuerung > Sicherheit

Man kommt per SSH auf RaspberryMatic mit User root und dem Passwort, welches in der Oberfläche gesetzt ist.

- Erster Check für einen USB-Stick:

Code: Alles auswählen

root@CCU:~# df -Th | grep media
tmpfs                tmpfs         474.6M         0    474.6M   0% /media
/dev/sdb1            vfat           14.6G      1.4M     14.6G   0% /media/usb1
- Alle gemounteten Laufwerke anzeigen:

Code: Alles auswählen

root@CCU:~# mount
/dev/root on / type ext4 (ro,relatime)
devtmpfs on /dev type devtmpfs (rw,relatime,size=451208k,nr_inodes=112802,mode=755)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /dev/shm type tmpfs (rw,relatime,mode=777)
tmpfs on /var type tmpfs (rw,noatime,size=486028k)
tmpfs on /media type tmpfs (rw,noatime)
/dev/mmcblk0p3 on /usr/local type ext4 (rw,noatime,nodiratime,commit=30)
/dev/mmcblk0p1 on /boot type vfat (ro,relatime,fmask=0002,dmask=0002,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/sdb1 on /media/usb1 type vfat (rw,nodev,noexec,noatime,nodiratime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
- Unmount USB Stick:

Code: Alles auswählen

root@CCU:~# umount /dev/sdb1
- Nochmal prüfen:

Code: Alles auswählen

root@CCU:~# mount
/dev/root on / type ext4 (ro,relatime)
devtmpfs on /dev type devtmpfs (rw,relatime,size=451208k,nr_inodes=112802,mode=755)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /dev/shm type tmpfs (rw,relatime,mode=777)
tmpfs on /var type tmpfs (rw,noatime,size=486028k)
tmpfs on /media type tmpfs (rw,noatime)
/dev/mmcblk0p3 on /usr/local type ext4 (rw,noatime,nodiratime,commit=30)
/dev/mmcblk0p1 on /boot type vfat (ro,relatime,fmask=0002,dmask=0002,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
- Neue Partition erstellen:

Code: Alles auswählen

root@CCU:~# fdisk /dev/sdb

Welcome to fdisk (util-linux 2.39.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/sdb: 14.59 GiB, 15664676864 bytes, 30595072 sectors
Disk model: Cruzer Blade
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 76667439-E1B5-4480-AF0D-DD97D31E0D62

Device     Start      End  Sectors  Size Type
/dev/sdb1   2048 30593023 30590976 14.6G Microsoft basic data

Command (m for help): d
Selected partition 1
Partition 1 has been deleted.

Command (m for help): n
Partition number (1-128, default 1):
First sector (34-30595038, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-30595038, default 30593023):

Created a new partition 1 of type 'Linux filesystem' and of size 14.6 GiB.
Partition #1 contains a vfat signature.

Do you want to remove the signature? [Y]es/[N]o: Y

The signature will be removed by a write command.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

- Neue Partition formatieren:

Code: Alles auswählen

root@CCU:~# mkfs.f2fs /dev/sdb1

    F2FS-tools: mkfs.f2fs Ver: 1.16.0 (2023-04-11)

Info: Disable heap-based policy
Info: Debug level = 0
Info: Trim is enabled
Info: [/dev/sdb1] Disk Model: Cruzer Blade
Info: Segments per section = 1
Info: Sections per zone = 1
Info: sector size = 512
Info: total sectors = 30590976 (14937 MB)
Info: zone aligned segment0 blkaddr: 512
Info: format version with
  "Linux version 6.1.73 (builder@acf6e67e1d6c) (aarch64-buildroot-linux-gnu-gcc.br_real (Buildroot -g6d18e07) 12.3.0, GNU ld (GNU Binutils) 2.40) #1 SMP PREEMPT Sat Mar 16 11:34:19 UTC 2024"
Info: [/dev/sdb1] Discarding device
Info: This device doesn't support BLKSECDISCARD
Info: This device doesn't support BLKDISCARD
Info: Overprovision ratio = 1.220%
Info: Overprovision segments = 91 (GC reserved = 88)
Info: format successful
- Danach einfach einen reboot machen

Code: Alles auswählen

root@CCU:~# reboot
- Nochmal via mount prüfen, der USB-Stick ist automatisch via F2FS gemounted:

Code: Alles auswählen

root@CCU:~# mount
/dev/root on / type ext4 (ro,relatime)
devtmpfs on /dev type devtmpfs (rw,relatime,size=451208k,nr_inodes=112802,mode=755)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /dev/shm type tmpfs (rw,relatime,mode=777)
tmpfs on /var type tmpfs (rw,noatime,size=486028k)
tmpfs on /media type tmpfs (rw,noatime)
/dev/mmcblk0p3 on /usr/local type ext4 (rw,noatime,nodiratime,commit=30)
/dev/mmcblk0p1 on /boot type vfat (ro,relatime,fmask=0002,dmask=0002,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/sda1 on /media/usb1 type f2fs (rw,lazytime,nodev,noexec,noatime,nodiratime,background_gc=on,nodiscard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,alloc_mode=reuse,checkpoint_merge,fsync_mode=posix,discard_unit=block,memory=normal)
root@CCU:~#
Grüße
Andreas
CCU3 - RaspberryMatic 3.75.6.20240316

Benutzeravatar
jmaus
Beiträge: 9865
Registriert: 17.02.2015, 14:45
System: Alternative CCU (auf Basis OCCU)
Wohnort: Dresden
Hat sich bedankt: 464 Mal
Danksagung erhalten: 1883 Mal
Kontaktdaten:

Re: USB oder SD-Karte mit f2fs formatieren

Beitrag von jmaus » 27.03.2024, 19:16

Danke für diese kurze Anleitung. Vielleicht sollte man die besser im RaspberryMatic Dokumentationswiki irgendwo hinterlegen, statt hier untergehen zu lassen?
RaspberryMatic 3.75.7.20240420 @ ProxmoxVE – ~200 Hm-RF/HmIP-RF/HmIPW Geräte + ioBroker + HomeAssistant – GitHub / Sponsors / PayPal / ☕️

Antworten

Zurück zu „RaspberryMatic“