--- trunk/www/partitions.html 2010/05/31 18:11:36 70 +++ trunk/www/partitions.html 2010/08/13 10:08:43 94 @@ -78,8 +78,8 @@

Clonezilla-SysRescCD

Documentation: Managing partitions

-

25/05/2010 - v 3.1.0

-

Last update: 31/05/2010

+

10/08/2010 - v 3.1.0

+

Last update: 13/08/2010

@@ -117,7 +117,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 [^]

@@ -132,7 +132,7 @@

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.

@@ -144,9 +144,7 @@

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? [^]

@@ -180,9 +178,11 @@

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.

+

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, 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.

+

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? [^]

@@ -238,7 +238,7 @@ ext4 - No + No*** Native 16 GB-16 TB* Yes @@ -246,8 +246,8 @@ exFAT - Native (Vista/7)** - No + Built-in (Vista/7)** + 3rd party driver 64 ZB No Yes @@ -258,7 +258,8 @@

* 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:

@@ -266,8 +267,8 @@
  • "Native" means that the kernel supports the filesystem and the OS can boot from a partition using that FS.
  • "Built-in" means that the kernel supports the filesystem, but booting from a partition containing such FS is very difficult.
  • "Driver included" means that ntfs-3g (the driver that adds NTFS support to Linux) comes with most GNU/Linux distributions.
  • -
  • "3rd party driver" means that drivers to add filesystem support are available, but must be downloaded and installed separately. The drivers are Ext2 IFS and Ext2fsd.
  • -
  • "No" means that there is no way to use the filesystem within the operating system.
  • +
  • "3rd party driver" means that drivers to add filesystem support are available, but must be downloaded and installed separately. The ext2/3 drivers are Ext2 IFS and Ext2fsd and the exFAT driver is exfat.
  • +
  • "No" means that there is no way to get read-write filesystem support.
  • Filesystems [^]

    @@ -282,7 +283,7 @@

    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.

    @@ -302,13 +303,13 @@

    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.

    @@ -324,7 +325,7 @@

    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.

    @@ -350,7 +351,7 @@

    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.

    @@ -364,11 +365,11 @@

     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
    @@ -414,10 +415,6 @@

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

    @@ -484,15 +484,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. @@ -521,17 +521,20 @@

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

    -

    I move the directory:

    +

    I copy the directory to the new partition:

    + +

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

    -

    mv /mnt/sda1/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.

    @@ -546,7 +549,7 @@

    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.