Results 1 to 3 of 3

Thread: Linux to WinBlows File sharing cmd - explanation needed

  1. #1
    Junior Member registered user
    Join Date
    Jan 2004
    Posts
    14

    Linux to WinBlows File sharing cmd - explanation needed

    Hi there from Perth, Western Australia first up

    I have been using Debian for about a week and finding it quite a learning curve indeed! Setup was a breeze and with the help from a friend over the internet, i redirected my sources.list from the default German? site, to a local FREE provider of traffic.... d/l and installed the updates fine to.

    Then came the time when i wanted to connect to my WinBlows machine and view my movies and mp3's etc etc.... So i started off by reading the document at http://www.knoppix.net/docs/index.php/FaqSambaQuick and following the instructions...... After a few trys and thought i came to connect to my WinBlows machine with the following command:

    mount -t smbfs -o username=administrator,password=flippers //Karma/C$ /mnt/myshare

    WHAT I WANT TO KNOW IS: What does this mean lol? I would like an explanation on what each section of that command means and why it is like that order if possible?

    Nothing worse than doing something, it working, and then wondering what it means...
    Thanks to anyone who replies.

  2. #2
    Senior Member
    Join Date
    Oct 2003
    Location
    Sydney, Australia
    Posts
    157
    If you type 'man mount' on the command line, you will see the following
    Code:
    MOUNT(8)                       Linux Programmer's Manual                       MOUNT(8)
    
    NAME
           mount - mount a file system
    
    SYNOPSIS
           mount [-lhV]
    
           mount -a [-fFnrsvw] [-t vfstype] [-O optlist]
           mount [-fnrsvw] [-o options [,...]] device | dir
           mount [-fnrsvw] [-t vfstype] [-o options] device dir
    
    DESCRIPTION
           All  files  accessible  in  a Unix system are arranged in one big tree, the file
           hierarchy, rooted at /.  These files can be spread out over several devices. The
           mount  command  serves to attach the file system found on some device to the big
           file tree. Conversely, the umount(8) command will detach it again.
    
           The standard form of the mount command, is
                  mount -t type device dir
           This tells the kernel to attach the file system found on  device  (which  is  of
           type  type)  at the directory dir.  The previous contents (if any) and owner and
           mode of dir become invisible, and as long as this file system  remains  mounted,
           the pathname dir refers to the root of the file system on device.
    The synopsis shows you all the general forms of the command, in your case you typed the last one, which is explained in the last paragraph I included of the description.

    In order to help you understand this, you need to realize the different ways in which Windows and UNIX/Linux/Knoppix handle filesystems.

    Under Windows, just as an example, if you have two hard disk, each with one partition on, then the first disk will appear as C: and the second will appear as D:. If you put a CD in your drive, it will appear as E:. Any folders shared from other computers that you attach can appear as any letter from F: to Z:.

    Under UNIX/Linux/Knoppix, we don't use drive letters. Instead your first filesystem is always known as the root filesystem, and is denoted as /. All other filesystems are then 'mounted' or attached at some point within the directory structure underneath /.

    The last two arguments of your mount command - the device and dir ones - basically say "take the filesystem that is contained on this device and make it appear at this directory under root".

    Now, the mount command is general purpose, and is used to mount everything including hard disks, cd's, floppy disks and also folders shared from other computers. Obviously each kind of filesystem needs to be handled differently, so one of the first things you need to tell mount is which kind of filesystem it is dealing with. This is the -t command and the smbfs argument says that it is a Windows SMB share.

    Each type of filesystem also needs additional options which are specific for that type. These come after the -o flag. For Windows shares, we need to specify a username and password, which are just as you have shown them.

    Now in the case of a shared folder, the device is not really an actual device at all, but rather what I think MS calls a UNC or something, which - as you are probably aware - looks like \\machinename\sharename.

    So, if we break down your command into its constituent parts....
    Code:
    mount
    invoke the mount command
    Code:
    -t smbfs
    tell if we want to attach a share from a Windows machine
    Code:
    -o username=administrator,password=flippers
    options specific to this share, the username and password for the remote machine.
    Code:
    //Karma/C$
    the "device" we want to attach, in this case actually the share C$ on the machine called Karma
    Code:
    /mnt/myshare
    we want all of the files and directories in the remote share to appear as though the are in the directory called /mnt/myshare on the local machine.

  3. #3
    Senior Member registered user
    Join Date
    Jun 2003
    Posts
    611
    In linux there is usually more than one way to accomplish the same thing. Here's a variation that also works to mount a remote share-

    smbmount //$hostname/$sharename /mnt/netdrive -o username=$username

    Just change this command so that $hostname is the host you want to connect to, $sharename is the name of the share, and $username is the name of a user who can access the share.

    To avoid confusion and permission problems I make a user called knoppix on the windows computer and set $username as knoppix when running the script.

    You'll then be prompted for $username's password, and the share will be mounted to /mnt/netdrive.

Similar Threads

  1. File recovery / File permissions help needed?
    By sepekte in forum General Support
    Replies: 0
    Last Post: 05-11-2005, 11:48 PM
  2. Knoppix - windows file sharing
    By shiva_iitm in forum Networking
    Replies: 1
    Last Post: 03-13-2005, 08:02 AM
  3. Knoppix 3.4 and Windows XP File Sharing
    By spartyguy in forum Networking
    Replies: 1
    Last Post: 05-21-2004, 04:36 PM
  4. File Sharing
    By slicksps in forum The Lounge
    Replies: 3
    Last Post: 11-18-2003, 12:24 AM
  5. file needed
    By beachbumtroy in forum General Support
    Replies: 1
    Last Post: 03-10-2003, 08:48 AM

Posting Permissions

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


Fujinet 1.7.1 Atari 400 800 800XL 130XE 65XE XEGS Assembled, Tested, Working picture

Fujinet 1.7.1 Atari 400 800 800XL 130XE 65XE XEGS Assembled, Tested, Working

$99.99



Atari 800 8-bit Computer System Fully Tested Great Condition 48k READ picture

Atari 800 8-bit Computer System Fully Tested Great Condition 48k READ

$350.00



UNOCART-2600 SD card Multi Rom Cartridge for ATARI 2600 with CASE picture

UNOCART-2600 SD card Multi Rom Cartridge for ATARI 2600 with CASE

$34.25



VTG Atari 1200XL Home Computer System 1200 XL ** Tested ** Parts or Repair picture

VTG Atari 1200XL Home Computer System 1200 XL ** Tested ** Parts or Repair

$323.75



SOLD AS IS Lot of 5.25

SOLD AS IS Lot of 5.25" Floppy Disks w/ Games & Software? Commodore 64 Atari 800

$59.99



Golf Challenge - Sierra On-Line - 1982 / Atari 400/800 picture

Golf Challenge - Sierra On-Line - 1982 / Atari 400/800

$199.95



Atari 520ST Vintage Home Computer Keyboard Unit picture

Atari 520ST Vintage Home Computer Keyboard Unit

$199.97



Atari OS & Memory Expansion Cartridges Lot - Untested Possibly For Parts/Repairs picture

Atari OS & Memory Expansion Cartridges Lot - Untested Possibly For Parts/Repairs

$149.97



DEFECTIVE Atari 810 Vintage Computer Disk Drive  powers on Unit Only Boo G3D picture

DEFECTIVE Atari 810 Vintage Computer Disk Drive powers on Unit Only Boo G3D

$49.29



Atari 800XL Computer Bundle Tested Fully Working picture

Atari 800XL Computer Bundle Tested Fully Working

$299.00