Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Mar 2017 16:25:28 +0100
From:      Matthias Apitz <guru@unixarea.de>
To:        freebsd-questions@freebsd.org
Subject:   Re: bootable ext. USB SSD for backup
Message-ID:  <20170317152528.GA3072@c720-r314251>
In-Reply-To: <alpine.BSF.2.20.1703162320170.74703@wonkity.com>
References:  <20170316194612.GA1748@c720-r314251> <alpine.BSF.2.20.1703162320170.74703@wonkity.com>

next in thread | previous in thread | raw e-mail | index | archive | help
El día jueves, marzo 16, 2017 a las 11:32:14p. m. -0600, Warren Block escribió:

> It works.  I've used USB 3 memory sticks of 16GB and larger with 
> success.  In some versions of FreeBSD, the boot loader is really slow on 
> USB.  Once you get past the really... slow... spinner... it is very 
> usable.  USB 2 is not as good, but can be tolerable and might be 
> good enough with the write speeds of an SSD.
> 
> However, some USB 3 memory sticks run really hot when connected to a USB 
> controller.  For example, the Lexar 128GB JDS55 gets so hot that people 
> have reported melting of the plastic case.  I can verify that level of 
> heat, but have not left it in use long enough for melting.  My Lexar 
> 32GB JDS75 has similar transfer speeds but does not get meltingly hot.

I had not much interest in participate in the discussion about GiB, etc.
Meanwhile I did the following (all based on FreeBSD 12.0-CURRENT r314251 (amd64):


# gpart create -s gpt da0
gpart: geom 'da0': File exists
# gpart destroy -F da0
da0 destroyed
# gpart create -s gpt da0
da0 created
# gpart add -t freebsd-boot -s 512k -a4k -l ssdboot da0
da0p1 added
# gpart bootcode -b /boot/pmbr -p /boot/gptboot -i1 da0
partcode written to da0p1
bootcode written to da0
# gpart add -t freebsd-ufs -l  ssdrootfs -b 1m -s 16g da0
da0p2 added
# gpart add -t freebsd-swap -l ssdswap -a 1m -s 2g da0
da0p3 added
# gpart add -t freebsd-ufs -l  ssdbackupfs -a 1m da0
da0p4 added

# newfs -U -t /dev/gpt/ssdrootfs
# newfs -U -t /dev/gpt/ssdbackupfs

(re/ -t see below)

# gpart set -a active da0
active set on da0
# gpart show -l da0
=>        40  1953525088  da0  GPT  (932G)
          40        1024    1  ssdboot  (512K)
        1064         984       - free -  (492K)
        2048    33554432    2  ssdrootfs  (16G)
    33556480     4194304    3  ssdswap  (2.0G)
    37750784  1915772928    4  ssdbackupfs  (914G)
  1953523712        1416       - free -  (708K)


# mount /dev/gpt/ssdrootfs /mnt


# cd /usr/src
# make installworld  DESTDIR=/mnt
# make installkernel DESTDIR=/mnt
# make distrib-dirs  DESTDIR=/mnt
# make distribution  DESTDIR=/mnt

# cp /etc/rc.conf            /mnt/etc
# cp -p /etc/c720.kbd        /mnt/etc
# cp -p /etc/sysctl.conf     /mnt/etc
# cp -p /boot/loader.conf    /mnt/boot/
# cp -p /boot/device.hints   /mnt/boot/

# cat > /mnt/etc/fstab  <<EOF
/dev/gpt/ssdrootfs  / ufs rw,noatime 1 1
/dev/gpt/ssdswap none swap sw 0 0
EOF

# chroot /mnt passwd root
Changing local password for root
New Password:

the SSD now boots fine ...

I had to switch off TRIM because the SSD does not support it:

# tunefs -t disable /dev/gpt/ssdrootfs
tunefs: issue TRIM to the disk cleared
# tunefs -t disable /dev/gpt/ssdbackupfs
tunefs: issue TRIM to the disk cleared

HIH someone (as well to understand that Linux is not FreeBSD and how the
things are organized in FreeBSD).

	matthias

-- 
Matthias Apitz, ✉ guru@unixarea.de, ⌂ http://www.unixarea.de/  ☎ +49-176-38902045



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170317152528.GA3072>