Howto: Using LVM to manage your disks The NetBSD Project
Status: Closed Time to complete: 120 hrs Mentors: Radoslaw Kujawa, Julian Coleman, Julian Fagir Tags: howto, system

There is already a chapter about the logical volume manager in NetBSD: http://netbsd.org/docs/guide/en/chap-lvm.html
This task is about not having a whole chapter about it, but rather a small and comprehensive howto how you would manage logical volumes with NetBSD instead of reading through the whole chapter.

Uploaded Work
File name/URL File size Date submitted
howto_lvm 2.5 KB November 28 2012 01:53 UTC
howto_lvm 5.2 KB November 29 2012 01:09 UTC
howto_lvm 6.3 KB November 29 2012 02:30 UTC
Comments
Eric Newberry on November 27 2012 04:21 UTC Task Claimed

I would like to work on this task.

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

This task has been assigned to Eric Newberry. You have 120 hours to complete this task, good luck!

Eric Newberry on November 27 2012 17:00 UTC Format?

What format would I write this document in?

Radoslaw Kujawa on November 27 2012 18:39 UTC Format

Markdown, HTML or plain text

Radoslaw Kujawa on November 27 2012 18:43 UTC Format

Actually, plain text is the preferred choice. Markdown and HTML are acceptable.

Eric Newberry on November 27 2012 23:22 UTC Re: Format

Ok. Also, where can I obtain lvm2tools and libdevmapper? I can't find them with pkgsrc.

Radoslaw Kujawa on November 28 2012 00:29 UTC Re: Format

They are a part of base system since NetBSD 6.0, you don't need to install them from pkgsrc. See "man lvm".

Eric Newberry on November 28 2012 01:54 UTC Ready for review

The work on this task is ready to be reviewed.

Eric Newberry on November 28 2012 01:54 UTC Re: Format

Ok, thanks.


I've finished the HOWTO and have submited it.

Radoslaw Kujawa on November 28 2012 10:44 UTC Re: Format

I've read what you wrote and I think it's quite good. However, I have some suggestions:


- Add information on how to find the appropriarte device name to use as physical volume (how do I know that I should use wd1d or wd2d...?).


- Add an example of creating a file system on logical volume (it might not be obvious for a person reading how-to, after all, these kind of documents are for newbies moslty).


- Add info on how to mount this new filesystem automatically during system startup.


- What should the user do if he'll run out of filesystem space? Is it possible to resize the filesystem? How to do it?


 

Radoslaw Kujawa on November 28 2012 10:44 UTC Task Needs More Work

One of the mentors has sent this task back for more work. Talk to the mentor(s) assigned to this task to satisfy the requirements needed to complete this task, submit your work again and mark the task as complete once you re-submit your work.

Eric Newberry on November 28 2012 23:42 UTC Discovering Device Names

How would I explain finding the device names? I'm not that familiar with the naming scheme on BSD.


 

Radoslaw Kujawa on November 28 2012 23:56 UTC Re: Discovering Device Names

You still have 3 days and 8 hours to become familiar ;-). Just explain what would you do to obtain the device name after fresh installation, or receiving preconfigured NetBSD box, or after connecting a new drive to the system. Think of typical use cases.


You can always get information about devices from kernel message buffer - see dmesg(8) command. If you don't have NetBSD installed, then try it in a virtual machine. Try to connect various types of drivers, see how they appear in the system.


The nice thing about NetBSD dmesg is that almost every device driver has a man page. So for example if you see "sd0" in dmesg, then just look up "man sd". 

Eric Newberry on November 29 2012 01:10 UTC Ready for review

The work on this task is ready to be reviewed.

Eric Newberry on November 29 2012 01:12 UTC Improvements Completed

I believe I've completed the improvements listed.


However, as I said before, I'm not exactly that familiar with BSD, so it might still need some work. ;)

Radoslaw Kujawa on November 29 2012 01:51 UTC Re: Improvements Completed

Looks even better than before, but still a few minor corrections are needed:


- Saying that device name is based on port number is not entirely true. I'd rather say that device names are assigned in order of detection. So it's possible to have sd0 on controller X, sd1 on controller Y, sd2 on controller X, etc. What you wrote about devices is generally okay, but I'm under impression that you think controller port numbers have some meaning here (they don't). In most cases if you have a single controller then indeed drives will be numbered sequentially, just because there will be single driver detecting disks and it will claim first free device name. To avoid confusion I'd just call wd0 "first SATA/IDE hard disk", wd1 "second SATA/IDE hard disk", and so on (not "hard disk on second port" - that might not be true).


- Also you didn't mention how did you learn which device names are used by which disks. Provide and example of dmesg command usage and what to look for in its output.


- Are you sure that last column in /etc/fstab should be "1" in this example? I assume that this logical volume is not your / filesystem.


- What command could you use to resize FFS file system after resizing logical volume?


 

Radoslaw Kujawa on November 29 2012 01:52 UTC Task Needs More Work

One of the mentors has sent this task back for more work. Talk to the mentor(s) assigned to this task to satisfy the requirements needed to complete this task, submit your work again and mark the task as complete once you re-submit your work.

Eric Newberry on November 29 2012 02:30 UTC Ready for review

The work on this task is ready to be reviewed.

Radoslaw Kujawa on November 29 2012 10:20 UTC Good job!

Thanks, I'm closing this task.

Radoslaw Kujawa on November 29 2012 10:21 UTC Task Closed

Congratulations, this task has been completed successfully.