1.虚拟机中创建新的磁盘,创建好后使用: [root@RHEL01 ~]# fdisk -l
查看新分出来的磁盘及代号
2.使用fdisk 为新建的磁盘如/dev/sdb 分区: fdisk /dev/sdb
Command (m for help): m Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delet
e 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)
3.将新建立的磁盘分区格式化为ext3的类型
[root@RHEL01 ~]# mkfs -t ext3 /dev/sdb1mke2fs 1.39 (29-May-2006)Filesystem label=OS type: Linux
Block size=4096 (log=2)Fragment size=4096 (log=2)1048576 inodes, 2096474 blocks
104823 blocks (5.00%) reserved for the super user First data block=0
Maximum filesystem blocks=214748364864 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, 1605632Writing inode tables: done Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 35 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.[root@RHEL01 ~]#fdisk -l
4.挂载新硬盘及分区
[root@RHEL01 ~]# mkdir /mnt/newdisk
[root@RHEL01 ~]#mount /dev/sdb1 /mnt/newdisk [root@RHEL01 ~]# df -h
5.设置开机自动启动挂载分区
[root@RHEL01 ~]#
vi /etc/fstab
6.用NFS 共享挂载的新硬盘/mnt/newdisksdb1
a./etc/init.d/nfs start
b.创建或修改/etc/exports文件( 关闭防火墙 )/mnt/newdisksdb1 192.168.204.128(rw)
Service iptables stop
在其他客户机上建立同样的文件挂载点 mkdir /dev/newdisksdb1
c.查看远程机器硬盘挂载共享情况Showmount -e 192.168.204.128
Mount 192.168.204.128:/mnt/newdisksdb1 /mnt/newdisksdb1 d.修改/etc/fstab 的文件(注意以NFS 挂载)
注意:
a.在/etc/fstab 上有没有加上网络挂载硬盘;
b.查看服务器NFS 的服务有没有开;
c.查看服务器上的防火墙有没有关掉;
d.查看服务器上的/etc/exports 文件有没有问题;
如果客户机上部署好的挂载硬盘不见了,请检查
作者:天涯芳草 QQ :2455587060
Vmwa re 下Redhat Li nux创建加载共享磁盘
2011年11月26日
分区linux 创建加载共享磁盘的第1 页