LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to identify Red Hat version? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-identify-red-hat-version-892367/)

evsam 07-18-2011 04:34 PM

How to identify Red Hat version?
 
Hello All,
I have a Red Hat Linux system that does not boot. The boot partition is damaged and files cannot be recovered.

I would like to know how to find out which version of Red Hat was installed from the program/data partition which is undamaged and accessible from Fedora Live CD. I assume this is available in a configuration file somewhere.

I plan to download the appropriate version and re-install.

Thanks
Evsam

sycamorex 07-18-2011 05:10 PM

Boot the Fedora Live CD, mount the Red Hat file system, eg:
Code:

mkdir temp
mount /dev/sda2 temp
cd temp
cat etc/redhat-release

Please note that sda2 is just an example. Make sure you mount the filesystem containing Red Hat's /etc directory.

frieza 07-18-2011 05:18 PM

as long as the /boot is separate from the rest of the system than booting to a live cd and reading /etc/issue
or /etc/redhat-release should tell you

however if you /boot partition is really separate, you shouldn't have to re-install your whole system to fix this

what you would do is boot from a live/rescue cd

create a mount point (directory) for the / partition for my example i will use /repair

mount the / partition
Code:

mount /dev/sda3 /repair
re-format the /boot partition
Code:

mkfs -t ext(2,3, or 4) /dev/sda1
mount the /boot partition on /repair/boot
Code:

mount /dev/sda1 /repair/boot
then bind the /dev, /proc, and /sys directories of the live cd into their respective directories on /repair

Code:

$ su -c 'mount ‐‐bind /dev /repair/dev'
$ su -c 'mount ‐‐bind /proc /repair/proc'
$ su -c 'mount ‐‐bind /sys /repair/sys'

then chroot into the system
Code:

$ su -c 'chroot /repair'
if you are already running as root on the live cd than you can issue the commands without the su -c

once you have that done, you can simply use yum (or up2date if you are using Red hat enterprise linux) to re-install the packages (the kernel packages) from the repositories (assuming your live/repari cd provides internet access), or from locally downloaded copies if you don't and reinstall grub to generate a new grub configuration file
Code:

# grub-install /dev/sda
once you have this done you should have a functioning system

note, /dev/sda, /dev/sda1 and /dev/sda3 are merely examples, you should figure out which ones are correct for your system.


All times are GMT -5. The time now is 04:03 AM.