给硬盘分区
[root@localhost ~]# fdisk /dev/sdb
//接上硬盘之后,使用fdisk命令分区
The number of cylinders for this disk is set to 1044.
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): m
//使用m查看选项
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition //添加一个分区
o create a new empty DOS partition table
p print the partition table //查看现有分区
q quit without saving changes //推出但不保存
s
create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit //保存并推出
x extra functionality (experts only)
Command (m for help): p
//查看现有分区
Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1
1 250 2008093+ 83 Linux
/dev/sdb2
251 1044 6377805 5 Extended
/dev/sdb5
251 1044 6377773+ 83 Linux
//以前已经把所有分区都划分好了,我们先删除一个
Command (m for help): d
Partition number (1-5): 5
Command (m for help): n
Command action
l logical (5 or over) //扩展分区
p primary partition (1-4)//主分区
l
//创建逻辑分区
First cylinder (251-1044, default 251):
Using default value 251
Last cylinder or +size or +sizeM or +sizeK (251-1044, default 1044):
//这里填写硬盘空间的大小格式:+***M 如若不写就是以最大的数值填写
Using default value 1044
Command (m for help): p
Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1
1 250 2008093+ 83 Linux
/dev/sdb2
251 1044 6377805 5 Extended
/dev/sdb5
251 1044 6377773+ 83 Linux
格式化硬盘
[root@localhost ~]# mkfs -t ext3 /dev/sdb5
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
798112 inodes, 1594443 blocks
79722 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1635778560
49 block groups
32768 blocks per group, 32768 fragments per group
16288 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 32 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
挂在硬盘
[root@localhost /]# mount /dev/sdb5 /text
[root@localhost /]# ls /text
lost+found
在/etc/fstab里面添加开机启动
[root@localhost /]# vim /etc/fstab
/dev/VolGroup00/LogVol00 /
ext3 defaults 1 1
LABEL=/boot
/boot ext3 defaults 1 2
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
/dev/VolGroup00/LogVol01 swap
swap defaults 0 0
# Beginning of the block added by the VMware software
.host:/
/mnt/hgfs vmhgfs defaults,ttl=5 0 0
# End of the block added by the VMware software
/dev/sdb1
/test ext2 defaults 0 0
/dev/sdb5
/text ext3 defaults 0 0
第一字段 设置是硬盘文件
第二字段 挂在的目录
第三字段 使用的文件格式
第四字段 硬盘使用的参数
defaults 同时具有 rw, suid, dev, exec, auto, nouser, async 等参数。 基本上,预讴情�晔褂� defaults 讴定即可!
第五字段 能否被dump命令备份
0 代表丌要做 dump 备�В� 1 代表要每天运行dump 的动作。 2 也代表其他额定日期的 dump 备份动作, 通常这个数值是 0 就是 1 啦!
是否检验扇区
在这个字段中,我们可以讴定是否要以 fsck 检验该 filesystem 喔。 0 是不要要检验, 1 表示最早检验(一般�秤懈�目��会讴定为 1), 2 也是要检验,不过 1 会比较早被检验啦! 一般来说,根目录定为 1 ,其他的要检验的 filesystem 都设定为 2 就好了。
挂在iso镜像
[root@localhost ~]# mount -o loop /mnt/hgfs/xunin/rhel.5.0.server.centoschina.com.dvd.iso /mnt/iso/
[root@localhost ~]# ls /mnt/iso/
Cluster
README-or.html RELEASE-NOTES-ml.html
ClusterStorage README-pa.html
RELEASE-NOTES-mr.html
EULA
README-pt_BR.html RELEASE-NOTES-or.html
eula.en_US
README-ru.html RELEASE-NOTES-pa.html
GPL
README-si.html RELEASE-NOTES-pt_BR.html
images
README-ta.html RELEASE-NOTES-ru.html
isolinux
README-te.html RELEASE-NOTES-si.html
README-as.html README-zh_CN.html
RELEASE-NOTES-ta.html
README-bn.html README-zh_TW.html
RELEASE-NOTES-te.html
README-de.html RELEASE-NOTES-as.html RELEASE-NOTES-zh_CN.html
README-en
RELEASE-NOTES-bn.html RELEASE-NOTES-zh_TW.html
README-en.html RELEASE-NOTES-de.html RPM-GPG-KEY-fedora
README-es.html RELEASE-NOTES-en
RPM-GPG-KEY-fedora-test
README-fr.html RELEASE-NOTES-en.html RPM-GPG-KEY-redhat-auxiliary
README-gu.html RELEASE-NOTES-es.html RPM-GPG-KEY-redhat-beta
README-hi.html RELEASE-NOTES-fr.html RPM-GPG-KEY-redhat-former
README-it.html RELEASE-NOTES-gu.html RPM-GPG-KEY-redhat-release
README-ja.html RELEASE-NOTES-hi.html Server
README-kn.html RELEASE-NOTES-it.html TRANS.TBL
README-ko.html RELEASE-NOTES-ja.html VT
README-ml.html RELEASE-NOTES-kn.html
README-mr.html RELEASE-NOTES-ko.html
[root@localhost ~]#