I've decided to go the way of the consensus and mount USB drives to a directory. So, I did some research and found someone who edited fstab to make mounting to a directory on the Desktop.
So, all I need to do is edit the /etc/fstab file.
In place of the device path I'm using the drives UUID so I don't have to worry about the devices getting shuffled during unmount, and I use the Desktop directory path as the mount point (yes, I created a fstab.bak backup file) and save it as fstab_mount for quick copy, you'll see why in just a little bit.
Lines added to fstab:
The Type and Option are all copy and paste from the systems original fstab.
Next all I need to do is mount the mount point: USB1 and Flash. Unfortunately I have to be on the Desktop to do this, is there a script I can write that I can click on and do it without being on the desktop in the terminal?
As you can see it fails to mount the thumb drive "Flash" because it can not be found in fstab." This is because after every mount the fstab is being overwritten with each "mount".
I edit fstab in "nano /etc/fstab", I've even used sudo nano, but it keeps getting overwritten. I have also used "mount -a" after the edit as some users have advised in other posts.
So I copy fstab_mount to /etc/fstab and mount the falsh drive:
and again fstab is overwritten again.
Help is very sparse on the web, and all they talk about is being overwritten on Boot, not mount. I'm using a CAINE 7.0 Live CD, so no booting.
So I got to thinking, it could be the end of each line calling the file: "# by rbfstab".
I removed “ # by rbfstab” from end of each line entry. On mount the bootup defaults are appended to the end of fstab (see below), on the first mount ONLY, Why only the first one???
So, why is /etc/fstab being automatically overwritten on a mount, even with rbfstab disabled?
Why is fstab being appended to with the "bootup" settings on the first mount only?
What is the mount process calling?
The OS runs in the background checking for new devices plugged in, is this what is happening? But why would it append to fstab if the devices match what's already there (except the removal of # by rbfstab)?
So, all I need to do is edit the /etc/fstab file.
In place of the device path I'm using the drives UUID so I don't have to worry about the devices getting shuffled during unmount, and I use the Desktop directory path as the mount point (yes, I created a fstab.bak backup file) and save it as fstab_mount for quick copy, you'll see why in just a little bit.
Lines added to fstab:
Code:
UUID=A6B01E5FB01E35F1 /home/caine/Desktop/USB1 ntfs-3g rw,loop,noauto,noexec,nodev,noatime,umask=000,show_sys_files,streams_interface=windows,allow_other 0 0 # by rbfstab
UUID=E2FB-5843 /home/caine/Desktop/Flash vfat rw,loop,noauto,noexec,nodev,noatime,umask=000,shortname=mixed,quiet 0 0 # by rbfstab
Next all I need to do is mount the mount point: USB1 and Flash. Unfortunately I have to be on the Desktop to do this, is there a script I can write that I can click on and do it without being on the desktop in the terminal?
Code:
/Desktop# mount USB1
/Desktop# mount Flash
mount: can't find Flash in /etc/fstab or /etc/mtab
/Desktop#
I edit fstab in "nano /etc/fstab", I've even used sudo nano, but it keeps getting overwritten. I have also used "mount -a" after the edit as some users have advised in other posts.
So I copy fstab_mount to /etc/fstab and mount the falsh drive:
Code:
/Desktop# mount Flash
/Desktop#
Help is very sparse on the web, and all they talk about is being overwritten on Boot, not mount. I'm using a CAINE 7.0 Live CD, so no booting.
So I got to thinking, it could be the end of each line calling the file: "# by rbfstab".
I removed “ # by rbfstab” from end of each line entry. On mount the bootup defaults are appended to the end of fstab (see below), on the first mount ONLY, Why only the first one???
Code:
root@caine:/home/caine/Desktop# nano /etc/fstab
GNU nano 2.2.6 File: /etc/fstab
overlayfs / overlayfs rw 0 0
tmpfs /tmp tmpfs nosuid,nodev 0 0
/dev/sr0 /media/sr0 iso9660 ro,loop,noauto,noexec,nodev,noatime 0 0
/dev/sda1 /media/sda1 ntfs-3g ro,loop,noauto,noexec,nodev,noatime,umask=000,show_sys_files,streams_interface=windows,allow_other 0 0
/dev/sda2 /media/sda2 vfat ro,loop,noauto,noexec,nodev,noatime,umask=000,shortname=mixed,quiet 0 0
/dev/sda3 /media/sda3 vfat ro,loop,noauto,noexec,nodev,noatime,umask=000,shortname=mixed,quiet 0 0
/dev/sda5 /media/sda5 ntfs-3g ro,loop,noauto,noexec,nodev,noatime,umask=000,show_sys_files,streams_interface=windows,allow_other 0 0
/dev/sda6 /media/sda6 ntfs-3g ro,loop,noauto,noexec,nodev,noatime,umask=000,show_sys_files,streams_interface=windows,allow_other 0 0
/dev/sda7 /media/sda7 ntfs-3g ro,loop,noauto,noexec,nodev,noatime,umask=000,show_sys_files,streams_interface=windows,allow_other 0 0
UUID=A6B01E5FB01E35F1 /home/caine/Desktop/USB1 ntfs-3g rw,loop,noauto,noexec,nodev,noatime,umask=000,show_sys_files,streams_interface=windows,allow_other 0 0
UUID=4E26CC1026CBF74D /home/caine/Desktop/USB2 ntfs-3g rw,loop,noauto,noexec,nodev,noatime,umask=000,show_sys_files,streams_interface=windows,allow_other 0 0
UUID=E2FB-5843 /home/caine/Desktop/Flash vfat rw,loop,noauto,noexec,nodev,noatime,umask=000,shortname=mixed,quiet 0 0
########## Below are the lines added after a mount is issued ##############
/dev/sr0 /media/sr0 iso9660 ro,loop,noauto,noexec,nodev,noatime 0 0 # by rbfstab
/dev/sda1 /media/sda1 ntfs-3g ro,loop,noauto,noexec,nodev,noatime,umask=000,show_sys_files,streams_interface=windows,allow_other 0 0 # by rbfstab
/dev/sda2 /media/sda2 vfat ro,loop,noauto,noexec,nodev,noatime,umask=000,shortname=mixed,quiet 0 0 # by rbfstab
/dev/sda3 /media/sda3 vfat ro,loop,noauto,noexec,nodev,noatime,umask=000,shortname=mixed,quiet 0 0 # by rbfstab
/dev/sda5 /media/sda5 ntfs-3g ro,loop,noauto,noexec,nodev,noatime,umask=000,show_sys_files,streams_interface=windows,allow_other 0 0 # by rbfstab
/dev/sda6 /media/sda6 ntfs-3g ro,loop,noauto,noexec,nodev,noatime,umask=000,show_sys_files,streams_interface=windows,allow_other 0 0 # by rbfstab
/dev/sda7 /media/sda7 ntfs-3g ro,loop,noauto,noexec,nodev,noatime,umask=000,show_sys_files,streams_interface=windows,allow_other 0 0 # by rbfstab
root@caine:/home/caine/Desktop#
Why is fstab being appended to with the "bootup" settings on the first mount only?
What is the mount process calling?
The OS runs in the background checking for new devices plugged in, is this what is happening? But why would it append to fstab if the devices match what's already there (except the removal of # by rbfstab)?