Ubuntu

ubuntu server guide LVM section rewrite

Reported by James Dupin on 2009-03-23
2
Affects Status Importance Assigned to Milestone
ubuntu-docs (Ubuntu)
Undecided
Adam Sommer

Bug Description

Binary package hint: ubuntu-docs

I propose the following rewrite for the LVM section of ubuntu server guide

that is to say from current 2592 to current 2617

<!-- beginning of rewrite -->

2592
Continuing with <emphasis>srv</emphasis> as an LVM volume example, this section covers adding a second hard disk, creating a Physical Volume (PV), adding it to the volume group (VG), extending the logical volume <filename role="directory">srv</filename> and finally extending the filesystem. This example assumes a second hard disk has been added to the system. This hard disk will be named /dev/sdb in our example. BEWARE: make sure you don't already have an existing /dev/sdb before issuing the commands below. You could lose some data if you issue those commands on a non-empty disk. In our example we will use the entire disk as a physical volume (you could choose to create partitions and use them as different physical volumes)

2593
First, create the physical volume, write:

2594
sudo pvcreate /dev/sdb

2595
Now extend the Volume Group (VG):

2596
sudo vgextend vg01 /dev/sdb

2597
Use <emphasis>vgdisplay</emphasis> to find out the free physical extents - Free PE / size (the size you can allocate). We will assume a free size of 511 PE (equivalent to 2GB with a PE size of 4MB) and we will use the whole free space available. Use your own PE and/or free space.

2598
The Logical Volume (LV) can now be extended by different methods, we will only see how to use the PE to extend the LV:

2599
sudo lvextend /dev/vg01/srv -l +511

2600
The <emphasis>-l</emphasis> option allows the LV to be extended using PE.
The <emphasis>-L</emphasis> option allows the LV to be extended using Meg, Gig, Tera, etc bytes.

2601
Even though you are supposed to be able to <emphasis>expand</emphasis> an ext3 or ext4 filesystem without unmounting it first, it may be a good pratice to unmount it anyway and check the filesystem, so that you don't mess up the day you want to reduce a logical volume (in that case unmounting first is compulsory).

2602
The following commands are for an <application>EXT3</application> or <application>EXT4</application> filesystem. If you are using another filesystem there may be other utilities available.

2603
sudo umount /srv

2604
sudo e2fsck -f /dev/vg01/srv

2605
The <emphasis>-f</emphasis> option of e2fsck force checking even if the system seems clean.

2606
Finally, resize the filesystem:

2607
sudo resize2fs /dev/vg01/srv

2608
mount the partition and check its size.

2609
mount /dev/vg01/srv /srv && df -h /srv

<!-- end of rewrite -->

Related branches

Adam Sommer (asommer) wrote :

Thanks James for the new content, it greatly simplifies the section. I've committed the changes to revision 238.

Thanks again.

Changed in ubuntu-docs:
assignee: nobody → asommer
status: New → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-docs - 9.04.5

---------------
ubuntu-docs (9.04.5) jaunty; urgency=low

  * String freeze release

  * [Matthew East]
    - Updating logout and shutdown instructions for Jaunty (User Switcher, not System menu)
    - musicvideophotos.xml - use consistent language for extracting audio cds (LP: #346245)
    - musicvideophotos.xml - use direct link to brasero manual
    - Make titles of documents in yelp indexes match the title of the documents themselves (LP: #345852)
    - Refresh pot templates

  * [Dougie Richardson]
    - basic-commands.xml - paste instructions correction (LP: #341534)
    - internet/troubleshooting.xml - changing bad wording
    - video.xml - dvd support requires gstreamer-ugly (LP: #338321)
    - connecting.xml - modem instructions (LP: #310331)

  * [Adam Sommer] - Server Guide
    - Updated OpenLDAP section for new /etc/default/slapd configuration.
    - Added instructions for setting correct ACL for the Kerberos keys.
    - virtualization.xml - new Eucalyptus and OpenNebula sections
    - installation.xml:
      * rewrite of Extending Volume Groups section (LP: #347201, LP: #346862, and LP: #346859)
      * Updates for Jaunty.
    - security.xml:
      * Updated Firewall section for Jaunty.
      * Corrected "sudo ufw app info Samba" command (LP: #346327).
    - dns.xml - fixing grammar and spelling mistakes (LP: #348032, LP: #348023, LP: #348094).
    - windows-networking - Updated Likewise Open section for Jaunty (feedback from Thierry Carrez).

  * [Phil Bull]
    - about-ubuntu.xml - minor edits and updates, simplify a few sentences
    - add-applications.xml:
      * Add new entity for Software Sources, with sensible name
      * Simplify structure
      * Reduce verbosity, concentrate on the instructions
      * Separate-out conceptual information into dedicated sections

  * [Nathan Handler]
    - virtualization.xml - typo (LP: #343633)

  * [Dean Sas]
    - music.xml - volume control preferences fix (LP: #346957)

  * [Tim Bosse]
    - connecting.xml - add basic VPN instructions

 -- Matthew East <email address hidden> Wed, 25 Mar 2009 22:03:21 +0000

Changed in ubuntu-docs:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers