¿Cómo puedo aumentar el espacio en el disco duro en el servidor Ubuntu?

¿Cómo puedo aumentar el espacio en el disco duro en el servidor Ubuntu?

Instalé el servidor Ubuntu y ejecuté exitosamente mi servidor web en él. Aunque quiero saber que el espacio en el disco duro de mi sistema es de 1 TB, que está lleno de contenidos disponibles en mi sitio web. Y quiero agregar un disco duro externo de 4 TB a mi placa base, pero la pregunta es cómo puedo aumentar el espacio del disco duro donde está instalado LAMP. Quiero decir, quiero fusionar la partición, algo que podamos hacer con AOME Partition Manager con Windows... Y si hay alguna otra alternativa, hágamelo saber...

Respuesta1

Prueba esto:

Suponiendo que su disco externo es /dev/sdc

Cree una tabla de partición gpt y una partición:

sudo -i
gdisk /dev/sdc

The initial output is a warning if the disk is not a new disk or a disk already using GPT:

GPT fdisk (gdisk) version 0.7.2
Partition table scan:
  MBR: MBR only
  BSD: not present
  APM: not present
  GPT: not present
***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format.
THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by typing 'q' if
you don't want to convert your MBR partitions to GPT format!
***************************************************************
Command (? for help):

Al iniciar gdisk en un disco con particiones MBR existentes y sin GPT, el programa muestra un mensaje rodeado de asteriscos sobre la conversión de las particiones existentes a GPT.

Tipo ? y verá una lista de comandos disponibles:

Command (? for help):  ? 
b   back up GPT data to a file
c   change a partition's name
d   delete a partition
i   show detailed information on a partition
l   list known partition types
n   add a new partition
o   create a new empty GUID partition table (GPT)
p   print the partition table
q   quit without saving changes
r   recovery and transformation options (experts only)
s   sort partitions
t   change a partition's type code
v   verify disk
w   write table to disk and exit
x   extra functionality (experts only)
?   print this menu

Escriba n para agregar una nueva partición y XXXT para darle un tamaño a la partición.

Partition number (1-128, default 1):  1 
First sector (34-15728606, default = 4605952) or {+-}size{KMGTP}: 
Last sector (4605952-15728606, default = 15728606) or {+-}size{KMGTP}: +4T
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): 8300
Changed type of partition to 'Linux filesystem

El w escribe sus cambios en el disco mientras el comando q sale sin guardar los cambios:

Comando (? para ayuda): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N):  y 
OK; writing new GUID partition table (GPT).
The operation has completed successfully.

Como gdisk crea particiones, no sistemas de archivos, necesitarás formatear cada una de tus particiones.

mkfs -t ext4 /dev/sdc1

Mueve archivos, normalmente alojados en /var/www a la nueva partición

mkdir /media/newwww
mount /dev/sdc1 /media/newwww
cp -dpR /var/www/* /media/newwww/
mv /var/www /var/oldwww
mkdir /var/www

Obtener el UUID

blkid /dev/sdc1

      /dev/sdc1: UUID="c676ae51-cb6f-4c0e-b4a9-76850aafa1d6" TYPE="ext4" 

Edite el archivo /etc/fstab

nano /etc/fstab

En el archivo agregue esta línea:

UUID=c676ae51-cb6f-4c0e -xxxx-xxxxxxxx /var/www ext4    defaults        0       2

Control + O, guardar archivo. Control + X, cerrar nano.

umount /media/newwww
mount /dev/sdc1 /var/www

Si todo funciona correctamente borra el directorio antiguo:

sudo -i
rm /var/oldwww

información relacionada