setup nfs server

fdisk -l 查看分区:


[root@OVMM1~]# fdisk /dev/sdc


 


Thenumber of cylinders for this disk is set to 1566.


There isnothing wrong with that, but this is larger than 1024,


andcould 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): d


Selectedpartition 1


 


Command(m for help): 1


1:unknown command


Commandaction


   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): n


Commandaction


   e  extended


   p  primary partition (1-4)


p


Partitionnumber (1-4): 1


Firstcylinder (1-1566, default 1):


Usingdefault value 1


Lastcylinder or +size or +sizeM or +sizeK (1-1566, default 1566):


Usingdefault value 1566


 


Command(m for help): w


Thepartition table has been altered!


 


Callingioctl() to re-read partition table.


Syncingdisks.


[root@OVMM1~]# mke2fs -j -L mypool1 /dev/sdc1


mke2fs1.39 (29-May-2006)


Filesystemlabel=mypool1


OS type:Linux


Blocksize=4096 (log=2)


Fragmentsize=4096 (log=2)


1572864inodes, 3144715 blocks


157235blocks (5.00%) reserved for the super user


Firstdata block=0


Maximumfilesystem blocks=3221225472


96 blockgroups


32768blocks per group, 32768 fragments per group


16384inodes per group


Superblockbackups stored on blocks:


        32768, 98304, 163840, 229376, 294912,819200, 884736, 1605632, 2654208


 


Writinginode tables: done                           


Creatingjournal (32768 blocks): done


Writingsuperblocks and filesystem accounting information: done


 


Thisfilesystem will be automatically checked every 23 mounts or


180days, whichever comes first.  Use tune2fs-c or -i to override.



[root@OVMM1poolfs]# vi /etc/fstab


[root@OVMM1poolfs]# more /etc/fstab


/dev/VolGroup00/LogVol00/                       ext3    defaults        1 1


LABEL=/boot             /boot                   ext3    defaults        1 2


tmpfs                   /dev/shm                tmpfs   defaults        0 0


devpts                  /dev/pts                devpts  gid=5,mode=620  0 0


sysfs                   /sys                    sysfs   defaults        0 0


proc                    /proc                   proc    defaults        0 0


/dev/sdb1               /u01                    ext3    defaults        1 1


/dev/VolGroup00/LogVol01swap                    swap    defaults        0 0


#LABEL=osimages/ovm3/osimages ext3 defaults 1 1


LABEL=mypool1/ovm3/mypool1/poolfs ext3 defaults 1 1


[root@OVMM1poolfs]# mount -a


[root@OVMM1poolfs]# df -h


Filesystem            Size  Used Avail Use% Mounted on


/dev/mapper/VolGroup00-LogVol00


                       19G  2.9G  15G  17% /


/dev/sda1              99M   17M  78M  18% /boot


tmpfs                 2.0G     0 2.0G   0% /dev/shm


/dev/sdb1             9.9G  2.9G 6.5G  31% /u01


/dev/sdc1              12G  159M  12G   2% /ovm3/mypool1/poolfs


[root@OVMM1html]# service nfs start

[root@OVMM1 ~]# mount 192.168.1.110:/ovm3/mypool1/poolfs/ /mnt
[root@OVMM1 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       19G  2.9G   15G  17% /
/dev/sda1              99M   17M   78M  18% /boot
tmpfs                 2.0G     0  2.0G   0% /dev/shm
/dev/sdb1             9.9G  2.9G  6.5G  31% /u01
/dev/sdc1              12G  159M   12G   2% /ovm3/mypool1/poolfs
192.168.1.110:/ovm3/mypool1/poolfs/
                       12G  158M   12G   2% /mnt



[root@OVMM1 ~]# more /etc/exports
#/home/nfs/ovmcluster   myserver(no_root_squash,rw)
#/home/nfs/ovmdata      myserver(no_root_squash,rw)
/ovm3/mypool1/poolfs 192.168.1.0/24(no_root_squash,rw)







猜你喜欢

转载自blog.csdn.net/henrybai/article/details/50497155
nfs