LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-27-2011, 04:31 PM   #1
Jordan Miguel
LQ Newbie
 
Registered: Apr 2011
Distribution: CentOS
Posts: 5

Rep: Reputation: 0
Extend an partition


Hello,

I would like to know if is possible extend a partition using one disk.
I have 50 GB on /dev/vdf2 and would like to add on:
/dev/vdc1 50G 6.4G 41G 14% /home3

And this partition will have 100G of space..

This is possible?
 
Old 04-27-2011, 04:42 PM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Hi Jordan,

If it is an lv then yes if not then no.

From the output I can see it is a simple partition /dev/vdc1 it appears to be a normal partition and not an lvm.

I am first time seeing vdc. Can you please let us know which distro you are using?
 
Old 04-27-2011, 04:52 PM   #3
Jordan Miguel
LQ Newbie
 
Registered: Apr 2011
Distribution: CentOS
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by T3RM1NVT0R View Post
Hi Jordan,

If it is an lv then yes if not then no.

From the output I can see it is a simple partition /dev/vdc1 it appears to be a normal partition and not an lvm.

I am first time seeing vdc. Can you please let us know which distro you are using?
It's my df -h. I have extended the VolGroup00 ( / ) without problemas.. But I don't know how to do this with vdc1

Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
186G 108G 69G 62% /
/dev/vda1 99M 19M 75M 21% /boot
tmpfs 2.0G 0 2.0G 0% /dev/shm
/dev/vdb1 128G 106G 16G 87% /home2
/dev/vdc1 50G 6.4G 41G 14% /home3
/usr/tmpDSK 485M 65M 395M 15% /tmp

Is possible do this formatting or unmounting this partition and remounting again?
 
Old 04-27-2011, 04:57 PM   #4
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Formatting will result in data loss. Don't go for it.

Before that please let us know the output of the following commands:

1. vgdisplay
2. lvdisplay
3. pvdisplay
4. mdadm --detail
 
Old 04-27-2011, 05:40 PM   #5
Jordan Miguel
LQ Newbie
 
Registered: Apr 2011
Distribution: CentOS
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by T3RM1NVT0R View Post
Formatting will result in data loss. Don't go for it.

Before that please let us know the output of the following commands:

1. vgdisplay
2. lvdisplay
3. pvdisplay
4. mdadm --detail
Yes, but if necessary, I could move this to other directory and after this I move tho this again..

1 - --- Volume group ---
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 4
Metadata Sequence No 9
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 4
Act PV 4
VG Size 197.47 GB
PE Size 32.00 MB
Total PE 6319
Alloc PE / Size 6319 / 197.47 GB
Free PE / Size 0 / 0

2 - --- Logical volume ---
LV Name /dev/VolGroup00/LogVol00
VG Name VolGroup00
LV Write Access read/write
LV Status available
# open 1
LV Size 191.66 GB
Current LE 6133
Segments 4
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:0

--- Logical volume ---
LV Name /dev/VolGroup00/LogVol01
VG Name VolGroup00
LV Write Access read/write
LV Status available
# open 1
LV Size 5.81 GB
Current LE 186
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:1

3 - --- Physical volume ---
PV Name /dev/vda2
VG Name VolGroup00
PV Size 49.90 GB / not usable 25.37 MB
Allocatable yes (but full)
PE Size (KByte) 32768
Total PE 1596
Free PE 0
Allocated PE 1596

--- Physical volume ---
PV Name /dev/vdd
VG Name VolGroup00
PV Size 50.00 GB / not usable 32.00 MB
Allocatable yes (but full)
PE Size (KByte) 32768
Total PE 1599
Free PE 0
Allocated PE 1599

--- Physical volume ---
PV Name /dev/vde
VG Name VolGroup00
PV Size 50.00 GB / not usable 32.00 MB
Allocatable yes (but full)
PE Size (KByte) 32768
Total PE 1599
Free PE 0
Allocated PE 1599

--- Physical volume ---
PV Name /dev/vdf1
VG Name VolGroup00
PV Size 47.68 GB / not usable 28.41 MB
Allocatable yes (but full)
PE Size (KByte) 32768
Total PE 1525
Free PE 0
Allocated PE 1525

4 - mdadm: No devices given.

Addictionally, thats my fdisk -l

Disk /dev/vda: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/vda1 * 1 13 104391 83 Linux
/dev/vda2 14 6527 52323705 8e Linux LVM

Disk /dev/vdb: 139.5 GB, 139586437120 bytes
16 heads, 63 sectors/track, 270466 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/vdb1 1 270466 136314832+ 83 Linux

Disk /dev/vdc: 53.6 GB, 53687091200 bytes
16 heads, 63 sectors/track, 104025 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/vdc1 1 104025 52428568+ 83 Linux

Disk /dev/vdd: 53.6 GB, 53687091200 bytes
16 heads, 63 sectors/track, 104025 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Disk /dev/vdd doesn't contain a valid partition table

Disk /dev/vde: 53.6 GB, 53687091200 bytes
16 heads, 63 sectors/track, 104025 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Disk /dev/vde doesn't contain a valid partition table

Disk /dev/vdf: 107.3 GB, 107374182400 bytes
16 heads, 63 sectors/track, 208050 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/vdf1 1 99207 50000296+ 83 Linux
/dev/vdf2 99208 198414 50000328 83 Linux
 
Old 04-27-2011, 06:07 PM   #6
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Alright I got a better picture now.

Both /dev/vdc1 and /dev/vdf2 are linux partitions and not linux lvm

Only way that I am aware of to achieve what you are thinking is to move data from /home3 to some other location and then perform the following:

1. Change the partition type of vdc1 to linux lvm
2. Change the partition type of vdf2 to linux lvm
3. Create physical volumes corresponding both linux lvm partitions. pvcreate /dev/vdc1, pvcreate /dev/vdf2
4. Add these volumes to a group say vghome. vgcreate vghome /dev/vdc1 /dev/vdf2
5. Create a single logical volume. lvcreate -L +99.9GB -n lvhome vghome
6. Format the lv by mkfs.ext3 /dev/vghome/lvhome (you can use ext2 or ext4 whatever you like)
7. Mount it to /home and copy back the data.

Important Note:: Make sure that you have full file system back on this system. Performing partition operation is always risky so be sure that you have good file system backup of the whole system. I am not suggesting to use full 100 GB in lvcreate command just to make sure that we do not overwrite any existing partition boundries.
 
1 members found this post helpful.
Old 04-27-2011, 06:11 PM   #7
Jordan Miguel
LQ Newbie
 
Registered: Apr 2011
Distribution: CentOS
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by T3RM1NVT0R View Post
Alright I got a better picture now.

Both /dev/vdc1 and /dev/vdf2 are linux partitions and not linux lvm

Only way that I am aware of to achieve what you are thinking is to move data from /home3 to some other location and then perform the following:

1. Change the partition type of vdc1 to linux lvm
2. Change the partition type of vdf2 to linux lvm
3. Create physical volumes corresponding both linux lvm partitions. pvcreate /dev/vdc1, pvcreate /dev/vdf2
4. Add these volumes to a group say vghome. vgcreate vghome /dev/vdc1 /dev/vdf2
5. Create a single logical volume. lvcreate -L +99.9GB -n lvhome vghome
6. Format the lv by mkfs.ext3 /dev/vghome/lvhome (you can use ext2 or ext4 whatever you like)
7. Mount it to /home and copy back the data.

Important Note:: Make sure that you have full file system back on this system. Performing partition operation is always risky so be sure that you have good file system backup of the whole system. I am not suggesting to use full 100 GB in lvcreate command just to make sure that we do not overwrite any existing partition boundries.
I understand! Thank you for the help..

One simple doubt.. I could have multiple homes( home home2 home3 home4 home5 ), without having problems? Because this is a cloud system, then, I need to add more resources when necessary.(I'm using cPanel on this server).
 
Old 04-27-2011, 06:34 PM   #8
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

You're welcome.

Well you can have multiple home volumes but remember you can have only 4 primary partitions on a drive.

Also from my personal experience I will say as long as you have a data which is less than 1 TB you can have it on a single partition. If more than that then create a separate partition for it otherwise it will create problem during maintenance.

In addition to the above point I will say it is a good practice that you should not expand lv frequently because every time you expand you are adding up a partition to it (I consider it as a point of failure). For example I have a home volume which I have expanded over 4 partition and if any of the partition will fail and I have not configured RAID then I am gone. Ofcourse you can restore from backup or rebuild the array if you have configured RAID but it is an overhead. Also I have seen issues with missing superblock when many partitions are involved.

If I am not wrong cPanel is a backup software which is used to backup the data of server/servers on to a centralized backup server. I have read about it in some LQ thread only.
 
Old 04-27-2011, 07:46 PM   #9
Jordan Miguel
LQ Newbie
 
Registered: Apr 2011
Distribution: CentOS
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by T3RM1NVT0R View Post
You're welcome.

Well you can have multiple home volumes but remember you can have only 4 primary partitions on a drive.

Also from my personal experience I will say as long as you have a data which is less than 1 TB you can have it on a single partition. If more than that then create a separate partition for it otherwise it will create problem during maintenance.

In addition to the above point I will say it is a good practice that you should not expand lv frequently because every time you expand you are adding up a partition to it (I consider it as a point of failure). For example I have a home volume which I have expanded over 4 partition and if any of the partition will fail and I have not configured RAID then I am gone. Ofcourse you can restore from backup or rebuild the array if you have configured RAID but it is an overhead. Also I have seen issues with missing superblock when many partitions are involved.

If I am not wrong cPanel is a backup software which is used to backup the data of server/servers on to a centralized backup server. I have read about it in some LQ thread only.
Perfect!! Thank you for all T3RM1NVT0R!

cPanel is a panel for webserver managing, as the plesk!
 
Old 04-27-2011, 07:51 PM   #10
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

You're welcome Jordan.

Ooops!! Totally missed on cPanel :-(
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Extend a partition musiqdefunk Linux - Newbie 7 03-25-2011 02:12 PM
How to Extend Boot Partition mselvaprakash Linux - Server 5 10-19-2010 06:21 PM
How to extend partition of a device stmas Linux - Virtualization and Cloud 14 09-27-2010 12:04 PM
how to extend linux partition? hariharan.83 Linux - Newbie 3 05-05-2009 11:58 AM
how to extend partition? Sushy *BSD 2 01-25-2007 12:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:23 AM.

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