# Is it possible to install from a running system?



## avonix (Jul 7, 2022)

Would it work If I do the installation manually like creating BSD disklabel/UFS partitions, doing tar -xf base.txz kernel.txz onto new root, running grub-mkconfig and then running bsdconfig once I boot into the new OS?


----------



## SirDice (Jul 7, 2022)

FreeBSD doesn't use GRUB.


----------



## im (Jul 7, 2022)

Yes, you can install FreeBSD manually. It will work if you will done the process correctly.
Also you can copy your running system to another HDD.

Assuming MBR and UFS you should do something like this:
`fdisk -vBI /dev/newhdd1`
`bsdlabel -wB /dev/newhdd1s1`
Edit (save, edit, restore) a created bsdlabel if you need it.
Run newfs for every data partition (enable softupdates and journalling if you need it)
Extract the kernel, base to new boot partition (or copy existing system to new disk).
Mount new / partition somewhere, edit fstab, rc.conf and some other if you need it.
You can run newly installed system as a jail inside the main system. Using a jail you can install some software or prepare the new system for future use.


----------



## avonix (Jul 8, 2022)

im said:


> Yes, you can install FreeBSD manually. It will work if you will done the process correctly.
> Also you can copy your running system to another HDD.
> 
> Assuming MBR and UFS you should do something like this:
> ...


I created a nested BSD disklabel under DOS. Which partition type I have to select here?


----------



## SirDice (Jul 8, 2022)

Boot the FreeBSD install media. Pick a 'custom' install and do the partitioning with the shell from the install media. Use gpart(8) to create the slices and partitions you need.


----------



## im (Jul 8, 2022)

avonix said:


> I created a nested BSD disklabel under DOS. Which partition type I have to select here?


4.2BSD looks as a correct choice.
I liked DOS but creating FreeBSD partitions and slices under DOS in 2022 may result a lot of previously unknown issues. Please use the native FreeBSD tools to avoid the surprices.


----------



## avonix (Jul 15, 2022)

Not what the title says it but here's how I did:

```
dd if=(freebsd image) of=(dev/sdX) (a temporary partition to write the ISO file)
```


```
set root=(hd0,msdosX)
kfreebsd /boot/loader
```

After installation (root on 3rd slice):

```
set root=(hd0,msdos3)
kfreebsd /boot/loader
```


----------

