Archive for the ‘CentOS’ tag
CentOS NFS How-to Guide: Exporting and Mounting a NFS Drive
This guide shows you how to start an NFS service on one (host) machine, export the NFS drive, and then connect to that NFS drive from a client machine.
## On the NFS host machine:
#Start Portmap service if needed.
#NFS uses portmap and a bunch of ports (that you can set in /etc/sysconfig/nfs) if you want.
See this link for more details on NFS ports.
#Start portmap service
service portmap status
service portmap start (if needed)
#Start NFS
service nfs start
#Edit /etc/exports
#Reference: https://www.redhat.com/docs/manuals/enterprise/RHEL-3-Manual/ref-guide/s1-nfs-server-export.html
Format is (select the options you want):
[Directory to export] [Hosts to allow](options)
/home/just_testing 192.168.0.0/24(rw,async,wdelay,root_squash)
#Run exportfs to refresh NFS exports
exportfs -av
Be sure the proper ports are open on iptables
Reference: http://pario.no/2008/01/15/allow-nfs-through-iptables-on-a-redhat-system/
## Now on your NFS client machine:
Start portmap
service portmap start
Create a mount point and mount the NFS drive. Remember to use your own server’s IP address:
mkdir /mnt/nfs-usbdisk
mount 192.168.0.2:/home/just_testing /mnt/nfs-usbdisk
Voila ! Tail your logs if you have any problems !
How to mount an Amazon S3 bucket as virtual drive on CentOS 5.2
#Note: If you are using CentOS 4, it’s the same general process. You might have more difficulty finding the packages to install fuse and dependencies.
This is a simple guide on how to mount your S3 bucket as a “virtual drive”. This is great for backing up your data to S3, or downloading a bunch of files from S3.
#First, make sure you have the fuse package installed.
#On CentOS, fuse is available from RPMforge
#http://wiki.centos.org/AdditionalResources/Repositories/RPMForge
#Now install fuse
yum install fuse
modprobe fuse
#Download s3fs and make
cd /usr/local/src
wget http://s3fs.googlecode.com/files/s3fs-r191-source.tar.gz
cd s3fs
make
#Copy the binary to /usr/local/bin (or wherever you prefer)
cp s3fs /usr/local/bin
#Make a mount point
mkdir /mnt/s3drive
#Mount your bucket like this:
s3fs bucketname -o accessKeyId=XXXXXXXXXXXXXXXXXXXX -o secretAccessKey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX /mnt/s3drive
That’s it ! You can change directory to your virtual drive or start copying files !
Go ahead and use a visual client such as CyberDuck or S3Hub to verify with your own eyes that this actually worked. ![]()
Good luck!
