Manually performed partitioning changes get reverted on reboot
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Triaged
|
Medium
|
Unassigned | ||
cloud-init |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Hello,
I am facing an issue where I need to make changes to the initially deployed partition layout, but upon making those changes and rebooting, the partition layout gets reverted.
My env:
MAAS version: 2.6.0 (7802-g59416a86
System vendor: HP
System product: ProLiant DL360 Gen9 (780021-S01)
System version: Unknown
Mainboard product: ProLiant DL360 Gen9
Mainboard firmware version: P89
Mainboard firmware date: 12/27/2015
CPU model: Intel(R) Xeon(R) CPU E5-2690 v3
Deployed (16.04 LTS "Xenial Xerus")
Kernel: xenial (ga-16.04)
Power type: ipmi
Power driver: LAN_2_0 [IPMI 2.0]
Power boot type: EFI boot
Architecture amd64/generic
Minimum Kernel: no minimum kernel
Interfaces: eno1, eno2, noe3, eno4, eno49, eno50. Only eno49 is used.
Storage: sda Physical 1TB, sdb Physical 1TB.
Steps to reproduce:
1. Deploy MAAS with the following partition configuration:
sda-part1 536.9 MB Partition fat32 formatted filesystem mounted at /boot/efi
sda-part2 100.0 GB Partition ext4 formatted filesystem mounted at /
2. Check the partitions on the node:
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931.5G 0 disk
|-sda1 8:1 0 512M 0 part /boot/efi
`-sda2 8:2 0 931G 0 part /
sdb 8:16 0 931.5G 0 disk
Here we notice the initial partitioning scheme is not respected. This could be related to the main issue of partitioning changes being reverted, but could also be a separate issue.
3. Boot an ubuntu ISO and go into rescue mode. I used ubuntu-
4. Choose "Do not use a root filesystem" and "Execute a shell in the installer environment".
4. Run the following commands:
$ e2fsck -f /dev/sda2
$ resize2fs /dev/sda2 150G
$ e2fsck -f /dev/sda2
$ sudo parted /dev/sda
(parted) unit GiB print
(parted) resizepart
Partition number? 2
End? 200GiB
(parted) print
You should see partition 2 resized.
(parted) quit
$ e2fsck -f /dev/sda2
5. Confirm
$ fdisk -l
6. Sync writes
$ sync
7. Reboot the node. Remove ISO image.
8. Let system boot, check partitions again:
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931.5G 0 disk
|-sda1 8:1 0 512M 0 part /boot/efi
`-sda2 8:2 0 931G 0 part /
sdb 8:16 0 931.5G 0 disk
We can see see that the changes were reverted.
If I remove cloud-init, I can successfully re-partition and reboot, without the changes being reverted.
Attached logs before and after repartition.
summary: |
- Manully performed partitioning changes get reverted on reboot + Manually performed partitioning changes get reverted on reboot |
Changed in maas: | |
milestone: | 2.7.0b1 → 2.7.0b2 |
Changed in maas: | |
milestone: | 2.7.0b2 → none |
Changed in maas: | |
milestone: | 3.4.0 → 3.4.x |
Hello,
After speaking with some folks, we realized the resizefs or growpart modules are growing back the partitions on every reboot.
However, it should do so only when /var/lib/ cloud/instance changes. In my case it never changed, I was using the same MAAS machine all the time. There could be a bug in the way it the instance value to previous values, causing it to think it is a new machine every time I reboot.