fail to mount ntfs in BSD

[root@ftp /mnt/test]# ntfs-3g /dev/da10s1 /mnt/test                                                                                 
fuse: failed to open fuse device: No such file or directory 

kldload fuse  

That’s a missing module needs loading.
nJoy 😉

Playing with Glusterfs

More details in a later post but I finally realized the order of things ? Thought I’d share.

 

Reference sites:
http://www.gluster.org/community/documentation/index.php/Getting_started_configure
http://www.redhat.com/magazine/009jul05/features/gfs_practices/

mkdir ~/gluster
cd ~/gluster

wget -l 1 -nd -nc -r -A.rpm http://download.gluster.org/pub/gluster/glusterfs/LATEST/RHEL/epel-6/x86_64/

 

yum install glusterfs-libs-*.el6.x86_64.rpm -y
yum install glusterfs-*.el6.x86_64.rpm -y
yum install glusterfs-fuse-*.el6.x86_64.rpm -y
yum install glusterfs-cli-*.el6.x86_64.rpm -y
yum install glusterfs-server-*.el6.x86_64.rpm -y
yum install glusterfs-geo-replication-*.el6.x86_64.rpm -y

service glusterd start
chkconfig glusterd on

service glusterfsd start
chkconfig glusterfsd on

gluster peer probe <hostname of the other server in the cluster, or IP address if you don’t have DNS or /etc/hosts entries>


dd if=/dev/zero of=~/test.bin count=10000k
losetup /dev/loop0 test.bin

fdisk /dev/loop0 ---> new partition all blocks fdisk --> n -> p -> 1 -> from 1 to 637 in this case

yum install xfsprogs xfsdump -y

mkfs.xfs -i size=512 /dev/loop0 -f

--- Testing fs --------
mkdir /mnt/test
mount /dev/loop0 /mnt/test



--------fstab -----

/root/test.bin /mnt/test xfs loop 0 0

>>>>> test rebooting


mkdir -p /mnt/test/brick

gluster volume create gv0 replica 2 192.168.1.81:/mnt/test/brick 192.168.1.79:/mnt/test/brick

gluster volume info

Volume Name: gv0
Type: Replicate
Volume ID: cb3110c8-82b0-45f5-9e38-98652a95b54b
Status: Created
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: 192.168.1.81:/mnt/test/brick
Brick2: 192.168.1.79:/mnt/test/brick 




gluster volume start gv0

Just the client

  yum install glusterfs-libs-3.5.0-2.el6.x86_64.rpm -y
  yum install glusterfs-3.5.0-2.el6.x86_64.rpm -y
  yum install glusterfs-fuse-3.5.0-2.el6.x86_64.rpm -y

nJoy 😉

Automagically maintain a file system with autofs

Pending more detail

yum install -y autofs

/etc/autofs.master contains used protocols

/- /etc/autofs.nfs

/etc/autofs.nfs

/mnt/mountpoint -fstype=nfs,rw,soft,intr,rsize=8192,wsize=8192 hostname_or_IP:/mnt/exported_folder

To find out what is exported on a given machine use

showmount -e

nJoy 😉

Adding a XFS filesystem to CentOS 5

Howto use enterprise Linux ‘extras’ to mount a XFS filesystem on a CentOS v5.2 VM

Install RPM’s
Note: Due to this bug (3205), install binutils to overcome the error “xargs: nm: No such file or directory” while installing kmod-xfs-xen.

# yum install binutils
# yum install xfsprogs yum-kmod kmod-xfs-xen

# mkfs.xfs -f /dev/sda1

Check

A chunk of disk (2TB) has been allocated to a LVM partition for the VM, which is formatted with XFS. The device is mapped into the VM as /dev/xvdc1 (i.e. a whole device, c.f. partitioned device).

Before using the filesystem, perform a check:

# xfs_check /dev/xvdc1

Note: xfs_check requires a significant chunk of memory to run. With 2Gbyte of swap and 1Gbyte of RAM a check was unsuccessful.

Mount
Mount the disk by using it’s volume label. The label can be verified with the xfs_admin program:

# xfs_admin -l /dev/xvdc1
label = “purple-files”

Add the mount entry to ‘/etc/fstab’ so that the filesystem is automatically mounted at the next restart.

LABEL=purple-files /files xfs defaults 0 0
Mount the filesystem

# mount /files

NOTE: CENTOS 6.X

Centos 6.X (64bit) already supports XFS in kernel. You only need to
install xfsprogs package to mount xfs filesystems.

just yum install xfsprogs (it is included in centos 6.2 base)

Appendices

# yum install xfsprogs yum-kmod kmod-xfs-xen

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
kmod-xfs-xen x86_64 0.4-2 extras 256 k
xfsprogs x86_64 2.9.4-1.el5.centos extras 1.3 M
yum-kmod noarch 1.1.10-9.el5.centos base 15 k

Transaction Summary
=============================================================================
Install 3 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 1.6 M

Virtual Loopback Filesystem: Building A Linux Filesystem From An Ordinary File

Unix / Linux has a great inbuilt simplicity to it where you can create file systems on any block set . Now .. a file is a block  set so technically and truly at it’s core a file system can be built on a file and mounted :

I need a 100MB partition for some tests :

Using ofcourse Google as my calculator {pfsssst !!! obviously .. DUH}. I tried 100MB / 512 bytes and got

(100 megabytes) / (512 bytes) = 204 800

[root@localhost admin]# dd if=/dev/zero of=disk-image count=204800
204800+0 records in
204800+0 records out
104857600 bytes (105 MB) copied, 41.8633 s, 2.5 MB/s
[root@localhost admin]#

This command leaves me with a 105MB file in which to create my etx3 fs like so :

[root@localhost admin]# ls -al disk-image 
-rw-r--r--. 1 root root 104857600 Jul 13 18:17 disk-image
[root@localhost admin]#

Once this file is created I will use the mkfs to format over the disk-image file:

[root@localhost admin]# /sbin/mkfs -t ext3 -q disk-image
disk-image is not a block special device.
Proceed anyway? (y,n) y
[root@localhost admin]#

Thus a filesystem now resides on my file named disk-image.

We can now use a loopback device to mount the disk-image anywhere we need it:

[root@localhost admin]# mkdir /mnt/test1
[root@localhost admin]# mount
/dev/sda2 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda1 on /boot type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
[root@localhost admin]# mount disk-image /mnt/test1/
mount: /home/admin/disk-image is not a block device (maybe try `-o loop'?)
[root@localhost admin]# mount -o loop disk-image /mnt/test1/
[root@localhost admin]# cd /mnt/test1/
[root@localhost test1]# ls
lost+found
[root@localhost test1]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              18G  2.7G   14G  16% /
tmpfs                 504M  768K  503M   1% /dev/shm
/dev/sda1             291M   50M  226M  19% /boot
/home/admin/disk-image
                       97M  5.6M   87M   7% /mnt/test1

[root@localhost test1]# touch file1
[root@localhost test1]# mkdir -p top1/bottom1
[root@localhost test1]# tree
.
+-- file1
+-- lost+found
+-- top1
    +-- bottom1

3 directories, 1 file
[root@localhost test1]#

Thus a new file system is now running inside the file.

Backing up that file or moving it to another system would entail now quiescing any applications/scripts working with the file, unmounting the loopback fs system, doing your thing then replace all the cards on the deck 🙂