# “Error while fetching file:///mnt/usr/freebsd-dist/base.txz : no such file or directory” on FreeBSD 13.1 install



## Kalero (Jul 13, 2022)

Hi, I’m trying to install FreeBSD 13.1 using a USB flash-drive and I keep getting the following error after partitioning the disk:

```
“Error while fetching file:///mnt/usr/freebsd-dist/base.txz : no such file or directory.”
```
The same error occurs with the other tarballs (kernel, ports, etc.) and the installation cannot continue.

Any suggestion? Any help will be appreciated. Thanks.


----------



## SirDice (Jul 13, 2022)

You burned a bootonly image?



> bootonly
> 
> This supports booting a machine using the CDROM drive but *does not contain the installation distribution sets* for installing FreeBSD from the CD itself. You would need to perform a network based install (e.g., from an HTTP or FTP server) after booting from the CD.


----------



## Kalero (Jul 13, 2022)

SirDice said:


> You burned a boot-only image?


No, I burned the memstick image.


----------



## SirDice (Jul 13, 2022)

mini-memstick?



> mini-memstick
> 
> This can be written to a USB memory stick (flash drive) and used to boot a machine, but *does not contain the installation distribution sets* on the medium itself, similar to the bootonly image. It also supports booting into a "livefs" based rescue mode. There are no pre-built packages.


----------



## Kalero (Jul 13, 2022)

SirDice said:


> mini-memstick?


No, the full one.


----------



## SirDice (Jul 13, 2022)

I just downloaded it and I can assure you the files are all there. So either your image is corrupt (did you check the checksum?) or your stick is broken.


```
root@hosaka:/vm/.iso # ll /mnt/usr/freebsd-dist/
total 1295560
-rw-r--r--  1 root  wheel       1046 May 12 11:07 MANIFEST
-rw-r--r--  1 root  wheel  195363380 May 12 11:07 base.txz
-rw-r--r--  1 root  wheel   96256544 May 12 11:07 kernel-dbg.txz
-rw-r--r--  1 root  wheel   51427572 May 12 11:07 kernel.txz
-rw-r--r--  1 root  wheel   67037100 May 12 11:07 lib32.txz
-rw-r--r--  1 root  wheel   44546820 May 12 11:07 ports.txz
-rw-r--r--  1 root  wheel  192751792 May 12 11:07 src.txz
-rw-r--r--  1 root  wheel   15446816 May 12 11:07 tests.txz
```


----------



## Kalero (Jul 13, 2022)

SirDice said:


> I just downloaded it and I can assure you the files are all there. So either your image is corrupt (did you check the checksum?) or your stick is broken.


Thanks for your help. The checksums were OK, as well as the flash drive. Have you tried to select more optional components than the default one when the installation asks whether you want to install any other optional component?


----------



## SirDice (Jul 13, 2022)

It's complaining about missing base.txz, you can't disable that. That file contains the entire base OS. Doesn't have anything to do with third party software either (packages).


----------



## Kalero (Jul 13, 2022)

SirDice said:


> It's complaining about missing base.txz, you can't disable that. That file contains the entire base OS. Doesn't have anything to do with third party software either (packages).


Yes, I know, but I think it’s a bug. Could you try that?


----------



## T-Daemon (Jul 13, 2022)

Kalero said:


> “Error while fetching file://*/mnt*/usr/freebsd-dist/base.txz : no such file or directory.”


The /mnt path is unusual. The default BSDINSTALL_DISTDIR environment is set to /usr/freebsd-dist.

Which optional distribution sets (packages) have you selected?


----------



## SirDice (Jul 13, 2022)

Nothing wrong with the memstick image, boots and installs just fine. No issues, no errors.


----------



## Kalero (Jul 13, 2022)

T-Daemon said:


> The /mnt path is unusual. The default BSDINSTALL_DISTDIR environment is set to /usr/freebsd-dist.
> 
> Which optional distribution sets (packages) have you selected?


I have selected them all.


----------



## Kalero (Jul 13, 2022)

SirDice said:


> Nothing wrong with the memstick image, boots and installs just fine. No issues, no errors.


Did you select every optional component?


----------



## SirDice (Jul 13, 2022)

It's optional _components_, not packages. And it appears to specifically be the base-dbg and lib32-dbg components. Those are not on the image and have to be downloaded. If that happens you indeed get the rather odd `Error while fetching file:///mnt/usr/freebsd-dist/base.txz: No such file or directory`. I never enable those components, I don't need them. But enabling the base-dbg and/or lib32-dbg components does indeed appear to trigger a bug. It should just download those two from a remote site, everything else should come from the install media.


----------



## Kalero (Jul 13, 2022)

SirDice said:


> It's optional _components_, not packages. And it appears to specifically be the base-dbg and lib32-dbg components. Those are not on the image and have to be downloaded. If that happens you indeed get the rather odd `Error while fetching file:///mnt/usr/freebsd-dist/base.txz: No such file or directory`. I never enable those components, I don't need them. But enabling the base-dbg and/or lib32-dbg components does indeed appear to trigger a bug. It should just download those two from a remote site, everything else should come from the install media.


Yes, that’s exactly what I find so odd; the installer has to download the optional components if you select them because they are not in the memstick image, OK, but it mysteriously triggers that error trying to fetch the included ones, locally!

P. S. I’ve corrected “packages” by “components”.


----------



## SirDice (Jul 13, 2022)

I suggest you open your first bug report 






						FreeBSD Bugzilla Main Page
					






					bugs.freebsd.org


----------



## Voltaire (Jul 15, 2022)

Just out of curiosity, how did you put the file on the USB. With something like UNetbootin? What is important to know is that not all methods are equally reliable. The most reliable method is through dd. So your best bet is to overwrite your USB with zeros and then format it to FAT32. Then you can write the downloaded file to the USB with the following (root) command:
_dd bs=4M if=path/to/freebsd-version-x86_64.iso of=/dev/*sdx* conv=fsync oflag=direct status=progress_

I think you should give this a try just to be sure.


----------



## SirDice (Jul 15, 2022)

Irrelevant. The base-dbg.txz and lib32-dbg.txz files just aren't on the images. Has nothing to do with the way the image is written to USB.


----------



## smithi (Jul 16, 2022)

Voltaire said:


> Just out of curiosity, how did you put the file on the USB. With something like UNetbootin? What is important to know is that not all methods are equally reliable. The most reliable method is through dd.



Given that it's not the problem here, that's true.



Voltaire said:


> So your best bet is to overwrite your USB with zeros and then format it to FAT32.



Both of those are entirely unnecessary.  The following dd does everything needed.



Voltaire said:


> Then you can write the downloaded file to the USB with the following (root) command:
> 
> _dd bs=4M if=path/to/freebsd-version-x86_64.iso of=/dev/*sdx* conv=fsync oflag=direct status=progress_



/dev/sdx ?  Do I smell a whiff of Linux?  The Release Announcement example:

`# dd if=FreeBSD-13.1-RELEASE-amd64-memstick.img of=/dev/da0 bs=1m conv=sync`

works fine, from *.img or *.iso


----------



## Voltaire (Jul 27, 2022)

smithi said:


> /dev/sdx ?  Do I smell a whiff of Linux?  The Release Announcement example:
> 
> `# dd if=FreeBSD-13.1-RELEASE-amd64-memstick.img of=/dev/da0 bs=1m conv=sync`
> 
> works fine, from *.img or *.iso


Yes it a command from the Arch Linux wiki. It also works fine on FreeBSD. You have to replace /dev/*sdx* with /dev/da0 but you can use all the rest of the syntax on FreeBSD just fine.


----------



## smithi (Jul 27, 2022)

Yes, though noticing that conv=fsync and conv=sync do different things.  If you want to use fsync(2) perhaps you should use both, as in conv=fsync,sync ?


----------

