Recupere 100 GB em disco não “visto” pelo fdisk, mas mostrado em parted

0

Estou executando o Ubuntu 14.04 e estou usando o lvm para as partições raiz e de troca. Quando eu uso parted (ou gparted), vejo 110GB não particionados em / dev / sda.

hari@Ubuntu02:~$ sudo parted /dev/sda unit GB print free
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 3408GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type      File system  Flags
        0.00GB  0.00GB  0.00GB            Free Space
 1      0.00GB  0.26GB  0.25GB  primary   ext2         boot
        0.26GB  0.26GB  0.00GB            Free Space
 2      0.26GB  805GB   805GB   extended
 5      0.26GB  805GB   805GB   logical                lvm
 3      805GB   1636GB  831GB   primary                lvm
 4      1636GB  3299GB  1662GB  primary                lvm
        3299GB  3408GB  110GB             Free Space

No entanto, quando eu uso o fdisk para criar a partição, ele não mostra esse espaço livre.

hari@Ubuntu02:~$ sudo fdisk -l /dev/sda

Disk /dev/sda: 3408.5 GB, 3408486045696 bytes
255 heads, 63 sectors/track, 414391 cylinders, total 6657199308 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 identifier: 0x000d989d

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      499711      248832   83  Linux
/dev/sda2          501758  1572861951   786180097    5  Extended
/dev/sda3      1572861952  3196057599   811597824   8e  Linux LVM
/dev/sda4      3196057600  6442450943  1623196672   8e  Linux LVM
/dev/sda5          501760  1572861951   786180096   8e  Linux LVM

Parece que o espaço livre começa no setor 6442450943 e vai até o setor 6657199308.

Eu ingenuamente tentei um lvextend, mas ele me deu a seguinte mensagem.

hari@Ubuntu02:~$ sudo lvextend -L+100G /dev/ubuntu-vg/root
  Extending logical volume root to 3.63 TiB
  Insufficient free space: 25600 extents needed, but only 2 available

Dado que / dev / sda2 é meu único volume lógico e os setores livres são depois de / dev / sda5 como faço para recuperar o espaço não particionado de 110GB e adicioná-lo ao meu grupo de volume lvm usando os comandos parted, fdisk e lv-.

    
por harijay 10.07.2016 / 17:19

1 resposta

0

Consegui recuperar 100 GB por um processo de quatro etapas

Mounted a new Disk (/dev/sdc) with same size as incompletely used
disk (/dev/sda4) and used pvcreate and lvextend to add it as a
logical volume to the LVM volume group 

I used pvmove to move the data from /dev/sda4 . This took ~16 hrs
but was seamless. It automagically moved it to new /dev/sdc volume
and then showed that /dev/sda4 was unused.   I pvremoved the
/dev/sda4 from the volume group 

I used fdisk to remove the existing partition and repartitioned the
space using gparted. 

I added this volume to the volume group( pvcrate and lvextend) and
then was able to use up all size with a sudo lvresize -r -l
+100%FREE /dev/ubuntu-vg/root 

This added back that 100GB which was not incorporated into the
partition and also the volume-group.
    
por 13.07.2016 / 22:40