How to install mdadm on Ubuntu 17.04

How to install mdadm on Ubuntu 17.04

Mdadm is a free and open source GNU/Linux utility used to manage and monitor software RAID devices. It is used to configure RAID disks and present to the Linux kernel as a block device. This includes whole hard drives and their partitions. This tutorial covers the installation procedure of mdadm on Ubuntu 17.04.

Installation procedure

To start the installation procedure, add the repo by executing the following command.

root@linuxhelp1:~# add-apt-repository ppa:eugenesan/ppa
This repository contains collection of customized, updated, ported and backported
packages for two last LTS releases and latest pre-LTS release.
Packages for older releases relocated to ppa:eugenesan/archive or deleted.
+-------------------------------------------------------------------------------------+
| Disclaimer:
+-------------------------------------------------------------------------------------+
* Packages in this a nd related PPAs are for personal use only.
  They developed specifically for several custom environments and may not work for you.
* Usage of packages in this PPA, in some forms, might contradict licenses of software
  packaged in this and related PPAs. End users and administrator are responsible for
  runtime licensing and possible legal consequences.
* Some packages provided with their dependencies while some might require additional
  Ubuntu repositories and external PPAs. Below is the list of
.
.
.
Press [ENTER] to continue or ctrl-c to cancel adding it
gpg: keybox ' /tmp/tmp58gcy2yp/pubring.gpg'  created
gpg: /tmp/tmp58gcy2yp/trustdb.gpg: trustdb created
gpg: key E61380B28313A596: public key " Launchpad synergy+"  imported
gpg: Total number processed: 1
gpg:imported: 1
OK

The repositories are added to the target system. Update the repo by running the apt-get update command.

root@linuxhelp1:~# apt-get update
Get:1 http://ppa.launchpad.net/eugenesan/ppa/ubuntu zesty InRelease [15.4 kB]
Hit:2 http://in.archive.ubuntu.com/ubuntu zesty InRelease
Hit:3 http://security.ubuntu.com/ubuntu zesty-security InRelease
Hit:4 http://in.archive.ubuntu.com/ubuntu zesty-updates InRelease
Hit:5 http://in.archive.ubuntu.com/ubuntu zesty-backports InRelease
Get:6 http://ppa.launchpad.net/eugenesan/ppa/ubuntu zesty/main amd64 Packages [1,100 B]
Get:7 http://ppa.launchpad.net/eugenesan/ppa/ubuntu zesty/main i386 Packages [1,108 B]
Get:8 http://ppa.launchpad.net/eugenesan/ppa/ubuntu zesty/main Translation-en [1,288 B]
Fetched 18.9 kB in 1s (12.3 kB/s)
Reading package lists... Done

The target system is updated with the required repositories. Install the mdadm package and press y to continue with the installation procedure.

root@linuxhelp1:~# apt-get install mdadm -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
default-mta | mail-transport-agent
The following NEW packages will be installed:
mdadm
0 upgraded, 1 newly installed, 0 to remove and 33 not upgraded.
Need to get 400 kB of archives.
After this operation, 1,181 kB of additional disk space will be used.
Get:1 http://in.archive.ubuntu.com/ubuntu zesty/main amd64 mdadm amd64 3.4-4 [400 kB]
Fetched 400 kB in 1s (203 kB/s)
Preconfiguring packages ...
Selecting previously unselected package mdadm.
(Reading database ... 203161 files and directories currently installed.)
Preparing to unpack .../archives/mdadm_3.4-4_amd64.deb ...
Unpacking mdadm (3.4-4) ...
Processing triggers for ureadahead (0.100.0-19) ...
Setting up mdadm (3.4-4) ...
Generating mdadm.conf... done.
update-initramfs: deferring update (trigger activated)
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-4.10.0-21-generic
Found initrd image: /boot/initrd.img-4.10.0-21-generic
Found linux image: /boot/vmlinuz-4.10.0-19-generic
Found initrd image: /boot/initrd.img-4.10.0-19-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done
update-rc.d: warning: start and stop actions are no longer supported  falling back to defaults
Processing triggers for doc-base (0.10.7) ...
Processing 2 added doc-base files...
Processing triggers for systemd (232-21ubuntu2) ...
Processing triggers for man-db (2.7.6.1-2) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for initramfs-tools (0.125ubuntu9) ...
update-initramfs: Generating /boot/initrd.img-4.10.0-21-generic
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.

The application has been succesfully installed in the target system. To know more about the options used in the mdadm, execute the following command.

root@linuxhelp1:~# mdadm --help
mdadm is used for building, managing, and monitoring
Linux md devices (aka RAID arrays)
Usage: mdadm --create device options...
Create a new array from unused devices.
mdadm --assemble device options...
Assemble a previously created array.
mdadm --build device options...
Create or assemble an array without metadata.
mdadm --manage device options...
make changes to an existing array.
mdadm --misc options... devices
report on or modify various md related devices.
mdadm --grow options device
resize/reshape an active array
mdadm --incremental device
add/remove a device to/from an array as appropriate
mdadm --monitor options...
Monitor one or more array for significant changes.
mdadm device options...
Shorthand for --manage.
Any parameter that does not start with ' -'  is treated as a device name
or, for --examine-bitmap, a file name.
The first such name is often the name of an md device.Subsequent
names are often names of component devices.

For detailed help on the above major modes use --help after the mode
e.g.
mdadm --assemble --help
For general help on options use
mdadm --help-options

For removing the package, run the following remove command and press y to continue with the uninstallation process.

root@linuxhelp1:~# apt-get remove mdadm -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
mdadm
0 upgraded, 0 newly installed, 1 to remove and 33 not upgraded.
After this operation, 1,181 kB disk space will be freed.
(Reading database ... 203234 files and directories currently installed.)
Removing mdadm (3.4-4) ...
update-initramfs: deferring update (trigger activated)
Processing triggers for initramfs-tools (0.125ubuntu9) ...
update-initramfs: Generating /boot/initrd.img-4.10.0-21-generic
Processing triggers for doc-base (0.10.7) ...
Processing 2 removed doc-base files...
Processing triggers for man-db (2.7.6.1-2) ...

Wasn' t that an easy installation procedure? Mdadm supports TRIM operations for the underlying solid-state drives.

FAQ
Q
where to check the options available for mdadm?
A
the options used in the mdadm, execute the following command
# mdadm --help
Q
which command to add the repo for mdadm in terminal?
A
add the repo of mdadm by executing the following command
# add-apt-repository ppa:eugenesan/ppa
Q
what is the use of installing mdadm in ubuntu?
A
Mdadm is a free and open source GNU/Linux utility used to manage and monitor software RAID devices. It is used to configure RAID disks and present to the Linux kernel as a block device. This includes whole hard drives and their partitions.
Q
If there is any source package available for mdadm?
A
refer the link for source package of mdadm
'https://git.kernel.org/pub/scm/utils/mdadm/mdadm.git/snapshot/mdadm-4.0.tar.gz".
Q
Whether mdadm is available for windows?
A
no. mdadm is not available for Windows.