0

I had installed two RAID1 drives on Ubuntu 18.04 and had verified that if any one drive is taken out, the system booted and then after the second drive was added, it resynced.

That was some months back... I now see the following output of df:

Filesystem     1K-blocks     Used Available Use% Mounted on
udev             7938140        0   7938140   0% /dev
tmpfs            1593780     1116   1592664   1% /run
/dev/md1       929492160 22455384 859751428   3% /
tmpfs            7968892        0   7968892   0% /dev/shm
tmpfs               5120        0      5120   0% /run/lock
tmpfs            7968892        0   7968892   0% /sys/fs/cgroup
tmpfs            1593776        0   1593776   0% /run/user/1000

I would have expected to see two entries in df output. One for /dev/md1 and another for /dev/md0.

And this is the output of fdisk -l

  Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
  Units: sectors of 1 * 512 = 512 bytes
  Sector size (logical/physical): 512 bytes / 512 bytes
  I/O size (minimum/optimal): 512 bytes / 512 bytes
  Disklabel type: dos
  Disk identifier: 0xee3b4e44

  Device     Boot    Start        End    Sectors   Size Id Type
  /dev/sda1           2048   62500863   62498816  29.8G fd Linux raid autodetect
  /dev/sda2  *    62500864 1953523711 1891022848 901.7G fd Linux raid autodetect


  Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
  Units: sectors of 1 * 512 = 512 bytes
  Sector size (logical/physical): 512 bytes / 512 bytes
  I/O size (minimum/optimal): 512 bytes / 512 bytes
  Disklabel type: dos
  Disk identifier: 0xe78f1647

  Device     Boot    Start        End    Sectors   Size Id Type
  /dev/sdb1           2048   62500863   62498816  29.8G fd Linux raid autodetect
  /dev/sdb2  *    62500864 1953523711 1891022848 901.7G fd Linux raid autodetect


  Disk /dev/md0: 29.8 GiB, 31981568000 bytes, 62464000 sectors
  Units: sectors of 1 * 512 = 512 bytes
  Sector size (logical/physical): 512 bytes / 512 bytes
  I/O size (minimum/optimal): 512 bytes / 512 bytes


  Disk /dev/md1: 901.6 GiB, 968068431872 bytes, 1890758656 sectors
  Units: sectors of 1 * 512 = 512 bytes
  Sector size (logical/physical): 512 bytes / 512 bytes
  I/O size (minimum/optimal): 512 bytes / 512 bytes

Also cat /proc/mdstat lists the following:

   Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10] 
   md1 : active raid1 sda2[1] sdb2[0]
         945379328 blocks super 1.2 [2/2] [UU]
         bitmap: 4/8 pages [16KB], 65536KB chunk

   md0 : active raid1 sda1[1] sdb1[2]
         31232000 blocks super 1.2 [2/2] [UU]

   unused devices: <none>

Output of mount is:

   sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
   proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
   udev on /dev type devtmpfs (rw,nosuid,relatime,size=7938140k,nr_inodes=1984535,mode=755)
   devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
   tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=1593780k,mode=755)
   /dev/md1 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)
   securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
   tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
   tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
   tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
   cgroup on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime)
   cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
   pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
   cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
   cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
   cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
   cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
   cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
   cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
   cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
   cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
   cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
   cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
   cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
   systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=28,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=2459)
   hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
   fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
   debugfs on /sys/kernel/debug type debugfs (rw,relatime)
   configfs on /sys/kernel/config type configfs (rw,relatime)
   mqueue on /dev/mqueue type mqueue (rw,relatime)
   sunrpc on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
   binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
   lxcfs on /var/lib/lxcfs type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)
   tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=1593776k,mode=700,uid=1000,gid=1000)

Content of /etc/fstab is:

      # /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/md1 during installation
      UUID=f10a9259-4dca-4e48-b01d-4a524ffd0daa /               ext4    errors=remount-ro 0       1
      # swap was on /dev/md0 during installation
      UUID=8877598b-7735-420f-bd2c-0e7c30b0dd59 none            swap    sw              0       0

What am I missing? Is RAID1 not operational?

7
  • @KamilMaciorowski ls -l /dev/md0 displays: "brw-rw---- 1 root disk 9, 0 Aug 29 10:23 /dev/md0 "
    – Sunny
    Aug 29, 2019 at 6:02
  • @KamilMaciorowski output of mount is provided above. I edited the question as it is verbose to provide in comments.
    – Sunny
    Aug 29, 2019 at 6:25
  • I would guess (but not 100% sure) /dev/md0 should be mounted on /boot. Show us what's in /etc/fstab and the output of blkid /dev/md0.
    – Tomek
    Aug 29, 2019 at 6:36
  • @Tomek Output of sudo blkid /dev/md0 is /dev/md0: UUID="8877598b-7735-420f-bd2c-0e7c30b0dd59" TYPE="swap"
    – Sunny
    Aug 29, 2019 at 6:41
  • 1
    This is swap space, not a filesystem. You will see some output about it from swapon (alone, no options) command.
    – Tomek
    Aug 29, 2019 at 6:45

2 Answers 2

1

blkid and fstab both indicate that /dev/md0 is a swap space, therefore it will not show up in mount or df output.

swapon will print some details about configured swap devices and files.

2

I would have expected to see two entries in df output. One for /dev/md1 and another for /dev/md0.

df shows mounted filesystems. Not all of them, but it certainly doesn't show filesystems that are not mounted.

There is /dev/md1 in the output of mount (mounted on /). There is no /dev/md0. /dev/md0 is not mounted, so it doesn't appear in the output of df.

I don't know if it should be mounted or where you want it to be mounted. If you mount it somewhere, it will appear in the output of df.


According to your comment

Output of sudo blkid /dev/md0 is /dev/md0: UUID="8877598b-7735-420f-bd2c-0e7c30b0dd59" TYPE="swap"

and according to /etc/fstab

UUID=8877598b-7735-420f-bd2c-0e7c30b0dd59  none  swap  sw  0  0

/dev/md0 is your swap device. There is no filesystem there. In this state it should not be mounted and it shouldn't appear in the output of df.


In case this is not clear, let me state explicitly: there are two separate RAID 1 arrays.

  • md1 is larger, the underlying devices are sda2 and sdb2,
  • md0 is smaller, the underlying devices are sda1 and sdb1.
1
  • For RAID arrays, I am not sure if both need to be mounted. I have not changed anything as far as file systems to be mounted or automounted. I want to know what is wrong and what I need to be do. Therefore the question. It is a live system so I am afraid to try by just reading online.
    – Sunny
    Aug 29, 2019 at 6:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .