LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 10-19-2008, 08:34 AM   #1
arashi256
Member
 
Registered: Jan 2008
Location: Brighton, UK
Distribution: Ubuntu 12.04 / CentOS 6.5
Posts: 385

Rep: Reputation: 61
Unhappy Trying to understand LVM.


I'm running out of disk space on my server, so was going to add a new IDE hard disk. Presumably, each drive like hard disks are listed under the virtual filesystem under /dev. I only have one hard disk in there at the moment and I bascally want to add a new hard disk and only append the new space to /home. However, under /dev where I was expecting just one entry for /dev/sda1, I get sda, sda1 and sda2 which look like SATA drives (which I don't understand). These entries are highlighted in yellow and if I do a "ls -la" I get things like: -

cdrom (in blue) -> sr0 (in yellow)
cdrw (in blue) -> sr0 (in yellow)
floppy (in blue) -> fd0 (in yellow)

How will I know if I've added a new hard disk and how can I identify the devices above in any certainty?

As far as I can tell, the procedure for adding a new disk is: -

1. Add new physical drive (data and power cable)
2. Check to see if the new device appears under /dev (this is one bit I'm unclear about).
3. fdisk the new disk using "fdisk /dev/sda2" or whatever (thats what I need to know too, I guess).
4. Format the Linux partition using "mkfs -t ext3 /dev/sda2".
5. Scan for Linux LVM file-systems which the "vgcreate <groupname> /dev/partition1...or something". Don't understand this bit either really.
6. Create volumes to a specific set with the "pvcreate /dev/partition1" command.
7. Now I should be able to create a logical volume (presumably something like VolGroup01 like I can see under /dev now). Apparently, I should use "lvcreate -L xyM -n <volume> <group>" where xy is the size of the group and <group> is the volume group name (something like VolGroup02?) and <volume> is the name returned from the previous step.
8. Finally, format the logical volume (VolGroup02) with "mkfs -t ext3 /dev/sda2" (again? - didn't I do that already above - wrong order?)

Now, can I mount the new drive and append the space with something like "mount /dev/hda2 /home" and if so, how can I make this automatic?

Anything I've got wrong above. Oh, and sorry for all the questions!
 
Old 10-19-2008, 10:38 AM   #2
mazhar_theone
LQ Newbie
 
Registered: Mar 2008
Posts: 14

Rep: Reputation: 0
Quote:
Originally Posted by arashi256 View Post
I'm running out of disk space on my server, so was going to add a new IDE hard disk. Presumably, each drive like hard disks are listed under the virtual filesystem under /dev. I only have one hard disk in there at the moment and I bascally want to add a new hard disk and only append the new space to /home. However, under /dev where I was expecting just one entry for /dev/sda1, I get sda, sda1 and sda2 which look like SATA drives (which I don't understand). These entries are highlighted in yellow and if I do a "ls -la" I get things like: -

cdrom (in blue) -> sr0 (in yellow)
cdrw (in blue) -> sr0 (in yellow)
floppy (in blue) -> fd0 (in yellow)

How will I know if I've added a new hard disk and how can I identify the devices above in any certainty?

As far as I can tell, the procedure for adding a new disk is: -

1. Add new physical drive (data and power cable)
2. Check to see if the new device appears under /dev (this is one bit I'm unclear about).
3. fdisk the new disk using "fdisk /dev/sda2" or whatever (thats what I need to know too, I guess).
4. Format the Linux partition using "mkfs -t ext3 /dev/sda2".
5. Scan for Linux LVM file-systems which the "vgcreate <groupname> /dev/partition1...or something". Don't understand this bit either really.
6. Create volumes to a specific set with the "pvcreate /dev/partition1" command.
7. Now I should be able to create a logical volume (presumably something like VolGroup01 like I can see under /dev now). Apparently, I should use "lvcreate -L xyM -n <volume> <group>" where xy is the size of the group and <group> is the volume group name (something like VolGroup02?) and <volume> is the name returned from the previous step.
8. Finally, format the logical volume (VolGroup02) with "mkfs -t ext3 /dev/sda2" (again? - didn't I do that already above - wrong order?)

Now, can I mount the new drive and append the space with something like "mount /dev/hda2 /home" and if so, how can I make this automatic?

Anything I've got wrong above. Oh, and sorry for all the questions!
/dev/sda is your first hard drive and /dev/sda1 /dev/sda2 are partitions on it.

you should get /dev/sdb or /dev/hdb if your secondary hard drive is properly detected on your machine.

login as root and check all the drives using fdisk -l command

It will show all drives attached on your machine with the partition list .

let me know output of following command
Quote:
fdisk -l
Mazhar
http://mazhar.co.in/blogs/
 
Old 10-19-2008, 10:42 AM   #3
arashi256
Member
 
Registered: Jan 2008
Location: Brighton, UK
Distribution: Ubuntu 12.04 / CentOS 6.5
Posts: 385

Original Poster
Rep: Reputation: 61
Quote:
Originally Posted by mazhar_theone View Post
/dev/sda is your first hard drive and /dev/sda1 /dev/sda2 are partitions on it.

you should get /dev/sdb or /dev/hdb if your secondary hard drive is properly detected on your machine.
Ah, okay - so the numerics are partitions of the drives. Good to know - that makes more sense.

Quote:
Originally Posted by mazhar_theone View Post
/
login as root and check all the drives using fdisk -l command

It will show all drives attached on your machine with the partition list .

let me know output of following command


Mazhar
http://mazhar.co.in/blogs/
The output with currently one hard disk is: -

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xaf7daf7d

Device Boot Start End Blocks Id System
/dev/sda1 * 1 25 200781 83 Linux
/dev/sda2 26 14593 117017460 8e Linux LVM

Disk /dev/dm-0: 119.2 GB, 119252451328 bytes
255 heads, 63 sectors/track, 14498 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/dm-0 doesn't contain a valid partition table

Disk /dev/dm-1: 536 MB, 536870912 bytes
255 heads, 63 sectors/track, 65 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x30307800

Disk /dev/dm-1 doesn't contain a valid partition table
 
Old 10-20-2008, 12:14 AM   #4
uncle_philip
Member
 
Registered: Apr 2008
Location: sydney
Distribution: centos5.2
Posts: 50

Rep: Reputation: 15
assume your ide drive in C,
fdisk /dev/hdc, create some partition
mkfs -t ext3 /dev/hdc1, format drive c1,c2,c3..
mkdir /media/hdc1, create the mount point directory, c1,c2,c3..
mount -t ext3 /dev/hdc1 /media/hdc1, mount the drive, you need to mount the drive everytime you reboot your computer.
OR, under /etc/fstab, add
/dev/hdc1 /media/hdc1 ext3 defaults 1 1
 
Old 10-20-2008, 01:17 AM   #5
arashi256
Member
 
Registered: Jan 2008
Location: Brighton, UK
Distribution: Ubuntu 12.04 / CentOS 6.5
Posts: 385

Original Poster
Rep: Reputation: 61
Thanks! That should give me a better direction.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Possible to change non-LVM to LVM? darthfoolish Linux - Software 2 08-01-2008 03:47 AM
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
Can somebody help me to understand... Kristoffer G Mandriva 1 09-06-2007 06:38 AM
LXer: Back Up (And Restore) LVM Partitions With LVM Snapshots LXer Syndicated Linux News 0 04-17-2007 11:16 AM


All times are GMT -5. The time now is 11:31 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration