You are not logged in.

#1 2019-07-13 11:08

Jerome
Member
Registered: 2016-02-26
Posts: 148

changing permissions on usb drive

I've bought a new usb drive, and after changing the file system (using gparted) from fat-32 to ext4, I find that I don't have write permissions to copy data to the drive. However, after doing sudo chmod 666 /dev/sdb nothing changes and I'm still not able to write to the drive. Any suggestions? thanks.

Last edited by Jerome (2019-07-13 11:08)

Offline

#2 2019-07-13 20:44

Rademes
Member
From: Latvia
Registered: 2015-12-13
Posts: 636

Re: changing permissions on usb drive

Hello!
First, you have to mount your flash drive. Basically it should mount automaticaly. Use command lsblk to check this.
If you can see /media/...... near your flash drive system NAME (/dev/sdb1) in column MOUNTPOINT, it means, that your flash drive has been automounted.
If not, you should mount it manually. Run lsblk to identify your flash drive's system NAME (usually /dev/sdb1). Look at your drive's SIZE.
Do not confuse the flash drive with a hard disc.
Then, make folder for drive mounting: sudo mkdir /media/myext4flash
Next, mount your flash drive: sudo mount -t ext4 /dev/sdb1 /media/myext4flash
I assume, that your flash drive's system name is /dev/sdb1.
Now, your flash drive has been mounted, and the mountpiont is /media/myext4flash.
Check it using lsblk as explained earlier.
Now you can change permissions for the whole flash drive.
1. cd /media/myext4flash
2. sudo chmod -R 777 .     
R - recursive (all files and folders inside choosen folder); 777 - read, write, execute; . - current folder (which you have opened using cd in 1. step.
3. ls -alh - to check the result. You should see drwxrwxrwx or rwxrwxrwx in the first column.
Now you will be able to write on your flash drive.
Note: You should NOT apply sudo chmod 666 to folders! This option does NOT apply executable flag, so you will not be able to open folders.
Yes, I know, I should name catalogues or directories instead of folders, but sorry, old habit from Windows times.
Also, you may want to change owner for your flash drive from root to default user: sudo chown -R 1000:1000 .
To unmount flash drive: sudo umount /dev/sdb1
I hope, I have explained clearly. I do not write such explanations often.

Last edited by Rademes (2019-07-13 21:09)


Before asking for help please read this topic: https://www.q4os.org/forum/viewtopic.php?id=3502   If you have problems with WiFi network, try to install the Network Manager using Q4OS Software Centre.

Offline

#3 2019-07-14 11:12

Jerome
Member
Registered: 2016-02-26
Posts: 148

Re: changing permissions on usb drive

Hi Rademes, I followed your instructions to the letter and now it's all good. Many thanks, much appreciated. I have copied your post for future reference.

Offline

Board footer

Powered by FluxBB