Results 1 to 10 of 27
Hi all,
I have a partition mounted as read only in my embedded linux machine for safety reason. At some point, I want to write something to it, then I ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 10-10-2012 #1Just Joined!
- Join Date
- Oct 2012
- Location
- Vaasa
- Posts
- 11
remount a partition to change access permission
Hi all,
I have a partition mounted as read only in my embedded linux machine for safety reason. At some point, I want to write something to it, then I use this command to change the permission (and change back to read only afterward):
However, there is one thread which is using files in this partition (with mmap function). When this command is executed, the thread will be suspended for a short time, I think because remount option detaches and attaches the partition, hence the thread cannot find it and get suspended.Code:mount -o remount,rw path-to-partition
Is there more efficient way to change partition access permission?
- 10-10-2012 #2Just Joined!
- Join Date
- Oct 2012
- Location
- Delhi, India
- Posts
- 19
check this out
unix.stackexchange.com/questions/30268/mount-device-with-r-w-access-to-specific-user
- 10-10-2012 #3Just Joined!
- Join Date
- Oct 2012
- Location
- Vaasa
- Posts
- 11
- 10-10-2012 #4Just Joined!
- Join Date
- Oct 2012
- Location
- Delhi, India
- Posts
- 19
you could edit /etc/fstab to do this
UUID=<xxxxx> /media/where ext4 rw,auto,nls=utf8,umask=077,gid=46,uid=1000 0 0
Users are listed in /etc/passwd while groups are listed in /etc/group
you may have to edit this according to your taste
- 10-10-2012 #5Just Joined!
- Join Date
- Oct 2012
- Location
- Vaasa
- Posts
- 11
Hi Joseph,
Thanks for quick reply. However i am afraid I do not understand the point you are trying to help.
As I said this is embedded Linux system and it does not even have /etc/fstab but that was not a problem.
Originally the partition is MOUNTED as read-only. Then at some point (in one thread) I want to change the access permission without remounting because it will affect other threads.
- 10-10-2012 #6Just Joined!
- Join Date
- Oct 2012
- Location
- Delhi, India
- Posts
- 19
sorry my mistake, i forgot the word embedded
it does look pretty difficult
could you specify the linux system specs
- 10-10-2012 #7Just Joined!
- Join Date
- Oct 2012
- Location
- Vaasa
- Posts
- 11
Hi,
I am afraid I dont know system information because it has been cleared.
However, I think I dont need the fstab file, all can be done with mount command options.
(problem is which option)
- 10-10-2012 #8Just Joined!
- Join Date
- Oct 2012
- Location
- Delhi, India
- Posts
- 19
the point is with the mount command you will have to do it before the processes begin or the threads are sure to die, you cannot do a remount
the other option is to restart the process after you remount and re-remount
- 10-10-2012 #9Just Joined!
- Join Date
- Oct 2012
- Location
- Vaasa
- Posts
- 11
Hi Joseph,
This change permission thing is done in one thread(or process).
The situation is that there are multiple threads running and at some point one thread wants to change permission to rw to write something and change it back to ro. This action must not affect other threads because they are using other resources in the same partition.
- 10-10-2012 #10Just Joined!
- Join Date
- Oct 2012
- Location
- Delhi, India
- Posts
- 19
ah! is est impossible


2Likes
Reply With Quote

