DB-유

Creating Volumes and Shared Folders on Synology

· synology, storage, nas

I've clicked through the DSM setup wizard's automatic storage setup exactly once, and I regretted it. It picked SHR and ext4 on that model, and once a volume is formatted you can't change the file system without wiping it. Now I always skip the wizard and build the layout by hand.

Here's the route I take on DSM 6.x, from empty disks to a shared folder a Windows or Linux client can reach. Before you start, make sure every disk shows "Normal" under Storage Manager → HDD/SSD, and decide on redundancy: two or more disks for SHR/RAID 1, three or more for SHR-2/RAID 5/RAID 6.

Disk group or storage pool

Open Storage Manager. Depending on the model and DSM build the second tab is called Disk Group or Storage Pool; the workflow is the same.

  1. Click Create.
  2. Choose the RAID type. For a home or small office box with mixed drive sizes, SHR is the practical choice because it uses the extra capacity of larger disks. For identical enterprise disks, RAID 5 or RAID 6 behaves more predictably.
  3. Select the disks. Any data on them is destroyed.
  4. Leave "Perform disk check" enabled on new drives. It takes hours on 4 TB disks but catches dead-on-arrival units before you put data on them.

Building parity takes a while. You can create the volume while the group is still optimising, but it'll crawl until it finishes. I just go do something else for a day.

The volume

Switch to the Volume tab and click Create. Choose Custom rather than Quick so you get to pick the file system.

  • Btrfs: available on the plus-series and higher. Enables shared folder snapshots, data checksumming, and per-folder quotas. This is what I use on anything that supports it.
  • ext4: the only option on the entry-level j-series and some value models. Perfectly stable, just without snapshots.

Allocate the full capacity unless you have a specific reason to keep space for a second volume. Multiple volumes on the same disk group only make sense when you want a different file system or want to isolate a Surveillance Station or Docker workload.

After the volume shows "Normal", check it from the shell if you like:

ssh admin@nas
sudo df -h /volume1
sudo mount | grep volume1

You should see /dev/mapper/cachedev_0 or /dev/md2 mounted on /volume1 with type btrfs or ext4.

Shared folder

Go to Control Panel → Shared Folder → Create. Fill in:

  • Name: keep it short and without spaces; it becomes the SMB share name and the path /volume1/<name>.
  • Location: the volume you just created.
  • Hide this shared folder in "My Network Places": useful for admin-only shares.
  • Enable Recycle Bin: I turn this on for user data shares and off for backup targets, where it only doubles the disk usage of rotated files.

On Btrfs volumes the Advanced tab also offers "Enable shared folder quota" and "Enable data checksum for advanced data integrity". The checksum option costs a little write performance, so I enable it for documents and photos but leave it off for shares holding virtual machine images or database files.

Encryption is decided here as well. An encrypted shared folder uses eCryptfs and limits file names to 143 characters. If you tick it, download the key file and store it somewhere other than the NAS.

Permissions

The wizard ends on the Permissions tab. Grant Read/Write to the users or groups that need it, and give everyone else No Access. I create a group per share in Control Panel → Group first, so permissions are managed by group membership rather than per user.

For a Linux client that will mount over NFS, open the shared folder, click Edit → NFS Permissions → Create and add a rule such as:

Hostname or IP: 192.168.1.0/24
Privilege: Read/Write
Squash: Map root to admin
Security: sys
Enable asynchronous: yes

Then make sure NFS itself is switched on under Control Panel → File Services → NFS.

Did it work?

From Windows, browse to \\nas\<sharename> and create a test file. From Linux:

sudo mount -t cifs //nas/data /mnt/data -o username=youruser,vers=3.0
touch /mnt/data/test.txt
ls -la /mnt/data

On the NAS itself, confirm the folder and its owner:

ls -ld /volume1/data

New shared folders are owned by root:users with mode 777 at the top level; DSM enforces the real access control through Samba and the NFS exports, not through the POSIX bits.

Things that bit me

  • "The volume cannot be created because the disk group is crashed" usually means one of the new disks failed its initial check. Look at Storage Manager → HDD/SDD → Health Info and replace the disk before continuing.
  • Windows shows "You do not have permission to access \nas\share" even though the user has Read/Write. Nine times out of ten the user is also a member of a group with No Access, and No Access always wins. Check Control Panel → User → Edit → Permissions, which shows the effective result.
  • Btrfs is not offered in the file system dropdown. The model does not support it; there is no way to enable it, so choose ext4.
  • A share that was created encrypted shows as empty after a reboot. Encrypted folders are not mounted automatically unless "Mount automatically on startup" was ticked, which DSM discourages for security. Mount it manually from Control Panel → Shared Folder → Encryption → Mount.

SHR versus classic RAID, and Btrfs versus ext4. Those are the two choices worth losing sleep over. Everything else can be fixed later.