Bug 195705 - Installer issues / bsdconfig
Summary: Installer issues / bsdconfig
Status: In Progress
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Devin Teske
URL:
Keywords: install
Depends on:
Blocks:
 
Reported: 2014-12-05 09:21 UTC by Chris
Modified: 2022-11-13 22:28 UTC (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris 2014-12-05 09:21:39 UTC
Issue # 1:
Network selection made during install aren't being carried over to the HD after install is completed. Even if I go into the shell option after install & attempt to ping i.e.: yahoo.com nothing is going through. The installer is using it's own default DNS settings: (127.0.0.1) So I went in later w/ bsdconfig & updated my network settings manually deleting the default all together. Now I can ping out Yay me! :) 

Issue # 2
When I go into freebsd & select option 2 or 3 I'm attempting to update from ftp I get:

No pkg(8) database found!

So so went into "options" under "Choose installation Media" & seen USB. Slick, I downloaded a dvd image, (as per reading the documentation it has most of the software in it & judging by size) burned it to a usb thumb drive that's 32Gb in size. (Basically the same way I used dd to create the install media.) I shutdown FreeBSD OS inserted my thumb drive, launched bsdconfig & attempted to install from usb:

No pkg(8) database found!

Just to clarify... X11 went in just fine. 
Ideas? Anyone? 

Off to install a desktop...
Comment 1 Glen Barber freebsd_committer freebsd_triage 2015-07-18 00:01:25 UTC
(In reply to Chris from comment #0)
> Issue # 2
> When I go into freebsd & select option 2 or 3 I'm attempting to update from
> ftp I get:
> 
> No pkg(8) database found!
> 

Packages are not available via ftp.

> So so went into "options" under "Choose installation Media" & seen USB.
> Slick, I downloaded a dvd image, (as per reading the documentation it has
> most of the software in it & judging by size) burned it to a usb thumb drive
> that's 32Gb in size. (Basically the same way I used dd to create the install
> media.) I shutdown FreeBSD OS inserted my thumb drive, launched bsdconfig &
> attempted to install from usb:
> 
> No pkg(8) database found!
> 

This has been an ongoing problem since the 10.0-RELEASE cycle, and persisted through 10.1-RELEASE.

I do not expect this to be resolved anytime soon, and certainly not before 10.2-RELEASE.  Instructions on using the on-disc packages for installation were included in the 10.1-RELEASE announcement email, and will be included in the 10.2-RELEASE email as well.
Comment 2 Devin Teske freebsd_committer freebsd_triage 2018-06-17 22:28:31 UTC
I will focus on the "Install from USB" first then I will focus on FTP (either working to remove all the FTP entries -- leaving only the URL option for, say, pointing at your own in-house FTP setup; or working to get some FTP options restored if we're still interested in presenting some options there).
Comment 3 Devin Teske freebsd_committer freebsd_triage 2018-06-23 21:43:05 UTC
For reference, when Glen said:

> Instructions on using the on-disc packages for installation were included in the 10.1-RELEASE announcement email

That information is available under the third bullet points at each of:

https://www.freebsd.org/releases/10.1R/errata.html#open-issues
https://www.freebsd.org/releases/10.2R/errata.html#open-issues
https://www.freebsd.org/releases/10.3R/errata.html#open-issues
https://www.freebsd.org/releases/10.4R/errata.html#open-issues
Comment 4 Devin Teske freebsd_committer freebsd_triage 2018-06-23 23:27:09 UTC
For reference, I am doing all my work on FreeBSD 11.1-RELEASE amd64.

With respect to "Install from USB". First I want to address userland-case of bsdconfig. That is to say, you have installed the Operating System and want to install packages offline from USB media.

There are a number of ways you could get the DVD media onto a USB thumb drive. I will explain the method that I used first and explain the results I got with that.

I downloaded the memstick image for 11.1-R because I want the USB thumb drive to be bootable. I know this doesn't contain packages, but I will also download the DVD image and perform surgery. Here are the commands that I used:

NB: I was doing this in a VM with limited disk space, so had to sacrifice network and download the full images because I feared I would not have enough disk space to decompress even. If you have plenty of disk space to decompress the *.xz, I recommend downloading them and using unxz instead of downloading the raw .iso/.img files (you'll finish your download in less time and save on overall monthly bandwidth costs, if applicable).

$ fetch https://download.freebsd.org/ftp/releases/ISO-IMAGES/11.1/FreeBSD-11.1-RELEASE-amd64-dvd1.iso
$ sudo mdconfig -f FreeBSD-11.1-RELEASE-amd64-dvd1.iso
md0
$ sudo mkdir -p /dvd
$ sudo mount_cd9660 /dev/md0 /dvd
$ fetch https://download.freebsd.org/ftp/releases/ISO-IMAGES/11.1/FreeBSD-11.1-RELEASE-amd64-memstick.img
$ sudo mdconfig -f FreeBSD-11.1-RELEASE-amd64-memstick.img
md1
$ gpart backup md1 | tee img-layout.txt
GPT 4
1          efi       3    1600  
2 freebsd-boot    1603     118  
3  freebsd-ufs    1721 1504448  
4 freebsd-swap 1506169    2048  
$ sudo camcontrol devlist
# !!! Make sure da1 is the thumb drive !!!
$ sudo gpart destroy -F da1
da1 destroyed
$ sudo gpart create -s gpt da1
da1 created
$ sudo gpart add -t efi -s 1600 da1
da1p1 added
$ sudo gpart add -t freebsd-boot -s 118 da1
da1p2 added
$ gpart show da1
=>      40  30594992  da1  GPT  (15G)
        40      1600    1  efi  (800K)
      1640       118    2  freebsd-boot  (59K)
      1758  30593274       - free -  (15G)

$ sudo gpart add -t freebsd-ufs -s $(( 30593274 - 2048 )) da1
da1p3 added
$ sudo gpart add -t freebsd-swap da1
da1p4 added
$ gpart backup da1 | tee thumb-layout.txt
GPT 128
1            efi       40     1600  
2   freebsd-boot     1640      118  
3    freebsd-ufs     1758 30591226  
4   freebsd-swap 30592984     2048  
$ sudo dd if=/dev/md1p1 of=/dev/da1p1
$ sudo dd if=/dev/md1p2 of=/dev/da1p2
$ sudo dd if=/dev/md1p4 of=/dev/da1p4
$ sudo tunefs -p /dev/md1p3 | tee img-ufs.txt 
tunefs: POSIX.1e ACLs: (-a)                                disabled
tunefs: NFSv4 ACLs: (-N)                                   disabled
tunefs: MAC multilabel: (-l)                               disabled
tunefs: soft updates: (-n)                                 disabled
tunefs: soft update journaling: (-j)                       disabled
tunefs: gjournal: (-J)                                     disabled
tunefs: trim: (-t)                                         disabled
tunefs: maximum blocks per file in a cylinder group: (-e)  2048
tunefs: average file size: (-f)                            16384
tunefs: average number of files in a directory: (-s)       64
tunefs: minimum percentage of free space: (-m)             8%
tunefs: space to hold for metadata blocks: (-k)            0
tunefs: optimization preference: (-o)                      time
tunefs: volume label: (-L)                                 FreeBSD_Install
$ sudo newfs -L FreeBSD_Install -f 2048 -k 0 /dev/da1p3
$ sudo tunefs -p /dev/da1p3 | tee thumb-ufs.txt 
tunefs: POSIX.1e ACLs: (-a)                                disabled
tunefs: NFSv4 ACLs: (-N)                                   disabled
tunefs: MAC multilabel: (-l)                               disabled
tunefs: soft updates: (-n)                                 disabled
tunefs: soft update journaling: (-j)                       disabled
tunefs: gjournal: (-J)                                     disabled
tunefs: trim: (-t)                                         disabled
tunefs: maximum blocks per file in a cylinder group: (-e)  2048
tunefs: average file size: (-f)                            16384
tunefs: average number of files in a directory: (-s)       64
tunefs: minimum percentage of free space: (-m)             8%
tunefs: space to hold for metadata blocks: (-k)            0
tunefs: optimization preference: (-o)                      time
tunefs: volume label: (-L)                                 FreeBSD_Install
$ sudo mount /dev/md1p3 /mnt
$ sudo mkdir -p /usb
$ sudo mount /dev/da1p3 /usb
$ sudo rsync -avzH --delete /mnt/ /usb/
$ sudo rsync -avzH /dvd/ /usb/
# Overwrite USB files with DVD files
# Next steps: Cleaning up ...
$ sudo umount /mnt
$ sudo mdconfig -d -u 1
$ sudo umount /dvd
$ sudo mdconfig -d -u 0
# Next steps: Eject thumb drive (Optional)
$ sudo umount /usb
$ sudo camcontrol eject da1
Unit stopped successfully, Media ejected
# Safe to pull thumb drive out of USB port

The end result of all this is that I should have a bootable USB thumb drive with packages on it and free space. There may be other ways to get the packages onto a thumb drive, but I wanted to explore this option first with respect to what bsdconfig  would see.

When I insert the freshly minted thumb drive (using the above instructions), bsdconfig does not see it as a USB drive but that is fine and somewhat expected (arguably). This is because bsdconfig relies on the GEOM layer to identify what is a USB disk versus regular ol' "DISK" class hardware. My particular USB thumb drive is identified in GEOM as DISK class under the name "da1" (da0 is my VMware virtual disk for my root filesystem, just FYI).

bsdconfig offers a "UFS" option in the "Choose Installation Media" menu.

ASIDE: One minor note, if you plug the USB device into the computer after the "Choose Installation Media" menu has been presented, you can go to Options -> "Re-Scan Devices" to pick new GEOM devices.

Selecting the UFS menu, I can see multiple entries (thanks to GEOM tasting) representing the thumb drive, but these two jump out at me:

    da1p3
    ufs/FreeBSD_Install

Selecting ufs/FreeBSD_Install looks good but either work (tested).

Before I move on to FTP (which I am starting to get some ideas on already), I will look into some other ways of having the DVD packages on USB and how GEOM (and therefore bsdconfig) sees such devices.