Monday 23 April 2007

SATA/PATA - Mounting Fat32/NTFS Partitions (Mepis 6.5)

Original fstab after clean install of Simply Mepis 6.5:

# Pluggable devices are handled by uDev, they are not in fstab
/dev/sda3 / ext3 defaults,noatime 1 1
/dev/sda2 swap swap sw,pri=1 0 0
none /proc proc defaults 0 0
none /proc/bus/usb usbfs devmode=0666 0 0
none /dev/pts devpts mode=0622 0 0
none /sys sysfs defaults 0 0
# Dynamic entries below, identified by 'users' option
/dev/sda1 /mnt/sda1 ntfs noauto,users,exec,ro,umask=0222 0 0
/dev/hdc1 /mnt/hdc1 vfat,ext3,ext2,reiserfs noauto,users,exec 0 0
/dev/hdc5 /mnt/hdc5 vfat,ext3,ext2,reiserfs noauto,users,exec 0 0
/dev/sda4 /mnt/sda4 vfat,ext3,ext2,reiserfs noauto,users,exec 0 0
/dev/cdrom /media/cdrom iso9660,udf noauto,users,exec,ro 0 0

To auto-mount the other drive partitions, allowing read/write privileges on the fat32 partitions, alter the fstab entry by doing the following:

su
kate /etc/fstab

Change the fstab entry until it looks like the following:

# Pluggable devices are handled by uDev, they are not in fstab
/dev/sda3 / ext3 defaults,noatime 1 1
/dev/sda2 swap swap sw,pri=1 0 0
none /proc proc defaults 0 0
none /proc/bus/usb usbfs devmode=0666 0 0
none /dev/pts devpts mode=0622 0 0
none /sys sysfs defaults 0 0
/dev/sda1 /mnt/sda1 ntfs-3g auto,users 0 0
# Dynamic entries below
/dev/hdc1 /mnt/hdc1 vfat,ext3,ext2,reiserfs noauto,users,exec 0 0
/dev/hdc5 /mnt/hdc5 vfat,ext3,ext2,reiserfs noauto,users,exec 0 0
/dev/sda4 /mnt/sda4 auto noauto,users,exec 0 0
/dev/cdrom /media/cdrom udf,iso9660 noauto,users,exec,ro 0 0
/dev/hda /media/cdrom udf,iso9660 noauto,users,exec,ro 0 0

Then add the following to your /etc/rc.local file before "exit":

if [ -e /usr/local/bin/mountVFAT.sh ]; then
/usr/local/bin/mountVFAT.sh
fi

Create a folder named "bin within the /usr/local folder. Then inside that folder create a text called mountVFAT.sh. That text file should contain the following information:

#!/bin/bash

sudo -u melchizedek mount /mnt/hdc1
sudo -u melchizedek mount /mnt/hdc5
sudo -u melchizedek mount /mnt/sda4

Change the file permissions using the following command:

chmod ug+x /usr/local/bin/mountVFAT.sh

Reboot

No comments:

Post a Comment