Merge lp:~csurbhi/ubuntu/natty/os-prober/os-prober.fix764893 into lp:ubuntu/natty/os-prober
Proposed by
Surbhi Palande
Status: | Needs review |
---|---|
Proposed branch: | lp:~csurbhi/ubuntu/natty/os-prober/os-prober.fix764893 |
Merge into: | lp:ubuntu/natty/os-prober |
Diff against target: |
123 lines (+80/-0) 3 files modified
debian/changelog (+7/-0) linux-boot-probes/common/50mounted-tests (+37/-0) os-probes/common/50mounted-tests (+36/-0) |
To merge this branch: | bzr merge lp:~csurbhi/ubuntu/natty/os-prober/os-prober.fix764893 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Colin Watson | Approve | ||
Review via email: mp+58654@code.launchpad.net |
Description of the change
Hi,
This patch adds support to mount the "@" subvolume to access a btrfs formatted rootfs. It checks if "@" is present and if so, then unmounts the partition before trying to mount the subvolume. Releases previous to Natty and other OS distros may not have the "/" on the "@" subvolume.
Tested lightly on kvm with Natty-btrfs rootfs.
Please do consider this as a *SRU* for Natty.
Thanks,
Surbhi.
To post a comment you must log in.
Unmerged revisions
- 18. By Surbhi Palande
-
mount btrfs subvolume @ when present to access a btrfs formatted rootfs.
(LP: #764893)
> mounted=1
> + debug "mounted as $type filesystem"
The indentation is in general wrong here - make sure to check whether
the code you're patching is using tabs or spaces for indentation, and
match it.
> + if [ $type="btrfs" ] && [ -x "$tmpmnt/@" ]; then
The first test is wrong shell syntax. This must be [ "$type" = btrfs ]
instead.
Furthermore, this won't work when we're using grub-mount, which we
generally will be nowadays; and remounting with 'mount -o ro,subvol=@ -t
btrfs' will bring us back to the bad old days before grub-mount, when we
had to choose between either corrupting hibernated filesystems or
failing to mount journalled filesystems that weren't cleanly unmounted.
I suggest instead that we check whether $type is either btrfs or fuse
(using 'case') and whether $tmpmnt/@/lib exists (this should be
reasonably safe since btrfs is only used on Linux); in that case,
bind-mount $tmpmnt/@ on $tmpmnt and remember to umount it twice at the
end. (Alternatively, we could arrange for everything to read from
$tmpmnt/@ without a bind-mount, but I think that would be rather more
code churn.)
> + warn "failed to mount" \
> + "@ ($partition)"
Try to make the warnings a bit more descriptive; most people will have
no idea what our subvolume scheme involves. They should still be
one-line warnings or thereabouts, not essays, but for example
consistently referring to "btrfs subvolume @ on $partition" would be an
improvement.