Permanent mounting fails

Hi,
I knew this question asked couple of time before but nothing works for me.
My OS is Suse 15, SP3.

I added a disk like below and it is /dev/sdb1

server1:~ # lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 40G 0 disk
└─sda1 8:1 0 40G 0 part
├─system-swap 254:0 0 2G 0 lvm [SWAP]
└─system-root 254:1 0 38G 0 lvm /
**sdb 8:16 0 100G 0 disk
└─sdb1 8:17 0 93.1G 0 part

**So I’m running “mount -t ext4 /dev/sdb1 /var/lib/” directory and it’s ok, I can see the disk the output of “df -hl” command.
But the problem is it’s not permanent.

So my /etc/fstab file is like below;

server1:~ # more /etc/fstab
/dev/system/swap swap swap defaults 0 0
UUID=1dc251df-544d-4386-851b-5e5cd9824eb3 / btrfs defaults 0 0
UUID=1dc251df-544d-4386-851b-5e5cd9824eb3 /boot/grub2/i386-pc btrfs subvol=@/boot/grub2/i386-pc 0 0
UUID=1dc251df-544d-4386-851b-5e5cd9824eb3 /boot/grub2/x86_64-efi btrfs subvol=@/boot/grub2/x86_64-efi 0 0
UUID=1dc251df-544d-4386-851b-5e5cd9824eb3 /home btrfs subvol=@/home 0 0
UUID=1dc251df-544d-4386-851b-5e5cd9824eb3 /var/lib/mailman btrfs subvol=@/var/lib/mailman 0 0
UUID=1dc251df-544d-4386-851b-5e5cd9824eb3 /var/lib/mariadb btrfs subvol=@/var/lib/mariadb 0 0
UUID=1dc251df-544d-4386-851b-5e5cd9824eb3 /var/lib/mysql btrfs subvol=@/var/lib/mysql 0 0
UUID=1dc251df-544d-4386-851b-5e5cd9824eb3 /var/lib/named btrfs subvol=@/var/lib/named 0 0
UUID=1dc251df-544d-4386-851b-5e5cd9824eb3 /.snapshots btrfs subvol=@/.snapshots 0 0
UUID=d1263b6a-8c0c-48a0-9bee-fde48073591a /var/lib ext4 defaults 0 0

server1:~ # blkid /dev/sdb1
/dev/sdb1: UUID=“d1263b6a-8c0c-48a0-9bee-fde48073591a” BLOCK_SIZE=“4096” TYPE=“ext4” PARTLABEL=“logical” PARTUUID=“444496d3-efce-4b28-9f85-e03dfa887808”

So as you can see above, I added the UUID, mounting points, disk format and other stuff like that, but after I restarted the server, I can’t see the disk from df command.

I also tried to add the command below(Not sure but some comments suggested this kind of input)

**/dev/sdb1 /var/lib ext4 rw,relatime 0 0

**But still same. What am I doing wrong?

Regards.

Hi yatta,

Welcome to this forum. /var/lib/ is not a suitable mount point. Wherever you want to mount your drive it must be an empty folder. If it worked with your manual command no other subfolder will be accessible in /var/lib/. I don’t think /var/lib/… is any good target to mount a drive at all as that doesn’t really fit with the usual unix file system structure. On the other hand, I am mounting drives directly into (selfmade) folders in “/”, so who am I to judge?
I’d suggest some place in your home folder, or in /mnt/ if it is supposed to be available system wide. However, make sure to create an empty folder to mount the drive to.

Have a lot of fun!

kasi

BTW, your terminal output or listings will be easier to read if you use the “code tags”:

server1:~ # more /etc/fstab
/dev/system/swap                           swap                     swap   defaults                        0  0
UUID=1dc251df-544d-4386-851b-5e5cd9824eb3  /                        btrfs  defaults                        0  0
UUID=1dc251df-544d-4386-851b-5e5cd9824eb3  /boot/grub2/i386-pc      btrfs  subvol=@/boot/grub2/i386-pc     0  0
UUID=1dc251df-544d-4386-851b-5e5cd9824eb3  /boot/grub2/x86_64-efi   btrfs  subvol=@/boot/grub2/x86_64-efi  0  0
UUID=1dc251df-544d-4386-851b-5e5cd9824eb3  /home                    btrfs  subvol=@/home                   0  0
UUID=1dc251df-544d-4386-851b-5e5cd9824eb3  /var/lib/mailman         btrfs  subvol=@/var/lib/mailman        0  0
UUID=1dc251df-544d-4386-851b-5e5cd9824eb3  /var/lib/mariadb         btrfs  subvol=@/var/lib/mariadb        0  0
UUID=1dc251df-544d-4386-851b-5e5cd9824eb3  /var/lib/mysql           btrfs  subvol=@/var/lib/mysql          0  0
UUID=1dc251df-544d-4386-851b-5e5cd9824eb3  /var/lib/named           btrfs  subvol=@/var/lib/named          0  0
UUID=1dc251df-544d-4386-851b-5e5cd9824eb3  /.snapshots              btrfs  subvol=@/.snapshots             0  0
**UUID=d1263b6a-8c0c-48a0-9bee-fde48073591a  /var/lib            ext4    defaults                           0  0**

It’s the # icon in the icon bar above your editor.

/var/lib is a system location. You’re lucky if anything works if you’ve successfully mounted another disk’s filesystem there. Do as kasi042 suggested and create a convenient mount point directory in /home, or if you are the sole system user, a mount point directory in /home/username/, then substitute that location for /var/lib in your fstab.

I actually trying to mount /var/lib/mysql folder now, but it still fails.

Nothing should ever be mounted by a user in /var/ or /usr/ anywhere. That’s the bailiwick of the packaging system rpm & zypper. If you want some out-of-repos software installed somewhere, put it in your homedir, or in /usr/local/ somewhere.

But can’t I do that? I mean technically it should be possible, right? Let’s forget this for temporarily and focus why mounting point is disappearing?

What is wrong with the line I added to the /etc/fstab

Please listen to what is said. You should not yourself mount anything on /var/lib. That is an important directory within a running system and all that is there before the mount (and that is a lot) will be unreachable after the mount.

Why do you want to make /var/lib a separate file system on a separate partition?

And what do you mean with “it is not permanent”?

And this is a more elaborate explanation about posting computer code:
There is an important, but not easy to find feature on the forums.

Please in the future use CODE tags around copied/pasted computer text in a post. It is the # button in the tool bar of the post editor. When applicable copy/paste complete, that is including the prompt, the command, the output and the next prompt.

An example is here: Using CODE tags Around your paste.

Mount at a non-empty location is a bad idea. The mount will eclipse all existing objects. Always create a new directory:

**erlangen:~ #** df -h /home-SSD/ 
Filesystem      Size  Used Avail Use% Mounted on 
/dev/sda1       1.8T  1.4T  408G  77% /home-SSD 
**erlangen:~ #** grep home-SSD /etc/fstab  
UUID=5605f149-34a7-4301-9bf3-f1f177e35ed6  /**home-SSD**               ext4   defaults                      0  0 
**erlangen:~ #**

I’m just going to guess here that the reason is the tree /usr/lib/ contains mount points on a BTRFS filesystem for several subvolume mounts, and the filesystem driver won’t let you bury those mounts by a mount to a parent or grandparent; or else you can’t do it using default mount options.

It’s a really stupid thing to try to do! Maybe the kernel and/or mount is/are smart enough to recognize that stupidity and won’t allow it.

You choose “LEAP 15.3” as prefix for your thread title. But one of the first things in your post is that you are running “Suse 15, SP3”, which is SLES/SLED and not openSUSE!

I changed the prefix to “OTHER VERSION”.

And please be aware that most people here do not run SLES/SLED and are thus not aware of the peculiarities of it vs. openSUSE. They will try to help you, but the real SUSE forum is at: https://community.suse.com/

Hi
Your trying to create a mount point on an existing btrfs sub volume, use yast to add the mount point and it should take care of removing the sub volume. Since your on SLES, you need to be over at https://community.suse.com/ asking these questions, or use SUSE Support.

Thanks for your helps! I’ll try to delete btfrs partition and create again.