Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

vDisk for appdata-folders (Docker)

Featured Replies

I recently had the problem that I wanted to move all my Docker data (in the appdata folder) over the network to an external NAS. But since Plex and Jellyfin consists of a lot of small files depending on the size of the media library, copying took me two days despite 10 Gbit/s.

 

I would like to show you here how I solved the problem by moving these files to a vDisk and thus the transfer is now much faster.

 

Structure

  1. Create thin provisioned vDisk
  2. Adjust vDisk-Size
  3. Remove vDisk
  4. Show size
  5. Auto-Mount/-Unmount
  6. Backup vDisk

 

Create thin provisioned vDisk

1. Create vDisk (.img)

truncate -s 100G /path/vDisk.img

(This creates a .img-File with the maximum size of 100 GiB)

 

2. Create file system

mkfs.xfs /path/vDisk.img

(possible options can be displayed by typing "mkfs" in the console and pressing Tab twice)

 

3. Create Mountpoint

mkdir /mountpoint/

(in my case the mountpoint is /mnt/disks/vm/appdata/plex)

 

4. Mount vDisk

mount -t auto -o loop /path/vDisk.img /mountpoint/

 

5. Adjust permissions

chown nobody:users /mountpoint/

(or wathever group or user you use)

 

6. Move files

Now, you can move/copy your files to this mountpoint (vDisk)

mv /plex_directory/* /mountpoint/

(keep in mind to change the permissions after moving the files)

 

 

Adjust vDisk-Size

1. unmount vDisk

umount /mountpoint/

(with the option -l you can force the unmount)

 

2. adjust vDisk size

truncate -s 200G /path/vDisk.img

(200G is the new size)

e2fsck -f /path/vDisk.img && resizefs /path/vDisk.img

(allocate the new size to the filesystem)

 

Remove vDisk

1. unmount vDisk

umount /mountpoint/

 

2. delete vDisk

rm /path/vDisk.img

 

 

Show size

Maximum size vDisk

du -h --apparent-size /path/vDisk.img

 

Effective disk space used

du -h /path/vDisk.img

 

 

Auto-Mount/-Unmount

You can insert this commands into a Userscript for mounting with the start of the Array or unmount with stop of the Array

(I use this config for my daily use. I haven't notice any serious performance drawbacks. Just make sure the vDisk is mountet before you start the Docker-Container!)

 

 

Backup vDisk

To backup a vDisk we just copy the .img fith the following command:

dd if=srcFile.img of=dstFile.img iflag=direct oflag=direct bs=64K conv=sparse

 

Edited by balrog
added some infos

  • 2 years later...
On 10/18/2020 at 4:43 PM, balrog said:

You can insert this commands into a Userscript for mounting with the start of the Array or unmount with stop of the Array

is this command: mount -t auto -o loop /path/vDisk.img /mountpoint/

  • Author
7 hours ago, moonerick said:

is this command: mount -t auto -o loop /path/vDisk.img /mountpoint/

 This is one of them. Here is an example of a full script (mount and unmount):

Mount (0_Mount-vDisks.sh) 

#!/bin/bash
#name=0_Mount-vDisks
#backgroundOnly=true

# Plex
mount -t auto -o loop /mnt/disks/VM/vdisks/PlexMediaServer.img /mnt/disks/VM/appdata/PlexMediaServer/

# VOD
mount -t auto -o loop /mnt/disks/VM/vdisks/vod.img /mnt/disks/VM/appdata/vod/

# Media
mount -t auto -o loop /mnt/disks/VM/vdisks/media.img /mnt/disks/VM/appdata/media/


Unmount (0_Unmount-vDisks.sh)

#!/bin/bash
#name=0_Unmount-vDisks
#backgroundOnly=true

# Plex
umount -l /mnt/disks/VM/appdata/PlexMediaServer/

# VOD
umount -l /mnt/disks/VM/appdata/vod/

# Media
umount -l /mnt/disks/VM/appdata/media/

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.