Burning Gapless CDs from mp3 in Linux

11 June 2009 at 4:36 pm | In Linux | Leave a Comment
Tags: , , , , , ,

Adapted from the archlinux wiki page.

This is a guide for burning gapless audio CDs from mp3s using Linux.

First, make sure you have lame and cdrdao installed. Both packages should be included in your distro’s repositories. In Ubuntu, you can install them with:

sudo apt-get install lame cdrdao

Now, copy and paste the following script into a text editor, and give it a meaningful name, such as “burngapless”:

#!/bin/bash
if [ -d wav ]
then
  echo "wav folder already exists; using existing wavs."
else
  echo "Decoding mp3s..."
  mkdir wav
  for file in *.mp3 ; do
    lame --decode -S "$file" "wav/$file.wav"
  done
  echo "Done."
fi
echo "Creating table of contents..."
cd wav
{
  echo "CD_DA"
  for file in *.wav ; do
    echo "TRACK AUDIO"
    echo "FILE \"$file\" 0"
  done
} > toc
echo "Done."
echo "Burning CD..."
cdrdao write --eject -n -v 0 toc
if [ $? ]
then
  echo "Error burning CD. Try running the script again."
  exit 1
else
  echo "Done."
  cd ..
  echo "Deleting temporary files..."
  rm -r wav
  echo "Done."
fi
exit 0

Make the script executable, and move to a location in the path:

chmod a+x burngapless
sudo mv burngapless /usr/bin

Usage

cd to the directory where your mp3s are located and run the script:

cd ~/Music/mp3/As\ I\ Lay\ Dying/Shadows\ Are\ Security/
burngapless

Tweaks & Shortcomings

  • For more detailed progress information, remove the “-S” flag from the lame command, and remove the “-v 0″ flag from the cdrdao command. If you don’t want to eject the CD after burning, remove the “–eject” flag from the cdrdao command.
  • If there is no writeable CD in the drive when the script reaches the cdrdao command, it will output “WARNING: Unit not ready, still trying…” for a while before giving up. If you insert a CD right away, it should go through with the burn process. Otherwise, just run the script again (after inserting a CD) and it will resume at the burning phase.
  • If you have multiple CD drives, you may need to specify the correct drive to cdrdao using the “–device” flag. For more info, see the cdrdao man page.
  • Note: if the burn is unsuccessful, the wav files will be left intact in case you want to try burning the CD again. If you don’t want to try burning again, you must manually remove the wav folder.

Kanagen 0.0.2: Japanese kana generator for Mac, Linux, and Windows

12 January 2009 at 2:56 pm | In Japanese, Kanagen, Linux, Mac OS X, Python | 6 Comments
Tags: , , , , , , , , , , ,

Kanagen 0.0.2 is now out and works under Mac OS X 10.5 (Leopard), many Linux/BSD variants, as well as Windows XP/Vista. Simply download the ZIP file below and follow the instructions in the README.txt to get started! If you are unfamiliar with Kanagen, its a program I wrote to help study Japanese characters. It generates random strings of hiragana, katakana, and romaji so that you can learn the syllabaries and also practice writing characters.

Mirror 1: http://www.mediafire.com/download.php?yyx4gncmwjw

Mirror 2: http://www.filefactory.com/file/a019agh/n/kanagen-0_0_2_zip

Changelog:

  • Cleaned up code so its easier to read and maintain
  • English-localized strings separated into a new module for easier localization
  • Clear screen routine now works on Windows (not much else works in Windows, though)

How to view Japanese characters on the Linux virtual terminal

11 January 2009 at 11:26 pm | In Japanese, Linux, Ubuntu | 1 Comment
Tags: , , , , , ,

Although it’s no problem to view Japanese/Unicode characters on an X11 console like xterm or Konsole, it can be difficult to view them in the Linux virtual terminal. That’s where JFBTERM comes into view. It provides Japanese and other special character output using the framebuffer.

Ubuntu provides a prebuilt package in the repositories; to install it execute

sudo apt-get install jfbterm

