FSTAB optimization

Hello all.

I recently back to Linux, and I need to set some extra hard discs to make a paranoid backup system.

So I’ve edited my FSTAB to load them on boot, but even on FSTAB they are recognized like removable media, like a USB hard disk, pendrive, and I want them to be “hidden” like the default disks where I have the / and /home disks.

So my question is, how I can improve the text to mount the drives but doesn’t show them like a removable media?

I also have a manually added swap file on the / NVME instead of the regular swap partition, why? I didn’t pay attention on the manual partition while I’m formatting, so I’ve created this way.

My lsblk (I rearranged the list to make it easier and faster to understand)

NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS

#system
nvme0n1     259:2    0 232,9G  0 disk 
├─nvme0n1p1 259:3    0 232,4G  0 part /
└─nvme0n1p2 259:4    0   512M  0 part /boot/efi

#personal data, working files
nvme1n1     259:0    0 465,8G  0 disk 
└─nvme1n1p1 259:1    0 465,8G  0 part /home

#personal backup from nvme1
sdd           8:48   0   3,6T  0 disk 
└─sdd1        8:49   0   3,6T  0 part /home/gits/WDS4K

#secondary drive for finished stuff and references, things I won't use for a long, similar to a 'cloud' concept.
sdb           8:16   0   1,8T  0 disk 
└─sdb1        8:17   0   1,8T  0 part /home/gits/WD2K

#Main timeshift (or some app like, doesn't decide yet) backup system to nvme1  (/home folder) and sdb
sdc           8:32   0   3,6T  0 disk 
└─sdc1        8:33   0   3,6T  0 part /home/gits/WDM4K

#Backup of SDC
sda           8:0    0 447,1G  0 disk 
└─sda1        8:1    0 447,1G  0 part /home/gits/Backup

My FSTAB

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

# NVME SAMSUNG EVO 970
UUID=BF8B-8AB9                            	/boot/efi      			vfat    	umask=0077 					0 2
UUID=86b39b27-cc8f-4870-b934-a0d73dc2dcf5 	/              			ext4    	defaults,noatime 			0 1

# NVME WD BLACK
UUID=5d1541b4-3159-41b4-84f2-436445dd259d 	/home          			ext4    	defaults,noatime 			0 2
tmpfs                                     	/tmp           			tmpfs   	defaults,noatime,mode=1777 	0 0

# NVME SAMSUNG EVO 970
/swopfile									none 					swap 		sw 							0 0

#the above disks are hidden from file manager and they are no visible like a removable media

#the bottom disks are mounted, but show as removable media (what I don't want)


# SSD SAMSUNG : Backup
UUID=88b9e941-ca0c-4675-82e4-158ecbe66d77	/home/gits/Backup		ext4		defaults					0 2

# HDD WD BLUE 2TB : Backup HDD
UUID=4626bb60-68d8-422c-ada5-254929b204d3	/home/gits/WD2K			ext4		defaults					0 2

# HDD WD PURPLE MAIN 4TB : Main 4K
UUID=b41ddbfd-9103-4c9c-b28c-ec5cc5bc6e19	/home/gits/WDM4K		ext4		defaults					0 2

# HDD WD PURPLE SEC 4TB : Sec 4K
UUID=a93b7b8d-cac1-43e1-bccd-c9bb64724731	/home/gits/WDS4K		ext4		defaults					0 2

You might have these (internal) drives connected to SATA ports with “hot swappable” feature enabled. You can disable this feature in your BIOS, if they provide an option to do so. (Sometimes also referred to as “hot pluggable”.)

Or you can just “hide” the quick access shortcuts (for these drives in question) on your panel / side-pane.

Are you using Gnome? That shows the removable media in the panel.
Edit /etc/fstab to add the option comment=x-gvfs-hide

It should like:

# SSD SAMSUNG : Backup
UUID=88b9e941-ca0c-4675-82e4-158ecbe66d77	/home/gits/Backup	ext4	defaults,comment=x-gvfs-hide	0 2

# HDD WD BLUE 2TB : Backup HDD
UUID=4626bb60-68d8-422c-ada5-254929b204d3	/home/gits/WD2K		ext4	defaults,comment=x-gvfs-hide	0 2

