Tag: mount

  • Mount NFS Drive

    Mount NFS Drive

    NFS (Network File System) is a protocol that allows a computer to access files over a network as if they were stored on its local hard drive. It was developed by Sun Microsystems in the 1980s and has become a popular file sharing protocol for Linux operating systems.

    On RHEL-based distro

    yum install nfs-utils -y
    

    To mount NFS drive, use

    mount -t nfs 10.160.0.5:/shared-data /var/www/html
    

    In the above command 10.160.0.5:/shared-data is the NFS drive, replace it with your NFS drive.

    Back to mount

  • unknown filesystem type linux_raid_member

    When i try mount a HDD, i get error

    root@super ~ # mount /dev/sda1 /mnt
    mount: /mnt: unknown filesystem type 'linux_raid_member'.
    root@super ~ # 
    

    This is because the disk is part of RAID.

    Lets check the disks avaialbe with parted -l

    parted raid

    parted shows /dev/sda1 and /dev/sdb1 as raid with same size. So its assemble raid array with command

    mdadm --assemble --run /dev/md3 /dev/sda1 /dev/sdb1
    

    I used /dev/md3 as other device names (/dev/md0, /dev/md1 and /dev/md2) are already in use.

    Now you can mount this drive with command

    mount /dev/md3 /mnt
    
  • Mount Windows Share in Linux

    On Ubuntu, install cifs-utils

    apt-get install cifs-utils
    

    First create a directory on which we can mount the windows share

    mkdir /media/SHARE_NAME
    

    Now create a file to store windows share username and password.

    vi /etc/SHARE_NAME.smbcredentials
    

    Add following to the file

    username=YOUR_WINDOWS_SHARE_USER
    password=YOUR_WINDOWS_SHARE_PASSWORD
    

    Now run

    mount -t cifs //192.168.0.4/SHARE_NAME /media/SHARE_NAME -o credentials=/etc/SHARE_NAME.smbcredentials,uid=LINUX_USER_NAME,iocharset=utf8,sec=ntlm,rw,dir_mode=0777,file_mode=0666
    

    192.168.0.4 – Replace with IP of your Windows computer with share.

    LINUX_USER_NAME – Replace with the Linux user name you want the files to be owned.

    To make share mounted on boot, edit

    vi /etc/fstab
    

    Add

    //192.168.0.4/SHARE_NAME  /media/SHARE_NAME  cifs  credentials=/etc/SHARE_NAME.smbcredentials,uid=LINUX_USER_NAME,gid=GID_OF_LINUX_USER,_netdev,iocharset=utf8,dir_mode=0777,file_mode=0666  0  0
    

    mount