Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Can't Write to External USB Drive

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
newb2debian
Posts: 32
Joined: 2018-02-11 14:25

Can't Write to External USB Drive

#1 Post by newb2debian »

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.

cuckooflew
Posts: 677
Joined: 2018-05-10 19:34
Location: Some where out west
Been thanked: 1 time

Re: Can't Write to External USB Drive

#2 Post by cuckooflew »

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!

LE_746F6D617A7A69
Posts: 932
Joined: 2020-05-03 14:16
Has thanked: 7 times
Been thanked: 68 times

Re: Can't Write to External USB Drive

#3 Post by LE_746F6D617A7A69 »

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

newb2debian
Posts: 32
Joined: 2018-02-11 14:25

Re: Can't Write to External USB Drive

#4 Post by newb2debian »

cuckooflew...I right clicked in the drive, opened as root, and then changed the permissions. That worked. Thank you to all who responded.

cuckooflew
Posts: 677
Joined: 2018-05-10 19:34
Location: Some where out west
Been thanked: 1 time

Re: Can't Write to External USB Drive

#5 Post by cuckooflew »

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!

LE_746F6D617A7A69
Posts: 932
Joined: 2020-05-03 14:16
Has thanked: 7 times
Been thanked: 68 times

Re: Can't Write to External USB Drive

#6 Post by LE_746F6D617A7A69 »

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

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Can't Write to External USB Drive

#7 Post by p.H »

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.

LE_746F6D617A7A69
Posts: 932
Joined: 2020-05-03 14:16
Has thanked: 7 times
Been thanked: 68 times

Re: Can't Write to External USB Drive

#8 Post by LE_746F6D617A7A69 »

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

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Can't Write to External USB Drive

#9 Post by p.H »

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.

LE_746F6D617A7A69
Posts: 932
Joined: 2020-05-03 14:16
Has thanked: 7 times
Been thanked: 68 times

Re: Can't Write to External USB Drive

#10 Post by LE_746F6D617A7A69 »

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

Post Reply