Frautoincnam Guru
Joined: 19 May 2017 Posts: 325
|
Posted: Wed Dec 18, 2024 9:38 pm Post subject: can't stop raid with liveusb [solved] |
|
|
Edit:
Problem solved with a much older USB key which does not create a ghost assembly and takes into account my partitions. But I remain very curious about the solutions you could have proposed. (The 2 USB keys are gentoo livecds)
Hello,
On a computer running Gentoo and working perfectly, I have a raid 1 that associates the partitions of my 2 disks one by one, and no lvm.
Its mdadm.conf is:
Code: | DEVICE /dev/sd[ab][123567]
ARRAY /dev/md123 metadata=0.90 UUID=f3a1266a:b8a3d1c0:58f2f8e7:254eabdb
ARRAY /dev/md122 metadata=0.90 UUID=b98a2770:1b208d6e:58f2f8e7:254eabdb
ARRAY /dev/md125 metadata=0.90 UUID=526e6df9:9f1fd15b:58f2f8e7:254eabdb
ARRAY /dev/md124 metadata=0.90 UUID=0627d9a2:9b8f1319:58f2f8e7:254eabdb
ARRAY /dev/md126 metadata=0.90 UUID=60e93244:ca06e195:58f2f8e7:254eabdb
ARRAY /dev/md127 metadata=0.90 UUID=87af9f2a:1ad04950:58f2f8e7:254eabdb |
Code: | And fstab:
/dev/md123 /boot ext2 noauto,noatime 1 2
/dev/md122 / ext4 noatime,acl,user_xattr 0 1
/dev/md125 none swap sw 0 0
/dev/md124 /tmp ext4 nodev,noexec 1 2
/dev/md126 /home ext4 noatime,acl,usrquota 1 2
/dev/md127 /var ext4 noatime,acl,user_xattr 1 2 |
Now I would like to move all the contents of all partitions to one (/dev/md122 can hold everything) and then expand it to all the available space.
So I booted on a liveusb and here is what I get at boot:
Code: | livecd ~ # cat /proc/mdstat
Personalities : [raid1]
md122 : inactive md127p3[0](S)
1970112 blocks
md123 : inactive md127p2[1](S)
20025280 blocks
md124 : inactive md127p1[1](S)
102336 blocks
md125 : inactive md127p6[0](S)
29974464 blocks
md126 : inactive md127p5[1](S)
3018688 blocks
md127 : active (auto-read-only) raid1 sdb[1] nda[0]
62125440 blocks [2/2] [UU]
unused devices: <none> |
Code: | livecd ~ # lsmod | grep raid
raid1 53248 1
livecd ~ # mdadm --examine --scan
ARRAY /dev/md127 UUID=87af9f2a:1ad04950:58f2f8e7:254eabdb
ARRAY /dev/md123 UUID=f3a1266a:b8a3d1c0:58f2f8e7:254eabdb
ARRAY /dev/md122 UUID=b98a2770:1b208d6e:58f2f8e7:254eabdb
ARRAY /dev/md125 UUID=526e6df9:9f1fd15b:58f2f8e7:254eabdb
ARRAY /dev/md124 UUID=0627d9a2:9b8f1319:58f2f8e7:254eabdb
ARRAY /dev/md126 UUID=60e93244:ca06e195:58f2f8e7:254eabdb
livecd ~ # mdadm --examine --scan >> /etc/mdadm.conf
livecd ~ # rc-service mdadm start
* Starting mdadm monitor ... [ ok ] |
I have the impression that /dev/md127 has assembled the whole 2 disks, right?
So, I can't assemble each of my partitions and do what I want to do.
The problem is that I am unable to stop it, even if I first kill all processes that have access to it:
Code: | livecd ~ # kill $(ps awfu | grep "^gentoo" | awk '{print $2}')
livecd ~ # lsof /dev/md127
lsof: WARNING: can't stat() fuse.portal file system /run/user/1000/doc
Output information may be incomplete.
livecd ~ # umount /dev/md127
umount: /dev/md127: not mounted.
livecd ~ # mdadm --stop /dev/md127
mdadm: Cannot get exclusive access to /dev/md127:Perhaps a running process, mounted filesystem or active volume group? |
I don't know what to do.
Obviously, I don't want to destroy my raid or lose the contents of the disks. |
|