Monday, March 02, 2009

Tutorial: Building a minimal Linux root filesystem (Step 0)

The first thing when creating a root filesystem is to create a filesystem for it. There are other means to reach the result, but here is a simple one which should work on all *nix systems.

1) Create the container for the filesystem using dd
dd if=/dev/zero of=filesystem_name bs=block_size, typically 1024 count=size in bytes

2) overall a basic filesystem, for example ext2
mk.ext2fs -N number_of_Inodes filesystem_name


and ready!
Please note that the number of Inodes must be greater than the number of files to be created on the root filesystem. If you ever experience a "No space left on device" even though you df shows you otherwise, this might be the problem.

No comments: