L
L
lik1732020-11-23 12:12:13
linux
lik173, 2020-11-23 12:12:13

How to change permissions for a folder (disk) in Linux?

There is a folder / media / cdrom0 how to change it to all rights?
wrote:
chmod a=rwx /media/cdrom0
chmod -r -rwx /media/cdrom0
sudo chown -R root:root /media/cdrom0
wrote errors:
chown: change owner of '/media/cdrom0/*': File system is only accessible to read
chmod: change permissions for '/media/cdrom0/': The file system is read-only.
*-all files of the folder
need to change the rights for the whole disk
how to do it?

I realized that I need to copy the files

Answer the question

In order to leave comments, you need to log in

5 answer(s)
J
justhostRU, 2020-11-23
@lik173

obviously the sdrom is mounted.
First you need to remove the disk (unmount). and then change the rights to the /cdrom directory itself.

A
Adamos, 2020-11-23
@Adamos

/media/cdrom0 is a CD drive, it is physically read-only, no matter how hard you push on the rights.
What did you want to do? If you burn a disc, then this is not done this way.

V
Vasily Bannikov, 2020-11-23
@vabka

mount the filesystem writable and chmod all files on the disk.

V
Victor Taran, 2020-11-23
@shambler81

change permissions on files - set permissions on all directories - set permissions on all files in this folder and below - owner root group root on everything in this folder (dangerous command to enter only with the full path otherwise there is an option to demolish the rights of the entire system works very fast . but this is the answer to your question, however it is not entirely clear what you want to do. Describe the real task, it seems you are doing something wrong
find /tmp/you_papka -type d -exec chmod 755 {} ;\
find /tmp/you_papka -type f -exec chmod 644 {} ;\
chmod -R root:root /tmp/you_papka

O
Oleg Volkov, 2020-11-24
@voleg4u

If the system is not too old - you can try overlay. This is just for cases of "repairing" read-only file systems without copying the contents.

# cd /tmp && rm -rf lower upper tmp merged && mkdir lower upper tmp merged
# mount /dev/cdrom lower
# mount -t overlay overlay -o lowerdir=lower,upperdir=upper,workdir=tmp merged
# cd merged

And do what you want there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question