Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I formatted /dev/sda1 - boot partition by mistake.
Now, after reboot, i have only grub cli.
What to do, to restore /boot ?
I'm trying restore my empty /boot partition using kali live on usb
(My os on hdd is centos, but i have not same os on live usb :/ )
After booting kali live i did:
mount /dev/mapper/vg_centosx220-lv_root /mnt/myroot
mount /dev/sda1 /mnt/myroot/boot
mount ‐‐bind /dev /mnt/myroot/dev
mount ‐‐bind /proc /mnt/myroot/proc
mount ‐‐bind /sys /mnt/myroot/sys
cp -L /etc/resolve.conf /mnt/myroot/etc/resolve.conf
gave me error: bash: tty: command not found
chroot /mnt/myroot /bin/bash
gave me same error.
Neighter apt-get or yum not work in chroot
(I don't have initrd.img in chroot)
I think on kali there is grub2 and on centos i had 0.97
I have not grub-install package on kali nor to install (apt-get install grub-install)
Is this possible to fix that using kali on usb ?
Last edited by blackRonin; 10-23-2014 at 11:21 PM.
I have /boot on separate partition /dev/sda1, and it's empty (only have lost and foud folder)
So all of the Grub boot files are gone as well as the kernel and initrd so even if you were able to reinstall Grub Legacy or Grub2, it still won't boot without those files. Do you still have your CentOS install CD?
What partition is / on?
Would it be on /dev/sda2?
If so that's, the partition you /mnt/myroot.
At present if you were to cd to /mnt/myroot you wouldn't see anything except proc sys and so on. Where as if you mount the / partition you would see your /etc /usr and so on, unless they are on separate paritotions & in that case you would need to mount them also.
No need to do that as you already have Grub installed to the mbr/sda. It's the /boot partition that is messed up and yes, you need to install an initrd. With Grub Legacy, you need the stage1 and stage2 files in /boot or you will get an error. See the link to the Grub Manual below, at the bottom of the page it explains the grub-install when you have a root partition. The problem is, there is no grub.conf file and this will not create it.
In the second link I posted above, read section 5.1 about the entries if you have a separate boot partition. According to that, your root line should be: root (hd0,0) since that is where the kernel and initrd are.
The part at the end of the kernel line should be: root=/dev/sda2
if the rest of the filesystem is on sda2. That's the way I understand it. Make a note of any changes you make so you know what you have done. I don't use CentOS or a separate boot partition but the page above makes sense.
It would be helpful if you were more specific about what 'problem' you have whether it is with dracut or uuid. Someone might recognize it. I don't use CentOS and have never used LVM so don't really know what you need there. You might try googling the problem specific to Red Hat/CentOS or posting more details here.