View Single Post
  #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: 5,934
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