# HDD WD PURPLE MAIN 4TB : Main 4K
UUID=b41ddbfd-9103-4c9c-b28c-ec5cc5bc6e19	/home/gits/WDM4K	ext4	defaults,comment=x-gvfs-hide	0 2

# HDD WD PURPLE SEC 4TB : Sec 4K
UUID=a93b7b8d-cac1-43e1-bccd-c9bb64724731	/home/gits/WDS4K	ext4	defaults,comment=x-gvfs-hide	0 2

1 Like

Hidden where?
Also, as long as you have those partitions mounted, any partitioning utility will be able to see them…

They are not “hidden” - they are just part of the normal / filesystem and won’t show up as as external, even if they where (external).

… drives connected via USB are not internal - and they will show up as such
once you plug them in

but you can mount them via fstab to specific places - and not use the automount feature of some filemanager that you might use/have running

I know so far. Gnome or some DE recognizes any mounted partitions in “home” directory and displays one or more “removeable media” labels/icons. That’s why they’re visibly a bit annoying for some people.

/etc/fstab adding the option comment=x-gvfs-hide is a solution for Gnome or some DE

First my excuses, I didn’t mention that all the disks are internal, 2 NVME and 4 SATA 3.0.

Hot Plug in BIOS, all disabled.

Yes I’m using Gnome 42, and the command doesn’t work, they still visible.

Partitioning utility like Gnome Disk or similar, yes, but Nautilus is not one, so maybe there is a chance to hide them, like the main drives.

English is not my default language, I know it’s not an excuse, but hidden it’s the best word I can find in my limitation, so sorry. =/

I forgot to explain earlier, all drives on FSTAB are internal.

Nautilus natural behavior ir show them on the “other places” section, but it never auto-mount anything, and my /home partition is not showed in there, I just want to make the same with the others.

I don’t get this Gnome behavior, the opposite makes more sense to me. Sadly, for me at least, I’m one of this people.

Did you reboot after adding this option?

But it works for me using Gnome 42 Wayland too. But I am using BTRFS, not EXT4

Offcourse, I also tryied only x-gvfs-hide.

None worked, after some researchs, it seens a old “problem” with fstab and Gnome, also includings comments about the decision of devs team to mount things on /dev /home with the “removable media” option, there are posts over 5 years talking about this command.

Some of them talkg about mount the drivers outside of this folders and them symlink things.

Just changing a little the subject, do you know if it is possible to define the user parameter of the section just for my user, like user=gits or just gits?

There is another possibility, if you create a new hidden directory name “/home/gits/.media/” and edit FSTAB to mount these partitions in “.media”, Gnome ignores this hidden directory “.media”.

I think it’s simpler, easier, and less problematic for normal folks simply to use Gnome-disks to set up mounts.

Beyond that, I’d go with systemd mounting (which is similar TBH)

However, fstab is a thing (though I don’t need to edit it myself)

│ LABEL=W2                                    /mnt/W2     auto    nosuid,nodev,nofail,x-gvfs-show,x-gvfs-name=W2   0 0 

Here is one example of a disk, which mounts at boot and shows up as a Device, not as a Removable Device.

removable

I’m also curious - why are you worried that you ‘failed to manually create a partition for swap’ when - for many folks - simply enabling swapfile is a better solution and requires no parititoning.

I think the “use-the-terminal-to-do-everything-under-Linux” bug bite some years ago, beying honest, I use get used to the terminal, I fell more confortable with it, it’s the “I can control everything with my fingers” felling, for me at least.

I don’t even know that Gnome Disks can manipulate FSTAB.

I saw some comments about it, I’ll take a look how it works, TYVM for the suggestion.

I’m not worried, but I’ve stayed some years out of Linux. When I’ve first try it, SWAP partition was a real comum and almost a obligatory stuff on partitioning and formating systems. I’m just a little lost in what changed over the last 5 years.

Beying honest, I like the SWAP file more than a partition, especially with SDD / NVME, no more things like “set the swap partition to the begging of the disc to maximum SWAP performance” like one time or another, someone use to say in HDD’s.

1 Like

Thank you it worked for me.

UUID=b4ef5a78-02fb-4c07-a631-d9f8f8f4344c /home/sgilfra/Música ext4    defaults,noatime,comment=x-gvfs-hide 0 2

Before adding comment=x-gvfs-hide the Música partition showed up on the desktop as an external drive. Now it didn’t show up but it’s mounted.