Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 Reduce/Resize LVM, Centos 7

views
     
TSUbuntuClient
post May 6 2016, 11:13 AM, updated 8y ago

Regular
******
Senior Member
1,349 posts

Joined: Jun 2007
From: /puchong/cyberjaya/klang



Hi,

I try to reduce /home partition to make new partition. So i decide to reduce it size. But getting error. Need sifu help:
CODE
[root@master ~]# e2fsck -b 8193 /dev/centos_master/home
e2fsck 1.42.9 (28-Dec-2013)
e2fsck: Bad magic number in super-block while trying to open /dev/centos_master02/home

The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
   e2fsck -b 8193 <device>

[root@master ~]# resize2fs /dev/centos_master/home 722G
resize2fs 1.42.9 (28-Dec-2013)
resize2fs: Bad magic number in super-block while trying to open /dev/centos_master/home
Couldn't find valid filesystem superblock.
[root@master ~]# cat /proc/mdstat
Personalities : [raid1]
md126 : active raid1 sdb1[1] sda1[0]
     410560 blocks super 1.0 [2/2] [UU]
     bitmap: 0/1 pages [0KB], 65536KB chunk

md127 : active raid1 sdb2[1] sda2[0]
     976219136 blocks super 1.2 [2/2] [UU]
     bitmap: 1/8 pages [4KB], 65536KB chunk

unused devices: <none>


Some advice needed.

Thanks.

Filesystem type: XFS

This post has been edited by UbuntuClient: May 6 2016, 11:17 AM
MISMan
post May 6 2016, 11:26 AM

On my way
****
Senior Member
691 posts

Joined: Apr 2009
From: KL


use aomei partition s/w, damn gud.

TSUbuntuClient
post May 6 2016, 11:30 AM

Regular
******
Senior Member
1,349 posts

Joined: Jun 2007
From: /puchong/cyberjaya/klang



Is there any other way not use gui? Server located at France.
abubin
post May 6 2016, 12:01 PM

10k Club
********
All Stars
10,423 posts

Joined: Jan 2003



QUOTE(MISMan @ May 6 2016, 11:26 AM)
use aomei partition s/w, damn gud.
*
this software does not even support linux and file type is XFS. WTF?

This post has been edited by abubin: May 6 2016, 12:01 PM
wKkaY
post May 6 2016, 12:12 PM

misutā supākoru
Group Icon
VIP
6,008 posts

Joined: Jan 2003
QUOTE(UbuntuClient @ May 6 2016, 02:13 PM)
Filesystem type: XFS
*
Use the XFS tools, not ext tools.
TSUbuntuClient
post May 6 2016, 12:20 PM

Regular
******
Senior Member
1,349 posts

Joined: Jun 2007
From: /puchong/cyberjaya/klang



I manage to reduce it. Need to remove logical and recreate.
TruboXL
post May 6 2016, 12:53 PM

Over 900 useless posts
*****
Junior Member
984 posts

Joined: Jan 2016


QUOTE(UbuntuClient @ May 6 2016, 12:20 PM)
I manage to reduce it. Need to remove logical and recreate.
*
explain in detail please... notworthy.gif
I don't remember XFS can be shrunk except delete partition and then make a smaller one...
TSUbuntuClient
post May 6 2016, 12:58 PM

Regular
******
Senior Member
1,349 posts

Joined: Jun 2007
From: /puchong/cyberjaya/klang



QUOTE(TruboXL @ May 6 2016, 12:53 PM)
explain in detail please... notworthy.gif
I don't remember XFS can be shrunk except delete partition and then make a smaller one...
*
That exactly what i do. Delete, make smaller, format with xfs and mount it back.
TSUbuntuClient
post Jun 28 2016, 04:58 PM

Regular
******
Senior Member
1,349 posts

Joined: Jun 2007
From: /puchong/cyberjaya/klang



How to add space in volume group (/dev/vda4)? doh.gif doh.gif
CODE
[root@ceph-1 ~]# fdisk -l

Disk /dev/vda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 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        1044     8281507+  8e  Linux LVM
/dev/vda4            1045        1305     2096482+   5  Extended
[root@ceph-1 ~]# pvscan
 PV /dev/vda2   VG VolGroup00   lvm2 [7.88 GB / 0    free]
 Total: 1 [7.88 GB] / in use: 1 [7.88 GB] / in no VG: 0 [0   ]
[root@ceph-1 ~]# pvcreate /dev/vda4
 Device /dev/vda4 not found (or ignored by filtering).
[root@ceph-1 ~]#

#DevilJason
post Jun 29 2016, 12:32 PM

New Member
*
Junior Member
11 posts

Joined: Apr 2007
From: Cheras, KL


QUOTE(UbuntuClient @ Jun 28 2016, 04:58 PM)
How to add space in volume group (/dev/vda4)?  doh.gif  doh.gif
CODE
[root@ceph-1 ~]# fdisk -l

Disk /dev/vda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 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        1044     8281507+  8e  Linux LVM
/dev/vda4            1045        1305     2096482+   5  Extended
[root@ceph-1 ~]# pvscan
 PV /dev/vda2   VG VolGroup00   lvm2 [7.88 GB / 0    free]
 Total: 1 [7.88 GB] / in use: 1 [7.88 GB] / in no VG: 0 [0   ]
[root@ceph-1 ~]# pvcreate /dev/vda4
 Device /dev/vda4 not found (or ignored by filtering).
[root@ceph-1 ~]#

*
Try fdisk /dev/vda, then "n" create new extended partition 1st, then only pvcreate.
TSUbuntuClient
post Jun 29 2016, 01:13 PM

Regular
******
Senior Member
1,349 posts

Joined: Jun 2007
From: /puchong/cyberjaya/klang



extended already made. Same error.
#DevilJason
post Jun 30 2016, 03:14 PM

New Member
*
Junior Member
11 posts

Joined: Apr 2007
From: Cheras, KL


QUOTE(UbuntuClient @ Jun 29 2016, 01:13 PM)
extended already made. Same error.
*
I mean after create extended, have u create new partition from the extended.

ie

Attached Image

something like this, the new partition will start form the extended size.
TSUbuntuClient
post Jun 30 2016, 03:17 PM

Regular
******
Senior Member
1,349 posts

Joined: Jun 2007
From: /puchong/cyberjaya/klang



/dev/vda4 is extended partition that i created.
bofhZ
post Jul 30 2016, 09:25 PM

New Member
*
Junior Member
11 posts

Joined: May 2013
did u do lvreduce before attempting to resize the superblock?

 

Change to:
| Lo-Fi Version
0.0160sec    0.49    6 queries    GZIP Disabled
Time is now: 29th March 2024 - 08:58 AM