DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Installation and Upgrading

OpenBSD Installation and Upgrading Installing and upgrading OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 13th July 2014
cravuhaw2C cravuhaw2C is offline
Port Guard
 
Join Date: Jul 2014
Posts: 45
Default Create a partition for OpenBSD in a multi-boot OS environment

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#Multibooting

I 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:

Code:
Use (W)hole disk or (E)dit the MBR? [whole] e

You will now create a single MBR partition to contain your OpenBSD data. This partition must have an id of ‘A6’; must *NOT* overlap other partitions;  and must be marked as the only active partition. Inside the fdisk command, the ‘manual’ command describes all the fdisk commands in detail.

Disk: sd0    geometry: 29185/255/63 [468862128 sectors)
Offset: 0    Signature: 0xAA55

                  Starting                Ending        LBA Info:                
 #:    id       C    H    S  -         C     H    S    [start : size]    
 *0:   83       0    32   33 -         3647 67    4    [2048 : 58591232] Linux files*
  1:   83       3647 67   5  -         9118 40   10    [58593280 : 87889920] Linux files*
  2:   00       0    0    0  -          0    0    0    [0 : 0 ]    unused
  3:   00       0    0    0  -          0    0    0    [0 : 0 ]    unused

Enter ‘help’ for information
fdisk: 1>

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.

Last edited by cravuhaw2C; 13th July 2014 at 09:21 AM.
Reply With Quote
  #2   (View Single Post)  
Old 13th July 2014
blackhole's Avatar
blackhole blackhole is offline
Spam Deminer
 
Join Date: Mar 2014
Posts: 314
Default

Quote:
Originally Posted by cravuhaw2C View Post
(I don’t know what it will be named on OpenBSD).
http://www.openbsd.org/faq/faq14.html
Reply With Quote
  #3   (View Single Post)  
Old 13th July 2014
hitest's Avatar
hitest hitest is offline
Real Name: George Nielsen
VPN Cryptographer
 
Join Date: Sep 2008
Location: B.C., Canada
Posts: 373
Default

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.
__________________
hitest

Last edited by hitest; 13th July 2014 at 02:19 PM. Reason: typo
Reply With Quote
  #4   (View Single Post)  
Old 13th July 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

Quote:
Originally Posted by cravuhaw2C View Post
have Ubuntu OS installed on /dev/sda1 (I don’t know what it will be named on OpenBSD).
Most likely, sd0 (SCSI disk driver sd(4), device number 0.). The sd(4) driver is for SCSI and is also used for SATA drives, softraid(4) volumes, and USB mass storage device.

