Custom storage mounting

Hi,
Is it possible to mount my storage using Label instead of UUID, using maas?
so far I was able to format my device using the ff
maas admin block-device format $SYSTEM_ID sda fstype=xfs label=MINIODRIVE1
but I can’t figure out how or what options is needed(checked docs/–help) to mount it using the label I’ve specified in the format.
I’ve tried the ff but it defaults to UUID
maas admin block-device mount $SYSTEM_ID sda mount_point=/mnt/drive-1 mount_options="defaults,noatime"

Maas version is 3.5.0 via snap.

Regards,
Jeff

Hi Jeff,

Regarding the documentation:

  • The main source of the documentation for MAAS CLI comes from the CLI itself. However, since MAAS CLI is generated directly from the API you can also use the API documentation where is easier to navigate. Specifically, the Block device/Block devices sections.
  • There is also the guide about How to manage block devices that describes all the actions that can be used with block devices.

Being said that, for what I see you are formatting and mounting the storage correctly. I do not think there is any other option to mount it. Could you provide an example (CLI output, screenshot…) about what you mean about the defaulting to UUID?

hi Javier,
Good day, thanks for the doc links. I’ve checked the api for mounting and looks like only mount_options and mount_point are available. At the moment when doing the mount command

maas admin block-device mount $SYSTEM_ID sda mount_point=/mnt/drive-1 mount_options="defaults,noatime"

in the installation log I see

Running command ['mount', '-t', 'xfs', '-o', 'defaults,noatime', '/dev/sda', '/tmp/tmp5lt9rmi3/target/mnt/drive-1'] with allowed return codes [0] (capture=True)

which in turn creates an mount entry in /etc/fstab using UUID

/dev/disk/by-uuid/9228cdae-d344-40b4-acdc-2916134a2a41 /mnt/drive-1 xfs defaults,noatime 0 1

What I would like to do is find a equivalent of the mount command by label

mount -L 'MINIODRIVE1' -t xfs -o 'defaults,noatime' /dev/sda mnt/drive-1

so that it would show up in the /etc/fstab as

LABEL=MINIODRIVE1 /mnt/drive-1 xfs defaults,noatime 0 1

In case its not possible via maas-cli/api atm and before doing the mounting in cloud-init scripts, is there some kind “deploy script” like commissioning/test scripts I can use within maas?

Regards,

Jeff

Ok, I see. Thanks for the detailed explanation :slight_smile:

I am afraid it is not possible to use the CLI or API to achieve what you proposed.

Mounting devices is handled in MAAS by using curtin. Actually, mount_options is not directly used by MAAS but used to replace the default values in curtin.

I do not think curtin allows to configure that option. According to the documentation of the mount command:

When entries are created in /etc/fstab , curtin will use the most reliable method available to identify each device. For regular partitions, curtin will use the UUID of the filesystem present on the partition. For special devices, such as RAID arrays, or LVM logical volumes, curtin will use their normal path in /dev.

Thus, if you are using a regular partition curtin will use UUID.

Nonetheless, I would suggest taking a look at curtin documentation, and in case that you find something that you want to test you can use it in MAAS through pre-seed files:
https://maas.io/docs/how-to-customise-machines

Hi Javier,

Thanks for the additional information, I’ll have a look at those.

Regards,
Jeff

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.