Archive for the ‘Computer related bits & pieces’ Category

Cloning a soon-to-crash hard drive

Friday, September 2nd, 2005

When my PC at work (an 8 months old HP) started making loud clicking sounds, I realized that I needed to act quickly and replace the disk. The replacement drive arrived the next day, but the troubles started once I tried to clone the old drive to the new one.

First, a warning. Be careful when using Norton Ghost (in my case version 2003) on a HP machine – there’s a known problem with that combination.

In my case, I ran Ghost and chose to clone the drive. When the computer booted into the Ghost interface, it locked up and displayed an error message saying “internal stack overflow”. After retrying this a few times (same results) and trying to boot back into Windows (didn’t work since Ghost had taken over the boot sector) I booted Knoppix so I could look for assistance on the web.

(Thank god for Knoppix, BTW… I was able to access my files and documents on the disk, access the net and use email just as usual. It only took a quick configuration of Thunderbird to get myself back on track.)

Further attempts to clone the drive from within Knoppix failed – PartEd crashed when I selected the drive and both PartImage and NTFSclone gave up midway due to disk errors.

Finally I managed to remove the small partition created by Ghost and make the old Windows partition active again, and Windows on the faulty drive booted again. Well, after a few lockups during boottime anyway.

Now it was time for another try at cloning the drive… I decided to give Acronis True Image a try, and it worked beautifully.

So the lesson is – don’t use Ghost unless you’re sure it’s compatible with your hardware, because it can really screw up your computer…

New header for Kubrick

Wednesday, August 10th, 2005

A cool service called Kubrickr makes it really easy to create a new header for the Kubrick theme for WordPress (probably the most popular blog theme in the world). Enter a tag to search for, select one of the suggested images, crop it online and save the resulting image (borders included!) to your WordPress installation.

I found a nice picture by Chris Darling that I’ll try out for a while…

Quick-starting Knoppix in (Windows) rescue mode

Wednesday, August 10th, 2005
  • Boot knoppix
  • Open a shell prompt and enter sudo su (or start a root shell through the Knoppix menu)
  • Change the knoppix password with passwd knoppix
  • Enable networking by removing the block, rm /etc/hosts.deny, rm /etc/hosts.allow
  • Check the IP of the machine with ifconfig. If you don’t have a DHCP server on your network, you need to set an IP manually.
  • Start SSH server with /etc/init.d/ssh start
  • Enable FTP by restarting inetd: /etc/init.d/inetd restart
  • Share the windows drives by creating a dir (for example /windows) and putting soft links in that dir to /mnt/hda1, /mnt/hda2 etc
  • Then use the trick from my previous weblog post to share the dir through samba without passwords.
  • Start VNC server by installing it with apt-get install vncserver and starting it with vncserver -geometry 1024x768

Some hints:

  • If you started Knoppix without a mouse, you can open the KDE menu with ALT-F1.
  • I’ve found that the fastest way to backup files from a damaged HD is with rsync.
    Most tips come from the great Knoppix wiki.
  • Playing MP3:s on a remote computer (not streaming)

    Friday, June 17th, 2005

    This is old news for me, but I realized that it might be helpful for other people so I decided to write something about it anyway…

    I really like my MythTV system, but using it to play MP3s is quite a mess. Turn on the TV, find the remote, navigate through the MP3 collection one letter at a time and then add the songs… I realized I really needed a simpler way to control the audio player…

    After some searching, I discovered Music Player Daemon. The server end (the daemon) only handles the library and the actual playing of files, the cool part is that there are quite a few clients for it. A WinAmp-like Windows frontend, a command line (console) based clients, graphical clients for Linux and (what I finally settled for) a web interface written in PHP.

    Since there’s always a computer on somewhere in my apartment (actually, it’s more like 3 or 4) it only takes a few seconds to browse to the album I want to hear and queue it. The only manual action required is to turn on the amplifier, so my next step is logical: find a way for the MPD server to turn on the amp.

    Perhaps through an IR blaster, or through the Sony S-link interface.

    On a side note: I’ve used a number of different solutions for streaming MP3s from my collection at home to work and other places…

  • Andromeda – PHP-based jukebox with a nice interface, unfortunately it’s crippled shareware.
  • Apache mod_musicindex – an Apache module that makes it really simple to play songs, but the interface is ugly and directory-based.

    Yet to be tested:

  • Edna – simple Python script that serves MP3 with dynamic playlists.
  • Samba-sharing a folder without passwords on Knoppix

    Wednesday, June 15th, 2005

    When trying to access a crashed laptop 2.5″ hard drive, I found myself a bit stuck when trying to share the entire drive on a Windows network. Accessing Windows shares from a linux box is really easy with Samba, but sharing a directory without any passwords was a bit more difficult…

    Knoppix found the USB disk without any problems, but sharing the drive required a few more steps.

    Finally I found a page with some helpful tips:

  • Edit the /etc/samba/smb.conf file
  • Replace “security=user” with “security=share”
  • Add something like this to the file:
    [sharename]
    public=yes
    writeable=no
    path=/mnt/uba1
    guest ok=yes
    browsable=yes

    Then a quick /etc/init.d/samba restart did it.

  • Cloning Windows XP installs with Norton Ghost

    Sunday, June 5th, 2005

    My employer recently bought a number of used PC:s, which all required Windows XP installs. The machines weren’t very fast (about 866 MHz/384 MB RAM on an average), and I didn’t really feel like spending 1.5 hrs x 10 machines on installing XP, and then running Windows Update, installing virus scanner, spyware detection, printers, FireFox and adjusting settings.

    Thus, I decided to use Ghost… The first approach was to create a disk image file of the “master” PC and using it on the other PC:s, but accessing the file (located on an external USB hard drive) proved to be difficult.

    The second option was to use the “peer-to-peer” mode, meaning the master computer rebooted into DOS/Ghost mode while the slave (target) computer booted from a “peer-to-peer network boot floppy” which Norton created for me. Both computers got IP adresses through DHCP, and all that remained was to connect them and start the copying.

    I was quite surprised by the speed, a ~1.5 GB XP install took only 7 minutes on a 100 MBit network – pretty fast considering the relatively slow hardware!

    All that remained when the transfer was done was to reboot, adjust the computer & user name and uninstall Ghost (since it was installed on the master computer, all slaves got it too – pretty silly but unavoidable). Voilá!

    Saving and burning RealAudio streams

    Sunday, June 5th, 2005

    When I discovered that Slayer (one of my favourite metal bands) would be featured on P3 Live, I decided to record that show… Sveriges Radio uses Windows Media and Real for their streams, and after some searching I found the excellent (free!) program Net Transport that would help me to save the stream to disk. The result was a ~40 MB large .rm file that I needed to convert to wav to be able to burn it (and/or convert it into MP3).

    Someone on a mailinglist suggested I’d use DB Power Amp which, with the help from RealAlternative quickly turned the .ra file into a huge wav.

    Using Sound Forge, I set so called “markers” in the file, named them into the song names, then turned them into regions and then saved all regions as separate files. I was pretty surprised to see that the Nero wave editor could read the Sound Forge marks directly, which meant I could burn the large WAV file instead of using the splitted WAV files. With the “no gaps between tracks” option enabled, the resulting disc sounded perfect!

    Edit:
    It’s now one month later, and I’ve almost forgotten the details on how to do this… Net Transport needs a rtsp link, and those are a bit tricky to extract. I did discover that selecting “File”->”Clip properties”->”View clip info” in the Real Player displayed the RTSP URL.