From owner-freebsd-sysinstall@FreeBSD.ORG Tue Oct 25 19:50:30 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 CE14F106566B for ; Tue, 25 Oct 2011 19:50:30 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5F5C88FC0A for ; Tue, 25 Oct 2011 19:50:30 +0000 (UTC) Received: by bkbzt4 with SMTP id zt4so974096bkb.13 for ; Tue, 25 Oct 2011 12:50:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=b8yPdmEOkalSIJbQlPEZPGDWKuva/3x8kSClizVR42U=; b=F24StgseX66AMWUVsT3vo2RZ7U82rH72idrZTSmWGnIfjJjaiaOVfU6/rtPNF/C1Fb 8KoABvaFbTKJLv3Dr6gMLIhCDX5oS63RZvpZDGLvDjscXTHjKMzzdWvB9Xay+1sG7EIG OaEtRlr1H82KbeniFJn+R7FQ9QOmtt1ekkIo8= MIME-Version: 1.0 Received: by 10.182.51.103 with SMTP id j7mr4594292obo.36.1319570694901; Tue, 25 Oct 2011 12:24:54 -0700 (PDT) Received: by 10.182.122.33 with HTTP; Tue, 25 Oct 2011 12:24:54 -0700 (PDT) In-Reply-To: <201110251826.p9PIQ8CB058446@fire.js.berklix.net> References: <201110251826.p9PIQ8CB058446@fire.js.berklix.net> Date: Tue, 25 Oct 2011 12:24:54 -0700 Message-ID: From: Garrett Cooper To: "Julian H. Stacey" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: sysinstall@freebsd.org Subject: Re: 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 19:50:30 -0000 On Tue, Oct 25, 2011 at 11:26 AM, Julian H. Stacey wrote: > 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. =A0This PC is trickier, All 4 are us= ed ! > > =A0MS `My Computer' says > =A0 =A0 =A0 =A0Local Disk (C:) =A0 =A0 =A0 =A0 176 =A0 =A0Gig Free of 218= =A0 GB > =A0 =A0 =A0 =A0RECOVERY (D:) =A0 =A0 =A0 =A0 =A0 =A0 2.39 GB Free of =A0 = 14.5 GB > =A0 =A0 =A0 =A0HP_TOOLS (E:) =A0 =A0 =A0 =A0 =A0 =A092.5 =A0MB Free of = =A0 99.1 MB > > =A0Booting BSD-8.2 USB image: fdisk /dev/ad4 > =A0 =A0 =A0 =A0Partition 1 =A0 =A0 Sysid 7,NTFS etc =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 199 M Active > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0start =A0 =A0 =A02048 size= =A0 =A0407552 > =A0 =A0 =A0 =A0Partition 2 =A0 =A0 Sysid 7,NTFS etc =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0223305 M > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0start =A0 =A0409600 size 4= 57328640 > =A0 =A0 =A0 =A0Partition 3 =A0 =A0 Sysid=3D7,NTFS etc =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 14866 M > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0start 457738240 size =A030= 445568 > =A0 =A0 =A0 =A0Partition 4 =A0 =A0 Sysid 12,DOS/Win-95 32 bit FAT =A0 =A0= 103 M > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0start 488183808 size =A0 = =A0211312 > > F1 : =A0 =A0200 Meg > =A0 =A0 =A0 =A0As F2 is the main MS FS occupying most of disk. > =A0 =A0 =A0 =A0I tried fdisk setting active=3D2, > =A0 =A0 =A0 =A0MS failed to boot then. Reverted back to Active=3D1 & MS b= ooted again. > > =A0 =A0 =A0 =A0I wonder what theyre using F1 for ? > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Repair base ? > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Or later to allow an encrypted F2 OS booti= ng from another > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0smaller F1 OS first ? > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Or just to make it harder for people insta= ll BSD > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Linux or any non MS to find a free partiti= on ? > > =A0 =A0 =A0 =A0Can I merge F1 & F2 somehow ? > > F2 =3D C: Main MS 223 Gig > =A0 =A0 =A0 =A0I shrank the F2 main NTFS from 223 G to 65G & > =A0 =A0 =A0 =A0check rebooted MS & it still boots MS, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0From /usr/ports/sysutils/ntfsprogs using > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/dist/usr/local/sbin/ntfsresize -s 65G -v = /dev/ad4s2 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0adjusted bm_size: 1983648-= >1984000 > > =A0 =A0 =A0 =A0I'm not clear exactly what reduced number of sectors I sho= uld > =A0 =A0 =A0 =A0tell fdisk for F2. > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ntfsinfo -m /dev/ad4s2 | /dist/usr/bin/mor= e > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0sector size: 512 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cluster size 4096, volume = size in clusters 15869139 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0dc 15869139 4096 * p 64999993344 > =A0 =A0 =A0 =A0Maybe I should allow 1K more than df shows when mounted, > =A0 =A0 =A0 =A0as per others below ? > > F3 =3D D: Recovery 15 G > =A0 =A0 =A0 =A0Hmm, this machibe was bought with legal MS inc licence, bu= t > =A0 =A0 =A0 =A0no MS DVD - Sigh > > =A0 =A0 =A0 =A0I could boot BSD from USB stick & tar this or F2 to anothe= r > =A0 =A0 =A0 =A0USB drive. =A0(if tar loses nothing on ntfs ?) > > F4 =3D E 100 Meg partition > =A0 =A0 =A0 =A07 Meg of HP manufacturer tools. I could copy with tar to a > =A0 =A0 =A0 =A0subdir in C: Not sure how I'll save paths for MS to execut= e, > =A0 =A0 =A0 =A0maybe an MS join command to subdir, if MS still have 'join= ' > =A0 =A0 =A0 =A0command (opposite of mount, effectively) > > Curiously, > =A0dmesg announced number of sector for USB da0 but not for ad4, just: > =A0dmesg | grep ad4 # 238475 MB WDC WD2500BEKT UDMA100 SATA 3Gb/s > > =A0cd /dist/sbin > =A0kldload /dist/boot/kernel/ntfs.ko > =A0mount_ntfs =A0 =A0/dev/ad4s1 /lap/1 ; du -s -k /lap/1 =A0 =A0 # =A0 = =A0 25 M > =A0mount_ntfs =A0 =A0/dev/ad4s2 /lap/2 ; du -s -k /lap/2 =A0 =A0 # 48.098= M > =A0mount_ntfs =A0 =A0/dev/ad4s3 /lap/3 ; du -s -k /lap/3 =A0 =A0 # 12,641= M > =A0mount_msdosfs /dev/ad4s4 /lap/4 ; du -s -k /lap/4 =A0 =A0 # =A0 =A06.7= M of 101 M > > =A0df > =A0 =A0 =A0 =A01Kblocks =A0 =A0 =A0 =A0Used =A0 =A0 =A0 =A0 =A0 =A0Avail = =A0 Capacity > =A0s1 =A0 =A0 =A0 203775 =A0 =A0 =A0 =A0 =A028815 =A0 =A0 =A0 =A0174960 = =A014% > =A0s2 =A0 =A0228664319 =A0 =A0 =A0 43896379 =A0 =A0 184767940 =A019% =A0 = =A0 # > =A0s3 =A0 =A0 15222783 =A0 =A0 =A0 12708523 =A0 =A0 =A0 2514260 =A083% = =A0 =A0 # ./hp/ > =A0s4 =A0 =A0 =A0 101562 =A0 =A0 =A0 =A0 =A0 6762 =A0 =A0 =A0 =A0 94800 = =A0 7% =A0 =A0 # ./$RECYCLE.BIN > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0# ./Hewlett-Packard > > =A0Analysis with dc shows F1,F2,F3 fdisk partition entries each 2x512 > =A0bytes more than df shows as size, but with F4, The DOS FS within > =A0the fdisk partiton is considerably smaller: > > =A0 =A0 =A0 =A0 =A0 203775 2 * p =A0 =A0407550 =A0 =A0 =A0 # fdisk shows = =A0 =A0407552 > =A0 =A0 =A0 =A0228664319 2 * p 457328638 =A0 =A0 =A0 # fdisk shows 457328= 640 > =A0 =A0 =A0 =A0 15222783 2 * p =A030445566 =A0 =A0 =A0 # fdisk shows =A03= 0445568 > =A0 =A0 =A0 =A0 =A0 101562 2 * p =A0 =A0203124 =A0 =A0 =A0 # fdisk shows = =A0 =A0211312 > > =A0/dist/usr/local/sbin/ntfsresize -n -s 65G -v /dev/ad4s2 I really don't know if there's a good way to do this other than go into gparted and hack the partitions (create an extended partition, force the non-Windows partition to be primary and set the rest to secondary, etc), but that will probably break HP's recovery software as it expects a fixed disk layout. My suggestion is to just create a recovery DVD from within Windows, blow away the recovery partition(s), and create your BSD stuff. Just beware that maybe restoring from the HP recovery partitions will blast away everything on your disk. One thing that I miss about the old Windows recovery CD stuff that they used to ship with Dells -- it made life so much easier (instead now all home PC vendors cram it onto HDDs, just because it's easier and now mom and pop won't lose their CDs by accident). HTH, -Garrett