jump to navigation

HOWTO: Copy Linux Filesystems June 8, 2006

Posted by devhen in HOWTO, Linux.
add a comment

I recently added a hard drive to one of my Linux systems and while searching for the best way to copy my old /home filesystem to the new drive I came upon this command:

/sbin/dump 0f – /home | ( cd /new ; /sbin/restore rf – )

Here my new hard drive is mounted on /new and I’m copying the entire filesystem from /home to /new. On my system (CentOS 4) the dump and restore commands are in /sbin/ but other distros may not be consistent so you’ll want to make changes to the command as needed.


HOWTO: Install fuse + sshfs on CentOS Linux June 8, 2006

Posted by devhen in CentOS, HOWTO, Linux.

UPDATED Dec-19-2006:

NOTE: These instruction are for CentOS 4.

The apt-get method of installing sshfs that I had posted here previously did not work for me. I got this error when trying to mount an ssh drive:

shfsmount: shfs filesystem not supported by the kernel

So, I set out to find a different method of installing sshfs (and fuse, which it requires). One, preferably, that would actually work. Well, I found one. Its not the most elegant solution but its effective.

First, download a copy of the fuse source rpm:

wget http://www.devhen.net/centos/fuse-2.6.0-1.src.rpm

Next, install the source rpm and then build the proper fuse rpm’s from the .spec file:

rpm -ivh fuse-2.6.0-1.src.rpm
rpmbuild -bb /usr/src/redhat/SPECS/fuse.spec

Next, install the rpms that you have built:

cd /usr/src/redhat/RPMS/i386 (replace ‘i386’ with your arch, if necessary)
rpm -Uvh fuse-2.6.0-1.i386.rpm fuse-kernel-2.6.0-1.i386.rpm fuse-libs-2.6.0-1.i386.rpm fuse-devel-2.6.0-1.i386.rpm

Now you can install the sshfs-fuse rpm:

wget http://www.devhen.net/centos/sshfs-fuse-1.6-2.i386.rpm
rpm -ivh sshfs-fuse-1.6-2.i386.rpm

** You can try building the sshfs-fuse rpm from its source package if your not on i386**

Now comes the ugly part… For some reason the system can’t find the fuse module after installing these packages. So, head over to the fuse project homepage and download fuse-2.6.0.tar.gz. Unpack it and then

make install

and you should be in business. As I said, this is not an elegant solution because you are installing fuse from the tar.gz file on top of the fuse rpms. However, it works for me and that’s all that matters right now because I really needed to mount some ssh drives on my workstation. 😉

Mount an ssh drive like so:

sshfs user@remotesystem:/path/you/want/to/mount/ /mnt/mount-point/ -o allow_other

Don’t forget the trailing /’s on both the source folder and the mount point. -o allow_other will give all users access to the mounted drive. Type sshfs -h for a list of all of sshfs’ options.