I've just created a PT & FS on a large flash drive, but I can't write to it: is says I'm not the owner (root). How do I change the permissions to writeable?
Announcement
Collapse
No announcement yet.
How to gain access to a newly created file system?
Collapse
This topic is closed.
X
X
-
[ABANDONED] How to gain access to a newly created file system?
Last edited by RLynwood; Apr 30, 2023, 07:44 PM.Tags: None
- Top
- Bottom
-
The permissions will probably already be set to "writable", but for root only.
But to change the ownership use Konsole to look for the path to the mounted partition of your flash drive with lsblk or df- it should be something like: /media/YourUsername/NameOfTheDevice .
Now sudo chown YourUsername:YourUsername /media/YourUsername/NameOfTheDevice (see output of lsblk or df for correct path) and you should be able to use it from your user account.Last edited by Schwarzer Kater; Feb 09, 2023, 04:28 PM.Debian KDE & LXQt • Kubuntu & Lubuntu • openSUSE KDE • Windows • macOS X
Desktop: Lenovo ThinkCentre M75s • Laptop: Apple MacBook Pro 13" • and others
get rid of Snap script (20.04 +) • reinstall Snap for release-upgrade script (20.04 +)
install traditional Firefox script (22.04 +) • install traditional Thunderbird script (24.04)
- Top
- Bottom
-
Your command string seems not to have worked. I created the PT & FS on the flash drive from a guest session in a borrowed computer. Will your command string work? Wouldn't I have to use "guest" for the username, etc.? Would that allow me access the drive anywhere else?Last edited by RLynwood; Feb 09, 2023, 04:34 PM.
- Top
- Bottom
Comment
-
Originally posted by RLynwood View Post[…]Would that allow me access with drive anywhere else?
But one can always sudo chmod 777 /media/YourUsername/NameOfTheDevice (but the path to the drive has to be correct, this one is just assumed…) and everyone can do anything everywhere with the drive (not the most secure way, but it might be OK for most purposes, as other file system types like FAT32 always work that way).Debian KDE & LXQt • Kubuntu & Lubuntu • openSUSE KDE • Windows • macOS X
Desktop: Lenovo ThinkCentre M75s • Laptop: Apple MacBook Pro 13" • and others
get rid of Snap script (20.04 +) • reinstall Snap for release-upgrade script (20.04 +)
install traditional Firefox script (22.04 +) • install traditional Thunderbird script (24.04)
- Top
- Bottom
Comment
-
No, don't want to do that. I just want to access my own data, usually on my computer but elsewhere if necessary. It looks like you're saying that in order to make the drive mine, I must create it from my computer. Right now, I don't have access to my computer. I guess I'll have to have the owner of the borrowed computer create another guest account that uses my computer's name to accomplish this. Is that right?Last edited by RLynwood; Feb 09, 2023, 04:52 PM.
- Top
- Bottom
Comment
-
Originally posted by RLynwood View PostNo, don't want to do that. I just want to access my own data, usually on my computer but elsewhere if necessary.
It can be done,sort of
https://unix.stackexchange.com/quest...or-any-linux-m
But a more appropriate file system such as FAT32/EXFAT are more appropriate for removable drives used across different machines.
- Top
- Bottom
Comment
-
Umm, not sure exactly were we are with this and there seems to be some confusion.
It depends on the file system and how you're attempting to mount the USB device. Most of the time, a removable device is mounted automatically by UDEV at /media/<USERNAME> and should handle the permissions automatically. If you used EXT4 on a removable device, maybe not. If you're mounting it some other way, then things will be different.
FYI, user "names" are not transportable. In other words the NAME doesn't ever follow a file system from computer to computer. However, the USER ID may. It's not a name but a number. The default user (and group) id for the person who installed the system is 1000. So if you were logged in as a guest on another system, it's likely different. The user NAME that's displayed comes from a file on the computer you're using, not from the file system.
So, plug the thing in and open Dolphin. You should see it in the lower left corner under "Removable Devices". Right click on it and select "Properties" then select "Permissions" and this will give you an idea where you stand. If it doesn't appear, then there's more work to do. If it does, then review the permissions and see what you are allowed to do and who the owner is. If it's not you, then close Dolphin.
Then you will need Konsole as suggested. I would navigate to the device, then attempt modification. So enter
cd /media/<your username>
If you're "bob" then cd /media/bob
Then just do ll -n (two lower case L's and minus lower case N) and enter. This will show you the user and group number.
Assuming it's not 1000 1000 and this is a system you set up, then run the command suggested above:
sudo chown 1000:1000 <name of the device>
and try Dolphin again. Any other results or problems, and something else will have to be done and more info will be required.
A tip: when you format a removable device, add a Label when you do it. Then when you plug it in, you will see the Label rather than the UUID gobble-de-gook.
- Top
- Bottom
Comment
-
I made it GPT with btrfs and mounted it in the guest session of the borrowed laptop (running Linux Mint 20.04), and I did give it a label/devicename. I realize that the standard advice is that this is inappropriate and overkill, but that's what I want to use.
I've removed it from the borrowed computer and plugged it into my computer running Live Kubuntu 20.04. KDE Partition Manager displays it, and it seems to say it's mounted (mount point: /media/kubuntu/[device name]. Its permissions, though, in Dolphin are the same as those in the borrowed computer: Access denied, I'm not the owner, root. Permissions doesn't seem to allow me to do anything with it since I'm not root/owner.
Since I'm using a Live usb of Kubuntu, I'm not using my username. Now what?
claydoh: "a different file system that doesn't use ownership and permissions so much. Native Linux file systems all have this."
Do you mean that all native Linux systems have ownership and permissions? I believe that's what you're saying, and I've believed that that was the case.
- Top
- Bottom
Comment
-
If it's your computer, you ARE root. Just change to root and copy whatever off of it and reformat it to EXFAT as Claydoh suggested. My 2TB USB drive is NTFS because I also use Windows for work. No permission issues here.
1. There's no reason to use BTRFS on a removable device and it's not recommended by the BTRFS developers.
2. If it's your computer, you can become root and do what you like. sudo -i will make you root for as long as you want.
3. If you're running Kubuntu from a live USB, then your username is transitory and "kubuntu" for the moment but I already told you the NAME doesn't matter, but the user ID does.
Honestly, it seems you're doing your best to place obstacles in your own way. You're using a temporary OS with an unwise choice for a file system on a removable device. Doing things the simple and common way has benefits, like not locking yourself out of your own devices.
Have you tried to reset the ownership? If you are root, yet can't change the ownership of the file system, then the problem is larger than you led us to believe.
- Top
- Bottom
Comment
-
I may well change the flash drive's PT and FS, but, though I'm using my computer, I don't have access to it. I believe but haven't determined for sure that its boot system is corrupted. Until I get it fixed, I'm using a Live usb of Kubuntu 22.04 on my computer because of the advantages of my keyboard, mouse, and (especially) monitor. As for the flash drives, I'm trying to consolidate data from a number of them, especially recently saved videos, onto one large usb stick. And I thought that btrfs would be sure to keep them safe better than any lesser fs. You may have told me that the user ID matters, but I don't know what that is or how to use it. How does this help give me access, write permission, to my flash drive?
I'm not trying to complicate things; they're already complicated for reasons I won't take the time to explain. I'm trying to uncomplicate them, but I can't do it straight forwardly. I'm having to learn things sort of backwards. I've learned what I mentioned above in preparation for solving my booting problem, while using my computer in crippled form. For working with the flash drives and downloading and saving data, I'm using a borrowed old laptop running Linux Mint 20.04.
That's all I'll say for now. I'll try to follow your response advice. Thanks.
- Top
- Bottom
Comment
-
-
I sure hope someone sees this update. I'm terribly sorry for my very long hiatus, but I'm back. I'm still trying to apply your advice, now just to a different flash drive. I have exactly the same problem on this one, so however I solve the problem with this one should also solve the other one. But this stick's file system is ext4.
I'm responding first to oshunluvr.
On both the borrowed laptop, running Linux Mint 20.04, and on the borrowed Live Kubuntu in my tower, the stick mounts automatically, and this stick's permissions say I have none; I'm not root, which is the owner. On the laptop, the stick is labeled 'guest', and on Live Kubuntu's Dolphin, it's labeled 'Kubuntu'. I need to be able to write to it on the laptop to begin with (that's the one on which I can download files to it), then later, after I've regained my computer's OS, transfer the files to my storage drive. (I've learned what the user names are and that they're not transferable.)
The Live Kubuntu's Konsole doesn't allow me to access the drive according to your command-line instructions, but the laptop's Mind did ch to that drive.But, rather than giving me the user numbers, it gave this output:
total 24
drwxr-xr-x 3 0 0 4096 Feb 16 14:28 ./
drwxr-x---+ 4 0 0 4096 Mar 6 21:35 ../
drwx------ 2 0 0 16384 Feb 16 14:28 lost+found/
Originally posted by oshunluvr View PostA tip: when you format a removable device, add a Label when you do it. Then when you plug it in, you will see the Label rather than the UUID gobble-de-gook.
I think this is as far as I can go with this advice. I look forward to your response. Thanks.
- Top
- Bottom
Comment
-
I still would like to know how to change the fs permissions on files I have copied from the borrowed laptop to a flash drive, but I don't need it now. The laptop called me "guest" on those stored files, and the Live Kub OS calls them its default name (Kubuntu, I think). I got very frustrated in not finding instructions that would do it and just decided to "keep it simple" and make the fs fat32. That worked. But in looking at the files on the flash drive, I realized why I wanted to keep a Linux fs: Linux allows special characters, which I use routinely in my system of file names. Some of that I lost. Too bad. I'm stopping here now and will make another post if necessary.
- Top
- Bottom
Comment
-
For example, see: https://www.freecodecamp.org/news/li...e-permissions/
And there are a lot of other tutorials like this (this was just the first one of many I found).Debian KDE & LXQt • Kubuntu & Lubuntu • openSUSE KDE • Windows • macOS X
Desktop: Lenovo ThinkCentre M75s • Laptop: Apple MacBook Pro 13" • and others
get rid of Snap script (20.04 +) • reinstall Snap for release-upgrade script (20.04 +)
install traditional Firefox script (22.04 +) • install traditional Thunderbird script (24.04)
- Top
- Bottom
Comment
Comment