From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: Rename a mountpoint (forcibly)? Date: Thu, 2 May 2013 14:42:33 +0100 Message-ID: <20130502134232.GF11630@ZenIV.linux.org.uk> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Linux FS Devel To: Andy Lutomirski Return-path: Received: from zeniv.linux.org.uk ([195.92.253.2]:40017 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759734Ab3EBNme (ORCPT ); Thu, 2 May 2013 09:42:34 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, Apr 30, 2013 at 03:16:46PM -0700, Andy Lutomirski wrote: > Is there a way to forcibly rename a mountpoint? I can rename a > directory that contains a mountpoint, but even if I bind-mount the > underlying FS, I get EBUSY if I try to rename a mountpoint. This is > annoying -- I want to replace the entire contents of my root partition > by moving the old contents away and moving replacements in, but the > mountpoints get in the way. > > Yes, this is evil, but it seems like the kernel is unnecessarily > preventing my from shooting myself in the foot, and in this case the > shot-in-the-foot is actually the desired effect. POSIX, IIRC, and in this case it's really common practice. As bfields suggested, use mount --move.