Pressed 中的某些 xfs 掛載選項不起作用(Ubuntu Server 20.04 LTS)

Pressed 中的某些 xfs 掛載選項不起作用(Ubuntu Server 20.04 LTS)

我嘗試了我的預置文件,發現在安裝 pxe 時,partman-auto 似乎只使部分 xfs 掛載選項生效。

我的分割區預置檔案:

# Use Regular, and wipe out anything that already exists
d-i partman-auto/disk string /dev/sda
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman-auto/method string regular
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-partitioning/confirm_write_new_label boolean true


# You can choose one of the three predefined partitioning recipes:
# - atomic: all files in one partition
# - home:   separate /home partition
# - multi:  separate /home, /usr, /var, and /tmp partitions
d-i partman-auto/choose_recipe select atomic


# If you just want to change the default filesystem from ext3 to something
# else, you can do that without providing a full recipe.
d-i partman/default_filesystem string ext4
d-i partman-auto/expert_recipe string                         \
      boot-root ::                                            \
              128 192 256 fat32                               \
                     $iflabel{ gpt }                          \
                     method{ efi } format{ }                  \
              .                                               \
              16384 65536 -1 ext4         \
                     $primary{ } $bootable{ }                 \
                     method{ format } format{ }               \
                     use_filesystem{ } filesystem{ ext4 }     \
                     mountpoint{ / }                          \
              .                                               \
              16384 131072 -1 xfs                             \
                     method{ format } format{ }               \
                     use_filesystem{ } filesystem{ xfs }      \
                     mountpoint{ /var/lib/docker }            \
                     options/pquota{ pquota }                 \
                     options/noatime{ noatime }               \
              .                                               \
              4096 4096 4096 linux-swap     \
                     method{ swap } format{ }                 \
              .

安裝完成後,本來以為xfs分割區應該有noatime,pquota掛載選項,但/etc/fstab檔案中的掛載選項只顯示noatime,沒有pquota

# /etc/fstab: static file system information.#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda2 during installation
UUID=4fe2f99a-74a1-4792-a01b-2e717b8f2814 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=7941-9BD0  /boot/efi       vfat    umask=0077      0       1
# /var/lib/docker was on /dev/sda3 during installation
UUID=5c563c14-2324-4060-ba54-9596b8cfe02f /var/lib/docker xfs     noatime         0       0
# swap was on /dev/sda4 during installation

UUID=77f9f570-9d77-467f-a5a0-55e3bf7fdcc6 none            swap    sw              0       0

這是一個錯誤還是應該如此?

答案1

我相信所options支持的內容partman-xfs僅限於中列出的內容這個原始檔案

noatime
relatime
nodev
nosuid
noexec
ro
sync
usrquota
grpquota

這是/lib/partman/mountoptions/$filesystem檢查過的文件get_mountoptions

一個可能的解決方法是使用late_command.例如

d-i preseed/late_command string \
    sed -i -e '/xfs/ s/noatime/noatime,pquota/' /target/etc/fstab ; 

相關內容