Install to dirty disk with swap fails

Bug #1743643 reported by Joshua Powers on 2018-01-16
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
curtin
Medium
Unassigned
subiquity
Undecided
Unassigned
casper (Ubuntu)
Undecided
Unassigned
livecd-rootfs (Ubuntu)
Undecided
Unassigned

Bug Description

Description:
Complete an install with a custom disk setup including swap and on a 2nd install the install fails.

Steps to reproduce:
1. Install to disk with following custom disk partitions:
* 3G ext4 /
* 1G ext4 /boot
* 1G ext4 /home
* 1G swap
2. Reboot
3. Install again with default options
4. Install fails

Logs:
Subiquity: https://paste.ubuntu.com/26399863/
Curtin: https://paste.ubuntu.com/26399862/

I also saw this with:
* 17gb ext4 /
* 1gb swap

Logs:
Subiquity: https://paste.ubuntu.com/26399883/
Curtin: https://paste.ubuntu.com/26399884/

Related branches

Joshua Powers (powersj) on 2018-01-16
description: updated
Ryan Harper (raharper) wrote :

can you attach /tmp/subiquity-curtin-install.conf from the environment? And can you include the curtin log from the "successful" first run?

Changed in curtin:
status: New → Incomplete
Joshua Powers (powersj) wrote :

First install curtin log: https://paste.ubuntu.com/26400611/
Checking swapon pointed to /swap.img

Second install
/tmp/subiquity-curtin-install.conf: https://paste.ubuntu.com/26400656/
/tmp/subiquity-curtin-install.log: https://paste.ubuntu.com/26400658/

Changed in curtin:
status: Incomplete → New

Can you attach the guest libvirt xml?

I suspect that we're not getting the right disk; the curtin config
includes both serial *and* path; we should have on or the other.
There is another possibility that due to the disk having a valid filesystem
that systemd may be triggering a fsck and mount if the
label of the rootfs matches the host environment.

I'd like to launch a similar guest and recreate the scenario.

On Tue, Jan 16, 2018 at 4:45 PM, Joshua Powers <email address hidden>
wrote:

> First install curtin log: https://paste.ubuntu.com/26400611/
> Checking swapon pointed to /swap.img
>
> Second install
> /tmp/subiquity-curtin-install.conf: https://paste.ubuntu.com/26400656/
> /tmp/subiquity-curtin-install.log: https://paste.ubuntu.com/26400658/
>
> ** Changed in: curtin
> Status: Incomplete => New
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1743643
>
> Title:
> Install to dirty disk with swap fails
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/curtin/+bug/1743643/+subscriptions
>

Joshua Powers (powersj) wrote :
Ryan Harper (raharper) wrote :

OK,

After rebooting a system with a swap *partition* vs. the swap file, the
normal live-cd boot process
selects the swap partition and enables it.

It would be good to disable that sort of behavior in the livecd process;

Additionally on curtin, in clear-holders, we will need to check if a target
disk or partition is
an active swap and disable/remove it.

This is somewhat troublesome w.r.t possibility of swap being used; so
ideally we'd prevent the
live-cd environment from loading swap partitions to begin with.

On Tue, Jan 16, 2018 at 5:06 PM, Joshua Powers <email address hidden>
wrote:

> virsh dumpxml output: https://paste.ubuntu.com/26400763/
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1743643
>
> Title:
> Install to dirty disk with swap fails
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/curtin/+bug/1743643/+subscriptions
>

Changed in curtin:
importance: Undecided → Medium
status: New → Confirmed
Michael Hudson-Doyle (mwhudson) wrote :

Ah haha what fun. Do you know which component is responsible for looking for swap partitions and mounting them?

Ryan Harper (raharper) wrote :

On Tue, Jan 16, 2018 at 5:51 PM, Michael Hudson-Doyle <
<email address hidden>> wrote:

> Ah haha what fun. Do you know which component is responsible for looking
> for swap partitions and mounting them?
>

the journal logs point to kernel; But I would generally suspect systemd
instead.

I can't find this generator but I believe it's gpt-auto-generator which
looks at GPT
partitions and can add a swap that's found but not in /etc/fstab

