[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: script makes kernel panic



Dexter Filmore <Dexter.Filmore@gmx.de> writes:

>Got a laptop here (Samsung X22), WinXP Pro and data partition in /dev/sda[23].
>Wrote this script to backup both partitions 1:1 to an external USB disk.
>Teh script itself works absolutely as intended.

>BUT: I added an entry to GRUB's menu.lst like that:

>title           Windows XP Backup
>root            (hd0,4)
>kernel          /boot/vmlinuz-2.6.18-6-686 root=/dev/sda5 rw init=/sbin/windows_backup
>initrd          /boot/initrd.img-2.6.18-6-686
>savedefault

>When I select that entry, kernel comes up, script is executed alright,
>but after the script called "halt" it just sits there and eventually
>throws a kernel panic - and I have no clue why.

By default, halt calls shutdown(8), which signals init(8) to shutdown
the system. Since you are not running a standard init, that signal is
never received by anything, so halt effectively does nothing. When your
script exits, since it is running as process 1 (init) you get a kernel
panic when it exits. Init should never exit.

Try using "halt -f". Check the man page for halt to see if there are any
other options you want to use.


Reply to: