linuxmuster / linuxmuster-linbo

Linbo imaging system for linuxmuster.net
23 stars 22 forks source link

linbo maupilating the local start.conf when finding labels with same name #141

Closed baumhof closed 3 years ago

baumhof commented 4 years ago

Hi There,

if linbo finds labels on the local storage of the client during boot it replaces the korresponding entries in the local start.conf.

Steps to recreate the Fault: 1) take a start.conf in a group with, among others, these Partitions: cache /dev/sda3 30GB ID83 ext4 swap /dev/sda5 4GB ID82 swap (importaint: the First word is the Label in the start.conf: label = cache label = swap )

2) boot Client an format. Optional: check start.conf on Client and blkid on Client

3) swap the two Partitions in the start.conf on the server: swap /dev/sda3 4GB ID82 swap cache /dev/sda5 30GB ID83 ext4 and change the cache Statement in the Head of the start.conf to /dev/sda5 I did an linuxmuster-import-devices afterwards: might not be necessary.

4) boot up Client, open linbo-ssh to the Client and view the start.conf (as seen in my last screenshot)

linbo-partitionsproblem1 linbo-partitionsproblem2 linbo-partitionsproblem3

If it helps: i encounterd this Problem for the first time in Sept 2019 after migrating from lmn6.2 to lmn7. One Hardwareclass moved from win7+ubuntu to only ubuntu, and the cachepartition moved. I had to manually clean the partitiontable. Workaround: use different labels in the new start.conf on server.

LG

Holger

fschuett commented 4 years ago

The error happens in function update_devices in Module linbo_cmd. I don't understand the use of this function. In my understanding the hdd should be manipulated with values from start.conf and start.conf should never be manipulated with values from the hdd. May be it makes sense, if one hdd is "/dev/sda" an on a different host it is "/dev/mmcblk0", but in my oppinion this should be managed with different linbo groups. I recommend removing this function.

fschuett commented 4 years ago

To fix the problem update_devices could check if dev and devnew are on different hdds.

fschuett commented 4 years ago

fix-update_devices.zip Attached is a patch that prevents update_devices from changing local start.conf if dev and devnew happen to be on the same device.