{"id":10688,"date":"2017-12-06T16:17:13","date_gmt":"2017-12-06T15:17:13","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/how-to-reduce-the-size-a-lvm-partition-formatted-with-xfs-filesystem-on-centos7\/"},"modified":"2017-12-06T16:17:13","modified_gmt":"2017-12-06T15:17:13","slug":"how-to-reduce-the-size-a-lvm-partition-formatted-with-xfs-filesystem-on-centos7","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/how-to-reduce-the-size-a-lvm-partition-formatted-with-xfs-filesystem-on-centos7\/","title":{"rendered":"How to reduce the size of an LVM partition formatted with xfs filesystem on CentOS7?"},"content":{"rendered":"<p>DISCLAIMER: I know it exists other solutions to do it<\/p>\n<p>Pre-requisites:<br \/>\n&#8211; a virtual machine (or not) with CentOS7 installed<br \/>\n&#8211; a free disk or partition<\/p>\n<p>I use a VBox machine and I added a 5GiB hard disk<\/p>\n<p>We list the disk and partition to check if our new hard is added.<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1; highlight: [8]\">[root@deploy ~]$ lsblk\nNAME                       MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT\nsda                          8:0    0   20G  0 disk\n\u251c\u2500sda1                       8:1    0    1G  0 part \/boot\n\u2514\u2500sda2                       8:2    0   19G  0 part\n  \u251c\u2500cl-root                253:0    0   21G  0 lvm  \/\n  \u2514\u2500cl-swap                253:1    0    2G  0 lvm  [SWAP]\nsdb                          8:16   0   10G  0 disk\n<\/pre>\n<p>Good, we can continue..<\/p>\n<p>Let&#8217;s partition the disk using fdisk<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">[root@deploy ~]$ fdisk \/dev\/sdb\nWelcome to fdisk (util-linux 2.23.2).\n\nChanges will remain in memory only, until you decide to write them.\nBe careful before using the write command.\n\nDevice does not contain a recognized partition table\nBuilding a new DOS disklabel with disk identifier 0x76a98fa2.\n\nCommand (m for help): n\n\n[root@deploy ~]$ fdisk \/dev\/sdb\nWelcome to fdisk (util-linux 2.23.2).\n\nChanges will remain in memory only, until you decide to write them.\nBe careful before using the write command.\n\nDevice does not contain a recognized partition table\nBuilding a new DOS disklabel with disk identifier 0x76a98fa2.\n\nCommand (m for help): n\nPartition type:\n   p   primary (0 primary, 0 extended, 4 free)\n   e   extended\nSelect (default p): p\nPartition number (1-4, default 1): 1\nFirst sector (2048-20971519, default 2048): \nUsing default value 2048\nLast sector, +sectors or +size{K,M,G} (2048-20971519, default 20971519): +5G\nPartition 1 of type Linux and of size 5 GiB is set\n\nCommand (m for help): w\nThe partition table has been altered!\n\nCalling ioctl() to re-read partition table.\nSyncing disks.\n<\/pre>\n<p>Now, we need to inform the kernel that the partition table has changed. To do that, either we reboot the server or we run partprobe<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">[root@deploy ~]$ partprobe \/dev\/sdb1\n[root@deploy ~]$\n<\/pre>\n<p>We create a physical volume<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">[root@deploy ~]$ pvcreate \/dev\/sdb1\nPhysical volume \"\/dev\/sdb1\" successfully created.\n<\/pre>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">[root@deploy ~]$ pvs\n  PV         VG Fmt  Attr PSize  PFree\n  \/dev\/sda2  cl lvm2 a--  19.00g       0\n  \/dev\/sdb1     lvm2 ---   5.00g    5.00g\n  \/dev\/sdc2  cl lvm2 a--   5.00g 1020.00m\n<\/pre>\n<p>We create a volume group<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">[root@deploy ~]$ vgcreate  vg_deploy \/dev\/sdb1\n  Volume group \"vg_deploy\" successfully created\n<\/pre>\n<p>We check that the volume group was created properly<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">[root@deploy ~]$ vgdisplay vg_deploy\n  --- Volume group ---\n  VG Name               vg_deploy\n  System ID\n  Format                lvm2\n  Metadata Areas        1\n  Metadata Sequence No  1\n  VG Access             read\/write\n  VG Status             resizable\n  MAX LV                0\n  Cur LV                0\n  Open LV               0\n  Max PV                0\n  Cur PV                1\n  Act PV                1\n  VG Size               5.00 GiB\n  PE Size               4.00 MiB\n  Total PE              1279\n  Alloc PE \/ Size       0 \/ 0\n  Free  PE \/ Size       1279 \/ 5.00 GiB\n  VG UUID               5ZhlvC-lpor-Ti8x-mS9P-bnxW-Gdtw-Gynocl\n<\/pre>\n<p>Here, I set the size of the logical volume with PE (Physical <a title=\"Extent\" href=\"https:\/\/en.wikipedia.org\/wiki\/Extent_(file_systems)\" target=\"_blank\" rel=\"noopener\">Extent<\/a>). One PE represents 4.00 MiB<\/p>\n<p>We create a logical volume on our volume group<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">[root@deploy ~]$ lvcreate -l 1000 -n lv_deploy vg_deploy\n  Logical volume \"lv_deploy\" created.\n<\/pre>\n<p>We have a look to check how our logical volume &#8220;lv_deploy&#8221; looks like<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">[root@deploy ~]$ lvdisplay \/dev\/vg_deploy\/lv_deploy\n  --- Logical volume ---\n  LV Path                \/dev\/vg_deploy\/lv_deploy\n  LV Name                lv_deploy\n  VG Name                vg_deploy\n  LV UUID                2vxcDv-AHfB-7c2x-1PM8-nbn3-38M5-c1QoNS\n  LV Write Access        read\/write\n  LV Creation host, time deploy.example.com, 2017-12-05 08:15:59 -0500\n  LV Status              available\n  # open                 0\n  LV Size                3.91 GiB\n  Current LE             1000\n  Segments               1\n  Allocation             inherit\n  Read ahead sectors     auto\n  - currently set to     8192\n  Block device           253:3\n<\/pre>\n<p>Let&#8217;s create our file system on the new logical volume<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">[root@deploy ~]$ mkfs.xfs  \/dev\/vg_deploy\/lv_deploy\nmeta-data=\/dev\/vg_deploy\/lv_deploy isize=512    agcount=4, agsize=256000 blks\n         =                       sectsz=512   attr=2, projid32bit=1\n         =                       crc=1        finobt=0, sparse=0\ndata     =                       bsize=4096   blocks=1024000, imaxpct=25\n         =                       sunit=0      swidth=0 blks\nnaming   =version 2              bsize=4096   ascii-ci=0 ftype=1\nlog      =internal log           bsize=4096   blocks=2560, version=2\n         =                       sectsz=512   sunit=0 blks, lazy-count=1\nrealtime =none                   extsz=4096   blocks=0, rtextents=0\n<\/pre>\n<p>We now create a new directory &#8220;mysqldata&#8221; for example<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">[root@deploy ~]$ mkdir \/mysqldata\n<\/pre>\n<p>We add the new entry for our new logical volume<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">[root@deploy ~]$ echo \"\/dev\/mapper\/vg_deploy-lv_deploy     \/mysqldata      xfs     defaults      0 0\" &gt;&gt; \/etc\/fstab\n<\/pre>\n<p>We mount it<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">[root@deploy ~]$ mount -a\n<\/pre>\n<p>We check the filesystem is mounted properly<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">[root@deploy ~]$ df -hT\nFilesystem                      Type      Size  Used Avail Use% Mounted on\n\/dev\/mapper\/cl-root             xfs        21G  8.7G   13G  42% \/\ndevtmpfs                        devtmpfs  910M     0  910M   0% \/dev\ntmpfs                           tmpfs     920M     0  920M   0% \/dev\/shm\ntmpfs                           tmpfs     920M  8.4M  912M   1% \/run\ntmpfs                           tmpfs     920M     0  920M   0% \/sys\/fs\/cgroup\n\/dev\/sda1                       xfs      1014M  227M  788M  23% \/boot\ntmpfs                           tmpfs     184M     0  184M   0% \/run\/user\/0\n\/dev\/loop2                      iso9660   4.3G  4.3G     0 100% \/media\/iso\n\/dev\/mapper\/vg_deploy-lv_deploy xfs       3.9G   33M  3.9G   1% \/mysqldata\n<\/pre>\n<p>We add some files to the \/mysqldata directory (a for loop will help us)<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">[root@deploy mysqldata]$ for i in 1 2 3 4 5; do dd if=\/dev\/zero  of=\/mysqldata\/file0$i bs=1024 count=10; done\n10+0 records in\n10+0 records out\n10240 bytes (10 kB) copied, 0.000282978 s, 36.2 MB\/s\n10+0 records in\n10+0 records out\n10240 bytes (10 kB) copied, 0.000202232 s, 50.6 MB\/s\n10+0 records in\n10+0 records out\n10240 bytes (10 kB) copied, 0.000255617 s, 40.1 MB\/s\n10+0 records in\n10+0 records out\n10240 bytes (10 kB) copied, 0.000195752 s, 52.3 MB\/s\n10+0 records in\n10+0 records out\n10240 bytes (10 kB) copied, 0.000183672 s, 55.8 MB\/s\n<\/pre>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">[root@deploy mysqldata]$ ls -l\ntotal 60\n-rw-r--r--. 1 root root 10240 Dec  5 08:28 file01\n-rw-r--r--. 1 root root 10240 Dec  5 08:28 file02\n-rw-r--r--. 1 root root 10240 Dec  5 08:28 file03\n-rw-r--r--. 1 root root 10240 Dec  5 08:28 file04\n-rw-r--r--. 1 root root 10240 Dec  5 08:28 file05\n<\/pre>\n<p>NOW the interesting part is coming because we are going to reduce our \/mysqldata filesystem<br \/>\nBut first let&#8217;s make a backup of our current \/mysqldata FS<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">[root@deploy mysqldata]$ yum -y install xfsdump\nLoaded plugins: fastestmirror\nLoading mirror speeds from cached hostfile\n<\/pre>\n<p>Bad news! we cannot reduce an <a href=\"https:\/\/access.redhat.com\/solutions\/540013\" target=\"_blank\" rel=\"noopener\">xfs partition directly<\/a> so we need:<br \/>\n&#8211; to backup our filesystem<br \/>\n&#8211; umount the filsesytem &amp;&amp; delete the logical volume<br \/>\n&#8211; re-partition tle logical volume with xfs FS<br \/>\n&#8211; restore our data<\/p>\n<p>Backup the file system<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">[root@deploy mysqldata]$ xfsdump -f \/tmp\/mysqldata.dump \/mysqldata\nxfsdump: using file dump (drive_simple) strategy\nxfsdump: version 3.1.4 (dump format 3.0) - type ^C for status and control\n\n ============================= dump label dialog ==============================\n\nplease enter label for this dump session (timeout in 300 sec)\n -&gt; test\nsession label entered: \"test\"\n\n --------------------------------- end dialog ---------------------------------\n\nxfsdump: level 0 dump of deploy.example.com:\/mysqldata\nxfsdump: dump date: Tue Dec  5 08:36:20 2017\nxfsdump: session id: f010d421-1a34-4c70-871f-48ffc48c29f2\nxfsdump: session label: \"test\"\nxfsdump: ino map phase 1: constructing initial dump list\nxfsdump: ino map phase 2: skipping (no pruning necessary)\nxfsdump: ino map phase 3: skipping (only one dump stream)\nxfsdump: ino map construction complete\nxfsdump: estimated dump size: 83840 bytes\n\n ============================= media label dialog =============================\n\nplease enter label for media in drive 0 (timeout in 300 sec)\n -&gt; test\nmedia label entered: \"test\"\n\n --------------------------------- end dialog ---------------------------------\n\nxfsdump: creating dump session media file 0 (media 0, file 0)\nxfsdump: dumping ino map\nxfsdump: dumping directories\nxfsdump: dumping non-directory files\nxfsdump: ending media file\nxfsdump: media file size 75656 bytes\nxfsdump: dump size (non-dir files) : 51360 bytes\nxfsdump: dump complete: 5 seconds elapsed\nxfsdump: Dump Summary:\nxfsdump:   stream 0 \/tmp\/mysqldata.dump OK (success)\nxfsdump: Dump Status: SUCCESS\n<\/pre>\n<p>Then, we unmount the filesystem and delete the logical volume<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">[root@deploy ~]$ umount \/mysqldata\/\n\n[root@deploy ~]$ df -hT\nFilesystem          Type      Size  Used Avail Use% Mounted on\n\/dev\/mapper\/cl-root xfs        21G  8.7G   13G  42% \/\ndevtmpfs            devtmpfs  910M     0  910M   0% \/dev\ntmpfs               tmpfs     920M     0  920M   0% \/dev\/shm\ntmpfs               tmpfs     920M  8.4M  912M   1% \/run\ntmpfs               tmpfs     920M     0  920M   0% \/sys\/fs\/cgroup\n\/dev\/sda1           xfs      1014M  227M  788M  23% \/boot\ntmpfs               tmpfs     184M     0  184M   0% \/run\/user\/0\n\/dev\/loop2          iso9660   4.3G  4.3G     0 100% \/media\/iso\n\n[root@deploy ~]$ lvremove \/dev\/vg_deploy\/lv_deploy\nDo you really want to remove active logical volume vg_deploy\/lv_deploy? [y\/n]: y\n  Logical volume \"lv_deploy\" successfully removed\n<\/pre>\n<p>We recreate the logical volume with a lower size (from 1000 PE to 800 PE)<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">[root@deploy ~]$ lvcreate -l 800 -n lv_deploy vg_deploy\nWARNING: xfs signature detected on \/dev\/vg_deploy\/lv_deploy at offset 0. Wipe it? [y\/n]: y\n  Wiping xfs signature on \/dev\/vg_deploy\/lv_deploy.\n  Logical volume \"lv_deploy\" created.\n<\/pre>\n<p>We build the XFS filesystem<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">[root@deploy ~]$ mkfs.xfs \/dev\/mapper\/vg_deploy-lv_deploy\nmeta-data=\/dev\/mapper\/vg_deploy-lv_deploy isize=512    agcount=4, agsize=204800 blks\n         =                       sectsz=512   attr=2, projid32bit=1\n         =                       crc=1        finobt=0, sparse=0\ndata     =                       bsize=4096   blocks=819200, imaxpct=25\n         =                       sunit=0      swidth=0 blks\nnaming   =version 2              bsize=4096   ascii-ci=0 ftype=1\nlog      =internal log           bsize=4096   blocks=2560, version=2\n         =                       sectsz=512   sunit=0 blks, lazy-count=1\nrealtime =none                   extsz=4096   blocks=0, rtextents=0\n<\/pre>\n<p>We remount the filesystem<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1; highlight: [14]\">[root@deploy ~]$ mount -a\n[root@deploy ~]$\n[root@deploy ~]$\n[root@deploy ~]$ df -hT\nFilesystem                      Type      Size  Used Avail Use% Mounted on\n\/dev\/mapper\/cl-root             xfs        21G  8.7G   13G  42% \/\ndevtmpfs                        devtmpfs  910M     0  910M   0% \/dev\ntmpfs                           tmpfs     920M     0  920M   0% \/dev\/shm\ntmpfs                           tmpfs     920M  8.4M  912M   1% \/run\ntmpfs                           tmpfs     920M     0  920M   0% \/sys\/fs\/cgroup\n\/dev\/sda1                       xfs      1014M  227M  788M  23% \/boot\ntmpfs                           tmpfs     184M     0  184M   0% \/run\/user\/0\n\/dev\/loop2                      iso9660   4.3G  4.3G     0 100% \/media\/iso\n\/dev\/mapper\/vg_deploy-lv_deploy xfs       3.2G   33M  3.1G   2% \/mysqldata\n<\/pre>\n<p>We list the content of \/mysqldata directory<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">[root@deploy ~]$ ls -l \/mysqldata\ntotal 0\n<\/pre>\n<p>Let&#8217;s restore our data<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">[root@deploy ~]$ xfsrestore -f \/tmp\/mysqldata.dump \/mysqldata\nxfsrestore: using file dump (drive_simple) strategy\nxfsrestore: version 3.1.4 (dump format 3.0) - type ^C for status and control\nxfsrestore: searching media for dump\nxfsrestore: examining media file 0\nxfsrestore: dump description:\nxfsrestore: hostname: deploy.example.com\nxfsrestore: mount point: \/mysqldata\nxfsrestore: volume: \/dev\/mapper\/vg_deploy-lv_deploy\nxfsrestore: session time: Tue Dec  5 08:36:20 2017\nxfsrestore: level: 0\nxfsrestore: session label: \"test\"\nxfsrestore: media label: \"test\"\nxfsrestore: file system id: 84832e04-e6b8-473a-beb4-f4d59ab9e73c\nxfsrestore: session id: f010d421-1a34-4c70-871f-48ffc48c29f2\nxfsrestore: media id: 8fda43c1-c7de-4331-b930-ebd88199d0e7\nxfsrestore: using online session inventory\nxfsrestore: searching media for directory dump\nxfsrestore: reading directories\nxfsrestore: 1 directories and 5 entries processed\nxfsrestore: directory post-processing\nxfsrestore: restoring non-directory files\nxfsrestore: restore complete: 0 seconds elapsed\nxfsrestore: Restore Summary:\nxfsrestore:   stream 0 \/tmp\/mysqldata.dump OK (success)\nxfsrestore: Restore Status: SUCCESS\n<\/pre>\n<p>Our data are back<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">[root@deploy ~]$ ls -l \/mysqldata\/\ntotal 60\n-rw-r--r--. 1 root root 10240 Dec  5 08:28 file01\n-rw-r--r--. 1 root root 10240 Dec  5 08:28 file02\n-rw-r--r--. 1 root root 10240 Dec  5 08:28 file03\n-rw-r--r--. 1 root root 10240 Dec  5 08:28 file04\n-rw-r--r--. 1 root root 10240 Dec  5 08:28 file05\n<\/pre>\n<p>Hope this helps \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>DISCLAIMER: I know it exists other solutions to do it Pre-requisites: &#8211; a virtual machine (or not) with CentOS7 installed &#8211; a free disk or partition I use a VBox machine and I added a 5GiB hard disk We list the disk and partition to check if our new hard is added. [root@deploy ~]$ lsblk [&hellip;]<\/p>\n","protected":false},"author":28,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[229],"tags":[],"type_dbi":[],"class_list":["post-10688","post","type-post","status-publish","format-standard","hentry","category-database-administration-monitoring"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to reduce the size of an LVM partition formatted with xfs filesystem on CentOS7? - dbi Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/how-to-reduce-the-size-a-lvm-partition-formatted-with-xfs-filesystem-on-centos7\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to reduce the size of an LVM partition formatted with xfs filesystem on CentOS7?\" \/>\n<meta property=\"og:description\" content=\"DISCLAIMER: I know it exists other solutions to do it Pre-requisites: &#8211; a virtual machine (or not) with CentOS7 installed &#8211; a free disk or partition I use a VBox machine and I added a 5GiB hard disk We list the disk and partition to check if our new hard is added. [root@deploy ~]$ lsblk [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/how-to-reduce-the-size-a-lvm-partition-formatted-with-xfs-filesystem-on-centos7\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-12-06T15:17:13+00:00\" \/>\n<meta name=\"author\" content=\"Open source Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Open source Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/how-to-reduce-the-size-a-lvm-partition-formatted-with-xfs-filesystem-on-centos7\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/how-to-reduce-the-size-a-lvm-partition-formatted-with-xfs-filesystem-on-centos7\/\"},\"author\":{\"name\":\"Open source Team\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/59554f0d99383431eb6ed427e338952b\"},\"headline\":\"How to reduce the size of an LVM partition formatted with xfs filesystem on CentOS7?\",\"datePublished\":\"2017-12-06T15:17:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/how-to-reduce-the-size-a-lvm-partition-formatted-with-xfs-filesystem-on-centos7\/\"},\"wordCount\":338,\"commentCount\":0,\"articleSection\":[\"Database Administration &amp; Monitoring\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/how-to-reduce-the-size-a-lvm-partition-formatted-with-xfs-filesystem-on-centos7\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/how-to-reduce-the-size-a-lvm-partition-formatted-with-xfs-filesystem-on-centos7\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/how-to-reduce-the-size-a-lvm-partition-formatted-with-xfs-filesystem-on-centos7\/\",\"name\":\"How to reduce the size of an LVM partition formatted with xfs filesystem on CentOS7? - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"datePublished\":\"2017-12-06T15:17:13+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/59554f0d99383431eb6ed427e338952b\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/how-to-reduce-the-size-a-lvm-partition-formatted-with-xfs-filesystem-on-centos7\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/how-to-reduce-the-size-a-lvm-partition-formatted-with-xfs-filesystem-on-centos7\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/how-to-reduce-the-size-a-lvm-partition-formatted-with-xfs-filesystem-on-centos7\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to reduce the size of an LVM partition formatted with xfs filesystem on CentOS7?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/59554f0d99383431eb6ed427e338952b\",\"name\":\"Open source Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/eb4fb12e386e8c41fdef0733e8114594cf2653e4f55e9fa2161442b8eaf3f657?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/eb4fb12e386e8c41fdef0733e8114594cf2653e4f55e9fa2161442b8eaf3f657?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/eb4fb12e386e8c41fdef0733e8114594cf2653e4f55e9fa2161442b8eaf3f657?s=96&d=mm&r=g\",\"caption\":\"Open source Team\"},\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/open-source-team\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to reduce the size of an LVM partition formatted with xfs filesystem on CentOS7? - dbi Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/how-to-reduce-the-size-a-lvm-partition-formatted-with-xfs-filesystem-on-centos7\/","og_locale":"en_US","og_type":"article","og_title":"How to reduce the size of an LVM partition formatted with xfs filesystem on CentOS7?","og_description":"DISCLAIMER: I know it exists other solutions to do it Pre-requisites: &#8211; a virtual machine (or not) with CentOS7 installed &#8211; a free disk or partition I use a VBox machine and I added a 5GiB hard disk We list the disk and partition to check if our new hard is added. [root@deploy ~]$ lsblk [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/how-to-reduce-the-size-a-lvm-partition-formatted-with-xfs-filesystem-on-centos7\/","og_site_name":"dbi Blog","article_published_time":"2017-12-06T15:17:13+00:00","author":"Open source Team","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Open source Team","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/how-to-reduce-the-size-a-lvm-partition-formatted-with-xfs-filesystem-on-centos7\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/how-to-reduce-the-size-a-lvm-partition-formatted-with-xfs-filesystem-on-centos7\/"},"author":{"name":"Open source Team","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/59554f0d99383431eb6ed427e338952b"},"headline":"How to reduce the size of an LVM partition formatted with xfs filesystem on CentOS7?","datePublished":"2017-12-06T15:17:13+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/how-to-reduce-the-size-a-lvm-partition-formatted-with-xfs-filesystem-on-centos7\/"},"wordCount":338,"commentCount":0,"articleSection":["Database Administration &amp; Monitoring"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/how-to-reduce-the-size-a-lvm-partition-formatted-with-xfs-filesystem-on-centos7\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/how-to-reduce-the-size-a-lvm-partition-formatted-with-xfs-filesystem-on-centos7\/","url":"https:\/\/www.dbi-services.com\/blog\/how-to-reduce-the-size-a-lvm-partition-formatted-with-xfs-filesystem-on-centos7\/","name":"How to reduce the size of an LVM partition formatted with xfs filesystem on CentOS7? - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2017-12-06T15:17:13+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/59554f0d99383431eb6ed427e338952b"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/how-to-reduce-the-size-a-lvm-partition-formatted-with-xfs-filesystem-on-centos7\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/how-to-reduce-the-size-a-lvm-partition-formatted-with-xfs-filesystem-on-centos7\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/how-to-reduce-the-size-a-lvm-partition-formatted-with-xfs-filesystem-on-centos7\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to reduce the size of an LVM partition formatted with xfs filesystem on CentOS7?"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/59554f0d99383431eb6ed427e338952b","name":"Open source Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/eb4fb12e386e8c41fdef0733e8114594cf2653e4f55e9fa2161442b8eaf3f657?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/eb4fb12e386e8c41fdef0733e8114594cf2653e4f55e9fa2161442b8eaf3f657?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/eb4fb12e386e8c41fdef0733e8114594cf2653e4f55e9fa2161442b8eaf3f657?s=96&d=mm&r=g","caption":"Open source Team"},"url":"https:\/\/www.dbi-services.com\/blog\/author\/open-source-team\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/10688","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/28"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=10688"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/10688\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=10688"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=10688"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=10688"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=10688"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}