LinuxQuestions.org
Review your favorite Linux distribution.
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 03-28-2017, 03:01 PM   #1
Chrisroot
Member
 
Registered: Mar 2017
Posts: 52

Rep: Reputation: Disabled
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.
 
Old 03-28-2017, 03:34 PM   #2
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec, CANADA
Distribution: Arch
Posts: 1,234

Rep: Reputation: 451Reputation: 451Reputation: 451Reputation: 451Reputation: 451
Quote:
Originally Posted by Chrisroot View Post
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.
 
Old 03-28-2017, 03:43 PM   #3
Chrisroot
Member
 
Registered: Mar 2017
Posts: 52

Original Poster
Rep: Reputation: Disabled
Thanks for the help.

Command lsblk -fs, " command not found".
 
Old 03-28-2017, 03:45 PM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 8,316
Blog Entries: 13

Rep: Reputation: 3703Reputation: 3703Reputation: 3703Reputation: 3703Reputation: 3703Reputation: 3703Reputation: 3703Reputation: 3703Reputation: 3703Reputation: 3703Reputation: 3703
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.
 
Old 03-28-2017, 03:56 PM   #5
Chrisroot
Member
 
Registered: Mar 2017
Posts: 52

Original Poster
Rep: Reputation: Disabled
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/
 
Old 03-28-2017, 03:59 PM   #6
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 8,316
Blog Entries: 13

Rep: Reputation: 3703Reputation: 3703Reputation: 3703Reputation: 3703Reputation: 3703Reputation: 3703Reputation: 3703Reputation: 3703Reputation: 3703Reputation: 3703Reputation: 3703
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/.
 
Old 03-28-2017, 04:01 PM   #7
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec, CANADA
Distribution: Arch
Posts: 1,234

Rep: Reputation: 451Reputation: 451Reputation: 451Reputation: 451Reputation: 451
Quote:
Originally Posted by Chrisroot View Post
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 04:06 PM.
 
Old 03-28-2017, 04:02 PM   #8
designator
Member
 
Registered: Jun 2003
Location: California, USA
Distribution: OpenSUSE Tumbleweed
Posts: 214

Rep: Reputation: 37
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
Code:
/sbin/fdisk -l

Last edited by designator; 03-28-2017 at 04:05 PM.
 
Old 03-28-2017, 04:07 PM   #9
Chrisroot
Member
 
Registered: Mar 2017
Posts: 52

Original Poster
Rep: Reputation: Disabled
Alright i tried, mkdir /tmp/mydisk- and the output was "No space left on device." This may be why im having trouble.
 
Old 03-28-2017, 04:09 PM   #10
designator
Member
 
Registered: Jun 2003
Location: California, USA
Distribution: OpenSUSE Tumbleweed
Posts: 214

Rep: Reputation: 37
Quote:
Originally Posted by Chrisroot View Post
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
Code:
fdisk -l
and

Code:
df --si
 
Old 03-28-2017, 04:17 PM   #11
Chrisroot
Member
 
Registered: Mar 2017
Posts: 52

Original Poster
Rep: Reputation: Disabled
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
 
Old 03-28-2017, 04:21 PM   #12
Chrisroot
Member
 
Registered: Mar 2017
Posts: 52

Original Poster
Rep: Reputation: Disabled
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
 
Old 03-28-2017, 04:27 PM   #13
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec, CANADA
Distribution: Arch
Posts: 1,234

Rep: Reputation: 451Reputation: 451Reputation: 451Reputation: 451Reputation: 451
Quote:
Originally Posted by Chrisroot View Post
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 ...
 
Old 03-28-2017, 04:39 PM   #14
Chrisroot
Member
 
Registered: Mar 2017
Posts: 52

Original Poster
Rep: Reputation: Disabled
ok, mkdir /media/usb-drive, cannot create directory, No such file or directory
 
Old 03-28-2017, 04:45 PM   #15
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec, CANADA
Distribution: Arch
Posts: 1,234

Rep: Reputation: 451Reputation: 451Reputation: 451Reputation: 451Reputation: 451
Quote:
Originally Posted by Chrisroot View Post
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 05:06 PM.
 
  


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] Cannot copy files to USB flash drive from internal HDD. erik2282 Linux - Desktop 8 10-04-2014 01:23 PM
Can I copy files from a ntfs drive on ubuntu server? Vodkaholic1983 Linux - Newbie 7 05-05-2013 07:03 AM
How to copy files from a usb pen drive to my linux box? HelpMe2877 Linux - Newbie 4 08-20-2008 03:54 AM
Copy Files From Lexar USB Drive In Slackware 12.1 OWA14 Linux - Newbie 3 05-27-2008 07:50 PM
copy files from your hard drive to usb key with Knoppix ziegen Linux - Distributions 1 08-09-2004 02:06 PM

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

All times are GMT -5. The time now is 02:09 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