Opened 5 weeks ago

Closed 3 weeks ago

Last modified 3 weeks ago

#19253 closed bug (fixed)

mount_server's "Restore previously mounted volumes" funtionality is bogus.

Reported by: bipolar Owned by: stippi
Priority: normal Milestone: R1/beta6
Component: Servers/mount_server Version: R1/beta5
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

I have set, via Tracker, the "Disk mounting during boot" option to "Previously mounted disks".

Via the kottan app, I can see that the ~/config/settings/mount_server file contains the correct values for:

  • all the boolean settings (only initialMountRestore set to true in my case)
  • 2 messages under info, for the two disks I want to be automatically mounted at boot: "Haiku64" (boot volume), and "Data1" partition.

Yet, upon boot, I end up with 3 volumes being mounted:

  • Haiku64 (a 64 bits install of beta5)
  • Haiku32 (a 32 bits install of beta5)
  • Data1

Similar thing when I boot Haiku32, all the three above get auto-mounted, despite having the correct settings in the mount_server file.

Change History (13)

comment:1 by humdinger, 5 weeks ago

FWIW, it works for me. 64bit beta5.

comment:2 by diver, 5 weeks ago

Same issue here. 64bit latest nightly.

comment:3 by bipolar, 5 weeks ago

I've double checked, on both VirtualBox, and on bare metal. Same wrong results everywhere for me with beta5+125, and even on an hrev58095 nightly I had lying around.

In case it change things, I have 7 partitions (6 BFS) on disk1, and 5 partitions on disk2 (2 ntfs, 1 ext4, 2 BFS), and disk3 (1 each of ntfs, ext4, BFS).

For VMs, only disk1 and disk2 are attached. When running bare metal all three disk are present. All disks with MBR-style partitions.

On hrev58095, I tried setting only the boot partition (disk3) and "data1" from disk1... upon reboot, 3 partitions were mounted: boot (disk3), and from disk1: "data1" and "temp1". On a following reboot, one more BFS partition was automounted: "temp2" :-/

comment:4 by waddlesplash, 5 weeks ago

Milestone: UnscheduledR1/beta6

comment:5 by bipolar, 5 weeks ago

I *think* the issue lies in the way MountArchivedVisitor calculates a "score" for each partition, to decide if it should auto-mount it. In MountArchivedVisitor::_Score(BPartition partition):

It assigns +4 "score points" if the capacity of a given partition matches the value stored on the info BMessage from the settings.

It then assigns ~+3 points if the deviceName matches.~ +1 if fsName matches, and +1 if blockSize matches. (deviceName won't match for partitions on the same disk, but can cause issues if you change driver order on BIOS or when switching from VM to bare-metal).

If I'm reading things right, a "score" value >= 6 means the partition gets auto-mounted.

In my case, "Haiku32" and "Haiku64" have the exact same capacity, ~and they are on the same device~ and are BFS formated, with same block size, thus they will get always auto-mounted together. Same with my "Data1"/"Data2" and "Temp1"/"Temp2" partitions.


I guess we need something more robust than that scoring mechanism, which clearly is not a good match for my setup :-)

Version 3, edited 5 weeks ago by bipolar (previous) (next) (diff)

comment:6 by bipolar, 5 weeks ago

The following change, while far from perfect, fixes the issue for me: https://review.haiku-os.org/c/haiku/+/8565

comment:7 by X512, 5 weeks ago

GPT unique partition GUID (not type GUID) can be used if available.

comment:8 by bipolar, 5 weeks ago

Sadly on this machine I only have MBR-style partitions. Would be nice if there was a way of adding some form of "unique" ID into BFS partitions, but I guess if there was... it would be in use already.

comment:9 by monni, 5 weeks ago

One way to get semi-unique ID is to store time of initializing/formatting the partition in the root directory metadata, but Haiku doesn't have statx() function yet to return full metadata of directory or file. Like I mentioned in 8565, file systems like FAT already store the information when partition was formatted in MS-DOS or Windows (not sure about tools in other operating systems).

comment:10 by nephele, 5 weeks ago

bipolar: fwiw gpt partition tables can be used on mbr booted computers too, but this depends on the firmware a bit. Some may have issues but it usually works. In that case this should work woth gpt uids.

comment:11 by waddlesplash, 3 weeks ago

Resolution: fixed
Status: newclosed

Fix merged in hrev58366.

comment:12 by diver, 3 weeks ago

I wonder if a commit here is related to this issue? https://github.com/axeld/haiku/tree/mount_server

comment:13 by diver, 3 weeks ago

Ah, never mind, it was actually already merged in hrev51932.

Note: See TracTickets for help on using tickets.