Access Linux Files Systems
Access Linux Files Systems
a. Overview of Partitions
systems in partitions.
INSTALLING ANEW DRIVE
• You create file systems and install disk driven When installing Linux. You might need to add a disk to a
working system. For example, you might add a new drive to expand the storage space available on a system.
• Of various types of hard drives, the most common with Linux are
1. ATA,
2. SATA and
3. SCSI.
ATA/IDE DRIVE
• ATA: this is the evolution of the technology formerly called IDE. Until recently. It was the most
popular drive interface used with personal computers.
• Pc motherboards typically feature two ATA drive controllers each with two channels. You can attach
one drive to each channel. With ATA, the first drive controller is called the master and the second is
called the slave.
Primary master = /dev/had
separate controller to each drive. Under Linux, SATA drives show up as follows:
• And so forth
SCSI
• Each SCSI controller supports a maximum of either 7(older SCSI system) or 15 devices, one
of which is the controller itself. Under Linux, these drives show up as follows:
• And so forth
• Disk Partitioning is the process of dividing a disk into one or more logical areas,
often known as partitions, on which the user can work separately. It is one step of
disk formatting. If a partition is created, the disk will store the information about
the location and size of partitions in the partition table. With the partition table,
each partition can appear to the operating system as a logical disk, and users can
read and write data on those disks. The main advantage of disk partitioning is
that each partition can be managed separately
PARTITIONING
2. One used to hold the contents of virtual memory known as the swap partition
• Partition definitions are stored in the first sector of the hard drive in a
structure called the Master Boot Record (MBR) or Master Boot Block
(MBB).
• In Linux, device files are created to represent the partitions. These device
file names mirror the name s of the hard disk and are then numbered
sequentially. For example, the first partition on the primary master IDE
drive (/dev/hda) would be called /dev/hda1
fdisk
• The fdisk tool is the traditional Linux partition editing tool.it is a text-
mode application.
• fdisk stands (for “fixed disk or format disk“) is the most commonly used
command-line based disk manipulation utility for a Linux/Unix system.
With the help of the fdisk command, you can view, create, resize, delete,
change, copy and move partitions on a hard drive using its own user-
friendly text-based menu-driven interface.
• This tool is very useful in terms of creating space for new partitions, organizing space
for new drives, re-organizing old drives, and copying or moving data to new disks. It
allows you to create a maximum of four new primary partitions and a number of logical
(extended) partitions, based on the size of the hard disk you have in your system.
• Where /dev/hdb is the device name of the hard drive you want to manage.
• You can use the fdisk –l command to view a list of drives and
partitions on your compute, as shown below
GPARTED
• The GNOME partition Editor (GParted)is a graphical partition editor. With it, you
can perform all of the same actions you could with fdisk. Many users find Gparted
easier to use. Instead of entering commands, you select from the menu, click buttons
and fill the dialog boxes.
• Gparted is included with many Linux distributions. You can download it from
http://gparted.sourceforge.net you can download a live CD version which you can
put on a CD OR USB drive and then boot from. Doing so enables you to use Gparted
to modify disks used by operating systems such as windows.
FORMATTING A DISK
• While Gparted formats a new partition for you automatically, at the command line you
must perform this step yourself. Once you create a partition with fdisk you must make the
file system with mkfs.
• Mkfs
• The mkfs (make file system) command creates file systems, in other words, it formats your
partition. In general, you use the command like this
Enter sudo fdisk -l To view the list of partition again. This time your
second drive has a valid partition
Fsck and e2fsck
Linux offers various commands for checking and repairing file systems which
are necessary steps after formatting a new partition. The traditional fsck (file
system check) command checks most file system types including ext2, and ext3.
it works as a front end to file system-specific checking program.
Use the following command to check and repair a specific file system
automatically.
Fsck –a /dev/hdx
• Creating disk partitions enables you to split your hard drive into
multiple sections that act independently.
• In Linux, users must structure storage devices (USB and hard drives)
before using them. Partitioning is also useful when you are installing
multiple operating systems on a single machine.
fdisk /dev/sda