From owner-freebsd-questions@FreeBSD.ORG Tue Feb 4 17:48:31 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 371047AD for ; Tue, 4 Feb 2014 17:48:31 +0000 (UTC) Received: from woodbine.london.02.net (woodbine.london.02.net [87.194.255.145]) by mx1.freebsd.org (Postfix) with ESMTP id D17BF16C2 for ; Tue, 4 Feb 2014 17:48:30 +0000 (UTC) Received: from chaos.bikerevolution.co.uk (93.96.233.122) by woodbine.london.02.net (8.5.140) id 51DA98CE089A8F1C for freebsd-questions@freebsd.org; Tue, 4 Feb 2014 17:47:46 +0000 Message-ID: <52F127C2.4050201@onetel.com> Date: Tue, 04 Feb 2014 17:47:46 +0000 From: Chris Whitehouse User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: User Questions Subject: gpart restore is different to gpart backup Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 17:48:31 -0000 Hi, I have two disks, one with a Windows 7 installation which includes a recovery partition. I saved the recovery partition with Clonezilla and then attempted to duplicate the partition scheme with gpart backup and restore. The original Win7 disk is 160gb, the replacement is 120gb. Booting from FreeBSD 10 usb flash drive I did # gpart backup ada0 > /mnt/gpart_backup_ada0.txt Next I created gpart_restore_ada0.txt from gpart_backup_ada0.txt with the size of the last partition reduced to allow for the size difference between the disks. I swapped disks and did the following Script started on Tue Feb 4 17:03:38 2014 root@:~ # gpart show ada0 gpart: No such geom: ada0. root@:~ # cat /mnt/gpart_show_ada0.txt ## this is the Win7 setup. => 63 312581745 ada0 MBR (149G) 63 1985 - free - (993K) 2048 25165824 1 !39 (12G) 25167872 204800 2 ntfs [active] (100M) 25372672 287205376 3 ntfs (137G) 312578048 3760 - free - (1.8M) root@:~ # cat /mnt/gpart_restore_ada0.txt MBR 4 1 !39 2048 25165824 2 ntfs 25167872 204800 [active] 3 ntfs 25372672 209068913 root@:~ # gpart restore ada0 < /mnt/gpart_restore_ada0.txt root@:~ # gpart show ada0 ## this is the restored setup. => 63 234441585 ada0 MBR (112G) 63 2016 - free - (1.0M) 2079 25165791 1 !39 (12G) 25167870 63 - free - (32K) 25167933 204687 2 ntfs [active] (100M) 25372620 63 - free - (32K) 25372683 209068902 3 ntfs (100G) 234441585 63 - free - (32K) root@:~ # exit Script done on Tue Feb 4 17:04:39 2014 This is the backup file from the Win7 disk. chrisw@chaos:~ % cat mnt/gpart_backup_ada0.txt MBR 4 1 !39 2048 25165824 2 ntfs 25167872 204800 [active] 3 ntfs 25372672 287205376 The resulting partition scheme has the partitions in different locations and different sizes. Why is this? How do I recreate the partition scheme with the same size and locations except for the last partition being smaller? There's a further issue that on trying to restore Clonezilla thinks the 12G partition is 2885MB. Thanks for any insight. Chris