Let's look at sd0 a little more closely You will find 32 devices in /dev for sd0:
Code:
$ ls /dev/*sd0*
/dev/rsd0a /dev/rsd0f /dev/rsd0k /dev/rsd0p /dev/sd0e  /dev/sd0j  /dev/sd0o
/dev/rsd0b /dev/rsd0g /dev/rsd0l /dev/sd0a  /dev/sd0f  /dev/sd0k  /dev/sd0p
/dev/rsd0c /dev/rsd0h /dev/rsd0m /dev/sd0b  /dev/sd0g  /dev/sd0l
/dev/rsd0d /dev/rsd0i /dev/rsd0n /dev/sd0c  /dev/sd0h  /dev/sd0m
/dev/rsd0e /dev/rsd0j /dev/rsd0o /dev/sd0d  /dev/sd0i  /dev/sd0n
$
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.
Reply With Quote
  #5   (View Single Post)  
Old 13th July 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

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".
Reply With Quote
  #6   (View Single Post)  
Old 13th July 2014
cravuhaw2C cravuhaw2C is offline
Port Guard
 
Join Date: Jul 2014
Posts: 45
Default

Quote:
Originally Posted by jggimi View Post
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 View Post
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 View Post
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 View Post
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.
Reply With Quote
  #7   (View Single Post)  
Old 13th July 2014
cravuhaw2C cravuhaw2C is offline
Port Guard
 
Join Date: Jul 2014
Posts: 45
Default

Quote:
Originally Posted by jggimi View Post
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
Reply With Quote
  #8   (View Single Post)  
Old 13th July 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

Quote:
Originally Posted by cravuhaw2C View Post
Firstly, what is meant by "MBR" partition? Does it mean the same as MSDOS partition?
A Master Boot Record is a block containing a very small boot program, and contains a partition table that can define up to four primary partitions. See http://en.wikipedia.org/wiki/Master_boot_record for further information.
Quote:
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.
From the table you provided above, you have four primary partitions:
  1. Partition 0, type 83 (linux files), 58,591,232 512-byte sectors, or 28,609 Megabytes.
  2. Partition 1, type 83 (linux files), 87,889,920 512-byte sectors, or 42,915 Megabytes.
  3. Partition 2 - empty
  4. Partition 3 - empty
Quote:
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 View Post
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.
  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.
  2. 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.
  3. Run the installation script, from the prompt you receive at boot.
  4. When prompted, edit the MBR. This will put you into the fdisk(8) program.
  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.
  6. 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.
  7. 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.
  8. 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.
Reply With Quote
  #9   (View Single Post)  
Old 14th July 2014
cravuhaw2C cravuhaw2C is offline
Port Guard
 
Join Date: Jul 2014
Posts: 45
Default

Quote:
Originally Posted by jggimi View Post
From the table you provided above, you have four primary partitions:
Quote:
Originally Posted by jggimi View Post
  1. Partition 0, type 83 (linux files), 58,591,232 512-byte sectors, or 28,609 Megabytes.
  2. Partition 1, type 83 (linux files), 87,889,920 512-byte sectors, or 42,915 Megabytes.
  3. Partition 2 - empty
  4. Partition 3 - empty
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) ?


and partition 1 yields 41.91 GB (42,915 MB divided by 1024 MB = 41.91 MB) ?

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 View Post

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".
Reply With Quote
Old 14th July 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

Quote:
Originally Posted by cravuhaw2C View Post
...how did partition 0 end up with only 27.94 GB (28,609 MB divided by 1024 MB = 27.94 GB) ?
I only have the information you provided above, in your fdisk report.
Quote:
I don't understand how you arrived at 512-byte sectors.
  1. Mass storage (a.k.a. "hard drives") that use fixed block architectures use either 512-byte or 4096-byte sector sizes. The vast majority use 512-byte, as 4096 is actually very new.
  2. You told us your device was 240 GB.
  3. Your report above shows 468,862,128 sectors. Multiplied by 512, that's 240,057,409,536 bytes.
  4. Drive manufactures use "marketing" sizes, which is 1,000 for Kilo, 1,000,000 for Mega, 1,000,000,000 for Giga, etc. None have ever used 1,024 for their math.
Quote:
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?
Cylinder 9118 is in use by partition #1. It ends in the middle of Cylinder 9118, at Head 40 / Sector 10. Starting at the beginning of Cylinder 9118 would cause an overlay between your two partitions.

Quote:
Using C/H/S method, shouldn't the starting values be 9118 /40 /11?
I recommended starting at a cylinder boundary, as I explained above.
Quote:

If using LBA method, how did you arrive at sector
146496735?
Per your report, each cylinder is 16,605 sectors long. I'd recommended starting at the beginning (Head 0 / Sector 1) of the next available cylinder, 9119.


Quote:
Your job title at OpenBSD should be "official ambassador".
Thank you, but I'm not a member of the Project, I'm just a user. And this site is entirely unofficial.
Reply With Quote
Reply

Tags
create, fdisk, multiboot, partition

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
FreeBSD won't boot after mounting root partition on OpenBSD Jtf FreeBSD Installation and Upgrading 12 19th March 2014 04:43 AM
Altq on multi wan and multi zone environment apsaras OpenBSD Security 0 26th May 2012 11:19 PM
g4u -> create just one boot floppy ccc NetBSD General 4 19th June 2011 04:46 PM
create a FAT32 partition and format it. wesley OpenBSD General 2 6th November 2010 08:31 AM
Tried to create new partition using sysinstall but change is not permanent disappearedng FreeBSD General 7 6th July 2008 10:00 PM


All times are GMT. The time now is 10:26 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick