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/)

Rickkkk 03-29-2017 10:36 AM

Quote:

Originally Posted by Chrisroot (Post 5689846)
Sorry to bother you all again,

command typed- cp -r /opt/biweb/app/ /mnt/drive_c/ -------Output- cannot create symbolic link- Operation not permitted.

I believe your syntax is incorrect:

cp /opt/biweb/app/. /mnt/drive_c/

***EDIT***

Just realized I made a typo (forgot the recursive option -r) ... The correct command is:

cp -r /opt/biweb/app/. /mnt/drive_c/

Chrisroot 03-29-2017 10:57 AM

Command ---cp /opt/biweb/app/. /mnt/drive_c/......output-- omitting directory.

Rickkkk 03-29-2017 10:59 AM

Quote:

Originally Posted by Chrisroot (Post 5689854)
Command ---cp /opt/biweb/app/. /mnt/drive_c/......output-- omitting directory.

... Please see my edit above ... I made a typo - sincere apologies ... The corrected command:

cp -r /opt/biweb/app/. /mnt/drive_c/

Cheers,

Chrisroot 03-29-2017 11:16 AM

Command- cp -r /opt/biweb/app/. /mnt/drive_c/-----operation not permitted.

Rickkkk 03-29-2017 11:25 AM

Quote:

Originally Posted by Chrisroot (Post 5689862)
Command- cp -r /opt/biweb/app/. /mnt/drive_c/-----operation not permitted.

Hey Chrisroot - this is a bit of a surprise. You are still logged in and executing this command as root ?

Could you post the output of these commands:

ls -l /opt/biweb/app

... and ...

ls -l /mnt/drive_c

Thx.

Chrisroot 03-29-2017 11:37 AM

ls -l /opt/biweb/app has a total 160, the whole tree is there which im trying to copy, sorry there is a lot to type.


ls -l /mnt/drive_c total 4-----drwxrwxr-x 32 root 4096 Mar 29 10:17app

And yes, i am logged in as root.

Rickkkk 03-29-2017 11:56 AM

Quote:

Originally Posted by Chrisroot (Post 5689874)
ls -l /opt/biweb/app has a total 160, the whole tree is there which im trying to copy, sorry there is a lot to type.


ls -l /mnt/drive_c total 4-----drwxrwxr-x 32 root 4096 Mar 29 10:17app

And yes, i am logged in as root.

... Sorry - I didn't realize you were communicating via a different computer and were unable to cut and paste ... Could you just zero in on the permissions information, the "drwxrwxr-x" fields ... What I'm trying to figure out is whether there is something preventing you from reading the contents of that directory ...

Those fields are organized in triads .. i.e. : rwx rwx rwx, even though there are no spaces in actuality. They specify the permissions for, respectively, the owner, the group, and everyone else. What is important, is that you have read (r) and execute (x) permissions. As root, you are probably the owner, so the first triad is likely to be the important one.

Chrisroot 03-29-2017 12:24 PM

The first triad is- drwxrwxr-x

rtmistler 03-29-2017 12:30 PM

I'm concerned about the owner and group for the mount directory.

However, for now, can you successfully do the following?
Code:

# cd /mnt/drive_c
# mkdir temp
# ls -l
<results should show directory temp as well as the ownership, group, and privileges for it, I'd like to see that one line result>
# echo 1 > test.txt
# ls -l test.txt
# cat test.txt
<result should be that text.txt is there as a file, I'd like to see the ls -l listing of it, and I'd like to see if it has '1' within it.>

These experiments will verify that you can create files and directories under the mounted disk.

Chrisroot 03-29-2017 12:31 PM

Alright, I typed command cp -r /opt/biweb/app /mnt/drive_c/

it took a bit of time then i went through mnt
root-cd /mnt
mnt # ls
drive_c sd1 sda1 sdb1 sdi sdn
mnt# cd /drive_c
drive_c # ls
app
drive_c # ls app

All the files i need are copied, BUT when i unmount the device. umount /mnt/drive_c, Output- Device not mounted-
Then plug the device into a windows machine, there is nothing there.

Rickkkk 03-29-2017 12:38 PM

Quote:

Originally Posted by Chrisroot (Post 5689906)
The first triad is- drwxrwxr-x

... sorry again for being imprecise ... by "first triad", I meant the first 3 letters (excluding the d, which is only there for directories ..) - they specify owner permissions.

For now, concentrate on the tests that rtmistler has suggested - this will eliminate any possibility of insufficient permissions on the mount point (which is your USB drive). I also find the owner of the mount point (user "32", group "root") surprising ...

Chrisroot 03-29-2017 12:38 PM

Command---cd /mnt/drive_c
drive_c---mkdir temp
drive_c---ls -l
total 8
drwxrwxr-x 32 root root 4096 Mar 29 app
drwxrwxr-x 2 root root 4096 Mar 29 temp

Rickkkk 03-29-2017 12:47 PM

Any ideas here, rtmistler ? The files and directories seemed to have been copied to the USB drive, but Chrisroot is then unable to see them when it is plugged into a Windows computer. Since the drive is formatted type c (FAT32 LBA W95), shouldn't this be possible ?

The result of the umount command is also surprising ...

rtmistler 03-29-2017 01:06 PM

Quote:

Originally Posted by Chrisroot (Post 5689918)
Command---cd /mnt/drive_c
drive_c---mkdir temp
drive_c---ls -l
total 8
drwxrwxr-x 32 root root 4096 Mar 29 app
drwxrwxr-x 2 root root 4096 Mar 29 temp

That looks good. I would say then that something goes astray when you try to copy an entire structure. I've seen that there are symbolic links in there. Perhaps you can copy one file or a few files or one single sub-directory where there are no symbolic links. Perhaps you can try that, then umount the disk and bring it to another machine and verify that the files are there. Also verifying that the temp directory is similarly there.

Note that you need to wait for the umount command to complete, which is bring you back to the prompt, and that it should be "umount /mnt/drive_c" where you also are not within any directories under that hierarchy. And then when you put the disk back in, you'll need to mount it again using the mount command shown earlier by me.

EDIT: I agree that the result of the umount command is a concern. This comes together with my notes to make sure you umount and then redo the mount as you unplug and re-plug the drive into your system. It will never auto-mount, you have to mount it each time you attach it. And before you detach it you should issue the umount command.

I do apologize, I will be in meetings for a bit and then done for the day, I'll monitor this thread, but likely may not be able to return to it until the morning. Hopefully you get some success.

Emerson 03-29-2017 01:41 PM

The drive wasn't mounted at copy time, all files went into a subdirectory in /mnt/. And, FAT does not support symlinks ...


All times are GMT -5. The time now is 08:30 PM.