elementary / elementary/installer

Installer seems to change partition names if they're not in order

Open
#522 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Vala
Stars
182
Forks
53
Avg merge
2d 16h
Merged PRs (30d)
1

Description

Some time ago I created a new partition in the middle of the disk. This means that labels (sdaN) are not in order.
Initial layout of disk, on which I tried to install elementary OS 6 (from logs):
```
INFO: obtaining partition information from /dev/sda1
INFO: obtaining partition information from /dev/sda2
INFO: obtaining partition information from /dev/sda9 <- partition on which I was trying to install
INFO: obtaining partition information from /dev/sda3
INFO: obtaining partition information from /dev/sda4
INFO: obtaining partition information from /dev/sda5
INFO: obtaining partition information from /dev/sda6
INFO: obtaining partition information from /dev/sda7
INFO: obtaining partition information from /dev/sda8 <- swap
```

I selected sda9 to be formatted to ext4 and used as root (/). I selected sda8 to be used as swap.

Then installer swapped those labels:

```
INFO: formatting /dev/sda9 with Swap
INFO: formatting /dev/sda8 with Ext4
```

After this operation layout is changed:

```
INFO: obtaining partition information from /dev/sda1
INFO: obtaining partition information from /dev/sda2
INFO: obtaining partition information from /dev/sda8 <- old sda9
INFO: obtaining partition information from /dev/sda3
INFO: obtaining partition information from /dev/sda4
INFO: obtaining partition information from /dev/sda5
INFO: obtaining partition information from /dev/sda6
INFO: obtaining partition information from /dev/sda7
INFO: obtaining partition information from /dev/sda9 <- old sda8
```

This change is also seen on already installed elementary, which means it's persistent for other linux systems. It's not a problem for me as I use UUID in /etc/fstab, but if someone used device names instead it would render their system unbootable after installation.

I also tried this in a vm with a following partition table:

![Zrzut ekranu z 2021-05-04 23 25 17](https://user-images.githubusercontent.com/24512604/117072284-7ea96c00-ad30-11eb-9ca9-2a0ca8535813.png)

Partition table after installation:
![Zrzut ekranu z 2021-05-04 23 35 04](https://user-images.githubusercontent.com/24512604/117072853-5ff7a500-ad31-11eb-8fd1-3ad5c9d836ea.png)

Labels are changed and put in order.

**To Reproduce**
Steps to reproduce the behavior:
1. Create partition table in such a way that labels (sdaN) are out of order (e.g. create two partitions first, commit changes, then create third one in the middle).
2. Run installer
3. Check labels after installation finishes

**Expected behavior**
Partition labels should stay the same after installation, especially swap and boot which can be shared with other systems.

**Desktop (please complete the following information):**
- OS: elementary OS 6 daily 2021.04.30

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.