From owner-freebsd-questions@FreeBSD.ORG Sun Sep 12 16:52:40 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4216106564A for ; Sun, 12 Sep 2010 16:52:40 +0000 (UTC) (envelope-from freebsd-questions@pp.dyndns.biz) Received: from smtprelay-b11.telenor.se (smtprelay-b11.telenor.se [62.127.194.20]) by mx1.freebsd.org (Postfix) with ESMTP id 5B0438FC1B for ; Sun, 12 Sep 2010 16:52:40 +0000 (UTC) Received: from ipb1.telenor.se (ipb1.telenor.se [195.54.127.164]) by smtprelay-b11.telenor.se (Postfix) with ESMTP id E2768E9316 for ; Sun, 12 Sep 2010 18:52:38 +0200 (CEST) X-SENDER-IP: [85.226.59.55] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmwzAJqhjExV4js3PGdsb2JhbACDGZ4uDAEBAQE1La1JkGmBIoFugTx0BIk/g2U X-IronPort-AV: E=Sophos;i="4.56,355,1280700000"; d="scan'208";a="129620299" Received: from c-373be255.107-1-64736c10.cust.bredbandsbolaget.se (HELO gatekeeper.pp.dyndns.biz) ([85.226.59.55]) by ipb1.telenor.se with ESMTP; 12 Sep 2010 18:52:38 +0200 Received: from [192.168.69.67] (phobos [192.168.69.67]) by gatekeeper.pp.dyndns.biz (8.14.4/8.14.4) with ESMTP id o8CGqaTs086684 for ; Sun, 12 Sep 2010 18:52:37 +0200 (CEST) (envelope-from freebsd-questions@pp.dyndns.biz) Message-ID: <4C8D0554.3000507@pp.dyndns.biz> Date: Sun, 12 Sep 2010 18:52:36 +0200 From: =?UTF-8?B?TW9yZ2FuIFdlc3N0csO2bQ==?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.9) Gecko/20100910 Lightning/1.0b2 Thunderbird/3.1.3 MIME-Version: 1.0 To: FreeBSD Questions References: <4C72BCFC.1030106@pp.dyndns.biz> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: 8.1 memstick installation X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2010 16:52:40 -0000 > 2010/8/23 Morgan Wesström: >> On 2010-08-23 19:34, Friedemann Becker wrote: >>> Hello, >>> >>> I have some questions about an installation on a memorystick. >>> >>> I have (a few weeks still) a very poor internet connection at home >>> that's unusable for anything beyond email. I tried some hacking on >>> musescore (yes I know that it can't work, but that's not my problem >>> for now). Since I don't want to carry missing ports/packages/other >>> stuff around on a stick everytime I miss something - which takes one >>> day each - i would like to have a working system (not installation >>> image) on usb-stick. >>> Can i use fdimage with the memorystick installation image on windows, >>> or any hacked versions of it? >>> And how do turn this stick in a running system? >>> Or is there any kind of live-stick-images out there, and if it is, how >>> to move these on the stick (since windows is missing dd and nero >>> doesn't like burning sticks :-) ) >>> >>> Thanks in advance >>> >> >> Check my old message on how to do this in FreeBSD 7.2. The same >> instructions should work for 8.1 too, just change the version references. >> http://lists.freebsd.org/pipermail/freebsd-questions/2009-July/201928.html >> /Morgan >> On 2010-08-26 13:52, Friedemann Becker wrote: > Thanks a lot, > this seems to work. Is there any chance to get this into the faq or > handbook? It's seems way more usefull to me than a live-CD. Best thing > would be putting it into sysinstall, but maybe this is not reallistic. > > Best regards, > Friedemann > For the archives - below I've updated my installation guide to work with FreeBSD 8.1-RELEASE, GPT and ZFS if anyone finds it useful. Make sure your usb memory stick is empty and unpartitioned, then plug it in and boot from the FreeBSD DVD. Select your country and keyboard layout. Enter the Fixit environment and use the live filesystem on your DVD. Your usb memory stick will most likely be da0 but you can (and should) check it with "camcontrol devlist" before you continue. Create a new GPT partitioning scheme: # gpart create -s gpt da0 Create a 64KiB partition for the zfs bootcode starting at LBA 1920: # gpart add -b 1920 -s 128 -t freebsd-boot da0 Create a zfs partition spanning the remainder of the usb memory stick and give it a label we can refer to: # gpart add -t freebsd-zfs -l FreeBSDonUSB da0 (The starting LBA for the first partition is there to align the partitions to the flash memory's erase block size. This is particularly important for the main zfs partition. The main partition above will start at exactly 1MiB (LBA 2048) which will align it to any erase block size used today. This alignment is also of great importance if you use this guide to install FreeBSD to one of the newer harddrives using 4096 byte sectors.) Install the protective MBR to LBA 0 and the zfs bootcode to the first partition: # gpart bootcode -b /dist/boot/pmbr -p /dist/boot/gptzfsboot -i 1 da0 Create /boot/zfs (for zpool.cache) and load the zfs kernel modules: # mkdir /boot/zfs # kldload /dist/boot/kernel/opensolaris.ko # kldload /dist/boot/kernel/zfs.ko Create a zfs pool and set its bootfs property: # zpool create zrootusb /dev/gpt/FreeBSDonUSB # zpool set bootfs=zrootusb zrootusb Switch to fletcher4 checksums and turn off access time modifications: # zfs set checksum=fletcher4 zrootusb # zfs set atime=off zrootusb Extract at a minimum, base and the generic kernel: # cd /dist/8.1-RELEASE/base # DESTDIR=/zrootusb ./install.sh # cd ../kernels # DESTDIR=/zrootusb ./install.sh generic Delete the empty, default kernel directory and move the generic kernel into its place: # rmdir /zrootusb/boot/kernel # mv /zrootusb/boot/GENERIC /zrootusb/boot/kernel Make sure the zfs modules are loaded at boot: # echo 'zfs_load="YES"' > /zrootusb/boot/loader.conf # echo 'vfs.root.mountfrom="zfs:zrootusb"' >> \ /zrootusb/boot/loader.conf Create /etc/rc.conf. Adjust and add to your own needs: # echo 'ifconfig_DEFAULT="DHCP"' > /zrootusb/etc/rc.conf # echo 'hostname="freebsd"' >> /zrootusb/etc/rc.conf # echo 'keymap="swedish.iso"' >> /zrootusb/etc/rc.conf # echo 'ntpdate_enable="YES"' >> /zrootusb/etc/rc.conf # echo 'sshd_enable="YES"' >> /zrootusb/etc/rc.conf # echo 'zfs_enable="YES"' >> /zrootusb/etc/rc.conf Setup your time zone: # cp /zrootusb/usr/share/zoneinfo/Europe/Stockholm \ /zrootusb/etc/localtime Create an empty fstab to avoid startup warnings: # touch /zrootusb/etc/fstab Set the root password in the new environment: # cd # chroot /zrootusb /bin/sh # passwd root # exit Copy zpool.cache: # cp /boot/zfs/zpool.cache /zrootusb/boot/zfs Unmount the filesystem and set its mountpoint: # zfs unmount -a # zfs set mountpoint=legacy zrootusb Exit SYSINSTALL and reboot. You now have a fully functional and bootable FreeBSD installation on your usb memory stick. Regards Morgan Wesström