move /home to ZFS pool
nitin chandra
nitinchandra1 at gmail.com
Sat Oct 14 08:26:50 UTC 2017
Hi,
>From the clue given by Richard, this is what I did :-
1. Cleaned the default user 'adminsys'. moved the hidden file to /opt
2. created data set
# zfs create -o mountpoint=/home homedata/home
# zfs list
NAME USED AVAIL REFER MOUNTPOINT
mapsetsdata 480K 837G 96K /mapsetsdata
mapsetsdata/home 96K 837G 96K /home
# cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda1 during installation
UUID=d3a4cbac-4033-414d-bbee-c5e33547e0f8 / btrfs
defaults,subvol=@ 0 1
# /home was on /dev/sda1 during installation
UUID=d3a4cbac-4033-414d-bbee-c5e33547e0f8 /home btrfs
defaults,subvol=@home 0 2
# swap was on /dev/sda5 during installation
UUID=07b33f4c-5bef-4a99-8678-2c66d1574f0b none swap sw
0 0
## setting ZFS
# /homedata/home /home zfs defaults,noatime 0 2
# df -h
Filesystem Size Used Avail Use% Mounted on
udev 5.8G 0 5.8G 0% /dev
tmpfs 1.2G 9.0M 1.2G 1% /run
/dev/sda1 28G 2.5G 24G 10% /
tmpfs 5.8G 4.0K 5.8G 1% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 5.8G 0 5.8G 0% /sys/fs/cgroup
homedata/home 837G 128K 837G 1% /home
homedata 837G 128K 837G 1% /homedata
cgmfs 100K 0 100K 0% /run/cgmanager/fs
tmpfs 1.2G 0 1.2G 0% /run/user/1000
Which FS will be used, as in fstab /home says btrfs and zfs points to
homedata/home and /home also shows /home size as ZFS pool size ?
Can I add more disk's to this pool ?
copied the 'adminsys'
Still No luck
Suggestion please ...
Thank you
On 14 October 2017 at 12:42, nitin chandra <nitinchandra1 at gmail.com> wrote:
> Hi All,
>
>
> I have ZFS installed on Ubuntu 16.04 with kernel-4.4.0-96 and zfs from
> repositories.
> (zfs from repositories was not getting installed with kernel 4.10 or 4.12)
>
> # sudo apt install spl dkms spl-dkms zfsutils-linux zfs-dkms zfs-doc
> zfs-initramfs zfs-zed
>
> # sudo zpool create -o ashift=12 -o autoexpand=on -o autoreplace=on -O
> atime=off -O compression=lz4 homedata
> ata-WDC_WD10EZEX-08WN4A0_WD-WCC6Y3HCDZU2-part3
>
> # sudo zfs create homedata/home
>
> # sudo zfs set mountpoint=legacy homedata/home
>
> ## edit in '/etc/fstab'
> homedata/home /home zfs defaults,noatime 0 0
>
> I have 2 Admin accounts, adminsys (main) and admin2(temp).
>
> When I reboot the move of /home does not happen.
>
> I have been at this for past 4 days, I am sure I am missing some thing
> very simple.
>
> Some information about the current status :
>
>
> adminsys at home01:~$ sudo zfs list
> [sudo] password for adminsys:
> NAME USED AVAIL REFER MOUNTPOINT
> homedata 308K 837G 116K /homedata
>
>
> adminsys at home01:~$ sudo zpool status
> pool: homedata
> state: ONLINE
> scan: scrub repaired 0 in 0h0m with 0 errors on Fri Oct 13 15:23:11 2017
> config:
>
> NAME STATE READ WRITE CKSUM
> homedata ONLINE 0 0 0
> ata-WDC_WD10EZEX-08WN4A0_WD-WCC6Y3HCDZU2-part3 ONLINE 0 0 0
>
> errors: No known data errors
> adminsys at home01:~$
>
>
> I intend to use this pool to share on LAN with a mix of Win 7/8/10 and
> Linux machines.
>
> Need help in setting up
>
> 1. pool as /home
> 2. 'pool' '/home' on LAN (smb) with 4 users
>
>
> Default users are created when installing Ubuntu at the time of
> install .. 'adminsys', later ... after researching on the net
> somewhere it was
> suggested create 2nd 'root' user to move the main 'root' user ...
> adminsys to the ZFS pool.
>
> so /home directory is not empty.
>
> tried the following in /etc/fstab
>
> homedata/home /home zfs defaults,noatime 0 0
>
> still nope :(
>
> So if I login with 2nd root account,
>
> empty the 1st root directory, erasing even the hidden files. Leave the
> main directory.
>
> then do
>
> [root at homedata]# zfs set mountpoint=legacy homedata/home
>
> then modify 'fstab' as above, will it work ?
>
> If I dont do any modifications to 'fstab' then, Yes, it does mount
> 'homedata' pool on boot. I can
>
> cd /homedata <enter>
>
> [adminsys at home01:/homedata] #
>
>
> Thank you
>
> Nitin
More information about the ubuntu-users
mailing list