Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Offical apps | Community apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Support
  3. Volumes created before v10: mount unit keeps `/dev/sdX` after disk path migration, wrong disk mounted after reboot

Volumes created before v10: mount unit keeps `/dev/sdX` after disk path migration, wrong disk mounted after reboot

Scheduled Pinned Locked Moved Solved Support
volumesmigration
5 Posts 2 Posters 92 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T
    T
    tobiasb
    wrote last edited by girish
    #1

    Version: 10.1.6 (also checked current master, no change in the related code)

    Summary

    The migration 20260611170000-stabilize-diskpaths.js changes diskPath of ext4/xfs volumes in the database to a stable /dev/disk/by-id/... path. It does not rewrite the systemd mount unit in /etc/systemd/system/. The unit keeps the kernel device name (for example What=/dev/sdb). The dashboard shows the by-id path, but systemd mounts /dev/sdb.

    When a server has more than one block device, the kernel can assign sdb and sdc in a different order after a reboot. Then Cloudron mounts the wrong disk into the volume.

    What happened

    1. In February 2026 we created a volume on a Hetzner disk. The dashboard only offered /dev/sdb at that time. The unit file got What=/dev/sdb.
    2. After the update to v10, the dashboard showed /dev/disk/by-id/scsi-0HC_Volume_<id> for this volume. The unit file did not change (file date still February 2026).
    3. In November 2026 we attached a second Hetzner disk and created a second volume. This volume got a correct by-id unit.
    4. The next reboot (unattended-upgrades) was the first boot with both disks. The kernel swapped sdb and sdc.
    5. Both volumes were now mounted from the same disk. The Nextcloud app on the first volume started on the wrong disk, created a new empty directory structure and reported Nextcloud is not installed.
    6. "Remount" in the dashboard did not help. It restarts the existing unit and mounts /dev/sdb again.

    The database was not affected. After we fixed the unit file, the app started normally with all data.

    Cause in the code

    • migrations/20260611170000-stabilize-diskpaths.js updates volumes.mountOptionsJson and backupSites.configJson only. It does not touch the unit files.
    • src/scripts/remountmount.sh only runs systemctl stop and systemctl start on the existing unit.
    • src/mounts.js writes What= from mountOptions.diskPath only when a mount is added.

    The same problem can affect backup sites with the ext4/xfs provider.

    How to check

    grep --with-filename "^What=/dev/sd" /etc/systemd/system/mnt-*.mount
    

    Each result is a unit that uses an unstable device name.

    Workaround

    Stop the apps that use the volume, then:

    cp /etc/systemd/system/mnt-volumes-<volume-id>.mount /root/
    sed --in-place 's|^What=/dev/sd.*$|What=/dev/disk/by-id/scsi-0HC_Volume_<id>|' /etc/systemd/system/mnt-volumes-<volume-id>.mount
    systemctl daemon-reload
    systemctl restart mnt-volumes-<volume-id>.mount
    docker restart sftp
    

    Then start the apps again.

    Suggested fix

    One of these options:

    1. A migration that rewrites the unit files of all volumes and backup sites with the changed diskPath, followed by systemctl daemon-reload.
    2. Let "Remount" generate the unit file from the database before it starts the unit. Then the dashboard button also repairs old installations.

    The text was not written by myself, I would be to lazy and stupid to create it without typos/mistakes. ๐Ÿ˜„

    1 Reply Last reply
    4
    • girishG
      girishG
      girish
      Staff
      wrote last edited by
      #2

      Ah good catch, was an oversight by me. I guess this is a bit late now since this happened in 10.x, and we are in 10.1.x now already ๐Ÿ˜• Thanks for reporting in any case.

      1 Reply Last reply
      0
      • girishG girish has marked this topic as solved
      • T
        T
        tobiasb
        wrote last edited by tobiasb
        #3

        @girish

        What does mean to late? for the migration (migrations/20260611170000-stabilize-diskpaths.js), sure, when you know all instances are already on latest version. But the units are stil broken, without a fix.

        Or does cloudron handles volumes now differently in the next version?

        1 Reply Last reply
        0
        • girishG
          girishG
          girish
          Staff
          wrote last edited by
          #4

          @tobiasb migrations are only run once. Once released, they cannot be edited i.e no bug fixes can be made to existing migrations. So, to fix the migration, we will have add another new migration in next cloudron release. Not sure if that is worth it since the Cloudrons will remain broken until the next release (whenever that happens).

          T 1 Reply Last reply
          0
          • girishG girish

            @tobiasb migrations are only run once. Once released, they cannot be edited i.e no bug fixes can be made to existing migrations. So, to fix the migration, we will have add another new migration in next cloudron release. Not sure if that is worth it since the Cloudrons will remain broken until the next release (whenever that happens).

            T
            T
            tobiasb
            wrote last edited by
            #5

            @girish

            I unterstand this, we make such updates (in drupal) a no-op updates and create a new one with the fix. With a no-op update, it does not run twice. But I can not say, whether such fix needs a own migration anyway, so that 20260611170000-stabilize-diskpaths.js keeps untouched without to make it a no-op update.

            1 Reply Last reply
            1

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better ๐Ÿ’—

            Register Login
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Bookmarks
            • Search