Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General | Add support for F2FS and Btrfs root file systems #4164

Merged
merged 23 commits into from
Mar 9, 2021
Merged

Conversation

MichaIng
Copy link
Owner

@MichaIng MichaIng commented Mar 2, 2021

  • DietPi-FS_partition_resize | Add support for F2FS file system expansion
  • DietPi-FS_partition_resize | Since all known systems require the root/boot file system to be as a partition on a partition table, do not support cases the it is not on a partition, but instead error out with "unsupported naming scheme". Even if there were cases where such was possible, it's better to create visible failure for now. If such cases were reported, we'd need to handle those gracefully at many other places in the code.
  • DietPi-FS_partition_resize | Use "set -e" to error our directly when any command fails. This requires to use either if-then-else or "a || b" for conditionals, so that the check itself does not error out the script.

+ DietPi-FS_partition_resize | Add support for F2FS file system expansion
+ DietPi-FS_partition_resize | Since all known systems require the root/boot file system to be as a partition on a partition table, do not support cases the it is not on a partition, but instead error out with "unsupported naming scheme". Even if there were cases where such was possible, it's better to create visible failure for now. If such cases were reported, we'd need to handle those gracefully at many other places in the code.
+ DietPi-FS_partition_resize | Use "set -e" to error our directly when any command fails. This requires to use either if-then-else or "a || b" for conditionals, so that the check itself does not error out the script.
@MichaIng MichaIng added this to the v7.1 milestone Mar 2, 2021
@MichaIng MichaIng linked an issue Mar 2, 2021 that may be closed by this pull request
MichaIng added 2 commits March 3, 2021 19:42
+ DietPi-PREP | Add support for F2FS and Btrfs root file systems by installing related packages to allow resizing and fsck on those file system types
+ DietPi-PREP | Enhance partition type and file system type estimation by consequently using "lsblk"
+ DietPi-FS_partition_resize | Add support for Btrfs as well
@MichaIng MichaIng changed the title General | Add support for F2FS root file systems General | Add support for F2FS and Btrfs root file systems Mar 3, 2021
MichaIng added 8 commits March 3, 2021 22:10
+ DietPi-Drive_Manager | Add support for XFS format and fsck
+ DietPi-Drive_Manager | Add support for F2FS and Btrfs resize
+ DietPi-Drive_Manager | To collect drive info, consequently use findmnt for mounted drives and lsblk for unmounted drives. Keep using blkid only to get the list of formatted filesystems, since lsblk prints parent drives and unformatted drives as well.
+ DietPi-Drive_Manager | Harden and error handle a few steps
+ DietPi-Drive_Manager | Minor spelling: "Btrfs", "ext4" and "filesystem" which is correct as well and probably more common without space.
+ DietPi-Imager | Menu: Move from one menu to the logical next, only go back to main menu on cancel or when the image name has been entered
+ DietPi-Imager | Add F2FS and Btrfs support, WIP!
+ DietPi-Image | Use fstrim to NULL Btrfs and F2FS empty space and sgdisk can be used on raw disk image files as well
+ DietPi-Drive_Manager | When resizing file systems, unmount F2FS and ext4 first, which is safer, whereas Btrfs needs to be mounted, so inform user and return.
+ DietPi-Drive_Manager | When unmounting fails, halt and show an error prompt, so users know that and what went wrong, but allow to ignore
+ DietPi-Drive_Manager | After format, do manual "sync" to induce as small delay, required to show an UUID for XFS. Without this below "lsblk -no UUID" returns an empty string.
+ DietPi-Drive_Manager | Unmount drive automatically on format, so that it does not need to be unmounted manually. Use Unmount_Drive function, so that the mount point directory is removed as well.
+ DietPi-Drive_Manager | Unmount drive and stop service on fsck after a supported filesystem type has been detected to minimise the cases where services are stopped unnecessarily.
+ DietPi-Imager | We cannot re-create the F2FS filesystem to shrink it, since this implies changed UUIDs, rendering entries in fstab and boot configs wrong. Also there is no way to define the UUID on mkfs.f2fs or change if afterwards. So we must leave it in original size.
@MichaIng
Copy link
Owner Author

MichaIng commented Mar 5, 2021

ToDo:

  • F2FS can only be expanded when unmounted (and R/O?). This makes it difficult to resize on first boot automatically. Test which is true and unmount automatically when doing it via dietpi-drive_manager. EDIT: It works with R/O mount at least.
  • Btrfs can only be resized when mounted, hence mount automatically when doing it via dietpi-drive_manager. EDIT: It cannot be resized when R/O mounted.

The more I work with with F2FS and Btrfs I appreciate the flexibility when managing ext4 (whether it's about file system limitations or limited userspace tool features), especially as rootfs 😄.

MichaIng added 12 commits March 6, 2021 22:43
+ DietPi-Drive_Manager | Automatically mount unmounted F2FS drive to a temporary mount point, when it's being resized.
+ DietPi-Drive_Manager | Fix loop device detection and remove trailing /dev/ as well for unknown naming schemes
+ DietPi-FS_partition_resize | Tiny code enhancement
+ DietPi-Drive_Manager | After fsck, remount affected drive only, and do it and swapon only if it was mounted before. "mount -a" only works for drives without "noauto", hence root, boot and tmpfs mounts by default on DietPi. For this reason, the "mount -a" on each drive scan loop is obsolete as well.
+ DietPi-Imager | Btrfs file system cannot be resized when being R/O mounted
+ DietPi-Imager | Fix main menu start entry
+ DietPi-PREP | Do not keep sunxi-tools installed. Those are not used by us and only required on Allwinner sunxi SoCs. Define other Armbian packages more specifically.
+ DietPi-Drive_Manager | Do not unmount ext4 filesystems on resize, as it is not required and might break concurrent usage. Otherwise we would need to warn and ask first that the drive will be unmounted temporarily.
+ DietPi-Drive_Manager | Do not unmount F2FS filesystems on resize, but only remount them as R/O if not already the case, so at least concurrent read access remains.
+ DietPi-PREP | Fix version string detection for v7.0
+ CHANGELOG | Various drive- and filesystem-related fixes and enhancements
+ DietPi-FS_partition_resize | Since F2FS filesystems cannot be resized when being R/W mounted, mount it R/O temporarily
@MichaIng MichaIng merged commit 0203389 into dev Mar 9, 2021
@MichaIng MichaIng deleted the f2fs branch March 9, 2021 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RPi | Support for + provide F2FS images
1 participant