Use USB Flash Drive on Linux

In Linux, any disk drive has to be mounted first before you can use it. That actually is true for Windows also. But Windows shields a lot of that away from a regular user. Unlike Windows, there is no A: or D: drives for you to go directly in Linux, although I’ve heard that some versions of gnome or kde can do similar things.

With the popularity of USB flash drives, I thought it would be helpful to show how you can mount a USB flash drive on Linux command line to a lot of Windows users who are transitioning to Linux, or need to use Windows occasionally. My way may not be the best way but it has worked for me on my Linux machine. Let’s get to it:

0. Plug in the flash drive;
1. su as root, if you are not root already;
2. mount /dev/sda1 /mnt
3. cd /mnt to access the USB drive;
4. umount /dev/sda1 when you are done.

Problem: Fedora Core 2 as Virtual PC on Windows

Today I tried to install Linux as a guest OS on Windows Virtual PC. I got Fedora Core 2 late last year during a training. So that is what I tried.

I picked “Other” OS and created a new virtual disk. Installation started and I picked Graphic mode installation. The Anaconda hardware probing processing started. After it dected the monitor, mouse, it then tried to start the X. At this point, the process failed. Below is the error message I got:

An internal virtual machine error (13) has occured. The virtual machine will reset now.

So I started the text installation mode. And I picked Personal Desktop as the image I’d like to install. Most of the rest of the customization stuff were left as default.

The install seemed to take forever. It did finish finally but when it is time to start Fedora Core 2 Linux, it was never successful. Below is the sample of error messages I got:

Checksum for device 1 is not valid
Unsupported Intel Chipset
/etc/X11/perfdm: line 80: 317 Segmentation fault unicode_start $SYSFONT $SYSFONTACM

INIT: Id “x” respawning too fast: disabled for 5 minutes

So I figured the problem maybe caused by X and graphic stuff. I then reinstalled without X, gnome, kdesktop and all that. The install was successful, and Linux can be started.

However, when I login as root and issue commands, I periodically got Segmentation Error and the system is not stable. When I try to open or write a file in vi, I got E212: Can’t open file for writing. So essentially, it is useless.

Alas, Cygwin is much easier. But the good thing I found is that mutt seems to be included by default in Fedora.

Find out uptime of server and MySql database

This site had been unstable for the last couple of weeks, due to my hosting company’s issues with servers. My Apache and MySql database have both been moved to a different server. Hopefully things will be stable from now on.

During the troubleshooting time, I used a few commands to find out the uptime of both server and MySql database. I thought these would be helpful to other people so here they are.

To find out the uptime of your Linux server, any one of the following commands will do:

To find out the uptime of your mysql demon, log into the server using mysql command line, then issue the following command:

I am sure there is a way to find out how long Apache has been running, but I just don’t know. Can anybody enlighten me? Thanks.

wget and lynx

Linux and Unix gurus can ignore this post, but if you have better tips to share, please feel free to comment. I write this mainly as a note to myself and hopefully help out Linux / Unix newbies at the same time.

wget is perfect for downloading stuff through a command line. This is a great tool if your only access to the server is SSH. You can append & at the end of shell command line so the download happens in the background. You can do other productive work while download is ongoing.

lynx is a text based web browser. Don’t laugh, I found it pretty handy for some quick and dirty browsing and Yahoo mail checking. Unfortunately, it does not work with gmail.

Mutt questions

Originally posted at’s blog site:

I am working on my own website, It is Apache on Linux, ran by a hosting company. I got access to SSH, MySql, and most of Linux utilities. I am planning to use WordPress and host a blog there too. That will be my primary blogging site, including my thoughts on Linux, MySql, personal musings, and whatnot (cannot believe I used the word). It is still a work in progress. Hopefully I can get it up and running within a month.

Anyway, the real reason I post this is to seek advice / pointers on Mutt. I am planning to install Mutt on this Linux machine and use it as my primary email client. I want to use it primarily because it allows me to use my favorite editor, VI / VIM. I also heard from people that it is keyboard driven, which I like too. The fact it is light weight also helps.

Here are my questions:
1. Installation: anything advice, how easy or difficult it is. It looks like that something special needs to be done if you are going to use SSL. Since I don’t have root access to the Linux box, will I encounter problems when install Mutt?
2. Configuration: what do I need to do to configure it so I can have access to multiple POP or IMAP accounts? It looks like I need to play with .muttrc file.

That’s it for now. Email or comment below if you have ideas/suggestions. Thanks a lot.