I want to remove raid from my system as I am low on storage and I want to recover the second disk.
How can I recover the second disk, I tried but to no avail, here is my current state :
root@miirabox ~ # cat /proc/mdstat
Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10]
md2 : active raid1 nvme1n1p3[1] nvme0n1p3[0]
965467456 blocks super 1.2 [2/2] [UU]
bitmap: 8/8 pages [32KB], 65536KB chunk
md0 : active raid1 nvme1n1p1[1] nvme0n1p1[0]
33520640 blocks super 1.2 [2/2] [UU]
md1 : active raid1 nvme0n1p2[0](F) nvme1n1p2[1]
1046528 blocks super 1.2 [2/1] [_U]
unused devices: <none>
root@miirabox ~ # sudo mdadm --detail --scan
ARRAY /dev/md/1 metadata=1.2 name=rescue:1 UUID=36e3a554:de955adc:98504c1a:836763fb
ARRAY /dev/md/0 metadata=1.2 name=rescue:0 UUID=b7eddc10:a40cc141:c349f876:39fa07d2
ARRAY /dev/md/2 metadata=1.2 name=rescue:2 UUID=2eafee34:c51da1e0:860a4552:580258eb
root@miirabox ~ # mdadm -E /dev/nvme0n1p1
/dev/nvme0n1p1:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : b7eddc10:a40cc141:c349f876:39fa07d2
Name : rescue:0
Creation Time : Sun Sep 10 16:52:20 2023
Raid Level : raid1
Raid Devices : 2
Avail Dev Size : 67041280 sectors (31.97 GiB 34.33 GB)
Array Size : 33520640 KiB (31.97 GiB 34.33 GB)
Data Offset : 67584 sectors
Super Offset : 8 sectors
Unused Space : before=67432 sectors, after=0 sectors
State : clean
Device UUID : 5f8a86c6:80e71724:98ee2d01:8a295f5a
Update Time : Thu Sep 19 19:31:55 2024
Bad Block Log : 512 entries available at offset 136 sectors
Checksum : f2954bfe - correct
Events : 60
Device Role : Active device 0
Array State : AA ('A' == active, '.' == missing, 'R' == replacing)
root@miirabox ~ # mdadm -E /dev/nvme0n1p2
/dev/nvme0n1p2:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : 36e3a554:de955adc:98504c1a:836763fb
Name : rescue:1
Creation Time : Sun Sep 10 16:52:20 2023
Raid Level : raid1
Raid Devices : 2
Avail Dev Size : 2093056 sectors (1022.00 MiB 1071.64 MB)
Array Size : 1046528 KiB (1022.00 MiB 1071.64 MB)
Data Offset : 4096 sectors
Super Offset : 8 sectors
Unused Space : before=4016 sectors, after=0 sectors
State : clean
Device UUID : 8d8e044d:543e1869:9cd0c1ee:2b644e57
Update Time : Thu Sep 19 19:07:25 2024
Bad Block Log : 512 entries available at offset 16 sectors
Checksum : 4ce9a898 - correct
Events : 139
Device Role : Active device 0
Array State : AA ('A' == active, '.' == missing, 'R' == replacing)
root@miirabox ~ # mdadm -E /dev/nvme0n1p3
/dev/nvme0n1p3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x1
Array UUID : 2eafee34:c51da1e0:860a4552:580258eb
Name : rescue:2
Creation Time : Sun Sep 10 16:52:20 2023
Raid Level : raid1
Raid Devices : 2
Avail Dev Size : 1930934960 sectors (920.74 GiB 988.64 GB)
Array Size : 965467456 KiB (920.74 GiB 988.64 GB)
Used Dev Size : 1930934912 sectors (920.74 GiB 988.64 GB)
Data Offset : 264192 sectors
Super Offset : 8 sectors
Unused Space : before=264112 sectors, after=48 sectors
State : clean
Device UUID : 68758969:5218958f:9c991c6b:12bfdca1
Internal Bitmap : 8 sectors from superblock
Update Time : Thu Sep 19 19:32:42 2024
Bad Block Log : 512 entries available at offset 16 sectors
Checksum : 4a44ff36 - correct
Events : 13984
Device Role : Active device 0
Array State : AA ('A' == active, '.' == missing, 'R' == replacing)
root@miirabox ~ # mdadm -E /dev/nvme1n1p1
/dev/nvme1n1p1:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : b7eddc10:a40cc141:c349f876:39fa07d2
Name : rescue:0
Creation Time : Sun Sep 10 16:52:20 2023
Raid Level : raid1
Raid Devices : 2
Avail Dev Size : 67041280 sectors (31.97 GiB 34.33 GB)
Array Size : 33520640 KiB (31.97 GiB 34.33 GB)
Data Offset : 67584 sectors
Super Offset : 8 sectors
Unused Space : before=67432 sectors, after=0 sectors
State : clean
Device UUID : 0dfdf4af:d88b2bf1:0764dcbd:1179639e
Update Time : Thu Sep 19 19:33:07 2024
Bad Block Log : 512 entries available at offset 136 sectors
Checksum : a9ca2845 - correct
Events : 60
Device Role : Active device 1
Array State : AA ('A' == active, '.' == missing, 'R' == replacing)
root@miirabox ~ # mdadm -E /dev/nvme1n1p2
/dev/nvme1n1p2:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : 36e3a554:de955adc:98504c1a:836763fb
Name : rescue:1
Creation Time : Sun Sep 10 16:52:20 2023
Raid Level : raid1
Raid Devices : 2
Avail Dev Size : 2093056 sectors (1022.00 MiB 1071.64 MB)
Array Size : 1046528 KiB (1022.00 MiB 1071.64 MB)
Data Offset : 4096 sectors
Super Offset : 8 sectors
Unused Space : before=4016 sectors, after=0 sectors
State : clean
Device UUID : 228202fa:0491e478:b0a0213b:0484d5e3
Update Time : Thu Sep 19 19:24:14 2024
Bad Block Log : 512 entries available at offset 16 sectors
Checksum : e29be2bc - correct
Events : 141
Device Role : Active device 1
Array State : .A ('A' == active, '.' == missing, 'R' == replacing)
root@miirabox ~ # mdadm -E /dev/nvme1n1p3
/dev/nvme1n1p3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x1
Array UUID : 2eafee34:c51da1e0:860a4552:580258eb
Name : rescue:2
Creation Time : Sun Sep 10 16:52:20 2023
Raid Level : raid1
Raid Devices : 2
Avail Dev Size : 1930934960 sectors (920.74 GiB 988.64 GB)
Array Size : 965467456 KiB (920.74 GiB 988.64 GB)
Used Dev Size : 1930934912 sectors (920.74 GiB 988.64 GB)
Data Offset : 264192 sectors
Super Offset : 8 sectors
Unused Space : before=264112 sectors, after=48 sectors
State : clean
Device UUID : 431be888:cb298461:ba2a0000:4b5294fb
Internal Bitmap : 8 sectors from superblock
Update Time : Thu Sep 19 19:33:21 2024
Bad Block Log : 512 entries available at offset 16 sectors
Checksum : 2a2ddb09 - correct
Events : 13984
Device Role : Active device 1
Array State : AA ('A' == active, '.' == missing, 'R' == replacing)
root@miirabox ~ # mdadm -D /dev/md0
/dev/md0:
Version : 1.2
Creation Time : Sun Sep 10 16:52:20 2023
Raid Level : raid1
Array Size : 33520640 (31.97 GiB 34.33 GB)
Used Dev Size : 33520640 (31.97 GiB 34.33 GB)
Raid Devices : 2
Total Devices : 2
Persistence : Superblock is persistent
Update Time : Thu Sep 19 19:34:08 2024
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
Consistency Policy : resync
Name : rescue:0
UUID : b7eddc10:a40cc141:c349f876:39fa07d2
Events : 60
Number Major Minor RaidDevice State
0 259 1 0 active sync /dev/nvme0n1p1
1 259 5 1 active sync /dev/nvme1n1p1
root@miirabox ~ # mdadm -D /dev/md1
/dev/md1:
Version : 1.2
Creation Time : Sun Sep 10 16:52:20 2023
Raid Level : raid1
Array Size : 1046528 (1022.00 MiB 1071.64 MB)
Used Dev Size : 1046528 (1022.00 MiB 1071.64 MB)
Raid Devices : 2
Total Devices : 2
Persistence : Superblock is persistent
Update Time : Thu Sep 19 19:24:14 2024
State : clean, degraded
Active Devices : 1
Working Devices : 1
Failed Devices : 1
Spare Devices : 0
Consistency Policy : resync
Name : rescue:1
UUID : 36e3a554:de955adc:98504c1a:836763fb
Events : 141
Number Major Minor RaidDevice State
- 0 0 0 removed
1 259 6 1 active sync /dev/nvme1n1p2
0 259 2 - faulty /dev/nvme0n1p2
root@miirabox ~ # mdadm -D /dev/md2
/dev/md2:
Version : 1.2
Creation Time : Sun Sep 10 16:52:20 2023
Raid Level : raid1
Array Size : 965467456 (920.74 GiB 988.64 GB)
Used Dev Size : 965467456 (920.74 GiB 988.64 GB)
Raid Devices : 2
Total Devices : 2
Persistence : Superblock is persistent
Intent Bitmap : Internal
Update Time : Thu Sep 19 19:34:46 2024
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
Consistency Policy : bitmap
Name : rescue:2
UUID : 2eafee34:c51da1e0:860a4552:580258eb
Events : 13984
Number Major Minor RaidDevice State
0 259 3 0 active sync /dev/nvme0n1p3
1 259 7 1 active sync /dev/nvme1n1p3
root@miirabox ~ # lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 4K 1 loop /snap/bare/5
loop2 7:2 0 74.3M 1 loop /snap/core22/1586
loop3 7:3 0 40.4M 1 loop
loop4 7:4 0 269.8M 1 loop /snap/firefox/4793
loop5 7:5 0 74.3M 1 loop /snap/core22/1612
loop6 7:6 0 91.7M 1 loop /snap/gtk-common-themes/1535
loop8 7:8 0 38.8M 1 loop /snap/snapd/21759
loop9 7:9 0 271.2M 1 loop /snap/firefox/4848
loop10 7:10 0 504.2M 1 loop /snap/gnome-42-2204/172
loop12 7:12 0 505.1M 1 loop /snap/gnome-42-2204/176
loop13 7:13 0 38.7M 1 loop /snap/snapd/21465
nvme0n1 259:0 0 953.9G 0 disk
├─nvme0n1p1 259:1 0 32G 0 part
│ └─md0 9:0 0 32G 0 raid1 [SWAP]
├─nvme0n1p2 259:2 0 1G 0 part
│ └─md1 9:1 0 1022M 0 raid1
└─nvme0n1p3 259:3 0 920.9G 0 part
└─md2 9:2 0 920.7G 0 raid1 /
nvme1n1 259:4 0 953.9G 0 disk
├─nvme1n1p1 259:5 0 32G 0 part
│ └─md0 9:0 0 32G 0 raid1 [SWAP]
├─nvme1n1p2 259:6 0 1G 0 part
│ └─md1 9:1 0 1022M 0 raid1
└─nvme1n1p3 259:7 0 920.9G 0 part
└─md2 9:2 0 920.7G 0 raid1 /
root@miirabox ~ # cat /etc/fstab
proc /proc proc defaults 0 0
# /dev/md/0
UUID=e9dddf2b-f061-403e-a12f-d98915569492 none swap sw 0 0
# /dev/md/1
UUID=d32210de-6eb0-4459-85a7-6665294131ee /boot ext3 defaults 0 0
# /dev/md/2
UUID=7abe3389-fe7d-4024-a57e-e490f5e04880 / ext4 defaults 0 0
This is what I managed to do :
root@miirabox ~ # df -h
df: /run/user/1000/gvfs: Transport endpoint is not connected
Filesystem Size Used Avail Use% Mounted on
tmpfs 6.3G 5.7M 6.3G 1% /run
/dev/md2 906G 860G 0 100% /
tmpfs 32G 0 32G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/md1 989M 271M 667M 29% /boot
tmpfs 6.3G 132K 6.3G 1% /run/user/134
tmpfs 32G 648K 32G 1% /run/qemu
tmpfs 6.3G 244K 6.3G 1% /run/user/1000
tmpfs 6.3G 116K 6.3G 1% /run/user/140
root@miirabox ~ # cat cat /proc/mdstat
cat: cat: No such file or directory
Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10]
md2 : active raid1 nvme1n1p3[1] nvme0n1p3[0]
965467456 blocks super 1.2 [2/2] [UU]
bitmap: 8/8 pages [32KB], 65536KB chunk
md0 : active raid1 nvme1n1p1[1] nvme0n1p1[0]
33520640 blocks super 1.2 [2/2] [UU]
md1 : active raid1 nvme0n1p2[0] nvme1n1p2[1]
1046528 blocks super 1.2 [2/2] [UU]
root@miirabox ~ # umount /dev/md1
root@miirabox ~ # umount /dev/md2
root@miirabox ~ # umount /dev/md0
umount: /dev/md0: not mounted.
root@miirabox ~ # mdadm --fail /dev/md1 /dev/nvme0n1p2
mdadm: set /dev/nvme0n1p2 faulty in /dev/md1
root@miirabox ~ # mdadm --remove /dev/md1
root@miirabox ~ # mdadm --fail /dev/md1 /dev/nvme1n1p2
mdadm: set device faulty failed for /dev/nvme1n1p2: Device or resource busy
root@miirabox ~ # sudo mdadm --stop /dev/md1
mdadm: Cannot get exclusive access to /dev/md1:Perhaps a running process, mounted filesystem or active volume group?
root@miirabox ~ # sudo vgdisplay
root@miirabox ~ # lvdisplay
I was following a guide and could not proceed.
Please do not hesitate if you want more details. Thanks in advance.