Jump to content

Raid array vanishes after reboot

Go to solution Solved by Dutch_Master,

Your best option is to install a tool called Webmin. It does a lot of things, but for your case, it makes it fairly easy to get a RAID working, persistently. Add the Webmin repository to your sources.list file and use the package manager (Synaptic, aptitude) to install the tool. Once done, fire up your browser and connect to https://localhost:10000

 

During installation, Webmin will discover you've got mdadm installed already and make the RAID page available. It's under Hardware -> Linux RAID. Take it from there.

 

HTH!

Hello everybody

 

I'm pretty new to Linux (running Kubuntu) and I've been trying to get a raid array to work for the past 2 days.

I have 4 6TB drives that I'd like to use to create a raid 5 array. However, after creating the array, it vanished after a reboot.

 

As for my current understanding after research, the array is not being assembled at boot. Is that correct? How do I fix my issue?

I've attached a screenshot. Hopefully, this provides at least a bit information in order to troubleshoot. If you need anything else, please let me know.

 

Thanks.

Screenshot_20200618_140002.png

Link to comment
Share on other sites

Link to post
Share on other sites

Your best option is to install a tool called Webmin. It does a lot of things, but for your case, it makes it fairly easy to get a RAID working, persistently. Add the Webmin repository to your sources.list file and use the package manager (Synaptic, aptitude) to install the tool. Once done, fire up your browser and connect to https://localhost:10000

 

During installation, Webmin will discover you've got mdadm installed already and make the RAID page available. It's under Hardware -> Linux RAID. Take it from there.

 

HTH!

"You don't need eyes to see, you need vision"

 

(Faithless, 'Reverence' from the 1996 Reverence album)

Link to comment
Share on other sites

Link to post
Share on other sites

4 hours ago, Dutch_Master said:

Your best option is to install a tool called Webmin. It does a lot of things, but for your case, it makes it fairly easy to get a RAID working, persistently. Add the Webmin repository to your sources.list file and use the package manager (Synaptic, aptitude) to install the tool. Once done, fire up your browser and connect to https://localhost:10000

 

During installation, Webmin will discover you've got mdadm installed already and make the RAID page available. It's under Hardware -> Linux RAID. Take it from there.

 

HTH!

Thanks for that. I just installed Webmin and as you said, the Raid page is showing up. However, I'm not sure how to move on from there now.

 

  • What's confusing me right now is that it is showing me that there is an active RAID5 but it's only 40.5MiB?
  • As well when I choose RAID5 (Distributed Parity) and click on the green "Create RAID device of LEVEL" button I can just choose RAID device 0, which won't work.

 

I've attached 2 more screenshots.

 

Edit: Is it necessary to delete this RAID device array and make a new one using Webmin?

Screenshot_20200618_204757.png

Screenshot_20200618_205018.png

Link to comment
Share on other sites

Link to post
Share on other sites

As root (or prefix with sudo)

mv /etc/mdadm/mdadm.conf /etc/mdadm/mdadm.conf.bak

This moves your existing mdadm.conf file out of the way as a backup file (just plain text, as is usual in Linux) then reboot the machine. This should create a new mdadm.conf file, or nothing at all, and you should be able to create a new RAID in the web interface. If the 40MB RAID re-appears, just delete it completely by clicking on the array and then remove it with the corresponding button on the next page.

 

Note that if you want to assemble an array, you need to make sure each drive has a suitable file system on it. Technically it shouldn't have to, but in practice it's better to format a drive before inclusion in a RAID. Install the fdisk tool (or variants of it that can handle large partitions if you have large disks that require a GPT over traditional MBR) and format each disk as a single partition with ext4, JFS or XFS (choose one, don't mix!), then try to build a RAID with them.

"You don't need eyes to see, you need vision"

 

(Faithless, 'Reverence' from the 1996 Reverence album)

Link to comment
Share on other sites

Link to post
Share on other sites

16 hours ago, Dutch_Master said:

As root (or prefix with sudo)


mv /etc/mdadm/mdadm.conf /etc/mdadm/mdadm.conf.bak

This moves your existing mdadm.conf file out of the way as a backup file (just plain text, as is usual in Linux) then reboot the machine. This should create a new mdadm.conf file, or nothing at all, and you should be able to create a new RAID in the web interface. If the 40MB RAID re-appears, just delete it completely by clicking on the array and then remove it with the corresponding button on the next page.

 

Note that if you want to assemble an array, you need to make sure each drive has a suitable file system on it. Technically it shouldn't have to, but in practice it's better to format a drive before inclusion in a RAID. Install the fdisk tool (or variants of it that can handle large partitions if you have large disks that require a GPT over traditional MBR) and format each disk as a single partition with ext4, JFS or XFS (choose one, don't mix!), then try to build a RAID with them.

Thanks, the RAID is working now and gets assembled and mounted at boot!

 

Two more things:

1. I can't just copy, paste or create new folders on the RAID device now (without using the Terminal).

How can I change that, so I can use the keyboard shortcuts etc.?

 

2. Is there an easy way to setup email alerts using Webmin?

I'd like to get messages when one of the disks fails and a monthly report about the heath of the disks.

I tried to configure an email in Webmin - > Webmin configuration -> Sending emails (see attachment). Anyways, when I send a test message Webmin reports me the following:

Quote

Sending message from email@outlook.com to email@hotmail.com ..
.. sending failed : SMTP command failed : .

 

Screenshot_20200619_140314.png

Link to comment
Share on other sites

Link to post
Share on other sites

Post the contents of the fstab file:

cat /etc/fstab

As for the mail part, I haven't used it myself, but try switching the sender to Default.

"You don't need eyes to see, you need vision"

 

(Faithless, 'Reverence' from the 1996 Reverence album)

Link to comment
Share on other sites

Link to post
Share on other sites

26 minutes ago, Dutch_Master said:

Post the contents of the fstab file:


cat /etc/fstab

As for the mail part, I haven't used it myself, but try switching the sender to Default.

This is the content of my fstab:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda2 during installation
UUID=83f1dc4b-6e1f-4e62-8425-a5f366fe27f4 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=040D-1261  /boot/efi       vfat    umask=0077      0       1
/swapfile                                 none            swap    sw              0       0
/dev/md0        /mnt/raid       ext4    defaults        0       0

 

Link to comment
Share on other sites

Link to post
Share on other sites

That's good. You'll need write as well as read permissions to the /mnt/raid directory:

chmod -R +rwx /mnt/raid

Having said that, it might be easier to re-assign the entire directory to your normal user. That comes with some security risks (although on a single-user system these are marginal) so try the chmod method first.

"You don't need eyes to see, you need vision"

 

(Faithless, 'Reverence' from the 1996 Reverence album)

Link to comment
Share on other sites

Link to post
Share on other sites

11 minutes ago, Dutch_Master said:

That's good. You'll need write as well as read permissions to the /mnt/raid directory:


chmod -R +rwx /mnt/raid

Having said that, it might be easier to re-assign the entire directory to your normal user. That comes with some security risks (although on a single-user system these are marginal) so try the chmod method first.

Thanks. Unfortunately, the chmod method didn't work.

Link to comment
Share on other sites

Link to post
Share on other sites

Right, then we're going in deep! ;)

 

First, determine what group your normal user has:

groups #execute as normal user

Let's say for the sake of this intro your regular user name is gripfly. If you see that appearing in the output of the above command, your username is also a group. Next, invoke the chgrp command as root:

chgrp -R gripfly /mnt/raid  #prefix with sudo if your system doesn't have a normal root user!

Check if it has changed (again, as root):

ls-l /mnt/raid

The output should contain your username at least once. Btw, the previous command can be invoked prior to changing the group of /mnt/raid, in order to see the changes the command makes. If it doesn't work, you can revert the situation by replacing gripfly with the group name it had before and re-execute the command.

 

Pro-tip: use the arrow keys on the keyboard to scroll through previous commands on the cli (command line interface).

"You don't need eyes to see, you need vision"

 

(Faithless, 'Reverence' from the 1996 Reverence album)

Link to comment
Share on other sites

Link to post
Share on other sites

38 minutes ago, Dutch_Master said:

Right, then we're going in deep! ;)

 

First, determine what group your normal user has:


groups #execute as normal user

Let's say for the sake of this intro your regular user name is gripfly. If you see that appearing in the output of the above command, your username is also a group. Next, invoke the chgrp command as root:


chgrp -R gripfly /mnt/raid  #prefix with sudo if your system doesn't have a normal root user!

Check if it has changed (again, as root):


ls-l /mnt/raid

The output should contain your username at least once. Btw, the previous command can be invoked prior to changing the group of /mnt/raid, in order to see the changes the command makes. If it doesn't work, you can revert the situation by replacing gripfly with the group name it had before and re-execute the command.

 

Pro-tip: use the arrow keys on the keyboard to scroll through previous commands on the cli (command line interface).

Current state (Of ownership of the RAID device) after the commands:

  • User: root
  • Group: "gripfly"

Nonetheless, I still don't have permission to create a new folder.

 

Edit: As a side note, I have to use the sudo prefix in all commands that require root access.

 

Edit 2: Just checked the Tab "Advanced Permissions". The owning Group doesn't have write permissions.

Screenshot_20200619_190931.png

 

 

Edit 3: Just got myself access using the following command:

sudo chmod g+rwx /mnt/raid

Now, the owning group has write access.

 

Thanks very much for your help!

Link to comment
Share on other sites

Link to post
Share on other sites

Good, glad you got it sorted!

 

Another pro-tip:

sudo su

This gives you a semi-persistent root shell, until you close the terminal. Meaning, all commands that require root privileges can be run w/o the sudo prefix.

"You don't need eyes to see, you need vision"

 

(Faithless, 'Reverence' from the 1996 Reverence album)

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×