Fstab And Auto Mounting

am i right in saying that fstab only describes to the system what partitions should be mounted to what device (location) i know it can do a bit more than that...

but how do you get the system to mount file systems automatically at start up? is that a setting within fstab? under mount options...or is it a command that you need to type...or is it in another config file?


Similar Content



Are These Two Mount Statements The Same

hi experts

I got an NFS mount that I want to make permanent. So I know I have to added it in etc/fstab. but all I have is the mount shown below:

Code:
mount test.com:/vol/myhome /home

correspondingly, I have googled a sample nfs mount entry for fstab and made this:

Code:
#in fstab
test.com:/vol/myhome    /home    nfs  rw,soft,intr    0       0

are they same? I mean like permission wise and everything?

Thanks

Auto Mount 2 Hard Drives Attached By USB To Router

Hi all. My first time post and very new to linux.
I am using linux Mint Debian version.

My goal is to auto mount 2 external harddrives (Each hard drive is 2TB) attached to the 2 usb ports on my asus wireless router model rt-n56r.

I have succeeded in auto mounting my first drive HDD1 by configuring fstab file:

//192.168.1.1/HDD1 /media/public cifs username=**,password=**,rw,nounix,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0

At boot this partition is mounted without issue.

In attempting to mount the second hard drive HDD2 I added another entry in fstab as follows:

//192.168.1.1/HDD2 /media/public cifs username=**,password=**,rw,nounix,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0

It appears that both HDD1 and HDD2 mount however, when entering the partition only files and directories of the second hard drive appear.

So I changed the mount point in the second hard drive to reflect /media1/public1 and after the configuration neither hard drive appears to have mounted.

I tried using UUID instead of path to partition but cannot get even 1 attached hard drive to mount.

I appreciate in advance the help and assistance to my query.

Help Mounting A CD-R/DVD-R, Then Using Dd To Write To Them.

I can't seem to mount a CD-R or DVD-R, doesn't matter if it is blank or not.
However, when I use a program such as Brasero, I am able to write to them. I cannot use dd to write to them.

This is the output of trying to mount/unmount.
Code:
root@delarocha-> mount /dev/sr0 /media/cd
mount: /dev/sr0 is write-protected, mounting read-only
mount: wrong fs type, bad option, bad superblock on /dev/sr0,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail or so.

root@delarocha-> umount /dev/sr0
umount: /dev/sr0: not mounted
root@delarocha-> umount /media/cd
umount: /media/cd: not mounted
root@delarocha-> umount /media/cdrom
umount: /media/cdrom: not mounted

dmesg | tail
Code:
root@delarocha-> dmesg | tail
[ 1536.299777] sr 1:0:0:0: [sr0]  
[ 1536.299804] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 1536.299809] sr 1:0:0:0: [sr0]  
[ 1536.299814] Sense Key : Illegal Request [current] 
[ 1536.299820] sr 1:0:0:0: [sr0]  
[ 1536.299824] Add. Sense: Logical block address out of range
[ 1536.299829] sr 1:0:0:0: [sr0] CDB: 
[ 1536.299832] Read(10): 28 00 00 00 00 00 00 00 01 00
[ 1536.299846] end_request: I/O error, dev sr0, sector 0
[ 1536.299915] EXT4-fs (sr0): unable to read superblock

I don't think it can be anything wrong with the disk, since it is a untouched disk.
Note: The results of everything(apart from dmesg I would assume), are the same for a CD-R and DVD-R

This is what I get while trying to dd a .iso and .mp4, respectively.

Code:
web@delarocha-> dd if=/dev/sr0 of=~/Downloads/xubuntu-14.04.1-desktop-amd64.iso
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.000377316 s, 0.0 kB/s

Code:
web@delarocha-> dd if=/dev/sr0 of=~/Videos/The\ Hobbit/The\ Hobbit\ The\ Desolation\ of\ Smaug.mp4
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.000377179 s, 0.0 kB/s

uname -a
Code:
Linux delarocha 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt2-1 (2014-12-08) x86_64 GNU/Linux

When I used lsblk when I close the disk tray, it shows it mounted.
Code:
sr0                     11:0    1     2K  0 rom

But after I use the dd command to write the .iso, it disappears.

Here is my /etc/fstab
Code:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
/dev/mapper/delarocha-root /               ext4    errors=remount-ro 0       1
# /boot was on /dev/sda1 during installation
UUID=5bbedec0-6e3d-4185-91e0-292a72585908 /boot           ext2    defaults        0       2
/dev/mapper/delarocha-swap_1 none            swap    sw              0       0
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/sdb1       /media/usb0     auto    rw,user,noauto  0       0

I have also tried replacing /dev/sr0 in the above commands with /media/cdrom0.

Mounting A USB For Vbox

I am installing VirtualBox on Centos per http://www.digitesters.com/centos-in...adless-system/, and I don't understand the very end. Seems like Line 5 is not needed as it is already done on Line 4, right?

Code:
# mkdir /data/virtual_machines/vbox/vbusbfs
# chown vboxuser.vboxusers /data/virtual_machines/vbox/vbusbfs
# chmod 775 /data/virtual_machines/vbox/vbusbfs
# echo "none /data/virtual_machines/vbox/vbusbfs usbfs rw,devgid=$(awk -F : '/vboxusers/ {print $3}' /etc/group),devmode=664 0 0" >> /etc/fstab
# echo "none /data/virtual_machines/vbox/vbusbfs usbfs rw,devgid=$(awk -F : '/vboxusers/ {print $3}' /etc/group),devmode=664 0 0" >> /etc/fstab
# mount -a

I executed the above script (except didn't execute Line 5, and my user:group is vbox:vbox and not vboxuser.vboxusers, and the folder is at /home/vbox and not /data/virtual_machines/vbox), and the following was added to /etc/fstab. Please explain what Line 4 did and what the below line in my fstab file means.
Code:
none /home/vbox/vbusbfs usbfs rw,devgid=496
504,devmode=664 0 0

I then executed mount -a, and got the following response. The part about /var/www/main/ayb_resources and /var/www/main/ayb_cache does not exist is probably some old stuff which I can get rid of, but I am particularly interested in "mount point 0 does not exist" as it seems to be related to the above.

Code:
[root@devserver vbox]# mount -a
mount: special device /var/www/main/ayb_resources does not exist
mount: special device /var/www/main/ayb_cache does not exist
mount: mount point 0 does not exist
[root@devserver vbox]#

My total fstab file is as follows:

Code:
[root@devserver vbox]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Sat Apr 19 05:57:56 2014
#
# 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
#
/dev/mapper/VolGroup-lv_root /                       ext4    defaults        1 1
UUID=xxx-xxx-xxx-xxx-xxx /boot                   ext4    defaults        1 2
/dev/mapper/VolGroup-lv_home  /home                  ext4    defaults        1 2
/dev/mapper/VolGroup-lv_mysql /var/lib/mysql         ext3    barrier=0       1 2
/dev/mapper/VolGroup-lv_swap 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
/home/public/lib /var/www/main_lib/ayb_application/lib none bind
/var/www/main/html /var/www/main_lib/html none bind
/var/www/main/ayb_resources /var/www/main_lib/ayb_resources none bind
/var/www/main/ayb_cache /var/www/main_lib/ayb_cache none bind
none /home/vbox/vbusbfs usbfs rw,devgid=496
504,devmode=664 0 0
[root@devserver vbox]# mount -a
mount: special device /var/www/main/ayb_resources does not exist
mount: special device /var/www/main/ayb_cache does not exist
mount: mount point 0 does not exist
[root@devserver vbox]#

How To Remount Root Partition On System Booted From External Usb Drive

Hello,
I have a setup with arch linux installed on external ssd as normal (non-live) installation.
I had to do that after my main laptop was broken. I don't want to put my drive into the new hardware, so I run it as external one for until the main will be repaired.

It boots as usual, everything is working fine until the usb drive reconnects for some reason (may be the physical connection problem). It probably mounts itself as read-only, the system freaks out and dies slowly from I/O errors process by process. I cannot issue commands from shell, even reboot. I have to physically reset the machine.

Is there a way to change its behaviour to auto remount as rw after reconnecting the USB and just keep running as usual?

I think the fstab is the file that i should modify, but cannot find a way how to do it properly. Please correct me if I'm wrong. My current fstab:
Code:
# 
# /etc/fstab: static file system information
#
# <file system>	<dir> <type> <options> <dump> <pass>
# /dev/sdb2
UUID=145b3c51-6531-48f3-a79b-fb1ae238c7ee / ext4 rw,relatime,data=ordered 0 1

# /dev/sdb1
UUID=AFC4-6899 /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 2

/swapfile none swap defaults 0 0

Mounting An External USB Hard Drive

My attempts to back-up to an external hard disk finally met with apparent success but I cannot now mount the target drive.

To summarize:-
1. Installing a SATA hard disk, identical to my computer's main drive, in a USB 2.0 caddy and attaching this to the computer resulted in qualified recognition. 'fdisk' 'saw' both the main drive, as sda, and the USB drive, as sdb, respectively but initially noted that the latter, “... doesn't contain a valid partition table.” This was hardly surprising. At the point of first connection the external drive was essentially a 'bare metal' device, having had its data wiped. Nevertheless, 'fdisk' correctly reported its size, number of heads and cylinders, etc.
2. 'dmesg' also correctly identified the external disk as sdb, reporting its type and the USB port to which it is connected.
3. 'df' ignores the second hard drive, reporting only the main disk.
4. Attempts to clone/back-up the main disk to the external disk using the recommended tools EaseUS Todo back-up and RedoBackup, booting respectively from appropriate USB memory sticks, both failed. Neither utility was prepared to write to the external disk. EaseUS acknowledged the latter but crashed the whole computer when instructed to perform the clone. RedoBackup failed to recognize the external disk.
5. Then came the break-through. A bit more Net browsing led me to try the command 'dd if=/dev/sda of=/dev/sdb'. The main disk was bit-copied (cloned) to the external disk at roughly 20Gb per hour, meaning that my 80Gb disk was copied in just under 4 hours. Checking 'dd's resulting report showed what appeared to be a perfect copy.

So far, so good. I now have a back-up which, being identical to the main disk, should, I assume, be bootable. In the event of trouble with the main disk I should be able simply to exchange it for the external disk and carry on from the point at which I made my last back-up. I cannot, however, access and read the external disk. I assume that it must have a partition table and be mounted. The first requirement appears to have been resolved by the cloning operation. 'fdisk' reports no trouble with the partition table on the cloned external disk. It lists /dev/sb1 as the bootable Linux partition, /dev/sdb2 as the Extended partition and /dev/sdb5 as the Linux swap / Solaris partition, exactly mirroring the corresponding entries for the main, sda, drive.

My attempts to mount the external disk have all failed, however. I clearly do not understand the syntax of the mount command or have failed to meet some other requirement. 'mount' objected without hesitation to my early mistakes but “mount -t dev/sdb” was instantly accepted. No error messages or other output resulted and the command prompt was immediately redisplayed but 'mount' then failed to show that the external drive had been mounted. If I try something like 'mount -t /dev/sdb1 /mnt/xdisk', where xdisk is a directory I have been told to create, then I am presented with a prolix description of 'mount's syntax, most of which leaves me bewildered. 'mount' then once again confirms that sdb1 does not feature in the list of mounted devices.

Can someone offer any suggestions? I have read one or two of the other posts on this topic but none of the details match my problem too well and I did not understand some of the replies. If I try to add a line to /etc/fstab, for example, I find that I do not have a directory called 'fstab', only 'fstab.d' and that is empty.

I have roughly one year's experience with Linux Mint 13 which I chose because it so closely resembled Windows XP.

Mounting Separate Partitions That Are Not "normal"

I want my Plex Media Server, Web Server, and Honeypot running on separate partitions. I've formatted them how I want:

SDA7 is my MediaCentre, formatted in XFS, I'd like this mounted as a separate partition and I'd like this to be the location of the Plex Media Server.

SDA8 is my WebServer, formatted in ext4. I'd also like this mounted as a separate partition and be the location of my Web Server (Probs use LAMP and an FTP Download Client).

SDA9 is my Honeypot server, formatted in XFS. Again, I'd like this to be mounted on a separate partition and will be where my Honeypot Server lives.

I'd also like all three servers to be running on VM's to help isolate them.

How do I go about accomplishing this? I'm a Windows native. In Windows I'd have partitioned everything, Created the virtual machines, moved them to their respective partitions, then installed all of the applications.

First things first, how/what do I mount these drives as? Can I just mount them as /mnt/mediaserver and /mnt/webserver etc? Will these mount points then be recognised?

Creating A Mount Point For A Partition From Live USB

Hello all,

I was working through LFS 7.7 Chp 2.4 and mounted a wrong partition to /mnt/lfs.
I did the following commands while trying to mount the correct LFS partitions:
mount -v -t ext4 /dev/sda8 /mnt/lfs
mount -v -t ext4 /dev/sda9 /mnt/lfs/home
but I was supposed to mount sda11 and sda 12.

Now the system won't boot past the splash screen. I tried booting into a live usb and typed in the following commands
mount -v -t ext4 /dev/sda8 /
mount -v -t ext4 /dev/sda9 /home
but the system still won't boot past the splash screen.
Both gparted and the partition manager for the installer don't show a mount point.

How do I create a mount point from USB or is there another problem/solution?

Thanks

Centos /etc/fstab Command Doesn't Mount After Restart

Hi

I am using Centos 6.5 and i am testing Glusterfs.

I have at /etc/hosts :

Code:
123.456.789.000 host1
000.987.654.321 host2

And they can ping each other and all working great...

Glusterfs requires this command:

Code:
mount host1:/gluster-vmstore /home/nginx/public -t glusterfs

and if i run it manually it works great.

But when i restart checking using df -h is gone and is not working until i run it again manualy

I found on a tutorial that this edit on /etc/fstab will work after restart:

Code:
host1:/gluster-vmstore /home/nginx/public glusterfs defaults 0 0

But after restarting it was not working

Any ideas?

Thanks

Recovering After Windows 7 Install: Rescue Cannot Mount Root

I have a dual boot laptop with debian stable & Windows 7.

The HD partitions a
sda1: NTFS for W7
sda2: FAT32 (currently unused)
sda3: linux /boot
sda4: linux ext4, which is LVM with encryption

I've re-installed W7 and now need to recover the MBR & grub menu.

I've booted with the netinst usb in rescue mode, but it fails to mount the root partition /sda4:
"An error occured while mounting the device you entered for your root file system (/dev/sda4) on /target"

and /var/syslog shows:
Code:
rescue-mode: selected root device '/dev/sda4'
umount: cant umount /target: Invalid argument
isofs_fill_super: bread failed, dev=sda4, iso_blknum=16, block=32
EXT2-fs (sda4): error: unable to readsuperblock
EXT3-fs (sda4): error: unable to readsuperblock
rescue: mount: mounting /dev/sda4 on /target failed: Invalid argument

So it seems like something is wrong with the mount command?

Would appreciate suggestions how to solve this.

Thanks