Find the answer to your Linux question:
Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 27
Like Tree2Likes
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.
  1. #1
    Just 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):
    Code:
    mount -o remount,rw path-to-partition
    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.
    Is there more efficient way to change partition access permission?

  2. #2
    Just 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

  3. #3
    Just Joined!
    Join Date
    Oct 2012
    Location
    Vaasa
    Posts
    11
    Quote Originally Posted by gaurav-joseph View Post
    check this out

    unix.stackexchange.com/questions/30268/mount-device-with-r-w-access-to-specific-user
    Thank man, unfortunately it does not help
    Just to make sure that everyone understand me, I am looking for a solution to change access right on a partition without the need to remount if (this is totally different with chmod thing).

  4. $spacer_open
    $spacer_close
  5. #4
    Just 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

  6. #5
    Just Joined!
    Join Date
    Oct 2012
    Location
    Vaasa
    Posts
    11
    Quote Originally Posted by gaurav-joseph View Post
    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
    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.

  7. #6
    Just 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

  8. #7
    Just 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)

  9. #8
    Just 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. #9
    Just Joined!
    Join Date
    Oct 2012
    Location
    Vaasa
    Posts
    11
    Quote Originally Posted by gaurav-joseph View Post
    the point is with the mount command you will have to do it before the processes begin or the threads are sure to die
    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.

  11. #10
    Just Joined!
    Join Date
    Oct 2012
    Location
    Delhi, India
    Posts
    19
    ah! is est impossible

Page 1 of 3 1 2 3 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •