LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices

Reply
 
Search this Thread
Old 10-15-2013, 05:27 AM   #1
keith.turley
LQ Newbie
 
Registered: Oct 2013
Posts: 4

Rep: Reputation: Disabled
Unable to resize file system after adding new physical volume


Hi,

I am new to linux so please bare with me although I think this should be relatively straight forward.....

I have done a basic server install of Oracle Linux 6 update 4. I am doing this on VWare. I have installed the basic server with a 20gig drive and now want to add a new drive for my software of 200gig.

I have added the physcial drive via VMWare, added the primary partion, extended the volume group and extended the volume. I am having a problem however when it comes to telling the file system to use the available space.

Here is my outputs


pvdisplay

--- Physical volume ---
PV Name /dev/sda2
VG Name vg_kmtredhatuek
PV Size 19.51 GiB / not usable 3.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 4994
Free PE 0
Allocated PE 4994
PV UUID 2QjxZQ-xv5u-eSLS-SExR-x9IN-4zk9-mnm937

--- Physical volume ---
PV Name /dev/sdb3
VG Name vg_kmtredhatuek
PV Size 200.00 GiB / not usable 1.34 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 51199
Free PE 0
Allocated PE 51199
PV UUID In4t9m-mdKr-Kqp3-Bni0-v5S1-147H-bPIg9a

as you can see my new pv is sdb3 and has 200gig

vgdisplay

VG Name vg_kmtredhatuek
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 5
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 2
Act PV 2
VG Size 219.50 GiB
PE Size 4.00 MiB
Total PE 56193
Alloc PE / Size 56193 / 219.50 GiB
Free PE / Size 0 / 0
VG UUID nkwRvl-0mc8-gisl-B1YL-mg72-DMeI-mx9kaq

my volume group recognises the new 200gig plus the existing 20

lvdisplay
--- Logical volume ---
LV Path /dev/vg_kmtredhatuek/lv_root
LV Name lv_root
VG Name vg_kmtredhatuek
LV UUID mBhxnY-QhYW-0mpD-MMPR-4FOi-QcBU-oJHp14
LV Write Access read/write
LV Creation host, time kmt-redhatuek, 2013-10-01 11:15:44 +0100
LV Status available
# open 1
LV Size 215.54 GiB
Current LE 55177
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:0

--- Logical volume ---
LV Path /dev/vg_kmtredhatuek/lv_swap
LV Name lv_swap
VG Name vg_kmtredhatuek
LV UUID cgtBu0-cwT0-IcXi-8kSV-nQ4Q-43pW-LyWCLa
LV Write Access read/write
LV Creation host, time kmt-redhatuek, 2013-10-01 11:15:44 +0100
LV Status available
# open 2
LV Size 3.97 GiB
Current LE 1016
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:1

lv display shows that I have extended /dev/vg_kmtredhatuek/lv_root to use the extra space and sits at 215gig

Now from the multiple guides and forums I have read my understanding is now all i need to do is extend my file system to use the space.

here is my df output

df -h

f -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_kmtredhatuek-lv_root
16G 4.6G 9.6G 33% /
tmpfs 1012M 100K 1011M 1% /dev/shm
/dev/sda1 485M 52M 408M 12% /boot
.host:/ 465G 171G 295G 37% /mnt/hgfs


When I try to resize I get this

resize2fs /dev/mapper/vg_kmtredhatuek-lv_root

resize2fs 1.41.12 (17-May-2010)
resize2fs: Device or resource busy while trying to open /dev/mapper/vg_kmtredhatuek-lv_root
Couldn't find valid filesystem superblock.

I have no idea how to fix this. I am guessing this is something to do with a missing super block file somewhere??? No idea why tho.

if i do a dump2fs i get this......

dumpe2fs /dev/sdb3 | grep -i superblock

dumpe2fs 1.41.12 (17-May-2010)
dumpe2fs: Bad magic number in super-block while trying to open /dev/sdb3
Couldn't find valid filesystem superblock.

can anyone help with this? I have tried this process from scratch twice now, previously i tried increasing the size of the existing volume this time I added a new disk and got the same problem both times.

Ay help would be much appreciated.....

Thanks

Keith
 
Old 10-15-2013, 06:02 AM   #2
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,436
Blog Entries: 11

Rep: Reputation: 181Reputation: 181
Quote:
Originally Posted by keith.turley View Post
When I try to resize I get this

resize2fs /dev/mapper/vg_kmtredhatuek-lv_root

resize2fs 1.41.12 (17-May-2010)
resize2fs: Device or resource busy while trying to open /dev/mapper/vg_kmtredhatuek-lv_root
Couldn't find valid filesystem superblock.
Why it did not find a valid superblock is beyond me knowledge but it sures not normal behaviour. You might want to run
Code:
fsck /dev/mapper/vg_mk...-lv_root.
and see if it gives you any errors.
What type of filesystem are on the vl? With ext3/4 you should be able to resize the partition while its mounted. Maybe the savest way would be to boot with a live cd and then resize the fs.
All in all you are doing the right thing we just have to solve the super block failure.

Quote:
Originally Posted by keith.turley View Post
dumpe2fs /dev/sdb3 | grep -i superblock

dumpe2fs 1.41.12 (17-May-2010)
dumpe2fs: Bad magic number in super-block while trying to open /dev/sdb3
Couldn't find valid filesystem superblock.
When using lvm dont access the drivers on a physical level but only on their lvm part. Like /dev/mapper/vg_mk..-lv-root. I'd say that as the resize2fs did not work out you don't have a filesystem on /dev/sdb3.
 
Old 10-15-2013, 07:06 AM   #3
keith.turley
LQ Newbie
 
Registered: Oct 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
ok so interesting question on the file system type - I see you logic here.

Its Oracle linux which runs a btrfs file system - you can see that below on /

df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/mapper/vg_kmtredhatuek-lv_root
btrfs 16293888 5633220 9099044 39% /
tmpfs tmpfs 1035276 112 1035164 1% /dev/shm
/dev/sda1 ext4 495844 52952 417292 12% /boot
.host:/ vmhgfs 487546976 179763624 307783352 37% /mnt/hgfs

I have been googling and found there is a utility to resize btrfs file systems - will look into that in a bit more detail. Im not sure I understand the above outputs indicating different files systems.
 
Old 10-15-2013, 07:31 AM   #4
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,436
Blog Entries: 11

Rep: Reputation: 181Reputation: 181
If its a brtfs filesystem the ext utilities will not work.

You can also use the mount command to see which filesystem you have. Or use file -s /dev/mapper/vg-....

Words in bold are commands you can run from a shell.

Last edited by zhjim; 10-15-2013 at 07:36 AM.
 
Old 10-15-2013, 07:46 AM   #5
keith.turley
LQ Newbie
 
Registered: Oct 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
thanks zhjim

this seemed to work

sudo btrfs filesystem resize max /

df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_kmtredhatuek-lv_root
216G 5.4G 202G 3% /
tmpfs 1012M 112K 1011M 1% /dev/shm
/dev/sda1 485M 52M 408M 12% /boot
.host:/ 465G 172G 294G 37% /mnt/hgfs

You put me onto the file system stuff...cheers!
 
Old 10-15-2013, 09:26 AM   #6
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,436
Blog Entries: 11

Rep: Reputation: 181Reputation: 181
Your are welcome. Please mark the thread solved. Use the thread tools at the top of the page for this.
 
Old 10-15-2013, 09:45 AM   #7
keith.turley
LQ Newbie
 
Registered: Oct 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
done. thanks again zhjim
 
Old 10-23-2013, 02:17 AM   #8
voleg
Member
 
Registered: Oct 2013
Distribution: RedHat
Posts: 145

Rep: Reputation: 5
btrfs as / ....
Very brave man.

Had a lot of problem with this FS in past. Probably all of them already fixed, but never salt an open wounds.

ext (even 4) is solid and proven FS.
For example SuSE use reiserfs for / for years and happy with it,
but once I've put valuable data on it, and resized number of times to make room,
my data was lost (files remains, but not readable).
 
  


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
Resize Exended Partition with logical volume and ext4 file system joloboff Linux - Laptop and Netbook 2 03-18-2013 08:03 PM
[SOLVED] Cannot resize VirtualBox .vdi file when created from physical disk Vanyel Linux - Virtualization and Cloud 1 02-16-2013 10:53 PM
[SOLVED] mdadm: unable to resize volume LBM Linux - Software 8 03-25-2012 04:56 AM
Fedora LVM volume group & Physical Volume resize problem gabeyg Fedora 1 05-14-2008 11:26 AM
Ext3 File-system down after adding LVM physical device JZL240I-U Linux - Software 2 11-21-2005 06:46 AM


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