Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13
Hi, I'm a novice Linux user. I am trying to edit my grub.conf file. I am logged in as root. It says it is a read only file. I have ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2010
    Posts
    7

    CentOS4.5 Edit grub.conf


    Hi,
    I'm a novice Linux user.
    I am trying to edit my grub.conf file. I am logged in as root. It says it is a read only file. I have tried to set permission with chmod 777 and also tried through GUI. Using VI it says it's a read only file. Using nano it will not write either. I have two choices on boot up. I want to automatically go to second automatically. First at the moment is CentOS-4 i386 (2.6.9-55.ELsmp) and second is CentOS-4 i386 (2.6.9-55.EL). Any ideas?
    Thanks

  2. #2
    Linux Engineer nujinini's Avatar
    Join Date
    Apr 2009
    Posts
    1,274
    Hello!

    Allow me to try to answer your question larrymac

    Kindly execute as root and paste the output here.

    # nano /boot/grub/grub.conf
    nujinini
    Linux User #489667

  3. #3
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    3,043
    Can you post the output of
    Code:
    mount
    cat /boot/grub/grub.cfg
    we can then see how you have partitions mounted, and your current grub config.

  4. $spacer_open
    $spacer_close
  5. #4
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    How did you gain root privileges? IIRC, CentOS 4.5 uses GRUB Legacy and root user have full access to grub.conf file.

    Try this
    Code:
    su -
    nano /boot/grub/grub.conf
    In case it doesn't work, post the output of this
    Code:
    ls -l /boot/grub/gr*
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  6. #5
    Just Joined!
    Join Date
    Nov 2010
    Posts
    7
    Hi nujinini,

    # grub.conf generated by anaconda
    #
    # Note that you do not have to rerun grub after making changes to this file
    # NOTICE: You have a /boot partition. This means that
    # all kernel and initrd paths are relative to /boot/, eg.
    # root (hd0,0)
    # kernel /vmlinuz-version ro root=/dev/sda3
    # initrd /initrd-version.img
    #boot=/dev/sda
    default=0
    timeout=5
    splashimage=(hd0,0)/grub/splash.xpm.gz
    hiddenmenu
    title CentOS-4 i386 (2.6.9-55.ELsmp)
    root (hd0,0)
    kernel /vmlinuz-2.6.9-55.ELsmp ro root=LABEL=/1 rhgb quiet
    initrd /initrd-2.6.9-55.ELsmp.img
    title CentOS-4 i386-up (2.6.9-55.EL)
    root (hd0,0)
    kernel /vmlinuz-2.6.9-55.EL ro root=LABEL=/1 rhgb quiet
    initrd /initrd-2.6.9-55.EL.img

    [ Read 21 lines ]
    ^G Get Help ^O WriteOut ^R Read File ^Y Prev Page ^K Cut Text ^C Cur Pos
    ^X Exit ^J Justify ^W Where Is ^V Next Page ^U UnCut Txt ^T To Spell


    Thanks

  7. #6
    Just Joined!
    Join Date
    Nov 2010
    Posts
    7
    Hi Jonathan183


    [root@css grub]# mount
    /dev/sda3 on / type ext3 (rw)
    none on /proc type proc (rw)
    none on /sys type sysfs (rw)
    none on /dev/pts type devpts (rw,gid=5,mode=620)
    usbfs on /proc/bus/usb type usbfs (rw)
    /dev/sda1 on /boot type ext3 (rw)
    none on /dev/shm type tmpfs (rw)
    /dev/sda6 on /home type ext3 (rw)
    /dev/sda2 on /usr type ext3 (rw)
    none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)

    Thanks

  8. #7
    Just Joined!
    Join Date
    Nov 2010
    Posts
    7
    Hi devils casper,

    Output from grub file posted previous.


    [root@css ~]# ls -l /boot/grub/gr*
    -rw------- 1 root root 721 Oct 8 16:40 /boot/grub/grub.conf

    Thanks

  9. #8
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    As I suggested earlier, have you tried su - to gain root privileges? There is a difference between su and su -.
    Code:
    su -
    nano /boot/grub/grub.conf
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  10. #9
    Just Joined!
    Join Date
    Nov 2010
    Posts
    7

    Angry

    Hi There,

    Yes I tried the su - command. As far as I am aware I am root with full privileges because I need to be for the application that's running. It states that the file is read-only when trying to make change....
    Whe I right-click on file in GUI it states that owner is root and can read & write file!

  11. #10
    Just Joined!
    Join Date
    Nov 2010
    Posts
    7

    Question

    My unhappy face icon should have been a confused face....

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •