Merge ~crass/casper:fix-unsafe-mount-iso-loopback into casper:main
Proposed by
Glenn Washburn
Status: | Needs review |
---|---|
Proposed branch: | ~crass/casper:fix-unsafe-mount-iso-loopback |
Merge into: | casper:main |
Diff against target: |
43 lines (+18/-1) 2 files modified
scripts/casper (+2/-0) scripts/casper-helpers (+16/-1) |
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Dimitri John Ledkov | Needs Information | ||
Steve Langasek | Needs Information | ||
Canonical Hardware Enablement | hwe | Pending | |
Review via email: mp+453083@code.launchpad.net |
Description of the change
This fixes a very old issue where booting the iso via loopback can mount hibernated filesystems which can lead to data loss and corruption of the hibernation image. A kernel parameter, "unsafe-mount", is added which allows the old behavior. This can be tested by the following steps:
1. Store the livecd iso on a journalled, say ext4, filesystem
2. hibernate with that filesystem mounted
3. boot the iso via loopback
4. reboot into hibernated system and see if resume succeeds
To post a comment you must log in.
Thanks for this proposal. As this is a substantive change, I would like to see a bug opened against https:/ /bugs.launchpad .net/ubuntu/ +source/ casper before accepting it, so that we ensure we have a way to track discussion/feedback from users in the future.
A few thoughts:
- Ubuntu does not support hibernation anymore, for various reasons; TL;DR: the usability of it is sufficiently poor, and the power savings advantage sufficiently limited versus suspend on modern systems, that it was not worth carrying on. I don't know what other Linux distributions do with respect to hibernation support these days, but if the situation is similar, then I think this is an uncommon use case.
- This patch changes the default behavior of casper when loading images from nearly all supported writable filesystems. I'm not sure we should change the default. It is *safer*, but it reduces usability for most of our users (again, a hibernated Ubuntu filesystem is uncommon; booting a livefs on a system that's hibernated is even more uncommon). This is partly why I think we should have a bug report attached to this discussion.
- The mount manpage mentions using '-o ro,noload' with ext3 and ext4 filesystems to let it be mounted without the journal being replayed. Wouldn't this be a robust solution that doesn't require refusing to load from ext3/ext4 filesystems by default?
- This is only an issue when the user boots a casper-based system *specifically pointing it* at an image which is located on a journalling filesystem that has a dirty journal because it was mounted by a Linux system that has been hibernated and will be confused by a journal replay happening behind its back. So uh seriously, who does that and why?