From owner-freebsd-questions@FreeBSD.ORG Tue Aug 29 14:31:30 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E8A1D16A4DD for ; Tue, 29 Aug 2006 14:31:29 +0000 (UTC) (envelope-from jerrymc@clunix.cl.msu.edu) Received: from clunix.cl.msu.edu (clunix.cl.msu.edu [35.9.2.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6DC4643D60 for ; Tue, 29 Aug 2006 14:31:27 +0000 (GMT) (envelope-from jerrymc@clunix.cl.msu.edu) Received: from clunix.cl.msu.edu (localhost [127.0.0.1]) by clunix.cl.msu.edu (8.13.6+Sun/8.13.6) with ESMTP id k7TEVQMC002512; Tue, 29 Aug 2006 10:31:26 -0400 (EDT) Received: (from jerrymc@localhost) by clunix.cl.msu.edu (8.13.6+Sun/8.13.6/Submit) id k7TEVMYK002511; Tue, 29 Aug 2006 10:31:22 -0400 (EDT) From: Jerry McAllister Message-Id: <200608291431.k7TEVMYK002511@clunix.cl.msu.edu> To: daniel@unisul.br Date: Tue, 29 Aug 2006 10:31:22 -0400 (EDT) In-Reply-To: <200608291148.k7TBmEcL028572@relay.unisul.br> X-Mailer: ELM [version 2.5 PL7] MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: freebsd-questions@freebsd.org Subject: Re: Deletar the /var partition and to create it with bigger size! 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, 29 Aug 2006 14:31:30 -0000 > > I always used sysinstall to create or to erase partitions of the > FreeBSD. However I had difficulty to execute this task for problems of > geometry of the disk. I would like to know through that command I can create > or erase partitions of the FreeBSD. The SLICE I already to obtain to > modify through the FDISK. First of all, you must have available empty space contiguous with the partition you wish to expand. If you do not have that, then you will have to start from scratch, or add another disk drive. You can use sysinstall to recreate partitions and modify slices as long as there is space available and as long as the drive or slice is not mounted and in use. (drive is you are modifying slices and slice if you are modifyine partitions) If you do not use sysinstall then fdisk is used to change slices. You may need to do it from a fixit disk because it is likely you will be modifying the FreeBSD slice that the system normally uses to boot. If you want to change a partition within a slice (namely the FreeBSD slice) you need to use bsdlabel(8). That creates and writes the slice's label and defines partitions. After using bsdlabel, you must use newfs(8) to create the file system on the newly created/modified partition. But, still, to add space to a partition, there must be free space - eg space that is not in a partition already - right next to the partition you want to expand. Alternatively, you do not specifically have to increase the /var partition. you can move some of its contents to another partition where there is sufficient free space (if such exists) and then create symbolic links to the new location[s]. Common candidated for such moving and linking are /var/spool, /var/log, /var/db and/or /var/mail. My habit is to have a large partition that contains home directories and other overflows. Typical mount point is /home. Then, I usually put /var/spool and /var/log there as directories named /home/var.spool and /home/var.log and link them back to the original names in /var. eg, after copying those directories over to /home/var.spool and /home/var.log respectively, I then rm the original /var/spool and /var/log and then create links. Actually, first I rename them, then do the link and check things before actually rm-ing the originals. Something like this: All must be done as root (and probably best in single user, but not required). cd /var use tar | tar or cp -Rp to make a new copy in /home cp -Rp spool /home/var.spool mv spool oldspool ln -s /home/var.spool spool cp -Rp log /home/var.log mv log oldlog ln -s /home/var.log log Check it all out to make sure it is just fine cd /var rm -rf oldspool rm -rf oldlog I like to use the naming convention of var.spool and var.log for the copies because it reminds me of where there come from. I a similar thing with /var/db in /var and with /uar/local, /usr/ports, and /usr/src in /usr Then those things which grow, sometimes unexpectedly can have room without me constantly monitoring them. It also makes backups more straightforward. Everything that is frequently changing is in /home. Of course, if you do not have a large directory with plenty of space available, then you may be looking to add some disk space. Good luck, ////jerry > > Thank you! >   > Daniel Bitencourt Cadorin >