Hot answers tagged

61

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


49

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.


24

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 ...


20

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


19

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 ...


14

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 ...


13

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 /mnt/...


12

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 -> /...


12

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 ...


11

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 ...


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

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 ...


8

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


8

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 ...


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

You can see some information about currently mounted devices by looking at the contents of /etc/mtab (the syntax is quite similar to the one of /etc/fstab). You should find some useful information about mount options as well. Otherwise, you can use a simple "fstab generator" like this one: http://epistel.no/fstab/


7

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 ...


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

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


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

You have no way of predicting what the device names or IDs will be after a significant hardware change (virtual hardware in this case, from Xen to KVM). Linode is the only entity here who knows what's going to change and how you should proceed if you upgrade. With that said, don't do this. You're forcing yourself to take an outage. If it breaks, you'll be ...


5

Add uid and gid like these: /dev/mapper/db-db /var/lib/mysql ext3 relatime,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: ...


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

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

Not anymore. -o remount,noatime was an effective method of disabling atime without a reboot. I don't know that I'd say it's a good idea, but if you intend to turn atime off, I don't see what it would be a bad idea either if you have an old enough kernel. According to the man page for mount: MS_REMOUNT The following mountflags can be changed: ...


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

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


5

Probably an /etc/fstab issue. Ubuntu is trying to mount a partition present in /etc/fstab and yet not able to find that partition i.e. /dev/xvdf. In order to troubleshoot this, you need to - 1) shutdown this instance 2) Launch another instance 3) Attach the root EBS of this instance to the new instance from step(2) 4) mount the EBS from step(3) , say ...


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.



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