From owner-freebsd-sysinstall@FreeBSD.ORG Tue Oct 25 18:55:59 2011 Return-Path: Delivered-To: sysinstall@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBDF0106564A for ; Tue, 25 Oct 2011 18:55:59 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from tower.berklix.org (tower.berklix.org [83.236.223.114]) by mx1.freebsd.org (Postfix) with ESMTP id 7A2688FC12 for ; Tue, 25 Oct 2011 18:55:59 +0000 (UTC) Received: from mart.js.berklix.net (pD9FBECF9.dip.t-dialin.net [217.251.236.249]) (authenticated bits=0) by tower.berklix.org (8.14.2/8.14.2) with ESMTP id p9PIQPVn079818 for ; Tue, 25 Oct 2011 18:26:26 GMT (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (fire.js.berklix.net [192.168.91.41]) by mart.js.berklix.net (8.14.3/8.14.3) with ESMTP id p9PIQEWG070358 for ; Tue, 25 Oct 2011 20:26:14 +0200 (CEST) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (localhost [127.0.0.1]) by fire.js.berklix.net (8.14.4/8.14.4) with ESMTP id p9PIQ8CB058446 for ; Tue, 25 Oct 2011 18:26:14 GMT (envelope-from jhs@fire.js.berklix.net) Message-Id: <201110251826.p9PIQ8CB058446@fire.js.berklix.net> To: sysinstall@freebsd.org From: "Julian H. Stacey" Organization: http://www.berklix.com BSD Unix Linux Consultancy, Munich Germany User-agent: EXMH on FreeBSD http://www.berklix.com/free/ X-URL: http://www.berklix.com/~jhs/cv/ Date: Tue, 25 Oct 2011 20:26:08 +0200 Sender: jhs@berklix.com Cc: Subject: Shrinking 4 parititions on a new HP laptop (fwd) X-BeenThere: freebsd-sysinstall@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Sysinstall Work List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Oct 2011 18:56:00 -0000 Hi sysinstall@freebsd.org, I posted similar to below to hackers Tue, 25 Oct 2011 02:26:05 +0200, but no reply, so reformulating & adding info & hoping sysinstall@ may have ideas what non BSD partitions one might encounter on a newly purchased PC, & how best to remove before installing FreeBSD ? I'm not asking for help on BSD commands, just want ideas what the mess of 4 MS partitions might be, how best to move them aside. A new purchased HP laptop (pavilion entertainment PC dm3 has all 4 partitions occupied with MS (done by HP or shop) (Label under laptop: Windows 7 Home Prem OA.) I want to reduce MS to just 1 of the 4 fdisk partitions & the other 3 for FreeBSD slices (2 boots of different release of BSD & a large common UFS as I usual do). Normaly easy, previously I've found eg with XP, that new MS machines use just a single Fdisk partition eg F1. This PC is trickier, All 4 are used ! MS `My Computer' says Local Disk (C:) 176 Gig Free of 218 GB RECOVERY (D:) 2.39 GB Free of 14.5 GB HP_TOOLS (E:) 92.5 MB Free of 99.1 MB Booting BSD-8.2 USB image: fdisk /dev/ad4 Partition 1 Sysid 7,NTFS etc 199 M Active start 2048 size 407552 Partition 2 Sysid 7,NTFS etc 223305 M start 409600 size 457328640 Partition 3 Sysid=7,NTFS etc 14866 M start 457738240 size 30445568 Partition 4 Sysid 12,DOS/Win-95 32 bit FAT 103 M start 488183808 size 211312 F1 : 200 Meg As F2 is the main MS FS occupying most of disk. I tried fdisk setting active=2, MS failed to boot then. Reverted back to Active=1 & MS booted again. I wonder what theyre using F1 for ? Repair base ? Or later to allow an encrypted F2 OS booting from another smaller F1 OS first ? Or just to make it harder for people install BSD Linux or any non MS to find a free partition ? Can I merge F1 & F2 somehow ? F2 = C: Main MS 223 Gig I shrank the F2 main NTFS from 223 G to 65G & check rebooted MS & it still boots MS, From /usr/ports/sysutils/ntfsprogs using /dist/usr/local/sbin/ntfsresize -s 65G -v /dev/ad4s2 adjusted bm_size: 1983648->1984000 I'm not clear exactly what reduced number of sectors I should tell fdisk for F2. ntfsinfo -m /dev/ad4s2 | /dist/usr/bin/more sector size: 512 cluster size 4096, volume size in clusters 15869139 dc 15869139 4096 * p 64999993344 Maybe I should allow 1K more than df shows when mounted, as per others below ? F3 = D: Recovery 15 G Hmm, this machibe was bought with legal MS inc licence, but no MS DVD - Sigh I could boot BSD from USB stick & tar this or F2 to another USB drive. (if tar loses nothing on ntfs ?) F4 = E 100 Meg partition 7 Meg of HP manufacturer tools. I could copy with tar to a subdir in C: Not sure how I'll save paths for MS to execute, maybe an MS join command to subdir, if MS still have 'join' command (opposite of mount, effectively) Curiously, dmesg announced number of sector for USB da0 but not for ad4, just: dmesg | grep ad4 # 238475 MB WDC WD2500BEKT UDMA100 SATA 3Gb/s cd /dist/sbin kldload /dist/boot/kernel/ntfs.ko mount_ntfs /dev/ad4s1 /lap/1 ; du -s -k /lap/1 # 25 M mount_ntfs /dev/ad4s2 /lap/2 ; du -s -k /lap/2 # 48.098 M mount_ntfs /dev/ad4s3 /lap/3 ; du -s -k /lap/3 # 12,641 M mount_msdosfs /dev/ad4s4 /lap/4 ; du -s -k /lap/4 # 6.7 M of 101 M df 1Kblocks Used Avail Capacity s1 203775 28815 174960 14% s2 228664319 43896379 184767940 19% # s3 15222783 12708523 2514260 83% # ./hp/ s4 101562 6762 94800 7% # ./$RECYCLE.BIN # ./Hewlett-Packard Analysis with dc shows F1,F2,F3 fdisk partition entries each 2x512 bytes more than df shows as size, but with F4, The DOS FS within the fdisk partiton is considerably smaller: 203775 2 * p 407550 # fdisk shows 407552 228664319 2 * p 457328638 # fdisk shows 457328640 15222783 2 * p 30445566 # fdisk shows 30445568 101562 2 * p 203124 # fdisk shows 211312 /dist/usr/local/sbin/ntfsresize -n -s 65G -v /dev/ad4s2 Cheers, Julian - -- Julian Stacey, BSD Unix Linux C Sys Eng Consultants Munich http://berklix.com Reply below, not above; Indent with "> "; Cumulative like a play script. Format: Plain text. Not HTML, multipart/alternative, base64, quoted-printable.