Search results for "manage mbr"

Rectangular, with rounded corners

“Rectangular, with rounded corners.”

Sorry, that’s not the geometry we mean. Disk geometry generally refers to the layout of the disks internally. If you open the case of a hard drive you’ll find a stack of round disks, commonly called platters. They’re covered with a layer of magnetic material that extends from the middle of the disk to the outer edge. When the disk drive is on, these disks spin at thousands of revolutions per minute (rpm). (This is the rpm count you’ll see on the box and in advertising, and has a great deal to do with the performance of an individual disk.)

You will also see a head on each side of each platter. The head moves between the center of the disk and the edge so it can read data from the hard drive beneath it. A fairly typical new hard drive has 16 heads. That’s enough for 8 platters, with a head on each side. So, we can read from 16 different locations on the platters simultaneously, so long as the data you want happens to be on different sides of different platters. Every head has a unique number, starting with 0.

Each platter has a number of circular tracks, or tracks, arranged much like the growth rings in a tree. These tracks hold data as a string of 0s and 1s. A head moves over a particular track at a certain distance from the center of the disk and reads this data as the platter spins by beneath it. When you request data from a different track, the head shifts its position and lets that track rotate past beneath it.

If you stack the particular tracks from all the platters on top of one another, you have a cylinder. For example, the innermost track of each platter forms one cylinder, numbered 0. The next-innermost forms cylinder 1. The 3,022nd track of each platter forms cylinder number 3021. Many operating systems expect to find that MBR partitions encompass complete cylinders and get quite upset if they don’t.

Each track is broken up into segments, called sectors, which can each hold 512 bytes of data. Each sector within a track has a unique number, starting with 1. What’s more, every sector on a hard drive has a unique number. If a particular hard drive has 39,179,952 sectors, you can expect to find each with a number 0 through 39,179,951. Many tools expect to address hard disks by sector numbers. When part of a disk goes bad, smart disks mark the affected sectors and don’t use them.

So, sectors combine into tracks, which are arranged in rings on each platter. Tracks can be stacked into cylinders, and they all combine to make up the hard drive. This all seems simple enough, and it would be, if you could reliably use this information.

Over the years, various limitations have been hit in both hard disk and operating system design. We touched upon the 504MB and 8GB limits. These limits could only be avoided by tricking the system BIOS and/or operating system. If the most popular operating system can only accept 63 sectors per track, but the hard drives your company manufactures have 126 sectors per track, you have a problem — unless, of course, you teach your hard drive to lie. If you claim you have half as many sectors per track, but you have twice as many platters, you can make the problem go away. Everything still adds up to the same number of sectors, after all, and all the tools can still find a unique sector-by-sector number. By the time hard drive information reaches the operating system, it has quite possibly been through one or more of these translations.

When you have only one operating system on a hard drive, this works fine. If your operating system receives or performs a slightly different translation on the disk, however, the translated geometry will not precisely match. The individual sector numbers will still match, but cylinder boundaries may not be the same within the translated geometry. Because many operating systems expect their MBR partitions to begin and end on a cylinder boundary, this is a problem. This is why we use only an operating system’s native tools to create MBR partitions for that OS.

Now that you understand the hardware and the translations it undergoes, let’s look at how to manage these partitions.

Incoming search terms:

  • rectangular cylinder rounded corners

Every operating system includes tools to manage MBR partitions

Every operating system includes tools to manage MBR partitions. Unfortunately, every operating system handles MBR partitions in a slightly different manner. More unfortunately, most of these tools are namedfdisk.” Each tool operates differently, and while some of them look similar or have a common heritage they are not guaranteed to be interoperable. The upshot of all this is that you should create the MBR partitions used by an operating system by the operating system’s native tools. When you’re installing a dual-boot OpenBSD/XP system, use OpenBSD’s fdisk(8) to create the MBR partitions only for OpenBSD and use the Windows XP installer to create the partition for Windows XP. Do not use the OpenBSD fdisk tool to create Windows XP partitions, and do not try to create OpenBSD partitions with XP! This might look workable, but minor differences between fdisk implementations might make the partition unusable.

Because this is an OpenBSD book, we’ll focus on OpenBSD’s fdisk. Check the documentation for the other operating systems you’re using for details on their fdisk implementations. The concepts are the same, but many of the details differ.

Incoming search terms:

  • manage mbr

Careful planning is essential

Careful planning is essential when installing two operating systems on a single hard drive. Each operating system has restrictions on where it may lie on the disk, and you must satisfy those restrictions for every OS you install. For example, Windows 98 expects to be the first operating system on the disk, but OpenBSD’s root partition expects to be within the first 8GB. This can make life difficult. Consider the restrictions on each operating system, and figure out a method you can meet them while still getting both operating systems on one drive. Write down your partitioning needs before starting an install.

You then need to create MBR partitions for each operating system, using the appropriate tool for that OS. Once you know where these MBR partitions belong, you can start to install your operating systems. Operating systems should be installed in the order that they go on disk — if Windows XP is the first operating system on your disk, install that first. This allows you to use each operating system’s native tools to create the MBR partition for that operating system. Not all operating systems work well within MBR partitions created by another operating system: For example, the Windows XP installer will see partitions created by OpenBSD, but may choke when attempting to put a file system on them.

Once you have all of your operating systems on the disk, install a boot manager to control the OS you want to start at boot time.

Note Each additional operating system adds complexity to the installation and disk partitioning process. Be prepared to reinstall the various operating systems a few times until you have everything set up as you like. Do not load any data on your computer until you have every operating system installed and every partition formatted the way you want!

 

Easiest way – Install hard drive in your computer

Many people need to run multiple operating systems on one computer, and OpenBSD allows you to do that. By far, the easiest way to do this is to install a hard drive in your computer for each operating system. This allows you to use each OS’s native disk tools without risking tramping on your other operating system. In this day of dirt-cheap hundred-gig hard drives, however, this is an added complication for many people who simply want to divide up their hard disk appropriately.

When you divide up a single hard disk between multiple operating systems, you fall into another level of partitioning, known as MBR (Master Boot Record) partitions. The boundaries of these partitions are stored in the Master Boot Record on a disk, and are managed by tools such as UNIX fdisk(8), DOS fdisk, or Microsoft’s Disk Administrator. Any operating system can see MBR partitions; they may not recognize that one of these partitions is designated for OpenBSD, but they realize that this is a discrete section of disk. Within these large partitions, you create smaller OpenBSD-specific partitions for /home, /usr, and so on.

The fdisk tools allow you to, say, take your 80GB disk and designate the first 20GB for OpenBSD, the second 20GB for Microsoft Windows XP, the third 20GB for FreeBSD, and the last chunk for Linux, should you wish. You then use each OS’s native tools to manage those chunks of disk space. You would then use a separate “boot manager” to choose between operating systems at boot time.

When you decide where to put disk space for any one OS, you need to allow for OpenBSD’s boot limitations. Just because you have multiple operating systems on a hard drive doesn’t mean that you can ignore the 504MB limit or the 8GB limit. If you have enough disk space to install more than one operating system, chances are your system does not suffer from the 504MB limit. Still, the OpenBSD root partition must be contained entirely within the first 8GB of disk, not the first 8GB of disk space assigned to OpenBSD. In most cases, this means that OpenBSD must be the first operating system on your disk. Also, OpenBSD on a hard disk must be a single contiguous section; you cannot dedicate the first 20GB of your hard drive to OpenBSD, have a 20GB Microsoft partition, and have a 40GB OpenBSD partition to round out your disk.

Put your OpenBSD partition first on the disk, and you won’t have any problems.