Can't Write to External USB Drive

If none of the more specific forums is the right place to ask

Can't Write to External USB Drive

Postby newb2debian » 2020-09-04 13:30

Hello...I'm currently using Debian 10. I put a 1TB Samsung EVO 850 SSD in an OWC Mercury Elite Pro Mini external portable drive case. I used gparted to create an Ext4 partition on the drive with no issues. I plug the external drive into my Debian puter using USB and it sees and mounts the drive with no issues. In the GUI, when I right click to create a directory/folder on the drive, it's greyed out. No-one has ever accused me of being smart, so I must be missing something to be able to write to the external drive. Any ideas what could be occurring? Any suggestions would be most helpful. Thank you.
newb2debian
 
Posts: 17
Joined: 2018-02-11 14:25

Re: Can't Write to External USB Drive

Postby cuckooflew » 2020-09-04 13:40

Probably you don't have your file permissions set correctly, you can use 'chmod' to change them, see: https://wiki.debian.org/Permissions
Any way, that is what I would check first.
Please Read What we expect you have already Done
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!
cuckooflew
 
Posts: 683
Joined: 2018-05-10 19:34
Location: Some where out west

Re: Can't Write to External USB Drive

Postby LE_746F6D617A7A69 » 2020-09-04 14:04

cuckooflew wrote:Probably you don't have your file permissions set correctly (...)
For sure he don't have the permissions - It's because after the formatting the root directory on that external drive belongs to ... root ;)

@newb2debian:
There are several possible solutions, but IMO the simplest & fastest is to create a directory that belongs to You, and keep all Your files there.
When You connect the drive, it is mounted as: /media/newb2debian/MyExternalDrive (example user and drive names). Your directory needs to be created with root privileges, like this:
Code: Select all
sudo mkdir /media/newb2debian/MyExternalDrive/My_Data
sudo chown newb2debian:newb2debian /media/newb2debian/MyExternalDrive/My_Data

Now the directory My_Data belongs to You and it will be possible to create new sub-dirs and copy the files to this directory using standard GUI tools.

If You would like to share the data also with other users, You can use the chmod command as described under the Debian Wiki link posted by cuckooflew
Bill Gates: "(...) In my case, I went to the garbage cans at the Computer Science Center and I fished out listings of their operating system."
The_full_story and Nothing_have_changed
LE_746F6D617A7A69
 
Posts: 421
Joined: 2020-05-03 14:16

Re: Can't Write to External USB Drive

Postby newb2debian » 2020-09-04 14:13

cuckooflew...I right clicked in the drive, opened as root, and then changed the permissions. That worked. Thank you to all who responded.
newb2debian
 
Posts: 17
Joined: 2018-02-11 14:25

Re: Can't Write to External USB Drive

Postby cuckooflew » 2020-09-04 21:08

Glad that worked your welcome, I was in a hurry, and forgot to mention, also the owner,eg: If root is the owner, a normal user can not do anything. See 'man chown' or as you did,
.I right clicked in the drive,

Select properties, and you would see who the owner is, and the permissions, as root you can change any of that.
You might want to consider reading some documentation, if you are not sure what permissions to use.
And your welcome
===edit===
On mine, I do basically what LE_746F6D617A7A69 says:
but IMO the simplest & fastest is to create a directory that belongs to You, and keep all Your files there.
Please Read What we expect you have already Done
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!
cuckooflew
 
Posts: 683
Joined: 2018-05-10 19:34
Location: Some where out west

Re: Can't Write to External USB Drive

Postby LE_746F6D617A7A69 » 2020-09-06 08:23

newb2debian wrote: I used gparted to create an Ext4 partition on the drive with no issues.
Somehow I didn't pay too much attention to the above sentence - but it's quite important:
For removable and non-bootable drives dedicated for use in Linux You don't need to create partitions at all - it's a waste of drive space and RAM, where the kernel loads the partition table.
It's possible to just create the filesystem directly on the device, by simply using:
Code: Select all
mkfs.ext4 /dev/sd<x> #no partition number, ext4 is just an example

;)
Bill Gates: "(...) In my case, I went to the garbage cans at the Computer Science Center and I fished out listings of their operating system."
The_full_story and Nothing_have_changed
LE_746F6D617A7A69
 
Posts: 421
Joined: 2020-05-03 14:16

Re: Can't Write to External USB Drive

Postby p.H » 2020-09-06 14:01

LE_746F6D617A7A69 wrote:For sure he don't have the permissions - It's because after the formatting the root directory on that external drive belongs to ... root

No, it's because the root directory has write permission only for the owner.
/tmp belongs to root too, yet all users can write to it.

LE_746F6D617A7A69 wrote:For removable and non-bootable drives dedicated for use in Linux You don't need to create partitions at all - it's a waste of drive space and RAM, where the kernel loads the partition table.
It's possible to just create the filesystem directly on the device

It is possible and technically valid, but I do not recommend it. A partition table provides information about the drive contents. Without it, the drive may appear empty at first glance. A partition table wastes at most 1 MiB, which is negligible compared to current drive sizes.
p.H
 
Posts: 1618
Joined: 2017-09-17 07:12

Re: Can't Write to External USB Drive

Postby LE_746F6D617A7A69 » 2020-09-06 15:17

p.H wrote:
LE_746F6D617A7A69 wrote:For sure he don't have the permissions - It's because after the formatting the root directory on that external drive belongs to ... root

No, it's because the root directory has write permission only for the owner.
That's what I said - and also I've mentioned that the directory has to be owned by the user, and also that the OP can use chmod to make it writeable for everyone, so I don't know where do You see a problem...

p.H wrote:
LE_746F6D617A7A69 wrote:For removable and non-bootable drives dedicated for use in Linux You don't need to create partitions at all - it's a waste of drive space and RAM, where the kernel loads the partition table.
It's possible to just create the filesystem directly on the device
It is possible and technically valid, but I do not recommend it. A partition table provides information about the drive contents. Without it, the drive may appear empty at first glance. A partition table wastes at most 1 MiB, which is negligible compared to current drive sizes.
The only information that the partition table provides regarding the *contents* of the drive is the type of partition - but this information is not worth much, and can be misleading, because partition types are completely ignored by all of the disk utilities, including those used for formatting.

You argument regarding that the drive may appear empty makes no sense - the presence of partition table doesn't mean the the drive contains some data - such information is provided by the File System structures, and not by the partition table.

Besides, all the disk utilities on Linux are supporting partition-less devices, and Gnome-disks or GParted allow to format such drives in a convenient way (for newbies -> no CLI)
Bill Gates: "(...) In my case, I went to the garbage cans at the Computer Science Center and I fished out listings of their operating system."
The_full_story and Nothing_have_changed
LE_746F6D617A7A69
 
Posts: 421
Joined: 2020-05-03 14:16

Re: Can't Write to External USB Drive

Postby p.H » 2020-09-06 16:11

LE_746F6D617A7A69 wrote:That's what I said

No, that's not what you said.

LE_746F6D617A7A69 wrote:and also I've mentioned that the directory has to be owned by the user

And this statement is wrong.

LE_746F6D617A7A69 wrote:and also that the OP can use chmod to make it writeable for everyone

This statement is correct and contradicts your previous statement.

LE_746F6D617A7A69 wrote:The only information that the partition table provides regarding the *contents* of the drive is the type of partition - but this information is not worth much, and can be misleading, because partition types are completely ignored by all of the disk utilities, including those used for formatting.

You could say the same with labels. So what ? Are you going to ditch them just because they may be set inadequately or ignored by machines ? They are mostly for humans, not machines, and if you set them with adequate values, then this information can be useful for people.

LE_746F6D617A7A69 wrote:You argument regarding that the drive may appear empty makes no sense - the presence of partition table doesn't mean the the drive contains some data

But it is a better hint that the drive may contain data than no partition table.
It is less dangerous to wrongy think that a drive contains data than to wrongly think that it is empty.

LE_746F6D617A7A69 wrote:such information is provided by the File System structures, and not by the partition table.

Only if the system knows about the filesystem type. On the other hand, all systems understand partition tables.
p.H
 
Posts: 1618
Joined: 2017-09-17 07:12

Re: Can't Write to External USB Drive

Postby LE_746F6D617A7A69 » 2020-09-06 16:57

Oh, I know that game too...

p.H wrote:And this statement is wrong.
No it's correct - if You read my post in full and not just single selected sentences
p.H wrote:This statement is correct and contradicts your previous statement.
This statement is correct, and it does not contradict the previous, because user can own the directory and make it writeable for everyone at the same time, just like in case of /temp
p.H wrote:You could say the same with labels.
We are not talking about labels - please start some other topic for that.
p.H wrote:They are mostly for humans, not machines
The partition types were used by the software in the past, and some companies have some types exclusively registered for their software technologies - but today the types are useless.
p.H wrote:But it is a better hint that the drive may contain data than no partition table.
Like I said, partition table means nothing regarding the contents of the drive
p.H wrote:Only if the system knows about the filesystem type. On the other hand, all systems understand partition tables.
Like I said, partition-less drives are good if they are used only with Linux systems - it's hard to believe that Your ability to read with understanding have failed only within this topic.
Bill Gates: "(...) In my case, I went to the garbage cans at the Computer Science Center and I fished out listings of their operating system."
The_full_story and Nothing_have_changed
LE_746F6D617A7A69
 
Posts: 421
Joined: 2020-05-03 14:16


Return to General Questions

Who is online

Users browsing this forum: No registered users and 12 guests

fashionable