how to recreate fstab for improper halt on rescue

Hi I have installed Opensuse leap 42.2 on my system. To make changes to system I have entered rescue mode and mounted proc,sys etc., and after that I have done chroot. After sometime power failure occurred. I have made no changes to system.

I have again entered rescue mode and tried to mount filesystem proc but this time I got error as /proc mount point not found in /etc/fstab. I am able to successfully login normally into my system.

Can anyone of you suggest how to recreate fstab I mean all the filesystem’s mounted on my system ie., entries found in /etc/mtab.

Which is correct, /proc is mounted implicitly by startup sequence since years.

how to recreate fstab I mean all the filesystem’s mounted on my system ie., entries found in /etc/mtab.

/etc/mtab lists everything, including virtual and dynamic filesystems that are mounted either implicitly by service manager/kernel or on-demand. Adding them all to fstab is simply wrong.

What exact problem you try to solve now?

I am able to boot into os as usually but there is no entry for /proc in fstab.

I am unable to perform chroot in rescue mode because there is no entry for proc in fstab.

I do not see any relation between the first and second sentence. Show exact commands that fail and their output. Copy and paste please.

I am providing the contents of fstab and mtab below please examine

fstab


UUID=ab492036-a9ad-40c2-b192-35a2d3e0c2a1 / btrfs defaults 0 0
UUID=0b0a4916-34a7-468a-aaf5-0d5f17508310 /boot                ext4       acl,user_xattr        1 2
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
devtmpfs /dev devtmpfs
UUID=20fa1fcf-89bd-414b-80c1-5b1199033c89 swap swap defaults 0 0
UUID=ab492036-a9ad-40c2-b192-35a2d3e0c2a1 /opt btrfs subvol=@/opt 0 0
UUID=ab492036-a9ad-40c2-b192-35a2d3e0c2a1 /srv btrfs subvol=@/srv 0 0
UUID=ab492036-a9ad-40c2-b192-35a2d3e0c2a1 /tmp btrfs subvol=@/tmp 0 0
UUID=ab492036-a9ad-40c2-b192-35a2d3e0c2a1 /usr/local btrfs subvol=@/usr/local 0 0
UUID=ab492036-a9ad-40c2-b192-35a2d3e0c2a1 /var/cache btrfs subvol=@/var/cache 0 0
UUID=ab492036-a9ad-40c2-b192-35a2d3e0c2a1 /var/crash btrfs subvol=@/var/crash 0 0
UUID=ab492036-a9ad-40c2-b192-35a2d3e0c2a1 /var/lib/libvirt/images btrfs subvol=@/var/lib/libvirt/images 0 0
UUID=ab492036-a9ad-40c2-b192-35a2d3e0c2a1 /var/lib/machines btrfs subvol=@/var/lib/machines 0 0
UUID=ab492036-a9ad-40c2-b192-35a2d3e0c2a1 /var/lib/mailman btrfs subvol=@/var/lib/mailman 0 0
UUID=ab492036-a9ad-40c2-b192-35a2d3e0c2a1 /var/lib/mariadb btrfs subvol=@/var/lib/mariadb 0 0
UUID=ab492036-a9ad-40c2-b192-35a2d3e0c2a1 /var/lib/mysql btrfs subvol=@/var/lib/mysql 0 0
UUID=ab492036-a9ad-40c2-b192-35a2d3e0c2a1 /var/lib/named btrfs subvol=@/var/lib/named 0 0
UUID=ab492036-a9ad-40c2-b192-35a2d3e0c2a1 /var/lib/pgsql btrfs subvol=@/var/lib/pgsql 0 0
UUID=ab492036-a9ad-40c2-b192-35a2d3e0c2a1 /var/log btrfs subvol=@/var/log 0 0
UUID=ab492036-a9ad-40c2-b192-35a2d3e0c2a1 /var/opt btrfs subvol=@/var/opt 0 0
UUID=ab492036-a9ad-40c2-b192-35a2d3e0c2a1 /var/spool btrfs subvol=@/var/spool 0 0
UUID=ab492036-a9ad-40c2-b192-35a2d3e0c2a1 /var/tmp btrfs subvol=@/var/tmp 0 0
UUID=ab492036-a9ad-40c2-b192-35a2d3e0c2a1 /.snapshots btrfs subvol=@/.snapshots 0 0
UUID=74a150ca-64ab-4f6f-973f-5ba106a4369b /home                xfs        defaults              1 2

mtab


sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
devtmpfs /dev devtmpfs rw,size=3778280k,nr_inodes=944570,mode=755 0 0
securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /run tmpfs rw,nosuid,nodev,mode=755 0 0
tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,mode=755 0 0
cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd 0 0
pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0
cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0
cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0
cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0
cgroup /sys/fs/cgroup/net_cls,net_prio cgroup rw,nosuid,nodev,noexec,relatime,net_cls,net_prio 0 0
cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0
cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct 0 0
cgroup /sys/fs/cgroup/hugetlb cgroup rw,nosuid,nodev,noexec,relatime,hugetlb 0 0
cgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0
cgroup /sys/fs/cgroup/pids cgroup rw,nosuid,nodev,noexec,relatime,pids 0 0
cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0
/dev/sda10 / btrfs rw,relatime,space_cache,subvolid=259,subvol=/@/.snapshots/1/snapshot 0 0
systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=26,pgrp=1,timeout=0,minproto=5,maxproto=5,direct 0 0
mqueue /dev/mqueue mqueue rw,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,relatime 0 0
hugetlbfs /dev/hugepages hugetlbfs rw,relatime 0 0
/dev/sda10 /opt btrfs rw,relatime,space_cache,subvolid=260,subvol=/@/opt 0 0
/dev/sda10 /var/lib/named btrfs rw,relatime,space_cache,subvolid=271,subvol=/@/var/lib/named 0 0
/dev/sda10 /var/lib/libvirt/images btrfs rw,relatime,space_cache,subvolid=266,subvol=/@/var/lib/libvirt/images 0 0
/dev/sda10 /var/lib/machines btrfs rw,relatime,space_cache,subvolid=267,subvol=/@/var/lib/machines 0 0
/dev/sda10 /srv btrfs rw,relatime,space_cache,subvolid=261,subvol=/@/srv 0 0
/dev/sda10 /.snapshots btrfs rw,relatime,space_cache,subvolid=258,subvol=/@/.snapshots 0 0
/dev/sda10 /var/cache btrfs rw,relatime,space_cache,subvolid=264,subvol=/@/var/cache 0 0
/dev/sda10 /var/lib/mysql btrfs rw,relatime,space_cache,subvolid=270,subvol=/@/var/lib/mysql 0 0
/dev/sda10 /var/crash btrfs rw,relatime,space_cache,subvolid=265,subvol=/@/var/crash 0 0
/dev/sda10 /var/lib/mariadb btrfs rw,relatime,space_cache,subvolid=269,subvol=/@/var/lib/mariadb 0 0
/dev/sda10 /tmp btrfs rw,relatime,space_cache,subvolid=262,subvol=/@/tmp 0 0
/dev/sda10 /var/log btrfs rw,relatime,space_cache,subvolid=273,subvol=/@/var/log 0 0
/dev/sda10 /var/lib/mailman btrfs rw,relatime,space_cache,subvolid=268,subvol=/@/var/lib/mailman 0 0
/dev/sda10 /var/lib/pgsql btrfs rw,relatime,space_cache,subvolid=272,subvol=/@/var/lib/pgsql 0 0
/dev/sda10 /var/tmp btrfs rw,relatime,space_cache,subvolid=276,subvol=/@/var/tmp 0 0
/dev/sda10 /var/spool btrfs rw,relatime,space_cache,subvolid=275,subvol=/@/var/spool 0 0
/dev/sda10 /usr/local btrfs rw,relatime,space_cache,subvolid=263,subvol=/@/usr/local 0 0
/dev/sda9 /home xfs rw,relatime,attr2,inode64,noquota 0 0
/dev/sda10 /var/opt btrfs rw,relatime,space_cache,subvolid=274,subvol=/@/var/opt 0 0
/dev/sda1 /boot ext4 rw,relatime,data=ordered 0 0
fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0
tmpfs /run/user/0 tmpfs rw,nosuid,nodev,relatime,size=763972k,mode=700 0 0
gvfsd-fuse /run/user/0/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=0,group_id=0 0 0

have you noticed that there is no entry for /proc,/sys etc., in fstab.

If anything goes wrong I must boot into rescue mode using opensuse leap 42.2 dvd and do chroot and after that perform any modifications. As something is missing in fstab I am unable to chroot in rescue mode.

Here’s a guide on how to boot from a rescue system and using chroot…

https://doc.opensuse.org/documentation/leap/startup/html/book.opensuse.startup/cha.trouble.html#sec.trouble.data.recover.rescue.filesystem

/proc is a virtual directory it does not exist on the drive. It contains the process running on a system. It is created at boot. not clear why you are trying to mount it. Exactly what command is run in the rescue. In essence with change root you barrow the running kernels /proc to use in the chroot.

When I issue the command mount -t proc none /mnt/proc I am getting error as /proc not found in /etc/fstab

There are many instances where mount /proc is used for example examine the following link which this procedure I have followed a number of times previously.

https://forums.opensuse.org/content.php/128-Re-install-Grub2-from-DVD-Rescue

For the last time - please copy and paste exact command and its output, not your interpretation of them.

I use:


mount --bind /dev  /mnt/dev
mount --bind /proc  /mnt/proc
mount --bind /sys  /mnt/sys

That’s in addition to the needed partition mounts, and assume that I have mounted the root partition at “/mnt”.

Yes mount --bind is a way to set a directory to also appear to be in a different local. It is not the same as mounting a partition at a mount point. You bind an existing directory to, in this case, the root partition that is mounted to be the target of chroot. When you chroot all the processes and devices have to be in place so that the new partition takes over the job of running the current kernel. All 3 of those directories are virtual created at run time and not on the drive itself