BTRFS volume is erased by mkfs.btrfs even if it "Format" is unchecked and the volume is initialized.
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 22/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- linux, python
- Lĩnh vực
- operating-systems
Hướng nghiên cứu
Start in the Ubiquity custom-partitioning/installer path that decides whether to format a selected BTRFS volume, and trace where the Format checkbox value is passed before mkfs.btrfs is invoked. Reproduce with an existing BTRFS filesystem containing @ and @home, uncheck Format, and confirm whether the format flag is ignored for BTRFS. Done means an unchecked Format leaves the filesystem and subvolumes intact, with the issue's broader subvolume-mountpoint requests treated separately.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Version: Linux Mint 22 (Wilma)
Steps taken
- I was in a situation where I tried to reinstall over a non-working Linux Mint caused by an upgrade failure (21.3 to 22): https://github.com/linuxmint/mintupgrade-legacy/issues/58.
- I read that Ubuntu normally uses
@and@homesubvolumes, so I assumed Mint would re-use them
(https://askubuntu.com/a/1277695/766334).- Yeah, I understand assumptions like this are not good, and I'll try not to make them. I was in a rush to get things working, and made some mistakes. Consider though, that the installer should probably not let you make these mistakes (But yeah, I'll take the blame for the root causes of the issue above if it was using both Sury & WineHQ repos).
- I read an article that recommend renaming /usr/sbin/mkfs.btrfs and replacing it with a symlink to /usr/bin/true, but I thought, "There is no way that is necessary. I'll just uncheck format."
- In ubiquity options, I set / to the btrfs volume
- I unchecked "Format" for the btrfs volume.
- result: the installer ran mkfs.btrfs which deleted
@(old/) and@home(old/home). - I restored my backup but due to https://github.com/linuxmint/mintupgrade-legacy/issues/58 it turned out to be incomplete. I didn't know it was incomplete since rsync didn't complete nor show an error due to said issue. Due to the backup being restored (previous /home's files that were occupying unused space being overwritten by the incomplete restore), data recovery attempts failed. I tried btrfscue and UFS Explorer. In UFS Explorer I added the standard MIDI header to the pattern matching settings. The recovery tools found some recoverable files, but not any of the files I actually didn't have. I had to use an older backup for many files, though thankfully I didn't lose significant work (I recovered mostly usable MIDI from FLAC in a few cases and remembered the BPM so that helped, and most of my other stuff is on Nextcloud or git or hadn't changed recently).
Later on, I remembered the last time I did this, I did use the older set of instructions I mentioned above and replaced /usr/sbin/mkfs.btrfs with a symlink to /usr/bin/true, and that worked back then.
- I am not sure I can find the post, but I may have gleaned it from this thread where two people highly recommend doing that: https://bbs.archlinux.org/viewtopic.php?pid=1370237#p1370237
Expected behavior
Do not run mkfs.btrfs on an existing volume when "Format" is not checked. A stopgap solution barring the features below would be to simply not run it, and keep everything else the same. Then at least the user could later manually fix their fstab to mount /home to @home if they wanted in that case, and get their files from @ such as files they want in their old /etc or other folders. Not wiping / is convenient for those of us who can manage it safely (rename /etc, /opt, and /var/www and delete most or all others), and that should be allowed. Having a backup is a separate issue from the convenience of not having to restore it if unchecking "Format" is respected. I know format and mkfs are technically different things, but not erasing it is clearly what is expected--It is misleading and potentially destructive to have a "Format" checkbox that is able to be unchecked if mkfs.btrfs is run no matter what.
A complete btrfs install feature set would include letting the user set mountpoints on subvolumes (Treat them similarly to partitions in the UI).
- By default, set mountpoints on
@and@homebtrfs subvolumes to/and/homerespectively whether or not each exists, like Ubuntu does.- There are no apparent drawbacks since they share the same space by default.
- A solution providing more clarity to the user when the volume doesn't exist or
@and/or@homedoes not exist (as opposed to creating subvolumes silently) would be to speculatively list@and@homeunder the btrfs subvolume in the mount selection screen and allow choosing mountpoints for them (and existing ones, and the volume) whether or not each exists. - Selectively let the user check each subvolume to format or not.
Then during install:
- Use mkfs.btrfs only if there is no btrfs filesystem yet on each partition marked as btrfs in the custom partition layout UI.
mkdir /mnt/$UUID(or wherever is ideal)mount UUID=$UUID /mnt/$UUID- For each SUBVOL marked with a mountpoint:
- If format is checked for it individually,
btrfs subvol delete /mnt/$UUID/$SUBVOL, otherwise leave the subvolume intact. - If subvolume does not exist at this point,
btrfs subvol create /target-brfs/$SUBVOL. - Else leave the subvolume intact.
- If format is checked for it individually,
Related issues:
- Ngôn ngữ chính
- Python
- Star
- 58
- Fork
- 57
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của linuxmint/ubiquity
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
-
The variable named 'partition' causes an unhandled error when there are no disks connected to the system: "TypeError: argument of type 'NoneType' is not iterable".Có thể đã có người làm @eran132 đã nhận 71 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 18/100
Tất cả issue của linuxmint/ubiquity
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
521xueweihan/HelloGitHub#4729 ·
-
Relatório de erro do LinuxToysĐang mởauto-reported bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
cliproxy-quota: a tab around a credential email skips own-accounts and paced-accounts matchingĐang mởneeds-triage type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
pollen-robotics/reachy_mini_conversation_app#631 ·
Maintainer thường phản hồi trong vòng 7 ngày
-
stix-atlas.json: the same relationship id is used for several different mitigates relationshipsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100