Access my USB stick
Access my USB stick
Hi
my problem relates to the access rights to my USB stick.
The command stat shows: 0755 / drwxr-xr-x Uid: 1000/andreas Gid: 1000/andreas
How can I change my access rights so that I will be able to copy files to / from that USB stick, or delete them ?
Thanks for your advice
andreas
my problem relates to the access rights to my USB stick.
The command stat shows: 0755 / drwxr-xr-x Uid: 1000/andreas Gid: 1000/andreas
How can I change my access rights so that I will be able to copy files to / from that USB stick, or delete them ?
Thanks for your advice
andreas
Re: Access my USB stick
For me, I don't bother, I just use sudo, &/at the command line - but you can change the permissions of the mount point, as well as the files on it, if it has a decent file system on it, like ext2/3/4.
(FOSS, Linux, & BSD since 1999)
- dolphin_oracle
- Developer
- Posts: 20034
- Joined: Sun Dec 16, 2007 1:17 pm
Re: Access my USB stick
I'm going to guess thats the info for the mount point folder? and that your usb is formated ext4?
you have two options.
1. add a folder (sudo mkdir path_of_new_folder) and give your user full permissions to that folder (sudo chown path_to_folder USER:USER) and then store all your stuff in that folder.
I suppose you could do that to the root folder of the stick,but I've not had luck with actually getting that to work.
or
2. format the stick such that your user owns the root filesystem of the stick
https://mxlinux.org/wiki/system/format- ... ular-user/
you have two options.
1. add a folder (sudo mkdir path_of_new_folder) and give your user full permissions to that folder (sudo chown path_to_folder USER:USER) and then store all your stuff in that folder.
I suppose you could do that to the root folder of the stick,but I've not had luck with actually getting that to work.
or
2. format the stick such that your user owns the root filesystem of the stick
https://mxlinux.org/wiki/system/format- ... ular-user/
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.
Re: Access my USB stick
Hi,
many thanks for your feedback.
I forgot to mention that when I run the command sudo lsblk -f, it shows for that USB stick: /dev/sdb1 vfat and mount-point is: /media/andreas/"Title"
I guess that the filesystem vfat does not support Linux permissions, because FAT (e.g. FAT32, VFAT) is a Microsoft-owned proprietary filesystem ? Is my assumption correct ?
andreas
many thanks for your feedback.
I forgot to mention that when I run the command sudo lsblk -f, it shows for that USB stick: /dev/sdb1 vfat and mount-point is: /media/andreas/"Title"
I guess that the filesystem vfat does not support Linux permissions, because FAT (e.g. FAT32, VFAT) is a Microsoft-owned proprietary filesystem ? Is my assumption correct ?
andreas
Re: Access my USB stick
Yes, you are correct.
That's one of the reasons I got used to just using sudo to write to them.
That's one of the reasons I got used to just using sudo to write to them.
(FOSS, Linux, & BSD since 1999)
Re: Access my USB stick
yes and no. Permission and ownership announced for those mounted filesystem like . vfat,ntfs or exfat,
are determined through the mount options during the mount operation.
So if you e.g. set UID and GID mount option to root you would not have write permissions on a vfat FS.
If the mount-options are set to uid/gid of the user, e.g. like when clicked in Thunar to mount, you get ownership permissions,
as shown in your first post, which are read/write enable for the user.
In addition to permission/ownership o the filesystem you can mount the partition readonly, which would deny any write operation on that mount.
So all depends how those USBsticks have been mounted.
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB
Re: Access my USB stick
Hi fehlix
thanks a lot for your reply. As you advised, I have tried to mount my USB stick to have write permissions, using the following command:
sudo mount -o uid=1000,gid=1000 /dev/sdb1 /mountpoint
However, I get the message "/dev/sdb1 is write-protected, mounting read-only". So I am still not able to copy data on my USB stick.
Is there any other command I should use ? Or do I have to newly format the entire USB stick, and if yes, how can I do this ?
andreas
thanks a lot for your reply. As you advised, I have tried to mount my USB stick to have write permissions, using the following command:
sudo mount -o uid=1000,gid=1000 /dev/sdb1 /mountpoint
However, I get the message "/dev/sdb1 is write-protected, mounting read-only". So I am still not able to copy data on my USB stick.
Is there any other command I should use ? Or do I have to newly format the entire USB stick, and if yes, how can I do this ?
andreas
Re: Access my USB stick
Suggest to wipe the stick and reformat. In most cases it might be enough to just open Gparted to reformat.
But in this case I would do one additional step:
Plugin the USb stick into an USB port of the pc, not at an extension USb port.
Open Terminal and on the command line.
Clear partition table on the stick with live-usb-maker this way:
Code: Select all
sudo live-usb-maker partition-clear
and look like this:
Code: Select all
===========================================================
Starting live-usb-maker
===========================================================
Only one target usb device was found sdg
Will use target device sdg (14.7G JetFlash Transcend 16GB)
Will use source null
-----------------------------------------------------------
Ready to perform partition-clear action on sdg
-----------------------------------------------------------
Shall we begin?
= yes
> no
> pretend mode
Press <Enter> to select the highlighted entry
Use 'h' for help, 'r' to redraw, 'q' to quit
>> partition-clear
>> done
Create new partition Table: Device -> Partition Table ( type: msdos)
Create new partition: Partition -> New ( add label and select format ext4, fat32 or ntfs).
You do not have the required permissions to view the files attached to this post.
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB
Re: Access my USB stick
Creating ext4 with Gparted it's always created with root as the owner, I find the easiest way to get full write permissions for a user is to simply 'chown' it after creation.
Which I believe is
Hit Enter, enter password then hit Enter again.
As an example with a username & usergroup called 'home' for a drive named Storage, mounted in /media/home
Which I believe is
Code: Select all
sudo chown <your username>:<your usergroup> -R <mount point>
As an example with a username & usergroup called 'home' for a drive named Storage, mounted in /media/home
Code: Select all
sudo chown home:home -R /media/home/Storage
Re: Access my USB stick
Format stick ext2/3/4. Example (and be careful):
Where partition = sdb1 (Make sure that is your USB stick and not your second hard drive.)
Then:
Yes, that's a dot at the end. From that point on you will own the stick and be able to read/write at will.
Code: Select all
mkfs.ext4 /dev/partition
Then:
Code: Select all
chown user:group /path/to/stick/.