Thursday, August 2, 2007
File systems in Linux
This is a beginner's course and one of the concepts that newcomers to Linux find different is the idea of a file system in Linux. That is to say, the way data is stored and managed in Linux.
MS-Windows and Mac users are used to clicking on an icons and dragging the files they want copied to a floppy or another part of the hard drive. Linux users that use KDE or GNOME can also copy files in that way to different parts of the hard drive. However, if you would like to use floppies, we should talk here a bit about the type of file system Linux uses.
MS-Windows, from Windows 95 on up uses a file system called 'vfat' Linux uses a different system called 'ext2'. There are also other types of file systems out there. You may have chosen to have both Windows and Linux installed in your computer. At one point, you might have to access files in the Windows partition of your hard drive. You would use a command called 'mount' to do that. You would also have to indicate as an option in that command that the file system you want to access or "mount" is a Windows 'vfat' file system.
On the same idea, though floppies are becoming somewhat obsolete, you may want to store some files on a floppy or access data on a floppy that someone has given to you. You would also have to use the command 'mount' before you copied data to or got data from a floppy disk. If that person is a Windows user, then you would have to indicate once again that the file system is 'vfat'. If you want to copy data from your Linux partition to a floppy, you would have to format and then "mount" the floppy as a Linux 'ext2' file system.
Formatting a floppy for Linux
Most floppies sold on the market are pre-formatted for MS-Windows. You can copy data from Linux to a Windows formatted floppy with no problem. If you want to copy Linux files to a floppy to be used in another Linux machine or to be used by you later in Linux, then it might be better to format the floppy for Linux's ext2 file system.
We should also say now that this is considered an administration task. You have to be working as 'root' to be doing this. As you get more familiar with Linux, you can use commands such as 'su' to do the work of root on certain occasions when you're not actually working as root. We'll explain this command in later lessons.
To create a linux floppy "by hand", you would place a floppy in the drive and type:
mke2fs /dev/fd0
The command is an abbreviated way of saying "make an ext2 file system". The other part is the device, your floppy drive, which is known to Linux as "fd0" (floppy drive 0). As we mentioned in the first part of the course, everything is a file in Linux, including your floppy drive.
You will hear the customary noise of the floppy drive (some are louder than others - some older ones that I've heard sound like a chain saw) and you will get some output like this:
Linux ext2 filesystem format
and some other information about the size of the floppy etc.
You now have a Linux formatted floppy. You may want to run this command to check if the floppy has defects
e2fsck /dev/fd0
Some windows managers have a nice program to do both the formatting and the checking of the disk at the same time.
MS-Windows and Mac users are used to clicking on an icons and dragging the files they want copied to a floppy or another part of the hard drive. Linux users that use KDE or GNOME can also copy files in that way to different parts of the hard drive. However, if you would like to use floppies, we should talk here a bit about the type of file system Linux uses.
MS-Windows, from Windows 95 on up uses a file system called 'vfat' Linux uses a different system called 'ext2'. There are also other types of file systems out there. You may have chosen to have both Windows and Linux installed in your computer. At one point, you might have to access files in the Windows partition of your hard drive. You would use a command called 'mount' to do that. You would also have to indicate as an option in that command that the file system you want to access or "mount" is a Windows 'vfat' file system.
On the same idea, though floppies are becoming somewhat obsolete, you may want to store some files on a floppy or access data on a floppy that someone has given to you. You would also have to use the command 'mount' before you copied data to or got data from a floppy disk. If that person is a Windows user, then you would have to indicate once again that the file system is 'vfat'. If you want to copy data from your Linux partition to a floppy, you would have to format and then "mount" the floppy as a Linux 'ext2' file system.
Formatting a floppy for Linux
Most floppies sold on the market are pre-formatted for MS-Windows. You can copy data from Linux to a Windows formatted floppy with no problem. If you want to copy Linux files to a floppy to be used in another Linux machine or to be used by you later in Linux, then it might be better to format the floppy for Linux's ext2 file system.
We should also say now that this is considered an administration task. You have to be working as 'root' to be doing this. As you get more familiar with Linux, you can use commands such as 'su' to do the work of root on certain occasions when you're not actually working as root. We'll explain this command in later lessons.
To create a linux floppy "by hand", you would place a floppy in the drive and type:
mke2fs /dev/fd0
The command is an abbreviated way of saying "make an ext2 file system". The other part is the device, your floppy drive, which is known to Linux as "fd0" (floppy drive 0). As we mentioned in the first part of the course, everything is a file in Linux, including your floppy drive.
You will hear the customary noise of the floppy drive (some are louder than others - some older ones that I've heard sound like a chain saw) and you will get some output like this:
Linux ext2 filesystem format
and some other information about the size of the floppy etc.
You now have a Linux formatted floppy. You may want to run this command to check if the floppy has defects
e2fsck /dev/fd0
Some windows managers have a nice program to do both the formatting and the checking of the disk at the same time.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment