Help me to restore fstab!

  • So, by following something I found on google I've been an idiot and I deleted the fstab file and now OMV doesn't work anymore.


    I can ssh as root with Mobaxterm and I can see, download and delete files, but not write them. I have a backup of fstab on my PC so I tried to recreate it by pasting the content with nano but it doesn't let me save the file, it says the file system is read-only. Can you help me please?

  • The owner of the fstab is root. This is done to protect the system from the user. Please show

    Code
    ls -la /etc/fstab


    On my Raspi:

    Code
    pi@OMV:~ $ ls -ls /etc/fstab
    4 -rw-r--r-- 1 root root 1017 Apr 14 12:44 /etc/fstab

    Please use the following command to modify the fstab

    Code
    sudo nano /etc/fstab
  • The root filesystem might be mounted readonly. What is the output of:


    grep -w '/' /proc/mounts

    sudo blkid


    Also, what kind of system is it?

    omv 5.6.13 usul | 64 bit | 5.11 proxmox kernel | omvextrasorg 5.6.2 | kvm plugin 5.1.6
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • grep -w '/' /proc/mounts


    /dev/sda1 / ext4 ro,relatime 0 0


    sudo blkid


    /dev/sdb2: LABEL="4TB-RED" UUID="E2B231A8B2318259" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="3d98e3be-7531-4d39-bc7b-31120d3bd80a"

    /dev/sdd1: LABEL="Hyperspin" UUID="4669EB487C759C7E" TYPE="ntfs" PTTYPE="atari" PARTUUID="51b0c3b1-01"

    /dev/sdc1: LABEL="DISCO2TB" UUID="72121D05121CD049" TYPE="ntfs" PTTYPE="atari" PARTUUID="bf248bf0-01"

    /dev/sda1: UUID="1c48cbf7-d6b6-41d1-824e-772ee739d0b5" TYPE="ext4" PARTUUID="9237b448-01"

    /dev/sda5: UUID="1c877eba-fb34-4fd9-9d76-8aafef0c340a" TYPE="swap" PARTUUID="9237b448-05"

    /dev/sdb1: PARTLABEL="Microsoft reserved partition" PARTUUID="fe8361eb-6ed8-4039-8d82-3399e138e704"



    It's an Intel Atom board with OMV 5.x installed on a dedicated SSD, and it also has a PCI expansion card with some SATA ports. Hard disks are connected at random between the 2 sata on board ports and the PCI ones.


    P.S. the filesystem is, in fact mounted read-only, it says it so when I try to write files with nano (although it lets me delete files, for some reason).

  • The owner of the fstab is root. This is done to protect the system from the user. Please show

    Code
    ls -la /etc/fstab


    On my Raspi:

    Code
    pi@OMV:~ $ ls -ls /etc/fstab
    4 -rw-r--r-- 1 root root 1017 Apr 14 12:44 /etc/fstab

    Please use the following command to modify the fstab

    Code
    sudo nano /etc/fstab

    I deleted fstab, so I cannot ls it, and I already tried the nano route, it doesn't let me save the output because it says that the filesystem is read-only (even though it's strange that a "read-only" filesystem lets you delete files).

  • Since it is mounted readonly, we will have to fix that.


    sudo mount -o remount,rw /


    then (I used the partuuids from your output above):


    echo "proc /proc proc defaults 0 0" | sudo tee /etc/fstab

    echo "PARTUUID=9237b448-01 /boot vfat defaults 0 2" | sudo tee -a /etc/fstab

    echo "PARTUUID=9237b448-05 / ext4 defaults,noatime 0 1 | sudo tee -a /etc/fstab


    Then if you had any OMV mounted data disks


    sudo omv-salt deploy run fstab

    omv 5.6.13 usul | 64 bit | 5.11 proxmox kernel | omvextrasorg 5.6.2 | kvm plugin 5.1.6
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!


  • Now it doesn't even ssh, it says "connection refused". I'm afraid I'll have to reinstall it from scratch (now that I think about it, maybe I should have copied back my backup of fstab as soon as I mounted the filesystem as writable).


    the output of your last command was:

  • Now it doesn't even ssh, it says "connection refused

    Did you plug a monitor in to see if there is a message on the screen? Rebuilding fstab failed because it couldn't find a drive that you have listed in your database. - dev/disk/by-label/DATI500

    omv 5.6.13 usul | 64 bit | 5.11 proxmox kernel | omvextrasorg 5.6.2 | kvm plugin 5.1.6
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • Did you plug a monitor in to see if there is a message on the screen? Rebuilding fstab failed because it couldn't find a drive that you have listed in your database. - dev/disk/by-label/DATI500

    I had disconnacted that drive before the fstab mess, but I can reconnect it.


    When I boot the system I get this on screen: you are in emergency mode, give root password for maintenance.


    The problem is that after I input the password I always get an "incorrect login" message.

    The root password is the password I use to log in to OMV's web interface, right?

  • The root password is the password I use to log in to OMV's web interface, right

    No. omv web interface password is for the admin user. root is separate.


    When I boot the system I get this on screen: you are in emergency mode, give root password for maintenance.

    That is possibly happening because the drive is missing.

    omv 5.6.13 usul | 64 bit | 5.11 proxmox kernel | omvextrasorg 5.6.2 | kvm plugin 5.1.6
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!