Re:My Google Interview
by amalcon on Friday July 16, 2010 @10:22AM
(#1521213)
Perhaps a more "sysadmin-ish" answer would have been something more like "Whatever the command 'echo 1 > /tmp/one && du -h /tmp/one && rm /tmp/one' prints".
[ Parent
| on HN ]
That doesn't exactly work.
echo "a" > a; du -sh a; rm a
2.0K a
dumpe2fs /dev/sda1 | grep -i 'Block size'
Block size: 1024
Interesting. Still, I'm no sysadmin; the point is that demonstrating you know how to find something out short of google is better than... well, not.
I'm curious how you got that. Are you sure "a" is on /dev/sda1? What OS and FS are you using?
$ du -sh /tmp/a
4.0K a
$ tune2fs -l /dev/mapper/VolGroup00-LogVol00 | grep "Block size"
Block size: 4096
Positive that 'a' is on /dev/sda1. Running CentOS 5.5 and /dev/sda1 is ext3.
I get similar behavior on the other partition:
echo "a" > a; du -sh a
8.0K a
dumpe2fs /dev/VolGroup00/LogVol00 | grep "Block size"
Block size: 4096
Though if I 'touch' the files to create them, they are the blocksize. Which seems odd, since on my AIX and HP-UX boxes that gives files of size 0.