Total Pageviews

Google Ads

Saturday, September 6, 2014

50 Must-have plugins for extending Twitter Bootstrap

50 Must-have plugins for extending Twitter Bootstrap

You most certainly know about Twitter Bootstrap - the popular front end framework for building websites and apps. It favors simple, responsive design, and comes bundled with a sensible default stylesheet, a number of usefuljQuery plugins and an icon set. Although it doesn’t come with much else, Bootstrap is very extensible. In this article, you will find a collection of 50 must-have plugins you should know about for effective development with the framework. Let’s begin!

Collections of Bootstrap Enhancements

We will start off with two collections of Bootstrap plugins that are the perfect companions to the framework.

Fuel UX

Fuel UX is an incredible collection of enhancements to Twitter Bootstrap. All the controls are clean and lightweight, and they fit naturally into the bootstrap look and feel. The collection includes controls like datagrids, custom select boxes, spinners, trees, multi-step form wizards and more.
Fuel UX
Fuel UX

Jasny

Jasny is another collection of useful interface components for bootstrap. It features controls like input masks, file upload buttons, icons, additional form styles and more. You can either get a version of bootstrap with all the changes integrated, or you can download them separately as plugins.
Jasny Bootstrap
Jasny Bootstrap

Galleries

It is worth noting that you can use any regular jQuery plugin with your bootstrap-powered website. This means that any of the galleries from our jQuery plugin collection will work perfectly fine. What these plugins won’t have though, is bootstrap’s design language and way of doing things. For this reason, check out these three plugins specifically created with bootstrap in mind:

Bootstrap Lightbox

Bootstrap does include a carousel, but it falls short when you need to show a photo in a lightbox. This is where the simple Bootstrap Lightbox plugin comes into play. All you need to do is add the required HTML to the page, and you get a pretty and responsive lightbox with an optional caption.
Bootstrap Lightbox
Bootstrap Lightbox

Simple Lightbox

Simple Lightbox is another lightbox plugin that is simpler that the one above. It requires only that you add a data attribute to the image and to initialize the plugin.
Simple Lightbox
Simple Lightbox

Bootstrap Image Gallery

Bootstrap Image Gallery is a complete gallery solution for bootstrap. After you include the needed files in your page, you get a grid of images which open in modal windows. The gallery can also optionally go into fullscreen mode. Note that there is now an improved version of this plugin which drops the Bootstrap requirement, so you can use it in any project.
Bootstrap Image Gallery
Bootstrap Image Gallery

Dialogs and Notifications

Bootstrap comes with a good modal window implementation out of the box. These plugins make it even better.

Bootbox.js

Bootbox.js is a small JavaScript library that automates the process of creating bootstrap dialogs. It creates the needed markup for you, so all you have to do to trigger a bootstrap dialog is to call a function. It mimics the built-in browser dialogs like alert, confirm and prompt.
Bootbox.js
Bootbox.js

Bootstrap Modal

Bootstrap Modal extends the default bootstrap modal class. It makes the default dialogs responsive and adds the ability to load their content via AJAX automatically for you.
Bootstrap Modal
Bootstrap Modal

Bootstrap Growl

Bootstrap Growl is a jQuery plugin which turns Bootstrap’s notifications into pretty Growl-like alerts. Notifications can be heavily customized; you can choose the position on the screen, dimensions offsets and time to fade out.
Bootstrap Growl
Bootstrap Growl

Bootstrap Notify

Bootstrap Notify is a user-friendly extension to bootstrap notifications. Like the growl plugin above, here you can also heavily customize every aspect of the notifications and where they are shown.
Bootstrap Notify
Bootstrap Notify

Forms

Forms are the necessary evil of web development. They may be tedious and boring to create and to fill in, but they occupy a very important place in our online interactions. Bootstrap brings a long list of enhancements to forms in terms of usability and presentation. It may not offer much else, but the plugins in this section do a great job at changing that.

Bootstrap Form Helpers

Bootstrap Form Helpers is an indispensable collection for enhancing web forms. It comes with 12 custom jQuery plugins that give you everything from date and time pickers, font lists, timezone, language and country fields and more.
Bootstrap Form Helpers
Bootstrap Form Helpers

Bootstrap Tags

Bootstrap Tags is a plugin which can enhance your search boxes by presenting the search terms as tags. The plugin also supports filters, placeholders, popovers and autosuggest as well as a full set of callback functions so you can hook it up with your code. Similar plugins are Tags Manager and Bootstrap Tag.
Bootstrap Tags
Bootstrap Tags

Bootstrap Switch

No mobile interface is complete without a iOS-like switch control, and Bootstrap Switch gives you a perfect implementation that fits nicely into the Bootstrap design language. You can customize the size of the control and the colors by assigning class names to the element. The plugin is really simple to set up, as it wraps around an existing checkbox.
Bootstrap Switch
Bootstrap Switch

Bootstrap Markdown

I’ve mentioned markdown on Tutorialzine before (we even made a lightweight blog system with it ). Bootstrap markdown makes it possible to add markdown editing functionality seamlessly to your projects.
Bootstrap Markdown
Bootstrap Markdown

Bootstrap Maxlength

Bootstrap Maxlength is a neat little plugin which detects the HTML maxlength property of a textfield, and displays an interactive counter of the remaining characters. It is a great addition to text boxes and text areas.
Bootstrap Maxlength
Bootstrap Maxlength

Bootstrap Select

Bootstrap favors native browser controls, which is the reason it doesn’t expose any customization options for them. However, in some projects it is useful to have customizable controls like select boxes, which is exactly what Bootstrap Select does. This plugin gives you a pretty and customizable select box which looks great in your page. For an alternative try with SelectBoxIt, or one of the other well-known plugins like Select2 or Chosen.
Bootstrap Select
Bootstrap Select

Bootstrap Multiselect

And for select inputs without the multiple attribute, you can use Bootstrap Multiselect. The plugin creates an intuitive interface for using select inputs with the multiple attribute present. Instead of a select, a bootstrap button will be shown as a dropdown menu containing the single options as checkboxes.
Bootstrap Multiselect
Bootstrap Multiselect

Bootstrap WYSIHTML5

Bootstrap WYSIHTML5 is a beautiful rich text editor for bootstrap that comes in the form of an easy to embed JavaScript plugin. It gives you only basic functionality, but this will be fine for 90% of the use cases. For a bit more advanced editor, try this one or the insanely powerful TinyMCE.
Bootstrap WYSIHTML5
Bootstrap WYSIHTML5

Bootstrap Form Wizard

It is a good practice to split long forms into smaller, contextually similar chunks. This makes them a bit easier to handle. The Bootstrap Form Wizard does that for you and more.
Bootstrap Form Wizard
Bootstrap Form Wizard

jqBootstrapValidation

jqBootstrapValidation is a plugin that makes it easy to validate your Bootstrap forms. It is easy to include into your project and all the validation rules are described as data attributes on the input elements. If you need an alternative plugin, take a look at nod.
jqBootstrapValidation
jqBootstrapValidation

jQuery File Upload

jQuery File Upload is a very powerful and versatile file uploading plugin. See our tutorial about it here. The plugin is not strictly for bootstrap, but all the examples of their homepage use the frontend framework extensively.
jQuery File Upload
jQuery File Upload

Bootstrap Tag Autocomplete

Bootstrap Tag Autocomplete is a library which adds twitter and facebook-like mentions to your content editable text areas. It takes an array of available completions and inserts them as nodes in the text area on a match.
Bootstrap Tag Autocomplete
Bootstrap Tag Autocomplete

Date and Time Pickers

Your web application probably requires dates to be formatted in a specific way, and expecting people to manually type them in is a road that can only lead to frustration. The better approach is to have a widget which lets users simply click or tap on the date they need. The plugins in this category add such functionality to your Bootstrap forms.

Daterangepicker

Daterangepicker is a plugin for Bootstrap that is the perfect addition to your reports page. It lets users choose preset time periods like the last 7 or 30 days (you can define your own presets) and they can also choose an arbitrary time intervals. You only need to pass a few callback functions when instantiating the plugin, and you are ready to go. Check out a tutorial where we used this plugin to update a chart.
Daterangepicker
Daterangepicker

Bootstrap Timepicker

