From owner-freebsd-questions@FreeBSD.ORG Tue Mar 24 08:29:20 2015 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6BDB59A4 for ; Tue, 24 Mar 2015 08:29:20 +0000 (UTC) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F32F6F57 for ; Tue, 24 Mar 2015 08:29:19 +0000 (UTC) Received: from r56.edvax.de (port-92-195-131-196.dynamic.qsc.de [92.195.131.196]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx01.qsc.de (Postfix) with ESMTPS id DE9813CD96; Tue, 24 Mar 2015 09:29:14 +0100 (CET) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id t2O8TEK2004469; Tue, 24 Mar 2015 09:29:14 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Tue, 24 Mar 2015 09:29:14 +0100 From: Polytropon To: Mehmet Erol Sanliturk Subject: Re: Possible (or smart) to put freebsd-boot on USB stick for root-on-ZFS? Message-Id: <20150324092914.ed0ebb7f.freebsd@edvax.de> In-Reply-To: References: Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "freebsd-questions@freebsd.org" X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Mar 2015 08:29:20 -0000 On Tue, 24 Mar 2015 00:49:46 -0700, Mehmet Erol Sanliturk wrote: > I was using a FULL installation previously : Everything on the SAME HDD . > When it was becoming necessary to install a new operating system , I was > using another HDD and after installation on it the new OS , I was copying > my files ( in my home directory in previous HDD ) into new installed HDD . > This was taking approximately twelve hours . This setup gives you the ability to relapse to the old "state" whenever something fails - both the OS and your files will be as you left them. I think the main problem here is the copying process. If you are using separate UFS partitions, using dump and restore to transfer files might be quicker than "stupid" copying. > I one instance , my OS has been corrupted by a malicious inject ( this is > my suspect because I could not find a true reason for what was the attack > through "Bash" ) . The "modern" installation method of "curl ... | sudo bash" maybe? ;-) > Now , I am using the following set up : > > > I am using TWO HDDs : > > One is ONLY OS , and other is for my data files ( all of them downloaded > from Internet as open source project files ) mounted after installation of > OS . This is a good approach. In case you can't use separate disks, at least use separate UFS partitions. If you're using ZFS, you can apply the restriction that /home is not mounted during OS installation or upgrade. > When I want to upgrade to a new OS , I am using a NEW HDD ( I am NOT > installing onto existing HDD ) by disconnecting power of existing OS and > data HDDs . This will also help you to avoid accidental messing with boot records or partition tables. I "happily" remember the OS/2 installer damaging my partition table, and I had to reconstruct it manually with a hex editor and a handheld calculator. :-) > After installing the new OS and verifying that it is working correctly , I > am powering the data HDD and using an fstab entry to mount it . You can do something similar with ZFS and connected disks: Use boot environments as known on Solaris. Create a snapshot of the working installation first. Then install the new OS. Boot into that environment and check if everything works. Make sure /home is out of scope, just in case. And if you're happy with it, you can delete the snapshot. If not - make it the active installation again and purge the damaged new install. See the "beadm" port for details. > Use a USB stick or HDD ( revolving platter or SSD ) for ONLY OS and OTHER > HDDs for your data files . > > > OS my be on any convenient medium : revolving HDD , SSD , USB stick , it is > not important . If you don't mind longer startup times, you can even use a SD card in an USB enclosure, or a USB stick. This makes it possible to have "pluggable OS versions", like "beadm in hardware". :-) > You may generate any number of copies of it as a spare for possible > failures of used OS device : > In case of failure , the only thing is to do is to shut down the computer , > attach a spare OS medium and boot the computer . Exactly. BEs allow you to do this with your regular set of hard disks. However, by applying ultimate fat fingers, you can still damage things. It's way harder to do that when your old install is on a separate physical disk, disconnected, safely stored. > I am not using RAID , but "rsync" : one with -"-delete" as a replication > of current data disk , another without "--delete" for fear of accidental > deletions . Also have a look at cpdup, it's very handy. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...