Copyright: © 2007-2009, Spiros Georgaras <sng@hellug.gr> | Single page |
Last update: 23/12/2009 | Printable version |
![]() | |
Previous | Contents | Next |
When working with with disks/partitions and system backup, restoration and rescue, it is vital to have a very good understanding of the basic concepts of booting, partitioning etc.
This page is by no means a guide to these concepts. It just pin-points some of them, so the user can look them up in more thorough sources.
A file system is the way in which files are named and where they are placed logically for storage and retrieval. The DOS, Windows, OS/2, Macintosh, and UNIX-based operating systems all have file systems in which files are placed somewhere in a hierarchical (tree) structure. A file is placed in a directory (folder in Windows) or subdirectory at the desired place in the tree structure.
File systems specify conventions for naming files. These conventions include the maximum number of characters in a name, which characters can be used, and, in some systems, how long the file name suffix can be. A file system also includes a format for specifying the path to a file through the structure of directories.
Each operating system provides special tools to initialize/format the file system types it supports. Examples of such tools are format in DOS/Windows, mkdosfs and mkfs in Linux, etc.
A partition is a logical division of a hard disk created so that you can have different operating systems on the same hard disk or to create the appearance of having separate hard drives for file management, multiple users, or other purposes.
In Windows, a one-partition hard disk is labelled the "C:" drive ("A:" and "B:" are typically reserved for diskette drives). A two-partition hard drive would typically contain "C:" and "D:" drives. (CD-ROM drives typically are assigned the last letter in whatever sequence of letters have been used as a result of hard disk formatting, or typically with a two-partition, the "E:" drive.).
In UNIX-based systems, a partition is used to host the / (root) file system, and optionally the /opt, /usr and /home file systems. There may also be a swap partition, which doesn't host any file system.
Each operatin system provides some kind of tool to create and manage partitions. Examples of such tools are fdisk in DOS/Windows, fdisk, sfdisk and parted in Linux, etc.
When you boot an operating system into your computer, a critical part of the process is to give control to the first sector on your hard disk, which is called the Master Boot Record (MBR).
The Master Boot Record is also sometimes called the "partition sector" or the "master partition table" because it includes a partition table that defines how many partitions the hard disk has, the size of each, and the address where each partition begins.
A boot loader, also called a boot manager, is a small program which usually resides in the MBR of the first disk (i.e. primary master ATA disk) of the system, that places the operating system (OS) of a computer into memory.
Microsoft Windows or the Mac OS provide their own Boot Loaders, beeing able to load only the operating system in question. Linux, on the other hand, provides two alternatives: LILO and GRUB, which have Multiboot capabilities.
All the programs presented previously are able to create and delete partitions on any disk, with qparted at the top of the list, as it is a graphic tool.
Changing the ID (type) of a partition is easy using qparted, but it is as easy with sfdisk. In order to change a FAT32 partition to HPFS/NTFS (NTFS), the following command is enough:
sfdisk --change-id /dev/hda1 c 7
where
c: existing partition ID
7: new partition ID
Of course the partition will be usable only after it is formated with NTFS format, or after restoring a NTFS partition to it, using Clonezilla Live.
Finally, enlarging a partition is a two step process:
Fortunatelly, Clonezilla Live takes care of both these steps for us, when instructed to do so (using the parameter -r).
The following table presents known partition types along with their IDs:
0 Empty 80 Old Minix
1 FAT12 81 Minix / old Linux
2 XENIX root 82 Linux swap / Solaris
3 XENIX usr 83 Linux
4 FAT16 <32M 84 OS/2 hidden C: drive
5 Extended 85 Linux extended
6 FAT16 86 NTFS volume set
7 HPFS/NTFS 87 NTFS volume set
8 AIX 88 Linux plaintext
9 AIX bootable 8e Linux LVM
a OS/2 Boot Manager 93 Amoeba
b W95 FAT32 94 Amoeba BBT
c W95 FAT32 (LBA) 9f BSD/OS
e W95 FAT16 (LBA) a0 IBM Thinkpad hibernation
f W95 Ext'd (LBA) a5 FreeBSD
10 OPUS a6 OpenBSD
11 Hidden FAT12 a7 NeXTSTEP
12 Compaq diagnostics a8 Darwin UFS
14 Hidden FAT16 <32M a9 NetBSD
16 Hidden FAT16 ab Darwin boot
17 Hidden HPFS/NTFS b7 BSDI fs
18 AST SmartSleep b8 BSDI swap
1b Hidden W95 FAT32 bb Boot Wizard hidden
1c Hidden W95 FAT32 (LBA) be Solaris boot
1e Hidden W95 FAT16 (LBA) bf Solaris
24 NEC DOS c1 DRDOS/sec (FAT-12)
39 Plan 9 c4 DRDOS/sec (FAT-16 < 32M)
3c PartitionMagic recovery c6 DRDOS/sec (FAT-16)
40 Venix 80286 c7 Syrinx
41 PPC PReP Boot da Non-FS data
42 SFS db CP/M / CTOS / ...
4d QNX4.x de Dell Utility
4e QNX4.x 2nd part df BootIt
4f QNX4.x 3rd part e1 DOS access
50 OnTrack DM e3 DOS R/O
51 OnTrack DM6 Aux1 e4 SpeedStor
52 CP/M eb BeOS fs
53 OnTrack DM6 Aux3 ee EFI GPT
54 OnTrackDM6 ef EFI (FAT-12/16/32)
55 EZ-Drive f0 Linux/PA-RISC boot
56 Golden Bow f1 SpeedStor
5c Priam Edisk f4 SpeedStor
61 SpeedStor f2 DOS secondary
63 GNU HURD or SysV fd Linux raid autodetect
64 Novell Netware 286 fe LANstep
65 Novell Netware 386 ff BBT
70 DiskSecure Multi-Boot
75 PC/IX
The partitions you are most likely to see in use, are:
Previous | Contents | Next |