# What makes NanoBSD fully memory-based at run time?



## anti (Mar 12, 2013)

I am wondering what makes NanoBSD fully memory-based at run time? Is it because itâ€™s small size, so it fits to be in memory disk at run-time? Or there is a special mechanism made it in such form?
Is there something similar to NanoBSD in GNU/Linux?


----------



## Carpetsmoker (Mar 13, 2013)

You can fit anything in memory, as long as you have enough memory 

I'm not sure how nanoBSD works, but in my own home-brew nanoBSD-like script I use this in /boot/loader.rc:

```
set vfs.root.mountfrom="ufs:/dev/md0"
load /boot/kernel/kernel
echo Loading mfsroot
load -t mfs_root /mfsroot
set beastie_disable="YES"
autoboot
```

I boot this with syslinux:

```
label freebsd
MENU LABEL ^1 AndurilBSD
KERNEL /boot/syslinux/memdisk
APPEND initrd=/boot/freebsd.gz harddisk raw
```

This is actually not very efficient, since syslinux loads freebsd.gz in memory, and then FreeBSD then loads mfsroot in memory, but since the image is ~20M it's acceptable...



> Is there something similar to NanoBSD in GNU/Linux?



Well, Linux is not an OS, it's a collection of different utilities: Linux kernel + GNU bintools + network tools + ...
So making a `small' Linux distro means not adding to many pluses after the `Linux kernel' part 

This is a bit different from FreeBSD, where you have a comparatively large base system to start with, which needs to be `stripped down' in order to be very small.

If you want to make something very minimal, you can use Linux from scratch, which is basically a guide to making your own Linux distribution.
If you view this as an educational experience: go for it. If you just want a minimal distribution: there are already of them out there, so you're probably reinventing the wheel (use an internet search engine to find them).


----------

