Install Debian on F2FS filesystem
mouse 108 · person cloud · link
Last update
2025-04-05
2025
04-05
«flash friendly filesystem»

Install

  • boot: advanced options > expert install
  • proceed until Load installer components..., then select f2fs-modules
  • proceed until Partition disks, then:
  • select Execute a shell, then:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
  df -hT   # show mounted device names
  umount /target/boot
  cp -a /target /tg
  umount /target
  anna-install f2fs-tools-udeb  # or anna-install f2fs-modules; depmod; modprobe f2fs
  mkfs.f2fs -l mylabel -f -i -O extra_attr,inode_checksum,sb_checksum,compression /dev/sdX2
  mount -t f2fs -o compress_algorithm=zstd:6,compress_chksum,atgc,gc_merge,lazytime /dev/sdX2 /target
  cp -a /tg/. /target
  blkid -s UUID -o value /dev/sdX2 >> /target/etc/fstab
  echo "compress_algorithm=zstd:6,compress_chksum,atgc,gc_merge,lazytime" >> /target/etc/fstab
  nano /target/etc/fstab # edit `/`: replace UUID, set type=f2fs, prepend options
  mount /dev/sdX1 /target/boot
  df -hT   # re-check mounted device names
  exit
  • select Install the base system
  • reboot
  • grub (/etc/default/grub & update-grub)

System backup

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 1. copy latest `busybox` into destination folder
#   in order to use `tar` and `gzip` applets

# 2.boot debian netinst cd > Advanced > Rescue mode > Execute a Shell
anna-install f2fs-modules
depmod
modprobe f2fs
mkdir src dst
mount -t f2fs -o ro /dev/sdX2 /src
mount -t f2fs /dev/mmcblk0p1 /dst
cd /dst 
./busybox tar -C /src --numeric-owner -cvpf - . | ./busybox gzip -c > backup.tgz
cd /
umount /src /dst

Source: davidsebek, archlinux, debian, kernel