Sunday, January 15, 2006

partition LABEL problem and making cp recurse infinitely

Today was an eventful day, in the sense that many problems got solved. The one I spent my whole morning on was a typical silly mistake of mine. Nothing interesting, just mis-reading my own past email.

When I was trying to get a domU up, I was getting a file system corruption error something, the one where the kernel give you Ctrl+D option and asks root password, so that you can fix the file system. I don't have the error message right now, but at the boot time it was doing "fsck.ext3 -a LABEL/1" and it was not finding any disk having this label. Some googling made me check my /etc/fstab. It showed a garbled line for swap drive. The line looked like:
"LABEL=bClsid<8d>Ôèÿÿÿvk swap swap defaults 0 0" (in vi)
"LABEL=bClsid�vk swap swap defaults 0 0" (in cat)

Such garbled text was enough to blame that line for my file system problem. So I thought on the lines of fixing its label. I found tune2fs -L , and set the label on my booting partition to this. But that didn't help. I also thought that this Label thing gets set if you make it a root device (as per my understanding. But now I understand having a partition as root means to have only its mount point as a root). Eventually one google result made me understand the problem. The first line of fstab was:
LABEL=/1 / ext3 defaults 1 1
So it was trying to fsck the root file system, but by assuming that it has LABEL=/1. So I just changed the line from LABEL=/1 to /dev/ and it all worked fine.

The other funny experience was with cp. Yesterday I was copying a whole partition of one build host to my desktop linux machine for running it as a domU. Today when checked I saw it had filled the whole of my 75G drive. To my amazement I saw that it was a /usr/bin/mh directory which had 'mh' directories recursively. After playing around for sometime, I found that mh was a link to '.' (to that directory itself). So I have witnessed that cp is dumb about such softlinks (at least only with the options I had tried -r and -p). It kept on copying the same directory instead of the symbolic link.

No comments: