Nosso cenário é um servidor rodando CentOS.
Após adicionar o disco físico ou virtual na máquina, é necessário efetuar algumas configurações para que o sistema operacional possa reconhecê-lo.
Primeiro passo é descobrir esse hd em seu servidor, para isso digite o comando:
fdisk –l
O resultado será mais ou menos assim;
Disk /dev/sda: 1000.2 GB, 1000171331584 bytes
255 heads, 63 sectors/track, 121597 cylinders
Units = cilindros of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000dceb6
Dispositivo Boot Start End Blocks Id System
/dev/sda1 * 1 32 256000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 32 121598 976472064 8e Linux LVM
<span style=”color: #ff0000;”><em>Disk /dev/sdb</em>: 994.7 GB, 994721136640 bytes
255 heads, 63 sectors/track, 120934 cylinders
Disk /dev/sdb doesn’t contain a valid partition table</span>
Disk /dev/mapper/vg-swap: 4093 MB, 4093640704 bytes
255 heads, 63 sectors/track, 497 cylinders
Units = cilindros of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/vg-tmp: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cilindros of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Em nosso caso o HD novo está marcado com a linha em vermelho, e não foi particionado. Vamos prosseguir.
Execute o seguinte comando para iniciar o processo:
fdisk /dev/sdb
Digite a letra “n” para criar um novo particionamento.
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won’t be recoverable.
The number of cylinders for this disk is set to 16709.
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)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help):<span style=”color: #ff0000;”> n</span>
Escolha o tipo, em nosso caso vamos criar a “Primary”
Command action
e extended
p primary partition (1-4)
<span style=”color: #ff0000;”>p</span>
Marque opção 1 e depois sempre “default”
Partition number (1-4): 1
First cylinder (1-16709, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-16709, default 16709): 16709
Para finalizar o processo e salvar as alterações, digite “w”
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
Para formatar a unidade digite o comando:
mkfs.ext3 /dev/sdb
Aguarde o sistema finalizar o processo:
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
16777216 inodes, 33553752 blocks
1677687 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
1024 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
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 25 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
Crie uma pasta no sistema para seu novo HD:
mkdir /hdnovo
Monte a pasta no HD novo:
mount -t ext3 /dev/sdb /hdnovo
Vamos configurar para montagem automática ao reiniciar:
nano /etc/fstab
Edite o arquivo na última linha:
/dev/sdb /hdnovo ext3 defaults 1 2
Pronto! Agora seu, clique em CTRL + X para salvar, e assim o seu hd já pode ser utilizado.
								
								


