Re: always use local disk for driveorder

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Romu,

You've hit on a real problem.  Not only can SAN-attached disk be enumerated first,
also sometimes USB media (for physical installs).  Or virtual media (if doing
remote installs off a remote access controller, or via PXE).

So using /ddev/disk/by-path/* is certainly one great way to solve this.

To get a concrete example of what others are saying, consider a Dell server.

Consistently, the 1st PERC vol seems to be enumerated as [0:2:0:0] on
M620s and R620s.  Here's example output from lsscsi -g:

# lsscsi -g
[0:0:32:0]   enclosu DP       BACKPLANE        1.07  -         /dev/sg0
[0:2:0:0]    disk    DELL     PERC 6/i         1.22  /dev/sda   /dev/sg1
[0:2:1:0]    disk    DELL     PERC 6/i         1.22  /dev/sdb   /dev/sg2

ks.cfg now allows /dev/disk/by-path/ and /dev/disk/by-id shell-like globs.
See http://fedoraproject.org/wiki/Anaconda/Kickstart, Special Notes for
     Referring to Disks.

So /dev/disk/by-path/pci-*-usb-* captures all USB media,
   /dev/disk/by-path/pci-*-scsi-* captures all PERC vols,
   /dev/disk/by-path/pci-*-scsi-0:2:0:0 captures first PERC vol (on a M620),
   /dev/disk/by-path/pci-*-fc-* captures all FC LUNs.

However, on other Dell server models, the first PERC volume varies.  Sometimes it's
0:1:0:0.

So /dev/disk/by-path/pci-*-scsi-0:[1-9]:0:0 will be your first PERC volume on *any*
Dell server in the last decade or so.

Armed with this information, you can specify your boot disk in your ks.cfg.

   ...

   %include /tmp/ignoredisk

   # Partition and format the drives.
   part /boot --fstype ext3 --size=100 --asprimary

But wait!  What is this /tmp/ignoredisk file?  It comes from your "%pre" section.

   %pre
   # This *definitely* works.  See %include ignoredisk discussion above.
   FIRST_PERC_VOL=$(ls -1 /dev/disk/by-path/pci-*-scsi-0:[1-9]:0:0 | grep -v usb)

   echo "ignoredisk --only-use=$FIRST_PERC_VOL" > /tmp/ignoredisk
   echo "clearpart --all --initlabel --drives=$FIRST_PERC_VOL" >> /tmp/ignoredisk

In summary, blacklisting kerrnel modules is  simpler, but doesn't cover all the different
cases.

Doing as above covers all cases, but only for one particular server family.

Spike

_______________________________________________
Kickstart-list mailing list
Kickstart-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/kickstart-list

[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux