RAID 1 is work in Porteus with kernel of
neko
Code: Select all
# cat /usr/src/linux/.config | grep -i RAID
CONFIG_RAID_ATTRS=m
CONFIG_BLK_DEV_3W_XXXX_RAID=m
CONFIG_SCSI_AACRAID=m
# CONFIG_MEGARAID_NEWGEN is not set
# CONFIG_MEGARAID_LEGACY is not set
CONFIG_MEGARAID_SAS=m
CONFIG_SCSI_PMCRAID=m
CONFIG_MD_RAID0=m
CONFIG_MD_RAID1=m
CONFIG_MD_RAID10=m
CONFIG_MD_RAID456=m
CONFIG_DM_RAID=m
CONFIG_DMA_ENGINE_RAID=y
CONFIG_ASYNC_RAID6_RECOV=m
CONFIG_RAID6_PQ=m
# CONFIG_RAID6_PQ_BENCHMARK is not set
# CONFIG_ASYNC_RAID6_TEST is not set
and without:
But Porteus is have bug:
/etc/fstab generated not correct:
Code: Select all
# Do not edit this file as fstab is recreated automatically during every boot.
# Please use /etc/rc.d/rc.local or sysvinit scripts if you want to mount/unmount
# drive, filesystem or network share.
# System mounts:
aufs / aufs defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
devtmpfs /dev devtmpfs defaults 0 0
devpts /dev/pts devpts rw,mode=0620,gid=5 0 0
# Device partitions:
/dev/sda /mnt/sda ext2 users,noatime,nodiratime,suid,dev,exec,async,comment=x-gvfs-show 0 0
/dev/sdb1 /mnt/sdb1 linux_raid_member users,noatime,nodiratime,suid,dev,exec,async,comment=x-gvfs-show 0 0
/dev/sdc1 /mnt/sdc1 linux_raid_member users,noatime,nodiratime,suid,dev,exec,async,comment=x-gvfs-show 0 0
/dev/md0p1 /mnt/md0p1 ext4 users,noatime,nodiratime,suid,dev,exec,async,comment=x-gvfs-show 0 0
# RAID arrays:
/dev/md0 /mnt/md0 noatime,nodiratime,suid,dev,exec,async 0 0
/dev/md0p1 /mnt/md0p1 ext4 noatime,nodiratime,suid,dev,exec,async 0 0
# LVM volumes:
# Hotplugged devices:
/etc/fstab must to looks like this:
Code: Select all
# Do not edit this file as fstab is recreated automatically during every boot.
# Please use /etc/rc.d/rc.local or sysvinit scripts if you want to mount/unmount
# drive, filesystem or network share.
# System mounts:
aufs / aufs defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
devtmpfs /dev devtmpfs defaults 0 0
devpts /dev/pts devpts rw,mode=0620,gid=5 0 0
# Device partitions:
/dev/sda /mnt/sda ext2 users,noatime,nodiratime,suid,dev,exec,async,comment=x-gvfs-show 0 0
# RAID arrays:
/dev/sdb1 /mnt/sdb1 linux_raid_member users,noatime,nodiratime,suid,dev,exec,async 0 0
/dev/sdc1 /mnt/sdc1 linux_raid_member users,noatime,nodiratime,suid,dev,exec,async 0 0
/dev/md0 /mnt/md0 noatime,nodiratime,suid,dev,exec,async 0 0
/dev/md0p1 /mnt/md0p1 ext4 users,noatime,nodiratime,suid,dev,exec,async,comment=x-gvfs-show 0 0
# LVM volumes:
# Hotplugged devices:

for /dev/sdb1 and /dev/sdc1 need to remove
'linux_raid_member' /mnt/sdb1 and /mnt/sdc1 volumes of the mirror RAID1 must does not show at the left side of any file manager
+ need to move lines with /dev/sdb1 and /dev/sdc1 (linux_raid_member) to
section.
and for /dev/md0p1 need to add
users, and
,comment=x-gvfs-show
Any advice are welcome.
Thanks.
UPDATE
Well, seems RAID stuff placed in the /etc/rc.d/
rc.S:
Code: Select all
# Raid support:
if grep -qw 'TYPE=".*_raid_member"' /mnt/live/tmp/devices 2>/dev/null; then
echo "Assembling RAID arrays"
# Create fstab entries:
blkid | grep /dev/md | grep -v 'TYPE="LVM' | sort >/mnt/live/tmp/raid
echo -e "\n# RAID arrays:" >>/etc/fstab
MOPT=`egrep -o "^mopt=[^ ]+" /etc/bootcmd.cfg | cut -d= -f2`; [ $MOPT ] || MOPT="noatime,nodiratime,suid,dev,exec,async"
RAID=`grep -c / /mnt/live/tmp/raid`; x=1;
while [ $x -le $RAID ]; do
NAME=`sed -n "$x"p /mnt/live/tmp/raid | cut -d: -f1 | sed s@/dev/@@`
FS=` sed -n "$x"p /mnt/live/tmp/raid | egrep -o ' TYPE=[^ ]+' | cut -d'"' -f2`
echo "/dev/$NAME /mnt/$NAME $FS $MOPT 0 0" >>/etc/fstab
mkdir /mnt/$NAME; [ -z "`egrep -qo "^noauto( |\$)" /etc/bootcmd.cfg`" ] && mount /mnt/$NAME; let x=x+1
done
fi
# LVM support:
if egrep -q 'TYPE="LVM|TYPE=".*_raid_member"' /mnt/live/tmp/devices 2>/dev/null; then
echo "Initializing LVM (Logical Volume Manager):"
vgscan --mknodes --ignorelockingfailure
if [ $? = 0 ]; then
vgchange -ay --ignorelockingfailure
# Create fstab entries:
blkid | grep /dev/mapper | sort >/mnt/live/tmp/lvm
echo -e "\n# LVM volumes:" >>/etc/fstab
MOPT=`egrep -o "^mopt=[^ ]+" /etc/bootcmd.cfg | cut -d= -f2`; [ $MOPT ] || MOPT="noatime,nodiratime,suid,dev,exec,async"
LVM=`grep -c / /mnt/live/tmp/lvm`; x=1
while [ $x -le $LVM ]; do
NAME=`sed -n "$x"p /mnt/live/tmp/lvm | cut -d: -f1 | sed -e 's@/dev/mapper/@@' -e 's@-@/@g'`
# Fallback mode:
test -h /dev/$NAME || NAME=`sed -n "$x"p /mnt/live/tmp/lvm | cut -d: -f1 | sed s@/dev/mapper/@@`
FS=` sed -n "$x"p /mnt/live/tmp/lvm | egrep -o " TYPE=[^ ]+" | cut -d'"' -f2`
echo "/dev/$NAME /mnt/$NAME $FS $MOPT 0 0" >>/etc/fstab
mkdir -p /mnt/$NAME; [ -z "`egrep -qo "^noauto( |\$)" /etc/bootcmd.cfg`" ] && mount /mnt/$NAME; let x=x+1
done
fi
fi
and in initrd.xz/
finit
Code: Select all
# Run fstab for setup
fstab() { rm -f /tmp/devices
param nocd || for x in /dev/sr*; do blkid $x >>/tmp/devices; done
param nohd || blkid | egrep -v '/dev/sr|/dev/loop|/dev/mapper' >>/tmp/devices
dev=`egrep -v 'TYPE="sw|TYPE="LVM|TYPE=".*_raid_member"' /tmp/devices 2>/dev/null | cut -d: -f1 | cut -d/ -f3 | sort | uniq`
cat > /etc/fstab << EOF
# Do not edit this file as fstab is recreated automatically during every boot.
# Please use /etc/rc.d/rc.local or sysvinit scripts if you want to mount/unmount
# drive, filesystem or network share.
# System mounts:
aufs / aufs defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
devtmpfs /dev devtmpfs defaults 0 0
devpts /dev/pts devpts rw,mode=0620,gid=5 0 0
# Device partitions:
EOF
for x in $dev; do
fs=`grep -w /dev/$x /tmp/devices | egrep -o ' TYPE=[^ ]+' | cut -d'"' -f2`
[ $fs = vfat ] && echo "/dev/$x /mnt/$x vfat $MOPT,umask=0,check=s,utf8 0 0" >>/etc/fstab || echo "/dev/$x /mnt/$x $fs $MOPT 0 0" >>/etc/fstab
if [ ! -d /mnt/$x ]; then
mkdir /mnt/$x
if [ $fs = ntfs ]; then
ntfs-3g /dev/$x /mnt/$x -o $MOPT 2>/dev/null || { sed -i "/$x /d" /etc/fstab; rmdir /mnt/$x; }
else
mount -n /mnt/$x 2>/dev/null || { modprobe $fs 2>/dev/null && mount -n /mnt/$x 2>/dev/null || { sed -i "/$x /d" /etc/fstab; rmdir /mnt/$x; }; }
fi
fi
done
if [ -z "`egrep -o " noswap( |\$)" /proc/cmdline`" -a -e /tmp/devices ]; then
#echo -e "\n# Swap partitions:" >>/etc/fstab
for x in `grep 'TYPE="swap"' /tmp/devices | cut -d: -f1`; do echo "$x none swap sw,pri=1 0 0" >>/etc/fstab; done
fi }
# Mount things
mount_device() {
fs=`blkid /dev/$1 | egrep -o ' TYPE=[^ ]+' | cut -d'"' -f2`
if [ "$fs" ]; then
mkdir /mnt/$1
if [ $fs = vfat ]; then
mount -n /dev/$1 /mnt/$1 -o $MOPT,umask=0,check=s,utf8 2>/dev/null || rmdir /mnt/$1
elif [ $fs = ntfs ]; then
ntfs-3g /dev/$1 /mnt/$1 -o $MOPT 2>/dev/null || rmdir /mnt/$1
else
mount -n /dev/$1 /mnt/$1 -o $MOPT 2>/dev/null || { modprobe $fs 2>/dev/null && mount -n /dev/$1 /mnt/$1 -o $MOPT || rmdir /mnt/$1; }
fi
fi }
# Search for boot location
search() { FND=none; for x in `ls /mnt | tac`; do
[ $1 /mnt/$x/$2 ] && { DEV=$x; FND=y; break; }; done
[ $FND = y ]; }
# Delay booting a little until devices have settled
nap() { echo -en $i"device not ready yet? delaying [1;33m$SLEEP[0m seconds \r"; sleep 1; }
lazy() { SLEEP=6; while [ $SLEEP -gt 0 -a $FND = none ]; do nap; let SLEEP=SLEEP-1; fstab; search $*; done }
# Find location of Porteus files
locate() { LPATH=`echo $2 | cut -b-5 | sed s@/dev@/mnt@`
if [ $LPATH = /mnt/ ]; then
DEV=`echo $2 | cut -d/ -f3`; LPTH=`echo $2 | cut -d/ -f4-`; SLEEP=6
while [ $SLEEP -gt 0 -a ! -b /dev/$DEV ]; do nap; let SLEEP=SLEEP-1; fstab; done
[ -d /mnt/$DEV ] || mount_device $DEV
[ $1 /mnt/$DEV/$LPTH ]
elif [ $LPATH = UUID: -o $LPATH = LABEL ]; then
ID=`echo $2 | cut -d: -f2 | cut -d/ -f1`; LPTH=`echo $2 | cut -d/ -f2-`; DEV=`blkid | grep $ID | cut -d: -f1 | cut -d/ -f3`; SLEEP=6
while [ $SLEEP -gt 0 -a "$DEV" = "" ]; do nap; let SLEEP=SLEEP-1; fstab; DEV=`blkid | grep $ID | cut -d: -f1 | cut -d/ -f3`; done
[ -d /mnt/$DEV ] || mount_device $DEV
[ $1 /mnt/$DEV/$LPTH ]
else
LPTH=$2; search $* || lazy $*
fi }
Let's see...
UPDATE
1st fix for /etc/rc.d/
rc.S
Code: Select all
MOPT=`egrep -o "^mopt=[^ ]+" /etc/bootcmd.cfg | cut -d= -f2`; [ $MOPT ] || MOPT="noatime,nodiratime,suid,dev,exec,async"
replace with
Code: Select all
MOPT=`egrep -o "^mopt=[^ ]+" /etc/bootcmd.cfg | cut -d= -f2`; [ $MOPT ] || MOPT="noatime,nodiratime,suid,dev,exec,async,comment=x-gvfs-show"
and now I need to remove what I crossed out with a red line in
section of fstab (probably this to do in initrd.xz/finit)
My test stand in VirtualBox:
Code: Select all
# blkid | egrep -v '/dev/sr|/dev/loop|/dev/mapper' >>/tmp/devices
/dev/sda: UUID="22cb345c-d364-4f00-a8ff-cac6117c2a09" TYPE="ext2"
/dev/sdb1: UUID="deab012d-a49a-bbfd-6779-400ff3c13331" UUID_SUB="0610e2b7-9646-baaa-0374-1a7d1f049a6b" LABEL="porteus.example.net:0" TYPE="linux_raid_member" PARTUUID="b28fe85b-01"
/dev/sdc1: UUID="deab012d-a49a-bbfd-6779-400ff3c13331" UUID_SUB="a6c173ef-3f5b-8c0b-6b0e-b29e37cf0468" LABEL="porteus.example.net:0" TYPE="linux_raid_member" PARTUUID="bf04882c-01"
/dev/md0p1: UUID="07b72d9a-b258-4702-b184-ea9d1e561936" TYPE="ext4" PARTUUID="16d0e273-01"
/dev/md0: PTUUID="16d0e273" PTTYPE="dos"
Linux 6.6.11-porteus #1 SMP PREEMPT_DYNAMIC Sun Jan 14 12:07:37 MSK 2024 x86_64 Intel(R) Xeon(R) CPU E3-1270 v6 @ 3.80GHz GenuineIntel GNU/Linux
MS-7A12 » [AMD/ATI] Navi 23 [Radeon RX 6600] [1002:73ff] (rev c7) » Vengeance LPX 16GB DDR4 K2 3200MHz C16