--- trunk/www/onepage.html 2010/07/15 20:54:27 84 +++ trunk/www/onepage.html 2010/07/16 15:38:22 85 @@ -73,7 +73,7 @@

Wellcome

25/05/2010 - v 3.1.0

-

Last update: 13/07/2010

+

Last update: 16/07/2010

@@ -2403,7 +2403,7 @@ While partitioning, an user error or a bug can damage your partitions.

Creating a disk image of the disk to be
partitioned beforehand is highly recommended.
-The following pressentation has been made using
SystemRescueCD v 1.4.0 +The following pressentation has been made using
SystemRescueCD v 1.5.8

Some theory [^]

What is a partition? [^]

@@ -2411,14 +2411,13 @@

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.

-

What is the difference between primary, extended and logical partitions? [^]

+

What is the difference between primary, extended and logical partitions? [^]

Information about partitions is saved in so-called partition table in Master Boot Record. MBR itself is only 512 bytes in size, and only 64 bytes are reserved for partition table. That's not enough, and there are many workarounds to bypass limitations caused by the size, for example logical block addressing. Extended partitions are another workaround.

Partition table can only store information about four partitions. If one has, for example, two GNU/Linux distributions on the same disk, both of them having separate root partitions, shared /home and shared swap, the partition number limit has been hit already.

A partition that is mentioned in the partition table is called primary partition. Because of the limit, one disk can only contain 1-4 primary partitions.

An extended partition fixes the problem simply by containing more boot records, called Extended Boot Records (EBR). Each EBR contains information about one logical partition and, if the extended partition contains multiple logical partitions, link to the next EBR. Thus, an extended partition can contain unlimited amount of logical partitions.

Extended partition contains only EBRs and logical partitions (and maybe unallocated space). Extended partition doesn't contain any filesystem and files can't be stored in it. Of course, logical partition can contain any filesystem (or be unformatted).

-

Extended partition itself must be primary partition: an extended partition can't be within another extended partition. In addition, a disk can contain only one extended partition.

-

Logical partitions can always be used for storing data: any operating system can see logical partitions. GNU/Linux distributions can be installed to logical partitions as well, but Windows requires a lot of tweaking. See this outdated guide.

+

Logical partitions can always be used for storing data: any operating system can see logical partitions. GNU/Linux supports both multiple primary extended partitions and extended partitions within each other, while Windows supports only the latter. GNU/Linux distributions can be installed to logical partitions as well, but Windows requires a lot of tweaking. See this outdated guide.

What is LVM? [^]

LVM means "Logical Volume Manager". It allows creating volume groups on top of hard drives and logical volumes within volume groups. Logical volumes are NOT the same thing as logical partitions!

Volume groups can be created very flexibly: a volume group can allocate, for example, the first half of the first hard drive and the second half of the third drive. One can even create a massive volume group containing all storage he/she has.

@@ -2435,8 +2434,9 @@

What is journaling? [^]

Ideally, data in a partition never corrupts. But, in the real world, there are power failures and operating system freezes. And if a computer is forcefully shut down while something is written to the drive, the write operation can't be finished. That can damage the filesystem and destroy any files in the partition.

Journaling partially fixes that problem by writing most changes to the disk twice: first to a special area called journal and, after that, to the filesystem itself. If power is lost while writing to the journal was in progress, the partial change is just ignored and never committed to the filesystem itself. If power failure or OS freeze happened while writing to filesystem itself, the write operation is finished by using the information in journal.

-

Journaling helps most of the time when the computer has been forcefully shut down, but not always. Due to performance reasons, only some write operations are written to the journal, mostly the biggest operations. Of course, journaling doesn't help if that particular operation that was in progress while power was lost didn't go through the journal. Journaling also doesn't protect from everything: for example, using ext4 filesystem in conjuction with programs that write a lot of files in a short time can result in massive data loss, regardless if journaling is enabled or not.

-

In addition, journaling reduces performance. It causes more writes to the disk. That's not a big problem on mechanical hard drives, but on SSDs (Solid State Drives) and thumb drives write speed is much slower than read speed. They also have a limited number of writing cycles, so journaling reduces their lifetime. I (Jyrki) actually use ext2 and FAT32 filesystems on my external SSD drive because they do NOT support journaling at all.

+

Journaling is always a trade-off between reliability and performance. In fact, the ext3 and ext4 filesystems support multiple journaling modes in order to allow the user to choose the optimal compromise. The most popular choices are ordered and writeback.

+

Both modes only write metadata changes to the journal before committing them: data itself is written directly to the main filesystem. The difference between the modes is that ordered mode guarantees that the data is written before the change is marked as committed. The difference may sound small, but in some cases ordered mode causes horrible performance. In Linux 2.6.30, the default journaling mode was changed to writeback - and it was quickly found out that writeback mode may cause massive data loss. See this forum post for details. Most GNU/Linux distributions are now using ordered mode as the default again.

+

In addition, on SSDs (Solid State Drives) and thumb drives write speed is much slower than read speed. They also have a limited number of writing cycles, so journaling reduces their lifetime. Thus, I (Jyrki) recommend against using journaling fileystems on such drives.

What are the differences between most popular filesystems? [^]

The following table quickly describes the most important differences between them.

@@ -2489,7 +2489,7 @@ - + @@ -2497,22 +2497,23 @@ - - + +
ext4NoNo*** Native 16 GB-16 TB* Yes
exFATNative (Vista/7)**NoBuilt-in (Vista/7)**3rd party driver 64 ZB No Yes

* Depends on cluster size
-** This update adds exFAT support to Windows XP

+** This update adds exFAT support to Windows XP
+*** Ext2read makes accessing ext4 partitions possible, but it's not a driver and the access is read-only

Operating system support:

Filesystems [^]

This section contains more information about most popular filesystems.

@@ -2520,7 +2521,7 @@

The initial version of FAT (File Allocation Table), now referred as FAT12, was designed for floppy disks. A FAT12 partition can only be up to 32 megabytes in size. After that, PCs equipped with hard drives were introcuded by IBM and the sizes of hard drives began growing. Microsoft answered the need by developing first initial FAT16 and then final FAT16.

FAT16 partition can be up to two gigabytes in size. In the middle of 1990s, that limit was becoming a problem. Microsoft pushed the limit up by updating FAT again.

FAT32 was first introduced with Windows 95 OSR2. Windows 98, Windows Me, Windows 2000 and newer support FAT32 too. Linux kernel has supported FAT32 almost as long as Windows, but booting GNU/Linux from FAT32 partition is difficult and actually requires DOS to be installed in the partition as well. (more information)

-

FAT32 partition can be up to two terabytes in size. As of now (March 2010), there are hard drives that hit the limit, but don't exceed it. A single file within FAT32 partition can be up to four gigabytes in size.

+

FAT32 partition can be up to two terabytes in size. As of now (July 2010), there are hard drives that hit the limit, but don't exceed it. A single file within FAT32 partition can be up to four gigabytes in size.

Because FAT32 is, in the end, based on FAT12, it has very few features. It doesn't support file permissions, hard/symbolic links, encryption, compression, alternative data streams, journaling... It lacks support for nearly anything that defines a modern filesystem. However, due to very few features, FAT32 is very fast filesystem if it's not fragmented or on a Flash-based drive. Mind you, FAT32 fragments very fast.

Due to excellent operating system support, I recommend FAT32 for storing files which should be accessible in both Windows and GNU/Linux. FAT32 is also a good filesystem on Solid State Drives and thumb drives due to its performance.

ext2 [^]

@@ -2530,10 +2531,10 @@

The best property of ext2 is extensibility. The superblock contains information about which version the filesystem is (ext2, ext3 or ext4) and which extensions and features are in use. By using these pieces of information, the operating system or driver can decide whether or not mounting the partition is safe. That's the most important reason why most GNU/Linux distributions still use successors of ext2 as default filesystems.

Depending on cluster size, ext2 partition can be up to 2-32 terabytes in size. File size limit is 16 GB-2 TB.

Ext2 supports file permissions, both hard and symbolic links and extended file attributes. Encryption, compression and journaling are unsupported.

-

Due to lack of journaling support and existence of Windows drivers, I recommend using ext2 if you're going to install GNU/Linux on a SSD drive and want to be able to access files within Windows too. In fact, that's exactly the setup I have.

+

Due to lack of journaling support and existence of Windows drivers, I recommend using ext2 if you're going to install GNU/Linux on a SSD drive and want to be able to access files within Windows too.

However, lack of journaling support is the worst limitation of ext2. And what was done in order to get rid of the limitation?

ext3 [^]

-

Ext3, the successor of ext2, was introduced in Linux kernel on November 2001. It supports journaling, can be grown online and indexes large directories.

+

Ext3, the successor of ext2, was introduced in Linux kernel on November 2001. It supports journaling, can be grown online and optionally indexes large directories.

Ext2 IFS and Ext2fsd can mount ext3 partition as ext2 if the journal is empty. (If it's not, something is wrong - journal is always emptied when the partition is unmounted or the computer is shut down.) Thus, ext3 support under Windows is just as good/bad as ext2 support.

Partition and file size limits are the same as in ext2: partition size limit is 2-32 TB and file size limit 16 GB-2 TB, depending on cluster size.

Due to journaling support and existence of Windows drivers, ext3 is a good choice if you're going to install GNU/Linux on a mechanical hard drive and want to be able to access files within Windows.

@@ -2541,7 +2542,7 @@

Linux kernel support for ext4, the successor of ext3, was marked stable code on October 2008. Ext4 contains multiple performance and stability improvements over ext3.

The most important new feature is extents. An extent is a contiguous area of storage that has been reserved for a file. When a process starts to write to a file, the whole extent is allocated even before the write operation begins. The idea is that even if the file is larger than expected, it doesn't fragment if it doesn't exceed the size of the extent.

Another important improvement is larger partition size limit: an ext4 partition can be even one exabyte in size. (An exabyte is a million terabytes.) In addition, a directory within an ext4 partition can contain up to 64 000 subdirectories (instead of 32 000, as in ext2/3) and timestamps are much more accurate. The file size limit is 16 GB-16 TB, depending on cluster size.

-

Unfortunately, Ext2 IFS and Ext2Fsd don't support ext4 and are unable to mount ext4 partition if extents are enabled. They can be disabled, but other improvements of ext4 aren't that important for most people - using ext2 or ext3 is just easier.

+

Unfortunately, Ext2 IFS and Ext2Fsd don't support ext4 and are unable to mount ext4 partition if extents are enabled. They can be disabled, but other improvements of ext4 aren't that important for most people - using ext2 or ext3 is just easier. It is also possible to keep extents enabled and browse the partition using Ext2read, but Ext2read doesn't allow the user to write to the partition.

Due to its features, ext4 is a good filesystem on computers that only have GNU/Linux installed. Because journaling can be disabled, it is suitable for Solid State Drives and thumb drives too.

NTFS [^]

At the end of 1980s, IBM and Microsoft were developing OS/2 operating system. Both companies expected OS/2 1.1, released on 1988, to be the first popular operating system having a GUI, Presentation Manager. Even though it didn't become too popular during its first years, Microsoft didn't complain: Windows 2 didn't sell any better.

@@ -2554,18 +2555,18 @@

exFAT [^]

NTFS is a great filesystem, but due to its complexity and journaling, it's not suitable for Flash-based drives. Even Microsoft itself has recommended using FAT32 on removable Flash media.

However, FAT32 only allows files up to four gigabytes in size. The limit is already becoming too small, for example a DVD disc image can exceed that limit. In addition, FAT32 lacks file permission support. In order to get rid of these limitations, Microsoft took FAT from its grave and updated it one more time.

-

ExFAT (extended FAT), also known as FAT64, was introduced with Windows CE 6.0, on November 2006. Windows Vista SP1, Windows 7 and newer support exFAT too, and by installing this update Windows XP can be extended to support exFAT as well. Unfortunately, the only read-write exFAT driver for GNU/Linux (Tuxera exFAT for Embedded Systems) is payware.

+

ExFAT (extended FAT), also known as FAT64, was introduced with Windows CE 6.0, on November 2006. Windows Vista SP1, Windows 7 and newer support exFAT too, and by installing this update Windows XP can be extended to support exFAT as well. GNU/Linux drivers are available too, but currently none of them are both stable and free. The best option seems to be exfat, an open-source driver in beta stage.

The partition and file size limits of exFAT are the same: 64 zettabytes. Another important improvement is file permission support that, oddly, is lacking in Windows Vista. In addition, a directory within an exFAT partition can contain up to 2 796 202 files (instead of 65 536, as in FAT32) and timestamps have become more accurate.

No operating system can be installed to an exFAT partition, so such partitions can only be used for data storage. Due to lack of journaling and support for huge files, exFAT is a good filesystem on Solid State Drives and thumb drives that are only used within Windows Vista and/or 7.

Partition list [^]

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
+ 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
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
@@ -2609,21 +2610,20 @@ 75  PC/IX

The partitions you are most likely to see in use, are:

Partitioning example [^]

@@ -2658,15 +2658,15 @@

I right-click the unallocated area and select New.

-

I select Extended Partition as the partition type. The size was already 998 megabytes (the maximum) and as said, an extended partition doesn't contain any filesystem. I click Add.

+

I select Extended Partition as the partition type. The size was already 1000 megabytes (the maximum) and as said, an extended partition doesn't contain any filesystem. I click Add.

I right-click the unallocated area within the extended partition and select New.

-

I choose the ext4 filesystem and enter 798 MB as the partition size. After that, I click first the Free Space Following (MiB) combo box and then Add.

+

I choose the ext4 filesystem and enter 799 MB as the partition size. After that, I click first the Free Space Following (MiB) combo box and then Add.

I right-click the remaining unallocated space and select New one more time.

-

I choose the ext4 filesystem again. The partition size setting was already 201 megabytes (the whole available space), so I just press Add.

+

I choose the ext4 filesystem again. The partition size setting was already 200 megabytes (the whole available space), so I just press Add.

The next step is to commit the changes.

After that some operations, for example
partition deletion, can no longer be undone. @@ -2688,13 +2688,15 @@

Then I mount the partitions:

mount /dev/sda1 /mnt/sda1
mount /dev/sda6 /mnt/sda6

-

I move the directory:

-

mv /mnt/sda1/home/* /mnt/sda6/

+

I copy the directory to the new partition:

+

cd /mnt/sda1
+rsync -aAPSX home/ /mnt/sda6

+

I move the original directory out of my way and create a new directory in place of it:

+

mv home home-old
+mkdir home

After that, I unmount /dev/sda6, because it no longer needs to be mounted:

-

sync
-umount /dev/sda6

+

umount /dev/sda6

-

As you can see, under Linux it's perfectly normal that the terminal doesn't answer to the commands. Don't worry - they are really executed.

Now I close Terminal and launch Geany by pressing the fourth icon in the bottom pane.

I select File -> Open.

@@ -2707,7 +2709,7 @@

/dev/sda6 /home ext4 defaults 0 2

Finally, I select File -> Save.

-

It's a good idea to reboot the computer now and check if the distribution in /dev/sda1 still works. Anyway, the disk should now be ready for the new distro.

+

It's a good idea to reboot the computer now and check if the distribution in /dev/sda1 still works. If yes, the /home-old directory can be removed and the disk is ready for the new distro.

Data Recovery [^]

Deleted or "lost" files can be recovered from failed or formatted drives and partitions, cdroms and memory cards using the software available in SystemRescueCD.