Sucsessful upgrade from Debian 5 (lenny) to 6 (squeeze) and extending LVM volume with new Hard disk.

Well, last night I bravely attempted an upgrade of Debian lenny to squeeze which I would like to report overall was a breeze.

I won’t be posting a guide but I would like to point any readers attempting the same to a very useful blog post which helped me though the process.

Following the steps detailed here was a greate help.

I have to state that apart from a few packages installed from source that my Debian install wasn’t too far from the original, with the only external repository added to my source list being the tor repository located here, (deb http://deb.torproject.org/torproject.org lenny main), which for the purpose of the upgrade I comented out.

I don’t run debian natively, instead preferinmg to run it inside vmware on top of OS X with SSH and Xforwarding enabled to integrate the two nicely although I pretty much always have both running. I only have to sully myself with Windows while at work now thankfully.

Despite for the main part the upgrade going smoothly  I did run out of space on my root partition before the ‘apt-get dist upgrade’ stage.  Luckily apt flaged this before downloading the packages and due to VMware and LVM the proccess of adding extra space was not taxing.

I simply added a new SCSI drive from the VMWare settings, rebooted Debian to make sure it was seen, although I beleive even this step may have been unecisary due to the nature of SCSI in Linux.

Once rebooted I ssh’d back on to the machine, ran ‘su’ to give me root privileges and did the following;

Please note you could potentially loose all your data performing an operation like this. Always make sure to back up before doing something like this. I cannot guarantee that this will work. Despite having been successful for me any major alteration to your disk or partitions could have catastrophic effects.

debian:/# cfdisk /dev/sdc

(replace sdc with the appropriate name of your new disk, create a partition of type ‘Linux’ with the size you wish. In my case I used the entire disk )

debian:/# lvmdiskscan

(to check that lvm2 is seeing the disk and partition)

debian:/# pvcreate /dev/sdc1

(to add the partition to LVM)

debian:/# vgextend debnet /dev/sdc1

(debnet being the name of my LVM VG. Replace this with the correct name for your setup)

debian:/# lvm lvextend -l +100%FREE /dev/debnet/root (extend the LVM partition called ‘root’ to use 100% of free space)

debian:/# resize2fs -p /dev/mapper/debnet-root

(resize my ext3 partion contained in ‘debian-root’ to use the extra space)

That’s it. My root partition had now been extended to use the extra hard disk. LVM saves the day again and potentially this could have all been done without a reboot.

At this point I continued with the install and am now happily running Squeeze.

Installing exFat on Debian based distros

[Edited to update the download link – Aug 2012]

[Edit –  Included info on making .deb – Aug 2012]

ExFat, otherwise known as FAT64 is a new filesystem introduced by Microsoft with Windows Vista SP1.

The reasoning behind the new filesystem was to address an area in which Microsoft’s previous filesystems where not a neat fit, i.e. on large external flash drives where NTFS is not appropriate but FAT32 is not sufficient.

exFAT has a theoretical maximum disk size of 64 ZiB, 2,796,202 files per subdirectory and many other improvements.

Many modern SDXC cards are now coming formated with exFat and it was from one of these which I wanted to access from my Debian machine.

Linux support for exFAT is still very much experimental and Debian has no pre-made binary package yet although I didn’t have much trouble in compiling from source and installing.

As always when compiling from source you will need to have the GNU C compiler and associated tools installed.

If not already present you can do this as follows;

debian:/#su

debian:/#apt-get install build-esential libfuse-dev

Instead of the normal ‘make’ build system exFAT uses ‘Scons‘ so you may need to install this to.

debian:/#apt-get install scons

Once installed you can now download the exFAT source code from http://code.google.com/p/exfat/downloads/list

(Direct link to file as of writing, fuse-exfat-0.9.8.tar.gz)

Extract the tarball by typing;

debian:/#tar -xvf ./fuse-exfat-0.9.8.tar.gz

Navigate in to the directory containing the expanded files and run the following command to compile the source code and create a folder for the mount point. (You’ll need to have appropriate access permission to install, i.e. root )

debian:/#scons install

debian:/#sudo apt-get install checkinstall

debian:/#sudo checkinstall scons install

this will create a .deb file which can be installed and deleted with your package manager.

debian:/#sudo dpkg -i nameofpackage.deb

debian:/#mkidr /mnt/exfat

Now that exFAT is installed you can mount your external disk as follows;

debian:/#mount.exfat-fuse /dev/sdXn /mnt/exfat

You’ll need to replace the ‘X’ with the drive location and ‘n’ with the disk partition number, for example, ‘/dev/sdb5’.

Python on Debian from sourcecode update (altinstalling development branch 3.2 rc2)

Just though I’d post an update on my earlier post about installing Python 3.1.3 from source code on Debian Linux.

Although I wouldn’t encourage you to use it as your main environment some of you may be interested in trying out the latest development branch of Python to test new features or to help with finding and reporting bugs.

As of writing this, the lattest release is 3.2 rc2.

http://www.python.org/ftp/python/3.2/Python-3.2rc2.tgz

If you’d like to test out the development branch without interfering with your main install of Python you can use Pythons ‘altinstall’ feature.

Follow my previous guide on compiling Python 3.1.3 and when you reach the final stage instead of running;

debian:/#make && make install

Run the following instead;  (please note you will need appropriate permission to write to system folders to run either ‘make install’ or ‘make altinstall’.)

debian:/#make && make altinstall

Instead of installing the Python binary under the default name of  ‘python3’, ‘altinstall’ will incorporate the full version number in to the binary name leaving the original stable branch binary undisturbed.

You can run the ‘altinstall’ by typing;

debian:/#python3.2

Link to my previous guide:
Installing Python 3.1.3 from source, the full works (Debian Linux 5.x lenny)

Installing Python 3.1.3 from source, the full works (Debian Linux 5.x lenny)

So previously I’d posted about getting Python 3.1 installed from source on OS X. This time I’ll be talking about installing Python 3.1.3 on Debian Linux 5.x lenny.

Although this guide is specific to Debian lenny it should be applicable to other Linux distros’ based on Debian such as Ubuntu and can probably be adapted to work on other distros’.

First you’ll need to download the Python source code, you can do so by following this link. Python 3.1.3

You can also download and uncompress the file by running the following commands from the terminal

debian:/# wget http://www.python.org/ftp/python/3.1.3/Python-3.1.3.tar.bz2

debian:/# tar -xvf ./Python-3.1.3.tar.bz2

To build programs from source you’ll need to install gcc and associated files which can be done as follows;

debian:/# apt-get install build-essential

The first time I tried to compile the Python source-code I was presented with the following output….

Python build finished, but the necessary bits to build these modules were not found:
_curses            _curses_panel      _dbm
_gdbm              _hashlib           _sqlite3
_ssl               _tkinter           bz2
readline           zlib
To find the necessary bits, look in setup.py in detect_modules() for the module’s name.

I should expect on most fairly default installs of Debian you’ll also be missing the same components. If you wanted you could run Python as it is but you’ll be missing many important features.

If you follow the rest of this guide I’ll show you how to install all the required files for a fully featured Python build.

To install the missing components you should run the following from the terminal;

debian:/# apt-get install zlib1g-dev libncurses5-dev libreadline5-dev libssl-dev libbz2-dev libsqlite3-dev tk-dev libgdbm-dev

Now you have all the required components we can try to compile the code.

Navigate through to the directory where you extracted the Python files and run the following.

debian:/#./configure && make && make install

If everything has gone well Python 3.1.3 should now be compiled and installed.

you can run the Python interpreter by running the following;

debian:/#python3

I hope this guide has been helpful. Happy coding.

Macbook down!

Yesterday was a sad day for me. It was the day that my trusty and hardworking Macbook Pro finally expired.

To be fair to it, I could have treated it better, it was grubby and worn at the edges, it’s aluminium bent and frayed from it’s short but brave life filled with perilous adventures. It had barely ever been allowed full REM sleep, only the type you get with one lid closed. Waiting eagerly to resume it’s task within seconds of my call.

It had done the donkey work of a beast much larger than itself after me having cast aside desktop computers two years ago after having quite spectacularly destroyed my previous one in a death worthy of a hero. A death filled with blue sparks and flame.

For one who had lived life on the precipitous edge its end as it would come had been somewhat underwhelming.

It was happily chugging along, Debian and Solaris VM’s running in the background, a few ssh shells open along with 50 or so tabs open in Chrome and then with the blink of an eye appears the Apple gray screen of death.

I power it down and turn it back on, my ears pleasantly relived by the reassuring whir of fans, hard drive spindles and the cha-chunk of the cd-drive but my hopes are just as soon dashed when I fail to hear it’s yawning chime and it’s face light up with radiant colours.

Instead it sits there, brain-dead, soulless, breathing yet unable to perform.

Today I took it apart and isolated out all removable parts. Leaving the only possible culprits the logic board or it’s integrated graphics card.

Upon doing some research I find out that there is actually a known problem with a batch of Nvidia 8600GM’s present in some Macbook Pro 2.4Ghz models and that due to an unexpected failure rate apple has extended the warranty on effected units to 4 years along with free repairs. The problem seems to have been nicknamed the ‘Black screen of death’ and although this all sounds great, noises from forums and the blogosphere don’t seem to indicate the situation is as perfect as it seems.

Many seeming to have hit and miss results in actually claiming their free repair or having be charged upfront and then having had to demand a refund upon finding out that the problem is a known one and that they are entitled to their money back.

Here is a link to the Apple article laying out the details of this problem, http://support.apple.com/kb/TS2377

I’ve seen reports of those who had screen or files sharing enabled having still been able to access their machine remotely or by having booted the it in to target disk mode and retrieve their data that way.

Myself, seems as I’d had it striped down, I chose to stick the hard drive in my external disk cloner/caddy and connect it via USB to another machine and pull off the things I’ll need in the coming few days until repair.

So, has this happened to you? What was your experience in getting it repaired? Did you manage to get it done free of charge first time or did you have to battle?

Mine is being picked up by courier tomorrow and  am hoping for a smooth resolution.

Until then I’m stuck on a tiny and underpowered netbook hooked up to my 28″ monitor. As I type this I’m currently installing a Debian VM on it so I don’t have to miss out on my Unix fix.

Watch this space.