[x] Welcome to LinuxSolved.com Linux help forums, here we are a community of Linux users helping each other. It is helpful to both ie. new linux users as well experienced one. We always have our experts to help you and ofcourse members help each other, so you can ask for help any time by Registering.: Click to Register

Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Linux Forums - Linux Help,Advice & support community:LinuxSolved.com  |  Forum  |  Linux in General  |  Linux Development & Programming  |  Topic: Mounting Fat partitions automatically
The LinuxSolved.com GNU/Linux User Communit - Forum
Welcome to LinuxCommunity You have just arrived to a friendly linux community which is helping Linux Users from Years.. You can be its part if you have not already joined it. Registration is FREE and is gateway to unlimited help and support to all your linux related needs. If you are an GNU/Linux supporter then you have come to the right place.
Pages: [1]
  Print  
Author Topic: Mounting Fat partitions automatically  (Read 5404 times)
0 Members and 1 Guest are viewing this topic.
Ricky
LST CareTaker
Specially Skilled
*****
Offline Offline

Gender: Male
Posts: 2205


View Profile
« on: November 25, 2003, 06:01:16 AM »

Hi guys... i m here with a script which can mount your Fat partitions (windows partition) automatically....
I have tested it.. but i m inviting outher people to test it and if it has any problem please correct that or tell me.

Code:
#!/bin/bash
label[1]="C"
label[2]="D"
label[3]="E"
label[4]="F"
label[5]="G"
label[6]="H"
label[7]="I"
label[8]="J"
label[9]="K"
label[10]="L"

fdisk -l | grep Win95 | grep -v Extended | grep -v "Ext'd" | cut -f 1 -d" " > /tmp/scriptdump
echo "Checking FAT partitions...."
i="1"
suffix=""
found="false"
working="true"

while read device
do
if [ $working = "true" ]
then
echo "#The Partition Found by Script" >> /etc/fstab
echo -e "Found Windows FAT partition(s). \nMounting them ..."
working="false"
fi
found="true"
echo "$device /mnt/${label[$i]}$suffix"" vfat defaults 0 0" >> /etc/fstab
mkdir /mnt/${label[$i]}$suffix""
done < /tmp/scriptdump


if [ $found = "true" ]
        then
echo "# Partition mounted by script" >> /etc/fstab
mount -a -t vfat
echo -e "\nSuccessfully mounted Windows partitions"
else
echo -e "\nNo Windows (FAT) partitions found\n"
fi

rm -f /tmp/scriptdump

Copy this script to a file name :: "mountfat" and then chmod this file to 755 and then execute this script...
You should be login as root to run this script..
Logged
neo
Linux Learner
***
Offline Offline

Posts: 124


View Profile WWW
« Reply #1 on: December 10, 2003, 09:20:42 AM »

hey ricky
why donot we put the partitions to mount in fstab it will mount at startup and also unmount at shutdown.
Logged
Ricky
LST CareTaker
Specially Skilled
*****
Offline Offline

Gender: Male
Posts: 2205


View Profile
« Reply #2 on: December 10, 2003, 09:42:30 AM »

Hmm.. that script needs to be run only once..  it will autmatically give make the entries in your fstab so that you get your fat partitions mounted automatically every time you boots..
Logged
kennynoah
Linux Noob !
*
Offline Offline

Posts: 6


View Profile
« Reply #3 on: January 19, 2004, 08:05:33 AM »

how do i mount an NTFS partition
Logged
Ricky
LST CareTaker
Specially Skilled
*****
Offline Offline

Gender: Male
Posts: 2205


View Profile
« Reply #4 on: January 19, 2004, 08:50:28 AM »

Your question is already answered here..
http://www.linuxsolved.com/forums/viewtopic.php?t=118 in first reply there
Logged
huihuitiao
New Member

Offline Offline

Posts: 1


View Profile
« Reply #5 on: April 17, 2004, 12:38:36 AM »

I have four windows partitions ,c , d ,e ,f .use this script ,only mount partion c,can't mount other parttiions.why?
Logged
liquid
New Member

Offline Offline

Posts: 1


View Profile
« Reply #6 on: May 31, 2004, 04:49:37 AM »

Sad Hi ricky, i copied ur script on how mount fat partitions and i tried it. it works alright but it mounts only one fat partition a time. i have 3 fat partitions and when i restart linux it sometimes mount either of the 3 but not all and when i type df at the terminal i have duplicated drives mounted. how do i solve this problem. am kind of a newbie thanks. u've got the brain ricky.
Logged
Alien74
New Member

Offline Offline

Posts: 2


View Profile
« Reply #7 on: August 26, 2004, 02:40:54 AM »

I dont think we have to write such a long script.
we can edit the gile /etc/fstab and put enteries of partitions to be mounted automatically.
They will be mounted during booting.
 :lol:
Logged
MhykGyver
Linux Noob !
*
Offline Offline

Posts: 13


View Profile
« Reply #8 on: August 26, 2004, 08:41:34 AM »

hello again guys...i tried typing the script then saving it to mountfat then typing chmod automount 755 but it just won''t work...do i have to save the script with a .txt  extension or another? i'm kinda' lost...i also tried tinkering with the /etc/fstab but i really don't know how to add my fat partition...my fat partitions are hd8 and hd7...help please...
Logged
Linux Forums - Linux Help,Advice & support community:LinuxSolved.com
   

 Logged
Pages: [1]
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
ximian evolution, redirect mail automatically to a folder Linux Application taraj 1 1261 Last post April 05, 2004, 02:04:10 PM
by clarks
mount ntfs partitions Linux Servers Support shailesh_jain 4 1263 Last post May 26, 2004, 07:21:38 AM
by shailesh_jain
reg hardlink across partitions Linux Development & Programming deep123 6 954 Last post May 12, 2005, 01:40:45 AM
by deep123
Is there a limit on primary partitions Miscellaneous cheetahman 1 602 Last post August 16, 2005, 04:25:38 AM
by Ricky
Accessing Windows Partitions Linux Installation Support Ujjwol 1 536 Last post May 15, 2007, 05:58:41 AM
by Ricky
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 22, 2008, 11:42:09 AM

Login with username, password and session length
Navigation
Recent Discussions
[November 20, 2008, 11:30:52 PM]

[November 19, 2008, 07:52:41 PM]

[November 19, 2008, 07:52:36 PM]

[November 17, 2008, 10:42:59 AM]

[November 16, 2008, 12:49:47 AM]

[November 16, 2008, 12:48:58 AM]

[November 15, 2008, 08:29:02 AM]

[November 15, 2008, 08:24:41 AM]

[November 14, 2008, 05:11:50 AM]

[November 13, 2008, 03:28:22 AM]
Members
Total Members: 6227
Latest: karunadct
Stats
Total Posts: 8269
Total Topics: 2253
Online Today: 10
Online Ever: 111
(June 28, 2007, 06:47:29 AM)
Users Online
Users: 0
Guests: 9
Total: 9
Privacy Policy| Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks
Theme & TinyPortal v0.9.8 © Bloc