From owner-freebsd-questions@FreeBSD.ORG Thu Jun 9 08:31:43 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 8AD1F1065672 for ; Thu, 9 Jun 2011 08:31:43 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id 4E4BD8FC12 for ; Thu, 9 Jun 2011 08:31:43 +0000 (UTC) Received: from r55.edvax.de (port-92-195-63-204.dynamic.qsc.de [92.195.63.204]) by mx01.qsc.de (Postfix) with ESMTP id EC5433C9BF; Thu, 9 Jun 2011 10:31:41 +0200 (CEST) Received: from r55.edvax.de (localhost [127.0.0.1]) by r55.edvax.de (8.14.2/8.14.2) with SMTP id p598VfS5001993; Thu, 9 Jun 2011 10:31:41 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Thu, 9 Jun 2011 10:31:40 +0200 From: Polytropon To: Frank Bonnet Message-Id: <20110609103140.a942bea7.freebsd@edvax.de> In-Reply-To: <4DF08287.4050004@esiee.fr> References: <4DF08287.4050004@esiee.fr> Organization: EDVAX X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: make one partition with two existing ? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2011 08:31:43 -0000 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. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...