From ff79f68a792fc73945eaf47ddbc7f98249c51f19 Mon Sep 17 00:00:00 2001 From: DoTheEvo Date: Sun, 15 Sep 2024 11:37:36 +0200 Subject: [PATCH] update --- .../mounting_network_share_linux.md | 63 +++++++++++++++++++ _knowledge-base/vlans.md | 6 +- 2 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 _knowledge-base/mounting_network_share_linux.md diff --git a/_knowledge-base/mounting_network_share_linux.md b/_knowledge-base/mounting_network_share_linux.md new file mode 100644 index 0000000..287de17 --- /dev/null +++ b/_knowledge-base/mounting_network_share_linux.md @@ -0,0 +1,63 @@ +# Mounting Network Shares in Linux + +possible ways to mount stuff - fstab, autofs, systemd, docker volumes if its for docker + +possible types of shares + +* smb/samba/cifs - the most common share, support on all OS +* nfs - mostly used between linux machines, bit better performance +* iSCSI - the share is mounted as a block device as if it was really a disk, + great performance for small files + +More on setup of these shares is in +[TrueNAS Scale guide.](https://github.com/DoTheEvo/selfhosted-apps-docker/tree/master/trueNASscale) + +# smb/samba/cifs + +[Arch wiki](https://wiki.archlinux.org/title/samba#As_systemd_unit) +on samba systemd mount + +* you will create two files in `/etc/systemd/system` +* one will have extension `.mount` the other `.automount` +* the name will be the same for both and it MUST correspond with the planned + mount path. Slashes `/` being replaced by dashes `-`.
+ So if the share should be at `/mnt/mirror` the files are named + `mnt-mirror.mount` and `mnt-mirror.automount` +* copy paste the bellow content, edit as you see fit, + changing description, ip address and path, user and password,.. +* linux command `id` will show your current user `uid` and `gid` +* after ther changes execute command `sudo systemctl enable mnt-mirror.automount` + This will setup mounting that does not fail on boot if there are network issues, + and really mounts the target only on request + +`mnt-mirror.mount` +```ini +[Unit] +Description=3TB truenas mirror mount + +[Mount] +What=//10.0.19.11/Mirror +Where=/mnt/mirror +Type=cifs +Options=rw,username=kopia,password=aaa,file_mode=0644,dir_mode=0755,uid=1000,gid=1000 + +[Install] +WantedBy=multi-user.target +``` + +`mnt-mirror.automount` +```ini +[Unit] +Description=3TB truenas mirror mount + +[Automount] +Where=/mnt/mirror + +[Install] +WantedBy=multi-user.target +``` + +### Useful commants + +`smbclient -L 10.0.19.11` - list shares mounted from the ip +`systemctl list-units -t mount --all` diff --git a/_knowledge-base/vlans.md b/_knowledge-base/vlans.md index 88a6dc1..7cea5f7 100644 --- a/_knowledge-base/vlans.md +++ b/_knowledge-base/vlans.md @@ -66,7 +66,7 @@ lets put here also vlan stuff as you would need to deal with extra cables, extra interfaces, extra hardware.. * **Tag based**
The real deal vlan. At layer2 a **vlan tag** is added to frames. - It contains a **vlan ID** which is a number between 0 and 4095. + It contains a **vlan ID** which is a number between 1 and 4094. These are used to create virtual networks that are separate from each other but share same hardware, same cables.
The standard is called **802.1Q**. @@ -79,8 +79,8 @@ Some aspects: when entering or leaving switch. * A tag is 4 bytes in size, contains [several pieces of info](https://i.imgur.com/86zeYgG.png), the most important being vlan ID. -* **Vlan ID** (VID) is just a number between 0-4095, often picked as - multiplies of ten - 10, 20, 30, 40, ... with the ip address of that VLAN +* **Vlan ID** (VID) is just a number between 1-4094, often picked as + multiplies of ten - 10, 20, 30, 40, ... with the ip address pool on that VLAN having it somewhere too.
Like vlan30 would be set as 192.168.30.0/24 or 10.30.30.0/24. * Tagged frames **get dropped** if they would arrive to a regular machine,