Re: [newb] move /home to subvolume

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 1, 2015 at 6:36 AM, Neal Becker <ndbecker2@xxxxxxxxx> 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).



>
> What is the procedure?
>
> I tried first to create a subvolume for /home at the top-level, but couldn't
> figure out the syntax:
>
> [nbecker@nbecker2 ~]$ sudo btrfs subvolume create /home
> [sudo] password for nbecker:
> ERROR: '/home' exists


That doesn't work because you're trying to create a home subvolume
where a home directory exists. You need to mount the top level
subvolume to create a subvolume in it.


-- 
Chris Murphy
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux