Return-Path: Received: from [195.159.176.226] ([195.159.176.226]:37185 "EHLO blaine.gmane.org" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1754379AbdKCHUO (ORCPT ); Fri, 3 Nov 2017 03:20:14 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1eAWGp-0001Hh-DO for linux-btrfs@vger.kernel.org; Fri, 03 Nov 2017 08:20:03 +0100 To: linux-btrfs@vger.kernel.org From: Kai Krakow Subject: Re: defragmenting best practice? Date: Fri, 3 Nov 2017 08:19:59 +0100 Message-ID: <20171103081959.22fc5a24@jupiter.sol.kaishome.de> References: <20170831070558.GB5783@rus.uni-stuttgart.de> <20170914172434.39eae89d@jupiter.sol.kaishome.de> <59BBB15E.8010002@sarach.com.pl> <59BBDFA6.4020500@sarach.com.pl> <20170915190826.1f0be8a9@jupiter.sol.kaishome.de> <23033.512.820691.680916@tree.ty.sabi.co.uk> <9e274506-9780-bb74-8ba0-e5fa6c9663c3@gmail.com> <06352a91-4076-8c2a-3079-890e68abcdf5@rqc.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-btrfs-owner@vger.kernel.org List-ID: Am Fri, 3 Nov 2017 08:58:22 +0300 schrieb Marat Khalili : > On 02/11/17 04:39, Dave wrote: > > I'm going to make this change now. What would be a good way to > > implement this so that the change applies to the $HOME/.cache of > > each user? > I'd make each user's .cache a symlink (should work but if it won't > then bind mount) to a per-user directory in some separately mounted > volume with necessary options. On a systemd system, each user already has a private tmpfs location at /run/user/$(id -u). You could add to the central login script: # CACHE_DIR="/run/user/$(id -u)/cache" # mkdir -p $CACHE_DIR && ln -snf $CACHE_DIR $HOME/.cache You should not run this as root (because of mkdir -p). You could wrap it into an if statement: # if [ "$(whoami)" -ne "root" ]; then # ... # fi -- Regards, Kai Replies to list-only preferred.