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
.
2 Answers
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.
-
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 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.– uloBasEIOct 1, 2010 at 6:19
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?
mount
works that way, as far as I know its syntax is:mount -t type device dir
.