Copy file from Pi to USB
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?
command-line files raspberrypi mv
add a comment |
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?
command-line files raspberrypi mv
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 withchmod +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 ofmount | 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 mypathlld
script: github.com/waltinator/pathlld.git - Bash script to answer "Why can't I read/write that file?"
– waltinator
Feb 3 at 15:39
add a comment |
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?
command-line files raspberrypi mv
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?
command-line files raspberrypi mv
command-line files raspberrypi mv
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 withchmod +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 ofmount | 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 mypathlld
script: github.com/waltinator/pathlld.git - Bash script to answer "Why can't I read/write that file?"
– waltinator
Feb 3 at 15:39
add a comment |
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 withchmod +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 ofmount | 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 mypathlld
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
add a comment |
1 Answer
1
active
oldest
votes
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.
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 ofls -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 usingchmod +w 0ABE2571BE25568B
command. It would then becomedrwxrwxrwx
instead ofdrwxr-xr-x
which is shown currently in the screenshot. You could also usechmod 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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
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 ofls -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 usingchmod +w 0ABE2571BE25568B
command. It would then becomedrwxrwxrwx
instead ofdrwxr-xr-x
which is shown currently in the screenshot. You could also usechmod 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
add a comment |
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.
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 ofls -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 usingchmod +w 0ABE2571BE25568B
command. It would then becomedrwxrwxrwx
instead ofdrwxr-xr-x
which is shown currently in the screenshot. You could also usechmod 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
add a comment |
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.
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.
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 ofls -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 usingchmod +w 0ABE2571BE25568B
command. It would then becomedrwxrwxrwx
instead ofdrwxr-xr-x
which is shown currently in the screenshot. You could also usechmod 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
add a comment |
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 ofls -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 usingchmod +w 0ABE2571BE25568B
command. It would then becomedrwxrwxrwx
instead ofdrwxr-xr-x
which is shown currently in the screenshot. You could also usechmod 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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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