Tag Info

Hot answers tagged

27

You can simple run: mount -a -a Mount all filesystems (of the given types) mentioned in fstab. This command will mount all (not-yet-mounted) filesystems mentioned in fstab and is used in system script startup during booting.


22

Hell yes. If you execute the ln -s you create a symbolic link, which is an inode pointing to a certain filesystem object, which is why symlinks can traverse filesystems and hard links cannot: hard links do not have their own inode. If you mount a filesystem with --bind, you create a second mountpoint for a device or filesystem. If you envision a symlink as ...


22

If I had a volume mounted at /media/3tb-vol1/Private/, and I wanted to bind it to /srv/Private I have a /etc/fstab like this. /media/3tb-vol1/Private/ /srv/Private none bind


13

You need to change the permissions of the mounted filesystem, not of the mount point when the filesystem is not mounted. So mount /var/lib/mysql then chown mysql.mysql /var/lib/mysql. This will change the permissions of the root of the MySQL DB filesystem. The basic idea is that the filesystem holding the DB needs to be changed, not the mount point, unless ...


10

If your BIOS is detecting devices in a different order you can mount by label or by UUID. (You can see your /boot mount is already doing this.) LABEL=filesystemlabel /mnt/directory type options -or- UUID=uuidhere /mnt/directory type options You can get the UUID with the blkid command or the label with e2label. ...


10

There are a couple problems with the initial suggestion you list, though it seems like it's headed in a good direction: For security purposes, the mkdir command should create the directory with the sticky bit set in the mode: mkdir -m 1777 /mnt/tmp The -o nobootwait doesn't seem necessary as this is not being saved in /mnt/fstab. So, I'd recommend ...


9

The mount command accepts --bind or -o bind. In the /etc/fstab file, you can use the following line: /proc /chroot/mysql/proc none defaults,bind 0 0


8

A more robust approach, since you're running Ubuntu, would be to put Eric Hammond's suggestion inside an Upstart script, and have the bind done immediately after mounting /mnt: # File /etc/init/mounted-mnt.conf # mounted-mnt - Binds /tmp to /mnt/tmp description "Binds /tmp to /mnt/tmp" start on mounted MOUNTPOINT=/mnt task script test -d ...


8

Setup a second server as a slave. You probably want a master/master setup so either host can take writes. Move the IP over to this second machine. Now you can do your maint on the first machine. This will minimize the downtime for the MySQL service.


8

They're identical - both use ntfs-3g in (current) Ubuntu; the ntfs utils are just symlinked to ntfs-3g. # which mount.ntfs /sbin/mount.ntfs # which mount.ntfs-3g /sbin/mount.ntfs-3g # ls /sbin/mount.ntfs* -l lrwxrwxrwx 1 root root 13 2011-03-01 21:13 /sbin/mount.ntfs -> mount.ntfs-3g lrwxrwxrwx 1 root root 12 2011-03-01 21:13 /sbin/mount.ntfs-3g -> ...


8

Try replacing auto with _netdev in the options in /etc/fstab - this should make the mount wait until the network is up.


7

As has been mentioned in the comments, grab the disk's UUID and stick this in your fstab; UUID=66a7ba58-b1e2-4d91-9b5e-085064a954ab /stor ext4 defaults 0 0 (replace the UUID value with that of your own). As simple ls -la /dev/disk/by-uuid (which is just a collection of symlinks named the UUID of the disk which point to the real device's identifer ...


6

You don't edit /etc/mtab manually. You can, though, change your /etc/fstab to add or remove persistent mount points, i.e. the ones that will be mounted on startup. Also, the /etc/fstab file is used by the mount(8) command to refer to mount points. You can safely define new mount points, or delete existing ones in /etc/fstab without altering the current ...


6

Look at your /etc/mtab, /proc/swaps files and look at the output of mount. This should give you enough information to re-construct your fstab.


6

The mount command take an --fake or -f for short. The following command should do what you need: mount -fav The following is in the documentation for -f option: Causes everything to be done except for the actual system call; if it's not obvious, this ``fakes'' mounting the filesystem. This option is useful in conjunction with the -v flag to determine ...


6

There's a few things you could try: Assuming that they are still not mounted when you can login, does a mount -a cause any errors to get printed to your terminal? This will only use information available in the fstab to mount all available mounts, and should provide details of any mounts that are still failing to succeed. If you get no errors, and still ...


5

mount attaches a device node (physical disk, remote nfs mount, etc.) to a directory. What you're trying to do is map one directory to another directory. There are a few ways to handle this. The most common is called a symbolic link. It essentially creates a filesystem entry that redirects to another location within the filesystem. If you simply want ...


5

Yes, it would work. Or you can manually add it like: mount -o remount,noatime /dev/sd0 /mnt


5

You can copy the lines started with /dev/sd** from mtab and paste them in to a new text file and change /dev/sd** with UUID or LABEL. For example from your config: use UUID="3fc55e0f-a9b3-4229-9e76-ca95b4825a40" / ext4 rw,errors=remount-ro 0 0 instead /dev/sda1 / ext4 rw,errors=remount-ro 0 0 The line above also works, but UUID is the new standart and ...


5

To answer your question directly, there's nothing wrong with your fstab. You can't just add entries to your fstab willy nilly. This file is there for you to intruct the OS which disk partitions to mount, and to which locations in the filesystem. If you want to create different mount options for /home, /tmp, and /var, then you will need to create three ...


5

Add uid and gid like these: /dev/mapper/db-db /var/lib/mysql ext3 realtime,rw,exec,uid=frank,gid=www-group 0 2 You can use actual user/groupnames (beware of spaces) or numeric uid, gid values. I added rw and exec which might further help you prevent access troubles (presuming you are on a development system, not a production server). PS: I ...


5

Ensure that the netfs service is enabled. Use either ntsysv or chkconfig to enable it.


5

What share do you want to mount? Some allow to put credentials into external files only readable by root. This is the preferred way to handle this. An example: CIFS/SMB knows the option credentials=filename where filename is a file with the following content: username=value password=value domain=value See man mount.cifs for more information.


5

Long term, this is the sort of tasks that configuration management tools (e.g., puppet, chef, ansible) are made for. For a short term solution, I'd use something like func or fabric to push out your fstab file. Going to run through an example of using fabric since that's the one I'm most familiar with. Installation depends on your distro. One of these is ...


4

NFS. Over wireless. Using a b/g client (are you even sure you're linked up a G rates?). You're going to have a bad time here. Even if you're linked up at the theoretical maximum for 802.11g (54Mbps), and there is no RF interference (very unlikely in the 2.4GHz band), you still have a theoretical max of about 6.75MBps. Count in protocol overhead, ...


4

A workaround is to edit /etc/fstab to use the _netdev mount option. From mount man page: _netdev The filesystem resides on a device that requires network access (used to prevent the system from attempting to mount these filesystems until the network has been enabled on the system). Other possibilities are to use the ...


4

According to the fstab manual: The order of records in fstab is important because fsck(8), mount(8), and umount(8) sequentially iterate through fstab doing their thing. So yes, lines in the beginning got processed first, so put /var before /var/www. As to the second question: you can safely mount filesystems within a mounted one, it will work.


4

File /etc/mtab is maintained by the operating system. Don't edit it. File /etc/fstab defines what should be mounted. It is read at system start. When I add an extra disk to a system that should be mounted at system start I add it to /etc/fstab. To check the correctness of the updated /etc/fstab I use the command mount -a. That reads /etc/fstab as system ...


4

You don't have to follow this blindly as a hard rule. But the reasoning for more security-focused situations is as follows. The nodev mount option specifies that the filesystem cannot contain special devices: This is a security precaution. You don't want a user world-accessible filesystem like this to have the potential for the creation of character ...



Only top voted, non community-wiki answers of a minimum length are eligible