raid 1 question

hi,

never really worked with raids so I figured I try it out on an old pc, this is what I did:

install opensuse and at the partitioning part I did the following

sda1 2gb
sda2 20gb
sda3 rest
sdb1 2gb
sdb2 20gb
sdb3 rest

then made raid 1:

sda1 + sda1 as swap with name swap
sda2 + sdb2 as / with name root
sda3 + sdb3 as home with name home

all went well, opensuse got installed and all packaged where patched to latest release.

however when I reboot it hangs:

OK ] Found device /dev/md/swap
Activating swap /dev/md/swap…
OK ] Activated swap /dev/md/swap.
OK ] Reached target Swap.
*** ] A startjob is running for dev-md-home.device

which after a while changes into

TIME ] Timed out waiting for device dev-md-home.device
[DEPEND] Dependency failed for /home
[DEPEND] Dependency failed for Local File System.
Welcome to emergency mode! Afterlogging in, type “journalctl -xb” to view system logs, " systemctl reboot" to reboot, “systemctl default” to try again to boot into default mode.

that last messages just repeats but one can’t really login to tryp any of that.

So I went to search and learned about mdadm, so booted into rescue system with the USB stick and checked it all out with: mdadm -D /dev/md127, this showed that it was pending syncing, maybe that is why it said “A startjob is running” , so following some guides on the web:

mdadm --stop /dev/md127
mdadm --assemble --run --force --update=resync /dev/md127 /dev/sda3 /dev/sdb3

and after a while mdadm -D /dev/md127 showed status active, did the same for swap and / (md125 and md126)

rebooted and still got the same message.
fstab looks normal
/dev/md/swap swap swap defaults 0 0
/dev/md/root / ext4 acl,user_xattr 1 1
/dev/md/home /home ext4 acl,user_xattr 1 2

Sooooo what am I missing or doing wrong here ? is it systemd having issues mounting a raid1 or am I just doing something really obvious wrong ?

Thanks !

Please always post computer text between CODE tags. You get CODE tags by clicking on the # button in the tool bar of the post editor. Copy/past the prompt, the command the output and the next prompt in one sweep (when it is about a command and it’s output). I know that some of the ouput you show can not be copy/pasted (from the boot screen e.g.), but others can. So you do not say “fstab looks normal” because that is something you want us to look at. You post

cat /etc/fstab

but then with the prompts and the output as asked above.

We are basicaly non-believers. Story telling is nice for the background information, but undistorted computer output is what we love. :wink:

here you go :slight_smile:

sda is 1st disk of the raid1
sdb is 2nd disk of the raid1
sdc old winxp, not used
sdd is usb stick with suse 13.1
sde is usb stick to put these outputs on
mounted /dev/mnd125 on /root/sda2 to get to the /etc/fstab


cat fstab
/dev/md/swap         swap                 swap       defaults              0 0
/dev/md/root         /                    ext4       acl,user_xattr        1 1
/dev/md/home         /home                ext4       acl,user_xattr        1 2

fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes, 976773168 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 label type: dos
Disk identifier: 0x000a3838

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048     4208639     2103296   fd  Linux raid autodetect
/dev/sda2   *     4208640    46153727    20972544   fd  Linux raid autodetect
/dev/sda3        46153728   976773119   465309696   fd  Linux raid autodetect

Disk /dev/sdb: 500.1 GB, 500107862016 bytes, 976773168 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 label type: dos
Disk identifier: 0x68b96c68

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048     4208639     2103296   fd  Linux raid autodetect
/dev/sdb2   *     4208640    46153727    20972544   fd  Linux raid autodetect
/dev/sdb3        46153728   976773119   465309696   fd  Linux raid autodetect

Disk /dev/md127: 476.5 GB, 476476932096 bytes, 930619008 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/md126: 2153 MB, 2153709568 bytes, 4206464 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/md125: 21.5 GB, 21475753984 bytes, 41944832 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
lsblk
NAME      MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda         8:0    0 465.8G  0 disk  
├─sda1      8:1    0     2G  0 part  
│ └─md126   9:126  0     2G  0 raid1 
├─sda2      8:2    0    20G  0 part  
│ └─md125   9:125  0    20G  0 raid1 /root/sda2
└─sda3      8:3    0 443.8G  0 part  
  └─md127   9:127  0 443.8G  0 raid1 
sdb         8:16   0 465.8G  0 disk  
├─sdb1      8:17   0     2G  0 part  
│ └─md126   9:126  0     2G  0 raid1 
├─sdb2      8:18   0    20G  0 part  
│ └─md125   9:125  0    20G  0 raid1 /root/sda2
└─sdb3      8:19   0 443.8G  0 part  
  └─md127   9:127  0 443.8G  0 raid1 
sdc         8:32   0 298.1G  0 disk  
├─sdc1      8:33   0 146.5G  0 part  
├─sdc2      8:34   0    54G  0 part  
├─sdc3      8:35   0     1K  0 part  
└─sdc5      8:37   0  97.7G  0 part  
sdd         8:48   1  14.6G  0 disk  
├─sdd1      8:49   1     4M  0 part  
└─sdd2      8:50   1   4.3G  0 part  
sde         8:64   1  31.2M  0 disk  
└─sde1      8:65   1  31.2M  0 part  /root/usb
sr0        11:0    1  1024M  0 rom   
loop0       7:0    0  35.1M  1 loop  /parts/mp_0000
loop1       7:1    0  20.1M  1 loop  /parts/mp_0001
loop2       7:2    0  48.6M  1 loop  /mounts/mp_0000
loop3       7:3    0  22.4M  1 loop  /mounts/mp_0001
loop4       7:4    0   4.1M  1 loop  /mounts/mp_0002

well I got it working, not sure what is wrong though…

checking /dev/md from the USB stick showed:

ls /dev/md
linux:home  linux:root  linux:swap

so I changed the fstab to:

/dev/md/linux:swap         swap                 swap       defaults              0 0
/dev/md/linux:root         /                    ext4       acl,user_xattr        1 1
/dev/md/linux:home         /home                ext4       acl,user_xattr        1 2

and it eventually booted, but could not mound swap during boot, now looking into /dev/md from the running machine shows:

ls /dev/md
linux:home  root  swap

so changing the fstab to:

/dev/md/swap         swap                 swap       defaults              0 0
/dev/md/root         /                    ext4       acl,user_xattr        1 1
/dev/md/linux:home         /home                ext4       acl,user_xattr        1 2

gives me a normal machine, but I can’t really believe this is the normal way to go, could this be happening because I gave them a name when I ran the opensuse installer ?

I just did a complete fresh install and did not game them names when making the raids.

the fstab now mounts /dev/disk/by-id like it normally does with none-raids and everything gets mounted correctly at boot, seems like a bug I guess, will check bugzilla and report if I can’t find it

Confusing indeed. Sorry I can not be of much help. Hopefully others will tune in.

In any case, thanks for reporting back and please keep us informed. Allways good for others that run into the same.

Yes, this is a bug. Actually, in my case it fails with /dev/md/swap already.

https://bugzilla.novell.com/show_bug.cgi?id=867514

hi again,

got everything running fine so I figured time for some more testing to learn how it all works and how I can recover.

So I disabled /dev/sdb from the system and booted it up.
Grub started
Initial booting started
And then it halted with systemd showing:

*** ] 1 of 2 A startjob is running for…

which listed de md’s for /home and swap

I would have thought that the system would still be able to bootup even with 1 disk ? or am I to naive ?

This is fixed in current maintenance update for mdadm for 13.1. Did you install actual patches?

actually no, as was testing I skipped the big patch round, will do. thanks !

that was it, thanks :slight_smile: