Hi, I'm pretty new to Linux.
I'm currently working on a project in my Linux Administration class, but have run into a bit of a bump.
I'm tasked with booting Linux (currently using CentOS 7) through the GRUB prompt. I've loaded the kernel, but I'm having an issue with the initrd.
I've tried both of these commands:
"linux /boot/initrd-plymouth.img"
"linux /boot/initramfs-3.10.0-123.el7.x86_64.img"
Neither of these commands have worked. It only returns the message "invalid magic number" for both of the commands. Any ideas on how I can fix this?
Thanks for any help in advance. It should help me understand Linux better!
Ubuntu 12.04
I installed updates, which included a new kernel. I went to remove one of the older kernels and got:
Code:
jnojr@DEV:~$ sudo apt-get purge linux-image-3.13.0-46-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-3.13.0-46-generic gir1.2-ubuntuoneui-3.0 wireless-regdb iw
linux-headers-3.13.0-46 crda linux-headers-3.5.0-23-generic lesstif2
linux-headers-3.5.0-23 libubuntuoneui-3.0-1 thunderbird-globalmenu
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
linux-image-3.13.0-46-generic*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 197 MB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 340656 files and directories currently installed.)
Removing linux-image-3.13.0-46-generic ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.13.0-46-generic /boot/vmlinuz-3.13.0-46-generic
update-initramfs: Deleting /boot/initrd.img-3.13.0-46-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.13.0-46-generic /boot/vmlinuz-3.13.0-46-generic
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.13.0-51-generic
Found initrd image: /boot/initrd.img-3.13.0-51-generic
Found linux image: /boot/vmlinuz-3.13.0-49-generic
Found initrd image: /boot/initrd.img-3.13.0-49-generic
Found linux image: /boot/vmlinuz-3.13.0-48-generic
Found initrd image: /boot/initrd.img-3.13.0-48-generic
Found Windows Vista (loader) on /dev/sda1
Found CentOS release 6.6 (Final) on /dev/sdb1
Found linux image: /boot/vmlinuz-3.13.0-51-generic
Found initrd image: /boot/initrd.img-3.13.0-51-generic
Found linux image: /boot/vmlinuz-3.13.0-49-generic
Found initrd image: /boot/initrd.img-3.13.0-49-generic
Found linux image: /boot/vmlinuz-3.13.0-48-generic
Found initrd image: /boot/initrd.img-3.13.0-48-generic
Found Windows Vista (loader) on /dev/sda1
Found CentOS release 6.6 (Final) on /dev/sdb1
Found memtest86+ image: /boot/memtest86+.bin
error: syntax error.
error: Incorrect command.
error: syntax error.
error: Incorrect command.
error: syntax error.
error: line no: 146
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub/grub.cfg.new file attached.
done
Purging configuration files for linux-image-3.13.0-46-generic ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.13.0-46-generic /boot/vmlinuz-3.13.0-46-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.13.0-46-generic /boot/vmlinuz-3.13.0-46-generic
I have no idea how I'd "ensure there are no errors" in the /etc/grub related files... I have no idea what's supposed to be there. Looking at the line it's complaining about in /boot/grub/grub.cfg.new doesn't tell me anything. How do i find out what it's unhappy about?
hiiii all
I had installed Windows 7 on /dev/sda1 and /dev/sda2 and then I installed Centos 7.
Since then I cant find Windows entry in the Grub.
And i had tried to use all kind of solution found on the net I still cant see any entry.
I had edited 40_custom script adding:
cat <<EOF
menuentry "windows 7" {
insmod part_msdos
insmod ntfs
set root='hd0,msdos1'
search --no-floppy --fs-uuid --set=root FCDAE998DAE95006
chainloader +1
}
EOF
then this command grub2-mkconfig -o /boot/grub2/grub2.cfg
[root@localhost]# grub2-mkconfig -o /boot/grub2/grub2.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-123.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-123.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-93890f189dec4b309c004fdce969ca5a
Found initrd image: /boot/initramfs-0-rescue-93890f189dec4b309c004fdce969ca5a.img
then this
[root@localhost]# tail -10 /boot/grub2/grub.cfg
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
[root@localhost]#
Still cant find windows in grub
please help me with this guys
thanks
I want to change the menu on a Suse 12 Enterprise system.
I edit the /etc/default zip12grub.conf file execure grug2-mkconfig. Then reboot the system and no changes occur. The zip12grub.conf seems like the correct file to update so I am at a loss as to what the correct process would be.
cat zipl2grub.conf
## This is the template for '@zipldir@/config' and is subject to
## rpm's %config file handling in case of grub2-s390x-emu package update.
[defaultboot]
defaultmenu = menu
[grub2]
target = @zipldir@
ramdisk = @zipldir@/initrd,0x2000000
image = @zipldir@/image
parameters = "root=@GRUB_DEVICE@ @GRUB_EMU_CONMODE@ @GRUB_CMDLINE_LINUX@ @GRUB_CMDLINE_LINUX_DEFAULT@ initgrub quiet splash=silent "
[skip-grub2]
target = @zipldir@
ramdisk = @zipldir@/initrd,0x2000000
image = @zipldir@/image
parameters = "root=@GRUB_DEVICE@ @GRUB_CONMODE@ @GRUB_CMDLINE_LINUX@ @GRUB_CMDLINE_LINUX_DEFAULT@ "
[test-grub2]
target = @zipldir@
ramdisk = @zipldir@/initrd,0x2000000
image = @zipldir@/image
parameters = "root=@GRUB_DEVICE@ @GRUB_CONMODE@ @GRUB_CMDLINE_LINUX@ @GRUB_CMDLINE_LINUX_DEFAULT@ "
:menu
target = @zipldir@
timeout = 16
default = 1
prompt = 1
1 = grub2
2 = skip-grub2
3 = test menu grub2
grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/image-3.12.39-47-default
Found initrd image: /boot/initrd-3.12.39-47-default
Found linux image: /boot/image-3.12.28-4-default
Found initrd image: /boot/initrd-3.12.28-4-default
done
reboot
Storage cleared - system reset.
zIPL v1.24.1-38.17 interactive boot menu
0. default (grub2)
1. grub2
2. skip-grub2
Note: VM users please use '#cp vi vmsg <input> <kernel-parameters>'
Please choose (default will boot in 16 seconds):
Booting default (grub2)
I am using linux mint and the grub menu gets configured automatically using scripts in /etc/grub.d. The menuentry that gets created is something like
Code:
"linux mint (on /dev/sda1)"
. I use external drives sometimes and also have linux on my harddrive which I also switch between computers. It gets confusing when it says /dev/sda2 when it means something else. It boots fine because that actual boot command uses uuid. How can I change the text of the (script generated) description to also use partition labels or uuid (or the first few chars) just so I know which install will actually boot. like this:
Code:
"Linux Mint (OFFICESSD)"
"Linux Mint (HOMEHDD)"
"Ubuntu (SANDISK)"
"Ubuntu (IMATION)"
I realise (maybe its the best way) I can change the "GRUB_TITLE=Linux Mint 17 Cinnamon 64-bit" in /etc/linuxmint/info but would rather a smoother way.
Hello,
for the reason my PC hangs a long time at the boot line
initrd /boot/initrd.img-3.7.10-antix.7-486-smp
I decided to uopdate it with
update-initramfs -u
but the error
"cryptsetup: WARNING: failed to detect canonical device of /dev/sda2" appear.
I have few questions now:
- how to create a quick initrd
- how to avoid that error?
Your help will be much appreciated.
Hello
I have installed a CentOS 6.4 on VmWare.
Now, after several days of using it, it suddenly does not boots. There is a problem with its initialization, here is the error:
Kernel Panic : Unalble to init. Try passing init= option to the kernel.
Pid 1 : Swapper not tainted.
I have used CentOS.iso to rescue it, but it still does not solve it.
My grub.conf contains:
PHP Code:
# 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/sda2
# initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32-358.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-358.el6.x86_64 ro root=UUID=6082bcf5-00ba-4bf8-86ea-9821d774cb6f rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
initrd /initramfs-2.6.32-358.el6.x86_64.img
How should I solve it then? Thanks in advance
Hi all! I'm a Linux/Ubuntu noob who has recently bought a brand new HP laptop, nuked the Win 8 OS that it came/w & installed Ubuntu 14.04LTS. After DL/installing apps & setting it up a bit I decided to use gparted & partition my HDD for an additional OS, isolate programs from files, adjust swap, etc. All went well until I was prompted to reboot which I did & now I'm stuck @
" BusyBox v1.21.1 (Ubuntu 1:1.21.0-1ubuntu1) multi-call binary.
usage: chroot NEWROOT [PROG ARGS]
Run PROG with root directory set to NEWROOT "
Which invariably produces: (no matter what command I enter?!?)
" (initramfs) boot from BIOS
/bin/sh: boot: not found "
I'm quite confused @ how to proceed here?
My primary concern is the health of my machine through/after this is worked out.
That said, I'd love to not have to re-install Ubuntu/apps, etc. as I was partitioning the HDD because I had gotten it to a nice back-up place & felt ready to set it up.
Like I said I'm new to Linux/Ubuntu & waayyy behind on my terminal coding, but I could really use some pointers here & I'm not usually hard to teach. lol
Help?! :-[
Thanx!
Embarrassingly yours, WS.
Hi All,
I recently decided to tryout Linux and dual booted my laptop (originally just had windows 8) with Xubuntu. Now I want to try out Kali Linux. So I downloaded Kali and made a bootable USB, the problem is that when I try to boot from the USB it just brings up the grub menu asking me to select Xubuntu, Windows etc. I've changed the boot menu in the BIOS but that has no effect.
I've tried booting into windows and the restarting by holding shift but when I select the usb option it just says:
"system doesn't have any USB boot option. Please select other boot option in Boot Manager Menu"
and then returns to the grub menu. I don't understand because I used a bootable usb to install xubunto?
I'd be really grateful if anyone can help me out with this!
Thanks
I have a shell script that calls an expect script I wrote to ssh login to another host and get user input regarding that host's network configuration. I pass four arguments to the expect script: the remote host ip address, the username, the password, and the list of commands to run. My expect script is below:
#!/usr/bin/expect
# Usage: expectssh <host> <ssh user> <ssh password> <script>
set timeout 60
set prompt "(%|#|\\$) $"
set commands [lindex $argv 3];
spawn ssh [lindex $argv 1]@[lindex $argv 0]
expect {
"*assword:" {
send -- "[lindex $argv 2]\r"
expect -re "$prompt"
send -- "$commands\r"
}
"you sure you want to continue connecting" {
send -- "yes\r"
expect "*assword:"
send -- "[lindex $argv 2]\r"
expect -re "$prompt"
send -- "$commands\r"
}
timeout {
exit }
expect -re $prompt
send -- "exit\r"
}
The script runs well, except that if I send a command such as 'read' that requires user input, the script does not continue or exit after the user presses enter. It just hangs.
The commands I pass to the expect script and it's call are as follows:
SCRIPT='hostname > response.txt;netstat -rn;read net_card?"What is the network interface card number? " >> response.txt; read net_mask?"What is the subnet mask? " >> response.txt'
/usr/bin/expect ./expectssh.exp $hostip $usr $pswd "$SCRIPT"
Any suggestions on how I can pass a command to my expect script that requires user input without it hanging?
On a side note because I know it will come up - I am not allowed to do key-based automatic SSH login. I have to prompt for a username and password, which is done from my main shell script.
Thanks for any suggestions and help you can provide!
Hello!
TL;DR: Deleted Linux partition from Windows. Stuck at Grub rescue prompt.
I'm sorry to trouble you guys, because I'm an idiot.
So I'm wanting to dual-boot Kalilinux and Windows 8.
I went through the steps such as creating a bootable USB, changing the
boot order and so on. I get into Kali, start Gparted and try to partition stuff.
I'm far from an expert, so I wasn't sure what to do. Long-story short, I
didn't seem to get Kali installed correctly, due to something with an EFI
drive being required. So I boot into windows and then stupidly, because it said in the guide,try to "uninstall" Kali by removing it's partition, inside Win8 haha... So I did.
Now I simply get the Grub rescue command prompt when I boot from the same
USB and I have no idea how to fix it. I've run bootrec.exe/fixmbr in Windows haha,
for what it's worth. However Grub can't find any partition it says.
In windows, I have like... 2-3 Recovery partitions. Does anyone know how to remove
them??? I've tried to clear as much as I can, besides the C drive and Auxillary D drive.
Any advice would be very appreciated.