Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: Connect to my Network attached storage from command line

  1. #1

    Question Connect to my Network attached storage from command line

    Just wondering if there is a way
    Similar to netuse to map a directory
    On my Nas server from linux so i can
    Backup things from linux server to my nas
    Nas.
    What is required? Do i need to install
    Smb? The nas server may be a linux
    Box. Its iosafe. Not sure.

  2. #2

    Default Re: Connect to my Network attached storage from command line

    Depends a bit on what you're NAS is exporting, CIFS (SMB), NFS or something else.

    For CIFS try something like this:
    Code:
    mount -t cifs -o rw,username=<username>,password=<password>,workgroup=<domain> //<Your NAS>/<share> /mnt
    For NFS, you may try something like this:
    Code:
    mount -t nfs <Your NAS>:/<share> /mnt
    Both mount the share specified by <share> on server <Your NAS> in mountoint /mnt

    Louis

  3. #3
    Join Date
    Sep 2012
    Location
    Canada
    Posts
    112

    Default Re: Connect to my Network attached storage from command line

    As a side note, for a SMB share you can also pipe the output of your favorite backup program to smbclient so you don't need to mount anything. For example:

    Code:
    $ tar -cz /home | smbclient -N //server/share -c 'put - backup.tar.gz'
    Where //server/share accepts guest access.

    I don't know if the same thing can be done with NFS.
    Kalten

  4. #4

    Question Re: Connect to my Network attached storage from command line

    ahgmonitor:/mnt # mount -t smbfs -o 10.1.0.15:/Backup /mnt/nas
    mount: can't find /mnt/nas in /etc/fstab


    I forgot how to add linux directories in fstab.


    /mnt/nas is where I want to mount my nas Backup directory.

    Thanks

  5. #5

    Question Re: Connect to my Network attached storage from command line

    I added this in fs tab //10.1.0.15/Backup /mnt/nas smbfs username=username,password=password


    now I'm getting this

    ahgmonitor:/mnt/nas # mount -t smbfs -o 10.1.0.15:/Backup /mnt/nas
    mount: unknown filesystem type 'smbfs'


    I can't go and flip the kvm till monday to use a gui. is there a command line command to open a port for cifs or nfs in the suse firewall. than again
    I don't have authority to add those filesystems to the windows box. why can't it just mount on smbfs?

    I also tried this ahgmonitor:/mnt/nas # zypper install smbfs
    Retrieving repository 'KDE Extra' metadata ...............................[done]
    Building repository 'KDE Extra' cache ....................................[done]
    Retrieving repository 'openSUSE-12.3-Update' metadata ....................[done]
    Building repository 'openSUSE-12.3-Update' cache .........................[done]
    Retrieving repository 'openSUSE-12.3-Update-Non-Oss' metadata ............[done]
    Building repository 'openSUSE-12.3-Update-Non-Oss' cache .................[done]
    Loading repository data...
    Reading installed packages...
    'smbfs' not found in package names. Trying capabilities.
    'samba-client' providing 'smbfs' is already installed.
    Resolving package dependencies...
    Nothing to do.

    Why in heavens sake then won't it mount????

  6. #6

    Default Re: Connect to my Network attached storage from command line

    Try specifying -t cifs instead:

    mount -t cifs -o rw,username=<username>,password=<password>,workgroup=<domain> //<Your NAS>/<share> /mnt

  7. #7

    Question Re: Connect to my Network attached storage from command line

    Quote Originally Posted by LewsTherinTelemon View Post
    Try specifying -t cifs instead:

    mount -t cifs -o rw,username=<username>,password=<password>,workgroup=<domain> //<Your NAS>/<share> /mnt

    Is there a command line way to allow cifs through the firewall? I can't get to the gui till monday.

    also tried

    tar -cz /etc/nagios/objects | smbclient -N //10.1.0.15/Backup -c 'put - nagiosobjects.tar.gz'
    tar: Removing leading `/' from member names
    session setup failed: NT_STATUS_ACCOUNT_DISABLED

    Any idea how to enable NT_STATUS_ACCOUNT

  8. #8
    Join Date
    Nov 2009
    Location
    ND, USA
    Posts
    1,131

    Default Re: Connect to my Network attached storage from command line

    On 3/15/2014 10:36 AM, bperrotta wrote:
    > Is there a command line way to allow cifs through the firewall? I can't
    > get to the gui till monday.


    bperotta;

    You can always run YaST in "ncurses" mode from the command line.
    Code:
    su -
    yast
    Navigate with arrow, tab, enter and alt keys. The SuSEfirewall2 is found in:
    Security and Users > Firewall to open ports go to the Allowed Services tab. AFAIK there should be no need to open ports
    for a cifs mount.

    --
    P.V.
    "We're all in this together, I'm pulling for you" Red Green

  9. #9

    Question Re: Connect to my Network attached storage from command line

    Quote Originally Posted by venzkep View Post
    On 3/15/2014 10:36 AM, bperrotta wrote:
    > Is there a command line way to allow cifs through the firewall? I can't
    > get to the gui till monday.


    bperotta;

    You can always run YaST in "ncurses" mode from the command line.
    Code:
    su -
    yast
    Navigate with arrow, tab, enter and alt keys. The SuSEfirewall2 is found in:
    Security and Users > Firewall to open ports go to the Allowed Services tab. AFAIK there should be no need to open ports
    for a cifs mount.

    This isn't working either "ahgmonitor:~ # mount -t cifs -0 rw,username=<username>,password=<password>!,workgroup=ahghotels //10.1.0.15/Backup /mnt/nas
    -bash: !,workgroup=ahghotels: event not found



    Event not found? what the heck does that mean?
    --
    P.V.
    "We're all in this together, I'm pulling for you" Red Green
    Not sure what to do?
    Last edited by malcolmlewis; 16-Mar-2014 at 07:40.

  10. #10
    Join Date
    Nov 2009
    Location
    ND, USA
    Posts
    1,131

    Default Re: Connect to my Network attached storage from command line

    On 3/15/2014 10:56 PM, bperrotta wrote:
    > This isn't working either "ahgmonitor:~ # mount -t cifs -0
    >>rw,username=<username>,password=<password>!,workgroup=ahghotels
    >>//10.1.0.15/Backup /mnt/nas
    >>-bash: !,workgroup=ahghotels: event not found


    Well for one thing it should be -o (lower case oh), not -0 (numeral zero). See man mount for details.

    PS: I sure hope you posted a fake password. If not change it now.

    --
    P.V.
    "We're all in this together, I'm pulling for you" Red Green
    Last edited by malcolmlewis; 16-Mar-2014 at 07:41.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •