Hacker Forums

Creating your own Linux Distribution.


by The Uni-Hacker on Jun.17, 2008, under Misc

Recently I’ve been tasked with creating a Linux distribution that can support X-Windows and MONO. A Mono-Project application would be the main front end application running full screen with out the fluff and fat of a regular window manager. My choices were narrowed down between two distributions, Gentoo and Ubuntu server. Gentoo was nice because it was compiled from scratch for my hardware. Ubuntu Server was nice because I could apt-get the binaries and be done with it, no compiling source code.

The first thing you’ll want to do is download and install VirtualBox. Create a new machine and virtual disk with about 5 gigs of disk space. Using the Ubuntu Server ISO mounted as a CD in VirtualBox, boot the system and start the installation process. When you get to the part about disk partitioning, create a 1.8 gig for your main mount and use the rest as a secondary. The reason I chose 1.8gig is because I want to put this on a 2 gig USB drive, so 1.8 should keep my safe. Continue the installation and when you get to the part about selecting a server type, just select OpenSSH and do apt-get’s later. This way you know whats being installed. I did apt-get install Xorg and apt-get mono for my specific application. I think my OS took about 500MB of disk space, not too shabby.

Once you install all your applications you’ll need to create an ISO file. Mount that other partition you made into /mnt/hd. Then simply make an image by typing dd if=/dev/hda1 of=/mnt/hd/my-linux-os.iso. You may need to change the if device (hda1) to match the Virtual Hard drive of your system.

Now you simply copy the image onto a device such as a thumb drive or another hard drive and run grub to install the boot loader. After you install the ISO file you may need to change the fstab file to point to your correct hard drive device. In an up and coming article we’ll be covering bootable cd’s so stay tuned.

Command Overview:

Make ISO out of running OS.
dd if=/dev/hda1 of=/mnt/hd/your-os-distro.iso

Copy and ISO to a drive to use
dd if=/mnt/hd/your-os-distro.iso of=/dev/hda1

Remember to replace hda1 with your actual device, USB drives are usually sdb and SATA drives are usually sta from when I’ve been seeing.

The grub command I use to install my boot loader is as follows:

grub –no-floppy

Now you’ll see a grub prompt.
root(hd0,0) this says to install in hard drive 0, partition 0. Basically the first partition of the first drive in your computer.

setup(hd0)
this actually does the writing of grub.

quit Exit grub, your done.

Remember, hd0 is as if you were booted into your new system. If you have your new system mounted to your working pc, usually you want to change hd0 to hd1 for the drive your working on.

:
Click the Linux+Distributions+ to view the picture in full size.
Linux+Distributions+
Linux+Distributions+
Linux+Distributions+
Linux+Distributions+
Linux+Distributions+
Linux+Distributions+
Linux+Distributions+
Linux+Distributions+
Linux+Distributions+
Linux+Distributions+
Linux+Distributions+
Linux+Distributions+

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...