Bootstrap Timepicker is a pretty and touch friendly plugin that lets you turn text fields into time selection controls. It doesn’t have support for dates, but for that you can use one of the next plugins.
Bootstrap Timepicker
Bootstrap Timepicker

Clockface

Clockface is an alternative plugin to the one above. It presents the hours and minutes as text labels in a circle. While it is a bit ugly for my taste, I give it points for originality.
Clockface
Clockface

Bootstrap Datetime

Bootstrap Datetime Picker is a fully featured plugin that lets you turn a text field into a handy date and time picker control. The plugin is pretty and fits nicely with the framework’s design language. It is also fairly easy to customize with CSS. For an alternative check out this plugin.
Bootstrap Datetime
Bootstrap Datetime

Bic_Calendar

Bic_Calendar is a simple calendar widget that can show events loaded through AJAX. An example PHP script is included that outputs the events as a JSON object. The events are then displayed on the calendar and shown in a popup.
Bic_Calendar
Bic_Calendar

Color Pickers

Entering colors is another area that users need help with. You can’t simply think of a color and write down its hex value – you need to visualize it in some way. The plugins listed here help you alleviate this problem by creating color picker controls and swatches.

Pick a Color

Pick a Color is a bootstrap addon that shows an advanced color picker. You can choose colors by modifying one of the presets, by choosing a previously saved one, or generating a color by modifying the hue, saturation and lightness components.
Pick a Color
Pick a Color

Colorpicker for Bootstrap

Colorpicker for Bootstrap is a more traditional color picker – you get a Photoshop-like widget that lets you choose the main color and specific hues. I personally find this easier to use than the above plugin.
Colorpicker for Bootstrap
Colorpicker for Bootstrap

Color Palette

Color Palette is a Bootstrap plugin that displays a grid of color swatches when a text field is focused. The plugin is easy to integrate with your bootstrap project.
Color Palette
Color Palette

Tables

Bootstrap already offers basic table styles that do a great job with simple data. However, what if you’d like that data to be sortable, searchable and presentable on multiple pages? Read on.

Tablecloth

Tablecloth is a plugin that makes your tables pretty. It comes with a number of built-in styles, and it uses plugins liketablesorter internally to make the data in your tables sortable.
Tablecloth
Tablecloth

Data Tables

Data Tables is another table enhancing addon for Bootstrap. This plugin not only makes your tables sortable, but it also makes use of the framework’s pagination controls and makes the data searchable.
Data Tables
Data Tables

Interface Enhancements

This section contains various plugins that enhance the interface of your web app.

jQuery Bootpag

jQuery Bootpag is an enhanced bootstrap pagination plugin. It is very easy to set up – you only have to pass a callback function and listen for the page event. Inside that function, you can update the container element with the content that you need.
jQuery Bootpag
jQuery Bootpag

Tocify

Tocify is a table of contents plugin. It scans your page on DOMReady, looking for headings, and creates a Bootstrap – styled table of contents dynamically.
Tocify
Tocify

Bootstrap Link Preview

Bootstrap Link Preview is a JavaScript library offering a Facebook-like preview for URLs. It is very simple to use and weighs just a few kilobytes. To work around the same origin policy it depends on a PHP script though.
Bootstrap Link Preview
Bootstrap Link Preview

Tab drop

Tab drop is a neat plugin that hides your tabs in a dropdown if they don’t fit in a single row. This can come handy when designing responsive sites that need to work on small screens.
Tab drop
Tab drop

Flippant.js

Flippant.js is a tiny plugin that lets you flip elements to reveal further content with a smooth CSS transition. You can put any content on the back side – simply pass it as an argument to the function call.
Flippant.js
Flippant.js

Hover Dropdown

Another interface enhancement for Bootstrap. With the Hover Dropdown plugin you can activate the framework’s dropdowns on hover in addition to click. This can make for a better user experience with your site.
Hover Dropdown
Hover Dropdown

Social Buttons

Social Buttons is a collection of pretty social networking buttons built with Bootstrap and Font Awesome. This makes them very easy to scale and style.
Social Buttons
Social Buttons

Bootstro.js

Bootstro.js is a bootstrap plugin that lets you build a guided tour for new users. A tour consists of tooltips and overlays which explain the functions of your app. The plugin has plenty of options and callbacks, so it is easy to hook up with the rest of your code. For an alternative, checkout Bootstraptour.
Bootstro.js
Bootstro.js

AJAX

The Bootstrap extensions in this section handle inline editing of content with automatic syncing with your server, extend the framework with AJAX bindings and more.

X-editable

X-editable is a library that enhances Bootstrap with inline editing capability. Clicking an element that is set to be editable, will open up a bootstrap popup with a text field and buttons. In addition, it supports editing inline and has many different types of text controls including rich text editors and date pickers. On a successful edit, the plugin sends an AJAX request to your server.
X-editable
X-editable

Eldarion AJAX

With Eldarion AJAX you can extend bootstrap with automatic AJAX request handling. Simply add the ajax class to the button or link you wish to enhance, and the plugin will do the rest. It will send a request and replace the contents of the element with the response from the server. You can also submit forms in the same manner.
Eldarion AJAX
Eldarion AJAX

Typeahead

Typeahead is a library by twitter that offers a fast and fully featured autocomplete control for your site. It supports fetching autocomplete data via AJAX, caching, rate limiting and more. The most common selections are displayed as hints. The library is not dependent on bootstrap, but it can be easily integrated with it.
Typeahead
Typeahead

Conclusion

Bootstrap is a valuable addition to your web development toolbox. Knowing your way around the framework will let you build usable and responsive interfaces with ease. And with the plugins presented here, you can add advanced functionality that fits nicely with the rest of your site.

Origin Link: http://tutorialzine.com/2013/07/50-must-have-plugins-for-extending-twitter-bootstrap/

Friday, June 27, 2014

Centos yum error with epel

Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again


Try 
URLGRABBER_DEBUG=1 yum check-update
maybe cause it can not create https (secure of http) ... 
Check your system date (if date is not update ... https can not work) by using "date" command.
install ntp to auto - sync system date. 
yum --disablerepo epel install ntp
service ntpd restart

check your system date by "date" command ... after 5 - 10 sec ... your system time will be synced. 

Sunday, June 22, 2014

LVM – Logical Volume Management on CentOS 6

LVM quickly explained:

In computer storagelogical volume management or LVM provides a method of allocating space on mass-storage devices that is more flexible than conventional partitioning schemes. In particular, a volume manager can concatenate, stripe together or otherwise combine partitions into larger virtual ones that administrators can re-size or move, potentially without interrupting system use. As seen in the LVM design scheme, Physical Volumes (PV) are the bottom layer of LVM. The second layer are Volume Groups (VG) and the final, third layer are Logical Volumes (LV).
In Part 1 (LVM – Physical Volume Management on CentOS 6) we learned how to manage PV’s and prepared PV’s to be added to Volume Groups (VG’s). In Part 2 (LVM – Physical Volume Management on CentOS 6) we learned how to manage VG’s. In this post we will learn how to manage Logical Volumes (LV’s).

Logical Volume Management is a part 3/3 of LVM Management on CentOS 6!

In this post we will learn how to display, create, extend with filesystem resize, reduce with filesystem resize, resize, rename and remove Logical Volumes (LV).
Here is the basic design scheme:
LVM Logical Volume scheme (source: RedHat.com)
LVM Logical Volume scheme (source: RedHat.com)

Let’s start our Logical Volume Management on CentOS 6 guide!

1. Display Logical Volumes

We can display all Logical Volumes (LV’s) on the system with the “lvdisplay” command:
[root@foo ~]# lvdisplay
   --- Logical volume ---
   LV Path                /dev/vg_foo/LogVol01
   LV Name                LogVol01
   VG Name                vg_foo
   LV UUID                qtyLV0-EZuh-2b0f-raUG-EcIM-5teW-W3QyeW
   LV Write Access        read/write
   LV Creation host, time foo.geekpeek.net, 2013-05-08 10:59:33 +0200
   LV Status              available
   # open                 1
   LV Size                13.04 GiB
   Current LE             3339
   Segments               1
   Allocation             inherit
   Read ahead sectors     auto
   - currently set to     256
   Block device           253:0

   --- Logical volume ---
   LV Path                /dev/vg_foo/LogVol00
   LV Name                LogVol00
   VG Name                vg_foo
   LV UUID                bMxELt-4cN1-lpzb-j7nd-Ixyr-mpsE-vmO1Oe
   LV Write Access        read/write
   LV Creation host, time foo.geekpeek.net, 2013-05-08 10:59:48 +0200
   LV Status              available
   # open                 1
   LV Size                1.46 GiB
   Current LE             375
   Segments               1
   Allocation             inherit
   Read ahead sectors     auto
   - currently set to     256
   Block device           253:1
