2

I want to delete a particular directory in a read only file system. How do I mount its parent directory in read/write mode, so that I can delete that? I've tried several things with googling, but could not succeed. For some methods it says block device required.

3
  • Maybe you should provide us the commands that you tried.
    – cYrus
    Sep 30, 2010 at 18:33
  • I tried this: " sudo mount -rw ./ ./"
    – pineapple
    Sep 30, 2010 at 18:41
  • I doubt mount works that way, as far as I know its syntax is: mount -t type device dir.
    – cYrus
    Sep 30, 2010 at 19:20

2 Answers 2

5

I suppose you would like to remount the /usr file system read-write:

$ sudo mount -o remount,rw /usr

Just change /usr above by the mount point you would like to remount.

3
  • And a simple way to find the mount point for the filesystem containing a particular file is df particular/file. Sep 30, 2010 at 23:32
  • The command mentioned in answer gives error: unknown special file or file system
    – pineapple
    Oct 1, 2010 at 1:29
  • Would you like please to complete your question with the following information: the path to the folder you would like to delete, the output of the "df" command or the "mount" command, and the exact command you have executed to receive the error you have just mentioned in your last command. Many thanks.
    – uloBasEI
    Oct 1, 2010 at 6:19
0

The key is that you need to do this on a mount point basis. There is no easy way to do this for just a portion of a mounted filesystem. To get a list of the currently mounted filesystems, try

df

For one problem that the ability to do this would lead to, consider hard links. If a file is linked in one directory that is read-only and another that is read-write, what should the permissions on that file be?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .