SlideShare uma empresa Scribd logo
1 de 3
Baixar para ler offline
Reducir un file system – Guía rápida
Disminuír el tamaño de un file system, basado en LVM, debe ser realizado fuera
de línea (off-line, desmontado). De modo que para realizar el proceso, se puede
estructurar los pasos de la siguiente manera:


  Desmontar el file system
  Ejecutar un chequeo del file system para asegurar la integridad del volúmen
  Reducir el tamaño del file system
  Reducir el tamaño del volúmen lógico (LV)


     Nota : No se puede reducir el file system más allá del espacio libre
     disponible. Así, si el file system que se requiere reducir, dispone de 1G de
     espacio libre, solo se podrá reducir el volúmen en 1G. Sinembargo, si no se
     tiene precaución, los LV si se pueden reducir a un tamaño menor que el
     requerido por el file system. Si esto sucede, se podrían crear problemas
     graves y poco deseables. Por cierto, siempre es recomendable realizar un
     respaldo de los datos antes de efectuar el proceso.



Ejemplo, se quiere reducir el tamaño del file system “labx” en 2G para dejar 3G
disponibles

El procedimiento:


  1. Primero, hay que verificar el espacio disponible

     [root@pzolab home]# cd /labx
     [root@pzolab home]# df ­h .
     Filesystem                         Size     Used     Avail     Use%   Mounted on
     /dev/mapper/vg_pzolab­labx         5.4G    150M     5.00G    3%        /labx

     Nota : El comando de verificación de espacio, muestra que la partición
     tiene un tamaño de 5.4G y dispone de 5.00G de espacio libre. De esta
     forma se puede reducir la partición en 2G sin inconvenientes.



  2. Desmontar el file system

     [root@pzolab home]# cd /
     [root@pzolab home]# umount /labx




                                                                                    Ing. Miguel Arellano - 2013
3. Verificar errores en el file system

   [root@pzolab home]# e2fsck ­f /dev/mapper/vg_pzolab­lv_home
   e2fsck 1.42 (29­Nov­2011)
   Pass 1: Checking inodes, blocks, and sizes
   Pass 2: Checking directory structure
   Pass 3: Checking directory connectivity
   Pass 4: Checking reference counts
   Pass 5: Checking group summary information
   /dev/mapper/vg_pzolab­labx: 11/729360 files (0.0% non­contiguous), 81338/1458176 blocks



4. Reducir el file system a 3G


   [root@pzolab ~]# resize2fs /dev/mapper/vg_pzolab­labx 3G
   resize2fs 1.42 (29­Nov­2011)
   Resizing the filesystem on /dev/mapper/vg_pzolab­labx to 786432 (4k) blocks.
   The filesystem on /dev/mapper/vg_pzolab­labx is now 786432 blocks long.


5. Ahora, reducir el volúmen lógico a 3G

   [root@pzolab ~]# lvresize ­L 3G /dev/mapper/vg_pzolab­labx
     WARNING: Reducing active logical volume to 3.00 GiB
     THIS MAY DESTROY YOUR DATA (filesystem etc.)
   Do you really want to reduce labx? [y/n]: y
     Reducing logical volume labx to 3.00 GiB
     Logical volume labx successfully resized

6. Se puede comprobar el resultado usando “lvdisplay”

   [root@pzolab ~]# lvdisplay /dev/mapper/vg_pzolab­labx
     ­­­ Logical volume ­­­
     LV Path                /dev/vg_pzolab/labx
     LV Name                labx
     VG Name                vg_pzolab
     LV UUID                orUPOc­1QA5­2FH6­x8Oo­aL10­ltb7­HTA9kL
     LV Write Access        read/write
     LV Creation host, time pzolab.cvg.gob.ve, 2012­12­19 14:51:42 ­0430
     LV Status              available
     # open                 0
     LV Size                3.00 GiB
     Current LE             96
     Segments               1
     Allocation             inherit
     Read ahead sectors     auto
     ­ currently set to     256
     Block device           253:3

                                                                                  Ing. Miguel Arellano - 2013
7. Remontar el file system y comprobar el nuevo tamaño

  [root@pzolab ~]# mount /dev/mapper/vg_pzolab­labx /labx
  [root@pzolab ~]# df ­h
  Filesystem                          Size   Used  Avail  Use%  Mounted on
  /dev/mapper/vg_pzolab­labx          3.0G   144M    2.7G     6%       /labx




                                                                               Ing. Miguel Arellano - 2013

Mais conteúdo relacionado

Mais procurados

Git: An introduction of plumbing and porcelain commands
Git: An introduction of plumbing and porcelain commandsGit: An introduction of plumbing and porcelain commands
Git: An introduction of plumbing and porcelain commandsth507
 
Kubernetes in 30 minutes (2017/03/10)
Kubernetes in 30 minutes (2017/03/10)Kubernetes in 30 minutes (2017/03/10)
Kubernetes in 30 minutes (2017/03/10)lestrrat
 
Introduction to Nginx
Introduction to NginxIntroduction to Nginx
Introduction to NginxKnoldus Inc.
 
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...ScaleGrid.io
 
My sql failover test using orchestrator
My sql failover test  using orchestratorMy sql failover test  using orchestrator
My sql failover test using orchestratorYoungHeon (Roy) Kim
 
Prometheus on NKS
Prometheus on NKSPrometheus on NKS
Prometheus on NKSJo Hoon
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker IntroductionSparkbit
 
MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바NeoClova
 
Introduction to Docker storage, volume and image
Introduction to Docker storage, volume and imageIntroduction to Docker storage, volume and image
Introduction to Docker storage, volume and imageejlp12
 
DevOps - CI/CD 알아보기
DevOps - CI/CD 알아보기DevOps - CI/CD 알아보기
DevOps - CI/CD 알아보기SeungYong Baek
 
Práctica Active Directory 1-12
Práctica Active Directory 1-12Práctica Active Directory 1-12
Práctica Active Directory 1-12Adrian Gabriel
 
Architecting your WebRTC application for scalability, Arin Sime
Architecting your WebRTC application for scalability, Arin SimeArchitecting your WebRTC application for scalability, Arin Sime
Architecting your WebRTC application for scalability, Arin SimeAlan Quayle
 
Directivas de grupo locales (GPL) Windows Server 2008 R2
Directivas de grupo locales (GPL) Windows Server 2008 R2Directivas de grupo locales (GPL) Windows Server 2008 R2
Directivas de grupo locales (GPL) Windows Server 2008 R2camilaml
 
CKA Certified Kubernetes Administrator Notes
CKA Certified Kubernetes Administrator Notes CKA Certified Kubernetes Administrator Notes
CKA Certified Kubernetes Administrator Notes Adnan Rashid
 
SQL Server Alwayson for SharePoint HA/DR Step by Step Guide
SQL Server Alwayson for SharePoint HA/DR Step by Step GuideSQL Server Alwayson for SharePoint HA/DR Step by Step Guide
SQL Server Alwayson for SharePoint HA/DR Step by Step GuideLars Platzdasch
 
Deep dark-side of git: How git works internally
Deep dark-side of git: How git works internallyDeep dark-side of git: How git works internally
Deep dark-side of git: How git works internallySeongJae Park
 
K8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals TrainingK8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals TrainingPiotr Perzyna
 

Mais procurados (20)

Git: An introduction of plumbing and porcelain commands
Git: An introduction of plumbing and porcelain commandsGit: An introduction of plumbing and porcelain commands
Git: An introduction of plumbing and porcelain commands
 
Kubernetes in 30 minutes (2017/03/10)
Kubernetes in 30 minutes (2017/03/10)Kubernetes in 30 minutes (2017/03/10)
Kubernetes in 30 minutes (2017/03/10)
 
Introduction to Nginx
Introduction to NginxIntroduction to Nginx
Introduction to Nginx
 
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
 
My sql failover test using orchestrator
My sql failover test  using orchestratorMy sql failover test  using orchestrator
My sql failover test using orchestrator
 
