Arm Ukraine, zap Putin

Stolen Votes logo logo

No Cookies

Flag UK DE





No Tracking




How To Install BSD On A PC With Another OS Already Present

by Julian H. Stacey

Other Pages:

This answers these questions:

1st Answer by mail list:

Crux is just another Linux. So type: man fdisk Then think how much disk you have, if you a spare, how your going to shrink partitions maybe, repartition, & cross mount. Which depends on your hardware & Unix skill level.

If you get really stuck, back up your CRUX to other media. Reinstall either CRUX or BSD, making sure neither OS takes all the disc, leaving room for the other OS later .. then restore CRUX data into CRUX partition.

2nd Answer: This Page

First The Good News

Yes, FreeBSD has run as a dual, triple, or quad booted OS since 1996 or maybe earlier, see Article: "Installing and Using FreeBSD With Other Operating Systems" by Jay Richmond 6 August 1996

If Fdisk shows you have enough unused space on your boot disk to install a BSD partition, do it, no need to read more of this page smiley face icon If you don't have enough space, read on.

Shrinking your old installed OS to make some room for another OS too, eg BSD (or whatever else), is outside BSD's remit really, best to discuss shrinking on a mail list appropriate to the existing pre-installed OS you want to shrink.

When you've made space, installing BSD is easy by comparison with shrinking (& keeping bootable) the other existing installed OS to get space. Plenty of standard FreeBSD docs will help you to install once you've made space

If you get stuck shrinking, you should equally be able to get help discussing concepts not just with BSD people, but also from Linux & other local Unix people such as Solaris, HP etc.

Focus first test statement to locals to see if they know enough to help, by saying eg:

"I need to shrink my Linux PC partitions, keeping them bootable, then edit my MBR using Fdisk to reallocate some disc to install a BSD Unix, so both are dual bootable"

Now The Bad News

  • For a person without so much skill it's probably a lot safer & easier to copy all data elsewhere, then re-divide the disk, reload 1st OS (eg Crux) from backup & reinstall smaller 1st OS, leaving space for 2nd OS (FreeBSD).
    I recommend you do minimal installs (doesn't mean minimal disk size allocation, I just mean don't load tons of things into the file systems) of each OS first, make sure they all install & boot OK, & don't damage each other, then go back, boot each in turn & add all the extras for full installs, then overlay any of your OS configs previously saved from OS#1 eg CRUX & restore user data, then reboot OS#2 eg FreeBSD & grow the BSD from minimal install to full install.
  • I've seen a calm skilled friend get angry & lose 2 days work on a similar MBR retrofit scenario to this, it didn't involve FreeBSD I think, not sure, did involve a SCO or Unix-ware, but irrelevant really whatever, the point is MBR is dangerous to play with. Be careful. Yes I've probably trashed myself too, can't remember, but it's dangerous.
  • Another highly skilled friend's for a decade or 2 has maintained: 1 OS per disk (he physically used to change the data cable to another drive, used to work fine on SCSI-1 & IDE, but maybe SATA might not take such regular wear?).
  • Retro-fits, squeezing in another bootable OS, are tricky, unless one is skilled, & careful.
  • Personally for some years I've installed all new machines with MBRs with the max 4 slices, carefully thought out in advance of 1st install, leaving some space free for other versions of same OS, (eg for rescue boot, or alternate boot for lost utilities that won't build on latest version of OS etc), Usually I go for maybe 3 slices of 10 to 20G for 3 OSs, + 4th slice for rest of disc as a common shared large UFS file system for generic sources etc.

So You Still Want To Be Brave & Shrink, Not Reinstall ?

  • Fdisk manipulates the MBR = Master Boot Record, Essentially a 256 byte block at edge of disc, with a table of sizes & offset for 4 OS partitions, & one can also mark one of the 4 as to be active, ie the one to boot next.
  • Some might tell you: Beware, Fdisk is a Crock!, well old Microsoft Fdisk was size limited & broke things, but a modern FreeBSD Fdisk is fine, Linux Fdisks probably OK too I guess.
  • Even with modern Fdisk, one mistake & you may discover yourself swearing that the F in Fdisk surely means f__k disk ;-) (rather than perhaps Fixed Disk ? Be cautious ! smiley face icon
    (Fdisk on FreeBSD in multi user mode won't allow you to resize, unless you run sysctl kern.geom.debugflags=16 (after booting in single user mode its probably OK without), so Linux might have a similar restriction, (to avoid accidental foot shooting).)
  • Be aware some Linux use a different boot method, thats not fully compliant with Fdisk, LiLo maybe ? See "2 Overview of Boot Managers" PCs installed using "Grub" might also complicate (see ref in Wikipedia MBR page.)
  • Beware modern Microsoft seems to behave abnormally, not conforming to Active in MBR; Maybe what its doing is each reset by default sets the name of the Microsoft partition as next bootable ? See man nextboot (8) for a clue of what PC loader offers.

What You'll Need To Do, Approx:

  • Draw on paper or another computer, so you can refer to it when this computer may perhaps fail to boot (very easy to get this wrong so it wont boot!)
  • A map of your disc(s):
    • The 4 MBR slices per disc, sizes & offset shown by fdisk
    • The partitions each OS uses within each MBR slice, size & offsets shown by disklabel or bsdlabel
    • be cautious not to confuse unit sizes of 512 & 1024 that can be reported by different tools
  • Remember the cartoon of a man sitting on the branch of a tree, sawing the branch off. Which side was he sitting ? What you'r about to do is analogous but much easier to get wrong :-)
  • Write some live file system rescue media (on cd, usb stick, whatever), in case you blow yourself away.
  • Copy your Linux user data somewhere safe eg another LAN computer, or external USB or internal 2nd disc (consider if you will be able to read that file system if you trash Linux by mistake on PC, & cannot again mount that disc)
  • Make a plan, how to shrink & move each partition, to release enough contiguous space for fdisk to create a slice for FreeBSD... While ensuring that at all stages you do not destroy anything in the boot chain.
  • How to shrink:

    • See also:
    • Easiest to copy data to a spare partition, then unmount, then run the Linux equivalent of FreeBSD disklabel / bsdlabel + newfs (/ mkfs on an ancient Unix) then mount & copy back.
    • Various Alternatives
      ( Some programs may be capable of running on several types of op systems, (eg gparted))
      Least preferred option listed first.)
      • To shrink an MS FS: Programs that run on Microsoft, Some are commercial, eg PartitionMagic
      • To shrink an MS FS: rograms that run on Microsoft, Some are free, Names ?
      • To shrink an MS FS or a Linux FS: Run a free live Linux CD such as knoppix & shrink from there.
      • To shrink a Linux FS: Ask in a Linux forum, re tools analogous to ntfsresize, (but not for NTFS but for eg Ext1/2/Reiser or whatever other Linux FS you use).
      • To shrink an MS FS: Boot an existing(*) FreeBSD & run ntfsresize
      • On Linux: gparted, (Note gparted is not on FreeBSD-current /usr/ports/ at 26 May 2011).

    Exact Details & Further Help

    Exact detail of what's appropriate will vary dependent on what configuration an individual machine has. If you need help, ask a local Unix systems administrator over a coffee; read pages linked to above; discuss on a mail list of the OS you already have installed, that needs shrinking (not the new OS you want to migrate to, as shrinking the old is the hard bit, installing the new is easy).
    If your employer needs the work done, you could also hire a local consultant from this BSD globally indexed list

    EasyBCD Extends and revamps the Windows Vista/Windows 7 BCD bootloader.


    This was hacked together fairly quickly. To send improvements, mail me them preferably in "diff -c" format please.

Stolen VotesBerklix.Net Computer AssociatesDomainsApache: Web ServerFreeBSD: Operating System