From owner-freebsd-questions@freebsd.org Sat Dec 5 14:49:20 2015 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF7B0A4140B for ; Sat, 5 Dec 2015 14:49:20 +0000 (UTC) (envelope-from vsasjason@gmail.com) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5CF5C1808 for ; Sat, 5 Dec 2015 14:49:20 +0000 (UTC) (envelope-from vsasjason@gmail.com) Received: by wmec201 with SMTP id c201so99551979wme.1 for ; Sat, 05 Dec 2015 06:49:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=YzTdqnZjaDaGG99DoC/hmHbeqC3UeUTSQE+WhO1UvEk=; b=KX6pz7+lpPyPhVW+x+1oJa+Zh3cr6cZKRIZcmLElPJ9U+km5ByRliOBVp216K+8kYF HZoKE/bQRlZ8ZK5V2iV55Hw6fJXa1ui9J4FpyvYR7RDv9VjFOGnEu0x3xbOJzsEOJpCB ZZbH5uMUsNEG7rH0m492Plfo9GZRrI3F+c4G2TgEM/to/L0ofmsKofXlI8gqJ4Vbd3cG sjq9Z9rKEB3p9pgs+uS6tuyfWELr/tyPvOG0wQA3FaqpbPFWzPljlARYjHzxSJMaZRTp bRWaRHm8rf+xybiOh+AVMFZRUauAQobsrWt38CQozOnPsw5kjZi0A2wrlzhrvWM3qTtq HR8Q== X-Received: by 10.28.85.129 with SMTP id j123mr11684842wmb.77.1449326958941; Sat, 05 Dec 2015 06:49:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.140.75 with HTTP; Sat, 5 Dec 2015 06:48:59 -0800 (PST) In-Reply-To: <566299bf.2z11XFWfUMRFyXGs%perryh@pluto.rain.com> References: <566299bf.2z11XFWfUMRFyXGs%perryh@pluto.rain.com> From: Anton Sayetsky Date: Sat, 5 Dec 2015 16:48:59 +0200 Message-ID: Subject: Re: resizing a memstick image To: Perry Hutchison Cc: freebsd-questions@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2015 14:49:20 -0000 RTFM: https://www.freebsd.org/doc/handbook/disks-growing.html 2015-12-05 10:01 GMT+02:00 Perry Hutchison : > Having downloaded the 10.2 memstick image, I see that it is > configured as a 657MB GPT: > > # mdconfig -a -t vnode -u 0 -f /path/to/FreeBSD-10.2-RELEASE-i386-memstick.img > > # ls -l /dev/md* > crw-r----- 1 root operator 0, 175 Nov 30 01:46 /dev/md0 > crw-r----- 1 root operator 0, 176 Nov 30 01:46 /dev/md0p1 > crw-r----- 1 root operator 0, 178 Nov 30 01:46 /dev/md0p2 > crw-r----- 1 root operator 0, 179 Nov 30 01:46 /dev/md0p3 > crw------- 1 root wheel 0, 74 Aug 29 12:17 /dev/mdctl > > # gpart show md0 > => 3 1346448 md0 GPT (657M) > 3 32 1 freebsd-boot (16K) > 35 1344368 2 freebsd-ufs (656M) > 1344403 2048 3 freebsd-swap (1.0M) > > After I write this onto a 4GB flash drive, how would I go about > resizing the GPT and/or protective MBR to reflect the actual size > of the drive, so as to make the remaining 3GB or so available for > an additional partition and eliminate the geom warnings that the > secondary GPT is either corrupted or not in the last LBA? > > Relevant parts of dmesg -- > When connecting the flash drive before writing to it (on FreeBSD 8): > ugen0.3: at usbus0 > umass1: on usbus0 > umass1: SCSI over Bulk-Only; quirks = 0x0000 > umass1:3:1:-1: Attached to scbus3 > (probe0:umass-sim1:1:0:0): TEST UNIT READY. CDB: 0 0 0 0 0 0 > (probe0:umass-sim1:1:0:0): CAM status: SCSI Status Error > (probe0:umass-sim1:1:0:0): SCSI status: Check Condition > (probe0:umass-sim1:1:0:0): SCSI sense: UNIT ATTENTION asc:28,0 (Not ready to ready change, medium may have changed) > da2 at umass-sim1 bus 1 scbus3 target 0 lun 0 > da2: < Patriot Memory PMAP> Removable Direct Access SCSI-4 device > da2: 1.000MB/s transfers > da2: 3814MB (7811072 512 byte sectors: 255H 63S/T 486C) > > After writing the .img file to the flash drive (on FreeBSD 8): > GEOM: da2: partition 1 does not end on a track boundary. > GEOM: da2: the secondary GPT table is corrupt or invalid. > GEOM: da2: using the primary only -- recovery suggested. > > When booting 10.2-RELEASE from that flash drive: > ehci0: mem 0xffa80800-0xffa80bff irq 23 at device 29.7 on pci0 > usbus4: EHCI version 1.0 > usbus4 on ehci0 > usbus4: 480Mbps High Speed USB v2.0 > ugen4.1: at usbus4 > uhub2: on usbus4 > Root mount waiting for: usbus4 > Root mount waiting for: usbus4 > uhub2: 8 ports with 8 removable, self powered > Root mount waiting for: usbus4 > Root mount waiting for: usbus4 > ugen4.2: at usbus4 > umass0: on usbus4 > umass0: SCSI over Bulk-Only; quirks = 0xc100 > umass0:4:0:-1: Attached to scbus4 > Trying to mount root from ufs:/dev/ufs/FreeBSD_Install [ro,noatime]... > mountroot: waiting for device /dev/ufs/FreeBSD_Install ... > pass2 at umass-sim0 bus 0 scbus4 target 0 lun 0 > pass2: < Patriot Memory PMAP> Removable Direct Access SPC-2 SCSI device > pass2: Serial Number ################ > pass2: 40.000MB/s transfers > GEOM: new disk da0 > da0 at umass-sim0 bus 0 scbus4 target 0 lun 0 > da0: < Patriot Memory PMAP> Removable Direct Access SPC-2 SCSI device > da0: Serial Number ################ > da0: 40.000MB/s transfers > da0: 3814MB (7811072 512 byte sectors: 255H 63S/T 486C) > da0: quirks=0x2 > GEOM: da0: the secondary GPT header is not in the last LBA. > GEOM: diskid/DISK-################: the secondary GPT header is not in the last LBA. > GEOM: diskid/DISK-################: the secondary GPT header is not in the last LBA. > GEOM: diskid/DISK-################: the secondary GPT header is not in the last LBA. > _______________________________________________ > freebsd-questions@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"