1

I am following:

https://github.com/canonical/multipass/pull/1789 and https://lucasroesler.com/posts/2020/multipass-data-partition/ to move MULTIPASS_STORAGE to another location, but I am not lucky.

I am setting MULTIPASS_STORAGE=/pendrive/multipass:

/etc/systemd/system/snap.multipass.multipassd.service.d/override.conf

[Service]

Environment=MULTIPASS_STORAGE=/pendrive/multipass

If I run sudo journalctl -au snap.multipass* I get: Caught an unhandled exception: unable to create directory '/pendrive/multipass/cache'

This is my owner and permission (ls -l):

drwxrwxrwx 2 root multipass 4096 mar 28 22:27 multipass

I have my removable mount point like this: /dev/sdb1 /pendrive If I try sudo snap connect multipass:/pendrive I got error: snap "multipass" has no plug named "/pendrive"

Thank you

Raul Cejas
  • 111
  • 2

1 Answers1

0

There is a problem with the snap confinment and Multipass, it cant access the /pendrive directory.

Here is how to fix this: first be sure that Multipass is connected sudo snap connect multipass:removable-media then update the file /etc/systemd/system/snap.multipass.multipassd.service.d/override.conf to use the /media instead with this

[Service]
Environment=MULTIPASS_STORAGE=/media/pendrive/multipass

then set the correct permissions:

sudo mkdir -p /media/pendrive/multipass
sudo chown root:multipass /media/pendrive/multipass
sudo chmod 775 /media/pendrive/multipass

then Update your /etc/fstab file to mount the pendrive under the /media directory: /dev/sdb1 /media/pendrive ...

then replace the ellipsis with the good mount options for your filesystem and restart with this, then this should work:

sudo umount /pendrive
sudo mount /media/pendrive
sudo systemctl daemon-reload
sudo systemctl restart snap.multipass.multipassd.service
Saxtheowl
  • 1,112
  • 5
  • 8
  • 1
    It is very necesary to put my mount point /pendrive bellow /media ? because I should have to change a lot of think not related with multipass – Raul Cejas Mar 31 '23 at 23:00
  • I implemented you recommend me and it works fine. Thank you – Raul Cejas Apr 01 '23 at 02:49
  • You welcome :) dont forget to accept the question if it solved your problem, also it is not necessary to put your mount point /pendrive below /media – Saxtheowl Apr 01 '23 at 06:54