Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Monday, September 6, 2010

Today's Linux Nugget

I've been using Linux almost exclusively for quite a few months now and I have been avoiding setting up my printer until I needed it because it is connected via a USB to parallel port adapter and it didn't work out of the box. Linux seems to have no idea it is there.

Well, today I needed it. I rolled up my sleeves and got ready for frustration, but it wasn't that bad. Contrary to what I thought, there is no driver that I needed to install for the USB to parallel adapter. In fact, it was already installed.

~$ ls /dev/u*
/dev/urandom /dev/usblp0 /dev/usbmon0 /dev/usbmon1 /dev/usbmon2

It is right there as /dev/usblp0. But the printing system in Gnome seems to know nothing about it. So how do I add my printer?

Assuming you are running Ubuntu 10.04 as I am: Select System > Administration > Printing, click the Add button, then select Other in the devices list. Now enter the magical device URI:

parallel:/dev/usblp0

Add your printer using the built-in Linux driver and voila!

Saturday, August 30, 2008

A Tale of Three Partitions

Lately my home PC has had issues, the most annoying of which being that it would fail to install any Windows Installer (.msi) based product unless I dropped to a command line and forced it to install manually using:
runas /user:Administrator "msiexec.exe /i C:\full\path\to\installer.msi"

This was getting really annoying, and I have also been having my 13-in-1 card reader sporadically "go missing". I have a fairly new Dell XPS 710, and it is a pretty sweet machine. I can't complain about this thing as it is built like a tank and it is definitely a luxury model compared to past PCs I've had. Dell really knows how to build a machine.

Anyway, the Windows Installer thing has been bugging me for weeks because I have flexed all of my significant geek muscle trying to fix this problem and have come up empty handed. I was quite proud when I figured out the "runas" workaround (without it all installers just flash up a window and silently fail), but the fact that I cannot fix this problem just drives me nuts. I've tried removing almost every Windows-based component (.NET, Silverlight, etc.) and hacked around in the registry all to no end. So yesterday I decided to buy a second 500GB hard drive, and start from scratch (preserving my significant amount of data on the original 500GB drive).

Last night I started out by downloading a copy of the Linux-based Clonezilla LiveCD, and I used it to successfully clone my old drive to the new one. I knew from previous hacking that there were two other partitions on my hard drive besides my main data partition and I figured these were special Dell system partitions involved in the restore process and further investigation showed that they were in fact partitions containing the Dell diagnostics as well as a ghost image of the factory default WinXP installation. I basically now had two disks containing the following:

+------+--------------+-----------------+
| 47MB | 496GB NTFS | 3GB System |
| Diag | (Windows) | Restore |
+------+--------------+-----------------+

Sure enough, I was able to boot from either drive and ended up with an identical working installation of Windows XP. So the next step was to restore the factory default disk image. I had what I thought was a recovery CD and proceeded to boot from it. It turns out, it was not a recovery CD, but a re-installation CD. I figured there was a chance it would still somehow use the system partitions to install the old factory image onto my 496GB NTFS partition. Well, it installed Windows, but it did not restore the factory install - it just installed Windows. As a result, most of my hardware did not work; not even my network card so I couldn't even access the internet to figure out what to do next!

So I decided to boot from a boot disk and have a look around the third 3GB partition and found there to be a couple batch files and executables (basically Norton Ghost), and a ghost image that *was* a backup of my factory default. I was able to manually run recover.exe and restore the ghost image to my NTFS partition, but when I rebooted I was greeted with an error message that indicated Windows setup was not completed properly and to install again. Weird. At this point I figured there *has* to be a way to restore my machine from this ghost image using Dell's built-in support for this. A little Googling revealed I should be able to simply press Ctrl+F11 after the initial boot screen to initiate the restore procedure. After trying this, I was greeted with the error message Cannot recover. Much more searching and I found this very informative Dell forum thread:
http://www.dellcommunity.com/supportforums/board/message?board.id=dim_other&message.id=274416&query.id=299988#M274416

