Linux(CentOS)挂载移动硬盘,实现文件拷贝、备份 .

Linux(CentOS)挂载移动硬盘,实现文件拷贝、备份
常常我们需要备份服务器上的某些数据,今天在这里跟大家分享一下如何使用移动硬盘备份CentOS上的文件。
一、挂载移动硬盘(挂载NTFS格式分区)
1. 安装ntfs3g工具
wget http://tuxera.com/opensource/ntfs-3g_ntfsprogs-2011.4.12.tgz
tar zxf ntfs-3g_ntfsprogs-2011.4.12.tgz
cd ntfs-3g_ntfsprogs-2011.4.12
./configure --prefix=/usr/local/ntf3g
make&&make install

2. 挂载(可以使用多种命令进行挂载,蓝色代表要挂载的移动硬盘,绿色代表挂载到CentOS上某个盘符)
命令一:ntfs-3g /dev/sdb1 /mnt/windows -o locale=ar_SA.UTF-8,红色部分也可改为zh_CN.GBK,很明显,使用某种编码进行挂载,防止出现乱码;
命令二:mount -t ntfs-3g /dev/sdb1 /mnt/windows
补充:如何找到要挂载的移动硬盘?请使用命令 fdisk -l 进行查看,取消挂载:umount /mnt/windows
二、挂载移动硬盘错误解决办法
1. FATAL: Module fuse not found.(这是由于系统默认的内核并不支持FUSE模块,所以要更新内核)
modprobe fuse(此命令是用来查看系统是否支持FUSE)
uname –r(查看系统的内核版本)
yum install kernel*(更新系统内核)
shutdown -r now(重启计算机)
使用modprobe fuse命令查看系统是否支持FUSE,若不再显示FATAL: Module fuse not found,表示您可以使用ntfs3g进行移动硬盘挂载了
三、文件拷贝(文件拷贝就很简单了)
cp -r /web /mnt/windows (将CentOS中web目录下所有文件拷贝到/mnt/windows下,即拷贝到我们刚刚挂载的移动硬盘上)
 
http://www.tuxera.com/community/ntfs-3g-download/
 

Download

The latest stable version is ntfs-3g_ntfsprogs-2012.1.15, released on January 22, 2012.

 

Installation

Linux: Most distributions include and use NTFS-3G by default. Please use that one unless it’s an old version. If you wish to install NTFS-3G from the source code then make sure you have installed the basic development tools (gcc compiler, libc-dev libraries). Then type:

./configure
make
make install # or 'sudo make install' if you aren't root

Non-Linux: Please see the OS specific installation and source packages above.

Usage

If there was no error during installation then the NTFS volume can be mounted in read-write mode for everybody as follows. Unmount the volume if it had already been mounted, replace /dev/sda1 and /mnt/windows, if needed.

mount -t ntfs-3g /dev/sda1 /mnt/windows

Please see the NTFS-3G Manual for more options and examples.

You can also make NTFS to be mounted during boot by adding the following line to the end of the /etc/fstab file:

/dev/sda1 /mnt/windows ntfs-3g defaults 0 0

posted on 2012-11-18 14:14  imkun  阅读(547)  评论(0编辑  收藏  举报

导航