LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-10-2011, 09:54 AM   #1
deriklogov1983
LQ Newbie
 
Registered: Aug 2011
Posts: 8

Rep: Reputation: Disabled
fstab question


Hi,

I did some changes to filesystem (mount new drives), how do I store them in fstab ? is there any way to make it automatically without editing it line by line ?
If I dont store those changes, after reboot all changes disappeared
 
Old 08-10-2011, 10:00 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello and Welcome to LinuxQuestions,

That's the nature of the beasty . All mounts you perform manually get unmounted and not mounted automatically on reboot unless they are in the /etc/fstab file. Have a look at the man page for fstab:
Code:
man fstab
to find out what options are available. Every drive mentioned in that file will be automatically mounted (unless if noauto is specified) if available.

You'll have to edit the file and add the necessary lines to it. There's no need to reboot after you've added lines, you can just run:
Code:
mount -a
to (re-)mount what's listed in /etc/fstab.

Looking forward to your participation in the forums. Have fun with Linux.

Kind regards,

Eric
 
Old 08-10-2011, 10:20 AM   #3
deriklogov1983
LQ Newbie
 
Registered: Aug 2011
Posts: 8

Original Poster
Rep: Reputation: Disabled
Hi

Thank You for your response,
I need help with fstab:

here is my current fstab

#
# /etc/fstab
# Created by anaconda on Thu Apr 8 11:22:23 2010
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=d1299467-0e6f-4e11-8a6d-90c281a5a7f4 / ext3 defaults,usrquota 1 1
UUID=6af1af7e-a8c2-4753-b103-d25fa54ea05c /boot ext3 defaults 1 2
UUID=81febb0c-a541-49c5-abee-c712884ce209 swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/tmp /var/tmp ext3 defaults,usrquota,bind,noauto 0 0



and here is the prinout of my current "mount"
How do you add those new mounted points to fstab ?

root@sub [/]# mount
/dev/sda3 on / type ext3 (rw,usrquota)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sda1 on /boot type ext3 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/loop0 on /tmp type ext3 (rw,noexec,nosuid)
/tmp on /var/tmp type none (rw,noexec,nosuid,bind)
/dev/sdb on /mysqldb type ext3 (rw)
/dev/sdd on /home/backup type ext3 (rw)
/dev/sdc on /hard/disk_c type ext3 (rw)
/dev/sde on /hard/disk_e type ext3 (rw)
 
Old 08-10-2011, 10:28 AM   #4
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

Have you tried reading the man page for fstab to see what the numbers and codes (rw, noexec, etc...) mean? If you would have then you'd know how to format a line in fstab. Since I'm in a good mood:
Code:
/dev/sdb	/mysqldb	ext3	rw,errors=remount-ro	0	0
/dev/sdd	/home/backup	ext3	rw,errors=remount-ro	0	0 
/dev/sdc	/hard/disk_c	ext3	rw,errors=remount-ro	0	0
/dev/sde	/hard/disk_e	ext3	rw,errors=remount-ro	0	0
!! Caution !! Take into account that the directories you mention as mountpoints (second column) need to exist and that drives get mounted as root. If you need user access or users being able to mount then you'll need to modify the options. Have a look at the man page of fstab as indicated.

Kind regards,

Eric
 
  


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
fstab question drjay1627 Linux - Newbie 6 10-01-2009 12:45 PM
Question about fstab centosfan Linux - General 3 08-14-2009 02:11 PM
fstab question cjstm Linux - Newbie 1 12-12-2004 02:46 PM
fstab question. buckwheat12 Fedora 6 03-05-2004 06:31 PM
i have an fstab question... isajera Linux - General 7 12-21-2001 02:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:38 PM.

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