Skip to content

Instantly share code, notes, and snippets.

@runapp
Created July 21, 2021 07:43
Show Gist options
  • Save runapp/c1061572fc158e83d15d187bdf5fa998 to your computer and use it in GitHub Desktop.
Save runapp/c1061572fc158e83d15d187bdf5fa998 to your computer and use it in GitHub Desktop.
Enable quota on btrfs, creating subvolume for every user and then
allusers=$(cat)
for i in $allusers ; do
mv $i ==$i && \
btrfs subvol create $i && \
chown --reference===$i $i
done
for i in $allusers ; do
cp -a --reflink=always ==$i/. $i
#pushd ==$i && \
#find . -mindepth 1 -maxdepth 1 | while read j; do
# echo $i/$j
# cp -a --reflink=always $j ../$i/$j
#done
#popd
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment