Mounting /home directory on its own drive breaks quotas (?)

I had some advice in here on moving my /home directory to a drive of its own:

https://forum.virtualmin.com/t/relocate-home-directory/133626

Which I ultimately did in this way:

sudo fdisk -l

    (determine drive, probably /dev/sdb) 

sudo fdisk /dev/sdb

    n 
    p (the default) 
    1 (the default) 
    <enter> (the default, probably 2048) 
    <enter> (the default, some big number) 
    w 

sudo mkfs.ext4 /dev/sdb1
sudo mkdir /mnt/home
sudo mount /dev/sdb1 /mnt/home
sudo blkid /dev/sdb1

    (get the UUID string, be mindful that when you paste it later you'll have to remove the double-quotes) 

sudo rsync -av /home/ /mnt/home/
sudo nano /etc/fstab

    Add line (this UUID is an example):

        UUID=80fff7d0-184e-4d49-bb4d-282098bf7f3e /home ext4 defaults,relatime,usrquota,grpquota,quota,rw 0 2 

    Whole fstab would look something like this:

        # /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/ubuntu-vg/ubuntu-lv during curtin installation 
        /dev/disk/by-id/dm-uuid-LVM-TyLZvf3M8aGRPF4YjukB1I67mhyugjFxzfteEO1LYxELrdqnwOzgw9qN8hrB3cVy / ext4 quota,grpquota,usrquota,relatime,rw 0 1 
        # /boot was on /dev/sda2 during curtin installation 
        /dev/disk/by-uuid/24e58b7a-0439-4b03-a93e-e11fd52a1280 /boot ext4 defaults 0 1 
        UUID=99f17b50-7e96-410d-9c5b-954dcd248c7e /home ext4 defaults,relatime,usrquota,grpquota,quota,rw 0 2 

Ctrl-X and Y to exit and save
sudo umount /home
sudo mkdir /mnt/old_home
sudo mv /home /mnt/old_home
sudo mkdir /home
systemctl daemon-reload
sudo mount -a
df -h (check to see that "sdb1" in the answer) 

I noticed today that Virtualmin thinks I should recheck my configuration as its version may have updated. And when I do that one of the output strings says:

Quotas are not enabled on the filesystem /home which contains home directories under /home and email files under /home. Quota editing has been disabled

My fstab looks like this:

# / was on /dev/ubuntu-vg/ubuntu-lv during curtin installation
/dev/disk/by-id/dm-uuid-LVM-ZGyBSDlCriWXemlbEbnphTeUOqzYSn5RQrnL3Q39dpUzjnj3YeL3oj3749ahGid    /       ext4    rw,relatime,quota,usrquota,grpquota     0       1
# /boot was on /dev/sda2 during curtin installation
/dev/disk/by-uuid/61c79856-123c-48ba-99da-5ab9366cf6db /boot ext4 defaults 0 1
UUID=d4942993-5a7b-412c-8f52-a895ec88b71c /home ext4 defaults,relatime,usrquota,grpquota,quota,rw 0 2

I can fix this by changing the first and third lines of that thusly:

/dev/disk/by-id/dm-uuid-LVM-ZGyBSDlCriWXemlbEbnphTeUOqzYSn5RQrnL3Q39dpUzjnj3YeL3oj3749ahGid    /       ext4    rw,relatime,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0     0       1

UUID=d4942993-5a7b-412c-8f52-a895ec88b71c /home ext4 defaults,relatime,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0 0 2

And then:

systemctl daemon-reload
sudo quotaoff -av
sudo rm -f /aquota.user /aquota.group /home/aquota.user /home/aquota.group
sudo quotacheck -avugm -f
sudo quotaon -av

But should I? (Like have I done the right thing by my Virtualmin system this way?)

Thanks.

Ron

SYSTEM INFORMATION
OS type and version Ubuntu 7.30.8
Virtualmin version 2.402

It looks like all the commands you used were system commands? While I wouldn’t recommend it on a production system, I think you would have had to MOVE the partition to the new disk instead of recreating /home and rsyncing the contents. But this is from memory of long past installs. :wink:

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.