Question
I’ve installed a new 250GB SATA hard disk on our office CentOS Linux server. How do I format a hard disk under Linux operating system from a shell prompt?
How-To
There are total 4 steps involved for hard disk upgrade and installation procedure:
Step #1 : Partition the new disk using fdisk command
A device name refers to the entire hard disk. For more information see Linux partition naming convention and IDE drive mappings. To partition the disk – /dev/sdb, enter:
The basic fdisk commands you need are:
Step#2 : Format the new disk using mkfs.ext3 command
To format Linux partitions using mkfs.ext3 on the new disk:
Step#3 : Mount the new disk using mount command
First create a mount point /disk1 and use mount command to mount /dev/sdb, enter:
Step#4 : Update /etc/fstab file
Edit /etc/fstab file, enter:
Task: Label the partition
You can label the partition using e2label. For example, if you want to label the new partition /backup, enter
You can use label name insted of partition name to mount disk using /etc/fstab:
- LABEL=/backup /disk1 ext3 defaults 0 0
* VBird - Linux 磁碟與檔案系統管理
沒有留言:
張貼留言