Copy file from Pi to USB












0















So I am trying to copy a file from my home pi directory to USB on my Pi zero as root using sudo mv command and it still says permission denied. I am a root user. How do I copy this file if I don't have the permission even as root?



screenshot 1screenshot 2screenshot 3screenshot 4screenshot 5










share|improve this question




















  • 1





    It may help if you translate the messages in your screenshot to English to show what each message says. Also, consider that a directory may not have write permissions which can be resolved with chmod +w some/directory

    – Kristopher Ives
    Feb 1 at 16:10






  • 1





    It seems that your trying to copy a file to external drive. Please edit your question and include the output of mount | grep /media/pi/0ABE2571BE255688. Also, at least for posting to AU please switch to English.

    – Kulfy
    Feb 1 at 16:22













  • You can copy and paste the output directly to question body instead of posting images. Also, which distro are you using on your pi?

    – Kulfy
    Feb 3 at 15:37













  • See my pathlld script: github.com/waltinator/pathlld.git - Bash script to answer "Why can't I read/write that file?"

    – waltinator
    Feb 3 at 15:39
















0















So I am trying to copy a file from my home pi directory to USB on my Pi zero as root using sudo mv command and it still says permission denied. I am a root user. How do I copy this file if I don't have the permission even as root?



screenshot 1screenshot 2screenshot 3screenshot 4screenshot 5










share|improve this question




















  • 1





    It may help if you translate the messages in your screenshot to English to show what each message says. Also, consider that a directory may not have write permissions which can be resolved with chmod +w some/directory

    – Kristopher Ives
    Feb 1 at 16:10






  • 1





    It seems that your trying to copy a file to external drive. Please edit your question and include the output of mount | grep /media/pi/0ABE2571BE255688. Also, at least for posting to AU please switch to English.

    – Kulfy
    Feb 1 at 16:22













  • You can copy and paste the output directly to question body instead of posting images. Also, which distro are you using on your pi?

    – Kulfy
    Feb 3 at 15:37













  • See my pathlld script: github.com/waltinator/pathlld.git - Bash script to answer "Why can't I read/write that file?"

    – waltinator
    Feb 3 at 15:39














0












0








0








So I am trying to copy a file from my home pi directory to USB on my Pi zero as root using sudo mv command and it still says permission denied. I am a root user. How do I copy this file if I don't have the permission even as root?



screenshot 1screenshot 2screenshot 3screenshot 4screenshot 5










share|improve this question
















So I am trying to copy a file from my home pi directory to USB on my Pi zero as root using sudo mv command and it still says permission denied. I am a root user. How do I copy this file if I don't have the permission even as root?



screenshot 1screenshot 2screenshot 3screenshot 4screenshot 5







command-line files raspberrypi mv






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 3 at 15:34







stefmz 7

















asked Feb 1 at 15:55









stefmz 7stefmz 7

11




11








  • 1





    It may help if you translate the messages in your screenshot to English to show what each message says. Also, consider that a directory may not have write permissions which can be resolved with chmod +w some/directory

    – Kristopher Ives
    Feb 1 at 16:10






  • 1





    It seems that your trying to copy a file to external drive. Please edit your question and include the output of mount | grep /media/pi/0ABE2571BE255688. Also, at least for posting to AU please switch to English.

    – Kulfy
    Feb 1 at 16:22













  • You can copy and paste the output directly to question body instead of posting images. Also, which distro are you using on your pi?

    – Kulfy
    Feb 3 at 15:37













  • See my pathlld script: github.com/waltinator/pathlld.git - Bash script to answer "Why can't I read/write that file?"

    – waltinator
    Feb 3 at 15:39














  • 1





    It may help if you translate the messages in your screenshot to English to show what each message says. Also, consider that a directory may not have write permissions which can be resolved with chmod +w some/directory

    – Kristopher Ives
    Feb 1 at 16:10






  • 1





    It seems that your trying to copy a file to external drive. Please edit your question and include the output of mount | grep /media/pi/0ABE2571BE255688. Also, at least for posting to AU please switch to English.

    – Kulfy
    Feb 1 at 16:22













  • You can copy and paste the output directly to question body instead of posting images. Also, which distro are you using on your pi?

    – Kulfy
    Feb 3 at 15:37













  • See my pathlld script: github.com/waltinator/pathlld.git - Bash script to answer "Why can't I read/write that file?"

    – waltinator
    Feb 3 at 15:39








1




1





It may help if you translate the messages in your screenshot to English to show what each message says. Also, consider that a directory may not have write permissions which can be resolved with chmod +w some/directory

– Kristopher Ives
Feb 1 at 16:10





It may help if you translate the messages in your screenshot to English to show what each message says. Also, consider that a directory may not have write permissions which can be resolved with chmod +w some/directory

– Kristopher Ives
Feb 1 at 16:10




1




1





It seems that your trying to copy a file to external drive. Please edit your question and include the output of mount | grep /media/pi/0ABE2571BE255688. Also, at least for posting to AU please switch to English.

– Kulfy
Feb 1 at 16:22







It seems that your trying to copy a file to external drive. Please edit your question and include the output of mount | grep /media/pi/0ABE2571BE255688. Also, at least for posting to AU please switch to English.

– Kulfy
Feb 1 at 16:22















You can copy and paste the output directly to question body instead of posting images. Also, which distro are you using on your pi?

– Kulfy
Feb 3 at 15:37







You can copy and paste the output directly to question body instead of posting images. Also, which distro are you using on your pi?

– Kulfy
Feb 3 at 15:37















See my pathlld script: github.com/waltinator/pathlld.git - Bash script to answer "Why can't I read/write that file?"

– waltinator
Feb 3 at 15:39





See my pathlld script: github.com/waltinator/pathlld.git - Bash script to answer "Why can't I read/write that file?"

– waltinator
Feb 3 at 15:39










1 Answer
1






active

oldest

votes


















0














Could you check the output of the command ls -alh in both the directories ie /home/pi and /media/pi.
That command will basically show the owner of the file (along with other info) that you are trying to move/copy. Also since you are already in /home/pi directory, perhaps just try to use this command (wondering if double quotes was leading to an issue!):



mv vortexcomputers.py /media/pi/0ABE2571BE25568B/


Also, try creating a test file in /media/pi directory by using this command : touch test_file.txt



You should then be able to list the files to check if the file got created successfully.



Let me know how it goes.






share|improve this answer


























  • Ok thank you! I will truly the commands you told me and let you know how it goes soon(when I am on Pi again) probably tomorrow. In the meantime basically the message in the image says cannot create file blah blah blah permission denied. So it does not have permission to create file in that directory. Although I don't know why it says create when I am trying to move the file. Anyway I will try the commands and let you know how it goes.

    – stefmz 7
    Feb 2 at 17:35











  • Hi! I tried everything you told me. Still getting the same message. The output of the ls -alh command showed that the file I want to copy and my USB drive are owned by Pi. Though when I tried copying it both as Pi and root it didn't work. Also tried without quotes didn't work. Also gave writing permissions didn't work. Any other ideas? I am including screenshots in my question (edit).Also I am gonna edit my question to include the output of the mount|grep command as you told me. By the way creating a test text file in media/pi worked.

    – stefmz 7
    Feb 3 at 15:24











  • Hi, looks like your media/pi directory doesn't have write permissions (even though you mentioned that you have given write permissions). Could you try again by giving write permissions using command : chmod +w media/py. Also, Pls create the test file as well using the touch command etc and then show the output of ls -alh.

    – Saurabh Mittal
    Feb 3 at 19:45













  • If you look at the output of ls -alh command in your screenshot, you would see that the write permission is missing in /media/pi directory and its sub-directories. Hence as suggested by @kristopher-ives as well above, you just need to give the write permission by using chmod +w 0ABE2571BE25568B command. It would then become drwxrwxrwx instead of drwxr-xr-x which is shown currently in the screenshot. You could also use chmod 777 0ABE2571BE25568B , both commands would give the same result. Let me know how it goes! (This is just a case of missing write permission on the directory)

    – Saurabh Mittal
    Feb 4 at 10:31













  • Ok thanks! But I solved my problem otherwise. I got a USB to Ethernet card and I uploaded the files to the cloud. But I might try this just for science:).

    – stefmz 7
    Feb 4 at 20:28











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1114764%2fcopy-file-from-pi-to-usb%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Could you check the output of the command ls -alh in both the directories ie /home/pi and /media/pi.
That command will basically show the owner of the file (along with other info) that you are trying to move/copy. Also since you are already in /home/pi directory, perhaps just try to use this command (wondering if double quotes was leading to an issue!):



mv vortexcomputers.py /media/pi/0ABE2571BE25568B/


Also, try creating a test file in /media/pi directory by using this command : touch test_file.txt



You should then be able to list the files to check if the file got created successfully.



Let me know how it goes.






share|improve this answer


























  • Ok thank you! I will truly the commands you told me and let you know how it goes soon(when I am on Pi again) probably tomorrow. In the meantime basically the message in the image says cannot create file blah blah blah permission denied. So it does not have permission to create file in that directory. Although I don't know why it says create when I am trying to move the file. Anyway I will try the commands and let you know how it goes.

    – stefmz 7
    Feb 2 at 17:35











  • Hi! I tried everything you told me. Still getting the same message. The output of the ls -alh command showed that the file I want to copy and my USB drive are owned by Pi. Though when I tried copying it both as Pi and root it didn't work. Also tried without quotes didn't work. Also gave writing permissions didn't work. Any other ideas? I am including screenshots in my question (edit).Also I am gonna edit my question to include the output of the mount|grep command as you told me. By the way creating a test text file in media/pi worked.

    – stefmz 7
    Feb 3 at 15:24











  • Hi, looks like your media/pi directory doesn't have write permissions (even though you mentioned that you have given write permissions). Could you try again by giving write permissions using command : chmod +w media/py. Also, Pls create the test file as well using the touch command etc and then show the output of ls -alh.

    – Saurabh Mittal
    Feb 3 at 19:45













  • If you look at the output of ls -alh command in your screenshot, you would see that the write permission is missing in /media/pi directory and its sub-directories. Hence as suggested by @kristopher-ives as well above, you just need to give the write permission by using chmod +w 0ABE2571BE25568B command. It would then become drwxrwxrwx instead of drwxr-xr-x which is shown currently in the screenshot. You could also use chmod 777 0ABE2571BE25568B , both commands would give the same result. Let me know how it goes! (This is just a case of missing write permission on the directory)

    – Saurabh Mittal
    Feb 4 at 10:31













  • Ok thanks! But I solved my problem otherwise. I got a USB to Ethernet card and I uploaded the files to the cloud. But I might try this just for science:).

    – stefmz 7
    Feb 4 at 20:28
















0














Could you check the output of the command ls -alh in both the directories ie /home/pi and /media/pi.
That command will basically show the owner of the file (along with other info) that you are trying to move/copy. Also since you are already in /home/pi directory, perhaps just try to use this command (wondering if double quotes was leading to an issue!):



mv vortexcomputers.py /media/pi/0ABE2571BE25568B/


Also, try creating a test file in /media/pi directory by using this command : touch test_file.txt



You should then be able to list the files to check if the file got created successfully.



Let me know how it goes.






share|improve this answer


























  • Ok thank you! I will truly the commands you told me and let you know how it goes soon(when I am on Pi again) probably tomorrow. In the meantime basically the message in the image says cannot create file blah blah blah permission denied. So it does not have permission to create file in that directory. Although I don't know why it says create when I am trying to move the file. Anyway I will try the commands and let you know how it goes.

    – stefmz 7
    Feb 2 at 17:35











  • Hi! I tried everything you told me. Still getting the same message. The output of the ls -alh command showed that the file I want to copy and my USB drive are owned by Pi. Though when I tried copying it both as Pi and root it didn't work. Also tried without quotes didn't work. Also gave writing permissions didn't work. Any other ideas? I am including screenshots in my question (edit).Also I am gonna edit my question to include the output of the mount|grep command as you told me. By the way creating a test text file in media/pi worked.

    – stefmz 7
    Feb 3 at 15:24











  • Hi, looks like your media/pi directory doesn't have write permissions (even though you mentioned that you have given write permissions). Could you try again by giving write permissions using command : chmod +w media/py. Also, Pls create the test file as well using the touch command etc and then show the output of ls -alh.

    – Saurabh Mittal
    Feb 3 at 19:45













  • If you look at the output of ls -alh command in your screenshot, you would see that the write permission is missing in /media/pi directory and its sub-directories. Hence as suggested by @kristopher-ives as well above, you just need to give the write permission by using chmod +w 0ABE2571BE25568B command. It would then become drwxrwxrwx instead of drwxr-xr-x which is shown currently in the screenshot. You could also use chmod 777 0ABE2571BE25568B , both commands would give the same result. Let me know how it goes! (This is just a case of missing write permission on the directory)

    – Saurabh Mittal
    Feb 4 at 10:31













  • Ok thanks! But I solved my problem otherwise. I got a USB to Ethernet card and I uploaded the files to the cloud. But I might try this just for science:).

    – stefmz 7
    Feb 4 at 20:28














0












0








0







Could you check the output of the command ls -alh in both the directories ie /home/pi and /media/pi.
That command will basically show the owner of the file (along with other info) that you are trying to move/copy. Also since you are already in /home/pi directory, perhaps just try to use this command (wondering if double quotes was leading to an issue!):



mv vortexcomputers.py /media/pi/0ABE2571BE25568B/


Also, try creating a test file in /media/pi directory by using this command : touch test_file.txt



You should then be able to list the files to check if the file got created successfully.



Let me know how it goes.






share|improve this answer















Could you check the output of the command ls -alh in both the directories ie /home/pi and /media/pi.
That command will basically show the owner of the file (along with other info) that you are trying to move/copy. Also since you are already in /home/pi directory, perhaps just try to use this command (wondering if double quotes was leading to an issue!):



mv vortexcomputers.py /media/pi/0ABE2571BE25568B/


Also, try creating a test file in /media/pi directory by using this command : touch test_file.txt



You should then be able to list the files to check if the file got created successfully.



Let me know how it goes.







share|improve this answer














share|improve this answer



share|improve this answer








edited Feb 4 at 17:06

























answered Feb 1 at 16:23









Saurabh MittalSaurabh Mittal

165




165













  • Ok thank you! I will truly the commands you told me and let you know how it goes soon(when I am on Pi again) probably tomorrow. In the meantime basically the message in the image says cannot create file blah blah blah permission denied. So it does not have permission to create file in that directory. Although I don't know why it says create when I am trying to move the file. Anyway I will try the commands and let you know how it goes.

    – stefmz 7
    Feb 2 at 17:35











  • Hi! I tried everything you told me. Still getting the same message. The output of the ls -alh command showed that the file I want to copy and my USB drive are owned by Pi. Though when I tried copying it both as Pi and root it didn't work. Also tried without quotes didn't work. Also gave writing permissions didn't work. Any other ideas? I am including screenshots in my question (edit).Also I am gonna edit my question to include the output of the mount|grep command as you told me. By the way creating a test text file in media/pi worked.

    – stefmz 7
    Feb 3 at 15:24











  • Hi, looks like your media/pi directory doesn't have write permissions (even though you mentioned that you have given write permissions). Could you try again by giving write permissions using command : chmod +w media/py. Also, Pls create the test file as well using the touch command etc and then show the output of ls -alh.

    – Saurabh Mittal
    Feb 3 at 19:45













  • If you look at the output of ls -alh command in your screenshot, you would see that the write permission is missing in /media/pi directory and its sub-directories. Hence as suggested by @kristopher-ives as well above, you just need to give the write permission by using chmod +w 0ABE2571BE25568B command. It would then become drwxrwxrwx instead of drwxr-xr-x which is shown currently in the screenshot. You could also use chmod 777 0ABE2571BE25568B , both commands would give the same result. Let me know how it goes! (This is just a case of missing write permission on the directory)

    – Saurabh Mittal
    Feb 4 at 10:31













  • Ok thanks! But I solved my problem otherwise. I got a USB to Ethernet card and I uploaded the files to the cloud. But I might try this just for science:).

    – stefmz 7
    Feb 4 at 20:28



















  • Ok thank you! I will truly the commands you told me and let you know how it goes soon(when I am on Pi again) probably tomorrow. In the meantime basically the message in the image says cannot create file blah blah blah permission denied. So it does not have permission to create file in that directory. Although I don't know why it says create when I am trying to move the file. Anyway I will try the commands and let you know how it goes.

    – stefmz 7
    Feb 2 at 17:35











  • Hi! I tried everything you told me. Still getting the same message. The output of the ls -alh command showed that the file I want to copy and my USB drive are owned by Pi. Though when I tried copying it both as Pi and root it didn't work. Also tried without quotes didn't work. Also gave writing permissions didn't work. Any other ideas? I am including screenshots in my question (edit).Also I am gonna edit my question to include the output of the mount|grep command as you told me. By the way creating a test text file in media/pi worked.

    – stefmz 7
    Feb 3 at 15:24











  • Hi, looks like your media/pi directory doesn't have write permissions (even though you mentioned that you have given write permissions). Could you try again by giving write permissions using command : chmod +w media/py. Also, Pls create the test file as well using the touch command etc and then show the output of ls -alh.

    – Saurabh Mittal
    Feb 3 at 19:45













  • If you look at the output of ls -alh command in your screenshot, you would see that the write permission is missing in /media/pi directory and its sub-directories. Hence as suggested by @kristopher-ives as well above, you just need to give the write permission by using chmod +w 0ABE2571BE25568B command. It would then become drwxrwxrwx instead of drwxr-xr-x which is shown currently in the screenshot. You could also use chmod 777 0ABE2571BE25568B , both commands would give the same result. Let me know how it goes! (This is just a case of missing write permission on the directory)

    – Saurabh Mittal
    Feb 4 at 10:31













  • Ok thanks! But I solved my problem otherwise. I got a USB to Ethernet card and I uploaded the files to the cloud. But I might try this just for science:).

    – stefmz 7
    Feb 4 at 20:28

















Ok thank you! I will truly the commands you told me and let you know how it goes soon(when I am on Pi again) probably tomorrow. In the meantime basically the message in the image says cannot create file blah blah blah permission denied. So it does not have permission to create file in that directory. Although I don't know why it says create when I am trying to move the file. Anyway I will try the commands and let you know how it goes.

– stefmz 7
Feb 2 at 17:35





Ok thank you! I will truly the commands you told me and let you know how it goes soon(when I am on Pi again) probably tomorrow. In the meantime basically the message in the image says cannot create file blah blah blah permission denied. So it does not have permission to create file in that directory. Although I don't know why it says create when I am trying to move the file. Anyway I will try the commands and let you know how it goes.

– stefmz 7
Feb 2 at 17:35













Hi! I tried everything you told me. Still getting the same message. The output of the ls -alh command showed that the file I want to copy and my USB drive are owned by Pi. Though when I tried copying it both as Pi and root it didn't work. Also tried without quotes didn't work. Also gave writing permissions didn't work. Any other ideas? I am including screenshots in my question (edit).Also I am gonna edit my question to include the output of the mount|grep command as you told me. By the way creating a test text file in media/pi worked.

– stefmz 7
Feb 3 at 15:24





Hi! I tried everything you told me. Still getting the same message. The output of the ls -alh command showed that the file I want to copy and my USB drive are owned by Pi. Though when I tried copying it both as Pi and root it didn't work. Also tried without quotes didn't work. Also gave writing permissions didn't work. Any other ideas? I am including screenshots in my question (edit).Also I am gonna edit my question to include the output of the mount|grep command as you told me. By the way creating a test text file in media/pi worked.

– stefmz 7
Feb 3 at 15:24













Hi, looks like your media/pi directory doesn't have write permissions (even though you mentioned that you have given write permissions). Could you try again by giving write permissions using command : chmod +w media/py. Also, Pls create the test file as well using the touch command etc and then show the output of ls -alh.

– Saurabh Mittal
Feb 3 at 19:45







Hi, looks like your media/pi directory doesn't have write permissions (even though you mentioned that you have given write permissions). Could you try again by giving write permissions using command : chmod +w media/py. Also, Pls create the test file as well using the touch command etc and then show the output of ls -alh.

– Saurabh Mittal
Feb 3 at 19:45















If you look at the output of ls -alh command in your screenshot, you would see that the write permission is missing in /media/pi directory and its sub-directories. Hence as suggested by @kristopher-ives as well above, you just need to give the write permission by using chmod +w 0ABE2571BE25568B command. It would then become drwxrwxrwx instead of drwxr-xr-x which is shown currently in the screenshot. You could also use chmod 777 0ABE2571BE25568B , both commands would give the same result. Let me know how it goes! (This is just a case of missing write permission on the directory)

– Saurabh Mittal
Feb 4 at 10:31







If you look at the output of ls -alh command in your screenshot, you would see that the write permission is missing in /media/pi directory and its sub-directories. Hence as suggested by @kristopher-ives as well above, you just need to give the write permission by using chmod +w 0ABE2571BE25568B command. It would then become drwxrwxrwx instead of drwxr-xr-x which is shown currently in the screenshot. You could also use chmod 777 0ABE2571BE25568B , both commands would give the same result. Let me know how it goes! (This is just a case of missing write permission on the directory)

– Saurabh Mittal
Feb 4 at 10:31















Ok thanks! But I solved my problem otherwise. I got a USB to Ethernet card and I uploaded the files to the cloud. But I might try this just for science:).

– stefmz 7
Feb 4 at 20:28





Ok thanks! But I solved my problem otherwise. I got a USB to Ethernet card and I uploaded the files to the cloud. But I might try this just for science:).

– stefmz 7
Feb 4 at 20:28


















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1114764%2fcopy-file-from-pi-to-usb%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Human spaceflight

Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

File:DeusFollowingSea.jpg