how to make the first disk /dev/sda always
Hi All ,
I have a kickstart file with the below definition for the disk on which the rhel os should get installed
clearpart -all -initlabel
ignoredisk --only-use=sda
part /boot --fstype=ext4 --size=500 --ondisk=sda
part swao --size=4096 --ondisk=sda
part / --fstype=ext4 --size=1024 --grow --ondisk=sda
I have only one disk on all my servers . but when i try to do a automatic deployment of OS on these servers, some servers fails to
find the disk bcos the disk it creates may be sdb or sdd or sde irrespective it has only one disk .
Is there a way to force the first disk ,the server sees to be named /dev/sda ?
Or is there any way i can specify in kickstart file, to perform the partitioning on ,any or first, disk it finds. [sda/sdb/sdd/sde ..]
appreciate any help .
Regards
Robin
Responses
Hi Robin,
I've faced the same things. Sometimes it depends on the manufacturer of the server.
Dell servers for instance were notorious for forcing you make a virtual device through the raid bios (even for just --one-- single disk), and then present it to the system through the raid bios.
I built four oracle servers on oracle hardware (Oracle database servers on Oracle Inc hardware, Oracle bought Sun Microsystems) recently that were particularly a step below annoying but resolvable. In this case, I found the ILOM (Integrated Lights out Manager), disk would present itself during the build process (only) as sda, and the mirrored raid1 I created through the raid bios as sdb (again, only during the build process). The kickstart would fail complaining it did not have enough space. I examined the systems thoroughly and found the ILOM disk, a separate disk entirely that behaved like sda during the build process only.
After I partitioned it (a few sentences down), the OS saw the raid that was presented from the hardware as /dev/sda and the ILOM was not visible to the OS (nor should it be). This was kinda annoying. I discovered this through a manual load and then finally using the Sun (Oracle) partition tool that came with the very recent servers and creating the partitions through it. The Oracle Inc. graphical bios interface showed the mirrored 300gb drives as sdb, however, when I did the kickstart, the file had sdb, but later it registered as sda after the build!! - only after I successfully partitioned it.
Where I work, we don't always have control over what servers are purchased. So I occasionally perform a manual load just to make sure of how the disks are picked up and then create my kickstart after the survey of the manual load. The /root/anaconda-ks.cfg file after a manual build will have some clues, then I of course use LVM.
Once you've surveyed the system - make note of it in the Satellite Server (you can make notes on the server's profile) with the server make/model and partitioning details etc. Once you have this, you can then base subsequent kickstarts for similar hardware from that survey.
Hopefully this helps - if you need more than this - reply - someone will join in this discussion.
Hopefully someone will reply here and even have a simpler solution than what I've presented.
Regards,
Remmele
Robin, here's an example of partitioning within one kickstart I have on a system, the partitioning below should be adjusted for your needs, and all partitions certainly are not nessarily needed for your needs. Much of this is overkill in protecting "/" and in general...
The below disk was from a larger disk.
clearpart --all --drives=sda
ignoredisk --only-use=sda
part /boot --fstype=ext4 --size=500
part pv.253002 --grow --size=1
volgroup disk0 --pesize=4096 pv.253002
logvol /app --fstype=ext4 --name=app --vgname=disk0 --grow --size=100
logvol /home --fstype=ext4 --name=home --vgname=disk0 --size=1024
logvol /tmp --fstype=ext4 --name=tmp --vgname=disk0 --size=12288
logvol /var --fstype=ext4 --name=var --vgname=disk0 --size=12288
logvol /var/log --fstype=ext4 --name=varlog --vgname=disk0 --size=12288
logvol /var/log/audit --fstype=ext4 --name=varlogaudit --vgname=disk0 --size=4092
logvol / --fstype=ext4 --name=slash --vgname=disk0 --size=66560
logvol swap --name=swap --vgname=disk0 --recommended
It might be good for you to either use LVM, UUIDs or labels when making your partitions with your kickstart, so that your /etc/fstab will not have bare devices but either an LVM path, UUID or Label... see below...
If you do not use lvm, UUIDs or labels, in the unlikely chance one partition becomes unavailable (numerous reasons, single drives won't face the example later in this paragraph, but see this Red Hat Link), the partitions can get mixed. One example, I had a friend in another company who upgraded his firmware and it reordered his drives, and now he uses UUIDs for his systems (changed after his system was loaded).
You can define the filesystems to avoid this in the /etc/fstab configuration in three different ways: by kernel naming descriptors, by UUID, or by labels [added, and LVM]. The advantage of using UUIDs or labels [or LVM] is that they are not dependent on disk order. This is useful if you change your storage device order in the BIOS, you switch storage device cabling, or because some BIOS's may occasionally change the order of storage devices.
You can use the "blkid" command and then mount a drive in your /etc/fstab using the UUID:
Here's an example for "home" in an /etc/fstab:
[root@somesystem ~]# grep home /etc/fstab
/dev/mapper/disk0-home /home ext4 nodev,nosuid 1 2
[root@somesystem ~]# blkid | grep home
/dev/mapper/disk0-home: UUID="8f2a77a7-abc0-3f46-90f6-d46288c28c77" TYPE="ext4"
The mount could be easily changed (if it had no label and was not lvm) to:
[root@somesystem ~]# grep home /etc/fstab
UUID="8f2a77a7-abc0-3f46-90f6-d46288c28c77" /home ext4 nodev,nosuid 1 2
And that mounts just fine.
Lastly, see the tips at this 2010 Red Hat Summit pdf on kickstarts, especially page 36 where it speaks about protecting your SAN during kickstart.
Another thing to investigate is onbiosdisk (which I believe was actually developed with Dell). Fortunately this is only necessary for hosts which have more than one LUN on the PERC.
There is a way to definitively deduce what the value should be, but I would try with 80 and go from there.
http://lists.us.dell.com/pipermail/linux-poweredge/2008-November/037934.html
James,
I like the line in the example in your link with 'nousbstorage':
bootloader --driveorder=sdb,sda --location=mbr --append="nousbstorage"
That might have saved me with the fun/joy I had from the servers I mentioned earlier in this where the ILOM partition (server hardware was made by Oracle Inc, who bought Sun Microsystems) was pretending to be sda during install (see the bit I wrote earlier)
I have loaded lots of Dells, typically with the PERC, I can go into the raid bios and configure the disk there (step-by-step-instructions), even if it a single disk, one must make it a "raid 0" (strange). But once that is done, the disk appears during the anaconda installer as a normal disk.
This presents a 'virtual disk' that the OS recognizes... Thanks for posting that bit above James,
Remmele
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
