background preloader

Filesystem

Facebook Twitter

System

Q & A: The difference between hard and soft links LG #105. By Lew Pitcher I participate in about 30 usenet newsgroups, and in a virtual LUG, and a number of questions keep coming up. I've answered a few of these questions often enough to have 'canned' an answer, which I modify, depending on the circumstances. Here's one, now... Q: Can someone give me a simple explanation of the difference between a soft link and a hard link? The documentation I've read mention these links but make no strong explanations of their meaning and how/when to use them. A: OK, I'll give it a try... Unix files consist of two parts: the data part and the filename part.

The data part is associated with something called an 'inode'. . ---------------> ! The filename part carries a name and an associated inode number. . --------------> ! More than one filename can reference the same inode number; these files are said to be 'hard linked' together. ! On the other hand, there's a special file type whose data part carries a path to another file. ! Now, let's demonstrate some of this... Smart ACL management with Eiciel. The UGO model lets you associate only one group with a file. If you try to define read permissions on a file for user Charlie and read and write permissions for user Alexia, and Charlie and Alexia belong to different groups, you'll see what I mean.

With ACLs, you can specify elaborate permissions for multiple users and groups. Although Eiciel is a GNOME tool, you can run it on KDE as well if you have the necessary GNOME libraries installed. ACL supports is natively available in the 2.6 kernel, and ext2, ext3, XFS, JFS, and ReiserFS filesystems are ACL-capable. You can install Eiciel from official software repositories of your distribution using apt-get or yum. Once installed, Eiciel is available as a standalone application or as a Nautilus extension, but you'll have to restart Nautilus before you can take advantage of the extension. ACLs too rely on the traditional read, write, and execute permissions defined for each user and group. Linux_file_structure.jpg (JPEG Image, 1000x647 pixels) Encrypted Ubuntu 7.04 - How safe can you be? Did you ever live with the fear that somebody may break into your system one day and steal your files?

Well, those days are over, because you can now have an entire encrypted operating system. For this setup, we used a freshly installed Ubuntu 7.04 with up-to-date software, nothing else installed. But the following guide is supposed to work with your actual Ubuntu 7.04 installation (no reinstall needed).

Beware though: if you don't have the partitions setup like its shown below, this will NOT work. I will NOT be held responsible for any data loss on your hard drive if this process will NOT work for you, so you have been warned: TRY THIS AT YOUR OWN RISK! Things needed: - Ubuntu LiveCD- cryptsetup software Here is how your partitions should look like: /dev/sda1 -> /boot (about 150-200 MB, mine is 150 MB)/dev/sda2 -> swap (double as your computer RAM, mine is 2 GB because I have 1 GB of RAM)/dev/sda3 -> root (/) (should be more than 5 GB, mine is 35 GB) STEP 1 Boot from the LiveCD root (hd0,0)

Use kfsmd to keep track of changes in your filesystems. By Ben Martin on January 24, 2008 (7:00:00 PM) There are packages available for both 32- and 64-bit Fedora 7 and 8 and Ubuntu 7.10 Gutsy, as well as 32-bit packages for openSUSE 10.3. You can also download a repo file, which can be used with Fedora 8 and yum. Placing the repo file into /etc/yum.repos.d allows you to install kfsmd and its dependencies with yum install kfsmd on a Fedora 8 machine. You can also compile directly from source if that is your preference. Command-line clients for kfsmd come in two categories: monitoring and logging.

The monitoring client produces output on the console whenever something happens to a filesystem you are watching. You can log to either a Berkeley DB4 file or a PostgreSQL database. The following session shows a simple directory monitoring session using kfsmd. If you specify a directory to monitor with a full filesystem path, then kfsmd also monitors existing and newly created subdirectories by default. Logging with kfsmd. Anatomy of the Linux file system. Basic file system architecture The Linux file system architecture is an interesting example of abstracting complexity. Using a common set of API functions, a large variety of file systems can be supported on a large variety of storage devices.

Take, for example, the read function call, which allows some number of bytes to be read from a given file descriptor. The read function is unaware of file system types, such as ext3 or NFS. Back to top What is a file system? I'll start with an answer to the most basic question, the definition of a file system. Mounting Associating a file system to a storage device in Linux is a process called mounting. To illustrate the capabilities of the Linux file system layer (and the use of mount), create a file system in a file within the current file system. Listing 1. . $ dd if=/dev/zero of=file.img bs=1k count=10000 10000+0 records in 10000+0 records out $ You now have a file called file.img that's 10MB. . $ losetup /dev/loop0 file.img $ Listing 2.

Listing 3.