From owner-freebsd-questions@FreeBSD.ORG Tue Mar 24 08:56:56 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 EADFFFBA for ; Tue, 24 Mar 2015 08:56:55 +0000 (UTC) Received: from mail-yh0-x230.google.com (mail-yh0-x230.google.com [IPv6:2607:f8b0:4002:c01::230]) (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 A10AF277 for ; Tue, 24 Mar 2015 08:56:55 +0000 (UTC) Received: by yhch68 with SMTP id h68so80936580yhc.1 for ; Tue, 24 Mar 2015 01:56:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=uEmOz9zSQ97GZvDdSiCzRXvjYRuRCgJ5TcvomcMX8K4=; b=HiqZwDw+BWPopg1zRRdGdZNS/giWRwNprdzZtaaj1lgr/blQioKDrhTLkBHFPtAoNU t69wKz/CZqC90kuvBat2l0WarMmr6wcMdELjDVhDy1VaxKql3iFjH5/oJo+ZG6UfISNi VoyT3Pyr80fTJeHYuMaPWfTdjiTYyoUUDQDNmFqaejPvPY5+BPBKErBC12GNzfS0FyrB q1uZ5OOnpRxjyvasO34yiAFTwnFx3wxrKCGj9bkqiAu4VsaXU2hIv7jP/cXudPUHmkEu xsgb+NWQ8UOs+p1lco3UyyBBcYHFq4MFNU+flNvNtpZ7pG/uAlsS8rmWemN+VCLlvYnV q7lA== MIME-Version: 1.0 X-Received: by 10.236.221.136 with SMTP id r8mr3188545yhp.137.1427187414869; Tue, 24 Mar 2015 01:56:54 -0700 (PDT) Received: by 10.170.60.69 with HTTP; Tue, 24 Mar 2015 01:56:54 -0700 (PDT) In-Reply-To: <20150324092914.ed0ebb7f.freebsd@edvax.de> References: <20150324092914.ed0ebb7f.freebsd@edvax.de> Date: Tue, 24 Mar 2015 01:56:54 -0700 Message-ID: Subject: Re: Possible (or smart) to put freebsd-boot on USB stick for root-on-ZFS? From: Mehmet Erol Sanliturk To: Polytropon Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 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:56:56 -0000 On Tue, Mar 24, 2015 at 1:29 AM, Polytropon wrote: > 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, ... > In my set up , my /home/user_name is in OS disk for login purposes and it is mainly empty , it is not in data disks . On NEW OS installs , I am using the SAME user name ( not password ) to prevent user changes in data disks . Data disks are mounted on different directories such as /Data_Files /Saved_Files_A An external HDD ( ntfs ) , synchronized through .../media/... in Linux ( auto mounted when attached ). ( In FreeBSD , this may be an internal HDD mounted by "fstab" into a directory such as /Saved_Files_B and formatted as like /Saved_Files_A or different ( one UFS , other ZFS , etc. ) . ) Owner of /Data_Files /Saved_Files_A directories are my user_name , not "root" . Thank you very much . Mehmet Erol Sanliturk