Editing How to add a second pre-formatted drive to your NAS to copy data from/to

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 16: Line 16:
#Login into the Command Line Interface as "root"
#Login into the Command Line Interface as "root"
#Check what you already have mounted in the system by entering the command "df". Several things will be listed but we are only interested in the "/volume" entries in the very right hand column of the table that is displayed. Everyone should have "/volume1" and depending on how you have your current disks configured you could have "/volume2", "/volume3" etc etc. take note of the last volume number and hence the next free volume number. In my case I had a "/volume1" but NOT "/Volume2". Hence for me "/Volume2" was not being used and this is where this example will load the new drive. If you have "/volume2" or more in your system you need to use the next free volume for all commands given below.
#Check what you already have mounted in the system by entering the command "df". Several things will be listed but we are only interested in the "/volume" entries in the very right hand column of the table that is displayed. Everyone should have "/volume1" and depending on how you have your current disks configured you could have "/volume2", "/volume3" etc etc. take note of the last volume number and hence the next free volume number. In my case I had a "/volume1" but NOT "/Volume2". Hence for me "/Volume2" was not being used and this is where this example will load the new drive. If you have "/volume2" or more in your system you need to use the next free volume for all commands given below.
#Now we check that the new drive is being recognised, enter the command "fdisk -l" thats a lower case L not a 1. You will see each installed disk listed and each partition on the disk listed, e.g. Disk1 will be shown as "/dev/sda", with disk2 as "/dev/sdb", disk3 (if you have one) as "/dev/sdc" etc. Disk1 being a synology formated disk will have 3 partions shown as "/dev/sda1", "/dev/sda2" and "/dev/sda3". In my case the disk I added was disk2, hence is shown as "/dev/sdb". The disk I added ("/dev/sdb") was also a synology formated disk and hence has partitions "/dev/sdb1", "/dev/sdb2" and "/dev/sdb3". On a synology formated disk the first two partitions are Synology System partions, the third partion is where the user data (shared folders) are held.
#Now we check that the new drive is being recognised, enter the command "fdisk -l" thats a lower case L not a 1. You will see each installed disk listed and each partition on the disk listed, e.g. Disk1 will be shown as "/dev/sda", with disk2 as "/dev/sdb", disk3 (if you have one) as "/dev/sdc" etc. Disk1 being a synology formated disk will have 3 partions shown as "/dev/sda1", "/dev/sda2" and "/dev/sda3". In my case the disk I added was disk2, hence is shown as "/dev/sdb". The disk I added ("/dev/sdb") was also a synology formated disk and hence has partitions "/dev/sdb1", "/dev/sdb2" and "/dev/sdb3". On a synology formated disk the first two partitions are Synology System partions, the third Partion is where the user data (shared folders) are held.
#Now we need to map the data partion to a directory on the NAS root "/". For windows users the Linux "mount" command makes data on the mounted partition appear in a directory in the operating system root directory. Before we can mount the drive we have to create the directory the mounted drive will be attached to. From the step above the next free volume number I had was "/volume2". Hence create the directory by entering the commands "cd /" and "mkdir volume2".
#Now we need to map the data partion to a directory on the NAS root "/". For windows users the Linux "mount" command makes data on the mounted partition appear in a directory in the operating system root directory. Before we can mount the drive we have to create the directory the mounted drive will be attached to. From the step above the next free volume number I had was "/volume2". Hence create the directory by entering the commands "cd /" and "mkdir volume2".
#Now we mount the required partition to directory "/volume2". However although the partition "/dev/sdb3" is the one we want to attach we represent it using "/dev/hdb3". Hence we now need to enter the command "mount -t ext3 /dev/hdb3 /volume2" (if your disk is ext2 formatted then use ext2 instead of ext3). Also note we are mounting "hdb3", not "sdb3".
#Now we mount the required partition to directory "/volume2". However although the partition "/dev/sdb3" is the one we want to attach we represent it using "/dev/hdb3". Hence we now need to enter the command "mount -t ext3 /dev/hdb3 /volume2" (note "hdb3", not "sdb3")
#Finished, you can use the cp or other commands to copy/move data
#Finished, you can use the cp or other commands to copy/move data
#You only created a temporary mount so if you reboot the NAS you will need to re-use the same mount command again.
#You only created a temporary mount so if you reboot the NAS you will need to reuse the same mount command again.
#If you want to mount the Disk permanently you need to modify the "/etc/fstab" file using vi using the command "vi /etc/fstab". For the example above, i.e. we want to mount disk2, you will need to add an entry like "/dev/hdb /volume2 ext3 defaults 0 0" where the "b" of "hdb" represents disk2, "hdc" would be disk3 and "hdd" disk4, etc. If you need help using vi see [[Linux VI Editor|Basic commands for Linux VI Editor]]. Note in the fstab file we are describing the format and way we want the OS to handle the disk, so you don't specify the partition numbers. After modifying the fstab file. You use different options in the mount command, i.e. without the "-t" and "ext3" options. Hence enter something like "mount /dev/hdb3 /volume2" making sure you use the exact correct nomenclature for your circumstances as described previously.
#If you want to mount the Disk permanently you need to modify the "/etc/fstab" file using vi, i.e. enter "vi /etc/fstab". For the example above, i.e. we want to mount disk2, you will need to add an entry like "/dev/hdb /volume2 ext3 defaults 0 0" where the "b" of "hdb" represents disk2, "hdc" would be disk3 and "hdd" disk4, etc. If you need help using vi see [[Linux VI Editor|Basic commands for Linux VI Editor]]. Note in the fstab file we are describing the format and way we want the OS to handle the disk, so you don't specify the partition numbers. After modifying the fstab file. You use different options in the mount command, i.e. without the "-t" and "ext3" options. Hence enter something like "mount /dev/hdb3 /volume2" making sure you use the exact correct nomenclature for your circumstances as described previously.


==To remove the Disk==
==To remove the Disk==
Please note that all contributions to wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Wiki:Copyrights for details). Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)