LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-17-2012, 04:53 PM   #1
mhouston100
Member
 
Registered: Jun 2010
Posts: 32

Rep: Reputation: 16
Extend VM HDD with LVM - wrong format?


Hi guys, we are currently running a RHEL 5.5 server on as an ESX client. The 'drives' are set up using LVM.

I'm in the process of documenting the procedure for expanding the disks (instead of adding additional disks). The process seems to work fine except randomly it will fail on boot, the error being that the superblock is bad.

What it looks like is that there may be some confusion as to what type of partition is created when using fdisk. fstab mounts the partition as EXT3, but the superblock error describes it as EXT2. The disk is currently a single PV and LV which is why we are trying to expand rather than add extra disks.

After the process and reboot it will display the error:

Code:
fsck.ext3: No file or directory while trying to open /dev/ProntoLVM4/lv_backup
Then furthur:

Code:
The superblock could not be read or does not describe a correct ext2 filesystem.
The process I am following is (I'm using the GUI as these are non-Linux guys):

1. Shutdown server
2. Increase disk size through vSphere client
3. Start Pronto server
4. Log in as root
5. Start terminal session
6. fdisk /dev/sdd - fdisk on backup disk
7. ‘p’ – list partitions, confirm size is correct and only one partition
8. ‘d’ – delete partition, will automatically delete if only 1 partition
9. ‘n’ – new partition
10. ‘p’ – primary partition
11. ‘1’ – partition number 1
12. Press enter for first and last cylinder, to set default (which is the maximum size)
13. ‘w’ – write partition table
14. Restart server
15. Log in as root
16. Start terminal session
17. pvresize /dev/sdd1 – will fill partition with LVM physical volume
18. Load Logical Volume Manager in GUI (Start -> Administration -> Logical Volume Management)
19. Expand ProntoLVM4
20. Expand ProntoLVM4 logical view
21. Select lv_backup
22. Select ‘Edit Properties’
23. Click ‘Use Remaining’
24. Click OK

What is strange is that 3 out of 4 times this process will work flawlessly, then the 4th time it will result in the error! I'm kind of fumbling through this process as it was working perfectly for months and then now all of a sudden it doesn't work.

As always, thanks for your help!
 
Old 04-17-2012, 07:24 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by mhouston100 View Post
What it looks like is that there may be some confusion as to what type of partition is created when using fdisk. fstab mounts the partition as EXT3, but the superblock error describes it as EXT2.
fdisk doesn't create filesystems, just partitions. The tools use "ext2" generically to describe the entire ext[234] family - normal and (to Ted Ts'o at least) logical. Nothing to worry about.
Quote:
What is strange is that 3 out of 4 times this process will work flawlessly, then the 4th time it will result in the error! I'm kind of fumbling through this process as it was working perfectly for months and then now all of a sudden it doesn't work.
The superblock error would seem to indicate an alignment error in the partition re-allocation. Don't forget it's all just a virtualized slab of disk space to ESX.
I'd reckon you'd be better off adding the new disk as a pv to the vg then do the expansion of the lv/filesystem. Less prospect of error. Same effect - LVM just sees the vg as one big "disk".
 
Old 04-17-2012, 07:55 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
As an aside, if you go with the second disk, there is no need to partition it - use the entire (new) "disk" as a pv. Maybe you could then do the entire process from the GUI. Dunno, never use it.
 
Old 04-17-2012, 08:32 PM   #4
mhouston100
Member
 
Registered: Jun 2010
Posts: 32

Original Poster
Rep: Reputation: 16
Thanks for the response.

In my mind the way to go was to always to add new disks to the group and extend the LV etc but the powers that be are stuck in this mindset that it's 'messy' on the VM side. I had been doing a bit more research this morning and came across the same information as your post regarding the ext2 error so I guess I was off on that, I even tried manually setting the partition type to 8e 'Linux LVM' during the fdisk step but same error.

I've just been able to replicate the problem with a clone of the VM from last night prior to the change.

In the end I think that the best practice will be to just add another disk to the VM! I think for the untrained guys to follow the procedure it will be easier in the long run with less hassles, and you can do the whole process through the GUI by initialising the disk.

Just for my own knowledge - Is there a specific log file I can look at to get more info regarding the problem? If I tack 'fastboot' onto the boot parameters I can get into the system while the partition is still broken so I wouldn't mind finding out what was causing it, even if it wont officially help us.
 
Old 04-18-2012, 06:11 PM   #5
mhouston100
Member
 
Registered: Jun 2010
Posts: 32

Original Poster
Rep: Reputation: 16
Well for anyone that is interested, we have decided to go down the route of extending the drive but creating a new partition (as opposed to extending the current partition). This allows us to do it on the fly while the system is live, but has a limit of 4 partitions on each drive, so once that is reached we need to add another drive.

The basic procedure is :

1. Shutdown server
2. Increase disk size through vSphere client
3. Start Pronto server
4. Log in as root
5. Start terminal session
6. fdisk /dev/sdd - fdisk on backup disk
7. ‘p’ – list partitions, confirm size is correct and only one partition
8. ‘n’ – new partition
9. ‘p’ – primary partition
10. ‘1’ – partition number 1
11. Press enter for first and last cylinder, to set default (which is the maximum size)
12. ‘w’ – write partition table
13. partprobe - to pick up new partition
12. Start LVM gui and initialise space, add to PV and then grow LV.

Thanks for your help syg00
 
  


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
Need to extend previous LVM drive manishrmusale Linux - Server 1 12-26-2011 07:32 AM
[SOLVED] not able to extend a fs using lvm unix1adm Linux - General 9 04-21-2011 09:01 AM
Extend LVM partition rconan Linux - Software 5 08-31-2010 02:32 AM
extend crypted lvm volume imitis Linux - General 4 06-12-2010 06:55 AM
LVM extend size bravored Linux - General 7 01-21-2009 01:13 PM

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

All times are GMT -5. The time now is 02:19 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