FS#65003 - {arch-install-scripts} Duplicate "-o subvol" entries in genfstab output on BTRFS file system

Attached to Project: Arch Linux
Opened by Luc Gaboury (lgaboury) - Wednesday, 01 January 2020, 19:18 GMT
Last edited by Eli Schwartz (eschwartz) - Thursday, 11 March 2021, 03:16 GMT
Task Type Bug Report
Category Arch Projects
Status Closed
Assigned To Eli Schwartz (eschwartz)
Architecture All
Severity Very Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
This is a very minor bug report which does not seem to have any detected negative effects (at least as of yet), but decided to report it nonetheless.

When using BTRFS file system with subvolumes during Arch Linux installation, genfstab command creates duplicate entries for the option -o subvol. See below copy of the generated /mnt/etc/fstab on my system (Acer E5 575G):

# Static information about the filesystems.
# See fstab(5) for details.

# <file system> <dir> <type> <options> <dump> <pass>
# /dev/sda2
UUID=2cdb0f7a-25c8-4238-a0c7-cded878af9a0 / btrfs rw,relatime,ssd,space_cache,subvolid=256,subvol=/@,subvol=@ 0 0

# /dev/sda1
UUID=1EAA-52E1 /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 2

# /dev/sda2
UUID=2cdb0f7a-25c8-4238-a0c7-cded878af9a0 /home btrfs rw,relatime,ssd,space_cache,subvolid=258,subvol=/@home,subvol=@home 0 0

# /dev/sda3
UUID=be97a342-4349-4389-9638-578035f70dd9 none swap defaults 0 0



Steps to reproduce:

I used the following steps when configuring my system for installation.

parted --script /dev/sda \
mklabel gpt \
mkpart ESP fat32 1Mib 100MiB \
set 1 esp on \
mkpart Linux btrfs 100MiB 228GiB \
mkpart SWAP linux-swap 228GiB 100%

mkfs.fat -F32 /dev/sda1
mkfs.btrfs -f /dev/sda2
mkswap /dev/sda3
swapon /dev/sda3

mount /dev/sda2 /mnt
btrfs subvolume create /mnt/@
btrfs subvolume create /mnt/@home
umount -R /mnt
mount /dev/sda2 /mnt -o subvol=@
mkdir /mnt/boot
mkdir /mnt/home
mount /dev/sda2 /mnt/home -o subvol=@home
mount /dev/sda1 /mnt/boot

pacstrap /mnt base linux linux-firmware intel-ucode btrfs-progs nano man-db man-pages ntfs-3g networkmanager sudo \
pacman-contrib nss-mdns cups cups-pdf hplip firewalld xdg-user-dirs bluez pulseaudio-bluetooth avahi reflector

genfstab -t UUID /mnt >> /mnt/etc/fstab
This task depends upon

Closed by  Eli Schwartz (eschwartz)
Thursday, 11 March 2021, 03:16 GMT
Reason for closing:  Fixed
Additional comments about closing:  https://git.archlinux.org/arch-install-s cripts.git/commit/?id=ca8e8f63ec2de590dc 67d787ceca6686aed4f98e
Comment by Dave Reisner (falconindy) - Wednesday, 01 January 2020, 19:20 GMT
Can you include your /proc/self/mountinfo?
Comment by Alexander Schnaidt (Namarrgon) - Wednesday, 01 January 2020, 19:21 GMT
The two entries have different subvol= and subvolid= arguments. There is no bug here.
EDIT: Ignore this one, i misunderstood what the reporter meant.
Comment by Lukas B (teateawhy) - Tuesday, 07 January 2020, 21:30 GMT
I am not the bug reporter, but i also noticed this bug in genfstab. Giving subvol= as well as subvolid= is redundant, too. I attached mountinfo. Mount seems to ignore the second mentioning of subvol.
Comment by Luc Gaboury (lgaboury) - Wednesday, 15 January 2020, 22:07 GMT
Attached is requested mountinfo. Same result as Lukas B, seems to ignore the second subvol entry.
Comment by Takeshi Suzuki (takeshibaconsuzuki) - Monday, 20 January 2020, 19:51 GMT
It looks like the options parsed from findmnt already have the subvol option.

I added a check to see if subvol= was already in $opt in the pull request here: https://github.com/archlinux/arch-install-scripts/pull/4. What do you think?

Loading...