Fwd: move /home to ZFS pool

nitin chandra nitinchandra1 at gmail.com
Sat Oct 14 07:12:53 UTC 2017


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