NO idea how to

boles

Senior member
Jul 3, 2003
401
0
76


Ok so I have an IPCOP firewall box that has been running great for months. I put a CF drive in to replace the old IDE and am getting problems:

On Boot I get something like:
hda: dma_timer_expiry: dma status == 0x21
hda error waiting for DMA
hda: dma timeout retry: status=0x58 { DriveReady SeekComplete DataRequest }

hda: dma_timer_expiry: dma status == 0x21
hda: error waiting for DMA
hda: dma timeout retry: status=0x58 { DriveReady SeekComplete DataRequest }

It will eventually boot and run fine. THAT is until I enabled squid 2 days ago. Now after about 6 hours I start to get segmentation faults and all other kinds of strange behavior. I know this could be faulty ram but I am leaning toward the HD as the problem mostly because the increased HD activity due to squid.

I read an article that has similar problem:
http://www.linuxforums.org/forum/slackware-linux-help/20173-dma-issue-cf.html

That talks about turning off DMA in LILO but I dont have a clue how to do it. Can someone please give me some ideas? Can I do this on an existing build or to I have to rebuild the box?
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
It could be a bad drive controller, bad drive, or bad drive cable. Most likely it's the cable.

To turn of DMA you use the hdparm command, normally.

hdparm -d0 -k1 /dev/hda

for passing a kernel parameter in Lilo you wouild type out the name of the menu entry, like if it was 'linux' and you add ide=nodma so it would go like this:
linux ide=nodma

 

boles

Senior member
Jul 3, 2003
401
0
76
Excuse me if this is very noob but:

does hdparm -d0 -k1 /dev/hda carry over each time i boot?
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
The 'k1' switch is suppose to have it 'keep' the settings in between boots.

see 'man hdparm' for details on what the switches and commands mean.

But to be safe you probably want to add the ide=nodma to your lilo or grub configuration. Just to make sure.
 

boles

Senior member
Jul 3, 2003
401
0
76
Originally posted by: drag

But to be safe you probably want to add the ide=nodma to your lilo or grub configuration. Just to make sure.

how can i do that?
 

Slackware

Banned
Jan 5, 2007
365
0
0
vi /boot/grub/menu.lst


Use the arrows to get to the end of that line now type "a" (just an a without the quotation marks) and write ide=nodma

then type :wq.

that will do it.

 

Slackware

Banned
Jan 5, 2007
365
0
0
Glad to help. :)

Now type man vi, you will learn how to use this fully eventually (emacs freakes go away).

If you don't remember from time to time, just open up another terminal in X or if you use console, just hit Alt+f2 and you got another place to log into and use.

I almost wish i was you, you have a whole new wonderful world of stuff to discover. :)
 

boles

Senior member
Jul 3, 2003
401
0
76
i have used vi many times in the past. I worked a short time on an AIX AS400 system but that was long ago. the one thing i remember most was Q bang("q!") .... quit without save cause i f;ed up the file too much by not knowing what i was doing

i really like linux but my work doesnt leave me much time to give into my indulgence for other things...
 

Slackware

Banned
Jan 5, 2007
365
0
0
Originally posted by: boles
i have used vi many times in the past. I worked a short time on an AIX AS400 system but that was long ago. the one thing i remember most was Q bang("q!") .... quit without save cause i f;ed up the file too much by not knowing what i was doing

i really like linux but my work doesnt leave me much time to give into my indulgence for other things...

Oooh, i have an AS system coming my way, i still don't know what to put on it but it has more storage than i can possibly handle, i'm thinking webserver but then again i don't have the need for that either... crap...

It's PPC arch so I'll be likely to run a BSD on it, any suggestions would be welcome.

Oh, and if you just know vi, ask any configuration and i'll tell you the file, although i'm a bsd kinda guy, i do know my way around most distros, except those that hold on to old unix when there is no reason to complicate things with three shortcuts and fifteen config files..
 

Slackware

Banned
Jan 5, 2007
365
0
0
Actually, if you're comfy with AIX and the vi and tools that goes with that, NetBSD is probably going to go right up your alley, i'm not sure about the development of it though, maybe OpenBSD would be a better choice.

If you would like the same configurations to edit but with mostly the same but different tools i'd recomment slackware.

If you choose either OpenBSD or Slackware you will get lots of help around here, that i can promise.

If you need a desktop though, debian with it 20k packages has a lot to offer, even compiled avidemux which will work with almost any format and offers a multitude of ways to save it as a vcd, svcd, asvcd, dvd, dvd9 and most other formats you can imagine.
 

boles

Senior member
Jul 3, 2003
401
0
76
ok i went to try to set the ide=nodma setting but i dont have a menu.lst file. do i want to use grub.conf instead ?

i want to confirm the settings before i save it:

timeout 5
default saved
foreground = 16064e
background = ffffff
splashimage (hd0,0)/grub/ipcop.xpm.gz
title IPCop
root (hd0,0)
kernel /vmlinuz root=/dev/hda4 panic=10 acpi=off ro
savedefault
title IPCop SMP
root (hd0,0)
kernel /vmlinuz-smp root=/dev/hda4 panic=10 acpi=off ro
savedefault
title IPCop (ACPI enabled)
root (hd0,0)
kernel /vmlinuz root=/dev/hda4 panic=10 ro ide=nodma
savedefault
title IPCop SMP (ACPI HT enabled)
root (hd0,0)
kernel /vmlinuz-smp root=/dev/hda4 panic=10 acpi=ht ro
savedefault


 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
ok i went to try to set the ide=nodma setting but i dont have a menu.lst file. do i want to use grub.conf instead ?

Yea, the IPCop people must be trying to make it simpler but since most everyone else calls it menu.lst (like it's supposed to be) they just end up confusing people.

And yea that's what it should look like, but even if it's wrong it'll just be ignored so it won't hurt to try.
 

Slackware

Banned
Jan 5, 2007
365
0
0
Originally posted by: Nothinman
ok i went to try to set the ide=nodma setting but i dont have a menu.lst file. do i want to use grub.conf instead ?

Yea, the IPCop people must be trying to make it simpler but since most everyone else calls it menu.lst (like it's supposed to be) they just end up confusing people.

And yea that's what it should look like, but even if it's wrong it'll just be ignored so it won't hurt to try.

I missed that he was running IPCop, to make it even more confusing, SuSE has both menu.lst and grub.conf (I still prefer lilo).

But yeah, Nothingman is correct on this, IPCop uses the grub.conf instead and yes, that line should work and as Nothingman points out, if it's not a valid command, it will just be ignored.

 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
I missed that he was running IPCop, to make it even more confusing, SuSE has both menu.lst and grub.conf (I still prefer lilo).

RH likes to do that to, they use grub.conf as the real file but symlink menu.lst back to it because it's what grub expects.

But yeah, Nothingman is correct on this, IPCop uses the grub.conf instead and yes, that line should work and as Nothingman points out, if it's not a valid command, it will just be ignored.

There's no 'g' in my nick.
 

boles

Senior member
Jul 3, 2003
401
0
76
thanks all, i gave it a shot and no more errors on boot. I will see how the next 24 hours go. I should see errors about then and if not i am fixed
 

Panther505

Senior member
Oct 5, 2000
560
0
0
Something else to think about is that CF has a write life. You may want to investigate using a RAM disk for the squid logs or else you could wear out your CF card fairly quickly.

Panther505
 

boles

Senior member
Jul 3, 2003
401
0
76
Originally posted by: Panther505
Something else to think about is that CF has a write life. You may want to investigate using a RAM disk for the squid logs or else you could wear out your CF card fairly quickly.

Panther505


Thanks for the great recomendation. I am going to do that. I wonder should i put just the logs on that ramdisk or the cache also?

If found this article about creating ramdisks:
http://www.vanemery.com/Linux/Ramdisk/ramdisk.html

Also should i update the squid.conf to point to the new ramdisk or use symlink to point the /var/log/squid/ folder to the a new folder on the new disk? reason i ask is because i am somewhat worried about another component looking for the logs in the old location.





 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Personally I'd probably put the IDE disk back in and put all of /var on there.
 

boles

Senior member
Jul 3, 2003
401
0
76
figure i would ask here before i post new question...

I want to execute a set of commands each time my IPCop box boots. I found some info that says to edit the /etc/rc.d/rc.local file to add the commands i want. Is this correct or am i going to break something?


/sbin/mke2fs -q -m 0 /dev/ram0
/bin/mount /dev/ram0 /mnt/rd
/bin/chown squid:root /mnt/rd
/bin/chmod 766 /mnt/rd

/bin/mkdir /mnt/rd/squid
/bin/chown squid:root /mnt/rd/squid
/bin/chmod 766 /mnt/rd/squid


/bin/mkdir /mnt/rd/cache
/bin/chown squid:root /mnt/rd/cache
/bin/chmod 766 /mnt/rd/cach

ln -s /mnt/rd/cache/ /var/log/cache
ln -s /mnt/rd/squid/ /var/log/squid

 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
It's dependent on each distro and how their startup scripts work.

And you realize that those ram disks are pretty small, right? On my Debian x86 machine they're only ~8M each, on my AMD64 machine they're ~64M but that's still pitifully small. You'd be much better off just mounting a ramfs or tmpfs filesystem somewhere.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
But if you use ramfs or tmpfs you don't have to have any of that script, you just put a line in fstab and you're done.