This ultimately led me to this website which contains a very detailed breakdown of the Dell system partitions, what they contain, and how they are used during the boot process. There are also utilities there for fixing your master boot record code, partition types, and more. Wow, this looked like just the ticket! However, after repairing everything (my MBR code and partition types were messed up during the cloning/re-installing of Windows process) I was still not able to get Dell's built-in recovery procedure to work.

Eventually, I tried resetting the partition types on the original disk to be normal FAT16 and FAT32 partitions (as opposed to special, hidden partitions) using the ptedit.exe utility, then re-cloning them to the new disk with Clonezilla, resetting them *back* to hidden, then attempting to recover by manually running recover.exe, as suggested by the owner of goodell.net in another thread. It was suggested that perhaps the source partitions being configured as odd, hidden types would confuse the cloning software causing things to be cloned incorrectly. Setting the partition types to standard FAT16 and FAT32 types before cloning may alleviate this problem. This time after restoring from the ghost image and rebooting it worked, and I am up and running with a fresh installation of Windows XP (with no Windows Installer issue!). Now to re-install all of the programs I use every day, and slowly migrate my data over from the old drive.

On a positive note, I can't say enough about the build quality of Dell computers. I have 6 SATA ports on my motherboard, and this computer comes with a neatly routed power connection and SATA cable to every drive bay in my machine. Also, every drive bay has a plastic drive carrier inserted in each location. The amount of money you save in not having to purchase cables and plastic bits and baubles alone is staggering. Finally, there are no fasteners required on anything. There is a spring-loaded mechanism on everything so pretty much any drive or component can be removed by pressing a button or sliding a lever. Check this out:



Anyway, here's a big "thank you" to Dan Goodell for his awesome utilities and instructions. You've obviously helped a lot of people with this in the past and you've just helped one more. I owe you a beer!

Monday, June 4, 2007

More Linux Gripes

So, I thought (according to all the Linux fanpeople) that Linux was so much better than Windows because it never required updates? I have had more automatic updates and reboots on my Linux machine than my Windows machine in the last week!

I still like Ubuntu though and I fully expect more updates as Linux matures. It's just that what a lot of people don't seem to be able to understand (or maybe admit) is that all software is prone to error and needs to be fixed. Nobody's perfect (although some of us are more perfect...err.. quality-conscientious than others), and the more people that use your software on a daily basis will only serve to reinforce that little nugget of reality.

At any rate - I have put my Linux trials on hold for now because my ancient computer was simply too painful to use. I must admit that WinXP ran much better and faster on that machine, but I think it has a lot to do with the graphics card. For now, I am back to my laptop (and XP). Note to self:

Huge resolutions
+ crappy gfx card from the 90's
+ latest and greatest FOS OS
---------------------------------
Poor user experience

I think when I buy my new uber-computer (probably with a new ATI HD2900XT or some other outrageous graphics card) I'll try dual-booting Linux/Windows and continue my evaluation. Although at this point I'm not sure if the latter will be XP or Vista. I guess it depends on when I actually spec out and buy this beast.

Any recommendations on what to buy would be welcome (if anyone actually reads this). I've been out of the hardware game for awhile...

If only there were new Amiga hardware available. ;O)

Thursday, May 24, 2007

A Few Days With Ubuntu

So I have spent a few days now with Ubuntu Linux, and to be honest I have only used it for about 3-5 hours total - 95% of which has been spent trying to figure out two issues. First, my video card problems, and second - how to get the VPN client to connect to my corporate VPN. What a PITA! I tried everything I could think of for about an hour to no avail. It just would refuse to connect with no helpful error message at all - even with debug info turned on. Finally, after some more in-depth Googling I found that some other guy had a similar problem and he solved it by setting the MTU and MRU to 1500 (instead of the default 1416). I did the same, and all of a sudden it worked. Hrmph. The funny thing is, the debug information in the system logs looked like it was using an MRU of 1500 anyway - even when it was set to 1416.

I also wasted a bunch of time trying to play a simple .mp3 file using Totem. It simply would not work. It kept giving me an error about not being able to allocate a screen buffer - even after I turned off visualizations. However, after installing Elisa Media Center (which I always wanted to play with but it did not seem function at all on my machine either), all of a sudden .mp3 playback started working in Totem. Weird. So now I need to figure out why Elisa doesn't work. It runs, but slows down my computer big-time, and none of the keystrokes do anything. All I can do is kill it.

Enough bad stuff. The good stuff so far?

- Opera installed like a champ. I don't remember Linux ever installing something that easily.

- The mysterious lack of automatic update notifications. It's like when my 10 year old daughter goes for a sleep-over at a friend's house. It's so quiet! It's awesome! ;o)

Wednesday, May 23, 2007

Hello Again, Linux

Well, tonight I decided to once again re-visit the world of Linux. I have an old desktop PC at home that I have run XP on for quite a few years and I had a brief stint with Vista on it as well. However, this PC is finely aged (AMD Athlon XP 1200, 3DLabs VX1 graphics) and it failed to pull off Aero so what's the point, right?

Right. So I decided to try Linux again. I have been dabbling with Linux for years, ever since the days of Mandrake 7, Corel Linux, and Redhat 5. I was on Peanut Linux for the longest time, but mostly because I had crap hardware. I only ever ran it as a server anyway because I found it unusable as my main desktop machine in those days.

Well, I have been running Ubuntu on my home server for a couple years now and I must say that I have found my distro. I like the way it works. So I tried to install Fiesty Fawn (FF) tonight on this "dated" PC. I had recently set up FF on my work machine in a VMWare image for some testing I had to do and it was a pleasure to install. Well, let's just say I didn't fare so well tonight.

I stuck in the CD and watched it boot. Well...actually I watched two lines flash by and then a black screen. My machine appeared to be frozen at this point and there was nothing I could do except press reset and watch it all over again. A quick Google search brought me here:

https://bugs.launchpad.net/ubuntu/+source/syslinux/+bug/62453/

Turns out, the video card I have is not really supported by the installer GUI. Understandable - it is quite old and - GOOD NEWS! - there was a workaround! Hold down the shift key and boot in text mode. Pressing ENTER on the boot screen now fired up the GUI installer no problem and I could install FF. Cool! However, the largest resolution I could get was 800x600, and unfortunately this is not quite big enough to show the install wizard in all its glory. I could not see any of the Next or Back buttons (if that is in fact what they are labelled - I never saw them) and there was no way to resize the install wizard smaller. ARGH! But I, being the incredible hacker that I am, managed to blindly tab through assuming the right-most button on all of the install wizard pages would be Next, or Confirm, or whatever - and I haphazardly plowed through the installation process without ever actually seeing what it was I was pressing. Well, it seemed to work.

OK, so I now have Ubuntu 7.04 installed. However, I am still limited on my screen resolutions and to be honest 800x600 simply doesn't work. No problem - the bug tells me to grab some lines out of my /var/log/Xorg.0.log file and put them into my /etc/X11/xorg.conf file and all is well. The trouble is - it doesn't tell me what lines. Well, I guess it is assuming a basic level of X11 knowledge that is slightly higher than mine. Now I'm starting to sweat. X has always been the bane of my Linux existence. In fact, I would go so far as to call it a bastard. Right to its face. With its mother standing right beside it. Seriously - I actually had it completely fry a monitor on me way back in my Peanut Linux days by probing my graphics adapter with the wrong frequencies. Luckily that was a crap monitor. But I did not feel like sacrificing my 19" NEC to the X11 demons this evening, thank you very much!

But this story has a (somewhat) happy ending. I did manage to figure things out after some more searching and trial and error (with my sweaty fingers tightly crossed I might add). And I did take the time to add my experiences for the benefit of others to the bug report.

So! Ubuntu is locked and loaded and I am going to give it a whirl. I'm assuming trying to run Beryl/Compiz on my geriatric 3DLabs card (it *was* a screamer in its day!) is going to be a non-starter. Oh well - that would have been cool to play with.

As it sits, it is 12:50am and my wife has long gone to sleep while I tried to "quickly install Linux before I went to bed". Sigh. Hello again, Linux (you sonofabitch).


P.S. In all seriousness - kudos to the Ubuntu people. Ubuntu Linux is quite simply the best alternative out there, IMHO. And I *am* posting this from Opera - freshly installed into my shiny new Ubuntu installation.