Intro: Disk and partition management with NetBSD The NetBSD Project
Status: Closed Time to complete: 192 hrs Mentors: Martin Husemann, Julian Coleman, Julian Fagir Tags: howto, system

Additionally to the gpt and mbr confusion, NetBSD has two other systems that add complexity to disk management: Disk wedges (dk(4)) and Unix disklabels (disklabel(5)).


 You should write an article that introduces the reader to these systems, how they interact, and what their use cases are. You should also mention how they interact with additional disk subsystems like cgd(4) and ccd(4).

Uploaded Work
File name/URL File size Date submitted
Introduction to disk and partition management with NetBSD.txt 4.2 KB December 29 2012 00:34 UTC
Introduction to disk and partition management with NetBSD (1).txt 5.6 KB January 02 2013 08:58 UTC
Comments
Husnain Javed on November 26 2012 17:27 UTC Task Claimed

I would like to work on this task.

Husnain Javed on November 26 2012 17:39 UTC Claim Removed

The claim on this task has been removed, someone else can claim it now.

Edward Kalfov on November 26 2012 18:31 UTC Task Claimed

I would like to work on this task.

Edward Kalfov on November 26 2012 18:56 UTC Claim Removed

The claim on this task has been removed, someone else can claim it now.

Edward Kalfov on November 26 2012 18:56 UTC Task Claimed

I would like to work on this task.

Edward Kalfov on November 26 2012 18:59 UTC Claim Removed

The claim on this task has been removed, someone else can claim it now.

Jacob Grover on November 26 2012 22:52 UTC Task Claimed

I would like to work on this task.

Jacob Grover on November 26 2012 22:53 UTC Claim Removed

The claim on this task has been removed, someone else can claim it now.

Alvin Tan on November 26 2012 23:16 UTC Task Claimed

I would like to work on this task.

Alvin Tan on November 27 2012 04:17 UTC Claim Removed

The claim on this task has been removed, someone else can claim it now.

Ashish on November 27 2012 07:45 UTC Task Claimed

I would like to work on this task.

Aleksej Saushev on November 27 2012 08:20 UTC Task Assigned

This task has been assigned to Ashish. You have 192 hours to complete this task, good luck!

Ashish on November 27 2012 12:48 UTC Help please

I understood the second part of the question but the part which is "Additionally to the gpt and mbr confusion, NetBSD has two other systems that add complexity to disk management: Disk wedges (dk(4)) and Unix disklabels (disklabel(5))." i dont get it Please help me get a grasp at it !! 

Martin Husemann on November 27 2012 13:07 UTC Re: Help please

This is a bit tricky.


Conceptually you can divide "slicing" of a disk into two parts:



  1. a list of "parts" of the disk and how you use that while the system is running (sometimes you can add/remove this parts at runtime)

  2. a storage format use to make an initial list of those "parts" persistent on-disk


Historically these have been a bit mangled and both called "disklabel" - but actually there is a (sometimes slightly variying from arch to arch) on-disk "disklabel" structure, and a disklabel structure used inside the kernel.


Nowadays you can separate those two parts - in which case the second item is called a "wedge" and you have multiple choises for the first one. A typicall example is the GUID Partition Table, gpt, which is manipulated from userland with the http://netbsd.gw.com/cgi-bin/man-cgi?gpt++NetBSD-current tool.


The runtime device for a "part" of the disk is http://netbsd.gw.com/cgi-bin/man-cgi?dk+4+NetBSD-current and you can add or remove them with http://netbsd.gw.com/cgi-bin/man-cgi?dkctl++NetBSD-current.


The interaction (and additional tools available) is what you should describe in your article.


 


 

Ashish on November 27 2012 16:52 UTC Claim Removed

The claim on this task has been removed, someone else can claim it now.

JuanJe on November 28 2012 22:41 UTC Task Claimed

I would like to work on this task.

Julian Fagir on November 28 2012 22:53 UTC Task Assigned

This task has been assigned to JuanJe. You have 192 hours to complete this task, good luck!

JuanJe on November 29 2012 19:10 UTC Claim Removed

The claim on this task has been removed, someone else can claim it now.

hackpert on November 30 2012 14:01 UTC Task Claimed

I would like to work on this task.

Julian Fagir on November 30 2012 14:06 UTC Task Assigned

This task has been assigned to hackpert. You have 192 hours to complete this task, good luck!

hackpert on November 30 2012 14:16 UTC Claim Removed

The claim on this task has been removed, someone else can claim it now.

Kliment on November 30 2012 20:59 UTC Task Claimed

I would like to work on this task.

Julian Fagir on November 30 2012 23:56 UTC Task Assigned

This task has been assigned to Kliment. You have 192 hours to complete this task, good luck!

Kliment on December 1 2012 07:46 UTC Claim Removed

The claim on this task has been removed, someone else can claim it now.

Mukund Krishna Kothari on December 3 2012 09:55 UTC Task Claimed

I would like to work on this task.

Mukund Krishna Kothari on December 3 2012 09:56 UTC Claim Removed

The claim on this task has been removed, someone else can claim it now.

James on December 12 2012 17:05 UTC Task Claimed

I would like to work on this task.

James on December 12 2012 17:07 UTC Claim Removed

The claim on this task has been removed, someone else can claim it now.

Hobn on December 28 2012 05:48 UTC Task Claimed

I would like to work on this task.

Julian Fagir on December 28 2012 14:23 UTC Task Assigned

This task has been assigned to Hobn. You have 192 hours to complete this task, good luck!

Hobn on December 29 2012 00:34 UTC Wedges?

I've uploaded what I have so far but I'm still confused over wedges. Are they "secret" partitions not listed on the main partition table but somewhere else, thus following its own format? Wouldn't something following the main partition table unintentionally write over the wedge, in that case? That's sort of the idea I get from these old mails (here and here), but Martin Husemann's comment makes me think it's something of a partition table. Do wedges contain actual data or is it just a table of where things are?

Julian Fagir on December 29 2012 12:49 UTC Wedges

A wedge is just a "kernel-internal" partition. You create a wedge which then points to certain blocks on the disk.


Wedges in NetBSD are used in conjunction with the GPT. Think of something like this: The GPT defines partitions, but they have no representation to the kernel. Instead, wedges are assigned for each of the GPT partitions. You would end up with having e.g. dk1 for the first partition, dk2 for the second, etc.


But you could also use wedges for anything else where you want to partition disks without actually writing a partition table to the disk. It gives you the opportunity to use a count of blocks on the hard disk of your choice as a separate block device.

Hobn on December 31 2012 02:23 UTC Wedge usage

Are disk wedges limited to use with GPT? Can they be used with MBR or disklabel or maybe even an empty disk with no partition table?

Julian Fagir on December 31 2012 14:08 UTC Not limited

They are not limited to GPT, but they are used for them. For MBRs and disklabels, the kernel has a representation (which is the disk numbering scheme sd0a, sd0b, ... and sd0e, ... for MBR partitions). You could of course assign wedges to partitions as well, but you could also assign wedges to empty disks, right.


 


If you look at the dkctl(8) manpage, then the command `addwedge` allows you to specify a start block and the block count. This is exactly what it does. A disk wedge refers to a sequential count of blocks.


GPT just assigns the disk wedges automatically.


 


 

Hobn on January 2 2013 08:59 UTC Ready for review

The work on this task is ready to be reviewed.

Julian Fagir on January 2 2013 12:14 UTC Very well

Thank you! The article is fine so far, there's just one major caveat:


A ccd is just a concatenation of disks as compared to a raid0 which "churns" two disks together. You won't get extra data security or performance except for special use cases, but just a larger block device, and it has the chance to save some data even when one disk failed.


Anyway, you did well. If you liked the disk representation things, you could also have a look at these tasks. They are more practical, but you will also gain knowledge about how a computer boots:



  • http://www.google-melange.com/gci/task/view/google/gci2012/7977208



  • http://www.google-melange.com/gci/task/view/google/gci2012/7992203



  • http://www.google-melange.com/gci/task/view/google/gci2012/7992204


 


 

Julian Fagir on January 2 2013 12:14 UTC Task Closed

Congratulations, this task has been completed successfully.