3rd Times a Charm… Linux, Wifi and Samsung N210

If you follow this blog you will know that I’ve mentioned wireless and the Samsung N210 in the past.

Kickstart Samsung N210 Wireless
Update: UNR 10.04 Wireless on Samsung N210

The first one post was the most successful blog post I’ve ever written, and judging by the number of posts in the Ubuntu forums it’s something many people struggle with constantly with this netbook.

I’ve found that the solutions I posed previously worked, but had to be redone each time after a kernel update. What’s worse is that with each new ‘Buntu distro upgrade, an entirely new wireless problem appeared.

To be quite frank, I’m getting sick of this and I won’t be touching another Samsung netbook. In fact when it comes time to refresh I’ll probably opt for a System 76 box.

The latest upgrade appears to be finding the card and connecting seamlessly on live distro and install… but after a while of being online, it starts to drop off, becoming more frequent until it either doesn’t work at all, or it pretends to connect to the network without actually establishing any connection to the router.

I did a bit more digging in the forums and online and after much reading I’ve come to the conclusion that it has something to do with Canonical disabling Wireless N by default in 10.10 (Maverick), and whatever is going on inside Samsung netbooks… because to my dismay I discovered it’s not just the N210 that has this problem seems to be the majority of their netbook range using Realtek cards.

It was then that I stumbled across a German blog post from a link through a forum for sorting out wireless on the Samsung N510.

Dirk Hoeschen has put together both a driver and script to easily run from the command line which I can confirm worked on my N210. The only issue I’ve found is Wireless still drops but it’s much more stable and lasts longer. Furthermore, by running the script again it performs a ‘reset’ and causes the wireless to reboot without having to reboot.

sudo apt-get install build-essential
tar -xpf rtl819Xe.tar.gz
cd rtl819Xe
sudo ./install.sh

It’s not perfect but it works and so it is my 3rd solution from Ubuntu 10.10 onwards. There may be more elegant and more permanent solutions but I really don’t have the time or skill level to look for them. One thing I will state is that Ubuntu was the only distro I tested that recognised the Realtek hardware out-of-the-box despite these issues.

I honestly don’t know what the Narwhal will bring and if I’ll have to hunt for a new solution or if it will finally be fixed. Funnily enough, I did have duel boot with Win 7 Starter on the netbook and one evening when I was getting particularly fed up I booted in and found that Windows didn’t recognise the wireless network either – leading me to believe that the wireless cards in these things are very poor quality. Either that or Samsungs quality control efforts are seriously questionable. But that’s another story.

Update: UNR 10.04 Wireless on Samsung N210

Back in March I posted a “how I did it” on getting Wireless working the Samsung N210, which involved installing and compiling the Realtek driver. The post proved¬†immensely¬†popular and was top of google search results for a while when searched for “samsung n210 wireless”.

Unfortunately, unless you are still on Ubuntu 9.10 that guide is now useless, as I found out recently when I updated my Sammy netbook to 10.04. I did manage to get it working again, but it failed on another recent kernel update (2.6.32-24-generic) so I got fed up and rolled back to the last kernel (2.6.32-23).

It appears that Canonical messed up with the firmware or something (here’s a bug report) and so new firmware needs to be downloaded after compiling. It worked for me just downloading the firmware and restarting, but you may need download the latest r8192e driver and compile that first.

sudo apt-get install git-core
cd /tmp
git clone git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/firmware.git
sudo cp -av firmware/RTL8192E /lib/firmware/
*RESTART WILL WORK* ONLY x86

Thanks to s32ialx on the Ubuntu Forums for the tip. You should check out the thread for further updates.

Kickstart Samsung N210 Wireless

Update 1: Chris (see comments) has kindly provided a up-to-date driver (from Realtek) said to fix hanging issues after hibernate. I tested hibernate and apart from an Ubuntu One crash it worked. Instructions from the Realtek contact are provided below the original post, if you find it doesn’t work and want to try a different method.

Update 2: I’ve had to take the Realtek rtl8192e driver file down now as it’s hammering my bandwidth and I don’t want to pay extra money at this time. However I uploaded a copy to YourFileLink file hosting – get it here.

