Redimensiona / ponto de montagem (mas não está em lvm)

2

eu fiz como abaixo os passos

sr1-server:/dev # df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              38G   35G 1022M  98% /
udev                  3.9G   88K  3.9G   1% /dev

sr1-server:/dev # fdisk -l

Disk /dev/sda: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00083481

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         262     2104483+  82  Linux swap / Solaris
/dev/sda2   *         263        5221    39833167+  83  Linux
sr1-server:/dev # fdisk /dev/sda

The number of cylinders for this disk is set to 6527.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): d
Partition number (1-4): 2

Command (m for help): p

Disk /dev/sda: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00083481

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         262     2104483+  82  Linux swap / Solaris

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (263-6527, default 263):
Using default value 263
Last cylinder, +cylinders or +size{K,M,G} (263-6527, default 6527):
Using default value 6527

Command (m for help): p

Disk /dev/sda: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00083481

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         262     2104483+  82  Linux swap / Solaris
/dev/sda2             263        6527    50323612+  83  Linux

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
sr1-server:/dev # fdisk -l

Disk /dev/sda: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00083481

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         262     2104483+  82  Linux swap / Solaris
/dev/sda2             263        6527    50323612+  83  Linux
sr1-server:/dev # resize2fs /dev/sda2
resize2fs 1.41.1 (01-Sep-2008)
The filesystem is already 9958291 blocks long.  Nothing to do!

sr1-server:/dev # df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              38G   35G 1022M  98% /
udev                  3.9G   88K  3.9G   1% /dev

sr1-server:/dev #
sr1-server:/dev #
sr1-server:/dev # reboot

Broadcast message from root (pts/1) (Sat Jul 27 06:24:26 2013):

The system is going down for reboot NOW!
sr1-server:/dev #

Mas depois disso eu não consigo me conectar. seja certo ou errado? como resgatar o servidor?

    
por user183298 27.07.2013 / 17:28

3 respostas

6

Eu me vi involuntariamente gritando "nooooooo!" enquanto eu leio sua transcrição. Parece que você tentou redimensionar o sistema de arquivos raiz em um sistema em execução enquanto estava montado. Você mudou a tabela de partições, mas ela não foi relida pelo kernel (leia as mensagens cuidadosamente). Então o resize2fs não aconteceu porque o tamanho da partição antiga foi usado.

Se eu estou certo e é isso que você fez, foi uma péssima ideia. Apenas tente redimensionar as partições que não estão montadas e nunca faça nada para a partição raiz em um sistema em execução.

Sua melhor aposta agora é inicializar a partir da mídia de resgate e tentar descobrir em que estado a sua tabela de partições e sistema de arquivos estão. Você precisará de acesso de console ao servidor para fazer qualquer tipo de recuperação.

    
por 27.07.2013 / 19:19
1

Eu fiz um teste com partição simples no kvm guest, sem lvm você não pode fazer um redimensionamento online, esse é o resultado depois que eu redimensionei a partição e usei partprobe e blockdev && sfdisk

 partprobe /dev/vdb

Error: Partition(s) 1 on /dev/vdb have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use.  As a result, the old partition(s) will remain in use.  You should reboot now before making further changes.

 blockdev --rereadpt /dev/vdb

BLKRRPART: Device or resource busy


sfdisk -R /dev/vdb

BLKRRPART: Device or resource busy
sfdisk: This disk is currently in use.
    
por 27.07.2013 / 22:13
0

Ai, você teve seu fdisk no modo de exibição do cilindro. Eu suponho que começa em um endereço ligeiramente diferente agora em comparação com antes.

Se o seu servidor tiver, de alguma forma, um modo de recuperação (sistema de resgate que pode ser inicializado, terminal serial ao qual você pode se conectar, ...), você deve experimentá-lo e verificar o que está errado.

    
por 29.07.2013 / 13:01

Tags