From owner-freebsd-questions@FreeBSD.ORG Tue Jun 10 07:52:44 2008 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 01858106566B for ; Tue, 10 Jun 2008 07:52:43 +0000 (UTC) (envelope-from sonicy@otenet.gr) Received: from kane.otenet.gr (kane.otenet.gr [195.170.0.77]) by mx1.freebsd.org (Postfix) with ESMTP id 6CEBF8FC0C for ; Tue, 10 Jun 2008 07:52:43 +0000 (UTC) (envelope-from sonicy@otenet.gr) Received: from atlantis.dyndns.org (athedsl-4367213.home.otenet.gr [79.130.19.93]) by kane.otenet.gr (8.13.8/8.13.8/Debian-3) with ESMTP id m5A7qfUr016133; Tue, 10 Jun 2008 10:52:41 +0300 Message-ID: <484E32C9.5060709@otenet.gr> Date: Tue, 10 Jun 2008 10:52:41 +0300 From: Manolis Kiagias User-Agent: Thunderbird 2.0.0.14 (X11/20080607) MIME-Version: 1.0 To: dhaneshk k References: <20080609205426.N23640@awww.jeah.net> <9145C6E6-4C2F-4DA3-B953-4A91DC4C476B@goldmark.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-7; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: Adding a second disk to increase the space for /var on first dislk : 4 questions 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: Tue, 10 Jun 2008 07:52:44 -0000 dhaneshk k wrote: > > people : I am facing a issue , in my FreeBSD server box the /var (85 % now) directory is going to full , no space left in this disk anymore . > > But I have another disk in my box which is of 140 GB fresh disk , this I have to add so I gone through > the FreeBSD hand book of adding a new disk . > > > According to docs I sliced and partitioned the second disk , > > one doubt : here I created 10GB bsd partition in the second disk , > > I have to assign o assign this for /var (in my first disk /var is going to full) > > > Q1 ) so in /etc/fstab , the mount point what I have to specify ? > > /var itself or I need to create a directory (mkdir /myspace ) > > and add it as the mount point in /etc/fstab ? like this > > > /dev/da1s1e /myspace ufs rw 2 2 > > > OR > > /dev/da1s1e /var ufs rw 2 2 > > > > which one is correct ? > > > > and after this editing of /etc/fstab and restarting of the machine . > > > Q 2 ) my serverbox how it will continue to use the newly added space ? for this I have to do any thing > > > some one told me that I have to copy all the contents of the /var of first disk to this newly added space > > is it right ? > > how to do that > > > Q3 ) dd /dev/da0s1d /dev/da1s1/e right ? (to copy the content from /var (/dev/da0s1d) of the first disk to the newly added space for var on the second disk (/dev/da1s1e ) > > > > Q4 ) Is it needed to install all the applications which already installed in the /var of the first disk to the newly > > added space on the second disk? > > > > > please give your tips and advice to achieve what I am trying to do. Many of you may have done this > > before please help with your comments > > > > > Thanks in advance for all of you > Dhanesh > > > > _________________________________________________________________ > No Harvard, No Oxford. We are here. Find out !! > http://ss1.richmedia.in/recurl.asp?pid=500_______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > > > > You will have to do something like the following: - Mount the new partition to a temporary mount point (like /mnt) i.e.: mount /dev/da1s1e /mnt - Copy all the contents from /var to /mnt. Since /var is in use in a running system, the results maybe less than optimal. I suggest you switch to single user mode for doing this: shutdown now Use something like the following to transfer the files and permissions: tar cfC - /var . | tar xpfC - /mnt (thank you M.W. Lucas!) Now, unmount /var and /mnt and mount your new var: umount /var /mnt mount -o rw /dev/da1s1e /var Edit /etc/fstab and update it for the new disk: /dev/da1s1e /var ufs rw 2 2 either exit to multi user mode or reboot. Of course, check that the files were actually copied to their right places first!