Saturday, October 13, 2007

Mounting Partitions

===Mounting Other Partitions===
=====EXT3, FAT32 and NTFS=====
[[#NTFS|NTFS]]

[[#FAT32|FAT32]]

[[#EXT3|EXT3]]


===NTFS===
Mounting NTFS Partitions in Fedora 7

Fedora 7 ships with NTFS-3g. Quoting from the NTFS-3G web site [http://www.ntfs-3g.org NTFS-3G]
The NTFS-3G driver is an open source, freely available read/write NTFS driver for Linux, FreeBSD, Mac OS X, NetBSD, and Haiku. It provides safe and fast handling of the
Windows XP, Windows Server 2003, Windows 2000 and Windows Vista file systems. Most POSIX file system operations are supported, with the exception of full file
ownership and access right support.
To mount your NTFS partitions you need to
a. know what partitions you want to use
b. create a place to mount them to
c. mount them manually
d. mount them automatically
We'll start by listing the partitions on my laptop hard disk, a 160GB SATA with 4 partitions. Open a terminal as root and type
fdisk -l /dev/sda
Here's the output I get. Your's will be different.
[root@toshiba /]# fdisk -l /dev/sda
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 192 1536000 27 Unknown
/dev/sda2 * 192 16586 131684352 7 HPFS/NTFS
/dev/sda3 16587 19457 23061307+ 5 Extended
/dev/sda5 16587 17891 10482381 83 Linux
/dev/sda6 17892 19196 10482381 83 Linux
/dev/sda7 19197 19457 2096451 82 Linux swap / Solaris
As I stated, I have 4 partitions on this disk. /dev/sda1 is the Toshiba Recovery partition, /dev/sda2 is the Windows Vista partition, /dev/sda5 holds my Debian install, /dev/sda6 holds my Fedora 7 install and /dev/sda7 is the swap partition shared by Fedora and Debian. The one I'm after is the NTFS partition, /dev/sda2. Now that I know what partition is my Windows partition I need to go ahead and create a '''mount point''' for it. This will be where I mount the partition '''to'''. In the terminal, as root, type
mkdir /media/windows (you don't have to use ''windows'', you can call it anything you like)
So far we've determined what partition is the NTFS / Windows partition and created a '''mount point'''. Now all we need to do is to go ahead and mount it. In the terminal, as root, type
mount -t ntfs-3g /dev/sda2 /media/windows
Loosely translated, that's telling the file system to mount the partition /dev/sda3 to the folder /media/windows using the NTFS drivers. If there are no error messages, as there shouldn't be, you can open Nautlius and browse to the /media/windows folder and you should see all of your Windows files. To make the partition mount at boot time we need to add a line to the /etc/fstab file. In the terminal as root type
gedit /etc/fstab
Add a line at the bottom of the file
/dev/sda2 /media/windows ntfs-3g defaults 0 0
Save the file and close the editor. Your partition will now mount automatically at boot time.

=====FAT32=====
Mounting FAT32 Partitions

To mount a FAT32 partition, we follow the same steps that we used for the NTFS partitions. The difference here is the use of VFAT for mounting instead of NTFS-3G. If my NTFS partition, /dev/sda2, was FAT32 this is how we would set it up. Open a terminal as root and create a '''mount point'''.
mkdir /media/windows
Mount the partition.
mount -t vfat /dev/sda2 /media/windows
That's all there is to it. Using Nautilus you should be able to browse to /media/windows and see all of your files. To make the partition mount at boot time we need to add a line to the /etc/fstab file. In the terminal as root type
gedit /etc/fstab
Add a line at the bottom of the file
/dev/sda2 /media/windows vfat defaults 0 0
Save the file and close the editor. Your partition will now mount automatically at boot time.

=====EXT3=====
Mounting EXT3 Partitions

To mount an EXT3 partition, we follow the same steps that we used for the NTFS partitions. The difference here is the use of EXT3 for mounting instead of NTFS-3G. Using the Debian partition, /dev/sda5 as an example, here's how we would mount it. Open a terminal as root and create a '''mount point'''.
mkdir /media/debian
Mount the partition.
mount -t ext3 /dev/sda5 /media/debian
That's all there is to it. Using Nautilus you should be able to browse to /media/debian and see all of your files. To make the partition mount at boot time we need to add a line to the /etc/fstab file. In the terminal as root type
gedit /etc/fstab
Add a line at the bottom of the file
/dev/sda5 /media/debian ext3 defaults 0 0
Save the file and close the editor. Your partition will now mount automatically at boot time.

Return to [[Fedora 7]]

No comments: