From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [OSSTEST PATCH 5/6] ts-xen-build-prep: mkfs a new /home/osstest, don't resize2fs Date: Thu, 14 May 2015 11:05:12 +0100 Message-ID: <1431597912.13579.19.camel@citrix.com> References: <1431515722-5016-1-git-send-email-ian.jackson@eu.citrix.com> <1431515722-5016-6-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Ysq11-0004Lr-0w for xen-devel@lists.xenproject.org; Thu, 14 May 2015 10:05:19 +0000 In-Reply-To: <1431515722-5016-6-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On Wed, 2015-05-13 at 12:15 +0100, Ian Jackson wrote: > +sub replace_home () { > + my $dir = '/home/osstest'; > + my $mapper = lv_dev_mapper($vg,$lvleaf); > + my ($fstype,@opts) = qw(ext3 -m 0 -O sparse_super); > + target_cmd_root($ho, < + set -ex > + if mount | sed -e 's/^[^ ].* on //; s/ .*//' | grep -F '$dir'; then > + exit 0 > + fi > + mkfs -t $fstype @opts $lv > + mount $lv /mnt > + rsync -aHx --numeric-ids $dir/. /mnt/. > + rm -rf $dir > + mkdir -m 2700 $dir > + echo '$mapper $dir $fstype defaults 0 0' >>/etc/fstab > + umount /mnt > + mount $dir This doesn't update /etc/fstab so in standalone mode (when a host may share build and test duties) the reboots will cause the old /home/osstest to reappear and then I'm not sure if this all does what we want or not with the existing lv.