Date: Thu, 13 Feb 2014 13:28:36 +0100 From: Polytropon <freebsd@edvax.de> To: s m <sam.gh1986@gmail.com> Cc: freebsd-questions <freebsd-questions@freebsd.org> Subject: Re: Fwd: how to mount r/w encrypted partition when it is mount ad read-only? Message-ID: <20140213132836.5c04a470.freebsd@edvax.de> In-Reply-To: <CAA_1SgENBe7Vk9ubbtaGag03A%2By5Tx=4q6bdxMajoYdcSFPL9w@mail.gmail.com> References: <CAA_1SgFoz1a9Z40UNF0H8YBgnx7C=UBvG7diU-D6BXFU5WjkDw@mail.gmail.com> <CAA_1SgENBe7Vk9ubbtaGag03A%2By5Tx=4q6bdxMajoYdcSFPL9w@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 13 Feb 2014 12:10:47 +0330, s m wrote: > hello all > i have an encrypted user partition which is encrypted with geli. user is > mounted read-only. i want to mount it r/w for a short time, copy some files > on it and mount it read-only again. with unencrypted partitions, we can > change mount options. for example if an unencrypted user partition is > read-only mounted, we can mount it r/w by "mount -rw /usr" command. but > for encrypted partitions this command doesn't work and error "device busy" > occurs. > > is there any way to mount r/w encrypted partition when it is mounted as > read-only? See "man mount" and find the -u option: It updates the mount status from r/o to r/w as specified (and back). You could do this as follows, assuming the required options have already been set in /etc/fstab (e. g. /crypt is where the encrypted partition is currently mounted at in read-only mode) # mount -u -o rw /crypt ... now copy some stuff to /crypt ... # mount -u -o ro /crypt Of course, using "-uw" and "-ur" is shorter, I just wanted to illustrate the mechanism verbosely. :-) THis _should_ work with GELI encrypted partitions too, even though I haven't tested it. Note that reverting back to r/o could be delayed when writes are still pending; calling "sync" should issue all buffers to be written. In worst case, -f can be added (force), even when users are still holding files open on from their r/w activity. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140213132836.5c04a470.freebsd>