We can also display Logical Volumes with “lvscan” or “lvs” commands, but as we see the output is a bit different:
[root@foo ~]# lvscan
   ACTIVE            '/dev/vg_foo/LogVol01' [13.04 GiB] inherit
   ACTIVE            '/dev/vg_foo/LogVol00' [1.46 GiB] inherit
[root@foo ~]# lvs
   LV       VG     Attr      LSize  Pool Origin Data%  Move Log Cpy%Sync Convert
   LogVol00 vg_foo -wi-ao---  1.46g                                             
   LogVol01 vg_foo -wi-ao--- 13.04g
In the following examples i will be mostly using “lvdisplay” command, because it gives me the most information.
We see there are currently two existing Logical Volumes present. The first is called LogVol00 and the second is called LogVol01. These LV’s hold the system root and swap partition. With the “lvdisplay” command we can see additional information – LV Status, LV UUID, Current LE,…

2. Create Logical Volume

To create new Logical Volume (LV) we first have to check the desired Volume Group (VG) for free Physical Extent (PE) – Free PE’s.
[root@foo ~]# vgdisplay 
   --- Volume group ---
   VG Name               GeekPeek
   System ID             
   Format                lvm2
   Metadata Areas        3
   Metadata Sequence No  16
   VG Access             read/write
   VG Status             resizable
   MAX LV                0
   Cur LV                0
   Open LV               0
   Max PV                0
   Cur PV                3
   Act PV                3
   VG Size               5.99 GiB
   PE Size               2.00 MiB
   Total PE              3066
   Alloc PE / Size       0 / 0   
   Free  PE / Size       3066 / 5.99 GiB
   VG UUID               oj2GS6-l5aE-6WNv-QPJy-r1pC-ahSQ-EzFiKc

   --- Volume group ---
   VG Name               vg_foo
   System ID             
   Format                lvm2
   Metadata Areas        1
   Metadata Sequence No  3
   VG Access             read/write
   VG Status             resizable
   MAX LV                0
   Cur LV                2
   Open LV               2
   Max PV                0
   Cur PV                1
   Act PV                1
   VG Size               14.51 GiB
   PE Size               4.00 MiB
   Total PE              3714
   Alloc PE / Size       3714 / 14.51 GiB
   Free  PE / Size       0 / 0   
   VG UUID               3n3nzs-dzHK-rApY-EApz-Zz2H-JQVP-TlcYfF
As we can see, Volume Group “GeekPeek” has all of the 3066 PE’s free which means 5.99GiB of allocatable LV space. We can now create a Logical Volume with “lvcreate” command. Simple syntax is “lvcreate -n lvname -L size vgname“.
[root@foo ~]# lvcreate -n GeekVol01 -L 3GiB GeekPeek
Logical volume "GeekVol01" created
If we use the -l parameter instead of -L we are allocating Physical Extents and not actual size in GB, MB or KB. Check “lvcreate –help” for more info.
 [root@foo ~]# lvcreate -n GeekVol01 -l 1536 GeekPeek
   Logical volume "GeekVol01" created

 [root@foo ~]# lvdisplay
   --- Logical volume ---
   LV Path                /dev/GeekPeek/GeekVol01
   LV Name                GeekVol01
   VG Name                GeekPeek
   LV UUID                F99J0T-07s8-LJAy-rNvI-GZNd-DppC-HXsXai
   LV Write Access        read/write
   LV Creation host, time foo.geekpeek.net, 2013-07-09 16:18:41 +0200
   LV Status              available
   # open                 0
   LV Size                3.00 GiB
   Current LE             1536
   Segments               2
   Allocation             inherit
   Read ahead sectors     auto
   - currently set to     256
   Block device           253:2

   --- Logical volume ---
   LV Path                /dev/vg_foo/LogVol01
   LV Name                LogVol01
   VG Name                vg_foo
   LV UUID                qtyLV0-EZuh-2b0f-raUG-EcIM-5teW-W3QyeW
   LV Write Access        read/write
   LV Creation host, time foo.geekpeek.net, 2013-05-08 10:59:33 +0200
   LV Status              available
   # open                 1
   LV Size                13.04 GiB
   Current LE             3339
   Segments               1
   Allocation             inherit
   Read ahead sectors     auto
   - currently set to     256
   Block device           253:0

   --- Logical volume ---
   LV Path                /dev/vg_foo/LogVol00
   LV Name                LogVol00
   VG Name                vg_foo
   LV UUID                bMxELt-4cN1-lpzb-j7nd-Ixyr-mpsE-vmO1Oe
   LV Write Access        read/write
   LV Creation host, time foo.geekpeek.net, 2013-05-08 10:59:48 +0200
   LV Status              available
   # open                 1
   LV Size                1.46 GiB
   Current LE             375
   Segments               1
   Allocation             inherit
   Read ahead sectors     auto
   - currently set to     256
   Block device           253:1
Both commands created 3GiB large Logical Volume called “GeekVol01“.

3. Extend Logical Volume

We can extend a Logical Volume with “lvextend” command. The simple syntax is “lvextend -L +size vgname/lvname“. You can also resize the filesystem, but you need to add -r parameter “lvextend -L +size vgname/lvname -r“. In our example we will extend LV called “GeekVol01” on a VG called “GeekPeek” from 3GB to 5GB (+2GB in size).
Of course you first have to check if you have enough space available in your VG to complete the action!!
[root@foo ~]# lvextend -L +2GiB GeekPeek/GeekVol01
   Extending logical volume GeekVol01 to 5.00 GiB
   Logical volume GeekVol01 successfully resized

To automatically resize LV and filesystem use the -r parameter! We can resize filesystem on the fly, while mounted!
[root@foo ~]# lvextend -L +2GiB GeekPeek/GeekVol01 -r
   Extending logical volume GeekVol01 to 5.00 GiB
   Logical volume GeekVol01 successfully resized
 resize2fs 1.41.12 (17-May-2010)
 Filesystem at /dev/mapper/GeekPeek-GeekVol01 is mounted on /geek; on-line resizing required
 old desc_blocks = 1, new_desc_blocks = 1
 Performing an on-line resize of /dev/mapper/GeekPeek-GeekVol01 to 1310720 (4k) blocks.
 The filesystem on /dev/mapper/GeekPeek-GeekVol01 is now 1310720 blocks long.
[root@foo ~]# lvdisplay 
   --- Logical volume ---
   LV Path                /dev/GeekPeek/GeekVol01
   LV Name                GeekVol01
   VG Name                GeekPeek
   LV UUID                F99J0T-07s8-LJAy-rNvI-GZNd-DppC-HXsXai
   LV Write Access        read/write
   LV Creation host, time foo.geekpeek.net, 2013-07-09 16:18:41 +0200
   LV Status              available
   # open                 0
   LV Size                5.00 GiB
   Current LE             2560
   Segments               3
   Allocation             inherit
   Read ahead sectors     auto
   - currently set to     256
   Block device           253:2

   --- Logical volume ---
   LV Path                /dev/vg_foo/LogVol01
   LV Name                LogVol01
   VG Name                vg_foo
   LV UUID                qtyLV0-EZuh-2b0f-raUG-EcIM-5teW-W3QyeW
   LV Write Access        read/write
   LV Creation host, time foo.geekpeek.net, 2013-05-08 10:59:33 +0200
   LV Status              available
   # open                 1
   LV Size                13.04 GiB
   Current LE             3339
   Segments               1
   Allocation             inherit
   Read ahead sectors     auto
   - currently set to     256
   Block device           253:0

   --- Logical volume ---
   LV Path                /dev/vg_foo/LogVol00
   LV Name                LogVol00
   VG Name                vg_foo
   LV UUID                bMxELt-4cN1-lpzb-j7nd-Ixyr-mpsE-vmO1Oe
   LV Write Access        read/write
   LV Creation host, time foo.geekpeek.net, 2013-05-08 10:59:48 +0200
   LV Status              available
   # open                 1
   LV Size                1.46 GiB
   Current LE             375
   Segments               1
   Allocation             inherit
   Read ahead sectors     auto
   - currently set to     256
   Block device           253:1
When extending LV, do not forget the plus sign before the extend size! +2GiB!!

4. Reduce Logical Volume

We can reduce a Logical Volume with “lvreduce” command. The simple syntax is “lvreduce -L -size vgname/lvname“. You can also resize the filesystem, but you need to add -r parameter “lvreduce -L -size vgname/lvname -r“. In our example we will reduce LV called “GeekVol01” on a VG called “GeekPeek” from 5GB to 3GB (-2GB in size). We should deactivate our LV first with “lvchange” and later reactivate it:
[root@foo ~]# lvchange -an GeekPeek/GeekVol01
[root@foo ~]# lvreduce -L -2GiB geekpeek/GeekVol01 
   Reducing logical volume GeekVol01 to 3.00 GiB
   Logical volume GeekVol01 successfully resized
[root@foo ~]# lvchange -ay GeekPeek/GeekVol01

To automatically resize LV and your filesystem use the -r parameter:
[root@foo ~]# lvreduce -L -2GiB GeekPeek/GeekVol01 -r
 Do you want to unmount "/geek"? [Y|n] y
 fsck from util-linux-ng 2.17.2
 /dev/mapper/GeekPeek-GeekVol01: 18/327680 files (0.0% non-contiguous), 694497/1310720 blocks
 resize2fs 1.41.12 (17-May-2010)
 Resizing the filesystem on /dev/mapper/GeekPeek-GeekVol01 to 786432 (4k) blocks.
 The filesystem on /dev/mapper/GeekPeek-GeekVol01 is now 786432 blocks long.

   Reducing logical volume GeekVol01 to 3.00 GiB
   Logical volume GeekVol01 successfully resized

 [root@foo ~]# lvdisplay 
   --- Logical volume ---
   LV Path                /dev/GeekPeek/GeekVol01
   LV Name                GeekVol01
   VG Name                GeekPeek
   LV UUID                F99J0T-07s8-LJAy-rNvI-GZNd-DppC-HXsXai
   LV Write Access        read/write
   LV Creation host, time foo.geekpeek.net, 2013-07-09 16:18:41 +0200
   LV Status              available
   # open                 1
   LV Size                3.00 GiB
   Current LE             1536
   Segments               2
   Allocation             inherit
   Read ahead sectors     auto
   - currently set to     256
   Block device           253:2

   --- Logical volume ---
   LV Path                /dev/vg_foo/LogVol01
   LV Name                LogVol01
   VG Name                vg_foo
   LV UUID                qtyLV0-EZuh-2b0f-raUG-EcIM-5teW-W3QyeW
   LV Write Access        read/write
   LV Creation host, time foo.geekpeek.net, 2013-05-08 10:59:33 +0200
   LV Status              available
   # open                 1
   LV Size                13.04 GiB
   Current LE             3339
   Segments               1
   Allocation             inherit
   Read ahead sectors     auto
   - currently set to     256
   Block device           253:0

   --- Logical volume ---
   LV Path                /dev/vg_foo/LogVol00
   LV Name                LogVol00
   VG Name                vg_foo
   LV UUID                bMxELt-4cN1-lpzb-j7nd-Ixyr-mpsE-vmO1Oe
   LV Write Access        read/write
   LV Creation host, time foo.geekpeek.net, 2013-05-08 10:59:48 +0200
   LV Status              available
   # open                 1
   LV Size                1.46 GiB
   Current LE             375
   Segments               1
   Allocation             inherit
   Read ahead sectors     auto
   - currently set to     256
   Block device           253:1
When reducing LV, do not forget the minus sign before the extend size! -2GiB!!

5. Resize Logical Volume

We can extend and reduce LV’s with “lvresize” command. Simple syntax to reduce a LV is “lvresize -L -size vgname/lvname” – again to resize filesystem to add -r at the end. Simple syntax to extend a LV is “lvresize -L +size vgname/lvname” – again to resize filesystem to add -r at the end. We will reduce our LV called “GeekVol01” from 5GB to 3GB and then extend from 3GB back to 5GB – with filesystem resize!
[root@foo ~]# lvresize -L -2GiB geekpeek/GeekVol01 -r
 Do you want to unmount "/geek"? [Y|n] y

 fsck from util-linux-ng 2.17.2
 /dev/mapper/geekpeek-GeekVol01: 18/327680 files (0.0% non-contiguous), 694497/1310720 blocks
 resize2fs 1.41.12 (17-May-2010)
 Resizing the filesystem on /dev/mapper/geekpeek-GeekVol01 to 786432 (4k) blocks.
 The filesystem on /dev/mapper/geekpeek-GeekVol01 is now 786432 blocks long.

   Reducing logical volume GeekVol01 to 3.00 GiB
   Logical volume GeekVol01 successfully resized
[root@foo ~]# lvresize -L +2GiB geekpeek/GeekVol01 -r
 Extending logical volume GeekVol01 to 5.00 GiB
 Logical volume GeekVol01 successfully resized
 resize2fs 1.41.12 (17-May-2010)
 Filesystem at /dev/mapper/geekpeek-GeekVol01 is mounted on /geek; on-line resizing required
 old desc_blocks = 1, new_desc_blocks = 1
 Performing an on-line resize of /dev/mapper/geekpeek-GeekVol01 to 1310720 (4k) blocks.
 The filesystem on /dev/mapper/geekpeek-GeekVol01 is now 1310720 blocks long.

6. Rename Logical Volume

We can rename Logical Volume with “lvrename” command. The simple syntax is “lvrename vgname1/lvname1 vgname1/lvname2“. In our example we will rename our LV called “GeekVol01” existing on VG called “GeekPeek” to “RenameVol01“:
[root@foo ~]# lvrename GeekPeek/GeekVol01 GeekPeek/RenameVol01
Renamed "GeekVol01" to "RenameVol01" in volume group "geekpeek"
[root@foo ~]# lvdisplay 
   --- Logical volume ---
   LV Path                /dev/geekpeek/RenameVol01
   LV Name                RenameVol01
   VG Name                geekpeek
   LV UUID                F99J0T-07s8-LJAy-rNvI-GZNd-DppC-HXsXai
   LV Write Access        read/write
   LV Creation host, time foo.geekpeek.net, 2013-07-09 16:18:41 +0200
   LV Status              available
   # open                 1
   LV Size                5.00 GiB
   Current LE             2560
   Segments               3
   Allocation             inherit
   Read ahead sectors     auto
   - currently set to     256
   Block device           253:2

7. Remove Logical Volume

We can remove Logical Volumes with “lvremove” command. The simple syntax is “vgremove vgname/lvname“. In our example we will remove LV called “GeekVol01” existing on VG called “GeekPeek“. First deactivate LV and then remove it:
All data from LV you will remove will be lost!!
[root@foo ~]# lvchange -an geekpeek
[root@foo ~]# lvremove GeekPeek/GeekVol01
   Logical volume "GeekVol01" successfully removed
[root@foo ~]# lvdisplay 
   --- Logical volume ---
   LV Path                /dev/vg_foo/LogVol01
   LV Name                LogVol01
   VG Name                vg_foo
   LV UUID                qtyLV0-EZuh-2b0f-raUG-EcIM-5teW-W3QyeW
   LV Write Access        read/write
   LV Creation host, time foo.geekpeek.net, 2013-05-08 10:59:33 +0200
   LV Status              available
   # open                 1
   LV Size                13.04 GiB
   Current LE             3339
   Segments               1
   Allocation             inherit
   Read ahead sectors     auto
   - currently set to     256
   Block device           253:0

   --- Logical volume ---
   LV Path                /dev/vg_foo/LogVol00
   LV Name                LogVol00
   VG Name                vg_foo
   LV UUID                bMxELt-4cN1-lpzb-j7nd-Ixyr-mpsE-vmO1Oe
   LV Write Access        read/write
   LV Creation host, time foo.geekpeek.net, 2013-05-08 10:59:48 +0200
   LV Status              available
   # open                 1
   LV Size                1.46 GiB
   Current LE             375
   Segments               1
   Allocation             inherit
   Read ahead sectors     auto
   - currently set to     256
   Block device           253:1

Do it the easy way! Download GeekPeek.Net LVM Management automated bash script!