Now it’s time to prepare a harddisk for use in your NAS. You have to use your favorite partition manager for this, on Linux you can use fdisk, Gparted or Kpart. Also putting the harddisk in a external USB case come at handy now.
Assuming this is the second disk on your system, this will be sdb
(may vary, check your partition editor for actual diskname) and will continue using this.
We need to create 3 partitions for now that consists of a root, swap and home partition, the perfect layout would be:
sdb1
> 40 Gb for root filesystem (create this as ext3 partition)
sdb2
> 512 Mb for swap (create this as linux-swap partition)
sdb3
> Rest of the space on the disk. BUT be sure to leave 100 Mb free at the end of the disk after that partition, you’ll need that later on.
Save all changes to disk and let it partition, this can take up to 30 minutes (with 2 Tb) depending the disksize).
Then close your partition editor and open up a terminal and gain root level access:
sudo su -
Then navigate to /media:
cd /media
Create a mountpoint for the rootpartition and mount it:
mkdir harddisk
mount /dev/sdb1 ./harddisk
Then enter the disk:
cd harddisk
Now copy your tarball containing your root filesystem to the disk and untar it:
cp /root/rootfs.tgz ./
tar vxzf rootfs.tgz
rm rootfs.tgz
Now copy your kernelmodules tarball and untar it:
cp /root/kernelmodules.tgz ./
tar vxzf kernelmodules.tgz
rm kernelmodules.tgz
Now unmount the partition:
cd ..
umount ./harddisk
Now you’re done preparing the harddisk for first use on your NAS. Power it off and put it in your NAS. My next post will tell you how to boot your kernel and gain access to the harddisk to complete the debootstrap process!