Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Neal Becker <ndbecker2@gmail.com>
To: linux-btrfs@vger.kernel.org
Subject: Re: [newb] move /home to subvolume
Date: Mon, 01 Jun 2015 19:03:19 -0400	[thread overview]
Message-ID: <mkiobn$icn$1@ger.gmane.org> (raw)
In-Reply-To: CAJCQCtSSt623v-M6wvRUt7vbkd9qkKPnS7guMgCKDxJd+C9rtw@mail.gmail.com

Chris Murphy wrote:

> On Mon, Jun 1, 2015 at 6:36 AM, Neal Becker <ndbecker2@gmail.com> wrote:
>> I have everything under /:
>>
>> sudo btrfs subvolume list /
>> ID 257 gen 65795 top level 5 path root
> 
> root is a subvolume, but is not the top level (default) subvolume.
>>
>> I want to move /home onto it's own subvolume.  I hope I can do this while
>> the root device is mounted.
> 
> Yes.
> 
> You need to mount the top level and create a new subvolume. Assuming
> you haven't changed the default subvolume, just mount the device
> normally:
> 
> mount /dev/sdaX /mnt
> btrfs sub create /mnt/home
> cp -a --reflink /mnt/root/home /mnt/
> vi /etc/fstab ## to add an entry to mount subvol=home at /home
> umount /home
> mount /home
> 
> And then at your leisure you can blow away the contents of the copied
> and no longer used /home directory still in the root subvolume. Just
> be certain you're deleting the correct home. You could:
> cd /mnt/root/home
> rm -rf *     ## egads be certain
> 
> This is not a mount point, but the old home directory which is no
> longer in use. The path to the in use one is /mnt/home as well as
> /home (in the above example).
> 

Thanks, this all worked just fine.  Only thing I did differently, I needed 
to rename the old /home to /oldhome and mkdir /home for the new subvol 
mount, so that I now have /home and /oldhome and can, at my leisure, rm -rf 
oldhome (otherwise, mounting /home would have hidden the old /home and made 
it impossible to rm).


      parent reply	other threads:[~2015-06-01 23:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-01 12:36 [newb] move /home to subvolume Neal Becker
2015-06-01 12:57 ` Vytautas D
2015-06-01 13:03   ` Neal Becker
2015-06-01 13:57     ` Justus Seifert
2015-06-01 14:09     ` Austin S Hemmelgarn
2015-06-01 18:18 ` Chris Murphy
     [not found]   ` <CAG3t+pEHqATjGFUQrLn__O5-ByW4oX6MWjQiYh9GpgfqdKKiyg@mail.gmail.com>
2015-06-01 19:13     ` Chris Murphy
2015-06-01 23:03   ` Neal Becker [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='mkiobn$icn$1@ger.gmane.org' \
    --to=ndbecker2@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox