Read-only file system hardware fault in RAID



When you are getting errors from a file system like this..



cd /hom-bash: cannot create temp file for here-document: Read-only file system

-bash: cannot create temp file for here-document: Read-only file system

-bash: cannot create temp file for here-document: Read-only file system



You have new mail.

Last login: Tue Jun 15 13:16:58 2021 from 188.118.0.104

mktemp: failed to create file via template ‘/tmp/virtualenvwrapper-initialize-hook-XXXXXXXXXX’: Read-only file system

touch: cannot touch ‘’: No such file or directory

ERROR: virtualenvwrapper could not create a temporary file name.



It could be a hardware problem.


Due to a hardware fault, you have to replace your server while taking over the hard drives.

Furthermore both of my drives are faulty with one of them not even recognised by the system anymore. Mount your hard drive and back up my data and accept the full configuration loss for the server in order for us to replace them.


When my server has been booted into our rescue system. I could access it using the following IP address.


But?

How to mount this harddrive from RAID?


mount /dev/sda /mnt/crm/

mount: /mnt/crm: wrong fs type, bad option, bad superblock on /dev/sda, missing codepage or helper program, or other error.

root@rescue ~ # lsblk

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT

loop0 7:0 0 4G 1 loop

sda 8:0 0 2.7T 0 disk

├─sda1 8:1 0 32G 0 part

├─sda2 8:2 0 512M 0 part

├─sda3 8:3 0 1T 0 part

├─sda4 8:4 0 1.7T 0 part

└─sda5 8:5 0 1M 0 part

root@rescue ~ # mount /dev/sda4 /mnt/crm/

mount: /mnt/crm: unknown filesystem type 'linux_raid_member'.


cat /proc/mdstat

Personalities : [raid1]

unused devices: <none>




What am I doing wrong?

Or is this disc corrupt too and I can't use it?

When Hetzner has managed the server to bring my RAID back temporarily. I proceed to mount the md partitions as described in the article.


Mounting the drive(s) in the Rescue System

First, you should determine the partition identifier of the system by running the command lsblk. If the output is similar to the output below and there is a RAID entry in the TYPE column, then you have a software RAID running:

root@rescue ~ # lsblk

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT

loop0 7:0 0 4G 1 loop

sda 8:0 0 447.1G 0 disk

├─sda1 8:1 0 4G 0 part

│ └─md0 9:0 0 4G 0 raid1

├─sda2 8:2 0 512M 0 part

│ └─md1 9:1 0 511.4M 0 raid1

└─sda3 8:3 0 442.6G 0 part

└─md2 9:2 0 442.5G 0 raid1

sdb 8:16 0 447.1G 0 disk

├─sdb1 8:17 0 4G 0 part

│ └─md0 9:0 0 4G 0 raid1

├─sdb2 8:18 0 512M 0 part

│ └─md1 9:1 0 511.4M 0 raid1

└─sdb3 8:19 0 442.6G 0 part

└─md2 9:2 0 442.5G 0 raid1


Now you can mount the correct partition within an empty folder, for example, using /mnt.


If you have a software RAID, /dev/md2 is usually the system partition. (Enter cat /proc/mdstat to display all RAID partitions):

mount /dev/md2 /mnt
In any case we have backup in on our external server but now we can access some current configuration files.. Now we only need to restore our system from backup files and configs.
But it was nice to know that RAID works and can do what it expected to do.






Comments