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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
12-21-2009, 10:02 AM
|
#1
|
Member
Registered: Nov 2009
Location: Mars
Distribution: CentOS
Posts: 50
Rep:
|
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.
|
|
|
12-21-2009, 10:16 AM
|
#2
|
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908
|
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.
|
|
|
12-21-2009, 10:22 AM
|
#3
|
Member
Registered: Nov 2009
Location: Mars
Distribution: CentOS
Posts: 50
Original Poster
Rep:
|
Yea it's always the same.
|
|
|
12-21-2009, 10:31 AM
|
#4
|
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
|
Quote:
Originally Posted by Chenchu
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?
|
|
|
12-21-2009, 11:54 AM
|
#5
|
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
Rep:
|
Quote:
Originally Posted by Chenchu
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.
|
|
|
12-21-2009, 01:15 PM
|
#6
|
Member
Registered: Nov 2009
Location: Mars
Distribution: CentOS
Posts: 50
Original Poster
Rep:
|
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?
|
|
|
12-21-2009, 01:57 PM
|
#7
|
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
Rep:
|
Quote:
Originally Posted by Chenchu
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
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").
|
|
|
12-21-2009, 02:04 PM
|
#8
|
Senior Member
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
|
don't forget to mkdir /the/mount/point before you try toboot with the edited fstab. In the example above to try out your edit without rebooting use which will read fstab and mount those entries.
|
|
|
12-21-2009, 02:09 PM
|
#9
|
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
Rep:
|
Quote:
Originally Posted by damgar
don't forget to mkdir /the/mount/point before you try to boot with the edited fstab.
|
I thought
Quote:
Originally Posted by David1357
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.
|
|
|
12-21-2009, 02:13 PM
|
#10
|
Senior Member
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
|
Quote:
Originally Posted by David1357
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.
|
|
|
12-21-2009, 04:17 PM
|
#11
|
Member
Registered: Nov 2009
Location: Mars
Distribution: CentOS
Posts: 50
Original Poster
Rep:
|
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
|
|
|
All times are GMT -5. The time now is 09:29 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|