LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   how to edit a file using a boot cd (http://www.linuxquestions.org/questions/slackware-14/how-to-edit-a-file-using-a-boot-cd-4175437496/)

Laertiades 11-16-2012 07:29 PM

how to edit a file using a boot cd
 
I installed slackware 14.0 and tried to switch to the generic kernel by editing lilo.conf. Now I can't boot. When I boot using a cd I can't figure out how to edit a text file. None of the commands I know work: nano, vim, etc. If someone could tell me how to edit lilo.conf while in this condition I would be greatful.

markush 11-16-2012 07:48 PM

Hi,

boot the CD and be sure to know on which device /dev/sd? you've installed Slackware. Now chroot into your Slackware installation:
Code:

mkdir /mnt/slack
mount /dev/sda? /mnt/slack
mount -t proc none /mnt/slack/proc
mount --rbind /sys /mnt/slack/sys
mount --rbind /dev /mnt/slack/dev

The ? stands for a, b, or what else is correct on your system.
now you're within your Slackware-installation and can edit lilo.conf as if Slackware were running
Code:

vi /etc/lilo.conf
I would recommend to add the huge-kernel as a failsafe option to lilo.conf, here as an example (a part of) my lilo.conf
Code:

# Linux bootable partition config begins
image = /boot/vmlinuz
  initrd = /boot/initrd.gz
  append = "resume=/dev/sda9"
  root = /dev/sda5
  label = Slack64-current
  read-only
###
image = /boot/vmlinuz-huge-3.5.4
  root = /dev/sda5
  label = failsafe
  read-only
# Linux bootable partition config ends

I'm using also the generic kernel (as the default) but when my initrd would not work, I can chose for the failsafe option.

Afterwards run lilo and simply type "exit" to leave the chroot-environment. Then you can reboot the system.

Markus

BTW: Slackware uses elvis as default editor, use vi instead of vim when you've booted the install-CD

Laertiades 11-16-2012 09:57 PM

Thanks
 
Thank you so much Markus. boots fine now. Great learning experience. I even got the generic kernel working. I definately needed that. Thanks for getting me back on my feet.

markush 11-17-2012 04:01 AM

I'm happy to read that you've got it working.

When you have another Slackware-related question, please post it in the Slackware-forum of LQ http://www.linuxquestions.org/questions/slackware-14/ we have a very helpful and knowledgeable community here.

Markus

colucix 11-18-2012 04:55 AM

Moved: This thread is more suitable in the Slackware forum and has been moved accordingly to help your thread/question get the exposure it deserves.


All times are GMT -5. The time now is 11:40 AM.