Find the answer to your Linux question:
Results 1 to 5 of 5
Hi. I want to use GParted Live or PartedMagic Live on a machine to remove existing partitions, then create four new partitions for the installation of Windows, Swap, Debian, and ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2005
    Posts
    14

    Copy files from NAS to Linux machine via samba?


    Hi. I want to use GParted Live or PartedMagic Live on a machine to remove existing partitions, then create four new partitions for the installation of Windows, Swap, Debian, and Data. So far, so good.

    Then, while still running in the Linux Live environment, with no OS yet installed on the machine, I want to copy a large number of files from a NAS on the local network to which the machine is connected, to the Data partition, presumably using samba.

    The shares on the NAS are available, and I can access them from a Windows machine by simply using: net use n: \\nasname\sharename and provide user/password when prompted.

    How can I do the same from the Linux Live machine?

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,753
    You have to manually mount the share to an empty directory on the live system, such as /mnt/someshare (which you can create with the mkdir command). The mount command would be something like this: mount -t cifs service mount-point
    See the mount.cifs man page for more details. The service argument includes host IP+directory+userid+password information. The mount point is the directory you want to mount it on, such as /mnt/someshare. The '-t cifs' tells the mount command to use the CIFS file system type (Common Internet File System - Windows/Samba shares specifically), hence my advice to look at the mount.cifs man page. When you run 'mount -t cifs ...', it will actually run mount.cifs for you.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    May 2005
    Posts
    14
    Rubberman, thanks for the response!

    Okay, so I boot the PartedMagic Live CD, and at the desktop run partedmagic to create the partitions. Then, from the desktop, open a terminal.

    In /mnt, I mkdir ds410, then:
    mount -t cifs //server-ip/sharename /mnt/ds410 -o user=workgroup/user%password

    Now I can see the files in the share on the DS410 NAS. Great!

    Next, how to see the files on the local hard drive of the machine partedmagic is running on?

    So, in /mnt, I mkdir data, then:
    mount /dev/sda5 data

    and now I can see the files on the local partition. But, I think I should have used:
    mount /dev/sda5 /mnt/data

    but the first version worked--why? Is it because the current working directory at that point was /mnt?

    Also, I didn't include a -t type argument -- is that okay? In this case, the local partition is fat32 (from the mount man page, the type should be vfat), and the share on the NAS, though an ext4 partition, has contents that also came from a fat32 partition on another machine.

    So, now I can copy files back and forth between /mnt/ds410 and /mnt/data. Have I done everything correctly? Is there anything else I should be aware of?

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,190
    You created the dsr10 directory under the /mnt directory and your mount line for the cifs shows it being mounted there.
    You then created a data directory also under the /mnt directory then mounted it as data, you need to mount as you said, mount /dev/sda5 /mnt/data.
    I usually use the -t option for filesystem type but it isn't always necessary. If it doesn't work without it, then use it. And yes, the type would be vfat.

  6. #5
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,753
    So, now I can copy files back and forth between /mnt/ds410 and /mnt/data. Have I done everything correctly? Is there anything else I should be aware of?
    Probably... I think you are getting there. Keep working on it and refine your processes. I think you have already learned a lot about this subject - but more needs to be done.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

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