Update 3: For those who have upgraded to UNR version 10.04 and above, this solution seems to no longer work, please see my updated post.

My Sammy NC10 worked flawlessly when I installed Ubuntu Jaunty and every upgrade after then, before that, on Ibex I had to do teeny bit of hacking to get the wireless to work.

Well, after purchasing my N210, wireless is once again broken of course. Must be something to do with Samsung’s choice of wireless cards. Thankfully help is always on hand and I found the troubleshooting post at the Ubuntu Forums.

Now follow the instructions below (reproduced from chilli555’s forum post):

  1. Open a terminal and type:
  2. sudo apt-get install linux-headers-`uname -r` build-essential

  3. Extract the downloaded file to your desktop and then cd into the newly created directory (rtl8…)
  4. Now do type the following in order:
  5. make
    sudo su
    make install
    modprobe r8192e-pci
    iwconfig

  6. You may find you need to run the 2nd from last command (modprobe) as a normal user in order for wireless to start up automatically next time to reboot.

It’s as simple as that, and if your wireless fails again after a major update, then just run the modprobe command again. But it’s best to save the driver locally somewhere just in case.

For the NC10, Canonical fixed this issue on the next release (Jaunty) so I have faith that this will be a none issue in less than 6 months time also.

Alternative install, provided by Realtek:

1. Change to the driver directory.
2. sudo su
3. make
4. make install
5. Reboot
6. ./wlan0up or ./wlan1up

Notes: 1. If permission denied, change property with `chmod 777 wlan0up`
2. Or enable driver with `ifconfig wlanx up`(wlanx denote wlan interface name).

Ditch Windows 7 Starter and Send Microsoft a Message

Anyone else get a netbook recently and have you experience stunted by Microsoft with their crippled version of Windows 7? As you know, recently I bought a new Samsung n210 netbook. The trouble is that it came with Windows 7 Starter Trial edition installed.

Of course, I planned to install UNR anyway, but I still wanted to play with Windows 7 6.1 and see how it compared to Vista… boy was I feeling sorely ripped off when I discovered that this is basically some kind of crippled Trial version of Windows. I mean, you can’t even change the wallpaper on it!

All because Microsoft wants to upsell you a copy of Home Premium so that they can subsidise their OS on a system that is just not cost efficient to run it.

Well, there was no way I was going fall into this lousy sales trap and if you don’t want to play Microsoft’s game that it’s forcing on everybody send them a real message. Don’t just pay up and grumble, switch to a complete Operating System with no limits on what you can use it for, switch to Linux.

Here are 5 distro’s I’ve personally used and can recommend, but you don’t even have to go for one on this list, check out others, especially if one doesn’t quite match with your hardware:

Ubuntu
Ubuntu Netbook Remix
Linux Mint
OpenSUSE
Fedora

Or try out these distros that have been specifically created for netbooks:

Moblin
EEEbuntu
Jolicloud
(UNR technically belongs here too)

Most, if not all, of these distros are going to let you install a duel boot with Windows 7, so even if you want to keep it just for manufacturer updates you can.

Best thing about using Linux on a netbook is absolutely no need to have an external DVD player. I have been using a netbook for over a year and have never needed to plug in an external DVD player. Most of the software I use comes straight from the repositories, the rest is available online.

Don’t throw your money at Microsoft, teach them a real lesson, democratise your computing experience and heal your netbook!

Headless Recovery with Persistent Ubuntu Live USB

As some of you know, recently my Samsung NC10 netbook screen was smashed in an unfortunate accident. I have since replaced this with the excellent Sammy N210 but was at a loss where to begin recovering data from the NC10.

Of course, the obvious solution was unscrew and take out the hard drive, however these Netbooks are tightly built, and since I’m still considering the possibility of replacing the screen, I don’t want to create any superficial damage to the case.

So I googled for options, initially hoping to snag a Linux liveCD that would automatically boot with sshd in order for me to log in remotely.

Aside from some vague forum references to Knoppix and editing configuration files, I got nowhere. However what did occur to me was that Ubuntu LiveCD on a usb flash drive can be set to be persistent so it saves any changes including packages and settings.

The following steps are what I did to get access to my netbook data despite having a smashed screen, without needing to take out the hard drive, hook up an external monitor or building my own distro. Hopefully it may be useful for anyone finding themselves in a similar situation.

This is by no means a silver bullet. You will require the following setup for this to work:

  • The system with the broken screen must be capable of booting from USB.
  • The Bios must already be set to boot from USB (unless you have some way to set it without a screen).
  • A second ‘puter with sshd installed and running.

This will not work with a LiveCD, it needs to be a USB pen drive so that changes can be easily saved on the drive.

  1. Download an ISO of Ubuntu or Netbook Remix, which is what I used, and then use the Startup Disk Creator to create a live USB pen drive – check the box for persistent mode (“Stored in reserved extra space”).
  2. Run the LiveUSB and when it boots to desktop open a terminal and type:

    sudo apt-get update
    sudo apt-get install openssh-server

  3. When installing openssh on a LiveCD/USB you need a password to log in remotely. This can be done 1 of 2 ways, either by setting ‘passwd’ for the default ubuntu user or creating a new user. NerdNotes.org offers a nice and easy tutorial. In practice I found that when I rebooted the liveUSB for some reason the default ubuntu user ‘lost’ the password so I had to create a new user instead.
  4. If you have created a new user, be sure to add the username to the admin group, giving root privileges:
  5. sudo adduser <username> admin

  6. Test the ssh daemon by logging in remotely to the machine you will use for recovery. If you are prompted for a key then type ‘yes’ and hit enter:
  7. ssh username@hostname

  8. Then make sure you can ssh back to your ubuntu LiveUSB. You may also want to do a quick reboot and test run to see if you can ssh without problems and without touching the LiveUSB keyboard.
  9. Now shutdown the LiveUSB and plug it into your headless netbook/laptop, switch it on and let it boot up, it should take about 30 seconds to boot automatically after the menu and then another 30-45 seconds before you can ssh in.
  10. Create a directory you are going to use to copy all your files from your netbook.
  11. wafitz@ $ mkdir /media/bkup

  12. Once you can ssh to the LiveUSB, you want to mount your hard disk partition.
  13. wafitz@ubuntu$ sudo fdisk -l

    Device Boot      Start         End      Blocks   Id  System
    /dev/sda1               1         182    160101883+  82  Linux swap / Solaris
    /dev/sda2   *       53782       60802    69389632    7  HPFS/NTFS

    wafitz@ubuntu$ sudo mount /dev/sda1 /mnt

  14. It should now be easy after this to grab your files and scp them back to your curent system, whether you previously had Windows or Ubuntu (or other distro) Linux installed. However if like me, you had an encrypted home partition, then keep following the steps:
    I got the original instructions for this from Dustin Kirklands blog – nb: I needed to use ecryptfs-add-passphrase in order to record my passphrase manually before mounting the encrypted directory.
  15. wafitz@ubuntu$ sudo mount -o bind /dev /mnt/dev
    wafitz@ubuntu$ sudo mount -o bind /dev/shm /mnt/dev/shm
    wafitz@ubuntu$ sudo mount -o bind /proc /mnt/proc
    wafitz@ubuntu$ sudo mount -o bind /sys /mnt/sys
    wafitz@ubuntu$ sudo chroot /mnt
    root@ubuntu$ su - wafitz
    wafitz@ubuntu$ ecryptfs-add-passphrase --fnek
    wafitz@ubuntu$ ecryptfs-mount-private
    Enter your login passphrase:

    Warning: Using default salt value (undefined in ~/.ecryptfsrc)
    Inserted auth tok with sig [xxx] into the user session keyring

    wafitz@ubuntu$ cd $HOME
    wafitz@ubuntu$ ls -a

  16. Finally you can do a secure copy from your netbook back to your host pc:
  17. wafitz@ubuntu$ scp -pr * wafitz@:/media/bkup

If you have found this post whilst searching for a solution and this helps you, please let me know. Even more so, if this method can be refined or improved then I’d also like to read your comments!