LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-06-2015, 03:49 PM   #1
blackhawk2165
LQ Newbie
 
Registered: Jan 2015
Posts: 13

Rep: Reputation: Disabled
coping directories from external drives


Hello,

I am looking to copy files from an external drive onto the hard drive of my linux machine. I tried using rsync and cp to copy the files over from the external drive's directory to the directory I made for them on my machine. The first question I have is how are you supposed to identify which device is the one you are looking for in the dev directory, I am working with a seagate 1 TB Drive. The other question I have is how to then copy a specific directory from said external drive to the correct directory on my machine. By the way if this matters, which I don't think it does, I am running Ubuntu server 14.04 on a mac mini with 4GB of Ram.

Thanks,
Austin Harmon
 
Old 01-06-2015, 04:00 PM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,028

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
fdisk -l: should list all disks connected to the machine.
df -h: should list the amount of space used on each mounted partition.
mount: should list all mounted systems.

the file navigator should also clue you into where your disks are mounted. from there you can just drag-and-drop. or if you really want to just use the cp command from within the terminal. e.g.:
Code:
cp /path/to/source /path/to/destination
 
Old 01-06-2015, 04:18 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,950

Rep: Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530
Welcome to LinuxQuestions.

Since you stated you are running Ubuntu server edition is this strictly command line or did you install a desktop? If running a desktop then the external drive should automatically be mounted under the /media directory and then you can use the file browser to drag and drop with a mouse.

If not running a desktop then you need to manually mount the drive before you can copy files. How is the drive formatted, NTFS etc? You can look at the output of the dmesg command to see the device ID or look at the output of the lsblk command. Assuming only one internal drive then it should be sda and your external sdb.
 
Old 01-06-2015, 04:32 PM   #4
blackhawk2165
LQ Newbie
 
Registered: Jan 2015
Posts: 13

Original Poster
Rep: Reputation: Disabled
Okay so I tried copying the directory with /dev/sdb2/directory/, /dev/sdb/sdb2/directory/, /dev/sdb1/directory/, /dev/sdb/sdb1/directory. I used the lsblk command to show me where the external drive is. It says its in sdb2. If it says this does that mean its mounted or do I still need to manually mount it. Also yes I am doing this all from the command line. I just have ubuntu server running not desktop.
 
Old 01-06-2015, 05:00 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,950

Rep: Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530
You have to manually mount the drive.
First create a directory to use as a mount point.
mkdir /media/usb ( replace usb as desired)
sudo mount -t ntfs-3g /dev/sdb2 /media/usb

I used NTFS as an example. The output of the blkid command will display filesystem type if you do not know. Once mounted you can use any command you will then be able to copy files.
 
Old 01-06-2015, 05:08 PM   #6
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,872

Rep: Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249
Ubuntu makes partitions available under the /media directory for the user. If your user name was actually blackhawk2165, you would need to go to the /media/blackhawk2165 directory and find the partition. They are usually listed as UUIDs, which are long number/letter combinations so it is difficult to know which partition is which unless you can identify it by the directories and files there. You can also create a mount point manually and mount it. To find out where sdb2 is mounted, for example, you can run the df -h command suggested above. If it doesn't show up with that command it is not mounted.

Quote:
Okay so I tried copying the directory with /dev/sdb2/directory/, /dev/sdb/sdb2/directory/, /dev/sdb1/directory/, /dev/sdb/sdb1/directory
You need to copy from the mount point of one partition to the mount point of the other partition. If you are copying to a directory other than the /home/user, you need administrator privileges in almost all cases which means using sudo on Ubuntu
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mounting external drives siawash Linux - Software 35 05-21-2010 11:28 PM
mounting external drives thelonius Linux - Hardware 2 04-01-2007 10:08 AM
Will ANY external drives work? Micro420 Linux - Hardware 0 10-08-2004 07:14 PM
External Drives (iPod and Pen Drives) dhbiker Slackware 13 04-08-2004 07:36 AM
How to connect/link/mount drives/directories AnandKM Linux - Newbie 2 09-18-2003 08:07 AM


All times are GMT -5. The time now is 06:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration