Proper Way to Mount a Drive Permanently

Technical issues/questions of an intermediate or advanced nature.
Post Reply
jpagan
White ninja
White ninja
Posts: 10
Joined: 10 Feb 2016, 23:05
Distribution: Ubuntu
Location: Texas

Proper Way to Mount a Drive Permanently

Post#1 by jpagan » 21 Nov 2017, 21:24

Looking at general Linux forums, it says that I should edit fstab to mount file systems permanently. But when I open fstab from Porteus there is a note that says I should add a command to rc.local. Can somebody share with me what is the proper way to mount a file system persistently in Porteus 3.22?

Thanks in advance

JP

User avatar
Ed_P
Contributor
Contributor
Posts: 3423
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Proper Way to Mount a Drive Permanently

Post#2 by Ed_P » 22 Nov 2017, 05:16

Hi jpagan. I don't understand your question. :%) If a drive is plugged in when Porteus boots it is automatically mounted. And unless manually unmounted stays mounted until Porteus is shutdown. So, what exactly are you asking?? :unknown:
Ed

raja
Black ninja
Black ninja
Posts: 65
Joined: 02 May 2017, 09:51
Distribution: v3.2.2-32bit and v3.2.2-64 bit
Location: Chennai,India

Proper Way to Mount a Drive Permanently

Post#3 by raja » 22 Nov 2017, 11:11

ed_P, that is because, Linux systems we use are already loaded with all necessary libraries for system calls. I learned recently while installing Arch, that volume management is not natively supported in the Kernel.

Arch base installation will mount only its root partition as it is written in fstab .

File Mangers have settings for volume management for auto mounting and they may interact with prior installed libraries for I/O. Even for 'pen drive' mounting notification there is a check box in Pcmanfm (jssouza,fulalas - I found this under 'preferences') May be other FMs don't show this pop up, but list.

General advice is , we should have polkit-gnome,gvfs,udisk or udiskie etc. for auto mounting of volumes.

Since each of this take up lot of space ,I did not install in Arch. Instead I,edited, "/etc/fstab" file to include only a HDD partition where I store all my 'pdf,music.video,astronomy,photos, etc.' files, as read only. Other partitions don't show off. Very good safety measure.

Arch installation teaches lots of things. There will be only 'netctl' application for network, and it is useless for wpa2 encrypted security. One has to install, 'wpa_supplicant' downloaded from another machine.

If you install. Xorg,Xorg-server, you will not have "xinit", which has 'startx'. One will learn many more on .xauthority,.xinitrc, multi user setup etc.

xinit- fulalas, I noticed , this is the cause for 'screen messages showing xorg log upto xorgconf file. This is not shown in jssouza's LXDE as he may be using lxdm for auto login.(? pl confirm) I will try this week end.

I set up arch with lxde with minimum applications. editor,epdfviewer, net surf,mpv,mpaint,7zip.

Learning some basics, which may be child's play for many of you.

thanks.

User avatar
Blaze
DEV Team
DEV Team
Posts: 1555
Joined: 28 Dec 2010, 11:31
Distribution: ⟰ Porteus 3.2 Cinnamon x86_64
Location: ☭ Russian Federation, Lipetsk region, Dankov
Contact:

Proper Way to Mount a Drive Permanently

Post#4 by Blaze » 22 Nov 2017, 17:54

Hi jpagan.
For example, if you need to mount your windows share permanently then you are need to tweak /etc/rc.d/rc.local

Code: Select all

echo -e \\n# Local partitions:\\n//192.168.1.249/d /media/P cifs credentials=/root/.smblocal1,dir_mode=0777,file_mode=0777 0 0\\n//192.168.1.220/c /media/WEB cifs credentials=/root/.smblocal2,dir_mode=0777,file_mode=0777 0 0\\n//192.168.1.220/d /media/FTP cifs credentials=/root/.smblocal2,dir_mode=0777,file_mode=0777 0 0\\n//192.168.1.165/d /media/U cifs credentials=/root/.smblocal3,dir_mode=0777,file_mode=0777 0 0 >> /etc/fstab
after starting your system, you will get these lines in /etc/fstab (this job will done by /etc/rc.d/rc.local script in the init step)

Code: Select all

# Local partitions:
//192.168.1.249/d /media/P cifs credentials=/root/.smblocal1,dir_mode=0777,file_mode=0777 0 0
//192.168.1.220/c /media/WEB cifs credentials=/root/.smblocal2,dir_mode=0777,file_mode=0777 0 0
//192.168.1.220/d /media/FTP cifs credentials=/root/.smblocal2,dir_mode=0777,file_mode=0777 0 0
//192.168.1.165/d /media/U cifs credentials=/root/.smblocal3,dir_mode=0777,file_mode=0777 0 0
More info about this you can find here.
Linux porteus 4.13.3-porteus #1 SMP PREEMPT Sat Sep 23 18:22:13 x86_64 Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz GenuineIntel GNU/Linux
MS-7A12 » [AMD/ATI] Tobago PRO [Radeon R7 360 / R9 360 OEM] (rev 81) » Vengeance LPX 16GB DDR4 K2 3200MHz C16

jpagan
White ninja
White ninja
Posts: 10
Joined: 10 Feb 2016, 23:05
Distribution: Ubuntu
Location: Texas

Proper Way to Mount a Drive Permanently

Post#5 by jpagan » 27 Nov 2017, 17:22

Thanks Blaze,

I think this is exactly what I needed to know. However, in your first code line you are appending to etc/fstab, not /etc/rc.d/rc.local. Is this a typo?

User avatar
brokenman
Site Admin
Site Admin
Posts: 5659
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Proper Way to Mount a Drive Permanently

Post#6 by brokenman » 28 Nov 2017, 00:09

No not a typo. He is appending to fstab at a certain point during boot, instead of editing fstab directly. This should get it done.
fstab is created from scratch at every boot so you need to inject to it rather than edit it.
How do i become super user?
Wear your underpants on the outside and put on a cape.

jpagan
White ninja
White ninja
Posts: 10
Joined: 10 Feb 2016, 23:05
Distribution: Ubuntu
Location: Texas

Proper Way to Mount a Drive Permanently

Post#7 by jpagan » 29 Nov 2017, 15:53

Got it!

It works perfectly now. Thanks for all the help.
:good:

apollo
White ninja
White ninja
Posts: 24
Joined: 28 Oct 2017, 13:40
Distribution: 4.0 XFCE, Manjaro
Location: .bay.de
Contact:

Proper Way to Mount a Drive Permanently

Post#8 by apollo » 29 Nov 2017, 19:31

Hi,

thanks for that hint. I noticed that there is a tutorial and a thread regarding rc.local tweaks.
It would be nice if a small tutorial about using the rc.local for mounting samba-shares could be added this thread...for those who are not that familiar with the russian language. i could write down some lines if you wish :)

I tried this tweak on my machine, but unfortunately its not working right now, the share is not mounted after boot. /var/log/messages and /var/log/syslog do not contain any useful information about the issue.
fstab entry seems to be alright and a sudo mount --all mounts the share as expected. Any suggestions where i should have a look at? Maybe wireless isn´t up before mounts a performed...but i'm not sure...

Another question that came up:
Do i need to put the credentials-file into root-Folder or could this file be placed inside the guest-Home?

kind regards
apollo
My Porteus Module Repo: https://porteus.rw-net.de

Post Reply