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.

SNAP Plugin for unRAID v6 - DEPRECATED

Featured Replies

Do others agree with the "by design" conclusion?

 

I prefer to think of it as being at one step in its evolution.  We are waiting for dlandon to adjust his priorities and forgo job, family, sleep, and get back to work on the next steps, such as individual partition support, automatic recognition of hot-plugged devices of all types, support for 10 more file systems, etc etc ...      ;)

  • 1 month later...
  • Replies 163
  • Views 38.4k
  • Created
  • Last Reply

I've decided to re-purpose an old SSD for putting a Windows8 VM and my docker image on; outside the array.

 

I believe this plugin is the 'right' way to do this, but want to clarify a couple things before moving forward.

 

Using this plugin, I can mount the SSD automatically, but only after mounting it with the plugin, then adding a line to my go file, right?

 

Do I have to do anything to force the drive to maintain its name thru reboots?

 

Do I have to format this drive, and if so, what should I use so that I can just copy my windows8.qcow2 and my docker image to this drive, and continue to use them they way I do now?

 

Anything else I need to do/be aware of to get all this working?

 

thanks

I installed SNAP.  It recognizes my SSD, and lets me name the drive.  However, I can't actually mount the drive.

 

It shows as NTFS file system, which is correct.  Is that the reason it can't mount the drive?

 

What's next?

  • Author

I installed SNAP.  It recognizes my SSD, and lets me name the drive.  However, I can't actually mount the drive.

 

It shows as NTFS file system, which is correct.  Is that the reason it can't mount the drive?

 

What's next?

 

Right click on the SNAP webpage on the drive and you can mount it.

Right click on the SNAP webpage on the drive and you can mount it.

 

Ah, I didn't think to r-click the drive.  I was just trying to click the box with the M, which shows the mounted status.

 

right-click the drive did allow me to mount it.

 

Now I just need to figure out what to do next :)

  • Author

You can mount the drive in your go file to have it ready for VMs.

 

To mount:

 

/boot/config/plugins/snap.sh -m ShareName

 

To mount and share:

 

/boot/config/plugins/snap.sh -ms ShareName

You can mount the drive in your go file to have it ready for VMs.

 

To mount:

 

/boot/config/plugins/snap.sh -m ShareName

 

To mount and share:

 

/boot/config/plugins/snap.sh -ms ShareName

 

I assume I need to share in order to use it for my VM's and docker, yes?

 

Also, now that I've manually mounted and shared it, how do i access and use it?

 

I can see it in putty/midnight commander, but can't see it as a share, or see any other way to access/use it from my array.

Justin,

 

  Did you give the share a name via the snap settings Share Name column? Does that name show up on the snap settings page in the Share Name column? What do the status icons show?

 

Reed

  • Author

If you mount and share it, you'll see it in the network on a Windows machine using SMB.

 

On unRAID you'll see it as /mnt/user/ShareName just like other shares.

Do I have to share it to be able to use it for a VM image and/or docker; or is sharing it only for me to see it in windows via SMB?

 

Also, how do I format it, so I can then put the VM and docker images I already have onto that drive?

Justin,

 

  Did you give the share a name via the snap settings Share Name column? Does that name show up on the snap settings page in the Share Name column? What do the status icons show?

 

Reed

 

Yes, appdisk, which does show in the name column, and the icons show mounted and shared, not busy, spun down.

 

It looks to me like it's 'right', I just don't know how to use/access it.

 

** I had started writing this before dlandon replied, but didn't realize I didn't his post.  :P

  • Author

Do I have to share it to be able to use it for a VM image and/or docker; or is sharing it only for me to see it in windows via SMB?

 

Also, how do I format it, so I can then put the VM and docker images I already have onto that drive?

 

Sharing it makes it visible through smb.  Just mount it and use it through /mnt/user/ShareName.  You don't have to share it.

 

You'll have to format the drive through the cli or externally to unRAID.  Snap doesn't format drives.

fantastic, thanks again!

 

My drive rebuild will finish in a couple minutes, so I'll format, and get the go script updated, and see how I manage :)

I've been looking for how to format the drive in putty, but now I have another question; what format to use for SSD?

 

I was thinking XFS, like the rest of the array, but saw ext4 suggested for SSD due to it's ability to use TRIM.  I'm not sure I need TRIM for a VM image (qcow2) or the docker image, so I thought it best to ask before proceeding.

 

thoughts?

  • Author

I've been looking for how to format the drive in putty, but now I have another question; what format to use for SSD?

 

I was thinking XFS, like the rest of the array, but saw ext4 suggested for SSD due to it's ability to use TRIM.  I'm not sure I need TRIM for a VM image (qcow2) or the docker image, so I thought it best to ask before proceeding.

 

thoughts?

 

SNAP mounts an ext4 formatted drive with discard on.  I have done some research and there are some that think that enabling trim on a mount of a drive is overkill, is not necessary, and might affect the performance of the drive.  I have a daily cron task that does an fstrim on my xfs formatted cache drive.  Once a day should be enough.  I would format the drive as xfs and then run fstrim periodically.

 

fstrim -v /mnt/cache | logger

 

If your VM is a Windows OS, I would also suggest turning off indexing of the files on the drive and turn off the defragment schedule.  Neither of those is necessary on an SSD and will actually add additional wear to the drive.

I've been looking for how to format the drive in putty, but now I have another question; what format to use for SSD?

 

I was thinking XFS, like the rest of the array, but saw ext4 suggested for SSD due to it's ability to use TRIM.  I'm not sure I need TRIM for a VM image (qcow2) or the docker image, so I thought it best to ask before proceeding.

 

thoughts?

 

SNAP mounts an ext4 formatted drive with discard on.  I have done some research and there are some that think that enabling trim on a mount of a drive is overkill, is not necessary, and might affect the performance of the drive.  I have a daily cron task that does an fstrim on my xfs formatted cache drive.  Once a day should be enough.  I would format the drive as xfs and then run fstrim periodically.

 

fstrim -v /mnt/cache | logger

 

If your VM is a Windows OS, I would also suggest turning off indexing of the files on the drive and turn off the defragment schedule.  Neither of those is necessary on an SSD and will actually add additional wear to the drive.

 

good information, but it confused me  :-\

 

This SSD is not for my cache drive, only for a drive to store the VM and docker images.  it's 64GB, and my current windows8 VM is 50GB, and the docker is 10GB.  Will that leave enough room on the drive to prevent is slowing down because of not having enough free/swap space?

 

Also (where you confused me), you said SNAP will mount an ext4 drive, but earlier you said it doesn't format drives, then you said I should format as XFS, then run a daily cron job to do fstrim on the drive.

 

I just want to make sure I parsed the advise as this..

 

format the SSD as XFS and setup a cron job to do fstrim

 

i don't need/want to do ext4 on the drive, correct?

 

if i got all that right, do you have any ideas/suggestions on how to format as XFS in putty?

 

thanks again for taking the time to walk me thru this; sorry I'm asking so many questions :(

  • Author

good information, but it confused me  :-\

 

This SSD is not for my cache drive, only for a drive to store the VM and docker images.  it's 64GB, and my current windows8 VM is 50GB, and the docker is 10GB.  Will that leave enough room on the drive to prevent is slowing down because of not having enough free/swap space?

 

It doesn't make any difference if it is for a cache drive or a SNAP mounted drive.  As far as free space, it should not be a problem unless your VM is a qcow image that can grow in size.  Trim is used to let the SSD know how much free space is on the drive according to the OS being used.  There is no swap on that drive.

Also (where you confused me), you said SNAP will mount an ext4 drive, but earlier you said it doesn't format drives, then you said I should format as XFS, then run a daily cron job to do fstrim on the drive.

 

I only made a suggestion.  You can use ext4 mounted with SNAP that will turn on trim for the drive, or format the drive xfs and do a daily cron fstrim.  You could do either.  I favor an xfs drive with a daily fstrim,

I just want to make sure I parsed the advise as this..

 

format the SSD as XFS and setup a cron job to do fstrim

 

i don't need/want to do ext4 on the drive, correct?

 

Either ext4 or xfs with a daily fstrim will do the job.  In your case: fstrim -v /mnt/user/ShareName.

if i got all that right, do you have any ideas/suggestions on how to format as XFS in putty?

 

thanks again for taking the time to walk me thru this; sorry I'm asking so many questions :(

 

I'm not familiar enough with formatting drives in Linux to offer suggestions on how to format the drive.  I'd probably just install the drive and set it up as a cache drive and let unraid format it, then unassign it as a a cache drive.

Either ext4 or xfs with a daily fstrim will do the job.  In your case: fstrim -v /mnt/user/ShareName.

 

Okay, I got the drive factory reset, then formatted as XFS.  I named the drive snapdisk, and verified it's XFS.  I updated my go file...

 

#!/bin/bash
# Start the Management Utility
/usr/local/sbin/emhttp &
echo 192.168.20.150 media >>/etc/hosts
/usr/local/sbin/vfio-bind 0000:01:00.0 0000:01:00.1 0000:07:00.0
/boot/config/plugins/snap.sh -m snapdisk

 

and now I just need to set the cron job.  I've never done that, and searching the forums didn't reveal an easy 'how to' on this, so if I can pester you for one more bit of help, I'd really love to know how to add the cron job.

 

Thanks again.

  • Author

Create a script file and the copy it to /etc/cron.daily and unraid will execute it every day.

What is the best and preferred way to unmount these disk outside array when shutting down the server?

Create a script file and the copy it to /etc/cron.daily and unraid will execute it every day.

 

Thanks.  I try to figure out how to "create a script file" later today :)

 

I just rebooted the server, and the disk was not mounted.  I checked the go file, and the line was still there, but wrong.  I had

/boot/config/plugins/snap.sh -m snapdisk, but it needs to be

/boot/config/plugins/snap/snap.sh -m snapdisk  to get to the snap.sh file.

 

I fixed that and rebooted, but the drive was still not mounted upon startup, so now I'm not sure what's wrong.  I checked the plugin, and the drive is still showing, and with the correct name, but obviously, it's not mounted.

 

Any ideas on what I need to do to get it mounting on startup?  Does that line need to be in a certain order in the go file?  before emhttp, after, or should it not matter?

Aw crap; I just looked, and it's showing with no file system, so it seems to have gotten corrupted when unRAID decided to reboot this morning for no reason :( :( :(

 

 

  • Author

What is the best and preferred way to unmount these disk outside array when shutting down the server?

 

Install the powerdown plugin and create a K script to unmount the drive when the array is shutdown.

  • Author

Test your command line by mounting the drive in a telnet session.  That way you will know if there are any issues and can sort them out before putting it in the go file.

 

To create the daily trim script file.  Put this into a file and put it on your flash drive at /boot/custom/DailyTrim:

 

#
# Trim the SSD drive.
#
fstrim -v /mnt/user/ShareName | logger

 

Put the following in your go file:

#
# Set up daily SSD cache trim for unRaid cron
#
fromdos < /boot/custom/DailyTrim > /etc/cron.daily/DailyTrim
chmod +x /etc/cron.daily/DailyTrim

 

The fromdos insures that the script is in linux format with line feeds only.

Archived

This topic is now archived and is closed to further replies.

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.