First sale on eBay

It is not uncommon to have purchased something from eBay, I’ve had an account for several years and tend to buy something every couple of months.  Most of the items I buy on eBay are low cost and generally hard to find locally.  I’d often thought about selling stuff on eBay but just never got started.. until now.

What started this off was a sweep through some of the gadgets and whatnot that we’ve got cluttering up our home office.  This stuff has to go, and if it has value let’s sell it – otherwise its time to eCycle it.  I initially thought I’d start by selling some N64 games, but the game values (<$5) far outweigh the shipping costs.  So I figured I’d move onto the iPod that was no longer being loved ever since the iTouch arrived.

I used eBay to research what the going price was for an iPod in the condition mine was, and priced it on the lower end as a starting point.  I set a $10 USD flat rate for shipping since if I shipped to California it would be around $8 shipping + $2 for the bubble mailer.  Had someone in Vancouver bought it, I would have lost money on the flat rate shipping (about $4)!  Shipping is the first real hurdle you need to get over as a seller, and I think it is worse for Canadians (both as sellers, and buyers).

Lucky me, as a first time seller my first 5 listings are fee free!  Cool.  Of course, it took nearly 24hrs for my item to appear in any search results (trust me I tried).  No worries, it was a 7 day listing so lots of time for people to find it and bid.

Days passed.  I watched several broken iPod’s get more bidding activity and a higher price than my item.  I could see from the eBay dashboard that after 6 days, only 5 page views of my item had happened (2 which were mine!).  Then on the 6th day, the watchers arrived – 8 watchers tracking my item – there is hope.  The number of views rapidly climbed.

With less than 6 hours to go in the auction the bidding started.  My $30USD start price, jumped up rapidly.  17 bids later it sold for $76USD + $10USD shipping, the winning bid was made in the last minute of the auction from a bidder with no previous bids on my item.

After that it was smooth sailing.  Payment was via PayPal (who take a small percentage).  A quick trip to the post office and the iPod is on its way to the winner.  It has been an interesting experience, one I plan to repeat.

Mirrored Drives with Ubuntu

Mirrored drives are also known as a RAID 1 configuration.  It is important to note that running mirrored drives should not be used as a substitute for doing backups.  My motivation for running a RAID 1 is simply that with the drive densities today, I expect these drives to fail.  A terabyte unit is cheap enough that multiplying the cost by two isn’t a big deal, and it gives my data a better chance of surviving a hardware failure.

I purchased two identical drives several months apart – in the hopes of getting units from different batches. I even put them into use staggered by a few months as well.  The intent here was to try to avoid simultaneous failure of the drives due to similarities in manufacture date / usage.  In the end, the environment they are in is probably a bigger factor in leading to failure but what can you do?

Linux has reasonable software raid support.  There is a debate of the merits of software raid vs. hardware raid, as well as which level of raid is most useful.  I leave this as an exercise up to the reader.  The remainder of this posting will be the details of setting up a raid 1 on a live system.  I found two forum postings that talked about this process, the latter being most applicable.

We will start with the assumption that you do have the drive physically installed into your system.  The first step is to partition the disk.  I prefer using cfdisk, but fdisk will work too.  This is always a little scary, but if this is a brand new drive it should not have an existing partition table.  In my scenario I wanted to split the 1TB volume into two partitions, a 300Gb and a 700Gb.

Now let’s use fdisk to dump the results of our partitioning work:

$ sudo fdisk -l /dev/sdd

Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Device Boot         Start         End      Blocks   Id  System
/dev/sdd1               1       36473   292969341   83  Linux
/dev/sdd2           36474      121601   683790660   83  Linux

Next we need to install the RAID tools if you don’t have them already:

$ sudo apt-get install mdadm initramfs-tools

Now recall that we are doing this in a live system, I’ve already got another 1TB volume (/dev/sda) partitioned and full of data I want to keep. So we’re going to create the RAID array in a degraded state, this is the reason for the use of the ‘missing’ option. As I have two partitions I need to run the create command twice, once for each of them.

$ sudo mdadm --create --verbose /dev/md0 --level=mirror --raid-devices=2 missing /dev/sdd1
$ sudo mdadm --create --verbose /dev/md1 --level=mirror --raid-devices=2 missing /dev/sdd2

Now we can take a look at /proc/mdstat to see how things look:

$ cat /proc/mdstat
Personalities : [raid1]
md1 : active raid1 sdd2[1]
683790592 blocks [2/1] [_U]

md0 : active raid1 sdd1[1]
292969216 blocks [2/1] [_U]

unused devices: <none>

Now we format the new volumes. I’m using ext3 filesystems, feel free to choose your favorite.

$ sudo mkfs -t ext3 /dev/md0
$ sudo mkfs -t ext3 /dev/md1

Mount the newly formatted partitions and copy data to it from the existing drive. I used rsync to perform this as it is an easy way to maintain permissions, and as I’m working on a live system I can re-do the rsync later to grab any updated files before I do the actual switch over.

$ sudo mount /dev/md0 /mntpoint
$ sudo rsync -av /source/path /mntpoint

Once the data is moved, and you need to make the new copy of the data on the new degraded mirror volume the live one. Now unmount the original 1TB drive. Assuming things look ok on your system (no lost data) now we partition that drive we just unmounted (double and triple check the device names!) and format those new partitions.

All that is left to do is add the new volume(s) to the array:

$ sudo mdadm /dev/md0 --add /dev/sda1
$ sudo mdadm /dev/md1 --add /dev/sda2

Again we can check /proc/mdstat to see the status of the array. Or use the watch command on the same file to monitor the progress.

$ cat /proc/mdstat
Personalities : [raid1]
md1 : active raid1 sdd2[1]
683790592 blocks [2/1] [_U]

md0 : active raid1 sda1[2] sdd1[1]
292969216 blocks [2/1] [_U]
[>....................] recovery = 0.6% (1829440/292969216) finish=74.2min speed=65337K/sec

unused devices: <none>

That’s all there is to it.  Things get a bit more complex if you are working on your root volume, but in my case I was simply mirroring one of my data volumes.

BitPim and the Samsung M300

Jenn has a pay-as-you-go cell phone, while its a relatively inexpensive phone (Samsung M300) it has reasonable battery life, and its small.  One of the unexpectedly useful features was a camera, sure its not able to take very nice photos but sometimes your phone is the only camera you have handy “in the moment” (like when the kids go on a mud-puddle adventure).

Unfortunately with the pay-as-you-go plan, there wasn’t any way to get the pictures off the camera.  No data service meant you couldn’t email them from the phone, and the phones bluetooth connectivity seems to be limited to headset profiles.  The data cable was cheap enough on eBay so I thought I’d take a risk and see what could be done with one.

Once I had the cable, it was time to find some software.  BitPim seemed to be the right choice for me (free, and available on Linux).  The Ubuntu repositories have a version that works [sudo apt-get install bitpim].

You’ll want to run it as root, or mess with the /dev entries for USB to grant your user enough rights to access the phone.  The BitPim software handles the capabilities of the M300 in two ways, treating the one phone as effectively two devices.  The first is the “media” version, this allowed me to copy down the pictures from the phone.  The PIM version needed a bit more fiddling as it wasn’t actually detected properly.  I did manage to get it to download the contents of the phonebook from the phone.

Now it turns out that the Bell Mobility firmware for this phone seems to be different enough from the US version that BitPim simply won’t work for writing to the phonebook.  Someone else ran into exactly the same problem as I did. Of course, this was after I managed to delete all 60 phonebook entries that were already stored in the phone. Oops.  I think Jenn has now forgiven me.

I’ll reference the excellent HowardForums for all your cellular information needs. And a pointer to a Samsung page which provides a data access utility (that sadly still fails with the firmware I have).