Best of Tech Support

Our experts answer your technical questions.
Fixing ext2 Filesystem Damage

Question: after a power blackout I am having trouble with my drive. I am using the ext2 filesystem. With the help of the tomsrtbt floppy distribution and a couple of documents from the LDP, I have been able to boot in single-user mode. But when I try to execute the network script, the system sticks after echoing the following:

Disabling IPv$ packet forwarding
sysctl: ip forwarding off

What can I try next?

—Roberto Kruse, rkruse@ieee.org

I would advise you to boot from a rescue disk and run an e2fsck on the partitions of your damaged hard disk for an automatic check:

e2fsck -p -v /dev/<partition_to_fix>

Keep in mind that messing around with your disk, even with fsck and e2fsck, may result in loss of data, so be careful that you understand what you are about to do.

—Felipe E. Barousse Boué, fbarousse@piensa.com

You can try booting Linux with linux single or linux init=/bin/bash if all else fails. Type this at the LILO prompt. After that, you can look at the output of rpm -Va, which should tell you which packages have modified or missing files, and you can then re-install the said packages (with rpm -U --force /location/of/package.rpm) All that said, it's probably as good a time as any to upgrade your system to the latest Red Hat version, which should also fix your problem in the process.

—Marc Merlin, marc@merlins.org

How to Mount a USB Device?

I would like to access a Disgo 16MB USB Flash RAM device from Mandrake Linux. Will Linux automatically mount this device? If so, how can I find it?

—Greg, gregory_connor@yahoo.co.uk

I believe that Mandrake uses the usbdevfs pseudo-filesystem, though I don't know where it mounts. Type mount to see. My Red Hat machine mounts it on /proc/bus/usb.

—Ben Ford, ben@kalifornia.com

Linux supports USB storage devices if you have a recent kernel version. According to Mandrake's web site, they shipped 8.1 with kernel version 2.4.8. However, because the device drivers have evolved quite a bit in the last few months, it may be helpful to update to the latest 2.4.x version, which at the time of this writing is 2.4.18. You will need both the USB device filesystem and SCSI generic support. Then, check out the Linux USB Guide (linux-usb.sourceforge.net/USB-guide/book1.html). The “mass storage” section should be helpful.

—Chad Robinson, crobinson@rfgonline.com

______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

mount usb

Anonymous's picture

simply type: mount /dev/sda1 /somewhere

Re: Best of Tech Support

Anonymous's picture

Here is a script (sanitized) that I use to post my IP address. You can easily modify it to send an email instead of uploading a web page. Then just add it to your crontab to run as often as you want. Here's the URL where you can see the results of the script: http://home.hawaii.rr.com/nelsongarcia/myip.html

Aloha,

Nelson Garcia

#!/usr/bin/expect -f

set ftpserver "yourftpserver.com";

set username "yourusername";

set userpass "yourpassword";

set tmpfile "/tmp/myip";

set pubfile "myip.html";

set ifconf "/sbin/ifconfig";

set ip [exec $ifconf eth0]

set indx [string first "inet addr" $ip]

set indx [expr $indx +10]

set ip [string range $ip $indx end]

set indx [string first " " $ip]

set indx [expr $indx -1]

set ip [string range $ip 0 $indx]

set systime [clock seconds]

set datestrng "Last updated: [clock format $systime -format %H:%M:%S] - [clock format $systime -format {%B %d, %Y}]"

set toout [open "$tmpfile" w];

puts $toout "<html><head><title>My IP Address</title></head><body>";

puts $toout "<h1>My current IP is: <a href='http://$ip'>$ip</a><br>$datestrng </h1>";

puts $toout "<hr><h2>Warning</h2><br>Please do not bookmark any pages on my home server using the IP address as it is subject to change.";

puts $toout "<br>If the time above appears old, it probably means that my server is down and that you should not follow the link.";

puts $toout "<br><hr>Mail comments to <a href='mailto: '>Me</a>.</body></html>";

close $toout;

spawn ftp "$ftpserver"

expect "Name*:"

send "$username\r"

expect "Password:"

send "$userpass\r"

expect "ftp>"

send "put $tmpfile $pubfile\r"

expect "ftp>"

send "quit\r"

close

puts "\n"

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix