I have prepared for a friend a little NAS made of Ubuntu Server 20.04 on an SSD and two HHD in RAID1.
The software RAID1 has been made during the Ubuntu installation, here some info about it:
$ fdisk -l
Disk /dev/sda: 3.65 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: WDC WD40EFRX-68N
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/sdb: 3.65 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: ST4000VN008-2DR1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/md1: 3.65 TiB, 4000651739136 bytes, 7813772928 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
(I was expecting to see partitions here, but there seems to be no sda1 or sdb1...)
$ cat /proc/mdstat
Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5]
[raid4] [raid10] md1 : active raid1 sdb[1] sda[0]
3906886464 blocks super 1.2 [2/2] [UU]
bitmap: 0/30 pages [0KB], 65536KB chunk
unused devices: <none>
My friend is going to connect and transfer files to it with WinSCP from his Windows computer. I still have to install Jellyfin so that he can browse his media easily.
Till here everything is ok!
But as my friend does not know anything about Linux and network as well, I am thinking of an option that could let him access the files on the RAID1 in case of a problem. Like if something prevent him from reaching the server from his Windows computer, if the RAID1 failed somehow or if I am not here to help.
So I ended up installing Linux Mint on a another partition of the SSD, so that he can boot to it in case of emergency, thanks to a dual boot option in Grub.
In order to access his content from Linux Mint, I see two options:
Options 1) should be easily done by activating the RAID1 with mdadm --assemble --scan
and then mount /dev/md1
I did not try that though, because in case of a RAID problem, I think it should be safer to be able accessing each member of the RAID separately.
That's where I am stuck...
I have tried adding the /dev/sda UUID in fstab
/dev/sda 3.7GB UUID=xxx /mnt/local_disk1 ext4 errors=remount-ro 0 1
and then mount it with mount /mnt/local_disk1 /dev/sda
, but this is what I get:
mount: /mnt/local_disk1 : wrong fs type, bad option, bad superblock on /dev/sdb, missing codepage or helper program, or other error.
I also tried to specify the file system with mount -t ext4 /mnt/local_disk1 /dev/sda
, which gives me:
mount: /dev/sda : /mnt/local_disk1 is not a block device
Any idea of what I should do to let me access the content of /dev/sda from Linux Mint? (Obviously without breaking the RAID1 of Ubuntu server ;)
Здесь, в ситуации с Linux Mint:
$ lsblk -o NAME,SIZE,FSTYPE,TYPE,MOUNTPOINT
NAME SIZE FSTYPE TYPE MOUNTPOINT
sda 3.7T linux_raid_member disk
sdb 3.7T linux_raid_member disk
nvme0n1 119.2G disk
├─nvme0n1p1 512M vfat part /boot/efi
├─nvme0n1p2 50G ext4 part
└─nvme0n1p3 68.8G ext4 part /
Я наконец-то выбрал вариант 1) выше, воссоздав RAID1 в Linux Mint, что на самом деле должно быть безопаснее.
Мне нужно было только
$ apt install mdadm
$ reboot
А теперь у меня есть
$ lsblk -o NAME,SIZE,FSTYPE,TYPE,MOUNTPOINT
NAME SIZE FSTYPE TYPE MOUNTPOINT
sda 3.7T linux_raid_member disk
└─md1 3.7T ext4 raid1
sdb 3.7T linux_raid_member disk
└─md1 3.7T ext4 raid1
nvme0n1 119.2G disk
├─nvme0n1p1 512M vfat part /boot/efi
├─nvme0n1p2 50G ext4 part
└─nvme0n1p3 68.8G ext4 part /
Просто нужно было смонтировать его и добавить в / etc / fstab, чтобы я мог получить доступ к Raid из Linux Mint. :)
Обе ОС имеют идентичные mdadm.conf и fstab, кстати.