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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
03-28-2017, 02:01 PM
|
#1
|
Member
Registered: Mar 2017
Posts: 52
Rep: 
|
Cant copy files from Gentoo server to USB drive.
Hello Everyone,
My perdicament at the moment is that I am unable to copy a set of files from my Gentoo server to a USB drive. My path is
cp -r /opt/biweb/app/ /dev/sdc/. End result will say that /dev/sdc/ is not a directory. But it is.
|
|
|
03-28-2017, 02:34 PM
|
#2
|
Senior Member
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364
|
Quote:
Originally Posted by Chrisroot
Hello Everyone,
My perdicament at the moment is that I am unable to copy a set of files from my Gentoo server to a USB drive. My path is
cp -r /opt/biweb/app/ /dev/sdc/. End result will say that /dev/sdc/ is not a directory. But it is.
|
Hi Chrisroot,
Actually /dev/sdc is not a *normal* directory. Stuff under /dev represents virtual devices to which you can mount file systems.
List the ouptut of lsblk -fs to see where your USB drive is mounted and copy the files to that mount point. Post the output of the command if you would like us to help you with that.
Cheers.
|
|
|
03-28-2017, 02:43 PM
|
#3
|
Member
Registered: Mar 2017
Posts: 52
Original Poster
Rep: 
|
Thanks for the help.
Command lsblk -fs, " command not found".
|
|
|
03-28-2017, 02:45 PM
|
#4
|
Moderator
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,955
|
Likely the destination would be /dev/sdc1
Issuing the mount command will show you what drives are mounted. If this has been auto-mounted, then I'd just try to see if sdc1 is there.
|
|
|
03-28-2017, 02:56 PM
|
#5
|
Member
Registered: Mar 2017
Posts: 52
Original Poster
Rep: 
|
Alright I tried that command- cp -r /opt/biweb/app/ /dev/sdc1/ and the output was "cannot overwrite non-directory '/dev/sdc' with directory /opt/biweb/app/
|
|
|
03-28-2017, 02:59 PM
|
#6
|
Moderator
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,955
|
Firstly you should see how it is mounted, using the mount command. Because /dev/sdc1 may be mounted as /media/8fabcdef455461 .... and so forth, or it may be /media/mydisk if you gave the file system a name.
If you wish to copy files from under that source directory, I think the syntax is ok, but you may wish to end that with a dot, as in /opt/biweb/app/.
|
|
|
03-28-2017, 03:01 PM
|
#7
|
Senior Member
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364
|
Quote:
Originally Posted by Chrisroot
Alright I tried that command- cp -r /opt/biweb/app/ /dev/sdc1/ and the output was "cannot overwrite non-directory '/dev/sdc' with directory /opt/biweb/app/
|
... odd about lsblk not being there ... Could you post the ouput of the findmnt command or the mount command as suggested by rtmistler ?
Last edited by Rickkkk; 03-28-2017 at 03:06 PM.
|
|
|
03-28-2017, 03:02 PM
|
#8
|
Member
Registered: Jun 2003
Location: California, USA
Distribution: OpenSUSE Tumbleweed
Posts: 219
Rep:
|
Try this:
Code:
mkdir /tmp/mydisk
mount /dev/sdc1 /tmp/mydisk
cp -rv /opt/biweb/app/ /tmp/mydisk/
That mounts your disk under /tmp/mydisk which is a regular directory you can then use to copy files to.
If any of these give you errors, post those here before running the next command.
Also, to view what you need to mount, run
Last edited by designator; 03-28-2017 at 03:05 PM.
|
|
|
03-28-2017, 03:07 PM
|
#9
|
Member
Registered: Mar 2017
Posts: 52
Original Poster
Rep: 
|
Alright i tried, mkdir /tmp/mydisk- and the output was "No space left on device." This may be why im having trouble.
|
|
|
03-28-2017, 03:09 PM
|
#10
|
Member
Registered: Jun 2003
Location: California, USA
Distribution: OpenSUSE Tumbleweed
Posts: 219
Rep:
|
Quote:
Originally Posted by Chrisroot
Alright i tried, mkdir /tmp/mydisk- and the output was "No space left on device." This may be why im having trouble.
|
What's the output of
and
|
|
|
03-28-2017, 03:17 PM
|
#11
|
Member
Registered: Mar 2017
Posts: 52
Original Poster
Rep: 
|
fdisk -l
Device Boot Start End Blocks ID System
/dev/sdb1 1 8924 71681998 83 Linux
Disk /dev/sdc 16.0 GB
Device boot Start End Blocks ID System
/dev/sdc1 1 1947 15632384 c
|
|
|
03-28-2017, 03:21 PM
|
#12
|
Member
Registered: Mar 2017
Posts: 52
Original Poster
Rep: 
|
fdisk -l
device boot start end blocks ID system
/dev/sdb1 1 8924 71681998 83 Linux
disk dev/sdc 16.0 GB
device boot start end blocks ID system
/dev/sdc1 1 1947 15632384 c W95 FA32 LBA
The lower potrion is the usb drive
|
|
|
03-28-2017, 03:27 PM
|
#13
|
Senior Member
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364
|
Quote:
Originally Posted by Chrisroot
fdisk -l
Device Boot Start End Blocks ID System
/dev/sdb1 1 8924 71681998 83 Linux
Disk /dev/sdc 16.0 GB
Device boot Start End Blocks ID System
/dev/sdc1 1 1947 15632384 c
|
OK .. we're just missing the mount point. Often removable drives are mounted somewhere under /media ... Have you tried the findmnt command ? Post results ...
|
|
|
03-28-2017, 03:39 PM
|
#14
|
Member
Registered: Mar 2017
Posts: 52
Original Poster
Rep: 
|
ok, mkdir /media/usb-drive, cannot create directory, No such file or directory
|
|
|
03-28-2017, 03:45 PM
|
#15
|
Senior Member
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364
|
Quote:
Originally Posted by Chrisroot
ok, mkdir /media/usb-drive, cannot create directory, No such file or directory
|
Hi Chrisroot - You don't have permission to create subdirectories in /media yourself unless you make some changes. We won't need to do that. Let's start by seeing if it is already mounted. Try the findmnt command I mentioned earlier. You can reduce the output by specifying the block device:
findmnt /dev/sdc1
Last edited by Rickkkk; 03-28-2017 at 04:06 PM.
|
|
|
All times are GMT -5. The time now is 05:19 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|