https://github.com/systemd/systemd/issues/6192
https://bugs.freedesktop.org/show_bug.cgi?id=87230
https://www.reddit.com/r/archlinux/comments/5w1wkt/help_disabling_second_swap_partition_automounting/

>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1743643
>
> Title:
> Install to dirty disk with swap fails
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/curtin/+bug/1743643/+subscriptions
>

Ryan Harper (raharper) wrote :

On Wed, Jan 17, 2018 at 8:07 AM, Ryan Harper <email address hidden>
wrote:

>
>
> On Tue, Jan 16, 2018 at 5:51 PM, Michael Hudson-Doyle <
> <email address hidden>> wrote:
>
>> Ah haha what fun. Do you know which component is responsible for looking
>> for swap partitions and mounting them?
>>
>
> the journal logs point to kernel; But I would generally suspect systemd
> instead.
>
> I can't find this generator but I believe it's gpt-auto-generator which
> looks at GPT
> partitions and can add a swap that's found but not in /etc/fstab
>

Digging deeper into the livecd: casper removes/purges the
systemd-gpt-auto-generator which normally would
create a swap unit for gpt partitions marked as swap; however, there is
also another nice casper script
13swap which checks partitions for SWAPMAGIC value, and if so, calls
'swapon' $device.

I think casper scripts are part of the livecd-rootfs package, so we can
target that package as well to see
if there is a way disable the swapon bits.

I'm still working on curtin to have it remove target devices from swap if
they're added, however I do think it
would be best to not swap on target devices in the installer env.

>
> https://github.com/systemd/systemd/issues/6192
> https://bugs.freedesktop.org/show_bug.cgi?id=87230
> https://www.reddit.com/r/archlinux/comments/5w1wkt/
> help_disabling_second_swap_partition_automounting/
>
>
>>
>> --
>> You received this bug notification because you are subscribed to the bug
>> report.
>> https://bugs.launchpad.net/bugs/1743643
>>
>> Title:
>> Install to dirty disk with swap fails
>>
>> To manage notifications about this bug go to:
>> https://bugs.launchpad.net/curtin/+bug/1743643/+subscriptions
>>
>
>

Ryan Harper (raharper) on 2018-02-07
Changed in curtin:
status: Confirmed → Fix Committed
Michael Hudson-Doyle (mwhudson) wrote :

Wont fix for subiquity as curtin fixes should suffice.

Changed in subiquity:
status: New → Won't Fix

However we should probably fix it in casper too...

tags: added: id-5a712e25c7ccf9ed05ca2289
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in casper (Ubuntu):
status: New → Confirmed
Andreas Hasenack (ahasenack) wrote :

I'm still seeing this in yesterday's (feb 21st) image, fwiw.

Ryan Harper (raharper) wrote :

Can you:

journalctl -b | grep -i "curtin: Installation started."

That should dump the curtin version that was used; This is fixed in trunk
but not yet uploaded to bionic.

It's not clear how the live image obtains curtin, whether via the subiquity
snap
or using curtin from deb.

On Wed, Feb 21, 2018 at 10:46 AM, Andreas Hasenack <email address hidden>
wrote:

> I'm still seeing this in yesterday's (feb 21st) image, fwiw.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1743643
>
> Title:
> Install to dirty disk with swap fails
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/curtin/+bug/1743643/+subscriptions
>

I guess we could be totally unsubtle and do this: https://code.launchpad.net/~mwhudson/livecd-rootfs/lp-1743643/+merge/341440

Changed in casper (Ubuntu):
status: Confirmed → In Progress
status: In Progress → Invalid
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package livecd-rootfs - 2.513

---------------
livecd-rootfs (2.513) bionic; urgency=medium

  * In the live-server build, prevent casper from mounting any existing
    swap partitions from drives we might later be installing to.
    (LP: #1743643)

 -- Michael Hudson-Doyle <email address hidden> Wed, 21 Mar 2018 15:58:02 +1300

Changed in livecd-rootfs (Ubuntu):
status: New → Fix Released

This bug is believed to be fixed in curtin in 18.1. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in curtin:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.