LinuxQuestions.org
Help answer threads with 0 replies.
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 02-13-2019, 10:52 AM   #1
ramseyrt
LQ Newbie
 
Registered: May 2010
Location: Florida
Distribution: Gallium
Posts: 15

Rep: Reputation: Disabled
Unhappy Missing file systems after resizing LVM2 partition


Hello,

While attempting to copy the contents of a 4TB HD to a 500GB HD, I shrank my LVM2 partition and ended up with an unbootable drive. When booting, I get the following error, "dracut-initqueue[3733]: Warning: dracut-initqueue timeout - starting timeout scripts". This message scrolls down the screen to a counter stating that it will wait indefinitely. Anyway, the system never boots up.

To shrink the LVM2 partition, I booted the 4TB drive in a separate system as a secondary drive (primary drive running 7.4). The LVM2 partition contains the /root, swap, and /home partitions. I had 3.6TB allocated to /home, which only had 50Mb of data, so I decided to shrink it to 5Gb. I used tar to backup /home and then umounted all the LVM filesystems. I then used "lvreduce -L 5G /dev/cl/home" to resize the filesystem. Of course, the XFS filesystem in /home was now broken so I remade the filesystem using "mkfs.xfs /dev/cl/home". With that done, I mounted the filesystem and then untared the user files back into /home. Everything looked great. I must have missed something though because the drive won't boot now. Here's a multitude of outputs run from the rescue disk:

Code:
sh-4.2# fdisk -l
Disk /dev/sda: 4000.8 GB, 4000787030016 bytes, 7814037168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: gpt
Disk identifier: C54FE656-4A8B-4DC2-9B89-5C289F53A787


#         Start          End    Size  Type            Name
 1         2048       411647    200M  Microsoft basic 
 2       411648       821247    200M  EFI System      EFI System Partition
 3       821248      2918399      1G  Microsoft basic 
 4      2918400    221630463  104.3G  Linux LVM       

Disk /dev/loop0: 347 MB, 347414528 bytes, 678544 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop1: 2147 MB, 2147483648 bytes, 4194304 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop2: 536 MB, 536870912 bytes, 1048576 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/live-rw: 2147 MB, 2147483648 bytes, 4194304 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/live-base: 2147 MB, 2147483648 bytes, 4194304 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Code:
sh-4.2# ssm list
------------------------------------------------------------
Device           Free     Used      Total  Pool  Mount point
------------------------------------------------------------
/dev/loop0                      331.32 MB                   
/dev/loop1                        2.00 GB                   
/dev/loop2                      512.00 MB                   
/dev/sda                          3.64 TB        PARTITIONED
/dev/sda1                       200.00 MB                   
/dev/sda2                       200.00 MB                   
/dev/sda3                         1.00 GB                   
/dev/sda4   104.29 GB  0.00 KB  104.29 GB  cl               
------------------------------------------------------------
--------------------------------------------------
Pool  Type  Devices       Free     Used      Total  
--------------------------------------------------
cl    lvm   1        104.29 GB  0.00 KB  104.29 GB  
--------------------------------------------------
--------------------------------------------------------------
Volume      Volume size  FS           FS size       Free  Type  
--------------------------------------------------------------
/dev/loop0    331.32 MB  squashfs                               
/dev/loop1      2.00 GB  ext4         2.00 GB  898.83 MB        
/dev/sda2     200.00 MB  vfat                             part  
/dev/sda3       1.00 GB  xfs       1014.00 MB  693.05 MB  part  
--------------------------------------------------------------
Code:
sh-4.2# vgs
  VG #PV #LV #SN Attr   VSize    VFree   
  cl   1   0   0 wz--n- <104.29g <104.29g
Code:
sh-4.2# pvs
  PV         VG Fmt  Attr PSize    PFree   
  /dev/sda4  cl lvm2 a--  <104.29g <104.29g
Code:
sh-4.2# lvs  -o vg_name,lv_name
Code:
sh-4.2# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda4
  VG Name               cl
  PV Size               104.29 GiB / not usable 1.00 MiB
  Allocatable           yes 
  PE Size               4.00 MiB
  Total PE              26698
  Free PE               26698
  Allocated PE          0
  PV UUID               g2gCIt-9bBo-CRjR-0wgQ-MhP0-Gc0N-y6FG1n
Code:
sh-4.2# vgdisplay
  --- Volume group ---
  VG Name               cl
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  9
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                0
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               <104.29 GiB
  PE Size               4.00 MiB
  Total PE              26698
  Alloc PE / Size       0 / 0   
  Free  PE / Size       26698 / <104.29 GiB
  VG UUID               NEbYUz-9GdP-Y1lx-k5ou-Gyhg-HF1l-VdqF9F
Code:
sh-4.2# lvdisplay
Code:
sh-4.2# dd if=/dev/sda4 bs=512 count=24 | strings

LABELONE
LVM2 001g2gCIt9bBoCRjR0wgQMhP0Gc0Ny6FG1n
 LVM2 x[5A%r0N*>
cl {
id = "NEbYUz-9GdP-Y1lx-k5ou-Gyhg-HF1l-VdqF9F"
seqno = 1
format = "lvm2"
status = ["RESIZEABLE", "READ", "WRITE"]
flags = []
extent_size = 8192
max_lv = 0
max_pv = 0
metadata_copies = 0
physical_volumes {
pv0 {
id = "g2gCIt-9bBo-CRjR-0wgQ-MhP0-Gc0N-y6FG1n"
device = "/dev/sda4"
status = ["ALLOCATABLE"]
flags = []
dev_size = 7811117056
pe_start = 2048
pe_count = 953505
# Generated by LVM2 version 2.02.166(2)-RHEL7 (2016-09-28): Tue Aug 14 15:42:46 2018
contents = "Text Format Volume Group"
version = 1
description = ""
creation_host = "localhost.localdomain"	# Linux localhost.localdomain 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64
creation_time = 1534261366	# Tue Aug 14 15:42:46 2018
cl {
id = "NEbYUz-9GdP-Y1lx-k5ou-Gyhg-HF1l-VdqF9F"
seqno = 2
format = "lvm2"
status = ["RESIZEABLE", "READ", "WRITE"]
flags = []
extent_size = 8192
max_lv = 0
max_pv = 0
metadata_copies = 0
physical_volumes {
pv0 {
id = "g2gCIt-9bBo-CRjR-0wgQ-MhP0-Gc0N-y6FG1n"
device = "/dev/sda4"
status = ["ALLOCATABLE"]
flags = []
dev_size = 7811117056
pe_start = 2048
pe_count = 953505
logical_volumes {
root {
id = "li0jF4-glAQ-5u0I-ysPq-wgi1-KpNY-6gBhrr"
status = ["READ", "WRITE", "VISIBLE"]
flags = []
creation_time = 1534261366
creation_host = "localhost.localdomain"
segment_count = 1
segment1 {
start_extent = 0
extent_count = 12800
type = "striped"
stripe_count = 1
stripes = [
"pv0", 0
# Generated by LVM2 version 2.02.166(2)-RHEL7 (2016-09-28): Tue Aug 14 15:42:46 2018
contents = "Text Format Volume Group"
version = 1
description = ""
creation_host = "localhost.localdomain"	# Linux localhost.localdomain 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64
creation_time = 1534261366	# Tue Aug 14 15:42:46 2018
cl {
id = "NEbYUz-9GdP-Y1lx-k5ou-Gyhg-HF1l-VdqF9F"
seqno = 3
format = "lvm2"
status = ["RESIZEABLE", "READ", "WRITE"]
flags = []
extent_size = 8192
max_lv = 0
max_pv = 0
metadata_copies = 0
physical_volumes {
pv0 {
id = "g2gCIt-9bBo-CRjR-0wgQ-MhP0-Gc0N-y6FG1n"
device = "/dev/sda4"
status = ["ALLOCATABLE"]
flags = []
dev_size = 7811117056
pe_start = 2048
pe_count = 953505
logical_volumes {
root {
id = "li0jF4-glAQ-5u0I-ysPq-wgi1-KpNY-6gBhrr"
status = ["READ", "WRITE", "VISIBLE"]
flags = []
creation_time = 1534261366
creation_host = "localhost.localdomain"
segment_count = 1
segment1 {
start_extent = 0
extent_count = 12800
type = "striped"
stripe_count = 1
stripes = [
"pv0", 0
home {
id = "ldzoHy-yiLb-4QD7-Bsug-IAuC-seO1-t9ojej"
status = ["READ", "WRITE", "VISIBLE"]
flags = []
creation_time = 1534261368
creation_host = "localhost.localdomain"
segment_count = 1
segment1 {
start_extent = 0
extent_count = 939681
type = "striped"
stripe_count = 1
stripes = [
"pv0", 12800
# Generated by LVM2 version 2.02.166(2)-RHEL7 (2016-09-28): Tue Aug 14 15:42:48 2018
contents = "Text Format Volume Group"
version = 1
description = ""
creation_host = "localhost.localdomain"	# Linux localhost.localdomain 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64
creation_time = 1534261368	# Tue Aug 14 15:42:48 2018
cl {
id = "NEbYUz-9GdP-Y1lx-k5ou-Gyhg-HF1l-VdqF9F"
seqno = 4
format = "lvm2"
status = ["RESIZEABLE", "READ", "WRITE"]
flags = []
extent_size = 8192
max_lv = 0
max_pv = 0
metadata_copies = 0
physical_volumes {
pv0 {
id = "g2gCIt-9bBo-CRjR-0wgQ-MhP0-Gc0N-y6FG1n"
device = "/dev/sda4"
status = ["ALLOCATABLE"]
flags = []
dev_size = 7811117056
pe_start = 2048
pe_count = 953505
logical_volumes {
root {
id = "li0jF4-glAQ-5u0I-ysPq-wgi1-KpNY-6gBhrr"
status = ["READ", "WRITE", "VISIBLE"]
flags = []
creation_time = 1534261366
creation_host = "localhost.localdomain"
segment_count = 1
segment1 {
start_extent = 0
extent_count = 12800
type = "striped"
stripe_count = 1
stripes = [
"pv0", 0
home {
id = "ldzoHy-yiLb-4QD7-Bsug-IAuC-seO1-t9ojej"
status = ["READ", "WRITE", "VISIBLE"]
flags = []
creation_time = 1534261368
creation_host = "localhost.localdomain"
segment_count = 1
segment1 {
start_extent = 0
extent_count = 939681
type = "striped"
stripe_count = 1
stripes = [
"pv0", 12800
swap {
id = "ZgayP3-QsBy-gScj-RdSJ-obqo-5WqQ-EgnlE4"
status = ["READ", "WRITE", "VISIBLE"]
flags = []
creation_time = 1534261381
creation_host = "localhost.localdomain"
segment_count = 1
segment1 {
start_extent = 0
extent_count = 1024
type = "striped"
stripe_count = 1
stripes = [
"pv0", 952481
# Generated by LVM2 version 2.02.166(2)-RHEL7 (2016-09-28): Tue Aug 14 15:43:01 2018
contents = "Text Format Volume Group"
version = 1
description = ""
creation_host = "localhost.localdomain"	# Linux localhost.localdomain 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64
creation_time = 1534261381	# Tue Aug 14 15:43:01 2018
cl {
id = "NEbYUz-9GdP-Y1lx-k5ou-Gyhg-HF1l-VdqF9F"
seqno = 5
format = "lvm2"
status = ["RESIZEABLE", "READ", "WRITE"]
flags = []
extent_size = 8192
max_lv = 0
max_pv = 0
metadata_copies = 0
physical_volumes {
pv0 {
id = "g2gCIt-9bBo-CRjR-0wgQ-MhP0-Gc0N-y6FG1n"
device = "/dev/sda4"
status = ["ALLOCATABLE"]
flags = []
dev_size = 7811117056
pe_start = 2048
pe_count = 953505
logical_volumes {
root {
id = "li0jF4-glAQ-5u0I-ysPq-wgi1-KpNY-6gBhrr"
status = ["READ", "WRITE", "VISIBLE"]
flags = []
creation_time = 1534261366
creation_host = "localhost.localdomain"
segment_count = 1
segment1 {
start_extent = 0
extent_count = 12800
type = "striped"
stripe_count = 1
stripes = [
"pv0", 0
home {
id = "ldzoHy-yiLb-4QD7-Bsug-IAuC-seO1-t9ojej"
status = ["READ", "WRITE", "VISIBLE"]
flags = []
creation_time = 1534261368
creation_host = "localhost.localdomain"
segment_count = 1
segment1 {
start_extent = 0
extent_count = 1280
type = "striped"
stripe_count = 1
stripes = [
"pv0", 12800
swap {
id = "ZgayP3-QsBy-gScj-RdSJ-obqo-5WqQ-EgnlE4"
status = ["READ", "WRITE", "VISIBLE"]
flags = []
creation_time = 1534261381
creation_host = "localhost.localdomain"
segment_count = 1
segment1 {
start_extent = 0
extent_count = 1024
type = "striped"
stripe_count = 1
stripes = [
"pv0", 952481
# Generated by LVM2 version 2.02.166(2)-RHEL7 (2016-11-16): Mon Feb 11 04:05:26 2019
contents = "Text Format Volume Group"
version = 1
description = ""
creation_host = "localhost.localdomain"	# Linux localhost.localdom
Thanks in advance for any help!

Rob
 
Old 02-13-2019, 05:34 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 18,482

Rep: Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657
You can not shrink a xfs file system. The only way to reduce its size would be to backup, resize partition/LV, format new file system and then restore.

Quote:
lvs -o vg_name,lv_name
Quote:
sh-4.2# vgdisplay
--- Volume group ---
VG Name cl
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 9
VG Access read/write
VG Status resizable
VG Size <104.29 GiB
PE Size 4.00 MiB
Total PE 26698
Alloc PE / Size 0 / 0
I'm not sure exactly what steps you used to shrink the LVM/PE/LVs or how you recreated the /home VG but from the output provided above it does not show any volume groups. Did you create a backup of the root LV? If so the easiest way to recover would be to reinstall to the smaller drive and restore your data.
 
Old 02-13-2019, 07:04 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 17,781

Rep: Reputation: 2820Reputation: 2820Reputation: 2820Reputation: 2820Reputation: 2820Reputation: 2820Reputation: 2820Reputation: 2820Reputation: 2820Reputation: 2820Reputation: 2820
Looks like the OP is ok with the XFS situation.
Quote:
... but from the output provided above it does not show any volume groups.
Make that "logical volumes" - the cl vg is found ok.
But no lv's is a worry - something was done we don't know about; the actions mentioned shouldn't have the effect of blowing away all the lvs.

Note my sigline.
 
Old 02-13-2019, 08:12 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 18,482

Rep: Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657
Oops... I meant logical volumes.
 
  


Reply

Tags
centos, lvm, lvm2


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
lvm2 to non lvm2 L1nuxn00b703 Red Hat 5 12-18-2013 04:32 PM
LVM2 special device missing after reboot rizhun Linux - Software 3 04-19-2011 06:00 AM
resizing PV does not work (lvm) after resizing partition deadeyes Red Hat 5 03-11-2011 11:19 AM
LVM2 - CentOS 4.4 - Online resizing grant-skywalker Linux - General 6 03-27-2007 10:58 PM
resizing lvm2 physical volume fakie_flip Linux - Software 3 08-07-2006 12:18 PM

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

All times are GMT -5. The time now is 07:09 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration