Saturday, April 27, 2013

Create a Bootable USB on Xubuntu with unetbootin

To create a bootable Linux installation on a flash drive (using Xubuntu):

  • Insert the flash drive. After it mounts, use df to find the file system name (for example, /dev/sdd1).
  • Install unetbootin if you need to:

    $ sudo apt-get install unetbootin

  • Run unetbootin. *** Requires sudo access. Apparently this is a known issue with unetbootin.
  • I selected the "disk image" option because I'd already downloaded the ISO I wanted:
  • Press OK and it will expand the ISO onto the flash drive. *** Warning: This will delete everything on the drive.
  • Insert flash drive in target machine and boot away. You might have to go into the BIOS and select the USB drive as the bootable device, depending on the motherboard brand.

Update 10/6/2013:
If you want to get rid of the pesky ldlinux.sys off the flash drive that won't even let sudo delete it, do this:

$ sudo chattr -i ldlinux.sys

Then sudo rm ldlinux.sys. (Fix taken from here).

Update 19/10/2013:
If you have an Intel motherboard and boot from a USB drive and get the message "Boot error", it could be due to the BIOS settings. This forum post describes how to fix the problem, which worked on one of my old computers with an Intel motherboard.

Monday, April 22, 2013

Format Flash Drive for Big Files on Linux

By default, flash drives are formatted with the FAT32 file system. FAT32 has a file size limit of about 4.3GB.

To get around this, you can format with a file system that supports bigger files. I chose ext4 for this, you can use ext2, ext3, or others.

Who's a big boy today?


  • You probably won't be able to use the flash drive on Windows machines (maybe this is what you want?)
  • Performance of flash drives under different file systems can apparently vary markedly. I didn't have any issues with mine using ext4.

Here are the commands:

$ df

Use df to find out which device is your flash drive, in my case it was /dev/sdd1. (Make sure you get this right, so you don't blat your hard drive or something).

$ umount /dev/sdd1 $ sudo mkfs.ext4 -L "BigFileDrive" /dev/sdd1

After reformatting, the drive mounted with root as the owner, so I did:

$ sudo chown ash /media/ash/BigFileDrive $ chgrp ash /media/ash/BigFileDrive

And all was well.

Update 11 Sept 2013:

Trying to run this for NTFS (on kubuntu at least) can result in:

The program 'mkfs.ntfs' is currently not installed.
You can install it by typing:
sudo apt-get install ntfs-3g

But it says it's already installed. This is a known bug, a simple workaround is to just run mkntfs rather than mkfs.ntfs.

Sunday, April 21, 2013

Canon MG6250 Scanning on Xubuntu 12.10

The other day a friend of mine challenged me asked me if I'd got scanning going on the Canon MG6250.

I had never tried it, and some research showed other people were having some issues as well.

Here were the steps I took to get it going:

  • Install xsane (sudo apt-get install xsane)
  • The sane man pages refer to "backendname" a lot. The project's documentation gives the backend name for the 6250 as "pixma"
  • man sane-pixma (seems to be a man entry for each backend) tells you to that network scanners should normally be detected, but if not, add them directly to /etc/sane.d/pixma.conf
  • Edit that file and add a line of the format:
    IP address can be retrieved from the printer settings dialog, or from the options in the printer itself.
  • After adding an entry for the printer, save pixma.conf
  • If the sane daemon isn't running (some have reported that it is running, but I had to start it manually as per the next two steps):
    • Edit /etc/default/saned and set RUN=yes.
    • Then start the sane service: service saned start
  • Run xsane

Now xsane should discover the scanner, and instead of saying "no devices found" and dying, it should run up (brings up about 4 windows). All the default settings seem to work — just press "Scan".

Saturday, April 6, 2013

Logitech C270 Webcam in Linux

TL;DR: Logitech c270 works with Linux; guvcview good.

I bought a Logitech C270 webcam for my Dad, but thought I'd try it out first and see how it works with Linux.

First thing was to install cheese (as per the suggestion at ubuntu forums):

$ sudo apt-get install cheese

(This required a restart).

Then I ran cheese from the command-line -- webcam started up great! First thing I tried was to do a video capture...and got this:

Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started (cheese:2518): cheese-WARNING **: Jack server not found (cheese:2518): cheese-WARNING **: Could not initialize supporting library. Segmentation fault (core dumped)

So I tried to install jack and jackd, but this had no effect.

Then this bug suggested installing "gstreamer1.0-pulseaudio".

This worked. Had one core-dump after that, but mostly worked. Cheese complained about not being able to create thumbnails for the videos that were recorded, but I wasn't too concerned about that. By default, pictures go into ~/Pictures/Webcam, videos go in ~/Videos/Webcam.

Screen cap taken with cheese running

Videos recorded with cheese at 1280x960 and 960x720 looked awful. I don't know if this is a function of using webm or something else. Dialling down to 640x480 looked much better.

Only problem: the sound wasn't working.

Couldn't find a readily available solution, so I tried guvcview, after seeing it recommended in this askubuntu question.

$ sudo apt-get install guvcview

This looked like a neat little program. Had a lot more options than cheese. But still sound wouldn't work. Went through all the sound devices in the list. The device ID for the webcam (003 on my machine, as lsusb told me) wasn't in the list. Then I had this anti-brain fart where I recalled that some devices don't work so well in USB 3 ports, and I'd plugged the Webcam into the USB 3 on the front of the case.

640x480 screenshot taken with C270 and guvcview

Plugged it into a USB 2 in the back (restarted guvcview), and BAM! New audio device appears (a "USB Audio"). This worked just fine.

I had to give cheese another go, but still no sound. So I'm not sure what was going on there, but it felt like guvcview gave better control over the capture anyway.

(For the record, they are the Natural Confectionery Co. snakes).

Monday, April 1, 2013

Script to initialise Wacom Intuos 5

To round out the setup for my Wacom Intuos 5 tablet, this is the script I run to initialise it for left-handed use with an nVidia graphics card in Xubuntu 12.10:

#!/bin/bash if [ -x /usr/bin/xsetwacom ]; then xsetwacom set "Wacom Intuos5 M Pen stylus" Rotate half xsetwacom set "Wacom Intuos5 M Pen eraser" Rotate half xsetwacom set "Wacom Intuos5 M Pen cursor" Rotate half xsetwacom set "Wacom Intuos5 M Pen pad" Rotate half # HEAD-0, HEAD-1 identify screens when using nVidia graphics. # Use xrandr output for AMD, Intel, etc. xsetwacom set "Wacom Intuos5 M Pen stylus" MapToOutput HEAD-0 fi