From owner-freebsd-questions@FreeBSD.ORG Thu Jun 9 08:49:33 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 119FE106566C for ; Thu, 9 Jun 2011 08:49:33 +0000 (UTC) (envelope-from f.bonnet@esiee.fr) Received: from hp9.esiee.fr (hp9.esiee.fr [147.215.1.4]) by mx1.freebsd.org (Postfix) with ESMTP id CF9218FC14 for ; Thu, 9 Jun 2011 08:49:32 +0000 (UTC) Received: from [147.215.1.21] (lisa.esiee.fr [147.215.1.21]) by hp9.esiee.fr (Postfix) with ESMTP id 63A2F14E94A3 for ; Thu, 9 Jun 2011 10:48:40 +0200 (CEST) X-DKIM: OpenDKIM Filter v2.3.2 hp9.esiee.fr 63A2F14E94A3 Message-ID: <4DF0891B.3070708@esiee.fr> Date: Thu, 09 Jun 2011 10:49:31 +0200 From: Frank Bonnet User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10 MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: <4DF08287.4050004@esiee.fr> <20110609103140.a942bea7.freebsd@edvax.de> In-Reply-To: <20110609103140.a942bea7.freebsd@edvax.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: make one partition with two existing ? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2011 08:49:33 -0000 On 06/09/2011 10:31 AM, Polytropon wrote: > On Thu, 09 Jun 2011 10:21:27 +0200, Frank Bonnet wrote: >> Hello >> >> I have a raid 5 array ( HP hardware managed ) that contains the >> following partitions >> >> -- Filesystem Size Used Avail Capacity Mounted on >> /dev/aacd0s1a 1.9G 306M 1.5G 17% / >> devfs 1.0K 1.0K 0B 100% /dev >> /dev/aacd0s1g 10G 7.2M 9.3G 0% /tmp >> /dev/aacd0s1e 609G 559G 1.5G 100% /mnt >> /dev/aacd0s1d 97G 12G 77G 14% /usr >> /dev/aacd0s1f 610G 5.3G 556G 1% /var >> >> What I would like to do is >> >> 1 - delete the /mnt partition >> 2 - extend the /var partition with the free space left by /mnt >> >> Is it faisable without destroying the /var data ? > Shpuld be possible in few steps. > > 1. Unmount /var and dump its content, e. g. > # umount /var > # dump -0a -f /usr/var.dump /dev/aacd0s1f > > If you can't unmount /var, see "man dump" for the -L option. > > 2. Delete the /dev/aacd0s1e and /dev/aacd0s1f partition, e. g. > using sysinsall. > > 3. Create a new partition /dev/aacd0s1e with the size of the > former /dev/aacd0s1e + /dev/aacd0s1f, e. g. using sysinstall > or bsdlabel. > > 4. Initialize the new partition /dev/aacd0s1e, e. g. > # newfs -U /dev/aacd0s1e > Use further tunefs commands if required. > > 5. Mount it and restore from dump. > # mount /dev/aacd0s1e /var > # cd /var > # restore -r -f /usr/var.dump > > Finally you can remove /usr/var.dump. And make a change to > /etc/fstab for the new setting. > > The whole work is best done in single user mode so there > won't be requests for writing things to /var. > > > > > Thanks a lot !