LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Mystery mdadm raid1 mounting (https://www.linuxquestions.org/questions/linux-general-1/mystery-mdadm-raid1-mounting-4175601042/)

ajohn 03-04-2017 04:06 AM

Mystery mdadm raid1 mounting
 
I've been tearing my hair out on this for several days so hope some one can help. It's a desktop machine, my partitioning may be a bit unusual but has it's reasons. I use a raid1 array as /home. This is the disk layout.

Code:

john@dhcppc1:~> lsblk
NAME    MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINT
sda      8:0    0 119.2G  0 disk 
├─sda1    8:1    0  195M  0 part  /boot/efi
└─sda2    8:2    0 119.1G  0 part  /
sdb      8:16  0 232.9G  0 disk 
├─sdb1    8:17  0    10G  0 part  [SWAP]
├─sdb2    8:18  0    10G  0 part  /var
├─sdb3    8:19  0    10G  0 part  /tmp
└─sdb4    8:20  0 202.9G  0 part  /home/home2
sdc      8:32  0 232.9G  0 disk 
└─sdc1    8:33  0 232.9G  0 part 
sdd      8:48  1 232.9G  0 disk 
└─sdd1    8:49  1 232.9G  0 part 
  └─md0  9:0    0 232.9G  0 raid1
sr0      11:0    1  1024M  0 rom

Which sums the problem up. fstab shows the same but by name. I can't find md0 mapped to home anywhere. I've tried searching all files for home - rather a lot and later for uuid's. Those map to md0 in an odd sort of way but no signs of an assignment to home.

One of the drives is down. It needs replacing and also enlarging. For a number of reasons my general idea is to map home to a partition on the spare disc and use rsync to copy the files across. Remove the raid, install new drives, convert to raid, map to home and copy the files across again. To do that I need to remove the current home mapping.

The guides about on doing this via mdadm make various suggestions and many are rather old. The above looks to be a simpler way of doing it. I'm basically a desktop person and only go below if I must. I usually manage when I do but fully understanding all of what mdadm can do is a fair old task.

I'm also now determined to find out just how /home is mapped even if I fix it some another way.

The failure might be down to a power failure or actually the first time I installed opensuse leap 42.2. The install didn't indicate that it would format home but all of the old files from 12.3 went - as they needed to. During install I imported the partitioning and all apart from that aspect looked ok.

John
-

smallpond 03-04-2017 09:56 AM

From the above it looks like home is not a separate mount, it is under '/' on sda2. You seem to have half a raid1. Post the output of 'cat /proc/mdstat' to see.

rknichols 03-04-2017 10:02 AM

The quick way to find out what filesystem holds a directory is to use the df command, in your case:
Code:

df /home/
Do include the trailing "/" to force a possible symlink to be followed to its target.

ajohn 03-04-2017 10:35 AM

Thanks both. Arrggggggggggggggg. I imported my existing partitioning when I installed. It's totally disregarded what I had spec'd a /home. I've been fiddling around for over 4 days trying to sort this.

Code:

john@dhcppc1:~> df /home/
Filesystem    1K-blocks    Used Available Use% Mounted on                                   
/dev/sda2      122742812 48287944  68196796  42% /

also

Code:

john@dhcppc1:~> cat /proc/mdstat                                                             
Personalities : [raid1]                                                                       
md0 : active raid1 sdd1[1]                                                                   
      244197184 blocks super 1.0 [2/1] [_U]                                                   
      bitmap: 2/2 pages [8KB], 65536KB chunk                                                 
                                                                                             
unused devices: <none>

I did know one drive was down, need more space and wasn't keen on doing anything until I found out what was going on. Not keen on replacing it and then enlarging either as 2 drives would have to be changed and then enlarged. Examples on the web vary which was worrying. So intended to make a temporary /home then remove the raid and create another with new larger disks and then map that to home. Copying files across of course. It's done the first stage of that for me - looking on the bright side.

A scan with mdadm shows one disk active and the other as clean. Checksums ok on both but the one disk shows read errors at about the time I installed / had a power failure but I think that was well before the install.

That just leaves how do I remove the current raid completely? It does seem to be mounted but not mapped anywhere.

John
-

ajohn 03-04-2017 12:06 PM

Just a note.

I used yast2 to delete the raid. One problem. For some reason KDE reboot just hung up and wouldn't. Something about the greater not being happy and couldn't report the bug because it was unhappy. A reboot from the console did work and following that kde's was ok too.

Wonder what KDE was doing that needed an unused raid to be there.

John
-


All times are GMT -5. The time now is 04:15 PM.