Synology Terminal Mount Volume & Map

Synology Terminal Mount Volume & Map

Synology Terminal Mount Volume & Map 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!

 

Synology Terminal Mount

 

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

 

 

Synology SMB Mount Linux besturingssyteem

Synology SMB Mount op Linux besturingssysteem

In deze Synology post leg ik uit hoe een Synology SMB Mount commando via een terminal uitgevoerd  moet worden om op een Linux besturingssysteem een SMB verbinding te maken met een Synology gedeelde map. Op de Synology NAS is SMB v1 uitgeschakeld vanwege de onveiligheid van deze versie van SMB. Ik heb hieronder de situatie beschreven van de Synology NAS en de gebruikte Linux systemen. Als niet wordt ingelogd als root gebruiker dient het sudo commando gebruikt te worden om het Mount commando uit te voeren voor de SMB verbinding met de Synology NAS.  

Situatie:

Synology NAS versie: DSM 6.1.x

Geïnstalleerde Packages:  Active Directory (AD)

Gebruikers zijn gedefineerd in Active Directory en lokaal op de Synology NAS.

Op de Synology NAS is SMB ingeschakeld. SMB v1 is uitgeschakeld.

Linux operatingssystems: Ubuntu 16.04 en Centos 7

Ubuntu 16.04 LTS:

Hoe maak ik via de terminal een SMB verbinding met de Synology NAS met het Mount commando?

In een terminal sessie als gebruiker root.

Verander eerst naar root gebruiker. 

sudo su - 

Geef het volgende Mount commando om een SMB verbinding te maken met de Synology gedeelde map.

mount -t cifs //<ip address or DNS name Synology NAS>/<Share> /mnt (or other mount point) -o username=<AD user or NAS user>,vers=<2.1 or 3.0>

Om Nautilus op te starten vanuit Gnome GUI voer het volgende commando uit als root.

nautilus

In een terminal sessie als normale gebruiker:

geef het volgende Mount commando om een SMB verbinding te maken met de Synology gedeelde map.

sudo mount -t cifs //<ip address or DNS name Synology NAS>/<Share> /mnt (or other mount point) -o username=<AD user or NAS user>,vers=<2.1 or 3.0>

Om Nautilus op te starten vanuit Gnome GUI voer het volgende commando uit als normale gebruiker in een terminal sessie:

sudo nautilus

Connect from Centos 7

In een terminal sessie als gebruiker root:

Verander eerst naar root gebruiker.

sudo su - of su -

geef het volgende Mount commando om een SMB verbinding te maken met de Synology gedeelde map:

mount -t cifs //<ip address or DNS name Synology NAS>/share -o,user=<AD user or NAS user,domain=<AD netbios domain or other name for NAS users>,vers=<2.1 or 3.0> /mnt (or other mount point)

Om Nautilus op te starten vanuit Gnome GUI voer het volgende commando uit als root.

nautilus

In een terminal sessie als normale gebruiker:

geef het volgende Mount commando om een SMB verbinding te maken met de Synology gedeelde map:

sudo mount -t cifs //<ip address or DNS name Synology NAS>/share -o,user=<AD user or NAS user,domain=<AD netbios domain or other name for NAS users>,vers=<2.1 or 3.0> /mnt (or other mount point)

Om Nautilus op te starten vanuit Gnome GUI voer het volgende commando uit als normale gebruiker.

sudo nautilus