Confused about block devices
- From: Tim Roberts <timr@xxxxxxxxx>
- Date: Sat, 29 Sep 2007 04:56:17 GMT
I had an experience today that confused me. I'm hoping someone can explain
it to me.
We had a hard disk on an old Linux 2.4 server develop a bad spot, so I
replaced it today. We do a (nearly) full backup every morning at 4 AM, so
it wasn't terribly painful.
So, I mounted up a new hard disk, booted up a Knoppix CD, partitioned,
formatted, and unpacked the tars from the backup drive. All was well.
Still in Knoppix, I chrooted to the mounted file system on /mnt/hda2, and
then decided to "fdisk /dev/hda". This failed with a permission error.
I unchrooted, and then "fdisk /dev/hda" worked, of course. I then tried
"fdisk /mnt/hda2/dev/hda", and got the same permission error.
This surprised me. Both of the files were block devices, major 3, minor 0.
I thought that ANY inode created as a block device with major 3 and minor 0
would be a direct route to the first IDE disk.
When I finally booted from that disk, it all worked fine, so there was
nothing fundamentally wrong with the /dev directory.
Am I wrong to think that I should be able to do "mknod /tmp/foobar b 3 0"
and then "fdisk /tmp/foobar" with arbitrary an filename?
--
Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.
.
- Prev by Date: Re: 'insmod error Invalid module format' upon an improper kernel source tree hierarchy?
- Next by Date: X driver: Using offscreen memory manager for Xv
- Previous by thread: 'insmod error Invalid module format' upon an improper kernel source tree hierarchy?
- Next by thread: X driver: Using offscreen memory manager for Xv
- Index(es):