Guys,Before you’re going to advise me against doing it, I did read the advisory in 4.9 of “Multibooting OpenBSD (amd64, i386)” of http://www.openbsd.org/faq/faq4.html#MultibootingI just want to learn and I hope you will indulge me First, I have only one SSD of about 240 GB.Second, I have Ubuntu OS installed on /dev/sda1 (I don’t know what it will be named on OpenBSD). sda1 contains all the /root, /home, /var/, /temp, /usr that Ubuntu will use. I didn’t create a swap partition as I’m using an SSD. Grub2 has been installed on the MBR.Third, I wish to install OpenBSD (amd64, US keyboard) on /dev/sda2. Again sda2 will contain all the /root, /home, /var, /temp, /usr that OpenBSD needs. I don’t want to create a swap partition for OpenBSD OS. The reason is I’m using an SSD.I met an obstacle during installation and I hope that you will help me out:

I did consult the FAQs, ‘man’ pages and even typed in ‘help’ at the fdisk: 1> prompt before I posted this request for help. I couldn’t make sense of all the parameters and options available with fdisk.All I wish to do is create a 45 GB partition on /dev/sda2 of my SSD for OpenBSD (all the system files, /home, /temp, /user).Thanks in advance for your help in this.

I cannot speak about Ubuntu, but, I currently dual boot Slackware64-current with OpenBSD 5.5 amd64. I used the Slackware install DVD to format my OpenBSD partition as type A6. Lilo plays very nice with OpenBSD. On my dual boot set-up these are my partitions using linux labels.

sda1 SWAP
sda2 /
sda3 /home
sda4 OpenBSD

Here is the little snippet that is added to the end of my /etc/lilo.conf

other = /dev/sda4
label = OpenBSD
table = /dev/sda

If you're using GRUB I suspect your labelling system, set-up will be slightly different.

The /dev/rsd0* device nodes are "raw" or "character" mode devices, and are used for pretty much everything except mount commands. The /dev/sd0* devices are "cooked" or "block" mode devices, used primarily with mounts. The 16 partitions, a-p, are the partitions that are used by OpenBSD inside of a single MBR partition of type A6 -- on those five architectures that use MBRs.

The "c" partition is special, and reserved. It is always "the entire physical disk" and used with commands where you want to address the entire drive, such as fdisk(8). Those commands will take the short form of the device and convert it to the proper device node, internally. So you can type #fdisk -e sd0 to edit an MBR partition table and the fdisk(8) program will use the /dev/rsd0c device node for you, as if you had typed #fdisk -e /dev/rsd0c. Some commands that address individual OpenBSD partitions, such as newfs(8), will allow similar short forms: #newfs sd3f will be interpreted as if #newfs /dev/rsd3f was used.

The internal partitions, a-p, are often called disklabel partitions, as their configuration is stored in an area of the drive used by OpenBSD called a disklabel, and managed by the disklabel(8) program.

Quote:

All I wish to do is create a 45 GB partition on /dev/sda2 of my SSD for OpenBSD (all the system files, /home, /temp, /user).

Your current MBR partition table has two entries, both type 83, and two empty slots. The addresses are shown in two forms: Cylinder / Head / Sector numbers, and Logical Block Address numbers. C/H/S is an ancient geometric format that has been used for decades, and is still used by some BIOSes.

When using fdisk(8), you can address by C/H/S or by LBA, but not both at the same time. With C/H/S, you see starting and ending numbers, based on the geography reported above the table. With LBA, you see starting sector number and size in sectors.

To add the OpenBSD MBR partition, you can edit (e) either partition 2 or 3, and assign either by CHS starting and ending or by LHS and size. Then, you must flag (f) the partition as active, so that the partition will be booted by your BIOS, and then you can either write (w) the MBR or quit (q) and be prompted whether to write your changes or not.

Back up your system, first. But you knew that, right?

Last edited by jggimi; 13th July 2014 at 04:43 PM.
Reason: typo, of course. always.

I should add that, when using LBA mode, for size you can add "g" for gigabytes or "m" for megabytes. You don't need to hand calculate 512-byte sector counts. You can also use "*" instead of a number to mean "to the end of the drive".

The 16 partitions, a-p, are the partitions that are used by OpenBSD inside of a single MBR partition of type A6 -- on those five architectures that use MBRs.

Firstly, what is meant by "MBR" partition? Does it mean the same as MSDOS partition?

MBR = master boot record

There can be only one unique MBR on a single HDD or SSD with single or multiple installed OSes.

Secondly, what are those 5 architectures that use MBRs? I know Microsoft Windows, Linux and BSD. What are the remaining 2 architectures?

Quote:

Originally Posted by jggimi

To add the OpenBSD MBR partition, you can edit (e) either partition 2 or 3,

Sorry but I thought partition 2 was used by Ubuntu while partition 1 was used to store Grub2.

Quote:

Originally Posted by jggimi

and assign either by CHS starting and ending or by LHS and size. Then, you must flag (f) the partition as active, so that the partition will be booted by your BIOS, and then you can either write (w) the MBR or quit (q) and be prompted whether to write your changes or not.

Would you like to write a short wiki on how to prepare partition 3 with 45 GB for OpenBSD that includes system files, /root, /home, /temp, /var, /usr?

I would appreciate your help in this very much and you can even make it into an FAQ on the official OpenBSD website.

Quote:

Originally Posted by jggimi

Back up your system, first. But you knew that, right?

Thanks for your advice. The SSD I'm using is a spare one, used primarily for testing out Linux distros. I'm using it to learn about OpenBSD for now.

I should add that, when using LBA mode, for size you can add "g" for gigabytes or "m" for megabytes. You don't need to hand calculate 512-byte sector counts. You can also use "*" instead of a number to mean "to the end of the drive".

Thank you for your help and patience all this while but I'm technically challenged.

It would be good if you could write a short wiki on how to install OpenBSD in a multi-boot environment with the following parameters:

the first partition is already taken up by a Linux distro

the partition for OpenBSD installation will contain all the system files, /root, /temp, /home/, /usr/, /var

There can be only one unique MBR on a single HDD or SSD with single or multiple installed OSes.

Correct. There is only a single MBR. However, the standard was later enhanced to support extended partitions. This was accomplished by chaining additional boot records to describe them. See http://en.wikipedia.org/wiki/Extended_partition for further information.

Quote:

Secondly, what are those 5 architectures that use MBRs? I know Microsoft Windows, Linux and BSD. What are the remaining 2 architectures?

I'm referring to hardware architectures, not software. And the count is currently 6, having just checked the source code: amd64, i386, landisk, loongson, macppc, and socppc. (The cats architecure used it too, but that is no longer supported.)

Quote:

Sorry but I thought partition 2 was used by Ubuntu while partition 1 was used to store Grub2.

Would you like to write a short wiki on how to prepare partition 3 with 45 GB for OpenBSD that includes system files, /root, /home, /temp, /var, /usr?

I would appreciate your help in this very much and you can even make it into an FAQ on the official OpenBSD website.

Quote:

Thanks for your advice. The SSD I'm using is a spare one, used primarily for testing out Linux distros. I'm using it to learn about OpenBSD for now.

My recommendation is not to multiboot. You need to learn to crawl before you walk, and walk before you run. You're asking for flying lessons.

Quote:

Originally Posted by cravuhaw2C

Thank you for your help and patience all this while but I'm technically challenged.

It would be good if you could write a short wiki on how to install OpenBSD in a multi-boot environment with the following parameters:

the first partition is already taken up by a Linux distro

the partition for OpenBSD installation will contain all the system files, /root, /temp, /home/, /usr/, /var

No texts I have written has ended up in the FAQ, nor do I expect them to. (I have submitted patches to correct FAQ errors, but that is different.)

Herewith, your flying lesson. It starts with a preflight check at step 1.

Back up your Ubuntu system. You are likely to lose it, or overwrite a critical component rendering it unusable without deep technical skills at best.

Boot the OpenBSD installation media. This is the RAMDISK kernel, which has a very limited set of tools for installation or rescue built-in, and requires no external drives to function.

Run the installation script, from the prompt you receive at boot.

When prompted, edit the MBR. This will put you into the fdisk(8) program.

Having previously done some calculations, begin your OpenBSD MBR partition at sector 146496735, which happens to be the first sector (if I've done the math right, and I may not have) of Cylinder 9119: the address Cylinder 9119 / Head 0 / Sector 1 for the "geometry" indicated by your MBR. These geometries have been virtual, and meaningless for everything except BIOS programs, for decades. But generally, MBR partitions should begin on Cylinder boundaries to prevent BIOS boot issues.

Edit partition 2 or 3. Set it to type A6. Set the size of the MBR partition however you like. Flag the partition active. Then, exit the fdisk program and return to the script, either by w/q or q and answering the prompt to write positively.

You can use the automatic sizing of individual disklabel partitions as offered by the disklabel program, called next by the script. Or, you can configure the OpenBSD disklabel partitions however you wish.

Note: Depending on the BIOS of your hardware, you may not be able to boot OpenBSD at all. See FAQ 14.8 regarding BIOS boot limitations.

Assuming you are successful, you can then set up a multiboot bootloader, either from within Ubuntu, or within OpenBSD. I used to use GAG, but that has not been supported in years, so now I use grub, which I install as an OpenBSD package.

Last edited by jggimi; 13th July 2014 at 07:23 PM.
Reason: typo. again. this time just a misplaced comma and a misspelling of ubuntu.

My SSD was first partitioned when I was installing Ubuntu. I partitioned /dev/sda1 with 30 GB, /dev/sda2 with 45 GB and remaining was unpartitioned, that is free space.

Using OpenBSD's terminology, partition 0 would correspond to /dev/sda1 and partition 1 to /dev/sda2. Based on this assumption, how did partition 0 end up with only 27.94 GB (28,609 MB divided by 1024 MB = 27.94 GB) ?

Why is there such a great difference in calculating partition sizes using Ubuntu and OpenBSD? Either the calculation method used by Ubuntu or OpenBSD is correct, but not both.

I don't understand how you arrived at 512-byte sectors. You see: 58,591,232 divided by 28,609 gives 2048-byte sectors, no?

Quote:

Originally Posted by jggimi

5. Having previously done some calculations, begin your OpenBSD MBR partition at sector 146496735, which happens to be the first sector (if I've done the math right, and I may not have) of Cylinder 9119: the address Cylinder 9119 / Head 0 / Sector 1 for the "geometry" indicated by your MBR. These geometries have been virtual, and meaningless for everything except BIOS programs, for decades. But generally, MBR partitions should begin on Cylinder boundaries to prevent BIOS boot issues.

Am I right to assume you were referring to partition 2 that corresponds to id #2? If yes, shouldn't I start on Cylinder 9118 and not 9119?

Using C/H/S method, shouldn't the starting values be 9118 /40 /11?

If using LBA method, how did you arrive at sector 146496735?

Special note: I appreciate all that you have done for me thus far and also for writing lengthy explanations for the questions that I asked. If anyone is to be the face of OpenBSD, I would nominate you for you have shown that you are able to interface with the public and help guide novice users. Your job title at OpenBSD should be "official ambassador".