- 论坛徽章:
- 0
|
怎样加载一块硬盘分区
fdisk 分区 d——删除分区 n——添加分区
***********************************fdisk内容*************************************************
Command (m for help): d
————————————
Selected partition 1
Command (m for help): p
————----------------
Disk /dev/hdb: 5121 MB, 5121446400 bytes
15 heads, 63 sectors/track, 10585 cylinders
Units = cylinders of 945 * 512 = 483840 bytes
Device Boot Start End Blocks Id System
Command (m for help): n
-------------------------------------------------------------
Command action
e extended
p primary partition (1-4)
p
---
Partition number (1-4): 1
-----------------------------------------------
First cylinder (1-10585, default 1): (回车)
------
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-10585, default 10585): (回车)
------
Using default value 10585
Command (m for help): w
------------------------
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@rhad4 dev]# fdisk -l
-----------------------------------------------
Disk /dev/hda: 10.2 GB, 10242892800 bytes
255 heads, 63 sectors/track, 1245 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 274 2096482+ 82 Linux swap
/dev/hda3 275 363 714892+ 83 Linux
/dev/hda4 364 1245 7084665 5 Extended
/dev/hda5 364 1000 5116671 83 Linux
/dev/hda6 1001 1131 1052226 83 Linux
/dev/hda7 1132 1195 514048+ 83 Linux
/dev/hda8 1196 1245 401593+ 83 Linux
Disk /dev/hdb: 5121 MB, 5121446400 bytes
15 heads, 63 sectors/track, 10585 cylinders
Units = cylinders of 945 * 512 = 483840 bytes
Device Boot Start End Blocks Id System
/dev/hdb1 1 10585 5001381 83 Linux
**************************************************************************************
mkfs /dev/sdb1 格式化磁盘
mkdir /data
mount /dev/sdb1 /data 创建挂载点 注:挂载点 要以/dev/hdb 开头
vi /etc/fstab 添加挂载点到启动文件
tune2fs -j /dev/sdb1 转换为ex3的格式 或者格式化的时候选择mkfs.ex3 /dev/sdb1
如何新增一块硬盘(好好先生)
一、关机,物理连接硬盘
如果是IDE硬盘,注意主、从盘的设置;如果是SCSI硬盘,注意选择一个没有被使用的
ID号。
二、开机,检查硬盘有没有被linux检测到
dmesg |grep hd*(ide硬盘)
dmesg |grep sd*(SCSI硬盘)
或者 less /var/log/dmesg
如果你没有检测到你的新硬盘,重启,检查连线,看看bios有没有认出它来。
三、分区
你可以使用fdisk,Sfdisk或者parted(GNU分区工具,linux下的partition magic)
四、格式化
mkfs
五、修改fstab
vi /etc/fstab
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/7476/showart_30765.html |
|