<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Fstab on Michael’s Domain</title><link>https://jeltsch.org/en/tags/fstab/</link><description>Recent content in Fstab on Michael’s Domain</description><generator>Hugo</generator><language>en-us</language><copyright>Copyright © 2002 - 2026 Michael Jeltsch.</copyright><lastBuildDate>Fri, 24 Jul 2026 00:18:18 +0300</lastBuildDate><atom:link href="https://jeltsch.org/en/tags/fstab/index.xml" rel="self" type="application/rss+xml"/><item><title>Directory hard links in Linux</title><link>https://jeltsch.org/en/directory_hard_links/</link><pubDate>Thu, 03 Jun 2021 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/directory_hard_links/</guid><description>&lt;p&gt;Directory hard links in Linux are forbidden because they would:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;create cycles in the directory hierarchy.&lt;/li&gt;
&lt;li&gt;break the assumption that directories form a tree.&lt;/li&gt;
&lt;li&gt;complicate deletion and reference counting.&lt;/li&gt;
&lt;li&gt;make filesystem traversal and maintenance much harder.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Instead, Linux allows hard links for regular files and symbolic links for both files and directories. To emulate something similar to directory hard links, you can mount any file system path into any other directory (&lt;em&gt;bind mount&lt;/em&gt;). However, you need to be careful because you can get the same problems as with directory hard links, namely circular and thus infinite file paths…&lt;code&gt;sudo mount --bind /home/user/Documents/Desktop/ /home/user/Desktop/&lt;/code&gt;. Such a link disappears after a reboot. If you want to make it permanent, you can add the mount to /etc/fstab:&lt;code&gt;/home/user/Documents/Desktop/ /home/user/Desktop none bind&lt;/code&gt;. Some say this does not work with LVM, but at least, on Ubuntu 20.04 it does. Obviously, this entry should be at the bottom of the fstab!&lt;/p&gt;</description></item><item><title>Mounting group directories via the fstab</title><link>https://jeltsch.org/en/mounting_group_directories_via_the_fstab/</link><pubDate>Mon, 11 Feb 2019 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/mounting_group_directories_via_the_fstab/</guid><description>&lt;p&gt;At the University of Helsinki, one can apply for group directories, which is simply disk space on a NAS. These are easily mounted when you use a university-managed computer via the university menu, but what about if you use your own machine? At least for Ubuntu Linux, the way to mount these directories has changed multiple times during the years and it again broke recently. The current entry in the /etc/fstab file in my (Vanilla, non-university-managed) Ubuntu 16.04 is as follows:&lt;code&gt;# HY group directories//group2.ad.helsinki.fi/h204 /home/local_username/GROUP-drive cifs noauto,user,user=hy_username,nobrl,uid=1000,gid=1000,file_mode=0666,dir_mode=0777 0 0&lt;/code&gt;Then you can simply execute &amp;ldquo;mount /home/local_username/GROUP-drive&amp;rdquo; and you will be asked for your HY password. The number 2 and the string &amp;ldquo;h204&amp;rdquo; in the server address (group2.ad.helsinki.fi/h204) are specific for the cost center which is in this case H2042 (taking the first digit from the cost center string and first four characters from the cost center string, respectively).And here are some instruction on how to do it manually on a Macintosh:https://helpdesk.it.helsinki.fi/en/instructions/saving-and-sharing/group-storage-space/remote-access-home-and-group-directory-mac&lt;/p&gt;</description></item><item><title>Mount Samba shares (why doesn't Nautilus work?) and making smb mounts permanent</title><link>https://jeltsch.org/en/mount_samba_shares_why_doesn_t_nautilus_work_and_making_smb_mounts_permanent/</link><pubDate>Sat, 26 May 2007 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/mount_samba_shares_why_doesn_t_nautilus_work_and_making_smb_mounts_permanent/</guid><description>&lt;p&gt;&lt;strong&gt;Mount Samba shares&lt;/strong&gt;Apparently it is very easy to connectfrom within Nautilus to Windows computers (or rather to computers running smb services). The only thing you have to do is to type smb:/// into the URL bar and the network is browsed for available domains, workgroups and services. However when one tries to open some files (e.g. some image) there often appears the error message that those files cannot be accessed via samba.What to do? I figured that when you mount smb shares, that this works correctly. In order to mount my user directory on another computer this is the command:&lt;code&gt;sudo mount -t smbfs -o username=michael,password=here_goes_my_password //paula/michael /mnt/smb&lt;/code&gt;paula is the netbios name of the other computer and michael is the name of the share.You can also set the owner of all the files of the mounted file system with the -o uid=owner option:&lt;code&gt;sudo mount -t smbfs -o username=michael,password=here_goes_my_password -o uid=500 //paula/michael /mnt/smb&lt;/code&gt;If you don&amp;rsquo;t want to type your password, you can save it in a file like this:&lt;code&gt;username=susannepassword=0sdf7b&lt;/code&gt;and then you can refer to this &amp;ldquo;credentials&amp;rdquo; file:&lt;code&gt;sudo mount -t smbfs -o username=susanne,credentials=/home/susanne/.smbpasswd //patolmac217/susanne /mnt/smb&lt;/code&gt;In order to unmount use:&lt;code&gt;sudo umount /mnt/smb&lt;/code&gt;This mostly fails as you are likely to have some open windows/terminals that keep the connection active. Close them and try again. You also might try umount -f.&lt;strong&gt;Making smb mounts permanent&lt;/strong&gt;When you mount an SMB share, it will be gone upon system restart. To make it mount automatically during system bootup, you have to create a new entry in the /etc/fstab file. In my case e.g.:&lt;code&gt;//paula/michael /mnt/smb smbfs credentials=/home/jeltsch/.smbpasswd 0 0&lt;/code&gt;In the .smbpasswd file is my username and my password. Probably not very safe, but who cares? .smbpasswd should be anyway only readable by yourself!&lt;/p&gt;</description></item><item><title>Connecting the external hard drive to my computer (Maxtor One Touch 200GB, FireWire &amp; USB 2.0/1.1)</title><link>https://jeltsch.org/en/connecting_the_external_hard_drive_to_my_computer_maxtor_one_touch_200gb_firewire_usb_2_0_1_1/</link><pubDate>Fri, 25 May 2007 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/connecting_the_external_hard_drive_to_my_computer_maxtor_one_touch_200gb_firewire_usb_2_0_1_1/</guid><description>&lt;p&gt;The hard drive was connected to Redhat9 Linux via firewire and the hard drive had a reiserfs filesystem. It was supposed to be used for backups, but suddenly stopped working (it was not anymore recognized during system startup). Probably that had something to do with the external USB zip drive. Both are apparently visible to the system as SCSI devices and the zip drive might have (via automount) occupied the sda number that was manually added to /etc/fstab to enable the Maxtor hard drive. To check whether everything is OK with the drive itself, I connected it to my work computer. My work computer, however doesn&amp;rsquo;t have a fire wire card, so I had to use the USB port. This shouldn&amp;rsquo;t make any difference as both USB and firewire are somehow treated as SCSI devices.I only edited /etc/fstab adding the following line:&lt;code&gt;/dev/sda1 /mnt/usbhd1 reiserfs defaults 1 2&lt;/code&gt;I first forgot to create the directory /mnt/usbhd1. Thus after restarting the drive was not mounted. I checked with /sbin/fdisk -l and there was the following entry&lt;code&gt;/dev/sda1 Windows 95 (or something like that)&lt;/code&gt;Funnily the resiserfs file system shows as a fat filesystem. I changed the &amp;ldquo;reiserfs&amp;rdquo; entry in /etc/fstab to &amp;ldquo;vfat&amp;rdquo; and created the directory /mnt/usbhd1. During startup there was an error (something like &amp;ldquo;no fat filesystem could be found on the partition&amp;rdquo;). So I changed it back to reiserfs, rebooted and the external drive was mounted during startup without problems.&lt;/p&gt;</description></item><item><title>smb mounts via fstab or automount?</title><link>https://jeltsch.org/en/smb_mounts_via_fstab_or_automount/</link><pubDate>Mon, 21 May 2007 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/smb_mounts_via_fstab_or_automount/</guid><description>&lt;p&gt;I have many computers I need to connect to from my Linux box. Network browsing works, but is terribly slow, so I want to create some shortcuts, that I can mount with a single mouseclick what I need from a list. First I thought to modify the fstab and put there entries that would allow me to easily mount smb shares as a normal user. E.g.:&lt;code&gt;//paula/michael /media/smbmounts smbfs noauto,user,credentials=/home/jeltsch/.smbpasswd1 0 0&lt;/code&gt;This works if I have the entry mounted at system startup (without the &amp;ldquo;noauto&amp;rdquo; entry). If the &amp;ldquo;noauto&amp;rdquo; entry is present, the smb share is not mounted at system startup, but must explicitely be mounted by the following command:&lt;code&gt;mount /media/smbmounts&lt;/code&gt;Because of the &amp;ldquo;user&amp;rdquo; option in the fstab, every regular user should be able to do this. Not so! First I had to enable the &amp;ldquo;suid&amp;rdquo; for the smbmnt command (it appeared to be in /usr/bin/smbmnt, but was linked to a link that linked to /usr/lib/samba/classic/smbmnt:&lt;code&gt;chmod +s /usr/lib/samba/classic/smbmnt&lt;/code&gt;Then I found contradicting information whether the mountpoint (in my case /media/smbmounts) has to owned by the mounting user or not. To be safe it did:&lt;code&gt;chown jeltsch /media/smbmounts&lt;/code&gt;Still I got an error which I couldn&amp;rsquo;t figure out and I decided to use automounts.&lt;/p&gt;</description></item><item><title>Exporting automounted partitions via nfs</title><link>https://jeltsch.org/en/exporting_automounted_partitions_via_nfs/</link><pubDate>Wed, 04 Apr 2007 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/exporting_automounted_partitions_via_nfs/</guid><description>&lt;p&gt;We are accessing data from our server via nfs. The nfs exports are automounted on the nfs clients&amp;rsquo; computers. It works fine. However there is a partition (a whole drive in fact) on our server that is automounted on demand. We wanted this hard drive to unmount automatically if it is not needed to save energy and reduce noise levels. When I include the mountpoint of this partition in /etc/exports everything seems to work fine, but automounting this export on a client machine fails. It can still be mounted manually though with a regular mount command. As a workaround (in order to have a desktop link in KDE to the data on the server) I did the following:
I added an entry to the fstab: &lt;code&gt;server:/automounts/multimedia /media/multimedia nfs rsize=1024,wsize=1024,noauto,user 0 0&lt;/code&gt; Then I created a shell script: &lt;code&gt;!/bin/sh mount /media/multimedia kfmclient openProfile filemanagement /media/multimedia&lt;/code&gt; Then I created a new &amp;ldquo;Link to Application&amp;rdquo;, that points to that shell script.
As a result of clicking this Link, the nfs export is mounted and a new Konqueror window opens with the contents of the mountpoint directory displayed.&lt;/p&gt;</description></item><item><title>Mounting of vfat partitions and accession privilege management mapping (fstab, vfat, umask, fmask, dmask, users)</title><link>https://jeltsch.org/en/mounting_of_vfat_partitions_and_accession_privilege_management_mapping_fstab_vfat_umask_fmask_dmask_users/</link><pubDate>Wed, 04 Apr 2007 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/mounting_of_vfat_partitions_and_accession_privilege_management_mapping_fstab_vfat_umask_fmask_dmask_users/</guid><description>&lt;p&gt;Old Windows (i.e. fat partitions) are no problem for Linux. advanced installers like Yast automatically recognize them and make them available under Linux. However, sometimes the accession privileges are not as you need them. In order to make a fat partition (un)mountable to all users and make every file/directory +rwx for everybody, the fstab needs to look like this: &lt;code&gt;/dev/hda2 /media/windows/E vfat defaults,users,uid=500,gid=100,umask=000 0 0&lt;/code&gt; Additionally Linux owner 500 and group 100 mapped as an for all files. You can also set privileges separately for files (fmask) and directories (dmask). For umask you need to give the inverse octal, meaning: 000 means all privileges and 777 means no privileges.&lt;/p&gt;</description></item></channel></rss>