CentOS Minimal Install Custom Layout

hiddenknight821hiddenknight821 Member Posts: 1,209 ■■■■■■□□□□
I don't know if I'm trying the impossible here, but I was trying to configure CentOS minimal install (not the "base system" option from the full DVD) and create custom partitions. However, the options aren't available in the text-based install according to Red Hat. I know this is a bunch of crock since I've installed other latest Linux distro (Ubuntu Server 12.10 LTE) to achieve the same thing in text-based installation.

I was having the same problem as this guy, except that I didn't have the GUI limitation. I only wanted to use very little memory on my system for testing purpose.

Despite what Red Hat said, I know there gotta be a workaround, but I just can't find it on Google. It seems to me that no one cares to share their solutions or just went ahead with the GUI install and call it a day. But not this guy. This drives me nuts when problems are left unaddressed.


Here's the solution I attempted but failed:

The Installer prompts us with three options for the type of installation. Either I can use:
1) Use all space
2) Replace Existing Linux System
3) Use Free Space

So, I figured I can use the 2nd option and leave my file system intact and switch to the command-line using F2. Manually created the partitions and LVs there to create a blank existing file system. Hoping that I tricked the Installer into believing that it existed then switched back to the Installer screen. The next thing I know is that the Installer ran some scripts to completely format the disk with pre-configured layouts, which defeats the purpose of option 2. This irritated me since I know Red Hat's preventing me to customize my partition and claiming that some limitations were the problems.

I wanted to know what script behinds Anaconda that caused this, so I can verify if it's a bug or not, but the problem here is that I couldn't locate that particular file. I tried looking into the /proc/<ANACONDA PID>, but it's hard to find it when it's essentially a needle in a haystack. Can anyone helps me here? Be a pal, and just pop the minimal install file in the VM since it's only 307 MB, which isn't so bad. I'd like to know what you find.


Comments

  • prampram Member Posts: 171
    Its a limitation of Anaconda. Ubuntu doesn't use the same installer, why would you think that makes it untrue?
  • hiddenknight821hiddenknight821 Member Posts: 1,209 ■■■■■■□□□□
    pram wrote: »
    Its a limitation of Anaconda. Ubuntu doesn't use the same installer, why would you think that makes it untrue?

    Okay. Ask yourself this. Is it really a limitation or a "bug" that no one wants to bother fixing or improving until Red Hat decides to move to the next kernel iteration (maybe 2.7)? In Linux, there is no boundary, and I'd be naive not to believe that. None of the answers I found on Google convinced me to accept the fact that there isn't a workaround. The answers weren't elaborative enough in my opinion.


    So I decided to poke around under the hood a little further. There are a bunch of python script files listed in the Anaconda directory located `/mnt/runtime/usr/lib/' directory. Since I was at the "Partitioning Type" screen, I decided to search the "Replace existing Linux system" string recursively in the Anaconda directory to find the offending file. This idea didn't hit me until few hours after I made the first post. Yep, a big "doh!" moment, but I'm glad I'm learning this at home during my free time.

    It turned out the developers need to do some reworks in the Anaconda package as the three options left me no choice but erase the partitions or add another Linux OS to the free space only. I don't mind doing some development to improve the product only if I have some Python experience behinds me.

    With the second option, I thought I could nicely replace the existing Linux system by leaving all file systems intact and erase whatever files and directories are in there, but that's not the case. What the option really means is that it will ensure that no other Linux partitions will exist except the new OS that being installed. Hence, the use of CLEARPART_TYPE_LINUX constant in `$anaconda/textw/partition_text.py' file, which is the file used to create the text-based GUI screen with 3 partition options.

    So, now I'm very relieved to know the answer. And yes… it's safe to say there isn't a workaround with the minimal install image. Unless you're up for a challenge.
  • MentholMooseMentholMoose Member Posts: 1,525 ■■■■■■■■□□
    With a kickstart script you can make Anaconda configure a custom partition layout while still performing a text-mode install. The easiest way to create the kickstart script is probably to do a graphical installation and modify the resulting kickstart script (automatically saved at /root/anaconda-ks.cfg).

    There are several ways to point Anaconda to the script. One convenient way is to save it on a web server and add "ks=http://server/scriptname.cfg&quot; to the kernel command line when starting the installer. Here's a basic script that will configure a 200 MB /boot partition, 14 GB /, and use the rest for swap.
    install
    cdrom
    lang en_US.UTF-8
    keyboard us
    network --onboot no --device eth0 --bootproto dhcp --noipv6
    rootpw v3rys3cr3t
    firewall --service=ssh
    authconfig --enableshadow --passalgo=sha512
    selinux --enforcing
    timezone --utc America/Los_Angeles
    bootloader --location=mbr --driveorder=sda --append="nomodeset crashkernel=auto rhgb quiet"
    clearpart --all
    part /boot --fstype=ext2 --asprimary --size=200
    part / --fstype=ext4 --size=14336
    part swap --grow --size=200
    %packages --nobase
    @core
    %end
    
    MentholMoose
    MCSA 2003, LFCS, LFCE (expired), VCP6-DCV
  • hiddenknight821hiddenknight821 Member Posts: 1,209 ■■■■■■□□□□
    Yes! I knew there was a way! +++1 Rep to you, MentholMoose. But with my limited knowledge, I just couldn't prove it yet. If I have been reading the Michael Jang's book, then I'd have figured this out since it's the only book I have that includes the kickstart/anaconda topics.

    You're right. I'd be better off going through the GUI step and look at the kickstart configuration file after the installation. So, this IS the workaround afterall. Makes me wonder why I couldn't find the answer anywhere. Red Hat could have pointed that out as well rather than having to launch the GUI install.
Sign In or Register to comment.