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 |
Quote:
Code:
fsck /dev/mapper/vg_mk...-lv_root. 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:
|
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. |
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. |
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! |
Your are welcome. Please mark the thread solved. Use the thread tools at the top of the page for this.
|
done. thanks again zhjim
|
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). |
All times are GMT -5. The time now is 01:19 AM. |