Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
can knoppix save my gentoo server?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
uglyman
Apprentice
Apprentice


Joined: 21 Apr 2002
Posts: 216
Location: Seattle, WA USA

PostPosted: Mon Jul 09, 2007 2:05 am    Post subject: can knoppix save my gentoo server? Reply with quote

hi guys, I have a colo server with serverpronto. the deal is that the price is good but the service sucks. great uptime and all that, but they charge you per reboot, and per all other stuff you need the tech support for. You get no console access and no power switch access.

recently my server was rebooted (not at my request, but that is another story). I had about a year of uptime on it at that point, and I am sure I had absent mindedly screwed something up when updating some software along the way. the server never came back up, apparently some problem loading the network drivers (according to the dumbass at the console).

I had them boot it from a liveCD and get me in via ssh so I could take a look. I decided it was kind of hopeless to trouble shoot so I decided to just update everything (this thing is not really mission critical btw... heh). I built a new kernel with everything I could think of and then tried to set up grub to fallback to some old ones if it failed.

well all of them failed.... and so I had them put the CD back in, blah blah blah.... I have been through this several times now, and I am sure they are going to try to charge me for all of these reboots (I have to have them do it so the CD can be put in and out) The latest problem is that the screen simply goes blank after the kernel is chosen in the bootloader.

So what I would like to know is if I could take something like the liveCD which boots fine, but which allows remote login by default (a knoppix type thing for example) and install it on the hard drive next to the existing gentoo distro... then I would like to set grub to fallback to that if the main system doesn't start. that way I could continue to login, edit the kernel and stuff, then reboot and see which system loads. I could repeat this as many times as needed at no additional cost until the main system starts up.

The main issue is that I need to do it without blowing away all the data on there with fdisk... so ideally it would just go in a directory in /

any ideas?
thanks
Back to top
View user's profile Send private message
geforce
l33t
l33t


Joined: 29 Dec 2003
Posts: 654
Location: Canada

PostPosted: Mon Jul 09, 2007 3:12 am    Post subject: Reply with quote

Do you have free space or HDs ?
_________________
http://tilde.club/~geforce/
Back to top
View user's profile Send private message
uglyman
Apprentice
Apprentice


Joined: 21 Apr 2002
Posts: 216
Location: Seattle, WA USA

PostPosted: Mon Jul 09, 2007 3:49 am    Post subject: Reply with quote

no I only have one hard drive. The colo place partitions it and installs their basic gentoo before you get it, and without console access you are kind of stuck with their stupid partitioning scheme... it would just be expensive to have it done any other way.

output from fdisk:
Code:
Disk /dev/hda: 40.0 GB, 40060403712 bytes
255 heads, 63 sectors/track, 4870 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          13      104391   83  Linux
/dev/hda2              14        4678    37471612+  83  Linux
/dev/hda3            4679        4870     1542240   82  Linux swap / Solaris



there is LOTS of room inside /dev/hda2, what I was hoping is that there was a way to copy a knoppix disk image or a gentoo liveCD type environment into that partition (right next to the gentoo / dir) and use it for fallback, but I just don't know if it can be done without repartiitioning the drive or blowing away the gentoo install
Back to top
View user's profile Send private message
geforce
l33t
l33t


Joined: 29 Dec 2003
Posts: 654
Location: Canada

PostPosted: Mon Jul 09, 2007 4:18 am    Post subject: Reply with quote

how large is the swap ?

Can you remove a part of the swap for the testings ?
_________________
http://tilde.club/~geforce/
Back to top
View user's profile Send private message
uglyman
Apprentice
Apprentice


Joined: 21 Apr 2002
Posts: 216
Location: Seattle, WA USA

PostPosted: Mon Jul 09, 2007 5:00 am    Post subject: Reply with quote

I had wondered that too. I think its too small to do what I want, but I am not very familiar with these little linux distros I don't know how much room they need.

Code:
livecd etc # cat /proc/swaps
Filename                                Type            Size    Used    Priority
/dev/hda3                               partition       1542232 0       -1
Back to top
View user's profile Send private message
Akkara
Bodhisattva
Bodhisattva


Joined: 28 Mar 2006
Posts: 6702
Location: &akkara

PostPosted: Mon Jul 09, 2007 5:41 am    Post subject: Reply with quote

I'm no expert in this, but this thought comes to mind:

Could you put a really tiny root in hda1 - bare necessities sort of stuff - a /etc, a fstab, whatever in /bin that's needed, along with some stuff in a initrd to mount a loopback image file that's stored in hda2 which contains the rest of your rescue system?

Or maybe a danm-small-linux, just enough for remote login and rescue, entirely in hda1.

Good luck!

(Aside: it is curious they put swap last. I find the last sectors of a hard drive are the slowest to do i/o to.)
Back to top
View user's profile Send private message
uglyman
Apprentice
Apprentice


Joined: 21 Apr 2002
Posts: 216
Location: Seattle, WA USA

PostPosted: Mon Jul 09, 2007 6:26 am    Post subject: Reply with quote

thanks for the replies so far. I had thought about using the boot partition too.... but I had not thought of splitting a loopback out and putting it on hda2... that might be the way to go.

in the meantime I built a kernel based on the one on the liveCD... and used copies of the liveCDs module configs. if this doesn't boot then I will know for pretty sure it isn't the kernel but maybe my grubconfig instead. I am waiting for them to reboot it now. **fingers crossed**

I agree that having swap last is stupid... I can't figure out why they do that... but their prices really do make it worth putting up with their BS. I could not afford to have a colo box if not for this deal. I only pay 30 a month and I get the whole box to myself.
Back to top
View user's profile Send private message
geforce
l33t
l33t


Joined: 29 Dec 2003
Posts: 654
Location: Canada

PostPosted: Mon Jul 09, 2007 5:50 pm    Post subject: Reply with quote

If this doesn't work I'd suggest to either try damn small linux or diagnosis the problem.

Anyways a network driver shouldn't be so problematic !
_________________
http://tilde.club/~geforce/
Back to top
View user's profile Send private message
uglyman
Apprentice
Apprentice


Joined: 21 Apr 2002
Posts: 216
Location: Seattle, WA USA

PostPosted: Wed Jul 11, 2007 1:29 am    Post subject: Reply with quote

I am trying to fix the server but it sure would be nice to set something like this up in the future. I will have to experiment with it a little. thanks for the ideas everybody.
Back to top
View user's profile Send private message
geforce
l33t
l33t


Joined: 29 Dec 2003
Posts: 654
Location: Canada

PostPosted: Wed Jul 11, 2007 2:16 am    Post subject: Reply with quote

Thinking about it,

don't expect a GRUB fallback in case of a kernel panic.

It'll only fallback if it can't find the first kernel.
_________________
http://tilde.club/~geforce/
Back to top
View user's profile Send private message
uglyman
Apprentice
Apprentice


Joined: 21 Apr 2002
Posts: 216
Location: Seattle, WA USA

PostPosted: Wed Jul 11, 2007 2:20 am    Post subject: Reply with quote

are you sure?.. from what I read it was possible to make it fallback after a certain time if the system isn't up.
Back to top
View user's profile Send private message
uglyman
Apprentice
Apprentice


Joined: 21 Apr 2002
Posts: 216
Location: Seattle, WA USA

PostPosted: Wed Jul 11, 2007 2:24 am    Post subject: Reply with quote

found it:

source:
Code:
http://www.gnu.org/software/grub/manual/html_node/Booting-fallback-systems.html


Code:
4.3.2 Booting fallback systems

GRUB supports a fallback mechanism of booting one or more other entries if a default boot entry fails. You can specify multiple fallback entries if you wish.

Suppose that you have three systems, `A', `B' and `C'. `A' is a system which you want to boot by default. `B' is a backup system which is supposed to boot safely. `C' is another backup system which is used in case where `B' is broken.

Then you may want GRUB to boot the first system which is bootable among `A', `B' and `C'. A configuration file can be written in this way:

     default saved        # This is important!!!
     timeout 10
     fallback 1 2         # This is important!!!
     
     title A
     root (hd0,0)
     kernel /kernel
     savedefault fallback # This is important!!!
     
     title B
     root (hd1,0)
     kernel /kernel
     savedefault fallback # This is important!!!
     
     title C
     root (hd2,0)
     kernel /kernel
     savedefault

Note that `default saved' (see default), `fallback 1 2' and `savedefault fallback' are used. GRUB will boot a saved entry by default and save a fallback entry as next boot entry with this configuration.

When GRUB tries to boot `A', GRUB saves `1' as next boot entry, because the command fallback specifies that `1' is the first fallback entry. The entry `1' is `B', so GRUB will try to boot `B' at next boot time.

Likewise, when GRUB tries to boot `B', GRUB saves `2' as next boot entry, because fallback specifies `2' as next fallback entry. This makes sure that GRUB will boot `C' after booting `B'.

It is noteworthy that GRUB uses fallback entries both when GRUB itself fails in booting an entry and when `A' or `B' fails in starting up your system. So this solution ensures that your system is started even if GRUB cannot find your kernel or if your kernel panics.

However, you need to run grub-set-default (see Invoking grub-set-default) when `A' starts correctly or you fix `A' after it crashes, since GRUB always sets next boot entry to a fallback entry. You should run this command in a startup script such as rc.local to boot `A' by default:

     # grub-set-default 0

where `0' is the number of the boot entry for the system `A'.

If you want to see what is current default entry, you can look at the file /boot/grub/default (or /grub/default in some systems). Because this file is plain-text, you can just cat this file. But it is strongly recommended not to modify this file directl
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum