Find the answer to your Linux question:
Page 2 of 2 FirstFirst 1 2
Results 11 to 12 of 12
Would you mind explaining the device entry format? I didn't see anything on the man page for 'stat.'...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #11
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319

    Would you mind explaining the device entry format? I didn't see anything on the man page for 'stat.'
    The best things in life are free.

  2. #12
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    It's simply the device number, expressed both in hexadecimal and decimal format. I don't know why you'd want the decimal format for it, though. The hexadecimal is the only one that makes sense.
    If you look at your /dev/hda4 with ls -l, you'll see that it returns 3, 4. That's the same as the 0304 (or 304 since the first 0 is supressed) as returned by stat. The 3 is the device's major number, which in this case identifies it to the kernel's VFS subsystem, which specifies that any requests are to be redirected to the driver for IDE bus 0. The minor number is used by the individual device driver, and in this case (ie. in the IDE driver's case) specifies that the sought device is the fourth partition of the master drive on the bus specified by the major number. Major number 22 is IDE bus 1, 33 is bus 2, 34 is bus 3, 56 is bus 4, and so on. As you can see, the major numbers are almost completely random. They were just allocated in the kernel source as they were needed.

Page 2 of 2 FirstFirst 1 2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •