What is the best method to add a new hard drive in RHEL 5.4 linux machine?
Please go through the following details of linux machine and help me to add one 250 gb hard disk to increase available disk space.
[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda3 220G 3.7G 205G 2% /
/dev/hda1 99M 12M 83M 13% /boot
tmpfs 2.0G 0 2.0G 0% /dev/shm
Answer
Once you physically install the disk, you'll need to do the following:
use 'fdisk /dev/hdb' to create a partition on the new disk (in this case the new partition would likely be /dev/hdb1). You'll need to set the partition as as primary partition.
Write a file system -- for ext3 you'd use 'mkfs.ext3 /dev/hdb1'
I also like to assign a disk label to make mounting simpler: e2label /dev/hdb1 /label (where /label is whatever you want, such as /backup).
update /etc/fstab so that the disk is mounted on boot.
LABEL=/label /label ext3 defaults 0 0
For more details on /etc/fstab, you can refer to http://en.wikipedia.org/wiki/Fstabrun the command 'mount -a' to mount all file systems.
Assuming you've done everything correctly, after running 'mount -a' you should be able to run 'mount' to verify the mounts. If you see that /dev/hdb1 is mounted, then you're good to go.
Comments
Post a Comment