Sunday, November 15, 2009
weekend ends...
Thursday, November 12, 2009
I M BAK!!
Monday, June 15, 2009
FAT filesystem
The FAT file system actually refers to a family of filesystems consisting of the VFAT, FAT12,FAT16,FAT32, the numbers indicating the number of bits used to indicate the cluster number(FAT32 is an exception). The name comes from the logical structure that the file system uses-the File Allocation Table. This filesystem was used by DOS on the first IBM PCs and became a standard for the PCs that followed. The file allocation table provides information about allocation units. Now where did they come up? Well, generally, we think of files to be referred by the number of sectors of size 512 bytes on the disk. However one can imagine the performance issues that will be encountered when keeping track of big files in terms of the sectors. Hence the idea to group sectors into bigger chunks called clusters. The process by which clusters are assigned to files is called allocation. Hence clusters are called allocation units ranging from sizes of 4 to 64 sectors.
Every file must be allocated an integer number of clusters. This means that if a volume uses clusters that contain 8,192 bytes, an 8,000 byte file uses one cluster (8,192 bytes on the disk) but a 9,000 byte file uses two clusters (16,384 bytes on the disk). This is why cluster size is an important consideration in making sure you maximize the efficient use of the disk--larger cluster sizes result in more wasted space because files are less likely to fill up an integer number of clusters. The cluster size is determined primarily by the size of the disk volume after partition: generally speaking, larger volumes use larger cluster sizes.
The structure of a volume that is formatted using FAT filesystem has the structure as shown:
| Partition Boot Sector | FAT 1 | FAT 2(Copy) | Root folder | Other folders and files |
The Partition Boot sector:
The Partition boot sector is the first sector on a logical volume. A logical volume may be a primary partition, or a logical volume within an extended partition or a composite of two or more partitions. This file system boot sector is different from the master boot record(MBR). MBR is the first sector on the whole hard disk, while the partition boot sector is the first sector on a particular partition within the disk. During the boot process, after the POST is performed, the BIOS first finds a boot device, then loads the boot sector of the device. For a hard disk,this is the MBR. The control is passed on to the MBR code. The MBR code helps to load the boot sector of the active primary partition. Upto this point the boot process remains independent of the file system or the operating system used.
Now in case of FAT volumes that have Windows NT installed, the FAT boot sector is responsible for identifying the location of the file "NTLDR" on the volume, loading it into memory, and transferring control to it. Since execution control is passed on to the boot sector, there is need for an executable to be present at its first location. This is generally a JUMP instruction that serves to jump over the following "non-executable" locations. Then comes the OEM id that identifies the operating system that formatted the volume. Following the OEM id, there is a structure known as the BIOS parameter block that provides enough information to the executable part to find the NTLDR. It consists of info like sectors per cluster, sector size, number of FATs(including the multiple copies), root entries etc. On a bootable or non-bootable volume, the BIOS parameter block is followed by execuable code. The last 2 bytes in any boot sector are always 0x55, 0xAA.
The File Allocation Table:
The file allocation table contains the following types of information about each cluster on the volume :
* Unused (0x0000)
* Cluster in use by a file
* Bad cluster (0xFFF7)
* Last cluster in a file (0xFFF8-0xFFFF)
To protect the volume, two copies of the table are kept, in case one becomes damaged. In addition, the file allocation tables must be stored in a fixed location so that the files needed to start the system can be correctly located.
There is no organization to the FAT folder structure, and files are given the first available location on the volume. The starting cluster number is the address of the first cluster used by the file. Each cluster contains a pointer to the next cluster in the file, or an indication (0xFFFF) that this cluster is the end of the file.
The Root Folder:
The root folder contains entries for each file and folder on the root. In the conventional FAT system, the root directory is fixed in place after the 2 FATs. The file system hierarchy is thus anchored at the root directory. Even the size of the root directory has a limit. It can a hold a maximum of 512 entries in case of an hard disk. This is in contrast to the regular directory that can be placed anywhere and can have a variable size. One of the improvements introduced in the FAT32 version of the FAT file system was to remove these restrictions on the root directory. Under FAT32, the root directory is treated much more like a regular directory, and can be relocated and expanded in size like any other. An entry in the root directory contains information like name, attribute, time and date when created, last accessed date, last modified date and time, starting cluster number in the FAT and the file size. A FAT file has four attributes that can be turned on or off by the user-system file, archive file, read-only and hidden.
The root folder is followed by the storage of the other files and folders.
FAT32:
FAT32 is a derivative of the File Allocation Table (FAT) file system that supports drives with over 2GB of storage. Because FAT32 drives can contain more than 65,526 clusters, smaller clusters are used than on large FAT16 drives. This method results in more efficient space allocation on the FAT32 drive. The FAT32 file system includes four bytes per cluster within the file allocation table. However, the high 4 bits of the 32-bit values in the FAT32 file allocation table are reserved and are not part of the cluster number.
Ref: http://www.ntfs.com/fat-systems.htm
Adding Categories to Blogs
To explain the process in brief, I will tell you how I did it. First make this html script ready in any text editor. For me the script is:
<h2 class="sidebar-title">Categories</h2>
<u1>
<li><a href="http://e-nertia.blogspot.com/search/label/Introduction">Introduction</a></li>
<li><a href="http://e-nertia.blogspot.com/search/label/Technical">Technical</a></li>
<li><a href="http://e-nertia.blogspot.com/search/label/Travel">Travel</a></li>
</u1>
Replace the "http://........blogspot.com" with your blog homepage link and change the names of the topics as you wish(for me they are Introduction, Technical..). Make sure that the term in the link and the actual label are the same.
Now go to the Layout Page. It must be showing a skeleton of your blog page. The part of it that shows your blog archive and profile must also be having a link "Add a Gadget". Click on the link . In the new window that opens, click on the HTML/Java script option. Paste the HTML script that you have written in the text editor into the content box. No title is required. Save the changes. Done.
Now whenever you are writing a post that belongs to a particular topic, write in the box for the label the exact category that you have made for it. So for this post i wrote the label as Technical.
Happy Organisation!!
The challenge I faced during writing of this blog was printing the HTML script as text to show you the script. I hardly have any idea of HTML scripts. I saw the page sources of sites that have showed examples of HTML scripts. So, as a piece of information, i have replaced all the > with > and < with <
Friday, July 18, 2008
Alibaug Chi Sahal
Alibaug was a unanimous decision for a 2 day vacation since the more our three brains thought, the more we were confused. We booked the ST tickets a day earlier. The bus left Borivali at 5:15 am and two of us boarded at Goregaon(W) and one friend boarded at Andheri(W). The stop is opposite to the Filmistan studio in Goregaon and it’s near the Andheri Post in Andheri. Finally the trip started for the three of us. We did start babbling about movies(comparing the Lord of the Rings and the Harry Potter one). But that ended as soon as the mountains and enchanting scenes began to appear. We reached Alibaug stand at around 9:30 am. Then we went to Alibaug beach, scanned it a bit, and found it not worth of staying. So we left and came back to Alibag stand. We took an ST to Kihim beach, since I had heard of a resort near Kihim from an acquaintance. It’s called Sannidhya resort and it’s approved by M.T.D.C. Luckily, the last stop of the ST bus coincided with the resort. It’s a nice place to stay, a quite rustic one. We freshened up and sauntered around the place to find something that qualifies as a breakfast item since we had nothing since morning. Finally we found a shop that agreed to make “kanda pohe” for us at 12 noon. An hour later, we had lunch. It was good, both veg and non-veg. While feasting on the food, we had a chat with the guy who was serving us, and came to know that there’s a museum by the name of Karmarkar Museum at Sasavne which houses human sculptures. So after lunch we headed to Sasavne for the museum. This museum indeed has some exquisite sculptures, but for us muggles, they all were quite the same. It was closed when we reached there and was opened only for us. After returning back to the resort, we had tea and immediately left to enjoy the Kihim beach, after all Alibaug is equivalent to its beaches. We were a bit surprised to find the beach deserted. It was just the three of us on the whole beach and two or three fishermen very far away from us. The waves were awesome, but one has to be careful about the rocks that line the beach, since they can elude one’s sight at high tide and can prove perilous. After being content enjoying the force of the sea, we made our way back to the resort. That night, when we were having dinner, the guy who served us asked us not to go to the Kihim beach since there was news that few tourists got stung by jellyfishes. We were shocked since we had seen hundreds of them lying on the beach and yet didn’t give it much importance. Lucky us!Next day, we left the resort and headed to the Birla Mandir. This temple is situated near Revdanda. It was a long journey from the resort but the sight of the temple was quite rewarding. It must be among the few well maintained temples in Maharashtra. A temple in marble, the structure is quite fascinating. The temple is actually at its best when the lighting and the fountains come on. It must be a great sight to watch but we found ourselves there at the wrong time. We did not even find the poojari since the temple was closed at 11 am and was to open again around 4:30 pm. After leaving the temple, we found out from the locals that there were two more places that could be visited- Korlai fort and Kashid beach- and we had to select only one from them. We came to know that the fort wouldn’t be accessible at this time of the year. So Kashid beach it was. Another two Vikrams to take us to Kashid beach. The Vikram is the 8-seater rickshaw that is very common in Alibaug, and is also seen in Pune. But as you know, we Indians are very efficient in the usage of space. So this 8-seater is sometimes used as an uncomfortable 10 one and one that we got into broke all records with a mighty 12.Before going for the beach, we had lunch in one of the ‘khanavals’ ,around 2 km from the beach, where we got to taste local sea food and after getting an idea about the bus timings, headed for the beach .We found the Kashid beach better than the Kihim beach. There are hammocks attached on the beach where you can rest. The overall scenery in and around the Kashid beach was indeed enchanting, with the white sands and the surrounding hills. Here too, we could see the jellyfish lying on the beach. Yet, we risked it to get into the water and it was quite fun. Finally, we headed back to the stop but found that a bus had just passed and the next one to Mumbai would be after an hour or so. So, instead we got into a Vikram and went to the Alibaug stand and boarded an ST bound for Mumbai Central. It was a bumpy ride back home with a backseat in the ST, but with lots to talk about, it hardly matters where you are.........
Routes that we took:
Karmarkar Museum: From the resort->walking upto Chondi naka->Vikram to Sasavne
Kihim beach: 2 mins walking from the resort
Birla Mandir: From the resort->walking upto Chondi Naka->Vikram to Revdanda->Vikram to Birla Mandir
Kashid Beach: From Birla Mandir->Vikram to Revdanda->Vikram to Kashid beach
Some tips:
We felt that we should have come to Kashid beach first. So it would be better to consider going to Kashid first and then to Kihim.
Be very careful of the rocks at Kihim. They get submerged under the water at high tide and some can be sharp.
Be sure to get a report of the marine life in the water before getting into the water. In our case, we were very lucky to have enjoyed unhurt, but no one can guarantee it everytime.
Happy Holidaying!!!!!!