Archive for July, 2006

Recovery from a broken sudo

Ubuntu is probably the first distro that uses sudo instead of a root account. Recently, I started playing with it to help a friend out with a computer problem and discovered that sudo is rather fragile. For example, if you were to accidently delete or damage the /etc/sudoers file, sudo would stop working. You would not be able to get the sudoers back because you can’t sudo!

To recover, reboot your Ubuntu. At the boot manager, you should see an option for recovery, select that version and you’ll boot into root in text mode. From there, you can fix /etc/sudoers and everthing will be back to normal.

What did surprise me is that there is no root password. I thought when I type sudo, it was actually switching to root. Apparently, this is not the case. I am not sure if this would count as a security risk or not.

To avoid damaging your sudoers file, always edit it with sudo visudo. Visudo apparently checks the file for validity before saving it, so you don’t accidently damage your sudoers file.

Advertisements

July 28, 2006 at 3:29 am 1 comment

Subversion on a dual boot machine

Recently, I installed Ubuntu on a laptop with Windows XP. I left a Fat32 volume to share documents between Linux and Windows (since it’s still risky to write to NTFS). I later install subversion on both Windows and Linux Partition and though I could subversion as a document versioning system.

At around version 1.1, Subversion introduced a new file system call FSFS. Previous version of Subversion only supported Berkley DB, which only did not work properly cross platform (you get data corruptions). FSFS is a flat file system that do not have this problem and has been the default file system since version 1.2.

Unfortunately, when I attempt to check in a file to a repository on the FAT32 partiton, I got the following error:

Can’t chmod /myrepository

This was puzzling since chmod essentially does nothing on a Fat32 volume. The error message is deceptive. It appears that chmod is attempting to change permission on Fat32, which doesn’t support it and fails. In reality, the cause of the problem is because the Fat32 volume is typically mounted as root. Since the user is not the owner volume, chmod fails.

You have two solutions:

1. Mount the volume as being owned by you. For example, in the fstab, you can add:

/dev/hda3   /media/hda3   vfat  defaults,utf8,umask=007,gid=52,uid=1002 0       1
uid=1002 is my userId. To find out your uid, use the id command. This may not be such a good idea on mult-user machines, but dual boot machines tend to be used primary by one person.

2. Run the svn command using sudo or run as root. Since you are root, you have chmod permission over root owned volumes.

Of course, there are probably more elegant solutions, but this is what I could think of off the top of my head.

July 21, 2006 at 8:12 pm Leave a comment

Windows XP network can’t acquire DHCP address

Have you gotten in a situation where you have a network cable plugged in, and the connection light is ok indicating a good connection, but you can’t get DHCP? The symptoms in Windows is that you can’t acquire a network ip address and selecting repair network does not fix the problem. I have notice the following causes:

1. Your router is holding on to the lease for your computer. Try disconnecting the cable and see if the router will create a new lease.

2. If this does not work, then shutdown the router for a minute and then restart it. This should clear the lease.

3. Sometimes if you have bad ground, you could get enough noise that the connection seems to be OK, but you can’t acquire a lease.

July 4, 2006 at 5:33 pm 28 comments


Calendar

July 2006
M T W T F S S
« Jun   Aug »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Posts by Month

Posts by Category