Moving boot disk - does not seem easy?

Karl Denninger karl at denninger.net
Fri Sep 13 13:36:41 UTC 2019


On 9/12/2019 23:50, Polytropon wrote:
> On Thu, 12 Sep 2019 22:26:32 +0100, james wrote:
>> I had thought that this would be straightforward but it seems not.
>>
>> I have a freebsd 12 system, UFS boots /ada0p2.  Mounts some ZFS 
>> partitions and I'm away.
>>
>> I add a new PCIe card with a SATA SSD, and it grabs ada0.
>>
>> I want to move my boot to the SSD, not least because the boot priority 
>> now favours it as ada0, and I had to manually boot ada1p2.
> Use labels - you no longer have to deal with device names that
> could change depending on detection order (or other properties).
> As long as there is the appropriate boot code installed and you
> are referencing the boot partition's label, it will work, no
> matter if it is ada0p2 or ada2p2.
>
> Documentation and examples:
>
> https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/geom-glabel.html
>
> http://www.wonkity.com/~wblock/docs/html/disksetup.html#_the_new_standard_gpt

Labels are a good idea BUT be careful that you don't have two devices
connected at once with the same label on one of their partitions. 
Incidentally if you do things like boot off an encrypted ZFS pool you'll
note that by default the boot pool ignores the labels... :-)

[karl at NewFS ~]$ zpool status
  pool: zs
 state: ONLINE
  scan: scrub repaired 0 in 0 days 06:46:37 with 0 errors on Thu Sep 12
10:48:49 2019
config:

        NAME               STATE     READ WRITE CKSUM
        zs                 ONLINE       0     0     0
          raidz2-0         ONLINE       0     0     0
            gpt/rust1.eli  ONLINE       0     0     0
            gpt/rust2.eli  ONLINE       0     0     0
            gpt/rust3.eli  ONLINE       0     0     0
            gpt/rust4.eli  ONLINE       0     0     0
            gpt/rust5.eli  ONLINE       0     0     0

errors: No known data errors

  pool: zsr
 state: ONLINE
  scan: scrub repaired 0 in 0 days 00:04:20 with 0 errors on Mon Sep  2
03:13:46 2019
config:

        NAME            STATE     READ WRITE CKSUM
        zsr             ONLINE       0     0     0
          raidz2-0      ONLINE       0     0     0
            da2p4.eli   ONLINE       0     0     0
            da1p4.eli   ONLINE       0     0     0
            da11p4.eli  ONLINE       0     0     0
            da0p4.eli   ONLINE       0     0     0
            da3p4.eli   ONLINE       0     0     0

errors: No known data errors

Yes, those root pool elements (zsr) have labels (e.g. "ssd1" through
"ssd5"); the loader found their names during the probe and mounted them
this way anyway. 

-- 
Karl Denninger
karl at denninger.net <mailto:karl at denninger.net>
/The Market Ticker/
/[S/MIME encrypted email preferred]/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4897 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20190913/435d22eb/attachment.bin>


More information about the freebsd-questions mailing list