From owner-freebsd-questions@FreeBSD.ORG Sat Apr 29 04:04:48 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 D478516A402 for ; Sat, 29 Apr 2006 04:04:48 +0000 (UTC) (envelope-from ijeff@sandbox.ca) Received: from sandbox.ca (zaphod.sandbox.ca [199.246.50.125]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2E35843D46 for ; Sat, 29 Apr 2006 04:04:48 +0000 (GMT) (envelope-from ijeff@sandbox.ca) Received: from [127.0.0.1] (sandbox.ca [199.246.50.125]) by sandbox.ca (8.12.6/8.12.6) with ESMTP id k3T44hx1026978; Sat, 29 Apr 2006 00:04:44 -0400 (EDT) (envelope-from ijeff@sandbox.ca) In-Reply-To: References: Mime-Version: 1.0 (Apple Message framework v749.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <57CE9139-2593-4EA0-8B5F-1DA845ECC82F@sandbox.ca> Content-Transfer-Encoding: 7bit From: Ian Jefferson Date: Sat, 29 Apr 2006 13:04:41 +0900 To: Low Kian Seong X-Mailer: Apple Mail (2.749.3) X-Spam-Status: No, score=-3.2 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.0-igj_main_2005_08_07 X-Spam-Checker-Version: SpamAssassin 3.1.0-igj_main_2005_08_07 (2005-09-13) on zaphod.sandbox.ca Cc: freebsd-questions@freebsd.org Subject: Re: How do you resize an existing partition / slice ? 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: Sat, 29 Apr 2006 04:04:48 -0000 If you have extra disk space it's fairly straightforward to use dump/ restore and re-partition. I recently found myself desiring to re-slice my disk from a single slice to 5 slices. The basics were to dump the contents of my root, var, and usr partitions to 3 files on another disk. I booted from a distribution CD and installed a new OS on slice 2 with the default partitions. Slice 1 became a 1g partition for DOS if the urge struck me later, Slice 2 was a new OS and slice 3 was for the old/existing OS. I relabeled my 2nd slice and restored the original OS to the various partitions. The only thing I forgot was to re-name the partitions in the /etc/fstab on my old OS. The change in slice number went like this: /dev/ad0s1b none swap sw 0 0 /dev/ad0s1a / ufs rw 1 1 /dev/ad0s1e /tmp ufs rw 2 2 /dev/ad0s1f /usr ufs rw 2 2 /dev/ad0s1d /var ufs rw 2 2 Became /dev/ad0s3b none swap sw 0 0 /dev/ad0s3a / ufs rw 1 1 /dev/ad0s3e /tmp ufs rw 2 2 /dev/ad0s3f /usr ufs rw 2 2 /dev/ad0s3d /var ufs rw 2 2 In your case if you want just the original slice you would do something like: boot from the live filesystem CD fdisk your drive, label (partition) your drive to the configuration you want newfs each new partition, mount the drive you used for backup mount each of the new partitions of your original disk Restore each of the partitions in turn. Reboot from the original disk. This looks a bit complex but is not too bad at all. This dump/ restore or even tar'ing filesystems is something we used a long time ago to "image" NeXT systems. It's been quite reliable for me. Your mileage may vary. IJ On Apr 29, 2006, at 3:24 AM, Low Kian Seong wrote: > Dear all, > > Like the subject shows, I would just like to know how do i resize an > existing partition or slice, ermm with minimum loss of data of course. > > Thanks. > _______________________________________________ > 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"