How to permanently mount Windows partition on Ubuntu Server

You can use the following method to mount the windows partition on Ubuntu 12.04 server.

Step 1: create a directory on which you have to mount the windows partition

root@ubuntusrv:~# mkdir /nas_storage

Step 2: Copy and paste (after few changes) the below lines to /etc/fstab file to permanently mount the windows partition.

In your case, you have to change the server path, username and password.

#NAS storage for copying backups
//172.16.10.6/Server-Backups /nas_storage  cifs  username=admin,password=admin123,iocharset=utf8,sec=ntlm  0  0

Step 2A: (optional)
Use these lines to mount the drive with rights to particular user and group. This will be required if your backup destination is windows drive for BackupPC backups

#NAS storage with full rights to backuppc user and backuppc group
//172.16.10.6/Server-Backups /nas_storage  cifs  username=admin,password=admin123,rw,nounix,uid=backuppc,gid=backuppc,file_mode=0700,dir_mode=0700,forceuid,forcegid,nosetuids,_net

Step 3: now mount the same using the below command

root@ubuntusrv:~# mount –a

Note:
       If you get an error:

mount: //172.16.10.6/Server-Backups is not a valid block device

Then you may need to install samba file sharing:

sudo apt-get install smbfs

Step 4: you can check whether it is mounted or not using the following command

root@ubuntusrv:~# df -h
Filesystem                                        Size    Used   Avail    Use%   Mounted on
/dev/sda1                                       7.0G   2.2G    4.5G    33%     /
udev                                                 489M  4.0K    489M   1%       /dev
tmpfs                                                200M  240K  199M    1%       /run
none                                                 5.0M    0         5.0M    0%       /run/lock
none                                                 498M   0         498M   0%       /run/shm

//172.16.10.6/Server-Backups  4.4T     4.0T   336G   93%     /nas_storage

No comments:

Post a Comment