LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-27-2010, 11:44 PM   #1
fizeelinux
Member
 
Registered: Nov 2008
Posts: 91

Rep: Reputation: 15
LVM Basics


Hi all,

I am trying to learn LVM concepts and created Physical and Volume group and output are as follows.

Quote:
[root@srv-ftp /]# /sbin/fdisk /dev/sdb

The number of cylinders for this disk is set to 30401.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 12159 97667136 8e Linux LVM
/dev/sdb2 12160 18239 48837600 8e Linux LVM
Can anyone please help me in explaining this output? I can understand that it is a 250GB harddisk and it has two partions of LVM type.How can i see the unpartitioned size so that i can extend or create a new partition.How is the cylinder size related to the harddisk.What does 30401 and 16065 * 512 mean ?Awaiting for your reply.Thanks in advance.

Last edited by fizeelinux; 01-27-2010 at 11:45 PM.
 
Old 01-27-2010, 11:59 PM   #2
ongte
Member
 
Registered: Jun 2009
Location: Penang, Malaysia
Distribution: Mageia, CentOS, Ubuntu
Posts: 468

Rep: Reputation: 72
Disk /dev/sdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 12159 97667136 8e Linux LVM
/dev/sdb2 12160 18239 48837600 8e Linux LVM

In Red is your Total # of Cylinders.
In Blue is the last Cylinder of your 2nd partition. That means you still have space between 18240 & 30401 = 12161 Cylinders.

Take 12161 and times the Unit 8225280 bytes will give you your remaining space of 100,027,630,080 bytes. About 93GB. All this is basic partition concepts and does not really have anything to do with LVM.

The partitions marked as Linux LVM are used as the physical volumes. From them you can create volume groups and logical volumes.
To view LVM details use:
pvdisplay
vgdisplay
lvdisplay

Not in front of a *nix box, so can't tell you the exact commands. But basically, what you need to do is create another partition of type Linux LVM in the free space available.
Then use pvcreate to mark the partition as a physical volume(PV).
Use vgextend to add this PV into your current volume group (VG)
and lvextend to extend your logical volume (LV)
Finally use resize2fs to resize the filesystem into the new partition size.

Last edited by ongte; 01-28-2010 at 12:06 AM.
 
Old 01-28-2010, 12:03 AM   #3
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

Have a look at this LVM Tutorial, it's very easy to follow and understand and explains the commands with nice examples.

Kind regards,

Eric
 
Old 01-29-2010, 01:24 AM   #4
fizeelinux
Member
 
Registered: Nov 2008
Posts: 91

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by ongte View Post
Disk /dev/sdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 12159 97667136 8e Linux LVM
/dev/sdb2 12160 18239 48837600 8e Linux LVM

In Red is your Total # of Cylinders.
In Blue is the last Cylinder of your 2nd partition. That means you still have space between 18240 & 30401 = 12161 Cylinders.

Take 12161 and times the Unit 8225280 bytes will give you your remaining space of 100,027,630,080 bytes. About 93GB. All this is basic partition concepts and does not really have anything to do with LVM.

The partitions marked as Linux LVM are used as the physical volumes. From them you can create volume groups and logical volumes.
To view LVM details use:
pvdisplay
vgdisplay
lvdisplay

Not in front of a *nix box, so can't tell you the exact commands. But basically, what you need to do is create another partition of type Linux LVM in the free space available.
Then use pvcreate to mark the partition as a physical volume(PV).
Use vgextend to add this PV into your current volume group (VG)
and lvextend to extend your logical volume (LV)
Finally use resize2fs to resize the filesystem into the new partition size.
Thanks a lot.I really appreciate that.Thanks for the info.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
lvm ontop of raid10 or combine two raid1 via lvm? okar Linux - Server 3 09-11-2009 02:37 PM
LVM and multiple iSCSI disks performance of LVM xxx_anuj_xxx Linux - Server 4 05-01-2008 12:26 PM
LXer: Managing LVM with the LVM Manager LXer Syndicated Linux News 0 03-16-2008 11:10 AM
LXer: Back Up (And Restore) LVM Partitions With LVM Snapshots LXer Syndicated Linux News 0 04-17-2007 11:16 AM
Basics Sn7 Linux - Software 2 09-20-2004 12:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration