Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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.
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.
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
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.
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)
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:
!! 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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.