Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
rename raid devise on the go and get it sticky.(reopen)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
hedmo
l33t
l33t


Joined: 29 Aug 2009
Posts: 943
Location: halmstad

PostPosted: Sun Jun 16, 2019 6:04 pm    Post subject: rename raid devise on the go and get it sticky.(reopen) Reply with quote

hi


i have updated my kernel and the initramfs this week.the name of my raid device was /dev/md3 and now every
time when i reboot my box it rename it self to /dev/md124 or /dev/md125.is there a way to rename the mounted device :?:

regards hedmo


Last edited by hedmo on Mon Aug 12, 2019 5:14 am; edited 2 times in total
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7192
Location: almost Mile High in the USA

PostPosted: Sun Jun 16, 2019 6:18 pm    Post subject: Reply with quote

It typically uses the md127 minus x numbers when you tell the kernel or mdadm to autodetect. If you manually assemble your RAIDs it should be persistent. Probably need a udev rule or something to create a symlink if udev is ready that early during boot, and you still need to somehow distinguish it...

I end up using filesystem UUIDs when I can.
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43551
Location: 56N 3W

PostPosted: Sun Jun 16, 2019 6:31 pm    Post subject: Reply with quote

hedmo,

Don't fight the kernel. You will loose.

Assemble the raid sets by raid UUID.
Mount the filesystems by filesystem UUID.

Then you don't care about the devices that go into each raid set, nor what the raid sets are called.

Do you have a good reason to be interested in the /dev node names?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
hedmo
l33t
l33t


Joined: 29 Aug 2009
Posts: 943
Location: halmstad

PostPosted: Sun Jun 16, 2019 6:57 pm    Post subject: Reply with quote

NeddySeagoon wrote:
hedmo,

Don't fight the kernel. You will loose.

Assemble the raid sets by raid UUID.
Mount the filesystems by filesystem UUID.

Then you don't care about the devices that go into each raid set, nor what the raid sets are called.

Do you have a good reason to be interested in the /dev node names?


NeddySeagoon. i know i will loose.i just dont want to type in the raid device manually every time i boot because
it rename it self randomly.i am trying to use UUID but :
Code:
mybox /home/hedmo # cat /proc/mdstat
Personalities : [raid0] [raid1]
md124 : active raid0 sda3[0] sdb3[1]
      70047744 blocks 64k chunks
     
md125 : active (auto-read-only) raid1 sda1[0] sdb1[1]
      102336 blocks [2/2] [UU]
     
md126 : active raid0 sdc3[0] sdd3[1]
      42820608 blocks super 1.2 512k chunks
     
md127 : active raid0 sdc4[0] sdd4[1]
      102399872 blocks 64k chunks
     
unused devices: <none>
mybox /home/hedmo # mdadm --detail /dev/md124
/dev/md124:
           Version : 0.90
     Creation Time : Fri Jul  1 18:36:45 2011
        Raid Level : raid0
        Array Size : 70047744 (66.80 GiB 71.73 GB)
      Raid Devices : 2
     Total Devices : 2
   Preferred Minor : 124
       Persistence : Superblock is persistent

       Update Time : Fri Jul  1 18:36:45 2011
             State : clean
    Active Devices : 2
   Working Devices : 2
    Failed Devices : 0
     Spare Devices : 0

        Chunk Size : 64K

Consistency Policy : none

              UUID : 55e2d126:c90e2e4a:8a550ac9:2f2844cb
            Events : 0.1

    Number   Major   Minor   RaidDevice State
       0       8        3        0      active sync   /dev/sda3
       1       8       19        1      active sync   /dev/sdb3
mybox /home/hedmo # mdadm --detail /dev/md125
/dev/md125:
           Version : 0.90
     Creation Time : Fri Jul  1 18:36:34 2011
        Raid Level : raid1
        Array Size : 102336 (99.94 MiB 104.79 MB)
     Used Dev Size : 102336 (99.94 MiB 104.79 MB)
      Raid Devices : 2
     Total Devices : 2
   Preferred Minor : 125
       Persistence : Superblock is persistent

       Update Time : Mon Jun 17 03:27:22 2019
             State : clean
    Active Devices : 2
   Working Devices : 2
    Failed Devices : 0
     Spare Devices : 0

Consistency Policy : resync

              UUID : 02f6d676:f455634b:93f4ab15:302db154
            Events : 0.40

    Number   Major   Minor   RaidDevice State
       0       8        1        0      active sync   /dev/sda1
       1       8       17        1      active sync   /dev/sdb1
mybox /home/hedmo # cat /etc/fstab
# /etc/fstab: static file system information.
#
# noatime turns off atimes for increased performance (atimes normally aren't
# needed); notail increases performance of ReiserFS (at the expense of storage
# efficiency).  It's safe to drop the noatime options if you want and to
# switch between notail / tail freely.
#
# The root filesystem should have a pass number of either 0 or 1.
# All other filesystems should have a pass number of 0 or greater than 1.
#
# See the manpage fstab(5) for more information.
#

# <fs>                  <mountpoint>    <type>          <opts>          <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
UUID=02f6d676:f455634b:93f4ab15:302db154          /boot                   ext2  noauto,noatime  1 2
UUID=55e2d126:c90e2e4a:8a550ac9:2f2844cb          /                       ext3  noatime         0 1

#/swapfile none swap sw,loop 0 0
#/swapfile1 none swap sw,loop 0 0
#/swapfile2 none swap sw,loop 0 0
#/swapfile3 none swap sw,loop 0 0

/dev/sda2         none                    swap  sw,pri=1        0 0
/dev/sdb2         none                    swap  sw,pri=1        0 0
/dev/vg/usr       /usr                    ext3  noatime         1 2
/dev/vg/portage   /usr/portage            ext2  noatime         1 2
/dev/vg/home /usr/portage/distfiles  ext2  noatime         1 2
#/dev/vg/home      /home                   ext3  noatime         1 2
/dev/vg/opt       /opt                    ext3  noatime         1 2
/dev/vg/tmp       /tmp                    ext2  noatime         1 2
/dev/vg/var       /var                    ext3  noatime         1 2
/dev/vg/vartmp    /var/tmp                ext2  noatime         1 2
/dev/sde1         /home           ext4  noatime         1 2

#none    /var/tmp/portage    tmpfs    nr_inodes=1M    0 0

#/dev/md5         /media                  vfat  noauto         0 0
#/dev/sde1        /mnt/1TB                ntfs-3g       noatime,user    0 0 
#//homeserver/stuff/ /mnt/server cifs guest


/dev/sr0                /mnt/cdrom      auto    noauto,ro,user  0 0
#/dev/fd0               /mnt/floppy     auto    noauto          0 0
mybox /home/hedmo # mount /boot
mount: /boot: can't find UUID=02f6d676:f455634b:93f4ab15:302db154.
mybox /home/hedmo #

and grub
Code:

mybox /home/hedmo # cat /etc/default/grub   
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/files/grub.default-2,v 1.3 2013/05/13 16:54:13 floppym Exp $
#
# To populate all changes in this file you need to regenerate your
# grub configuration file afterwards:
#     'grub2-mkconfig -o /boot/grub2/grub.cfg'
#
# See the grub info page for documentation on possible variables and
# their associated values.

GRUB_DISTRIBUTOR="Gentoo"

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10

# Append parameters to the linux kernel command line
 GRUB_CMDLINE_LINUX=""

# Append parameters to the linux kernel command line for non-recovery entries
GRUB_CMDLINE_LINUX_DEFAULT="real_root=/dev/md124 dolvm domdadm quiet splash"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal.
# Note that you can use only modes which your graphic card supports via VBE.
# You can see them in real GRUB with the command `vbeinfo'.
GRUB_GFXMODE=1920x1080

GRUB_GFXPAYLOAD_LINUX=keep

# Path to theme spec txt file.
# The starfield is by default provided with use truetype.
# NOTE: when enabling custom theme, ensure you have required font/etc.
#GRUB_THEME="/boot/grub2/themes/starfield/theme.txt"

# Background image used on graphical terminal.
# Can be in various bitmap formats.
GRUB_BACKGROUND="/boot/grub2/start.jpg"

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to kernel
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY=true
mybox /home/hedmo #
mybox /home/hedmo # cat /etc/default/grub   
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/files/grub.default-2,v 1.3 2013/05/13 16:54:13 floppym Exp $
#
# To populate all changes in this file you need to regenerate your
# grub configuration file afterwards:
#     'grub2-mkconfig -o /boot/grub2/grub.cfg'
#
# See the grub info page for documentation on possible variables and
# their associated values.

GRUB_DISTRIBUTOR="Gentoo"

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10

# Append parameters to the linux kernel command line
 GRUB_CMDLINE_LINUX=""

# Append parameters to the linux kernel command line for non-recovery entries
GRUB_CMDLINE_LINUX_DEFAULT="real_root=/dev/md124 dolvm domdadm quiet splash"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal.
# Note that you can use only modes which your graphic card supports via VBE.
# You can see them in real GRUB with the command `vbeinfo'.
GRUB_GFXMODE=1920x1080

GRUB_GFXPAYLOAD_LINUX=keep

# Path to theme spec txt file.
# The starfield is by default provided with use truetype.
# NOTE: when enabling custom theme, ensure you have required font/etc.
#GRUB_THEME="/boot/grub2/themes/starfield/theme.txt"

# Background image used on graphical terminal.
# Can be in various bitmap formats.
GRUB_BACKGROUND="/boot/grub2/start.jpg"

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to kernel
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY=true
mybox /home/hedmo #



regards
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43551
Location: 56N 3W

PostPosted: Sun Jun 16, 2019 7:15 pm    Post subject: Reply with quote

hedmo,

There are lots of UUIDs for different things that look the same but are not
Code:
Consistency Policy : resync

              UUID : 02f6d676:f455634b:93f4ab15:302db154
            Events : 0.40

    Number   Major   Minor   RaidDevice State
       0       8        1        0      active sync   /dev/sda1
       1       8       17        1      active sync   /dev/sdb1


That UUID is the UUID you pass to
Code:
mdadm -A --uuid...
Its the UUID of the raid set.
To mount the filesystem on the raid set with UUID : 02f6d676:f455634b:93f4ab15:302db154. you need the filesystem UUID.

/etc/fstab:
# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
UUID=02f6d676:f455634b:93f4ab15:302db154          /boot                   ext2  noauto,noatime  1 2
UUID=55e2d126:c90e2e4a:8a550ac9:2f2844cb          /                       ext3  noatime         0 1

look like the raid UUIDs not the filesystem.

Please excuse the junk below,
Code:
 $ /sbin/blkid
/dev/sda1: UUID="9392926d-6408-6e7a-8663-82834138a597" TYPE="linux_raid_member" PARTUUID="0553caf4-01"
/dev/sda2: UUID="b6633d8e-41ef-4485-9bbe-c4c2d69f4e8c" TYPE="swap" PARTUUID="0553caf4-02"
/dev/sda5: UUID="5e3cadd4-cfd2-665d-9690-1ac76d8f5a5d" TYPE="linux_raid_member" PARTUUID="0553caf4-05"
/dev/sda6: UUID="9657e667-5b60-f6a3-0391-65e6dcf662fa" TYPE="linux_raid_member" PARTUUID="0553caf4-06"
/dev/sdb1: UUID="9392926d-6408-6e7a-8663-82834138a597" TYPE="linux_raid_member" PARTUUID="0553caf4-01"
/dev/sdb2: UUID="a5d62e51-ef8c-4b9d-a4cf-faf56dcaa999" TYPE="swap" PARTUUID="0553caf4-02"
/dev/sdb5: UUID="5e3cadd4-cfd2-665d-9690-1ac76d8f5a5d" TYPE="linux_raid_member" PARTUUID="0553caf4-05"
/dev/sdb6: UUID="9657e667-5b60-f6a3-0391-65e6dcf662fa" TYPE="linux_raid_member" PARTUUID="0553caf4-06"
/dev/sdc1: UUID="9392926d-6408-6e7a-8663-82834138a597" TYPE="linux_raid_member" PARTUUID="0553caf4-01"
/dev/sdc2: UUID="08f18d4d-69cc-4ff2-b85c-48da1935634b" TYPE="swap" PARTUUID="0553caf4-02"
/dev/sdc5: UUID="5e3cadd4-cfd2-665d-9690-1ac76d8f5a5d" TYPE="linux_raid_member" PARTUUID="0553caf4-05"
/dev/sdc6: UUID="9657e667-5b60-f6a3-0391-65e6dcf662fa" TYPE="linux_raid_member" PARTUUID="0553caf4-06"
/dev/sdd1: UUID="9392926d-6408-6e7a-8663-82834138a597" TYPE="linux_raid_member" PARTUUID="0553caf4-01"
/dev/sdd2: UUID="14ea0411-4e72-4749-92a1-1f9338bcf492" TYPE="swap" PARTUUID="0553caf4-02"
/dev/sdd5: UUID="5e3cadd4-cfd2-665d-9690-1ac76d8f5a5d" TYPE="linux_raid_member" PARTUUID="0553caf4-05"
/dev/sdd6: UUID="9657e667-5b60-f6a3-0391-65e6dcf662fa" TYPE="linux_raid_member" PARTUUID="0553caf4-06"
/dev/sde1: UUID="c400b18c-0210-4338-a0fd-f437ecbaaf99" TYPE="ext4" PARTLABEL="ext4" PARTUUID="150e6ef1-7ba8-409c-9c3f-dbdecdc9f18b"
/dev/sde2: UUID="cFoZJl-1URB-JTGu-05Df-eJ0R-nJYE-45AqZb" TYPE="LVM2_member" PARTLABEL="LVM" PARTUUID="5472e6a9-101d-4d52-87aa-91388f0df5b6"
/dev/md125: UUID="741183c2-1392-4022-a1d3-d0af8ba4a2a8" TYPE="ext2"
/dev/md126: UUID="ff5730d5-c28d-4276-b300-5b0b0fc60300" TYPE="ext4"
/dev/md127: UUID="7b2KgY-NHef-kuNk-WBAp-VnLa-h03A-b4ehGy" TYPE="LVM2_member"
/dev/mapper/vg-usr: UUID="7f0fad34-6130-42d8-8246-033de9717005" TYPE="ext4"
/dev/mapper/vg-local: UUID="54b46458-d411-4ea8-8920-4c5fcdb56a81" TYPE="ext4"
/dev/mapper/vg-tmp: UUID="59c06fd1-8471-4efb-b055-8f1cfb39645f" TYPE="ext4"
/dev/mapper/vg-var: UUID="57b34894-f80d-47ab-a522-46fb6e1a19b8" TYPE="ext4"
/dev/mapper/vg-portage: UUID="8675cb9c-4251-489f-8e9b-0244ca80176c" TYPE="ext2"
/dev/mapper/vg-home: UUID="8d5d5691-ceb7-4e58-bed3-28803cb88bfe" TYPE="ext4"
/dev/mapper/static-root: UUID="cf559dbe-81bb-45b7-bbdd-0bcdc81e066b" TYPE="ext4"
/dev/mapper/static-usr: UUID="24e36648-f410-40b8-931f-41ad46741a47" TYPE="ext4"
/dev/mapper/static-var: UUID="1c981da8-f0f6-4953-b485-8dbc9e7c6879" TYPE="ext4"
/dev/mapper/static-local: UUID="17457b1b-ce7f-4452-93d6-4ffbdc04eddb" TYPE="ext4"
/dev/mapper/static-opt: UUID="c486b7cc-6df4-4a55-8add-0691db3bbc02" TYPE="ext4"
/dev/mapper/static-portage: UUID="350c56dc-7519-47e4-9cea-ef0bb23bdbb0" TYPE="ext4"


In my blkid example sd[abcd]1 are one raid set, sd[abcd]5 another and sd[abcd]6 a third. That's /boot, root and LVM.
Notice that the UUIDs of sd[abcd]1 are identical.

Looking at the /dev/md* entries the filesystem UUIDs are listed. Its these UUIDs you une in fstab or pass on the kernel command line for root=UUID=
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
hedmo
l33t
l33t


Joined: 29 Aug 2009
Posts: 943
Location: halmstad

PostPosted: Sun Jun 16, 2019 7:56 pm    Post subject: Reply with quote

NeddySeagoon .thanks for the hint .it was wrong UUID.


best regards hedmo
Back to top
View user's profile Send private message
hedmo
l33t
l33t


Joined: 29 Aug 2009
Posts: 943
Location: halmstad

PostPosted: Mon Aug 12, 2019 5:13 am    Post subject: Reply with quote

i got almost the same problem with my laptop today :x .i am using genkernel-next and the initramfs does not find my root device.when i go in to the shell and typing "ls /dev"
i dont have any partitions there (/dev/nvme1n1pX).but if i put in a usbstick i get /dev/sdaX .

regards hedmo
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum