LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Cant copy files from Gentoo server to USB drive. (https://www.linuxquestions.org/questions/linux-newbie-8/cant-copy-files-from-gentoo-server-to-usb-drive-4175602729/)

designator 03-28-2017 05:54 PM

Show us the output of
Code:

df --si
as well. I'm curious why you couldn't create a directory inside /tmp/.

DDukes 03-28-2017 07:22 PM

@OP

Are you doing this as root or as a regular user?

If you're doing this as a regular user and the USB is a variation of FAT types like FAT16, FAT32, etc you can write to it since FAT requires no permissions. However, if the USB is formatted with one of linux filesystems types, you'd need to be the owner or part of the group to read/write to it as a regular user.

Quote:

Originally Posted by Chrisroot (Post 5689450)
ok, mkdir /media/usb-drive, cannot create directory, No such file or directory

You got this error because you tried to create a folder in a non-existent parent directory called /media.

Use a -p with mkdir to correct this

Code:

mkdir -p /media/usb-drive
Here is what the -p does from the mkdir --help

-p, --parents no error if existing, make parent directories as needed

Rickkkk 03-28-2017 07:29 PM

Quote:

Originally Posted by DDukes (Post 5689533)
@OP

Are you doing this as root or as a regular user?

If you're doing this as a regular user and the USB is a variation of FAT types like FAT16, FAT32, etc you can write to it since FAT requires no permissions. However, if the USB is formatted with one of linux filesystems types, you'd need to be part of the group to read/write to it as a regular user.

Hey DD ... the OP's USB is formatted FAT32 LBA - see one the previous posts ..

It's probably mounted somehow, we're just waiting for the OP to post the output of some commands to confirm that as well as the mount point.

Cheers :=)

DDukes 03-28-2017 07:47 PM

Quote:

Originally Posted by Rickkkk (Post 5689535)
Hey DD ... the OP's USB is formatted FAT32 LBA - see one the previous posts ..

It's probably mounted somehow, we're just waiting for the OP to post the output of some commands to confirm that as well as the mount point.

Cheers :=)

OK.

Chrisroot 03-29-2017 09:07 AM

Hey everyone, yes the mount point is incorrect. Right now i typed the following command "mount /dev/sdc1 /media/usb-drive/". The mount point has been created but the output i get is saying that mount /dev/sdc1 /media/usb-drive/ does not exist, but it does.

rtmistler 03-29-2017 09:13 AM

Are you already root, or would you need to use the sudo command to be able to complete the mount. Normally you need root privileges to accomplish a mount.

Chrisroot 03-29-2017 09:17 AM

Currently I am logged in as root.

Rickkkk 03-29-2017 09:19 AM

Quote:

Originally Posted by Chrisroot (Post 5689774)
Currently I am logged in as root.

Hi Chrisroot,

Again, can you run and post the output of the command:

findmnt /dev/sdc1

Thanks.

Chrisroot 03-29-2017 09:31 AM

Comamnd - findmnt /dev/sdc1 command not found. So im guessing it isn't mounted at the moment.

Rickkkk 03-29-2017 09:36 AM

Quote:

Originally Posted by Chrisroot (Post 5689785)
Comamnd - findmnt /dev/sdc1 command not found. So im guessing it isn't mounted at the moment.

No, oddly, that means the command is not available on your Gentoo server .. This is the 2nd time a rather ubiquitous command has not been found (lsblk being the other one).

Just for clarity - you are currently logged in to the Gentoo server as root, right ? You are not using some kind of live ISO ?

I'm stumped as to why some of these commands aren't available ...

rtmistler 03-29-2017 09:39 AM

No that means the findmnt command is not available, in your PATH, or on your system.

Let's back up for a second here:
  1. To be able to copy into or out of a drive, that drive needs to be mounted, and you need to have privileges to be able to read and write to it.
  2. Say the drive is /dev/sdc, and say further that the drive has a name string which was given when the filesystem was created, such as "12345". This drive if auto-mounted should show under /mnt or /media in a directory which matches the name "12345", or it will use a name matching some other attributes of the mounted file system, such as some long hex-ascii string.
  3. Things you can do when you plug in a disk are to:
    1. Issue the "mount" command to see if it is mounted, in fact you can do that before, then plug in the drive, then issue the mount command again, and see if you see the drive mounted
    2. You can look at your system log to see if /dev/sdc was recognized and some additional records to determine if it was auto-mounted
    3. If not auto-mounted, you can then try to manually mount it using the "mount" command, one possible example would be: "mount -t <file system type> /dev/sdc1 /mnt/<name>"
  4. If the drive is mounted, and you are root as you say you are, you should check the ownership of the /mnt or /media subdirectory, for instance if it is mounted at /mnt/drive_1 then check the ownership and group for the /mnt tree by going to there and doing "ls -l", it should be root and you should at least have rwx privileges for the directory.
  5. Same applies to the files or directories under that mounted directory, you should have privileges to access, read, and write there.
  6. Seeing as you're root, this would seem to be no problem, however it is worth checking
I feel that you need to understand first if this is mounted, and then diagnose how to get it mounted, if it is not mounted.

Rickkkk 03-29-2017 09:40 AM

... worst case, just run the following command and post its output:

mount

... the ouput will be a little lengthy, but at least we'll see the information we need ...

Thx.

Chrisroot 03-29-2017 09:41 AM

Yes, i am logged in as root currently. And yes it is a a Gentoo server not a live ISO. Is there a way to install some of these simple commands? I know this shouldn't be this difficult.

rtmistler 03-29-2017 09:42 AM

Quote:

Originally Posted by Chrisroot (Post 5689796)
Yes, i am logged in as root currently. And yes it is a a Gentoo server not a live ISO. Is there a way to install some of these simple commands? I know this shouldn't be this difficult.

Please type "mount" and post the result of that command

Rickkkk 03-29-2017 09:42 AM

Quote:

Originally Posted by rtmistler (Post 5689794)
No that means the findmnt command is not available, in your PATH, or on your system.

... I feel that you need to understand first if this is mounted, and then diagnose how to get it mounted, if it is not mounted.

... Absolutely agree. I again suggest posting the output of the mount command (no options, just mount).


All times are GMT -5. The time now is 12:26 PM.