LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-21-2009, 10:02 AM   #1
Chenchu
Member
 
Registered: Nov 2009
Location: Mars
Distribution: CentOS
Posts: 50

Rep: Reputation: 20
mount a filesystem with /etc/fstab


hey guys,
i'm trying to mount a filesystem when the system boots, so i won't need to mount it everytime..

so what I did was copying the line of the filesystem I wanted to mount on startup from /etc/mtab:

Code:
/dev/sda1 /media/209CDAF39CDAC308 fuseblk rw,nosuid,nodev,allow_other,blksize=40
96 0 0
and pasted it as it is, in the /etc/fstab file.
when the system booted, it didn't work. not only that, I wasn't able to mount the filesystem at all, (it gave me some kind of an error) so I removed the line from fstab file and it all back to normal.

how can I mount this filesystem on boot?
(i'm using Fedora 12 btw)

Last edited by Chenchu; 12-21-2009 at 04:19 PM.
 
Old 12-21-2009, 10:16 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
Is the /media mount point always the same from one mount the the next? If the mount changes from one mount to another, you should investigate writing a udev rule to create a persistent mount point. Then add the line to your fstab.
 
Old 12-21-2009, 10:22 AM   #3
Chenchu
Member
 
Registered: Nov 2009
Location: Mars
Distribution: CentOS
Posts: 50

Original Poster
Rep: Reputation: 20
Yea it's always the same.
 
Old 12-21-2009, 10:31 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by Chenchu View Post
when the system booted, it didn't work. not only that, I wasn't able to mount the filesystem at all, (it gave me some kind of an error) so I removed the line from fstab file and it all back to normal.
Please post the text of "some kind of an error". When you write "I wasn't able to mount the filesystem at all" did you try mounting /dev/sda1 somewhere other than /media/209CDAF39CDAC308? When you are able to mount the file system what does df -T show for it? Have you looked in the /var/log/* files for errors?
 
Old 12-21-2009, 11:54 AM   #5
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by Chenchu View Post
Code:
/dev/sda1 /media/209CDAF39CDAC308 fuseblk rw,nosuid,nodev,allow_other,blksize=40
96 0 0
Does "/media/209CDAF39CDAC308" exist? You should probably make a permanent mount point (e.g. /mnt/whatever) and use that instead.
 
Old 12-21-2009, 01:15 PM   #6
Chenchu
Member
 
Registered: Nov 2009
Location: Mars
Distribution: CentOS
Posts: 50

Original Poster
Rep: Reputation: 20
When I tried to mount the filesystem after the system booted, part of the error was
"/media/209CDAF39CDAC308" doesn't exist..

but everytime I mount this device, it's mounted to this mount point. can I make this mount permnant? to this mount point?
 
Old 12-21-2009, 01:57 PM   #7
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by Chenchu View Post
When I tried to mount the filesystem after the system booted, part of the error was
"/media/209CDAF39CDAC308" doesn't exist..
but everytime I mount this device, it's mounted to this mount point.
It must be automatically created by some daemon that scans for new devices.

Quote:
Originally Posted by Chenchu View Post
can I make this mount permanent? to this mount point?
You shouldn't use "/media/anything" if you want it permanent. The "/media" tree seems to be used by auto-mounting daemons. Google "linux automount" and "autofs" if you want to know more.

Instead, create "/mnt/your-creative-name-here" where you replace "your-creative-name-here" with something descriptive (or not). For example, if it is a thumb drive, you can use "/mnt/thumb". Then you can create an fstab entry that uses that mount pount.

Then all you have to do to mount the device is use "mount /mnt/thumb" (or "sudo mount /mnt/thumb").
 
Old 12-21-2009, 02:04 PM   #8
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

Rep: Reputation: 203Reputation: 203Reputation: 203
don't forget to mkdir /the/mount/point before you try toboot with the edited fstab. In the example above
Code:
mkdir /mnt/thumb
to try out your edit without rebooting use
Code:
mount -a
which will read fstab and mount those entries.
 
Old 12-21-2009, 02:09 PM   #9
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by damgar View Post
don't forget to mkdir /the/mount/point before you try to boot with the edited fstab.
I thought
Quote:
Originally Posted by David1357 View Post
Instead, create "/mnt/your-creative-name-here" where you replace "your-creative-name-here" with something descriptive (or not). For example, if it is a thumb drive, you can use "/mnt/thumb".
implied the use of "mkdir". But thanks for making it clear.
 
Old 12-21-2009, 02:13 PM   #10
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

Rep: Reputation: 203Reputation: 203Reputation: 203
Wink

Quote:
Originally Posted by David1357 View Post
I thought

implied the use of "mkdir". But thanks for making it clear.
It probably did, but I always need things spelled out for me, so it's habit to do the same.
 
Old 12-21-2009, 04:17 PM   #11
Chenchu
Member
 
Registered: Nov 2009
Location: Mars
Distribution: CentOS
Posts: 50

Original Poster
Rep: Reputation: 20
Okay I tried what you guys said, mounting it to /mnt/directory-i-created and it works.

here is how I got into this problem at first place,
the device is actually my windows-xp partition, so when I opened the Computer window, it showed me all the different partition i've on my HD plus the linux filesystem. each one as a diff HD icon.
so I tapped on the xp partition (which is the largest so most of my files are over there) and it asked me for my root pass. as I entered it, it mounted it to /media tree. then I linked few directories to my desktop, and after reboot that prob came up. I solved it by what you guys just said.

I got a brief overview of what autofs is right now.. guess i'll learn more on it later when I get to that in my study books.
thanks for the help fellas! much appericiated
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
* KipBond "rescue" mode can't mount filesystem w/ LABEL=/ in fstab KipBond Red Hat 0 02-06-2008 07:09 PM
fstab problem: mount: can't find dvd in /etc/fstab or /etc/mtab Nikon01 Slackware 5 11-17-2006 06:15 AM
FSTAB: My Win Share Wont Mount @ Boot, but will when I sudo mount -a...please help! TruANTOlogy Ubuntu 8 06-20-2006 08:00 AM
Using fstab to mount a filesystem in multiple places cav Linux - General 3 02-09-2004 02:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration