rbruno18
(usa CentOS)
Enviado em 20/03/2018 - 15:23h
Primeiro utilizamos o comando FDISK
# fdisk -l
Disk /dev/hda: 251.0 GB, 251000193024 bytes
255 heads, 63 sectors/track, 30515 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 64 514048+ 83 Linux
/dev/hda2 65 586 4192965 82 Linux swap / Solaris
/dev/hda3 587 30515 240404692+ 83 Linux
Disk /dev/hdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hdc1 * 1 499 4008186 83 Linux
/dev/hdc2 500 998 4008217+ 83 Linux
/dev/hdc3 999 60801 480367597+ 83 Linux
Neste exemplo o disco que existia no sistema é o /dev/hda (250gb) e foi adicionado um de 500gb, reconhecido como /dev/hdc "VERIFIQUE COMO SUBIU SEU NOVO HD PARA DAR CONTINUIDADE".
Vamos agora, particionar o disco com uma partição ext3 ou no caso pode escolher a que desejar melhor pra voce.
# fdisk /dev/hdc
The number of cylinders for this disk is set to 60801.
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): p
Disk /dev/hdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hdc1 * 1 499 4008186 83 Linux
/dev/hdc2 500 998 4008217+ 83 Linux
/dev/hdc3 999 60801 480367597+ 83 Linux
Como pode observar com o comando fdisk, “p” (print partition table), este disco possui 3 partições e dessa forma, vamos eliminar as partições;
Command (m for help): d
Partition number (1-4): 1
Command (m for help): d
Partition number (1-4): 2
Command (m for help): d
Selected partition 3
Command (m for help): p
Disk /dev/hdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
Como pode verificar, o disco já está limpo, portanto, iremos agora particionar;
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-60801, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-60801, default 60801):
Using default value 60801
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 83
Command (m for help): p
Disk /dev/hdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hdc1 1 60801 488384001 83 Linux
Command (m for help): w
The partition table has been altered!
Depois de particionado e guardado as novas configurações, vamos formatar o disco como ext3;
# mkfs.ext3 -b 4096 /dev/hdc1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
61063168 inodes, 122096000 blocks
6104800 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
3727 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 30 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
Agora que o disco está particionado e formatado, o ultimo passo será “montar” o novo disco e neste caso, vamos configurar como /d2;
# mkdir /d2
Edite o ficheiro /etc/fstab e adicione a linha:
/dev/hdc1 /d2 ext3 defaults 1 1
O ficheiro /dev/fstab ficará algo parecido com:
LABEL=/1 / ext3 defaults,usrquota,grpquota 1 1
LABEL=/boot /boot ext3 defaults 1 2
/dev/hdc1 /d2 ext3 defaults 1 1
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
LABEL=SWAP-sda2 swap swap defaults 0 0
Depois de gravar, iremos “montar” o disco na directoria definida;
# mount /d2
Verifique:
# df -vh
Filesystem Size Used Avail Use% Mounted on
/dev/hda3 223G 88G 124G 42% /
/dev/hda1 487M 51M 411M 11% /boot
tmpfs 2.5G 0 2.5G 0% /dev/shm
/dev/hdc1 459G 199M 435G 1% /d2