LinuxQuestions.org
Visit Jeremy's Blog.
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 05-31-2017, 08:39 AM   #1
fillister
Member
 
Registered: Feb 2007
Posts: 36

Rep: Reputation: 15
Ubuntu server16.04 copy folder from mounted usb to home folder


Hello all,

I have ssh into my ubuntu server and mounted a usb drive, what I would like to do is copy the folder nzedb to my home directory on this server. my attempts so far have resulted in an error message cannot stat no such directory.

sudo cp /dev/sdb1/nzedb ~/
[sudo] password for greg:
cp: cannot stat '/dev/sdb1/nzedb': Not a directory

Any help will be greatly appreciated

Thank you
 
Old 05-31-2017, 08:45 AM   #2
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
you need to mount the device first, you can't pull it directly from the raw block device.

So say...

Code:
mkdir /mnt/usb
mount /dev/sdb1 /mnt/usb
cp /mnt/usb/nzedb ~/
once done remember to unmount it and clean up.

Code:
umount /mnt/usb
rmdir /mnt/usb
 
Old 05-31-2017, 09:14 AM   #3
dejank
Member
 
Registered: May 2016
Location: Belgrade, Serbia
Distribution: Debian
Posts: 229

Rep: Reputation: Disabled
https://unix.stackexchange.com/quest...ctory-y#115564
 
Old 05-31-2017, 09:24 AM   #4
fillister
Member
 
Registered: Feb 2007
Posts: 36

Original Poster
Rep: Reputation: 15
Thank you r3sistance

I had to use the -r command then it worked perfect, I've been beating my head on the floor for a while on this and you have been a great help.

sudo cp /mnt/usb/nzedb ~/
cp: omitting directory '/mnt/usb/nzedb'
greg@nzedb:~$ sudo cp -r /mnt/usb/nzedb ~/
greg@nzedb:~$ ls
nzedb
 
  


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
[SOLVED] nfs-krb mounted home folder - Client hangs at login unehed Linux - Server 4 10-07-2011 06:16 AM
Able to access the mounted folder though the actual folder is moved VGM Linux - Networking 2 09-16-2010 12:10 PM
want to copy an inode folder from acdrom to a home directory (folder). nhbob Linux - Newbie 8 12-20-2009 11:12 AM
Copy Home Folder seashell11 Ubuntu 3 08-11-2006 12:39 PM
Can't allow partion permissions for a vfat partition, mounted as my home folder DrD Linux - General 19 07-26-2006 12:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:45 AM.

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
Open Source Consulting | Domain Registration