FreeBSD slice after any Linux extended partitions and do not change any logical

Freebsd slice after any linux extended partitions and

This preview shows page 6 - 9 out of 11 pages.

FreeBSD slice after any Linux extended partitions, and do not change any logical partitions in your Linux extended partitions after installing FreeBSD! The Linux+FreeBSD mini-HOWTO 2.1 FreeBSD ``slices'' and ``partitions'' 4
Image of page 6
3. Sharing swap space between Linux and FreeBSD This section describes how I got Linux and FreeBSD to share a swap partition. There may be other ways to get the same result. You can install FreeBSD before Linux if you want to, just pay attention to the order of the partitions in the FreeBSD slice. 3.1 Installing and preparing Linux The first step is to install Linux as normal. You have to leave space for the FreeBSD slice at your hard drive. You don't have to make a Linux swap partition, but if you want one, put it in the space you want to allocate for FreeBSD. That way you can delete the Linux swap partition later and use the space for FreeBSD. When you have installed Linux you have to build a new kernel. Read The Linux Kernel HOWTO if this is new to you. You have to include both UFS filesystem support (read only) and BSD disklabel (FreeBSD partition tables) support : UFS filesystem support (read only) (CONFIG_UFS_FS) [N/y/m/?] y BSD disklabel (FreeBSD partition tables) support (CONFIG_BSD_DISKLABEL) [N/y/?] (NEW) y Install the new kernel and reboot. Remove any line including the word swap from your /etc/fstab file if you have made a Linux swap partition. Make sure you have a working Linux boot floppy with the new kernel. Now you are ready to install FreeBSD. 3.2 Installing FreeBSD Install FreeBSD as described in the FreeBSD documentation. Remove the Linux swap partition if you have made one (you can use the FreeBSD fdisk program.) Pay attention to the order of the partitions in the FreeBSD slice. If you use the default labelling the second partition will be the swap partition. Complete the installation of FreeBSD and reboot into Linux using the new Linux boot floppy . 3.3 Setting up the FreeBSD swap partition in Linux Run dmesg when you have booted into Linux. In the output you should see something like this: Partition check: hda: hda1 hda2 hda3 hda4 < hda5 hda6 hda7 hda8 > This means that /dev/hda4 is your FreeBSD slice, while /dev/hda5 , /dev/hda6 , /dev/hda7 and /dev/hda8 are the FreeBSD partitions. If your swap partition is the second partition in the slice, it will be /dev/hda6 . The Linux+FreeBSD mini-HOWTO 3.Sharing swap space between Linux and FreeBSD 5
Image of page 7
You have to put the following line into your Linux /etc/fstab file to enable the swap partition: /dev/hda6 none swap sw 0 0 While FreeBSD can use any type of partition as swap space, Linux needs a special signature in the swap partition. This signature is made by mkswap . FreeBSD ruins this signature when it uses the shared swap partition, so you will have to run mkswap each time you boot into Linux. To do this automagically you have to find the script that runs swapon at boot time. In Red Hat Linux it is /etc/rc.d/rc.sysinit . Put the following line into that file just before swapon -a : awk -- '/swap/ && ($1 !~ /#/) { system("mkswap "$1"") }' /etc/fstab This will run mkswap on any swap partitions in
Image of page 8
Image of page 9

You've reached the end of your free preview.

Want to read all 11 pages?

  • Spring '12
  • JRUNG
  • ........., Disk partitioning, FreeBSD

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes