Annotation of wikisrc/ports/evbarm/install_using_sysinst.mdwn, revision 1.5

1.1       leot        1: [[!meta title="NetBSD/evbarm install via sysinst(8) on a SATA hard disk, USB stick or (u)SD card"]]
                      2: 
                      3: In this document we will see step by step how to install NetBSD/evbarm on an
                      4: external media (SATA hard disk, USB stick or (u)SD card) using
                      5: [[!template id=man name="sysinst" section="8"]].
                      6: 
                      7: 
                      8: # Populating (u)SD card with `armv7.img`
                      9: 
                     10: *TODOleot*: (mostly) copy-paste instructions from allwinner.mdwn
                     11: 
                     12: *TODOleot*: Adjust/provide u-boot incantantions to boot on a BPI
                     13: 
                     14: 
                     15: # Installing via sysinst(8)
                     16: 
1.2       leot       17: *TODOleot*: Document all sysinst(8) "screenshot"!
                     18: 
1.3       leot       19: Now that the SD card is populated with `armv7.img` we can login as `root` (by
                     20: default the password is empty) and run `sysinst`:
1.2       leot       21: 
1.4       leot       22: [[!template id=programlisting text="""
1.2       leot       23: # sysinst
1.4       leot       24: """]]
1.2       leot       25: 
1.3       leot       26: The first menu is about the system type (Respberry PI or Other), we select the
                     27: latter ("Other"):
                     28: 
1.4       leot       29: [[!template id=programlisting text="""
1.2       leot       30: 
                     31: 
                     32: 
                     33: 
                     34: 
                     35: 
                     36: 
                     37: 
                     38: 
                     39: 
                     40:                     +-------------------------------------+
                     41:                     | What kind of system do you have?    |
                     42:                     |                                     |
                     43:                     | a: Raspberry PI                     |
                     44:                     |>b: Other                            |
                     45:                     +-------------------------------------+
                     46: 
                     47: 
                     48: 
                     49: 
                     50: 
                     51: 
                     52: 
                     53: 
                     54: 
                     55: 
1.4       leot       56: """]]
1.2       leot       57: 
1.3       leot       58: We want to install NetBSD/evbarm on the hard disk so let's select
                     59: "Install NetBSD to hard disk":
                     60: 
1.4       leot       61: [[!template id=programlisting text="""
1.2       leot       62: 
                     63:  NetBSD/evbarm 8.0
                     64: 
                     65:  This menu-driven tool is designed to help you install NetBSD to a hard disk,
                     66:  or upgrade an existing NetBSD system, with a minimum of work.
                     67:  In the following menus type the reference letter (a, b, c, ...) to select an
                     68:  item, or type CTRL+N/CTRL+P to select the next/previous item.
                     69:  The arrow keys and Page-up/Page-down may also work.
                     70:  Activate the current selection from the menu by typing the enter key.
                     71: 
                     72:  If you booted from a floppy, you may now remove the disk.
                     73:  Thank you for using NetBSD!
                     74:                +-----------------------------------------------+
                     75:                | NetBSD-8.0 Install System                     |
                     76:                |                                               |
                     77:                |>a: Install NetBSD to hard disk                |
                     78:                | b: Upgrade NetBSD on a hard disk              |
                     79:                | c: Re-install sets or install additional sets |
                     80:                | d: Reboot the computer                        |
                     81:                | e: Utility menu                               |
                     82:                | f: Config menu                                |
                     83:                | x: Exit Install System                        |
                     84:                +-----------------------------------------------+
                     85: 
                     86: 
                     87: 
1.4       leot       88: """]]
1.2       leot       89: 
1.3       leot       90: Before proceeding with the installation, if the hard disk had any important data
                     91: it is better to stop and doing a backup before proceeding. If it is empty and/or
                     92: we can safetely remove its data we can proceed:
                     93: 
1.4       leot       94: [[!template id=programlisting text="""
1.2       leot       95: 
                     96:  You have chosen to install NetBSD on your hard disk.  This will change
                     97:  information on your hard disk.  You should have made a full backup before
                     98:  this procedure!  This procedure will do the following things:
                     99:          a) Partition your disk
                    100:          b) Create new BSD file systems
                    101:          c) Load and install distribution sets
                    102:          d) Some initial system configuration
                    103: 
                    104:  (After you enter the partition information but before your disk is changed,
                    105:  you will have the opportunity to quit this procedure.)
                    106: 
                    107:  Shall we continue?
                    108:                                +---------------+
                    109:                                | yes or no?    |
                    110:                                |               |
                    111:                                | a: No         |
                    112:                                |>b: Yes        |
                    113:                                +---------------+
                    114: 
                    115: 
                    116: 
                    117: 
                    118: 
                    119: 
                    120: 
1.4       leot      121: """]]
1.2       leot      122: 
1.3       leot      123: Now we can see all the available disks. The hard disk attached via SATA is a
                    124: 120GB SSD recognized as `wd0`:
                    125: 
1.4       leot      126: [[!template id=programlisting text="""
1.2       leot      127: 
                    128:  On which disk do you want to install NetBSD?
                    129: 
                    130: 
                    131:                      +-----------------------------------+
                    132:                      | Available disks                   |
                    133:                      |                                   |
                    134:                      |>a: wd0 (112G, SanDisk SDSSDA120G) |
                    135:                      | b: Extended partitioning          |
                    136:                      | x: Exit                           |
                    137:                      +-----------------------------------+
                    138: 
                    139: 
                    140: 
                    141: 
                    142: 
                    143: 
                    144: 
                    145: 
                    146: 
                    147: 
                    148: 
                    149: 
                    150: 
                    151: 
                    152: 
1.4       leot      153: """]]
1.2       leot      154: 
1.3       leot      155: We now need to edit MBR partition table. We will create two MBR partitions: the
                    156: first one a FAT32 for `/boot` and the other for NetBSD. We select "Edit the MBR
                    157: partition table":
                    158: 
1.4       leot      159: [[!template id=programlisting text="""
1.2       leot      160: 
                    161:  We are now going to install NetBSD on the disk wd0.
                    162: 
                    163:  NetBSD requires a single partition in the disk's MBR partition table, this is
                    164:  split further by the NetBSD disklabel.  NetBSD can also access file systems
                    165:  in other MBR partitions.
                    166: 
                    167:  If you select 'Use the entire disk' then the previous contents of the disk
                    168:  will be overwritten and a single MBR partition used to cover the entire disk.
                    169:  If you want to install more than one operating system then edit the MBR
                    170:  partition table and create a partition for NetBSD.
                    171: 
                    172:  A few hundred MB is enough for a basic installation, but you should allow
                    173:  extra for additional software and user files.
                    174:  Allow at least 5GB if you want to build NetBSD itself.
                    175:                       +---------------------------------+
                    176:                       | Which would you like to do?     |
                    177:                       |                                 |
                    178:                       |>a: Edit the MBR partition table |
                    179:                       | b: Use the entire disk          |
                    180:                       +---------------------------------+
                    181: 
                    182: 
                    183: 
                    184: 
                    185: 
1.4       leot      186: """]]
1.2       leot      187: 
1.3       leot      188: First we select the second entry ("b"), set the "type:" to "NetBSD":
                    189: 
1.4       leot      190: [[!template id=programlisting text="""
1.2       leot      191: 
                    192:  The Current MBR partition table is shown below.
                    193:  Flgs: a => Active partition, I => Install here.
                    194:  Select the partition you wish to change:
                    195: 
                    196:     Total disk size 114473 MB.
                    197:                +-----------------------------------------------------------+
                    198:     Start( MB) |>a:       type: unused                                     |
                    199:     ---------- | b:      start: 0 MB                                       |
                    200:  a:            | c:       size: 0 MB                                       |
                    201: >b:            | d:        end: 0 MB                                       |
                    202:  c:            | e:     active: No                                         |
                    203:  d:          +-----------------------------------+                         |
                    204:  e: Change in| a: Don't change                   |linders/MB)              |
                    205:  x: Partition| b: Delete partition               |                         |
                    206:              |>c: NetBSD                         |-------------------------+
                    207:              | d: Extended partition, LBA        |
                    208:              | e: FreeBSD/386BSD                 |
                    209:              | f: OpenBSD                        |
                    210:              | g: Linux native                   |
                    211:              | h: Linux swap                     |
                    212:              | i: DOS FAT12                      |
1.5     ! leot      213:              | <: page up, >: page down          |
1.2       leot      214:              +-----------------------------------+
                    215: 
                    216: 
1.4       leot      217: """]]
1.2       leot      218: 
1.3       leot      219: We reserve for the NetBSD MBR partition all the end of the disk,
                    220: starting at 92MB (1MB that will be empty and 91MB that will be for
                    221: the FAT32), we also select to make it active ("active: Yes") and
                    222: we will use it to install NetBSD ("install: Yes"):
                    223: 
1.4       leot      224: [[!template id=programlisting text="""
1.2       leot      225: 
                    226:  The Current MBR partition table is shown below.
                    227:  Flgs: a => Active partition, I => Install here.
                    228:  Select the partition you wish to change:
                    229: 
                    230:     Total disk size 114473 MB.
                    231:                +-----------------------------------------------------------+
                    232:     Start( MB) | a:       type: NetBSD                                     |
                    233:     ---------- | b:      start: 92 MB                                      |
                    234:  a:            | c:       size: 114381 MB                                  |
                    235: >b:            | d:        end: 114473 MB                                  |
                    236:  c:            | e:     active: Yes                                        |
                    237:  d:            | f:    install: Yes                                        |
                    238:  e: Change inpu| g: Change input units (sectors/cylinders/MB)              |
                    239:  x: Partition t|>x: Partition OK                                           |
                    240:                +-----------------------------------------------------------+
                    241: 
                    242: 
                    243: 
                    244: 
                    245: 
                    246: 
                    247: 
                    248: 
                    249: 
                    250: 
1.4       leot      251: """]]
1.2       leot      252: 
1.3       leot      253: We now select the first partition ("a") and create a "Windows FAT32", starting
                    254: at 1MB and ending at 92MB before the "NetBSD" partition. We also make it active
                    255: ("active: Yes"):
                    256: 
1.4       leot      257: [[!template id=programlisting text="""
1.2       leot      258: 
                    259:  The Current MBR partition table is shown below.
                    260:  Flgs: a => Active partition, I => Install here.
                    261:  Select the partition you wish to change:
                    262: 
                    263:     Total disk size 114473 MB.
                    264:                +-----------------------------------------------------------+
                    265:     Start( MB) | a:       type: Windows FAT32                              |
                    266:     ---------- | b:      start: 1 MB                                       |
                    267: >a:            | c:       size: 91 MB                                      |
                    268:  b:         92 | d:        end: 92 MB                                      |
                    269:  c:            | e:     active: Yes                                        |
                    270:  d:            | f:    install: No                                         |
                    271:  e: Change inpu| g: Change input units (sectors/cylinders/MB)              |
                    272:  x: Partition t|>x: Partition OK                                           |
                    273:                +-----------------------------------------------------------+
                    274: 
                    275: 
                    276: 
                    277: 
                    278: 
                    279: 
                    280: 
                    281: 
                    282: 
                    283: 
1.4       leot      284: """]]
1.2       leot      285: 
1.3       leot      286: Here the final MBR partition table:
                    287: 
1.4       leot      288: [[!template id=programlisting text="""
1.2       leot      289: 
                    290:  The Current MBR partition table is shown below.
                    291:  Flgs: a => Active partition, I => Install here.
                    292:  Select the partition you wish to change:
                    293: 
                    294:     Total disk size 114473 MB.
                    295: 
                    296:     Start( MB)  Size( MB) Flg Kind
                    297:     ---------- ---------- --- ----------------
                    298: >a:          1         91 a   Windows FAT32
                    299:  b:         92     114381   I NetBSD
                    300:  c:                           unused
                    301:  d:                           unused
                    302:  e: Change input units (sectors/cylinders/MB)
                    303:  x: Partition table OK
                    304: 
                    305: 
                    306: 
                    307: 
                    308: 
                    309: 
                    310: 
                    311: 
                    312: 
                    313: 
                    314: 
1.4       leot      315: """]]
1.2       leot      316: 
1.3       leot      317: Now that the MBR partition table is written we can proceed to set
                    318: sizes of NetBSD partitions:
                    319: 
1.4       leot      320: [[!template id=programlisting text="""
1.2       leot      321: 
                    322:  NetBSD uses a BSD disklabel to carve up the NetBSD portion of the disk into
                    323:  multiple BSD partitions.  You must now set up your BSD disklabel.
                    324: 
                    325:  You can use a simple editor to set the sizes of the NetBSD partitions, or
                    326:  keep the existing partition sizes and contents.
                    327: 
                    328:  You will then be given the opportunity to change any of the disklabel fields.
                    329: 
                    330:  The NetBSD part of your disk is 114381 Megabytes.  A full installation
                    331:  requires at least 288 Megabytes without X and at least 348 Megabytes if the X
                    332:  sets are included.
                    333:                      +-----------------------------------+
                    334:                      | Choose your installation          |
                    335:                      |                                   |
                    336:                      |>a: Set sizes of NetBSD partitions |
                    337:                      | b: Use existing partition sizes   |
                    338:                      +-----------------------------------+
                    339: 
                    340: 
                    341: 
                    342: 
                    343: 
                    344: 
                    345: 
                    346: 
1.4       leot      347: """]]
1.2       leot      348: 
1.3       leot      349: We set the swap size to 4G and we reserve the rest of the space for "/":
                    350: 
1.4       leot      351: [[!template id=programlisting text="""
1.2       leot      352: 
                    353:  You can now change the sizes for the system partitions.  The default is to
                    354:  allocate all the space to the root file system.  However, you may wish to
                    355:  have separate /usr (additional system files), /var (log files etc) or /home
                    356:  (users' home directories) file systems.
                    357: 
                    358:  Free space will be added to the partition marked with a '+'.
                    359: 
                    360:         MB         Cylinders   Sectors   Filesystem
                    361:     a:   2208(110284)      4488   4523904 + /
                    362:     b:   4096              8323   8389584   swap
                    363:     c:      0                 0         0   /tmp (mfs)
                    364:     d:      0                 0         0   /usr
                    365:     e:      0                 0         0   /var
                    366:     f:      0                 0         0   /home
                    367:     g: Add a user defined partition
                    368:     h: Change input units (sectors/cylinders/MB)
                    369:    >x: Accept partition sizes.  Free space 108076 MB, 13 free partitions.
                    370: 
                    371: 
                    372: 
                    373: 
                    374: 
                    375: 
                    376: 
                    377: 
1.4       leot      378: """]]
1.2       leot      379: 
1.3       leot      380: The summary of the current BSD disklabel is:
                    381: 
1.4       leot      382: [[!template id=programlisting text="""
1.2       leot      383: 
                    384:  We now have your BSD disklabel partitions as:
                    385:  This is your last chance to change them.
                    386: 
                    387:     Start  MB   End  MB  Size  MB FS type    Newfs Mount Mount point
                    388:     --------- --------- --------- ---------- ----- ----- -----------
                    389: >a:        92    110375    110284 FFSv1      Yes   Yes   /
                    390:  b:    110376    114472      4096 swap
                    391:  c:         0    114472    114473 Whole disk
                    392:  d:         0         0         0 unused
                    393:  e:         1        91        91 Boot partition
                    394:  f:         0         0         0 unused
                    395:  g: Show all unused partitions
                    396:  h: Change input units (sectors/cylinders/MB)
                    397:  x: Partition sizes ok
                    398: 
                    399: 
                    400: 
                    401: 
                    402: 
                    403: 
                    404: 
                    405: 
                    406: 
                    407: 
                    408: 
1.4       leot      409: """]]
1.2       leot      410: 
1.3       leot      411: We can adjust the disklabel, for example we can use FFSv2 for "/"
                    412: and for the disklabel "e" set its mount point to "/boot" in order
                    413: that an `/etc/fstab` entry will be populated (please note
                    414: that "/boot" will not be automatically mounted by default):
                    415: 
1.4       leot      416: [[!template id=programlisting text="""
1.2       leot      417: 
                    418:  We now have your BSD disklabel partitions as:
                    419:  This is your last chance to change them.
                    420: 
                    421:     Start  MB   End  MB  Size  MB FS type    Newfs Mount Mount point
                    422:     --------- --------- --------- ---------- ----- ----- -----------
                    423:  a:        92    110375    110284 FFSv2      Yes   Yes   /
                    424:  b:    110376    114472      4096 swap
                    425:  c:         0    114472    114473 Whole disk
                    426:  d:         0         0         0 unused
                    427:  e:         1        91        91 Boot partition             /boot
                    428:  f:         0         0         0 unused
                    429:  g: Show all unused partitions
                    430:  h: Change input units (sectors/cylinders/MB)
                    431: >x: Partition sizes ok
                    432: 
                    433: 
                    434: 
                    435: 
                    436: 
                    437: 
                    438: 
                    439: 
                    440: 
                    441: 
                    442: 
1.4       leot      443: """]]
1.2       leot      444: 
1.3       leot      445: We have finally ready to proceed with
                    446: [[!template id=man name="sysinst" section="8"]] as usual and install
                    447: the installation sets.  If you choose to install via FTP/HTTP please
                    448: note that the "Binary set directory" needs to be adjusted from
                    449: `/evbarm/binary/sets` to `/evbarm-earmv7hf/binary/sets` (it's
                    450: missing an `-earmv7hf' due different evbarm-s):
                    451: 
1.4       leot      452: [[!template id=programlisting text="""
1.2       leot      453: 
                    454:  The following are the http site, directory, user, and password that will be
                    455:  used.  If "user" is "ftp", then the password is not needed.
                    456: 
                    457:  a: Host                      ftp.NetBSD.org
                    458:  b: Base directory            pub/NetBSD/NetBSD-8.0
                    459: >c: Binary set directory      /evbarm-earmv7hf/binary/sets
                    460:  d: Source set directory      /source/sets
                    461:  e: User                      ftp
                    462:  f: Password
                    463:  g: Proxy
                    464:  h: Transfer directory        /usr/INSTALL
                    465:  i: Delete after install      No
                    466:  j: Configure network
                    467:  k: Exit
                    468:  x: Get Distribution
                    469: 
                    470: 
                    471: 
                    472: 
                    473: 
                    474: 
                    475: 
                    476: 
                    477: 
                    478: 
1.4       leot      479: """]]
1.2       leot      480: 
1.3       leot      481: The installation will proceed as usual and for more information
                    482: please give a look to
                    483: [The NetBSD Guide](https://www.netbsd.org/docs/guide/en/chap-exinst.html#exinst-choose-media).
                    484: 
                    485: *TODOleot*: add information how to populate `/boot` and prepare `boot.cmd`,
                    486: `boot.scr`.
                    487: 
1.4       leot      488: [[!template id=programlisting text="""
1.2       leot      489: # mount /dev/wd0e /mnt
                    490: # cp -r /boot/* /mnt/
1.4       leot      491: """]]
1.1       leot      492: 
                    493: 
                    494: # References
                    495: 
                    496: *TODOleot*: add a reference to the instructions shared via PR port-evbarm/50806.

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb