Monday 30 April 2007

SATA ONLY fstab - 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/sda5 / ext3 defaults,noatime 1 1
/dev/sda6 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/sda7 /home ext3 defaults,noatime 1 2
# Dynamic entries below
/dev/sda1 /mnt/sda1 ntfs-3g noauto,users 0 0
/dev/sda2 /mnt/sda2 vfat,ext3,ext2,reiserfs noauto,users,exec 0 0
/dev/sda3 /mnt/sda3 vfat,ext3,ext2,reiserfs 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
/dev/fd0 /media/floppy vfat,ext2 noauto,users,exec,rw 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/sda5 / ext3 defaults,noatime 1 1
/dev/sda6 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/sda7 /home ext3 defaults,noatime 1 2
/dev/sda1 /mnt/sda1 ntfs-3g auto,users 0 0
# Dynamic entries below
/dev/sda2 /mnt/sda2 vfat,ext3,ext2,reiserfs noauto,users,exec 0 0
/dev/sda3 /mnt/sda3 vfat,ext3,ext2,reiserfs 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
/dev/fd0 /media/floppy vfat,ext2 noauto,users,exec,rw 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/sda2
sudo -u melchizedek mount /mnt/sda3

Change the file permissions using the following command:

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


Reboot

Wednesday 25 April 2007

Editing the GRUB installer after a clean install (Mepis 6.5)

Allow your machine to boot into GRUB. Choose an OS from the menu and click enter. GRUB will try to load but will quickly come up with an error 22, stating that the partition doesn't exist, or some such. It will then revert back to a text version of GRUB. Again, highlight an OS, but instead of pressing "enter" press "e" to go into edit mode. You can then manually change the text string from hd1,2 to hd0,2, hit enter and then "b" (to boot).

After Mepis has loaded, with super user privileges, edit the /boot/grub/menu.lst files to make the changes permanent.

Your menu.lst file should look something like this......

timeout 15
color cyan/blue white/blue
foreground ffffff
background 0639a1

gfxmenu /boot/grub/message

title MEPIS - newest kernel
root (hd0,4)
kernel /boot/vmlinuz root=/dev/sda5 nomce quiet vga=791 resume=/dev/sda6
boot

title MEPIS - previous kernel (if any)
root (hd0,4)
kernel /boot/vmlinuz.old root=/dev/sda5 nomce quiet vga=791 resume=/dev/sda6
boot

title MEPIS - kernel 2.6.15-27-desktop
root (hd0,4)
kernel /boot/vmlinuz-2.6.15-27-desktop root=/dev/sda5 nomce quiet vga=791 resume=/dev/sda6
boot

title Windows XP
rootnoverify (hd0,0)
chainloader +1


title MEMTEST
kernel /boot/memtest86+.bin

Save the file and then reboot. You should now be able to log into either OS on the menu.

Monday 23 April 2007

Getting Synaptic/D-Link DSL-G624T Router To Work (Mepis 6.5)

First, type in this:

su
kate /etc/resolv.conf

Then hash out the entry that's there and add two new nameservers, so it looks like below:

nameserver 208.67.222.222
nameserver 208.67.220.220
#nameserver 192.168.1.1


Save and then retry Synaptic. If the fix works, when you reboot it'll reset, so you need to edit your dhclient.con file to make the fix permanent.

su
cp /etc/dhcp3/dhclient.conf /etc/dhcp3/dhclient.conf.bak
kate /etc/dhcp3/dhclient.conf


Find this line in the code.....

#prepend domain-name-servers 127.0.0.1;


and replace it with......

prepend domain-name-servers 208.67.222.222, 208.67.220.220;


(notice I've removed the hash symbol as well as changing the servers).

Next, look for the "domain-name-servers" line, and remove it. The text will look something like this........

request domain-name-servers, subnet-mask, broadcast-address, time-offset, routers, domain-name, host-name, netbios-name-servers, netbios-scope;


Remove the bit that says "domain name servers," making sure you remove the comma too. Save the file and then restart your network. The changes should then hold on reboot.

How to Mount Filesystems in Linux

Learn what is mounting and how to mount partitions and filesystems. You need to know how to mount if you want to, for example, access floppies or CD-ROMs or Windows partitions in Linux!

What is mounting?

As you know, you can store your data in different physical storage devices, like floppies, CD-ROMs, and hard disk drives. Your hard disk or disks are also very likely split up into different partitions with different filesystems.

If you're migrating to Linux from Microsoft Windows, you're probably used to accessing all your filesystems very easily: you just boot up your puter, go to My Computer, and find all your Windows partitions there immediately. For example, if you have a second hard drive (or a second Windows partition), it automatically appears as D:\ and you can immediately access it. The same goes for floppies, CD-ROMs, digital cameras, and other storage devices - you just plug them in, and you'll be able to immediately access them. However, this isn't the case in Linux.

You're probably a bit confused at first: you put your floppy or CD into the drive and start wondering why you're not able to access it! This is because your floppies, CDs, hard disk partitions, and other storage devices must be attached to some existing directory on your system before they can be accessed. This attaching is called mounting, and the directory where the device is attached is called a mount point.

After the device is mounted, you can access the files on that device by accessing the directory where the device is attached. When you're done and want to remove the floppy or CD or other device, you need to detach, unmount, it before removing it.

How to mount.

Mounting is done with the mount command.

When mounting, you must tell the mount command what is the device or partition you want to mount and what is the mount point. The mount point must be a directory that already exists on your system. For example, to mount your floppy:

$ mount /dev/fd0 /mnt/floppy


In this example, /dev/fd0 is your floppy drive, and /mnt/floppy is the mount point. Now when you access /mnt/floppy, you'll actually access the files on your floppy.

Usually /dev/fd0 is your floppy drive, although some distros are configured so that /dev/floppy is the same thing as /dev/fd0. Usually your CD-ROM is configured the same way: /dev/cdrom is your CD-ROM device (or, more specifically, /dev/floppy is a symbolic link to your actual floppy drive, and /dev/cdrom is a symbolic link to your CD-ROM drive).

Where to mount.

Although many Linux distros have directories like /mnt/floppy or /floppy created by default so you can mount your floppies there, you're not forced to use these directories. Using the mount command, you can mount your devices or partitions into any existing directory you want!

Usually your Linux distro is configured so that one particular directory is the default mount point for one particular device. In most distros it's /mnt/floppy or /floppy for floppies, and /mnt/cdrom or /cdrom for CD-ROMs. When this is the case, you don't need to tell mount the whole device name: just give either the device or mount point and you're ok. For example, if /mnt/floppy is the default mount point for /dev/fd0 (or whatever your floppy drive is), this would mount your floppy:

$ mount /mnt/floppy


The default mount points for different devices are configured in a file called /etc/fstab. The root user can freely edit the mount points configured in that file. If you're interested in learning how this file works, have a look at the Editing and understanding /etc/fstab tuXfile.

How to unmount.

Unmounting is done with the umount command. No, I didn't make a typo: the command really is umount, not unmount.

When unmounting, you'll need to tell umount what mounted device to unmount, either by telling what's the device or the mount point. For example, if /dev/fd0 is mounted to /mnt/floppy, you'll unmount it with

$ umount /mnt/floppy


or

$ umount /dev/fd0


It's not wise to remove the floppy from the floppy drive without unmounting it first! In the worst case the data you were writing to the floppy wasn't written into it yet. With CD-ROMs you can't do this: the tray won't even open if you haven't unmounted the CD first.

Mandriva's automount.

In Mandriva Linux you can just stick in your floppy or CD-ROM and immediately access the files on them, without mounting them first. After you're done, you can just remove them from the drive without unmounting them first. This can be done because of a tool called automount.

automount automatically mounts all the partitions and devices listed in /etc/fstab, no matter if the devices are physically there or not. This way you can access devices in Mandriva without mounting and unmounting them yourself.

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