From owner-freebsd-questions@freebsd.org Fri Apr 21 00:41:32 2017 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 BBC81D45DAD for ; Fri, 21 Apr 2017 00:41:32 +0000 (UTC) (envelope-from dpchrist@holgerdanske.com) Received: from holgerdanske.com (holgerdanske.com [184.105.128.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "holgerdanske.com", Issuer "holgerdanske.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AD5CD1C3 for ; Fri, 21 Apr 2017 00:41:32 +0000 (UTC) (envelope-from dpchrist@holgerdanske.com) Received: from 99.100.19.101 ([99.100.19.101]) by holgerdanske.com with ESMTPSA (ECDHE-RSA-AES128-GCM-SHA256:TLSv1.2:Kx=ECDH:Au=RSA:Enc=AESGCM(128):Mac=AEAD) (SMTP-AUTH username dpchrist@holgerdanske.com, mechanism PLAIN) for ; Thu, 20 Apr 2017 17:41:28 -0700 Subject: Re: dd image not working To: freebsd-questions@freebsd.org References: <4ce88806-41f9-4323-b0ef-53d5251a380a@unixarea.de> From: David Christensen Message-ID: <1d37b326-936c-9201-65fb-bf296d4cc9db@holgerdanske.com> Date: Thu, 20 Apr 2017 17:42:29 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0 MIME-Version: 1.0 In-Reply-To: <4ce88806-41f9-4323-b0ef-53d5251a380a@unixarea.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Apr 2017 00:41:32 -0000 On 04/20/2017 09:50 AM, Matthias Apitz wrote: > El jueves, 20 de abril de 2017 18:01:07 (CEST), James B. Byrne > escribió: >> I am trying to create a bootable USB image for FreeBSD. The device >> name of the USB flash memory appears to me to be /dev/sb1 >> >> # mount -l >> . . . >> /dev/sr0 on /media/cdrom0 type iso9660 (ro,noexec,nosuid,nodev) >> none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) >> /dev/sdb1 on /media/KINGSTON type vfat >> (rw,nosuid,nodev,uhelper=udisks,uid=500,gid=500,shortname=mixed,dmask=0077,utf8=1,flush) >> >> # >> >> I dismount that device >> >> # umount /dev/sdb1 >> >> and check >> >> # mount -l >> . . . >> /dev/sr0 on /media/cdrom0 type iso9660 (ro,noexec,nosuid,nodev) >> [Bluebirds] >> none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) >> # >> >> Now I run dd >> # dd >> if=/var/data/disk_images/FreeBSD/FreeBSD-11.0-RELEASE-i386-memstick.img >> of=/dev/sbd1 bs=512 conv=sync >> 1256080+0 records in >> 1256080+0 records out >> 643112960 bytes (643 MB) copied, 1.92347 s, 334 MB/s >> # >> >> >> But the usb key does not appear to have been altered at all. If I >> remove it and reinsert then it automounts with the same information as >> before: >> # mount -l >> . . . >> /dev/sr0 on /media/cdrom0 type iso9660 (ro,noexec,nosuid,nodev) >> [Bluebirds] >> none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) >> /dev/sdb1 on /media/KINGSTON type vfat >> (rw,nosuid,nodev,uhelper=udisks,uid=500,gid=500,shortname=mixed,dmask=0077,utf8=1,flush) >> >> [KINGSTON] >> > > please show > > # fdisk /dev/sdb Using Debian GNU/Linux 8 and dd(1) with the 'list' option: 2017-04-20 17:26:28 root@jesse ~ # fdisk --list /dev/sdb GPT PMBR size mismatch (1256080 != 7913470) will be corrected by w(rite). The backup GPT table is corrupt, but the primary appears OK, so that will be used. Disk /dev/sdb: 3.8 GiB, 4051697152 bytes, 7913471 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: EDF16287-85F8-11E6-A2F6-002590EC6166 Device Start End Sectors Size Type /dev/sdb1 3 125 123 61.5K FreeBSD boot /dev/sdb2 126 1254029 1253904 612.3M FreeBSD UFS /dev/sdb3 1254030 1256077 2048 1M FreeBSD swap Using FreeBSD 11.0 RELEASE and gpart(8) with the 'show' action: root@p43400e:~ # gpart show da0 => 3 1256075 da0 GPT (3.8G) [CORRUPT] 3 123 1 freebsd-boot (62K) 126 1253904 2 freebsd-ufs (612M) 1254030 2048 3 freebsd-swap (1.0M) > I think you should dd to /dev/sdb and not to sdb1 +1 Also: 1. sync(1) is useful. The last time I tried dd(1) with the 'conv=sync' option, my USB image was bad (PEBKAC). 2. A larger block size will increase throughput. So, using Debian GNU/Linux 8 (untested): # dd if=FreeBSD-11.0-RELEASE-i386-memstick.img of=/dev/sdb bs=1M; sync Note that the FreeBSD live system on the USB flash drive will change the drive contents once booted. So, if you're going to checksum the USB flash drive, be sure to do it immediately after burning. David