Añadir GPT a un disco únicamente con el MBR
En los discos de más de 2TB no podemos direccionar toda su capacidad con la tabla de particiones clásica (MBR). Vamos a ver como añadir la GPT en un disco sin perder sus datos para poder crear particiones de más de 2TB sin perder las existentes.
Para ello necesitaremos el gdisk que tenemos disponible en el repositorio EPEL:
# yum install gdisk
A continuación lo ejecutamos contra el disco:
# gdisk /dev/sda 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! ***************************************************************
A continuación simplemente grabamos (w) sin hacer ningún cambio para que nos transforme el MBR al formato GPT:
Command (? for help): 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). Warning: The kernel is still using the old partition table. The new table will be used at the next reboot. The operation has completed successfully.
A continuación ya podremos crear la nueva partición sin que estemos limitados a las 2TB:
[root@moria gptfdisk-0.8.1]# gdisk /dev/sda
GPT fdisk (gdisk) version 0.7.2
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Command (? for help): n
Partition number (3-128, default 3):
First sector (34-19529727966, default = 16779264) or {+-}size{KMGTP}:
Last sector (16779264-19529727966, default = 19529727966) or {+-}size{KMGTP}:
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): L
0700 Microsoft basic data 0c01 Microsoft reserved 2700 Windows RE
4200 Windows LDM data 4201 Windows LDM metadata 7501 IBM GPFS
7f00 ChromeOS kernel 7f01 ChromeOS root 7f02 ChromeOS reserved
8200 Linux swap 8300 Linux filesystem 8301 Linux reserved
8e00 Linux LVM a500 FreeBSD disklabel a501 FreeBSD boot
a502 FreeBSD swap a503 FreeBSD UFS a504 FreeBSD ZFS
a505 FreeBSD Vinum/RAID a800 Apple UFS a901 NetBSD swap
a902 NetBSD FFS a903 NetBSD LFS a904 NetBSD concatenated
a905 NetBSD encrypted a906 NetBSD RAID ab00 Apple boot
af00 Apple HFS/HFS+ af01 Apple RAID af02 Apple RAID offline
af03 Apple label af04 AppleTV recovery be00 Solaris boot
bf00 Solaris root bf01 Solaris /usr & Mac Z bf02 Solaris swap
bf03 Solaris backup bf04 Solaris /var bf05 Solaris /home
bf06 Solaris alternate se bf07 Solaris Reserved 1 bf08 Solaris Reserved 2
bf09 Solaris Reserved 3 bf0a Solaris Reserved 4 bf0b Solaris Reserved 5
c001 HP-UX data c002 HP-UX service ef00 EFI System
ef01 MBR partition scheme ef02 BIOS boot partition fd00 Linux RAID
Hex code or GUID (L to show codes, Enter = 8300): 8e00
Changed type of partition to 'Linux LVM'
Command (? for help): p
Disk /dev/sda: 19529728000 sectors, 9.1 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): 903B7E33-5F43-40C6-87AE-64D242FB6323
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 19529727966
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)
Number Start (sector) End (sector) Size Code Name
1 2048 8390655 4.0 GiB 8300 Linux filesystem
2 8390656 16779263 4.0 GiB 8200 Linux swap
3 16779264 19529727966 9.1 TiB 8E00 Linux LVM
Command (? for help): 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).
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot.
The operation has completed successfully.
Finalmente deberemos restaurar el grub, o el boot loader que tengamos instalado. Para el caso de grub podemos usar el script grub-install:
# grub-install /dev/sda Installation finished. No error reported. This is the contents of the device map /boot/grub/device.map. Check if this is correct or not. If any of the lines is incorrect, fix it and re-run the script `grub-install'. # this device map was generated by anaconda (hd0) /dev/sda
Al reiniciar arrancará normalmente el sistema operativo y tendremos la nueva partición sda3 con las 9.1TB disponibles para su uso:
# cat /proc/partitions major minor #blocks name 8 0 9764864000 sda 8 1 4194304 sda1 8 2 4194304 sda2 8 3 9756474351 sda3
Relacionados
Imprimir
18. November 2011 at 8:36 am :
Muy claro y bien explicado, y ahora me pregunto yo, estando como están los precios de los HDs, ¿cómo hace uno para comprarse uno de 9.1TB?
18. November 2011 at 10:08 am :
Se tratan de 6 discos en RAID5 por hardware, por eso el sistema operativo ve únicamente uno de :
22. November 2011 at 4:12 pm :
Muy buena explicación. Como siempre.
Saludos.