Synology Terminal Mount Volume & Folder
Synology Terminal Mount Volume & Folder
Synology Terminal Mount Volume & Folder shows commands you can execute via the terminal to mount volumes or encrypted shared folders. Always contact Synology support first for help and follow their directions and make sure you have a working backup. If you like to try it is on your own risk!
Always contact Synology support first for help and make a working backup first. Use this steps on your own risk!
Synology Terminal Mount after a crashed volume:
after a crashed volume which is not recoverable from the GUI you can try to mount the volume as read-only in a terminal.
Make terminal ssh connection to Synology NAS.
cat /etc/fstab
fdisk -l
cat /proc/mdstat
mdadm --detail /dev/<mdX, check cat /proc/mdstat>
check md not listed. For example md9
use at own risk:
mdadm -A -R /dev/<md not listed> /dev/<disk not crashed> /dev/<disk not crashed>
-A, --assemble Assemble a pre-existing array
-R, --run Attempt to start the array even if fewer drives were given than are needed for a full array. Normally if not all drives are found and --scan is not used, then the array will be assembled but not started. With --run an attempt will be made to start it
anyway.
command should return the message "mdadm: /dev/<md not listed> has been started with x drives."
lvm vgscan : take note of volume group name
vgchange -a y <volume group name, for example:vg1000>
-a, --activate
The command to mount the volume as read-only in order:
mount -o ro,noload /dev/<volume group name>/lv /volume1
volume group must exists on your system.
the volume should be reachable in the terminal session.
To see the data in DSM using File Station or Windows File Service (SMB)
synospace --map-file -d
synocheckshare
Synology Terminal Mount encrypted map:
Always contact Synology support first for help and make a working backup first. Use this steps on your own risk!
You need the password to decrypt the shared folder.
If you don't have the password but you have the key file, you can run the following command to retrieve the password, I used a Ubuntu Linux system with ecryptfs-utils installed.
printf "%s" "\$1\$5YN01o9y" | ecryptfs-unwrap-passphrase <keyfile.key>
Make terminal ssh connection to Synology NAS.
cd /volume<>
ls -al
check your folders, for example an encrypted folder named encrypt
@encrypt@ and encrypt
If only @encrypt@ exits and not encrypt this could mean the @encrypt@ folder is not mounted on mount point encrypt.
check with ls command the ls
ls -al @encrypt@ and ls-al encrypt
mount
and check it encrypted folder is mounted ( for example):
when it is mounted it will show:
/volume1/@encrypt@ on /volume1/encrypt type ecryptfs (rw,relatime,ecryptfs_fnek_sig=<>,ecryptfs_sig=<>,ecryptfs_cipher=aes,ecryptfs_key_bytes=32,ecryptfs_unlink_sigs)
when encrypt is not mounted it will not show this line after the mount command.
to mount the @encrypt@ folder on mount point encrypt.
first check if encrypt folder exists.
if not exits run mkdir encrypt ( this directory wil be deleted after encrypting the folder from the GUI, the folder cannot be removed with the rm command)
to mount:
mount.ecryptfs \@encrypt\@/ encrypt/
Passphrase: <fill in the password used to encrypt the folder, without the password you cannot see your data>
Select cipher:
1) aes: blocksize = 16; min keysize = 16; max keysize = 32
2) blowfish: blocksize = 8; min keysize = 16; max keysize = 56
3) des3_ede: blocksize = 8; min keysize = 24; max keysize = 24
4) twofish: blocksize = 16; min keysize = 16; max keysize = 32
5) cast6: blocksize = 16; min keysize = 16; max keysize = 32
6) cast5: blocksize = 8; min keysize = 5; max keysize = 16
Selection [aes]: select 1 aes
Select key bytes:
1) 16
2) 32
3) 24
Selection [16]: 2 (32)
Enable plaintext passthrough (y/n) [n]: n
Enable filename encryption (y/n) [n]: y
WARNING: Based on the contents of [/root/.ecryptfs/sig-cache.txt],
it looks like you have never mounted with this key
before. This could mean that you have typed your
passphrase wrong.
Would you like to proceed with the mount (yes/no)? : yes
Would you like to append sig [] to
[/root/.ecryptfs/sig-cache.txt]
in order to avoid this warning in the future (yes/no)? : yes
Successfully appended new sig to user sig cache file
Mounted eCryptfs
run command, mount and check
/volume1/@encrypt@ on /volume1/encrypt type ecryptfs (rw,relatime,ecryptfs_fnek_sig=<>,ecryptfs_sig=<>,ecryptfs_cipher=aes,ecryptfs_key_bytes=32,ecryptfs_unlink_sigs)
cd /volume1/encrypt
ls -al to check your data
you could use scp to copy your data to another device
To see the data in DSM using File Station or Windows File Service (SMB)
synospace --map-file -d
synocheckshare