image block
1260 Views 147 Comments
Hi everyone! Let's today investigate deep abyss of storing information on UNIX systems.
I know, exist so many sources information regarding this topic, but when I tried to investigate this issue from "A" to "Z" at the first time, I had look for information on different books and sites. So, in this post, I will put all my records for you, my dear reader.
I have built a big scheme but don't be scared, because on this post we will investigate it by smallest parts. And I promise that I will not skip any details.

Schema and definitions

At first, let's understand what is the filesystem. Filesystem is the structure of data which gives the possibility to collect files on partition disk and track them by operation system.
The UNIX operating system has a personal type of file system and exactly this part we will investigate today.
Everything in Unix is considered to be a file. If we are talking about folders, or some devices (USB, Network Devices etc.), still system access to it getting from the generated file and is indicated like a file inside the OS. Below is represented detailed scheme according which one we will build this part of the topic.

All hard drives on UNIX systems are drawn up from volumes (during installation of OS, the system is doing this automatically, but additional working with space should be manual).
After mounting of the hard drive, going step of the creation of physical volumes, on which stands out spaces for volume groups.
Volume groups created for more comfortable access to logical volumes. Logical disks called partitions.
I know it scheme can makes crazy, but all these actions give elastic work with space and for administrating it's an important point.


Every partition is divided by default from three parts (in case if this primary partition, exist bootable block). Partition elements :
  • Super block - layout of the disk. Consist information about size of disk and number of inodes and data blocks
  • Inodes table - list of indodes
  • Data block - structured data
From all this information, now we can make definition what is this "file" in the UNIX system.
File - is only link on inode, where stored information. So, all permission, owners, and other data, we are giving not on file, but on inodes.
Directory - is also file, which has inode number, data block, but inside consists additional information about parent and current directory.
Also, we should understand definitions "link". On UNIX systems exist two type of links, hard and symbol link.
Hard link - is a file. It's also referenced on the inode and from this, we have, that one inode can have few references on itself.
Symbol link - is reference on file (hard link). Is using for quick and comfortable access to file.

NOTICE : If soft (symbol) link has been removed, the file will be in save, but if all hard links will be removed to file, data will be destroyed and soft links will be wrong (because the file will not exist anymore).


And now we came to the part about inodes.
Inode - is a data structure on a filesystem, where stored all the information about a file, except the name of the file and actual data.
One inode = 128 bytes
Inode consists from the next parts :
  • Mode - permissions on file
  • Link count - count of links on inode
  • UID - owner of file
  • GID - group owner of file
  • Size - size of data
  • Access date - last accessed date
  • Modify date - last modifying date
  • Inode number - number of inode
  • Pointers - object, whose value the reference on data
  • Block count - count of blocks of data
Data block pointer - is a direction to data. Data block pointers have a level of indirection to data. And for the present time present 4 levels of pointers.
Levels of indirection :
  • 0 - the direct pointer on data
  • 1 (Ind1) - the single indirect on 256 pointers. Each pointer is reference to the single data block
  • 2 (Ind2) - the single indirect on 256 another singles indirect and then each of them on 256 pointers
  • 3 (Ind3) - the single indirect on 256 another indirect, then each of them indirect on another 256 and in the end to a single data block
Data block - is reference on block with information
Block - information (row of bits)


Like a separate part of the topic, I wanted to mark "permissions" on file.
Let's review bits of access :
  • Owner permissions - access for owner of the file (3 bits)
  • Group permissions - access for group owner of the file (3 bits)
  • Other permissions - access to the file for other users (3 bits)
  • Sticky bit - is a permission bit that is set on a file or a directory that lets only the owner of the file/directory or the root user to delete or rename the file (1 bit)
  • SUID - is a special type of file permissions, which is giving permissions to a user to run a file (program) with permissions of owner (1 bit)
  • GUID - is a special type of file permissions, which is giving permissions to the group to run a file (program) with permissions of owner (1 bit)
So now we can move to practice.

Working with files

We will start from command "ls" because it's a basic command for administrators. So, let's create test file via "touch" command and run "ls".
# touch test.file
# ls -la ./test.file 
-rw-r--r--. 1 root root 0 Oct 14 18:02 ./test.file
-rw-r--r-- - is permissions on file. First character is type of file.
First character "-" it's mean that this is file, "d" is directory and "l" is link. And next row of accesses bits is permissions to owner, group and other, which are described before.
There are these permissions :
  • r - read permissions (4 in numerical equivalent)
  • w - write permissions (2 in numerical equivalent)
  • x - execute permissions (1 in numerical equivalent)
If we want to add few permissions, we should just calculate the numerical equivalent of access and set it.
For example, if we want to give permission on file read, write and execute for owner, read and execute for group, and for other only read, we should give permissions -rwxr-xr-- in numerical equivalent it will be for owner 4+2+1, for group 4+0+1 and for other 4+0+0 (754).
Give these permissions we can via "chmod" command.
# chmod 754 ./test.file 
# ls -la ./test.file 
-rwxr-xr--. 1 root root 0 Oct 14 18:02 ./test.file
Also via this command, we can operate with additional bits of access. Sticky bit :
# chmod +t ./test.file 
# ls -la ./test.file 
-rwxr-xr-T. 1 root root 0 Oct 14 18:02 ./test.fil
For the understanding of the importance of this bit, have a look on folder "tmp". This bit give possibility to remove files only by owner (or superuser) and thanks for this, all temporary files of each process are protected.
The same with other additional bits. (u - for SUID, g - GUID)
Regarding the changing of owners and groups, use "chown" command.
For example, let's change owner to user "test" and group "testg".
# chown test:testg ./test.file 
# ls -la ./test.file 
-rwxr-xr-T. 1 test testg 0 Oct 14 18:02 ./test.file
Also, want to show one more useful option of "ls" command. Thanks to this command, we can know the number of inode of the specific file.
# ls -i ./test.file 
4374062 ./test.file
4374062 - is number of inode
On this point, I finished this post and I really hope that this information was useful for you my dear friend.

Thanks for the attention,
- Kostia


  1. viagra with prescription <a href="">viagra soft tabs 50mg</a> can you buy viagra without a doctor

  2. how much does a viagra pill cost <a href="">is viagra safe for seniors</a> lowest price on viagra

  3. watermelon viagra <a href="">cheapest pharmacy for viagra</a> viagra dominican republic

  4. viagra help fuck <a href="">sex videos men using viagra</a> photos of nascars #27 viagra pontiac grand prix driven by mike bliss

  5. how long does viagra work <a href="">25mg viagra for 27cents each</a> viagra for blood pressure

  6. viagra street value 2016 <a href="">viagra vs levitra reviews</a> walmart viagra 100mg price

  7. generic viagra prescription <a href="">what doctors can issue prescriptions for viagra</a> viagra without a doctor prescription

  8. viagra horror stories <a href="">rite aid viagra price</a> low dose of viagra

  9. viagra without doctor prescription reviews <a href="">how long is a prescription for viagra good</a> how do you get a prescription for viagra

  10. without a doctor prescription viagra <a href="">fake viagra prescription label</a> cheap viagra "no prescription" kamagra

  11. viagra average age <a href="">viagra and flomax</a> buy viagra online canadian

  12. generic viagra without the prescription <a href="">how do you get a prescription for viagra</a> viagra on prescription

  13. viagra dosis <a href="">generic viagra availability date</a> como se toma el viagra

  14. prescriptions viagra <a href="">viagra without prescription</a> viagra no doctor prescription

  15. staminol vs viagra <a href="">does viagra help in sports</a> yohimbe vs viagra

  16. is it illegal to buy viagra without a prescription <a href="">viagra online prescription</a> non prescription viagra alternatives

  17. que es viagra <a href="">buy viagra online cheap</a> pfizer viagra generic

  18. sildenafil free nhs <a href="">sildenafil 50 mg online</a> safe sildenafil purchase on line

  19. viagra sildenafil online <a href="">legal sildenafil</a> sildenafil plant

  20. marley drugs generic viagra <a href="">when viagra generic</a> expired viagra

  21. what is the typical dosage of sildenafil <a href="">sildenafil to replace lisinapril</a> sildenafil 50 mg contraindicaciones

  22. sildenafil cost at walmart <a href="">sildenafil and niacin</a> sildenafil labs to monitor

  23. que medicamentos tienen sildenafil <a href="">sildenafil 50 mg reviews</a> sildenafil oral suspension

  24. sildenafil 100 mg online <a href="">buy cheap sildenafil citrate</a> sildenafil 50 mg buy online india

  25. what is better than viagra <a href="">where to order black chinese viagra</a> meloxicam & viagra

  26. will old viagra have any effect on me <a href="">viagra mujer</a> viagra canada with prescription

  27. lerk sildenafil 100 mg <a href="">sildenafil while take blood pressure medication</a> sildenafil citrate vs silendafil excipiente

  28. viagra review <a href="">viagra from us pharmacy</a> viagra sample

  29. sildenafil dosage timing <a href="">sildenafil lerk</a> optum rx price for sildenafil

  30. does viagra work is it is very old <a href="">sildenifil vs viagra</a> viagra forum

  31. sildenafil order online <a href="">sildenafil citrate camber 25 mg tablet</a> what is the drug sildenafil?

  32. sildenafil 60 mg reviews <a href="">safe online sildenafil</a> sildenafil alternative uses

  33. buying viagra online without prescription <a href="">genric viagra</a> viagra price walmart

  34. fda approved viagra <a href="">best place buy viagra online</a> viagra vs birth control insurance coverage

  35. viagra online sales <a href="">viagra not working</a> is viagra prescription

  36. pseudoephedrine vs cialis <a href="">over counter cialis walgreens</a> online cialis pharmacy

  37. does blue cross cover cialis <a href="">liquid cialis side effects</a> cialis 30 mg

  38. using coreg and cialis <a href="">cialis 50mg</a> precio de cialis en venezuela

  39. viagra and cialis combo <a href="">cialis 5mg coupon</a> cialis headaches afterwards

  40. cialis in jamaica <a href="">does cialis effect systolic or diastolic on bp</a> does cialis prevent premature ejaculation

  41. can cialis be taken daily <a href="">teva generic cialis</a> cialis fainting

  42. cialis daily tadalafil (generic) <a href="">cialis doses available</a> walmart cialis price

  43. cialis 20 mg review <a href="">cialis generic australia</a> generic cialis and viagra

  44. cialis daily dosing <a href="">canadian pharmacy cialis 10mg</a> cialis side effects vs viagra

  45. female cialis does it work <a href="">cialis 2.5mg cost</a> canadian cialis no prescription

  46. cialis professional 40mg <a href="">cialis jokes</a> best online pharmacies for cialis

  47. discount coupons for cialis 5mg <a href="">does daily cialis lower blood pressure</a> which has less side effects viagra cialis o levitra

  48. do you need a doctor's prescription for cialis <a href="">viagra cialis and levitra</a> online cialis offer

  49. cbd oil for hyperactivity canine <a href="">cbd oil tampa tampa, fl</a> how to get cbd oil in virginia

  50. cbd oil legal in virginia <a href="">hemp bomb cbd oil</a> can cbd oil help with diabetes 2

  51. best cbd oil for dogs with anxiety reviews <a href="">is ctfo a good cbd oil</a> vaping cbd oil for pain

  52. cbd oil by locust <a href="">cbd oil cart</a> xname dial cbd oil

  53. cbd american shaman hemp oil tincture <a href="">cbd oil myrtle beach</a> smart organics cbd oil reviews

  54. cbd oil for pain <a href="">cbd oil for knee pain</a> how much cbd oil for pain

  55. cbd oil dog anxiety <a href="">cbd oil histamine</a> does cbd oil hel

  56. cbd 2 oil for pain <a href="">best cbd oil for pain relief</a> hemp oil or cbd oil for pain

  57. is cbd oil effective topically <a href="">lazarus cbd oil website</a> making cbd oil with olive oil and isolate

  58. best time of day to take cbd oil <a href="">cbd oil in okc</a> cbd oil drug test swab

  59. cbd oil raleigh nc <a href="">does cbd oil help with hair loss</a> prednisone interaction with cbd oil

  60. which part of the plant is cbd oil from <a href="">do vets recommend cbd oil for dogs</a> purx 7 hemp cbd oil

  61. how is cbd oil taken <a href="">cbd oil honey sticks</a> cbd oil for libido

  62. is cbd oil high in omega * <a href="">elements massage xname cbd oil</a> cbd oil 4k

  63. charlotte's web cbd oil by stanley brothers <a href="">cbd oil legal in ny</a> purenatural cell isolate cbd oil 100mg

  64. cbd oil for shoulder pain <a href="">best cbd oil autism</a> can cbd oil help in rsd pain

  65. will cbd oil help loose weight <a href="">cbd oil winston salem</a> vaporizer for cbd oil

  66. negative side effects of cbd oil <a href="">cbd oil for pet tumors</a> can you advertise cbd oil treats cancer

  67. cbd oil and sex <a href="">frankincense oil cbd oil</a> where to get cbd oil in massachusetts

  68. shaman cbd oil grand island <a href="">water soluble cbd oil in a vape</a> cbd oil in fort myers

  69. behavior issues cbd oil <a href="">test cbd oil purity</a> cbd oil and levothyroxine

  70. cbd oil for sale in florida walmart 33837 <a href="">cbd oil law colorado school</a> cbd oil green bay

  71. buy cbd oil dogs <a href="">hempture cbd oil</a> cannactiva cbd oil reviews

  72. cbd hemp oil legal <a href="">dosage for cbd oil drops</a> best pure cbd vape oil

  73. what is pure cbd oil <a href="">cbd oil weight loss reviews</a> cbd oil infused tumeric

  74. cbd oil lube <a href="">cbd oil e juice</a> 100% thc free cbd oil

  75. giving your dogs cbd oil <a href="">is sera relief cbd oil rated</a> cbd oil and opiates

  76. yooforic cbd oil <a href="">king canine cbd oil</a> you sell cbd oil and someone gets sick

  77. does hemp oil contains cbd <a href="">cbd oil to quit smoking</a> can u fname cbd oil

  78. cbd oil for hair conditioning <a href="">suthe cbd oil</a> cbd oil in cleveland ohio

  79. cbd oil for vape pen <a href="">pure med cbd oil</a> cbd infused coconut oil

  80. is cbd oil legal in pa <a href="">cbd oil work</a> cbd oil printable information

  81. cbd oil drops 20 mg <a href="">tincture cbd oil</a> cbd oil asthma

  82. cbd oil laws in the us <a href="">thorne cbd oil</a> cbd oil with htc

  83. ky cbd oil for sale <a href="">where to buy real cbd oil</a> zuri cbd oil

  84. Read More <a href="">straight from the source</a> check over here

  85. Read More <a href="">browse around this site</a> he said

  86. at Bing <a href="">Check This Out</a> inquiry

  87. these details <a href="">try this</a> More about the author

  88. read review <a href="">click over here</a> get more info

  89. their explanation <a href="">good</a> This site

  90. see this website <a href="">website</a> secret info

  91. the advantage <a href="">image source</a> look at more info

  92. web site <a href="">try this</a> page

  93. Web Site <a href="">her explanation</a> look what I found

  94. sneak a peek at this web-site. <a href="">More about the author</a> click this site

  95. click over here now <a href="">like it</a> Continue

  96. Going Here <a href="">see here</a> view publisher site

  97. continue reading this <a href="">Going Here</a> visit here

  98. dig this <a href="">Source</a> Learn More Here

  99. click this site <a href="">continue</a> check out this site

  100. talking to <a href="">view it</a> advice

  101. Check This Out <a href="">more help</a> view website

  102. i was reading this <a href="">More about the author</a> click here for info

  103. her comment is here <a href="">my company</a> Read Full Article

  104. see <a href="">Click Here</a> Web Site

  105. Check This Out <a href="">site</a> Get More Info

  106. on the main page <a href="">web link</a> lowest price

  107. additional info <a href="">useful reference</a> you can look here

  108. additional info <a href="">site</a> view website

  109. see this site <a href="">get more info</a> see post

  110. More Bonuses <a href="">what is it worth</a> click for source

  111. useful link <a href="">Related Site</a> get more information

  112. Recommended Reading <a href="">have a peek at this website</a> find out here

  113. this hyperlink <a href="">Continued</a> have a peek at this site

  114. read this <a href="">Learn More Here</a> my review here

  115. navigate to this web-site <a href="">continued</a> great site

  116. useful source <a href="">published here</a> read

  117. look at here <a href="">more information</a> web link

  118. click now <a href="">blog</a> why not try here

  119. have a peek at this web-site <a href="">official source</a> Link

  120. check my site <a href="">Visit Website</a> home page

  121. plus cbd oil gold formula <a href="">kangaroo cbd oil</a> how to make cbd vape oil from isolate

  122. where to buy viagra without a prescription <a href="">viagra car commercial</a> viagra erection ejaculation gif

  123. why choose levitra over viagra <a href="">overdose on viagra</a> side effects from viagra

  124. which cbd oil is best for pain <a href="">hemp cbd oil vs cbd oil</a> american science cbd oil reviews

  125. photos senior cocks on viagra fucking+ <a href="">chewable viagra soft tabs</a> viagra prices

  126. phyllis newman telling joke about jewish man and viagra <a href="">is viagra legal in colombia</a> viagra is called ta

  127. will cbd oil help pancreatitis in dogs <a href="">market on main somerset kentucky cbd oil</a> full spectrum cbd oil near me

  128. cbd oil for anxiety cost <a href="">cbd oil now legal in all 50 states</a> the best full spectrum cbd oil

  129. cbd versus hemp oil <a href="">cbd oil is positive in urine drug screen</a> cbd oil on ebay

  130. can i take viagra <a href="">compare medical costs in the military of transgenderbpeople and viagra</a> viagra from us pharmacy

  131. low thc cbd oil <a href="">cbd oil where to find</a> congress legalizes cbd oil

  132. order viagra paypal <a href="">how does viagra affect women</a> viagra or cialis better

  133. natural viagra watermelon <a href="">how to get viagra or cialis</a> how many viagra will a doctor prescribe

  134. where to buy cbd oil in rochester ny <a href="">cbd oil and lotensen</a> cbd oil for migraines reddit

  135. can you cut viagra in half <a href="">does viagra increase size</a> figral vs viagra

  136. cbd oil in williamsburg michigan <a href="">mixing cbd oil with asprin</a> cbd oil benifit

  137. is it safe to take 200 mg of viagra <a href="">viagra alternatives non perscription</a> does viagra work is it is very old

  138. buy viagra canada <a href="">will viagra stop working</a> viagra time to take effect

  139. best cbd oil for seizures <a href="">fibromyalgia and cbd oil</a> benefits cbd oil

  140. cbd oil austin texas <a href="">is cbd oil an antiimflammatory</a> cbd oil erowid

  141. compare price viagra cialis levitra <a href="">generic cialis in us</a> cialis mode of action

  142. order prescription drugs online <a href="">no prescription ed drugs</a> prescription drugs online order

  143. difference in cialis and viagra <a href="">cialis 10mg dosage</a> cialis covered by health insurance

  144. cost of cialis phillipines <a href="">cialis 5 mg for sale</a> cialis testimonials forum

  145. b+ pure cbd oil <a href="">cbd oil outlet rock hill sc</a> bluegrass cbd oil

  146. can cialis cause ed <a href="">cialis 30 day free</a> how long does liquid cialis last

  147. cbd oil and stroke <a href="">nuleaf cbd oil dosage</a> cbd oil copd

  148. Leave a Comment