Prometheus on NKS
Prometheus on NKSPrometheus on NKS
Prometheus on NKS
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
GIT INTRODUCTION
GIT INTRODUCTIONGIT INTRODUCTION
GIT INTRODUCTION
 
Advanced Git
Advanced GitAdvanced Git
Advanced Git
 
MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바
 
Introduction to Docker storage, volume and image
Introduction to Docker storage, volume and imageIntroduction to Docker storage, volume and image
Introduction to Docker storage, volume and image
 
DevOps - CI/CD 알아보기
DevOps - CI/CD 알아보기DevOps - CI/CD 알아보기
DevOps - CI/CD 알아보기
 
Práctica Active Directory 1-12
Práctica Active Directory 1-12Práctica Active Directory 1-12
Práctica Active Directory 1-12
 
Architecting your WebRTC application for scalability, Arin Sime
Architecting your WebRTC application for scalability, Arin SimeArchitecting your WebRTC application for scalability, Arin Sime
Architecting your WebRTC application for scalability, Arin Sime
 
Directivas de grupo locales (GPL) Windows Server 2008 R2
Directivas de grupo locales (GPL) Windows Server 2008 R2Directivas de grupo locales (GPL) Windows Server 2008 R2
Directivas de grupo locales (GPL) Windows Server 2008 R2
 
Git.pptx
Git.pptxGit.pptx
Git.pptx
 
CKA Certified Kubernetes Administrator Notes
CKA Certified Kubernetes Administrator Notes CKA Certified Kubernetes Administrator Notes
CKA Certified Kubernetes Administrator Notes
 
SQL Server Alwayson for SharePoint HA/DR Step by Step Guide
SQL Server Alwayson for SharePoint HA/DR Step by Step GuideSQL Server Alwayson for SharePoint HA/DR Step by Step Guide
SQL Server Alwayson for SharePoint HA/DR Step by Step Guide
 
Deep dark-side of git: How git works internally
Deep dark-side of git: How git works internallyDeep dark-side of git: How git works internally
Deep dark-side of git: How git works internally
 
K8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals TrainingK8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals Training
 

Semelhante a Reducir tamaño de particiones dinámicas (shrink file systems)

Semelhante a Reducir tamaño de particiones dinámicas (shrink file systems) (20)

Tutorial Rsyslog Debian Squeeze
Tutorial Rsyslog Debian SqueezeTutorial Rsyslog Debian Squeeze
Tutorial Rsyslog Debian Squeeze
 
Abf leccion 09
Abf leccion 09Abf leccion 09
Abf leccion 09
 
Proyecto 4
Proyecto 4Proyecto 4
Proyecto 4
 
Cuentionario
CuentionarioCuentionario
Cuentionario
 
Admin Manual
Admin ManualAdmin Manual
Admin Manual
 
Proyecto 4
Proyecto 4Proyecto 4
Proyecto 4
 
09 adm bases de datos abd5501 (03 unidad 2 oracle)
09 adm bases de datos abd5501 (03 unidad 2   oracle)09 adm bases de datos abd5501 (03 unidad 2   oracle)
09 adm bases de datos abd5501 (03 unidad 2 oracle)
 
File System Management
File System ManagementFile System Management
File System Management
 
5 espacio swap
5  espacio swap5  espacio swap
5 espacio swap
 
5 espacio swap
5  espacio swap5  espacio swap
5 espacio swap
 
Como mejorar el rendimiento de la pc
Como mejorar el rendimiento de la pcComo mejorar el rendimiento de la pc
Como mejorar el rendimiento de la pc
 
Proceso
ProcesoProceso
Proceso
 
TC3
TC3TC3
TC3
 
Participacion planificacion de disco raid
Participacion planificacion de disco raidParticipacion planificacion de disco raid
Participacion planificacion de disco raid
 
Herramientas de sistema
Herramientas de sistemaHerramientas de sistema
Herramientas de sistema
 
Tema3
Tema3Tema3
Tema3
 
Localizacion de fallas
Localizacion de fallasLocalizacion de fallas
Localizacion de fallas
 
Resumen t2
Resumen t2Resumen t2
Resumen t2
 
Herramientas de sistema
Herramientas de sistemaHerramientas de sistema
Herramientas de sistema
 
Swap
SwapSwap
Swap
 

Reducir tamaño de particiones dinámicas (shrink file systems)

  • 1. Reducir un file system – Guía rápida Disminuír el tamaño de un file system, basado en LVM, debe ser realizado fuera de línea (off-line, desmontado). De modo que para realizar el proceso, se puede estructurar los pasos de la siguiente manera: Desmontar el file system Ejecutar un chequeo del file system para asegurar la integridad del volúmen Reducir el tamaño del file system Reducir el tamaño del volúmen lógico (LV) Nota : No se puede reducir el file system más allá del espacio libre disponible. Así, si el file system que se requiere reducir, dispone de 1G de espacio libre, solo se podrá reducir el volúmen en 1G. Sinembargo, si no se tiene precaución, los LV si se pueden reducir a un tamaño menor que el requerido por el file system. Si esto sucede, se podrían crear problemas graves y poco deseables. Por cierto, siempre es recomendable realizar un respaldo de los datos antes de efectuar el proceso. Ejemplo, se quiere reducir el tamaño del file system “labx” en 2G para dejar 3G disponibles El procedimiento: 1. Primero, hay que verificar el espacio disponible [root@pzolab home]# cd /labx [root@pzolab home]# df ­h . Filesystem                      Size     Used     Avail     Use%   Mounted on /dev/mapper/vg_pzolab­labx 5.4G    150M     5.00G    3%        /labx Nota : El comando de verificación de espacio, muestra que la partición tiene un tamaño de 5.4G y dispone de 5.00G de espacio libre. De esta forma se puede reducir la partición en 2G sin inconvenientes. 2. Desmontar el file system [root@pzolab home]# cd / [root@pzolab home]# umount /labx Ing. Miguel Arellano - 2013
  • 2. 3. Verificar errores en el file system [root@pzolab home]# e2fsck ­f /dev/mapper/vg_pzolab­lv_home e2fsck 1.42 (29­Nov­2011) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information /dev/mapper/vg_pzolab­labx: 11/729360 files (0.0% non­contiguous), 81338/1458176 blocks 4. Reducir el file system a 3G [root@pzolab ~]# resize2fs /dev/mapper/vg_pzolab­labx 3G resize2fs 1.42 (29­Nov­2011) Resizing the filesystem on /dev/mapper/vg_pzolab­labx to 786432 (4k) blocks. The filesystem on /dev/mapper/vg_pzolab­labx is now 786432 blocks long. 5. Ahora, reducir el volúmen lógico a 3G [root@pzolab ~]# lvresize ­L 3G /dev/mapper/vg_pzolab­labx   WARNING: Reducing active logical volume to 3.00 GiB   THIS MAY DESTROY YOUR DATA (filesystem etc.) Do you really want to reduce labx? [y/n]: y   Reducing logical volume labx to 3.00 GiB   Logical volume labx successfully resized 6. Se puede comprobar el resultado usando “lvdisplay” [root@pzolab ~]# lvdisplay /dev/mapper/vg_pzolab­labx   ­­­ Logical volume ­­­   LV Path                /dev/vg_pzolab/labx   LV Name                labx   VG Name                vg_pzolab   LV UUID                orUPOc­1QA5­2FH6­x8Oo­aL10­ltb7­HTA9kL   LV Write Access        read/write   LV Creation host, time pzolab.cvg.gob.ve, 2012­12­19 14:51:42 ­0430   LV Status              available   # open                 0   LV Size                3.00 GiB   Current LE             96   Segments               1   Allocation             inherit   Read ahead sectors     auto   ­ currently set to     256   Block device           253:3 Ing. Miguel Arellano - 2013
  • 3. 7. Remontar el file system y comprobar el nuevo tamaño [root@pzolab ~]# mount /dev/mapper/vg_pzolab­labx /labx [root@pzolab ~]# df ­h Filesystem                      Size   Used  Avail  Use%  Mounted on /dev/mapper/vg_pzolab­labx      3.0G   144M    2.7G     6%       /labx Ing. Miguel Arellano - 2013