Não há setores livres disponíveis - Não é possível adicionar nova partição

0

Estou tentando adicionar 40 GB adicionais ao disco de 60 GB e torná-lo 100 GB. O disco é adicionado a partir do backend e no fdisk mostra 100 GB. No entanto, ao tentar criar uma nova partição, recebo o erro "Não há setores livres disponíveis".

Ao tentar criar uma partição com fdisk / dev / sda, conforme abaixo:

]# fdisk /dev/sda

The device presents a logical sector size that is smaller than
the physical sector size. Aligning to a physical sector (or optimal
I/O) size boundary is recommended, or performance may be impacted.

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): p

Disk /dev/sda: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x0006d1e9

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64        6528    51915776   8e  Linux LVM
/dev/sda3            6528        7832    10481740   8e  Linux LVM
/dev/sda4            7833        9137    10482412+   5  Extended
/dev/sda5            7833        9137    10482381   8e  Linux LVM
Partition 5 does not start on physical sector boundary.

Command (m for help): n
No free sectors available

Command (m for help): q

A saída do fdisk -l está abaixo:

 ~]# fdisk -l

Disk /dev/sda: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x0006d1e9

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64        6528    51915776   8e  Linux LVM
/dev/sda3            6528        7832    10481740   8e  Linux LVM
/dev/sda4            7833        9137    10482412+   5  Extended
/dev/sda5            7833        9137    10482381   8e  Linux LVM
Partition 5 does not start on physical sector boundary.

Disk /dev/mapper/vg_nkpdpbn01-lv_root: 69.2 GB, 69247959040 bytes
255 heads, 63 sectors/track, 8418 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_nkpdpbn01-lv_swap: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

Além disso:

 ~]# lsblk
NAME                            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                               8:0    0  100G  0 disk
ââsda1                            8:1    0  500M  0 part /boot
ââsda2                            8:2    0 49.5G  0 part
â ââvg_nkpdpbn01-lv_root (dm-0) 253:0    0 64.5G  0 lvm  /
â ââvg_nkpdpbn01-lv_swap (dm-1) 253:1    0    5G  0 lvm  [SWAP]
ââsda3                            8:3    0   10G  0 part
â ââvg_nkpdpbn01-lv_root (dm-0) 253:0    0 64.5G  0 lvm  /
ââsda4                            8:4    0    1K  0 part
ââsda5                            8:5    0   10G  0 part
  ââvg_nkpdpbn01-lv_root (dm-0) 253:0    0 64.5G  0 lvm  /
sr0                              11:0    1 1024M  0 rom



 ~]# pvs
File descriptor 63 (pipe:[355848]) leaked on pvs invocation. Parent PID 20225: -bash
  PV         VG           Fmt  Attr PSize  PFree
  /dev/sda2  vg_nkpdpbn01 lvm2 a--  49.51g    0
  /dev/sda3  vg_nkpdpbn01 lvm2 a--   9.99g    0
  /dev/sda5  vg_nkpdpbn01 lvm2 a--   9.99g    0
 ~]# lvs
File descriptor 63 (pipe:[356102]) leaked on lvs invocation. Parent PID 20225: -bash
  LV      VG           Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  lv_root vg_nkpdpbn01 -wi-ao---- 64.49g
  lv_swap vg_nkpdpbn01 -wi-ao----  5.00g
 ~]# vgs
File descriptor 63 (pipe:[356125]) leaked on vgs invocation. Parent PID 20225: -bash
  VG           #PV #LV #SN Attr   VSize  VFree
  vg_nkpdpbn01   3   2   0 wz--n- 69.49g    0


~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_nkpdpbn01-lv_root
                       64G   44G   17G  73% /
tmpfs                 3.9G  4.0K  3.9G   1% /dev/shm
/dev/sda1             477M  115M  337M  26% /boot
    
por Arun Krishnan 05.09.2018 / 07:09

2 respostas

1

Eu acho que você está tendo 3 partições primárias (sda1, sda2, sda3), 1 extendidas (sda4) e sd5 como lógicas. com parted, tente redimensionar a partição 4.

Exemplo:

parted /dev/sdb

    Disk /dev/sdb: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type      File system  Flags
 1      1049kB  1049GB  1049GB  primary   ntfs
 2      1049GB  1796GB  747GB   extended
 5      1049GB  1796GB  747GB   logical

(parted) resizepart
Partition number? 2
End?  [1796GB]? 2000GB
(parted) p
Model: WD My Passport 0748 (scsi)
Disk /dev/sdb: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type      File system  Flags
 1      1049kB  1049GB  1049GB  primary   ntfs
 2      1049GB  2000GB  951GB   extended
 5      1049GB  1796GB  747GB   logical

E agora tente adicionar uma nova partição lógica, usando fdisk ou parted, o que você quiser usar.

Com fdisk, você precisaria deletar sda4, e sd5 e adicioná-lo novamente, mantendo o mesmo começo, sobreposição de sda4 e sd5 poderia criar problema.

Observação: mantenha o backup de seus dados e primeiro entenda e teste e faça por sua conta e risco Provavelmente abaixo do caminho, mas não testado:

  1. Delete partition 4  ( Command (m for help): d and enter number 4 )
     2. Add it again and keep the first sector as old one ( Command (m for help): n, choose extended partition e
        , Partition number 4 , First Sector - 7833 , Last Sector - Default

     3. Add logical partition 5 -
     ( Command (m for help): n, Adding logical partition 5 , choose default for first and last sector 

    4 Modify beginning of logical partition 5 to old value ,  Expert command (m for help): b
    Partition number (1,2,5, default 5):5
    New beginning of data - 7833

    5 print table and verify
    
por 05.09.2018 / 08:22
0

Eu encontrei uma solução. 1. Aumentar o tamanho do volume estendido com parted. - Na linha de comando digite o comando "parted". Não há necessidade de desmontar o volume ou ir para o modo de recuperação.

parted

Imprima a tabela e veja a alocação atual:

(parted) print
  • redimensione a partição estendida do tamanho atual para o novo tamanho disponível. No meu caso é 100GB

    (parted) redimensionar 4 64.4GB 100GB

  • imprima e veja a nova alocação

    (parted) print

  • Agora faça a partição fdisk e crie uma nova partição sda6

    fdisk / dev / sda

por 05.09.2018 / 09:05