It is also helpful to install a good font for it to use:

sudo apt-get install unifont

Now, provided that you have a working framebuffer, you can start it by running jfbterm.

If you receive an error about /dev/fb0 not present, you need to enable a framebuffer. In Ubuntu, modify the current kernel line in /boot/grub/menu.lst to include vesafb. For example, my section in menu.lst reads something like:

title Ubuntu 8.10, kernel 2.6.27-9
kernel /boot/vmlinuz-2.6.27-9 root=/dev/hda1 ro vesafb:mtrr,ywrap vga=0x318
initrd /boot/initrd.img-2.6.27-9
quiet

After making the modification, reboot the system and try running jfbterm again.

Once you have jfbterm running, you can run commands like usual, and now should be able to see Japanese characters properly.

Kanagen GUI Mockup

11 January 2009 at 12:37 am | In Japanese, Kanagen, Linux, Python | Leave a Comment
Tags: , , , , , , , ,

Kanagen GUIMockup created with Glade for Kanagen GUI. Stay tuned for the actual program, coming to you sometime in 2009!

Kanagen: Japanese kana generator written in Python

10 January 2009 at 5:54 pm | In Japanese, Kanagen, Linux, Python | Leave a Comment
Tags: , , , , , , , , ,
Kanagen 0.0.1 in action in Katakana to Romaji mode, with vertical text columns too!

Kanagen 0.0.1 in action in Katakana to Romaji mode, with vertical text columns too!

Update: Kanagen 0.0.2 is now out! Please use it and let me know what you think.

Today I finished the first revision (0.0.1) of my program Kanagen. Kanagen is a learning tool to help students learn the Japanese syllabaries. It functions by generating random strings of hiragana or katakana characters, which must be translated into romaji, or vice versa (romaji to kana characters).

It features selectable string length, character selection (so you can choose which part of the alphabet to practice), and the ability to print the text in horizontal rows (like most Japanese websites) or in vertical columns (like Japanese books and newspapers).

Currently it features a text-only interface with menus, but if there is enough interest I would be happy to make a graphical version. I would also like to add additional features such as reading in the user’s input of the romaji transliteration, and perhaps even handwriting recognition so that it would be possible to detect kana drawn with the mouse or a tablet.

I wrote it in Python, and tested it only on Linux. It should work as long as you have a relatively recent version of Python and have Japanese character support installed. To use it, download the two files from one of the mirrors below and run it using python kanagen.py

Please let me know what you think! I appreciate any comments, suggestions, and criticism. I’m sure that there is a lot of room for improvement, since this is after all my first full program written in Python!

Note for Linux console users: If you wish to run this program on the virtual terminal (Alt-F1, Alt-F2, etc.) you must use a program like jfbterm for the Japanese characters to display successfully. Check out my guide to setting up Japanese character support on the console for more information.

Download Links:

Please use Kanagen 0.0.2 instead!

How to Boot Ubuntu 8.10/9.04 Live CD from a USB Drive (Non-persistent)

3 January 2009 at 4:53 pm | In Linux, Ubuntu | 2 Comments
Tags: , , , , , , , , ,

Note: the following instructions are for booting the Ubuntu or Kubuntu Live CD from a USB drive. For instructions on how to boot the alternate installer from a USB drive, please read my post here.

Here’s how you can run the Ubuntu 8.10/9.04 Live CD without burning it to a CD. This is great if you have a computer with a broken CD-ROM, or if you don’t want to waste a good CD-R. Follow the simple steps below and you shouldn’t have any problems. I’ve tested this with Ubuntu 8.10 and 9.04, as well as gNewSense 2.2.

1. Grab the Ubuntu or Kubuntu Live CD image.

2. Format the USB drive to FAT16:

Windows: Open My Computer, right-click on the USB drive, and click Format. Under File System, choose FAT. Then click Start.

Linux: Open a terminal and type:

sudo mkdosfs -F 16 /dev/sdc1

(where /dev/sdc1 is the device node of your USB drive).

3. Install syslinux to make the drive bootable:

Windows: Download the latest version of syslinux here (at the bottom), unzip it somewhere like C:\SYSLINUX. Then open a command prompt (Start->Run->cmd), and type:

cd C:\SYSLINUX\win32

syslinux -s -m F:

(where F: is your USB drive letter).

Linux: Install syslinux from your distro’s repositories, then open a terminal and type:

sudo syslinux /dev/sdc1

Note: If you have trouble later when you try to boot the USB drive, try this step again using syslinux -s /dev/sdc1.

3. (Linux users only) Mount the USB drive. For example,

sudo mkdir /media/flash

sudo mount /dev/sdc1 /media/flash

4. Extract the contents of the ISO image downloaded in step 1 to the USB drive:

Windows: Use a tool such as 7zip to extract the ISO to a folder on your hard drive, such as C:\UBUNTU. Then open a command prompt and type the following:

xcopy /e /h /k C:\UBUNTU\*.* F:

Linux: Open a terminal and type the following (assuming you downloaded the Ubuntu 9.04 ISO to your home directory):

cd
sudo mkdir /media/ubuntu
sudo mount -o loop ubuntu-9.04-desktop-i386.iso /media/ubuntu
sudo cp -aT /media/ubuntu /media/flash

5. Rename the isolinux directory to syslinux, and rename the isolinux.cfg file (which is inside the isolinux directory) to syslinux.cfg:

Windows: Open My Computer, double-click on the USB drive, and rename the folder isolinux to syslinux. Then double-click on the syslinux folder and rename the file isolinux.cfg to syslinux.cfg.

Linux: Open a terminal and type:

cd /media/flash

sudo mv isolinux syslinux

cd syslinux

sudo mv isolinux.cfg syslinux.cfg

6. Boot from the USB drive and use Ubuntu! If at this step you encounter any difficulties booting from the USB drive, try installing a new Master Boot Record (MBR):

Windows: I don’t know of an easy way to install a new mbr in Windows. I believe syslinux includes an mbr which might be usable for this purpose. If anyone knows how, please let me know!

Linux: Install the mbr package from your distro’s repositories, then open a terminal and type:

install-mbr /dev/sdc

where /dev/sdc is your USB drive’s device node.

Now try booting from the USB drive again. If you encounter the prompt MBR FA:, then type A and then 1. This will boot from the first partition of the USB drive.

Acer Aspire 6930 Laptop In Depth Review

31 December 2008 at 11:01 pm | In Laptop, Linux, Review, Ubuntu | 96 Comments
Tags: , , , , , , ,

The Acer Aspire 6930 laptop belongs to Acer’s “home entertainment” line, a group of laptops that sport glossy widescreen displays, dual-core processors, and additional multimedia features designed with entertainment in mind. The 6930 series laptops are based on the Intel GM45 chipset and feature the following base specifications (you can also view them at the manufacturer’s website):

  • Intel Core 2 Duo processors with Intel Centrino 2 technology
  • 3 or 4  GB of DDR2 RAM @ 667 MHz
  • 250 or 320 GB SATA hard drives
  • DVD-RW DL optical drives (optional Bluray disc drive)
  • 16.0″ glossy WXGA LCD with 16:9 aspect ratio
  • Intel GMA 4500 graphics (NVIDIA graphics available on some models)
  • Intel Wireless 802.11a/b/g/n, gigabit ethernet, 56k modem (optional Bluetooth 2.0+EDR)
  • Integrated webcam, stereo microphones, subwoofer, and surround output

The model I review here is the AS6930-6082, which includes a T5800 processor (two 2.0 GHz cores, 2 MB L2 cache per core), 4 GB RAM, a 250 GB hard drive, and comes loaded with Windows Vista Home Premium (64-bit edition). However, as I point out below, this laptop is very well-suited to running Linux, which I installed not too long after purchase.

First Impressions

Weighing in at 7.5 lbs and measuring 1.7″ thick, the Aspire 6930 certainly doesn’t come across as a lightweight. My first impression was of just how heavy and large this laptop is. Compared with my 12″ Powerbook, it was like carrying several large textbooks around.

In the box with the laptop were a 6-cell battery, AC adapter, and manuals. No recovery CDs were included, but software to make the discs was included.

Hardware Features and Build Quality

The screen is very glossy (which means that it shows dust and fingerprints quite easily). The palmrest/touchpad area has a very nice textured surface. Glossy plastic surrounds the keyboard area. Above the keyboard are the power button, speakers, and media control strip.

The screen is very glossy (which means that it shows dust and fingerprints quite easily). The palmrest/touchpad area has a very nice textured surface. Glossy plastic surrounds the keyboard area. Above the keyboard are the power button, speakers, and media control strip.

Unlike many of its competitors, Acer has opted for slightly less gloss on the cases of their laptops. The palmrest has a semi-rough texture that I found much nicer than the smooth plastic on other laptops. The touchpad is slightly lower than the palmrest area, but has the same texture. The scroll area is separated from the main touchpad by a ridge of plastic. In practice, I liked this setup; it seemed more intuitive than having the scroll bar integrated with the main trackpad area. Above the palmrest and around the keyboard is a small strip of glossy black plastic. Above the keyboard is an area of plastic mesh covering the speakers. Above that is a cylinder which the display hinges on, and which also houses the TUBA subwoofer.

Around the display is more glossy plastic. Above the display are the microphones and webcam. The back of the display (or lid) is made of a very dark-blue glossy plastic that also showcases a lighted Acer logo. In most lighting situations, the lid appears to be black; however, if you apply a bright light you’ll see that it is really a sparkly blue. Unfortunately, this surface tends to collect scratches and fingerprints very easily. If you’re really worried about the appearance of the laptop, you can use a soft cloth to buff out any of the smudges that appear on the lid.

One of the great features of the laptop is the array of ports included:

DC in, gigabit ethernet, expansion port, VGA out, HDMI out, E-SATA port, USB 2.0 port, audio inputs & outputs

From left to right: DC in, gigabit ethernet, expansion port, VGA, HDMI, E-SATA, USB 2.0, audio inputs & outputs, ExpressCard 54 (above audio ports)

USB 2.0, DVD-RW drive, modem, Kensington lock

From left to right: USB 2.0, DVD-RW drive, modem, Kensington lock

One port that is missing is an S-Video port; this has been ousted in favor of the HDMI output. Also, on my model the E-SATA port is not present (it is covered by a plastic blank).

The keyboard features a full-sized layout including a numerical keypad. Unfortunately, the keys are very spongy and shallow.

The keyboard features a full-sized layout including a numerical keypad. Unfortunately, the keyboard has a lot of flex and the stroke depth is shallow.

The keyboard is full sized, and includes a numerical keypad. The keys are glossy, and like all glossy surfaces show dirt and smudges all the more. Also, the keyboard has a significant amount of flex to it and a rather shallow stroke depth. I found that while I was able to type on the keyboard without any problems, I wouldn’t want to type for hours on it. If you spend most of your time typing, you may want to attach an external keyboard (or buy a different laptop).

The 16″ “CineCrystal” glossy display has a native resolution of 1366×768 (WXGA) and a 16:9 aspect ratio, which makes it great for viewing DVDs full-screen. For HD buffs, the resolution may be a disappointment since 1080p content will be scaled down. However, I feel that the resolution is more than enough for most people. Colors are vibrant, and text is crisp and very readable. The horizontal viewing range is excellent, allowing nearly 180 degrees of visibility without much color shift. The vertical viewing range, on the other hand, is only average, allowing about 45 degrees of movement up or down before the colors begin to invert. Also, the range of the hinges is a bit lacking—meaning you won’t be able to tilt the screen back very far.

Other than the keyboard, the build quality seems good. The display is stiff, and doesn’t flex easily. The main body of the laptop, although plastic, is firm and feels very sturdy. As far as the hardware components, they are mostly industry-standard and high quality. Since most modern laptops are made with the same components, I think that this laptop will be as reliable as most other laptops on the market today.

Entertainment Features

As I noted before, the Aspire 6930 is designed mostly for home entertainment. Several features included with it are oriented towards this purpose: the display, media control buttons, audio system, graphics system, I/O ports, as well as the bundled software. The options to add a Bluray drive and a TV tuner also make this an appealing laptop for home theater enthusiasts.

Display

The display has a 16:9 aspect ratio, allowing full-screen DVD playback without any letterboxing (black bars above and below the image). The high-end models feature a 1920×1080 resolution, giving a full HD 1080p video playback.

Media Control Buttons

The media control buttons give access to volume control, skip, pause/play, and stop. The buttons are capacitive, and glow blue when the laptop is on. To the right of the media control buttons are four buttons that perform programmable actions. By default, they function as wireless on/off, launch Internet, launch Bluetooth manager, and launch Acer Arcade. Also, in the top right corner is a button which turns virtual surround sound on or off.

Audio System

The audio system features two stereo speakers as well as a “Tuba CineBass” woofer. In reality, this is little more than a low to mid-range speaker that adds a small amount of bass. However, I would say that the speakers on this laptop aren’t bad and have more bass and overall volume than any other laptop speakers I’ve heard so far.

For I/O there are three 1/8″ minijack ports available. The black port doubles as stereo output or optical SPDIF output, while the other two are the line and microphone inputs.

Dolby Home Theater certification supposedly “deliver[s] the best possible listening experience.” Functionally, it allows the user to choose from a few simulated surround sound settings and a bass booster. In other words, it doesn’t do much, other than giving you a fancy logo above the speakers.

Technically speaking, the audio system is powered by an  Intel ICH9/HD audio controller, which boasts 192kHz/32-bit quality and native multi-channel output.

Webcam

Built into the casing above the LCD is a small “Crystal Eye” webcam and microphone. The webcam is capable of 640×480 resolution at best. During my testing, I found the image from the webcam to be average. Colors were off, especially under fluorescent lighting, and the image was a bit pixelated or fuzzy. It is certainly good enough to use as a webcam, but isn’t good for much else. The same could also be said about the microphone—it’s decent enough to use for voice chat, but I wouldn’t use it for anything else.

Graphics System

The graphics system for the low-end 6930s is the integrated Intel Graphics Media Accelerator (GMA) 4500MHD. The GMA 4500MHD provides native support for DirectX 10, Bluray, Windows Aero, and hardware decoding of HD video streams. For the end-user, this means that it is possible to run Windows Vista with all of the fancy graphics enabled. It also means that HD is fully supported, especially in combination with the built-in HDMI port. However, it doesn’t mean that the latest games will run. The GMA 4500MHD is very underpowered when it comes to video game graphics. I would be surprised if even Half-Life 2 ran smoothly enough to play on it. In my limited testing, a few older games ran without a hitch. For example, I was able to play Need for Speed: Hot Pursuit 2 with the graphics maxed out without any trouble.

On the higher-end 6930s, dedicated graphics are available. Any serious gamer would definitely want to spring for the more expensive options, which offer NVIDIA GeForce 9300M or 9600M graphics with 256 or 512 MB of dedicated RAM. With the 9600M it should be possible to play most new games at reasonable settings; however, this laptop really isn’t designed specifically for gaming so another laptop might be a better choice.

One feature of the graphics system that is particularly geared towards home theater use is the HDMI port. This makes it possible to connect the laptop directly to any TV that has an HDMI input, providing digital video and audio transfer. This is ideal if you want to watch DVDs or Bluray discs on your TV using your laptop.

Bundled Software

All of the 6930s come bundled with either Windows Vista Ultimate or Home Premium, which includes Media Center. Also bundled is Acer Arcade, which is based on Cyberlink’s PowerCinema. Whichever software you use, you can use the laptop as a media center to watch movies, listen to music, and record TV (with the optional TV tuner). It’s pretty clear that Acer is aiming to attract the home theater crowd with this laptop.

Battery Life

Under a normal load (browsing the web, listening to music, word processing, etc.) the battery lasts about 2 hours on average. With a minimal load (editing some text) and the display set at minimum brightness, it’s possible to get about 2 hours and 15 minutes of life. And with a full load (ripping CDs, playing video games, etc.) I wouldn’t expect the battery to last much longer than 1 hour and 30 minutes.

Performance

So how does the laptop perform? While I didn’t carry out any comprehensive benchmarks, I have to say that performance is very snappy. Even running Windows Vista Home Premium with all of the included bloatware, response times were fast and application launch times short. With a system like this, even Vista performs decently enough.

However, I knew that running Vista would be a terrible waste of this laptop’s power. Sure, for most people Vista will be adequate. But I like to know that I’m putting my hardware to good use, so that I have power to spare. Frankly, Vista tends to grab as many resources as it can. For example, after a regular bootup it would already be consuming about 1 GB or more of RAM. And the default installation occupied about 10 GB of the hard drive. Also, I noticed that the hard drive was constantly being accessed, even after I disabled indexing, SuperFetch, and half of the other unneccessary services that were running. It was time to install Linux to see what this laptop was really capable of.

Installing Linux (Ubuntu 8.10)

I chose to install Ubuntu 8.10 (64-bit) on my laptop, mostly because I’ve used Ubuntu in the past with good results. Installation from the Live CD proceeded as smoothly as could be possible. Almost all of the hardware was supported out of the box, including the graphics, audio, wireless networking, and webcam (with some minor issues described below). Standby and hibernate functioned correctly, and special keys such as volume, display brightness, and the media control buttons worked properly. In short, I didn’t have to do any manual configuration to get things working! This was a first for me. Every other time that I installed Ubuntu on a computer, I always seemed to run into something which required some adjustment to work. This time I didn’t have to do anything. I was even able to connect to a WPA2-protected network without so much as editing a configuration file. Desktop effects also worked out of the box, although I prefer to disable them to maximize performance.

Thanks to Adobe, a 64-bit version of Flash now exists for Linux; I found that full-screen Flash videos from Hulu.com and elsewhere played very smoothly. Although I’m not much of a gamer, I tried out a few racing games including TORCS and found that they ran fine.

I also tested Virtual Box to see how well virtualization would perform on this system. After installing Windows XP, I was pleasantly surprised to see that it ran almost as fast as it would natively. In the past I have found virtualization to be painfully slow for most purposes. Now that I’ve seen how fast it can work, I plan to use it for software testing.

What Didn’t Work

The built-in microphone didn’t work, although I tried several configurations. I’ve heard reports of others with the same problem, especially in Ubuntu, so I’m crossing my fingers in hopes that this will get fixed. Also, the webcam defaulted to the lower resolution of 320×240, and there was no obvious way to switch it back to the higher resolution. There may be a way to do this, so I plan on doing some research and posting my results here.

Conclusion

The Acer Aspire 6930 is a great laptop for running Linux, due to its great hardware compatibility.

The Acer Aspire 6930 is a great laptop for running Linux, due to its excellent hardware compatibility.

The Acer Aspire 6930 is a great laptop in most respects. I’ve been very happy with the quality, features, and performance that it has. I’d especially recommend it to people looking for a good Linux laptop that doesn’t require any complicated setup.

It would also be great as a media center, as a desktop replacement, or as a general purpose laptop. I wouldn’t recommend using it as a school laptop, because of its weight and size.

  • Quality: 4.5/5
  • Features: 5/5
  • Battery life: 3.5/5
  • Performance 5/5
  • Portability: 2.5/5

Overall rating: 4/5

Update (11 February 2009):

I’ve written up a guide to installing Windows XP on the Acer Aspire 6930 for those that are interested.

Verifying CDs and DVDs with md5sum

27 December 2008 at 3:48 pm | In Guides, Linux | Leave a Comment
Tags: , , , , ,

If you want to ensure the safety of your backups, it is critical to verify the data on a regular basis. With the advent of cheap CD-RW and DVD-RW drives, many people are now using CDs or DVDs as their primary backup medium. In this guide, I’ll show you how to verify the integrity of your CD or DVD backup set using a few simple command-line tools.

Verifying Individual Files

1. Checksum the original data using md5sum as follows. Open a terminal and navigate to the directory that contains the files you wish to backup:

cd ~/Documents/Pictures

Now we’ll md5sum all of the files in this directory and all subdirectories:

find * ! -type d -print0 | xargs -0 md5sum > md5sum.txt

There’s one problem with this command—it will checksum the output file (md5sum.txt). This causes a false checksum warning when you wish to verify the files. To remedy this, open md5sum.txt in a text editor and remove the line that refers to md5sum.txt. In the end, you should have a file that looks something like this:

9975c7ef5e33eb7b18a3b7a512a8d755 top100_080703/heic0702a.jpg
c0cdbfc6f4fa445f59af8de9fcc33951 planet_HD_209458b.png
38f50e2348c80fc2f125540e571c3f14 APOD/M42_hallasNr.jpg

2. Copy the files to CD or DVD. Make sure you also copy the md5sum.txt to the disc, so that you can use it to verify the backup later on. If you don’t copy the md5sum.txt file to the disc, keep it in a safe place and name it something like “checksum-backup-20081227-1.txt” so that you’ll remember which disc it corresponds with.

To verify the CD or DVD, open a terminal, navigate to your CD drive’s mounting point and mount the disc:

cd /media/cdrom
mount /media/cdrom

Now verify the contents with md5sum:

md5sum -c md5sum.txt

This will verify all of the files on the disc and output the results as follows:

top100_080703/heic0702a.jpg: OK
Transiting_planet_HD_209458b.png: OK
APOD/M42_hallasNr.jpg: OK

If at the end you don’t see anything else, that means all of your files were OK. Otherwise, you’ll get a message like this:

md5sum: WARNING: 5 of 134 computed checksums did NOT match

This means that some (5) of your files did not verify correctly and are probably corrupted. To narrow down the results to only the failed files, use the following:

md5sum -c md5sum.txt | grep -v 'OK$'

This will output all of the files that failed verification.

Verifying from an ISO File

If you have an ISO file that you’ve burned and you want to verify the disc, it’s very easy to do so.

1. Use isoinfo to find the block size and count of the ISO file (in our example it is called “name.iso”):

isoinfo -d -i name.iso

Look for these two lines, and write down the two values:

Logical block size is: 2048
Volume size is: 13656

2. Now find the md5sum of the disc (substitute /dev/dvd with the location of your CD drive):

dd if=/dev/dvd bs=block size from above count=volume size from above | md5sum

3. Finally compare the result with the md5sum of the ISO file:

md5sum name.iso

Make sure the result from step 3 matches the result of step 2. If they don’t match, that means your disc is either scratched, dirty, or corrupt.

Installing Ubuntu 8.10 Alternate with a USB Drive

27 December 2008 at 9:32 am | In Linux, Ubuntu | 7 Comments
Tags: , , , , , , , , , ,

Note: The following instructions are valid only for the alternate installer! Using a Live CD image won’t work. Please read my guide here for instructions on booting the Live CD from a USB drive.

Today I decided to install Ubuntu 8.10 with the alternate CD so that I could get a command-line system without all of the extra packages that are normally installed with Ubuntu. Unfortunately, my CD-ROM drive was not cooperating and was giving I/O errors when the installer was running, so I was forced to try installation using a flash drive. The directions in the Ubuntu community documentation were outdated and unclear on how to use the alternate image with a USB drive, so I was forced to improvise and thus discovered a great way to install Ubuntu without wasting a good CD-R.

For this method, you’ll need at least a 1GB USB drive and a high-speed internet connection.

1. Download the appropriate ISO image from the Ubuntu home page. I chose the 64-bit alternate image, which provided me with the text-based installer (much better than the graphical installer) and the ability to install a minimal command-line only system, as well as the ability to fully utilize my 64-bit processor (an Intel Core 2 Duo).

2. While this is downloading, you can start preparing the USB drive. I’d suggest formatting it to a fresh FAT16 partition.

Windows: This can be accomplished by right-clicking on the drive in My Computer, click on Format, choose FAT in the File System drop-down, and then click Start.

Linux: You can format the drive using sudo mkdosfs -F 16 /dev/sdc1 (substituting the proper device node of your drive for /dev/sdc1). FAT32 will probably work fine too, but I didn’t test it.

3. Windows: Download Syslinux (latest version at the bottom) and extract the archive somewhere like C:\SYSLINUX.

Linux: Install Syslinux from your distribution’s repositories, if it isn’t already installed.

4. Install SYSLINUX on your USB drive.

Windows: Open a command prompt (Start->Run->cmd) and navigate to C:\SYSLINUX\win32. Then type

syslinux -s -m F:

where F: is the path to your USB drive.

Linux: Open a terminal and type

sudo syslinux /dev/sdc1

where /dev/sdc1 is the location of your USB drive.

5. Download initrd.gz and vmlinuz from the Ubuntu archive (32-bit versions, 64-bit versions) and place both files in the root of your USB drive. Technical note: it is important to use the hd-media images because otherwise the installer won’t be able to find the ISO image later on.

6. Place the ISO image you downloaded earlier in the root directory of the USB drive. It doesn’t matter what it’s called as long as it ends in .iso.

7. Create a file named syslinux.cfg in the root of the flash drive and add the following lines to it (choose one of the three below):

Regular installation:

default vmlinuz

append initrd=initrd.gz

Command line system installation:

default vmlinuz

append initrd=initrd.gz file=/cdrom/preseed/cli.seed

LTSP server installation:

default vmlinuz

append initrd=initrd.gz file=/cdrom/preseed/ltsp.seed

Note: the /cdrom/ is not a typo!

8. Reboot your computer and make sure you choose to boot from the USB drive in the BIOS. The rest of the Ubuntu installation should proceed exactly as it would from a CD-ROM, with one exception: after the installation is finished, you need to do some configuring to add the USB drive as a source in apt.

9. Once the installation is complete, boot into your new system and open up a terminal. Copy the contents of the ISO image to your hard drive so that you don’t have to have your USB drive plugged in when you add packages. To do so, mount the USB drive and then mount the ISO image somewhere, and copy the files recursively to your hard drive:

sudo mkdir /media/flash
mkdir ~/ubuntu-cdrom
sudo mount /dev/sdc /media/flash
mount -o loop /media/flash/ubuntu-8.10-alternate-amd64.iso /cdrom
cp -r /cdrom/* ~/ubuntu-cdrom
umount /cdrom

Of course, you should substitute /dev/sdc with the location of your flash drive and ubuntu-8.10….iso with the name of your ISO image. You should end up with all of the files from the ISO image located under ~/ubuntu-cdrom or wherever you decided to put it.
Now edit the /etc/apt/sources.list file to include this location:

sudo nano /etc/apt/sources.list

and add at the bottom

deb file:/home/jesse/ubuntu-cdrom intrepid main restricted

where jesse is your user name. Finally, run

sudo apt-get update

to add the new source. You now should be able to install any of the packages that are on the CD with no problems.

Troubleshooting

If you’re having trouble getting the USB drive to boot, try installing a new Master Boot Record (MBR) on the drive using the instructions below.

Linux:

  1. Install the mbr package. On Ubuntu use sudo apt-get install mbr
  2. Run install-mbr to install a new MBR on the USB drive, where /dev/sdc is the path to the USB drive’s device node: sudo install-mbr /dev/sdc
  3. Reboot and choose the USB drive as the boot-up drive.
  4. If you see a prompt that says “MBR FA:” press A, then 1. This will boot from the first partition on the USB drive.
  5. Proceed from step 9 in the guide above.

Windows:

  1. Open a command prompt (Start->Run->cmd).
  2. Type the following, where F: is your USB drive, then press Enter: fdisk /mbr F:
  3. Reboot and choose the USB drive as the boot-up drive.
  4. Proceed from step 9 in the guide above.

Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.