summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnant Narayanan <anant@kix.in>2006-09-14 15:18:45 +0000
committerAnant Narayanan <anant@kix.in>2006-09-14 15:18:45 +0000
commit232dbda915dfcfec99e5983b7f53d57d4498a6aa (patch)
tree4d54060e75f7f2df07de6e83004551b610ac9865
downloadparted-232dbda915dfcfec99e5983b7f53d57d4498a6aa.tar.gz
Fix ChangeLog
git-svn-id: svn://svn.debian.org/svn/parted/upstream/trunk@820 2d424fd7-7fe2-0310-af74-8bc65edeb173
-rw-r--r--AUTHORS218
-rw-r--r--BUGS7
-rw-r--r--COPYING340
-rw-r--r--ChangeLog3003
-rw-r--r--Doxyfile1084
-rw-r--r--Makefile.am55
-rw-r--r--NEWS32
-rw-r--r--README63
-rw-r--r--THANKS28
-rw-r--r--TODO98
-rwxr-xr-xautogen.sh8
-rw-r--r--configure.ac462
-rw-r--r--debug/Makefile.am1
-rw-r--r--debug/clearfat/Makefile.am12
-rw-r--r--debug/clearfat/clearfat.c283
-rw-r--r--debug/test/HOWTO241
-rw-r--r--debug/test/Makefile.am18
-rwxr-xr-xdebug/test/build_leak_list12
-rwxr-xr-xdebug/test/test262
-rwxr-xr-xdebug/test/test_disk_bsd94
-rwxr-xr-xdebug/test/test_disk_dos173
-rwxr-xr-xdebug/test/test_disk_dvh94
-rwxr-xr-xdebug/test/test_disk_gpt78
-rwxr-xr-xdebug/test/test_disk_mac78
-rwxr-xr-xdebug/test/test_disk_pc98102
-rwxr-xr-xdebug/test/test_disk_sun94
-rwxr-xr-xdebug/test/test_fs_ext298
-rwxr-xr-xdebug/test/test_fs_fat181
-rw-r--r--debug/test/test_fs_hfs91
-rw-r--r--debug/test/test_fs_hfsplus95
-rwxr-xr-xdebug/test/test_fs_linux_swap69
-rwxr-xr-xdebug/test/test_fs_reiserfs98
-rw-r--r--debug/test/testrc41
-rw-r--r--doc/API288
-rw-r--r--doc/C/Makefile.am26
-rw-r--r--doc/C/parted.8117
-rw-r--r--doc/C/partprobe.854
-rw-r--r--doc/C/po/parted.8.pot394
-rw-r--r--doc/C/po/partprobe.8.pot173
-rw-r--r--doc/FAT766
-rw-r--r--doc/Makefile.am17
-rw-r--r--doc/USER.jp1788
-rw-r--r--doc/fdl.texi403
-rwxr-xr-xdoc/gendocs.sh285
-rw-r--r--doc/gendocs_template100
-rwxr-xr-xdoc/mdate-sh97
-rw-r--r--doc/parted-pt_BR.texi2903
-rw-r--r--doc/parted.texi1246
-rw-r--r--doc/po4a.mk93
-rw-r--r--doc/pt_BR-parted.8248
-rw-r--r--doc/pt_BR/Makefile.am5
-rw-r--r--doc/pt_BR/parted.8.pt_BR.po442
-rw-r--r--doc/pt_BR/partprobe.8.pt_BR.po178
-rw-r--r--doc/texinfo.tex6200
-rw-r--r--include/Makefile.am1
-rw-r--r--include/parted/Makefile.am18
-rw-r--r--include/parted/beos.h37
-rw-r--r--include/parted/constraint.h97
-rw-r--r--include/parted/crc32.h35
-rw-r--r--include/parted/debug.h92
-rw-r--r--include/parted/device.h146
-rw-r--r--include/parted/disk.h339
-rw-r--r--include/parted/endian.h87
-rw-r--r--include/parted/exception.h117
-rw-r--r--include/parted/fdasd.h229
-rw-r--r--include/parted/filesys.h117
-rw-r--r--include/parted/geom.h84
-rw-r--r--include/parted/gnu.h45
-rw-r--r--include/parted/linux.h42
-rw-r--r--include/parted/natmath.h101
-rw-r--r--include/parted/parted.h62
-rw-r--r--include/parted/timer.h66
-rw-r--r--include/parted/unit.h93
-rw-r--r--include/parted/vtoc.h286
-rw-r--r--libparted/ChangeLog160
-rw-r--r--libparted/Makefile.am40
-rw-r--r--libparted/arch/beos.c641
-rw-r--r--libparted/arch/blkpg.h64
-rw-r--r--libparted/arch/gnu.c878
-rw-r--r--libparted/arch/linux.c2105
-rw-r--r--libparted/cs/constraint.c530
-rw-r--r--libparted/cs/geom.c483
-rw-r--r--libparted/cs/natmath.c495
-rw-r--r--libparted/debug.c100
-rw-r--r--libparted/device.c441
-rw-r--r--libparted/disk.c2250
-rw-r--r--libparted/exception.c304
-rw-r--r--libparted/filesys.c786
-rw-r--r--libparted/fs/Makefile.am33
-rw-r--r--libparted/fs/amiga/Makefile.am14
-rw-r--r--libparted/fs/amiga/affs.c466
-rw-r--r--libparted/fs/amiga/affs.h20
-rw-r--r--libparted/fs/amiga/amiga.c382
-rw-r--r--libparted/fs/amiga/amiga.h71
-rw-r--r--libparted/fs/amiga/apfs.c154
-rw-r--r--libparted/fs/amiga/apfs.h19
-rw-r--r--libparted/fs/amiga/asfs.c145
-rw-r--r--libparted/fs/amiga/asfs.h19
-rw-r--r--libparted/fs/amiga/interface.c90
-rw-r--r--libparted/fs/bfs/Makefile.am6
-rw-r--r--libparted/fs/bfs/bfs.c276
-rw-r--r--libparted/fs/bfs/bfs.h47
-rw-r--r--libparted/fs/ext2/Makefile.am19
-rw-r--r--libparted/fs/ext2/ext2.c794
-rw-r--r--libparted/fs/ext2/ext2.h247
-rw-r--r--libparted/fs/ext2/ext2_block_relocator.c925
-rw-r--r--libparted/fs/ext2/ext2_buffer.c447
-rw-r--r--libparted/fs/ext2/ext2_fs.h323
-rw-r--r--libparted/fs/ext2/ext2_inode_relocator.c600
-rw-r--r--libparted/fs/ext2/ext2_meta.c146
-rw-r--r--libparted/fs/ext2/ext2_mkfs.c601
-rw-r--r--libparted/fs/ext2/ext2_resize.c734
-rw-r--r--libparted/fs/ext2/interface.c355
-rw-r--r--libparted/fs/ext2/parted_io.c136
-rw-r--r--libparted/fs/ext2/parted_io.h28
-rw-r--r--libparted/fs/ext2/tune.c40
-rw-r--r--libparted/fs/ext2/tune.h30
-rw-r--r--libparted/fs/fat/Makefile.am25
-rw-r--r--libparted/fs/fat/bootsector.c449
-rw-r--r--libparted/fs/fat/bootsector.h138
-rw-r--r--libparted/fs/fat/calc.c437
-rw-r--r--libparted/fs/fat/calc.h78
-rw-r--r--libparted/fs/fat/clstdup.c425
-rw-r--r--libparted/fs/fat/clstdup.h29
-rw-r--r--libparted/fs/fat/context.c260
-rw-r--r--libparted/fs/fat/context.h70
-rw-r--r--libparted/fs/fat/count.c410
-rw-r--r--libparted/fs/fat/count.h52
-rw-r--r--libparted/fs/fat/fat.c888
-rw-r--r--libparted/fs/fat/fat.h161
-rw-r--r--libparted/fs/fat/fatio.c151
-rw-r--r--libparted/fs/fat/fatio.h49
-rw-r--r--libparted/fs/fat/resize.c870
-rw-r--r--libparted/fs/fat/table.c466
-rw-r--r--libparted/fs/fat/table.h75
-rw-r--r--libparted/fs/fat/traverse.c369
-rw-r--r--libparted/fs/fat/traverse.h81
-rw-r--r--libparted/fs/hfs/DOC92
-rw-r--r--libparted/fs/hfs/HISTORY115
-rw-r--r--libparted/fs/hfs/Makefile.am15
-rw-r--r--libparted/fs/hfs/TODO27
-rw-r--r--libparted/fs/hfs/advfs.c331
-rw-r--r--libparted/fs/hfs/advfs.h49
-rw-r--r--libparted/fs/hfs/advfs_plus.c387
-rw-r--r--libparted/fs/hfs/advfs_plus.h52
-rw-r--r--libparted/fs/hfs/cache.c241
-rw-r--r--libparted/fs/hfs/cache.h118
-rw-r--r--libparted/fs/hfs/file.c231
-rw-r--r--libparted/fs/hfs/file.h42
-rw-r--r--libparted/fs/hfs/file_plus.c274
-rw-r--r--libparted/fs/hfs/file_plus.h61
-rw-r--r--libparted/fs/hfs/hfs.c1355
-rw-r--r--libparted/fs/hfs/hfs.h651
-rw-r--r--libparted/fs/hfs/journal.c388
-rw-r--r--libparted/fs/hfs/journal.h38
-rw-r--r--libparted/fs/hfs/probe.c232
-rw-r--r--libparted/fs/hfs/probe.h44
-rw-r--r--libparted/fs/hfs/reloc.c673
-rw-r--r--libparted/fs/hfs/reloc.h36
-rw-r--r--libparted/fs/hfs/reloc_plus.c948
-rw-r--r--libparted/fs/hfs/reloc_plus.h37
-rw-r--r--libparted/fs/jfs/Makefile.am6
-rw-r--r--libparted/fs/jfs/jfs.c112
-rw-r--r--libparted/fs/jfs/jfs_superblock.h145
-rw-r--r--libparted/fs/jfs/jfs_types.h528
-rw-r--r--libparted/fs/linux_swap/Makefile.am6
-rw-r--r--libparted/fs/linux_swap/linux_swap.c520
-rw-r--r--libparted/fs/ntfs/Makefile.am6
-rw-r--r--libparted/fs/ntfs/ntfs.c104
-rw-r--r--libparted/fs/reiserfs/Makefile.am7
-rw-r--r--libparted/fs/reiserfs/geom_dal.c139
-rw-r--r--libparted/fs/reiserfs/geom_dal.h63
-rw-r--r--libparted/fs/reiserfs/reiserfs.c867
-rw-r--r--libparted/fs/reiserfs/reiserfs.h109
-rw-r--r--libparted/fs/ufs/Makefile.am6
-rw-r--r--libparted/fs/ufs/ufs.c325
-rw-r--r--libparted/fs/xfs/Makefile.am6
-rw-r--r--libparted/fs/xfs/platform_defs.h115
-rw-r--r--libparted/fs/xfs/xfs.c122
-rw-r--r--libparted/fs/xfs/xfs_sb.h490
-rw-r--r--libparted/fs/xfs/xfs_types.h303
-rw-r--r--libparted/labels/Makefile.am35
-rw-r--r--libparted/labels/aix.c282
-rw-r--r--libparted/labels/bsd.c617
-rw-r--r--libparted/labels/dasd.c874
-rw-r--r--libparted/labels/dos.c2212
-rw-r--r--libparted/labels/dvh.c916
-rw-r--r--libparted/labels/dvh.h179
-rw-r--r--libparted/labels/efi_crc32.c125
-rw-r--r--libparted/labels/fdasd.c1153
-rw-r--r--libparted/labels/gpt.c1504
-rw-r--r--libparted/labels/loop.c338
-rw-r--r--libparted/labels/mac.c1616
-rw-r--r--libparted/labels/pc98.c892
-rw-r--r--libparted/labels/rdb.c1191
-rw-r--r--libparted/labels/sun.c853
-rw-r--r--libparted/labels/vtoc.c1162
-rw-r--r--libparted/libparted.c345
-rw-r--r--libparted/mbr.s86
-rw-r--r--libparted/timer.c245
-rw-r--r--libparted/unit.c564
-rw-r--r--parted.lsm17
-rw-r--r--parted.m4110
-rw-r--r--parted.spec.in78
-rw-r--r--parted/ChangeLog120
-rw-r--r--parted/Makefile.am24
-rw-r--r--parted/command.c140
-rw-r--r--parted/command.h49
-rw-r--r--parted/parted.c2259
-rw-r--r--parted/strlist.c605
-rw-r--r--parted/strlist.h59
-rw-r--r--parted/table.c265
-rw-r--r--parted/table.h57
-rw-r--r--parted/ui.c1361
-rw-r--r--parted/ui.h83
-rw-r--r--partprobe/Makefile.am13
-rw-r--r--partprobe/partprobe.c161
-rw-r--r--po/ChangeLog45
-rw-r--r--po/Makevars41
-rw-r--r--po/POTFILES56
-rw-r--r--po/POTFILES.in80
-rw-r--r--po/boldquot.sed10
-rw-r--r--po/ca.po2544
-rw-r--r--po/cs.po2500
-rw-r--r--po/da.po2737
-rw-r--r--po/de.po2546
-rw-r--r--po/en@boldquot.header25
-rw-r--r--po/en@quot.header22
-rw-r--r--po/es.po2573
-rw-r--r--po/fr.po2835
-rw-r--r--po/gl.po2901
-rw-r--r--po/hu.po2047
-rw-r--r--po/id.po2418
-rw-r--r--po/insert-header.sin23
-rw-r--r--po/it.po2461
-rw-r--r--po/ja.po2415
-rw-r--r--po/nl.po2421
-rw-r--r--po/nn.po2509
-rw-r--r--po/parted.pot2109
-rw-r--r--po/pl.po2574
-rw-r--r--po/pt.po2644
-rw-r--r--po/pt_BR.po2689
-rw-r--r--po/quot.sed6
-rw-r--r--po/remove-potcdate.sin19
-rw-r--r--po/ru.po2631
-rw-r--r--po/sv.po2634
-rw-r--r--po/tr.po2416
-rw-r--r--po/uk.po2401
-rw-r--r--po/vi.po2498
-rw-r--r--po/zh_CN.po2403
-rw-r--r--po/zh_TW.po2413
-rw-r--r--scripts/data/abi/baseline_symbols.txt450
-rwxr-xr-xscripts/extract_symvers67
-rwxr-xr-xscripts/release/tarball_upload.sh157
-rw-r--r--stamp-h11
255 files changed, 139784 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..20dcacd
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,218 @@
+This file is part of GNU Parted
+Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation Inc.
+
+This file may be modified and/or distributed without restriction. This is
+not an invitation to misrepresent who contributed to GNU Parted.
+
+-------------------------------------------------------------------------------
+
+We need to keep track of copyright (see the Maintainer HOWTO on www.gnu.org).
+
+
+Leslie Patrick Polzer <polzer@gnu.org>
+ * parts of 1.6.24 PedUnit API
+ * GPT pth_* functions and block size fixes
+ * PED_SECTOR_SIZE -> PED_SECTOR_SIZE_DEFAULT
+ * debugging framework
+ * ext2 "strange layout" fix (experimental)
+ * support for physical block sizes
+ * SCO BFS support
+
+ http://nic-nac-project.de/~skypher/
+
+ Snail Mail:
+ Am Kirchberg 15
+ 89537 Giengen
+ Germany
+
+Andrew Clausen <clausen@gnu.org>
+ * all FAT code (libparted/fs_fat)
+ * all linux-swap code (libparted/fs_linux_swap)
+ * some reiserfs glue code (libparted/fs_reiserfs) with Umanets
+ * most of the API (with lots of discussion with Lennert Buytenhek)
+ (include/parted/*)
+ * generic filesystem code (filesys.c) and device code (device.c)
+ * exception code (exception.c, debug.c)
+ * partition table code (disk.c)
+ * dos partition support (disk_dos.c)
+ * mac partition support (disk_mac.c)
+ * mips partition support (disk_mips.c)
+ * loopback support (disk_loop.c)
+ * some of the PC98 code (disk_pc98.c), with Masahiro Sakai.
+ * misc. hacking on all disk_*.c code
+ * low-level I/O code (device.c, geom.c, linux.c)
+ - init_scsi() stolen from gnome-gfdisk via Matt Wilson.
+ * constraint solver (natmath.c, constraint.c)
+ * command-line, and fdisk-like frontend (parted/*)
+ * stubs for ntfs, hfs, xfs
+ * hacked on libparted/fs_ext2 a fair bit (bug fixes, error handling,
+ support for > 1024 groups, etc.)
+ * libparted/mbr.s (the MBR boot loader code)
+ * misc hacking on GNU/Hurd port
+ * major surgery on GUID Partition Table (GPT) support (disk_gpt.[ch])
+ * progress meter support (libparted/timer.c include/parted/timer.h)
+
+ Snail mail:
+ 18 Shaw St
+ Ashwood, 3147
+ Australia
+
+Lennert Buytenhek <buytenh@gnu.org>
+ * original ext2 code (libparted/fs_ext2)
+ * discussion/ideas for API
+
+Matthew Wilson <msw@redhat.com>
+ * basis of partition table and device code (disk.c, disk_dos.c,
+ and device.c) Has morphed into something that looks completely
+ different now :-)
+ * bug fixes
+ * BSD disklabel support (disk_bsd.c)
+ * Python bindings to libparted
+ * Don't detect AIX physical volumes as msdos partition tables
+ * Code for manipulating AIX PVs
+
+Martin von Lwis <martin@mira.isdn.cs.tu-berlin.de>
+ * German translations
+
+Baty Jean-Marc <baty@club-internet.fr>
+ * French translations
+
+Hiroshi Takekawa <takekawa@sr3.t.u-tokyo.ac.jp>
+ * Japanese translations
+
+Eliphas Levy Theodoro <eliphas@conectiva.com>
+ * Brazillian Portugese translations
+
+Dmitry S. Sivachenko <dima@Chg.RU>
+ * Russian translations
+
+Timshel Knoll <timshel@pobox.com>
+ * man pages (parted.8 partprobe.8)
+ * bug fixes
+
+Ivo Timmermans <itimmermans@bigfoot.com>
+ * Dutch translations
+
+Ryoji Kawagishi <kawagisi@yk.rim.or.jp>
+ * Japanese translation of doc/USER (user documentation)
+ (replaced by Okuji's version, now)
+
+Okuji Yoshinori <okuji@kuicr.kyoto-a.ac.jp>
+ * doc/USER.jp
+ * contributions to Japanese translations
+
+Masahiro Sakai <ZVM01052@nifty.ne.jp>
+ * most of the PC98 support (disk_pc98.c), with Andrew Clausen
+ * lots of tedious work on parted/strlist.c
+
+Damien Genet <damien.genet@free.fr>
+ * parted.m4
+
+Ben Collins <bcollins@debian.org>
+ * Sun disk label support (libparted/disk_sun.c)
+ * stubs for UFS
+
+Vincent Stelh <vincent.stelhe@free.fr>
+ * move syntax patch (make END specification optional). Trivial
+ for copyright purposes (no disclaimer needed)
+
+Neal H Walfield <neal@cs.uml.edu>
+ * GNU/Hurd port - libparted/gnu.c
+
+Thomas Roelz <tom@suse.de>
+ * misc bug fixes
+
+Matt Domsch <Matt_Domsch@dell.com>
+ * GUID Partition Table (GPT) support (disk_gpt.[ch],
+ crc32.[ch])
+ * misc bug fixes, including end-of-device workaround
+ in libparted/linux.c
+
+Kjetil Torgrim Homme <kjetilho@linpro.no>
+ * Norweigen translations
+
+Jrgen Tegnr <jorgen.tegner@telia.com>
+ * Swedish translations
+
+Keld Simonsen <keld@dkuug.dk>
+ * Danish translations
+
+Richard M. Kreuter <kreuter@ausar.rutgers.edu>
+ * converted doc/USER to texinfo (doc/parted.texi)
+
+Miquel Matas <miquelmatas@wanadoo.es>
+ * Catalan translations
+
+Andreas Dilger <adilger@clusterfs.com>
+ * lots of mix bug fixes/cleanups
+
+Vicente E. Llorens <vllorens@mundofree.com>
+ * Spanish translations
+
+Yury Umanets <torque@ukrpost.net>
+ * basis of libparted/fs_reiserfs
+
+Bernardo Joo Torres da Silveira <bernardojts@ig.com.br>
+ * pt_BR translation of FAQ and parted.texi
+
+Wojciech Polak <polak@gnu.org>
+ * Polish translations
+
+Miloslav Trmac <mitr@volny.cz>
+ * Czech translations
+
+Maxim V. Dziumanenko <mvd@mylinux.com.ua>
+ * Ukrainian translations
+
+Giuseppe Sacco <eppesuig@debian.org>
+ * Italian translations
+
+Guillaume Knispel <k_guillaume@libertysurf.fr>
+ * nearly all hfs and hfs+ code (libparted/fs_hfs)
+ * hfs+ support for mac partitions (disk_mac.c)
+ * sync_fast code (linux.c gnu.c geom.[ch] device.[ch] )
+ * various fixes (parted.c ui.c filesys.c disk_dos.c disk.c
+ doc/parted.texi doc/API disk_gpt.c disk_mac.c unit.c fs_fat/traverse.c)
+
+Chris Lumens <clumens@redhat.com>
+ * interactive help fixes for filesystem types
+ * gcc-4 pedanticism cleanups
+
+Wei-Lun Chao <chaoweilun@pcmail.com.tw>
+ * Taiwanese dialect of Chinese (Cantonese?) translations.
+
+Tran Thi Hoang Quyen <banhdauxanhhaiduong@gmail.com>
+ * Vietnamese translations
+
+Eduardo Maestri Righes <eduardo@tteng.com.br>
+ * hidden partitions support
+ * setting MS Reserved partitions through "set" command.
+
+Arif E. Nugroho <arif_endro@yahoo.com>
+ * Indonesian translations
+
+Ithamar R. Adema <ithamar@unet.nl>
+ * BeOS support
+
+David Cantrell <dcantrell@redhat.com>
+ * Added support for Promise SX8 devices (original patch from Jeremy
+ Katz <katzj@redhat.com>)
+ * Brought IBM/Red Hat DASD patches forward to parted-1.7.x
+ Original IBM authors: Volker Sameske <sameske@de.ibm.com>
+ Horst Hummel <Horst.Hummel@de.ibm.com>
+ Original Red Hat authors: Phil Knirsch <phil@redhat.de>
+ Harald Hoyer <harald@redhat.de>
+ * Prevent SIGFPE when FAT sector size is 0
+ * Add virtual DASD (VIODASD) on iSeries support
+ * Use O_DIRECT I/O to prevent first partition corruption on GPT disks
+
+Peter Jones <pjones@redhat.com>
+ * Add ped_exception_get_handler()
+
+Darren Lavender <dl1@hppine99.gbr.hp.com>
+ * Fix SIGSEGV in parted 1.6.19 and assertion error in 1.7.0
+ * Add support for LUN/device resize detection and option GPT
+ header corruption
+ * Fixed off-by-one error in GPT header that allowed for overlap
+ between LDAs of LastUsableLBA and PartitionEntryLBA in backup GPT
diff --git a/BUGS b/BUGS
new file mode 100644
index 0000000..e7d3999
--- /dev/null
+++ b/BUGS
@@ -0,0 +1,7 @@
+
+Please see the FAQ (available on the web site at
+http://www.gnu.org/software/parted/) for common bugs from the past
+and http://alioth.debian.org/parted/ for a bug tracker.
+
+=======================================================================
+
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..3912109
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..4b74b9b
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,3003 @@
+Note: there are now separate ChangeLog files for the library and the
+front-end. This file is only for reference purposes and top-level changes.
+
+See libparted/ChangeLog and parted/ChangeLog.
+
+==============================================================================
+2006-09-01 David Cantrell <dcantrell@redhat.com>
+ * include/parted/device.h: add PED_DEVICE_VIODASD.
+ * include/parted/exception.h: add ped_exception_get_handler() prototype.
+
+2006-08-31 David Cantrell <dcantrell@redhat.com>
+ * include/parted/device.h: add PED_DEVICE_DASD (direct attached storage
+ device, zSeries).
+ * inlcude/parted/disk.h: add PED_PARTITION_METADATA and
+ PED_PARTITION_PROTECTED.
+ * include/parted/fdasd.h: add fdasd header file.
+ * include/parted/vtoc.h: add VTOC header file.
+ * include/parted/linux.h: if on zSeries, declare real_sector_size
+ and fdasd_anchor.
+
+2006-08-30 David Cantrell <dcantrell@redhat.com>
+ * include/parted/device.h: add PED_DEVICE_SX8 (Promise SX8 SATA device).
+
+2006-06-01 Otavio Salvador <otavio@debian.org>
+ * po/hu.po: add Hungarian translation. Thanks to SZERVC Attila
+ <sas-guest@haydn> for the file. Debian bug: #360457.
+
+2006-05-25 Leslie Polzer <leslie.polzer@gmx.net>
+ * configure.ac: added libdl to linker flags.
+
+2006-05-21 Otavio Salvador <otavio@debian.org>
+ * doc/*: add suport to use po4a to translate the manpages.
+
+2006-05-18 Otavio Salvador <otavio@debian.org>
+ * Makefile.am: add scripts and data need for abi checking. It'll
+ be used to avoid ABI broken packages;
+ improve logic to detect ABI brokeness;
+
+2006-05-08 Otavio Salvador <otavio@debian.org>
+ * doc/parted.texi: Rephrase some parted documentation based on
+ patches sent to Debian.
+
+2006-04-26 Otavio Salvador <otavio@debian.org>
+ * po/it.po: Update Italian translation. Thanks to Giuseppe Sacco
+ <giuseppe@eppesuigoccas.homedns.org> for the po file.
+
+2006-04-03 Otavio Salvador <otavio@debian.org>
+ * Makefile.am, scripts/extract_symvers: Add support to a simple
+ abi check.
+
+ * scripts/data/abi/baseline_symbols.txt: First version of our
+ controled symbols.
+
+2006-03-13 Ithamar Adema <ithamar@unet.nl>
+ * configure.ac, libparted/Makefile.am, libparted/libparted.c,
+ libparted/arch/beos.c, include/parted/beos.h: Added
+ _experimental_ BeOS (& descendents) support.
+
+ * libparted/fs/xfs/platform_defs.h, libparted/fs/ext2/ext2.h: Type
+ definition fixes for BeOS support.
+
+ * libparted/fs/hfs/hfs.c, libparted/fs/xfs/xfs.c, libparted/fs/jfs/jfs.c,
+ libparted/fs/reiserfs/reiserfs.c, libparted/fs/linux_swap/linux_swap.c,
+ libparted/fs/ntfs/ntfs.c, libparted/fs/ufs/ufs.c,
+ libparted/fs/amiga/affs.c: Explicit block_sizes initialization in
+ PedFileSystemType declarations (needed to satisfy gcc2 compiler).
+
+2006-03-03 Leslie Polzer <leslie.polzer@gmx.net>
+ * configure.ac: removed "-std=c99" from CFLAGS -- this implies so many
+ changes that a branch makes sense.
+
+ * configure.ac (AC_OUTPUT): removed libparted/fs/bfs/Makefile.in.
+
+ * po/POTFILES.in: updated to match new directory layout.
+
+2006-02-26 Leslie Polzer <leslie.polzer@gmx.net>
+ * configure.ac: added "-std=c99" to CFLAGS -- C99 extensions may be
+ used because we need "long long int".
+
+2006-02-11 Leslie Polzer <leslie.polzer@gmx.net>
+ * libparted/fs/reiserfs/reiserfs.c: added valid block sizes for
+ reiserfs.
+
+2006-02-06 Leslie Polzer <leslie.polzer@gmx.net>
+ * libparted/arch/linux.c (_device_probe_geometry): added preliminary
+ fix for HDIO_GETGEO ioctl returning failure (this will be superseded
+ by EDD support).
+
+2006-02-01 Leslie Polzer <leslie.polzer@gmx.net>
+ * configure.ac, aclocal.m4, parted/Makefile.am: removed static build
+ stuff.
+
+2006-01-31 Leslie Polzer <leslie.polzer@gmx.net>
+
+ * libparted/fs/ext2/ext2_mkfs.c
+ (ext2_mkfs_create_lost_and_found_inode): fixed allocation bug.
+
+ * libparted/fs/hfs/reloc_plus.c: changed msgid "[...] should not
+ contain its own extents." to "[...] should not contain its own
+ extents!".
+
+2006-01-26 Leslie Polzer <leslie.polzer@gmx.net>
+
+ * parted/parted.c (do_mkpart): changed an erroneous conditional that
+ would have prevented the creation of partitions on disk labels that
+ do not support the concept of extended partitions.
+
+ * libparted/fs/fat/fat.c, libparted/fs/ext2/interface.c,
+ libparted/fs/bfs/bfs.c, libparted/fs/amiga/affs.c,
+ libparted/fs/amiga/apfs.c, libparted/fs/amiga/asfs.c: added list of
+ supported block sizes.
+
+2006-01-20 Leslie Polzer <leslie.polzer@gmx.net>
+
+ * libparted/labels/gpt.c (gpt_probe): initialize pth to NULL and free
+ pth only if non-NULL.
+
+ * parted/parted.c (do_print): block size printf now uses %lld.
+ This fixes display of physical sector size.
+
+2006-01-18 Andres Salomon <dilinger@debian.org>
+ * libparted/arch/linux.c (linux_probe_all): use /sys/block in favor of
+ /proc/partitions where possible.
+ * libparted/arch/linux.c: added functions _skip_entry [static],
+ _probe_sys_block [static]
+
+2006-01-13 Leslie Polzer <leslie.polzer@gmx.net>
+ * libparted/labels/rdb.c (amiga_probe): made function use actual sector
+ size again.
+
+2006-01-11 Leslie Polzer <leslie.polzer@gmx.net>
+ * libparted/fs/Makefile.am: removed BFS until it is ready.
+
+ * include/parted/parted.h: added ped_calloc prototype.
+
+ * libparted/arch/linux.c (struct hd_driveid): added ATAPI/ATA7 words
+ 106, 117, 118.
+
+2006-01-02 Leslie Polzer <leslie.polzer@gmx.net>
+ * libparted/labels/gpt.c (pth_free): fixed assertion's return statement.
+
+ * libparted/libparted.c (ped_calloc): added.
+
+2005-12-25 Harley D. Eades III <hde@foobar-qux.org>
+* libparted/labels/gpt.c (pth_free): New function.
+* libparted/labels/gpt.c (gpt_probe): Added a call to pth_free().
+* libparted/labels/gpt.c (gpt_clobber): Now calls pth_free() on gpt
+ before returning and calls pth_free() on error_free_with_gpt instead
+ of ped_free().
+
+2005-12-25 Harley D. Eades III <hde@foobar-qux.org>
+* libparted/labels/gpt.c (pth_free): New function.
+* libparted/labels/gpt.c (gpt_probe): Added a call to pth_free().
+* libparted/labels/gpt.c (gpt_clobber): Now calls pth_free() on gpt
+ before returning and calls pth_free() on error_free_with_gpt instead
+ of ped_free().
+
+2005-12-25 Leslie Polzer <leslie.polzer@gmx.net>
+* include/parted/debug.h (PED_DEBUG): fixed variable arguments stuff.
+* configure.ac: added some compiler checks.
+* libparted/arch/linux.c (_device_seek, _partition_get_part_dev),
+ libparted/fs/reiserfs/geom_dal.c (__dev):
+ added casts.
+* libparted/arch/linux.c (_disk_sync_part_table),
+ libparted/fs/bfs/bfs.c (bfs_probe, bfs_clobber),
+ libparted/fs/ext2/ext2.c (ext2_copy_block, ext2_commit_metadata):
+ libparted/fs/ext2/ext2_mkfs.c (ext2_mkfs_create_lost_and_found),
+ libparted/labels/dos.c (probe_filesystem_for_geom),
+ libparted/labels/gpt.c (gpt_read):
+ turned runtime-length array into pointer.
+* libparted/fs/ext2/ext2_mkfs.c (ext2_mkfs_init_sb),
+ libparted/fs/jfs/jfs_types.h: renamed u_int*_t to uint*_t.
+* libparted/fs/reiserfs/reiserfs.c: sanitized function prototype.
+* libparted/fs/xfs/platform_defs.h: renamed __uint*_t to uint*_t
+ and __int*_t to int*_t.
+* libparted/labels/dos.c (probe_filesystem_for_geom): added assertions.
+* libparted/labels/gpt.c (struct _GuidPartitionEntryAttributes_t):
+ added fallback structure for non-GCC compilers (with #warning).
+
+2005-12-25 Leslie Polzer <leslie.polzer@gmx.net>
+* include/parted/debug.h: made PED_DEBUG a function if GCC is not being
+ used (which means the compiler might not support C99, where variadic
+ macros were introduced).
+* include/parted/debug.h: added check for __JSFTRACE__ which is an
+ instrumenting preprocessor disguising itself as GCC.
+
+2005-12-20 Leslie Polzer <leslie.polzer@gmx.net>
+* parted/parted.c (do_set): now offers toggled flag state as default.
+
+2005-12-19 Leslie Polzer <leslie.polzer@gmx.net>
+* configure.ac: added AC_C_INLINE check.
+* Doxyfile: adapted input files to new directory layout.
+* parted/parted.c (do_mkpart, do_mkfs, do_mkpartfs): automatically set
+ LBA flag on partition if available.
+
+2005-12-18 Leslie Polzer <leslie.polzer@gmx.net>
+* libparted/fs/ext2/interface.c (_ext2_get_resize_constraint): replaced
+ 'PED_SECTOR_SIZE_DEFAULT' with device's sector_size.
+* libparted/labels/Makefile.am: corrected crc32.c to efi_crc32.c.
+* libparted/fs/bfs/Makefile.am, libparted/fs/bfs/bfs.c: added.
+
+2005-12-17 Leslie Polzer <leslie.polzer@gmx.net>
+* parted/Makefile.am, configure.ac: added BUILDINFO
+* parted/parted.c: added build information (date, user, hostname)
+* libparted/fs/Makefile.am, libparted/labels/Makefile.am: added
+* libparted/crc32.c: renamed to efi_crc32.c
+* libparted/disk_amiga.c: renamed to rdb.c
+* libparted/labels/, libparted/fs/, libparted/cs/, libparted/arch/: added
+ and populated.
+
+2005-12-15 Leslie Polzer <leslie.polzer@gmx.net>
+* libparted/fs_ext2/ext2_block_relocator.c (ext2_block_relocate_grow):
+ get inode table offset from group descriptor.
+* libparted/fs_ext2/ext2.h, libparted/fs_ext2/ext2.c,
+ libparted/fs_ext2/ext2_block_relocator.c, libparted/fs_ext2/ext2_mkfs.c,
+ libparted/fs_ext2/ext2_resize.c, libparted/fs_ext2/ext2_meta.c:
+ removed 'howmany' macro and changed its calls to 'ped_div_round_up'.
+
+2005-12-08 Leslie Polzer <leslie.polzer@gmx.net>
+* parted/ui.c: changed bug reporting instructions.
+
+2005-11-18 Leslie Polzer <leslie.polzer@gmx.net>
+* parted/command.h (struct Command): added 'non_interactive' field indicating
+ whether it makes sense to use this command in non-interactive mode.
+* parted/command.h, parted/command.h: changed signature and body of
+ command_create to match new field 'non_interactive'.
+* parted/ui.c (non_interactive_mode): honor 'non_interactive' field.
+* parted/parted.c (do_print): removed display of start (should be always
+ equal to zero).
+* parted/parted.c (do_print): changed some wordings.
+* parted/parted.c (do_print, partition_print): added some blank lines.
+* libparted/natmath.c (ped_alignment_intersect): added debug statement
+ facilitating the debugging of the solver.
+* doc/API (preamble): added notice regarding deprecation.
+
+2005-11-16 Guillaume Knispel <k_guillaume@libertysurf.fr>
+* libparted/fs_hfs/hfs.c, libparted/fs_hfs/hfs.h: Added hfs_block_count and
+ hfsp_block_count global variables, they contain the number of FS blocks
+ allocated in memory for the copy buffer. Renamed MAX_BUFF to BLOCK_MAX_BUFF,
+ added BYTES_MAX_BUFF = 8MB.
+* libparted/fs_hfs/reloc.c (hfs_pack_free_space_from_block): Fill the cache
+ before allocating the copy buffer, limit the maximum buffer size to the max
+ of min(8MB, 1 HFS block) and allocate at least the size needed by the cache.
+ Store the number of HFS blocks allocated in hfs_block_count.
+* libparted/fs_hfs/reloc.c (hfs_effect_move_extent): Copy hfs_block_count
+ blocks by hfs_block_count blocks (instead of MAX_BUFF).
+* libparted/fs_hfs/reloc_plus.c (hfsplus_pack_free_space_from_block): Limit
+ the maximum buffer size to the max of min(8MB, 1 HFS+ block) and allocate
+ at least the size needed by the cache. Store the number of HFS+ blocks
+ allocated in hfsp_block_count.
+* libparted/fs_hfs/reloc_plus.c (hfsplus_effect_move_extent): Copy
+ hfsp_block_count by hfsp_block_count blocks (instead of MAX_BUFF).
+* libparted/fs_hfs/probe.c, libparted/fs_hfs/probe.h (hfsc_can_use_geom):
+ Added - check if the sector size is really 512B.
+* libparted/fs_hfs/probe.c (hfs_and_wrapper_probe, hfsplus_probe, hfs_probe,
+ hfsx_probe): Added calls to hfsc_can_use_geom.
+* libparted/fs_hfs/hfs.c (hfs_open, hfsplus_open): Added calls to
+ hfsc_can_use_geom.
+* parted/ui.c (command_line_get_sector): Handle range == NULL cleanly
+ (do_rescue uses that value...).
+* libparted/unit.c (parse_chs, ped_unit_parse_custom): Handle range == NULL
+ cleanly too.
+
+2005-11-14 Leslie Polzer <leslie.polzer@gmx.net>
+* include/parted/device.h, libparted/device.c, include/parted/disk.h,
+ include/libparted/disk.c: added documentation.
+* include/parted/device.h (struct _PedDevice): made fields sector_size and
+ phys_sector_size 64 bit wide.
+* Doxyfile: tweaked.
+
+2005-11-11 Otavio Salvador <otavio@debian.org>
+* configure.ac: add AM_GNU_GETTEXT_VERSION macro to ensure that we have a
+ good gettetxt version and let autoreconf happy ;-)
+* config.h.in, config.guess, config.sub, libtool, ltconfig, ABOUT-NLS,
+ depcomp, missing, mkinstalldirs, ltmain.sh, install.sh, INSTALL,
+ po/Makefile.in.in po/Rules-quot, m4/: removed. Those can be generated
+ when we're going to build the tarball.
+* configure.ac, Makefile.am: don't use m4/Makefile.in since won't install
+ or process it.
+* autogen.sh: added to be easier to us to build the tarball.
+
+2005-11-11 Guillaume Knispel <k_guillaume@libertysurf.fr>
+* parted/parted.c (do_print): removed diagnostic message displaying
+ if the free argument was given or if a partition number was given.
+* parted/parted.c (do_print): "Sector" instead of "Block" size, append 'B'
+ to the values.
+* libparted/unit.c, include/parted/unit.h, doc/API: added (declares, defined,
+ and documented) ped_unit_format_custom_byte based on ped_unit_format_custom,
+ added ped_unit_format_byte (wrapper of ped_unit_format_custom_byte),
+ transformed ped_unit_format_custom and ped_unit_format to wrappers of
+ ped_unit_format_custom_byte.
+ Depending of the unit and value to represent, ped_unit_format_custom_byte
+ can output representations with a precision up to 1/100 unit.
+* parted/parted.c (do_print): make use of ped_unit_format_byte instead of
+ ped_unit_format to get representation of end of partitions / device
+ (point to the last byte of the last sector instead of the first byte of
+ the last sector).
+
+2005-11-11 Leslie Polzer <leslie.polzer@gmx.net>
+* parted/parted.c (do_mkpart, do_mkpartfs): support partition naming.
+* parted/parted.c (do_mkpart, do_mkpartfs): ask for primary/extended only
+ when necessary.
+
+2005-11-10 Leslie Polzer <leslie.polzer@gmx.net>
+* include/parted/debug.h: added 'PedDebugHandler' type.
+* include/parted/debug.h: added 'PED_DEBUG' macro.
+* include/parted/debug.h, include/parted/debug.c: added ped_debug
+ and ped_debug_set_handler.
+* include/parted/debug.h: added some documentation.
+* configure.in: renamed to configure.ac.
+* libparted/disk_loop.c (loop_probe): removed gratuitous const cast.
+* libparted/disk_amiga.c: replaced 'dev->sector_size' with
+ 'PED_SECTOR_SIZE_DEFAULT' (first see whether Amiga PTs support bs != 512).
+* libparted/linux.c (init_generic): replaced dev->sector_size with
+ 'PED_SECTOR_SIZE_DEFAULT' (non-initialized).
+* libparted/linux.c (_device_probe_geometry): make cylinder size calculation
+ right.
+* libparted/debug.c (ped_debug): calls 'debug_handler' now instead of
+ 'default_handler'
+
+2005-11-09 Leslie Polzer <leslie.polzer@gmx.net>
+* include/parted/device.h (struct _PedDeviceArchOps, extern ped_device_read),
+ include/parted/disk.h (struct _PedDiskOps, _ped_disk_alloc):
+ changed the prototype of 'read', 'probe' and 'alloc' to take a const PedDevice.
+* include/parted/unit.h: renamed 'PED_SECTOR_SIZE' to
+ 'PED_SECTOR_SIZE_DEFAULT'.
+* libparted/disk.c (_ped_disk_alloc), libparted/disk_amiga.c (_amiga_read_block,
+ _amiga_find_rdb, amiga_probe, amiga_alloc), libparted/disk_bsd.c (bsd_probe,
+ bsd_alloc), libparted/disk_dos.c (msdos_probe, msdos_alloc),
+ libparted/device.c (ped_device_read), libparted/disk_dvh.c (dvh_probe,
+ dvh_alloc), libparted/disk_gpt.c (gpt_probe, gpt_alloc, _read_header,
+ _non_metadata_constraint), libparted/disk_loop.c (loop_alloc, loop_probe),
+ libparted/disk_mac.c (mac_probe, mac_alloc), libparted/disk_pc98.c
+ (pc98_probe, pc98_alloc), libparted/disk_sun.c (sun_probe, sun_alloc),
+ libparted/linux.c (_device_seek, _read_lastoddsector, linux_read):
+ made 'dev' const and added const cast where necessary.
+* libparted/disk_amiga.c (_amiga_checksum, amiga_probe, amiga_alloc, amiga_read,
+ amiga_write, amiga_partition_new), libparted/disk_bsd.c (bsd_alloc),
+ libparted/disk_msdos.c (probe_filesystem_for_geom), libparted/disk_gpt.c
+ (gpt_alloc, gpt_read, _write_pmbr, gpt_write, gpt_alloc_metadata),
+ libparted/fs_amiga/affs.c, libparted/fs_amiga/amiga.c,
+ libparted/fs_amiga/apfs.c, libparted/fs_amiga/asfs.c,
+ libparted/fs_ext2/interface.c, libparted/fs_hfs/advfs.c,
+ libparted/fs_hfs/advfs_plus.c, libparted/fs_hfs/cache.c,
+ libparted/fs_hfs/file.c, libparted/fs_hfs/file_plus.c, libparted/fs_hfs/hfs.c,
+ libparted/fs_hfs/journal.c, libparted/fs_hfs/probe.c, libparted/fs_hfs/reloc.c
+ libparted/fs_hfs/reloc_plus.c, libparted/fs_reiserfs/reiserfs.c,
+ libparted/gnu.c, libparted/linux.c:
+ replaced 'PED_SECTOR_SIZE' or '512' with 'PedDevice.sector_size' or
+ at least 'PED_SECTOR_SIZE_DEFAULT'.
+* libparted/disk_amiga.c (amiga_read), libparted/disk_bsd.c (bsd_alloc),
+ libparted/disk_msdos.c (probe_filesystem_for_geom), libparted/linux.c
+ (_device_get_length, linux_read, linux_write, _blkpg_add_partition):
+ added sector size assertion.
+* libparted/disk_gpt.c (struct _GuidPartitionTableHeader): made Reserved2
+ dynamic (need not be 420 bytes).
+* libparted/disk_gpt.c (pth_get_size, pth_get_size_static, pth_get_size_rsv2,
+ pth_new, pth_new_zeroed, pth_new_from_raw, pth_get_raw, pth_crc32): added.
+* libparted/disk_gpt.c (gpt_probe, gpt_clobber, _header_is_valid,
+ _read_header, _parse_header, gpt_read, _generate_header, gpt_write):
+ adapted to new Reserved2 and pth_* functions.
+* libparted/disk_gpt.c (gpt_probe): replaced '1' with 'GPT_HEADER_SECTORS'.
+* libparted/disk_gpt.c (_header_is_valid): added PedDevice argument.
+* libparted/disk_gpt.c (_parse_header, _write_pmbr): replaced '92' with
+ 'pth_get_size_static'.
+* libparted/disk_gpt.c (ped_disk_gpt_init): removed header size assertion.
+* libparted/linux.c (_device_get_sector_size): renamed to
+ '_device_set_sector_size'
+* libparted/linux.c (_device_set_sector_size): sets real sector size now
+ instead of 512.
+* libparted/linux.c (_device_probe_geometry): calls 'device_set_sector_size'
+ now.
+* libparted/linux.c (init_ide): added stub for setup of
+ 'PedDevice.phys_sector_size'.
+* libparted/linux.c (_blkpg_add_partition): added assertion for 'disk'.
+* doc/parted.texi (Related Software and Info): updated URLs for 'yaboot'
+ and 'ybin'.
+* doc/parted.texi (Related Software and Info): parted@gnu.org ->
+ bug-parted@gnu.org.
+* doc/parted.texi (unit): corrected note on sector size.
+
+2005-11-07 Otavio Salvador <otavio@debian.org>
+* parted/parted.c (do_print): print a error when called with a invalid
+ argument.
+* parted/parted.c (do_print): add 'free' argument that display information
+ about disk freespace.
+
+2005-11-05 Leslie Polzer <leslie.polzer@gmx.net>
+* parted/ui.c: updated wording of bug reporting instructions
+* libparted/disk_gpt.c: updated to work with block sizes > 512 bytes
+
+2005-11-02 Leslie Polzer <leslie.polzer@gmx.net>
+* released 1.6.25
+
+2005-10-28 Guillaume Knispel <k_guillaume@libertysurf.fr>
+* libparted/fs_hfs/journal.c, libparted/fs_hfs/hfs.c: fix some exception
+ messages.
+* libparted/unit.c (ped_unit_format_custom): remove unused variable "result".
+
+2005-10-25 Guillaume Knispel <k_guillaume@libertysurf.fr>
+* libparted/disk_mac.c (_disk_add_part_map_entry): the function didn't
+ work when mac_disk_data->last_part_entry_num was null (when the only
+ existing partition is the partition table and the user destroy it).
+
+2005-10-24 Guillaume Knispel <k_guillaume@libertysurf.fr>
+* parted/parted.c (prefer_snap): incorrectly chose MOVE_STILL instead
+ of MOVE_UP or MOVE_DOWN if both weren't activated.
+
+2005-10-15 Guillaume Knispel <k_guillaume@libertysurf.fr>
+* libparted/filesys.c (_probe_with_open): The file system was considered
+ valid if the open method was not implemented. Now openable file systems
+ are considered first (if one and only one is successfully opened,
+ return it), then if only one non openable file system is remaining,
+ return it (else return NULL).
+
+2005-10-14 Guillaume Knispel <k_guillaume@libertysurf.fr>
+* libparted/disk_dos.c (_log_meta_overlap_constraint): ignore inactive
+ partitions.
+* parted/parted.c (snap_to_boundaries): didn't reliably work since the
+ range is variable, complete rewrite.
+* parted/parted.c (try_snap): was called by snap_to_boundaries, removed.
+* parted/parted.c (prefer_snap): new function called by snap_to_boundaries,
+ detect if the sector should be snaped to the begining of the partition
+ it belongs to, or to the end.
+
+2005-10-13 Guillaume Knispel <k_guillaume@libertysurf.fr>
+* libparted/disk_gpt.c (add_metadata_part): don't forget to free the
+ constraint if adding the metadata partition failed.
+
+2005-10-04 Guillaume Knispel <k_guillaume@libertysurf.fr>
+* doc/parted.texi: Unit command description added, based on what
+ was previously in 2.2 Using GNU Parted (which has been replaced
+ by a reference to the unit command...). Also various fixes in
+ @copying layout and some typos fixes.
+
+2005-10-03 Otavio Salvador <otavio@debian.org>
+* po/es.po: updated
+
+2005-10-03 Guillaume Knispel <k_guillaume@libertysurf.fr>
+Applied patch from Colin Watson <cjwatson@debian.org>:
+* libparted/linux.c (_device_get_part_path): check for devfs-style /disc
+ without even testing if _have_devfs(), because udev can be used instead
+ with the same behavior.
+
+2005-10-02 Guillaume Knispel <k_guillaume@libertysurf.fr>
+Applied patch from Matt Zimmerman <mdz@debian.org>:
+* include/parted/device.h: PED_DEVICE_UBD added in PedDeviceType.
+* libparted/linux.c (_device_probe_type): recognize UML UBD devices.
+* libparted/linux.c (linux_new): handle UML UBD devices.
+
+2005-09-21 Guillaume Knispel <k_guillaume@libertysurf.fr>
+* po/id.po: added (thanks to Arif E. Nugroho <arif_endro@yahoo.com>)
+* po/es.po: updated
+* doc/parted.8: updates from A. Costa <agcosta@gis.net>
+Applied patch from Otavio Salvador <otavio@debian.org>:
+* libparted/disk_dos.c (probe_partition_for_geom): Fix compiler warnings
+ while compiling with gcc 4.0.
+* libparted/disk_sun.c (sun_read): bugfix - recognize partitions on sun
+ disklabel.
+
+2005-08-22 Guillaume Knispel <k_guillaume@libertysurf.fr>
+* libparted/disk_dos.c (_align_logical_no_geom): removed
+ _calc_min_logical_start() and use a true constraint instead, generated by
+ the new _log_meta_overlap_constraint(). This constraint should enforce
+ necessary gaps between logical partitions to fit the linked list of
+ partition tables. This should get ride of the infamous Assertion
+ (metadata_length > 0) failed bug for extended msdos disklabels generated
+ by Parted.
+* libparted/disk_dos.c (_align_logical): also use
+ _log_meta_overlap_constraint() as mandatory.
+
+2005-08-21 Guillaume Knispel <k_guillaume@libertysurf.fr>
+* libparted/unit.c (parse_chs, ped_unit_parse_custom): set *range to NULL
+ and *sector to 0 on failure.
+* parted/ui.c (command_line_get_sector): set *value to 0 on failure.
+* parted/parted.c (do_mkpart, do_mkpartfs, do_move, do_resize): more memory
+ leak fixes (range_start, range_end).
+
+2005-08-10 Leslie Polzer <leslie.polzer@gmx.net>
+* parted/ui.c: updated wording of bug reporting instructions
+* released 1.6.24
+
+2005-08-09 Leslie Polzer <leslie.polzer@gmx.net>
+Applied patch from Eduardo Righes <eduardo@tteng.com.br>, HP Brazil:
+* include/parted/disk.h, libparted/disk.c, libparted/disk_gpt.c:
+ hidden partitions support and command to set MS Reserved partitions
+ through "set" command.
+
+2005-08-08 Leslie Polzer <leslie.polzer@gmx.net>
+* parted/parted.c (do_resize): fixed memory leak (range_start, range_end).
+
+2005-08-03 Guillaume Knispel <k_guillaume@libertysurf.fr>
+* libparted/disk_dos.c (msdos_partition_destroy): leak correction, free
+ ((DosPartitionData*)(part->disk_specific))->orig if necessary.
+* libparted/fs_fat/traverse.c (fat_traverse_complete): leak correction, free
+ trav_info->dir_name.
+* libparted/linux.c (_device_get_sector_size): preassign sector_size to
+ PED_SECTOR_SIZE to make Valgrind happy.
+* parted/ui.c (command_line_get_sector): set *range to NULL in case of failure.
+
+2005-08-01 Guillaume Knispel <k_guillaume@libertysurf.fr>
+* libparted/disk_dos.c (probe_partition_for_geom): integer only calculation
+ of cyl_size and head_size, to avoid FP arithmetic approximation problems.
+* doc/API: fixed documentation for PedUnit according to new prototypes.
+
+2005-07-26 Leslie Polzer <leslie.polzer@gmx.net>
+* parted/ui.c (command_line_get_sector): set range in default case
+
+2005-07-19 Guillaume Knispel <k_guillaume@libertysurf.fr>
+* all files: FSF address changed to
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+
+2005-07-11 Guillaume Knispel <k_guillaume@libertysurf.fr>
+CHANGE SUMMARY:
+ HFSX and journaled HFS+ / HFSX now supported.
+ The HFS+ / HFSX allocation bitmap is saved during relocation.
+ This is safer.
+* libparted/fs_hfs/*: cosmetic changes in ped_exception_throw calls.
+* libparted/fs_hfs/journal.c: added.
+* libparted/fs_hfs/journal.h: added.
+* libparted/fs_hfs/Makefile.am: journal.c and journal.h added.
+* libparted/fs_hfs/cache.h: new tags for journal info block (CR_BTREE_CAT_JIB)
+ and journal (CR_BTREE_CAT_JL)
+* libparted/fs_hfs/hfs.h: journal structs (HfsJJournalInfoBlock,
+ HfsJJournalHeader, HfsJBlockInfo, HfsJBlockListHeader) described.
+ HFSJ_JOURN_IN_FS, HFSJ_JOURN_OTHER_DEV, HFSJ_JOURN_NEED_INIT,
+ HFSJ_HEADER_MAGIC, HFSJ_ENDIAN_MAGIC, HFSX_CASE_FOLDING, HFSX_BINARY_COMPARE
+ added.
+ Fields dirty_alloc_map, allocation_file, jib_start_block, jl_start_block of
+ HfsPPrivateFSData added.
+* libparted/fs_hfs/hfs.c (hfsplus_open): allocate dirty_alloc_map and open
+ allocation_file. Do not emit the warning exception about untested attributes
+ file anymore.
+ (hfsplus_close): free dirty_alloc_map and close allocation_file.
+ New HFSX descriptors hfsx_ops && hfsx_type.
+ (ped_file_system_hfs_init, ped_file_system_hfs_done): (un)register HFSX.
+* libparted/fs_hfs/reloc.c (hfs_effect_move_extent): don't save the allocation
+ map anymore.
+ (hfs_move_extent_starting_at): save it here.
+* libparted/fs_hfs/reloc_plus.c (hfsplus_do_move): handle journal and bitmap
+ reloc.
+ (hfsplus_move_extent_starting_at): call to the new hfsplus_save_allocation
+ added.
+* libparted/fs_hfs/probe.c, libparted/fs_hfs/probe.h: hfsx_probe added.
+* libparted/disk_mac.c (mac_partition_set_system): HFSX support.
+* doc/parted.texi: updated documentation to reflect new journaled and hfsx
+ capabilities.
+
+2005-07-10 Andrew Clausen <clausen@gnu.org>
+* libparted/disk.c (_partition_check, _partition_check_extended): replaced
+ a specific start<=end sanity check in _partition_check_extended with
+ a generic assertion in _partition_check.
+* libparted/parted.c (_ped_abs, _solution_check_distant, _get_left_bound,
+ _get_right_bound, _grow_over_small_freespace): removed and replaced with
+ snap_to_boundaries() et al:
+* libparted/parted.c (snap_to_boundaries, try_snap, snap): these functions
+ do similar things to the functions above that they replace, except that
+ they constrain themselves by the recently introduced unit-specific ranges
+ rather than "small" magic numbers. In addition, it will snap to an
+ existing partition boundary to avoid consuming slightly more free space.
+ (So, it could possibly shrink or grow)
+* libparted/disk.c (ped_disk_add_partition, ped_disk_set_partition_geom):
+ these functions now deduce if a there are no constraint solutions because of
+ overlapping problems, and throws an appropriate exception. This means
+ that lots of "Unable to satisfy constraints" messages will be replaced
+ with "Can't have overlapping partitions" messages where appropriate.
+* po/pl.po: updated.
+
+2005-07-06 Andrew Clausen <clausen@gnu.org>
+* po/POTFILES.in: added libparted/fs_hfs/* and libparted/unit.c.
+* po/vi.po: added (thanks to Tran Thi Hoang Quyen!)
+* configure.in: added vi (Vietnamese) to the language list.
+* po/ja.po po/nl.po: updated.
+* libparted/disk_dvh (dvh_alloc, _handle_no_volume_header,
+ _get_extended_constraint): make the volume header partition include
+ the first sector of the disk (which contains the partition table.)
+* libparted/disk_dvh (_handle_no_volume_header): removed the Ignore option
+ for disks without a volume header partition.
+* libparted/disk_dvh (_get_primary_constraint, _get_extended_constraint):
+ don't align to cylinder boundaries any more.
+* libparted/fs_ext2/ext2_block_relocator.c: added some comments.
+* released 1.6.23
+
+2005-07-04 Andrew Clausen <clausen@gnu.org>
+* include/parted/natmath.h (ped_div_round_to_nearest): added.
+* libparted/unit.c (ped_unit_parse_custom, geometry_from_centre_radius):
+ move out-of-disk detection into geometry_from_centre_radius(), because
+ the tolerance level depends on the radius.
+* libparted/unit.c (ped_unit_parse_custom): clip the sector inside the
+ disk, if it passed the geometry_from_centre_radius() tolerance check.
+* libparted/unit.c (ped_unit_format_custom): round to the nearest unit.
+* libparted/unit.c (ped_unit_format_custom): format cylinders separately,
+ because they shouldn't be rounded.
+* libparted/unit.c (ped_unit_parse_custom): start counting at -1, so that
+ -0 is past the end of the disk.
+* libparted/constraint.c (ped_constraint_solve_nearest): it is not a bug
+ to have no end solution.
+* libparted/constraint.c (_constraint_get_end_range): fixed an out-by-1
+ error on the length sanity check.
+* libparted/unit.c (ped_unit_parse_custom): reduce the radius by 1.
+ This means a location is fuzzy only to strictly less than the unit
+ size.
+
+2005-07-03 Andrew Clausen <clausen@gnu.org>
+* include/parted/unit.h: rearranged the order of prototypes, and changed
+ some formatting.
+* libparted/unit.c (ped_unit_get_size, get_sectors_per_cent, remove_punct):
+ rearranged order of functions.
+* libparted/unit.c (ped_unit_format_custom): rewrote more compactly,
+ using ped_unit_get_name().
+* libparted/unit.c (parse_chs, ped_unit_parse_custom): moved CHS parsing
+ into a new separate function.
+* libparted/unit.c (parse_unit_suffix, ped_unit_parse_custom): moved
+ the unit parsing code into a separate new function.
+* libparted/unit.c (ped_unit_parse_custom): restructed error handling.
+* libparted/unit.c (ped_unit_get_size): make % simple: length*SECTOR_SIZE/100
+* libparted/parted.c: applied a patch by Benno Schulenberg to clean up
+ error message / UI text strings.
+
+2005-07-02 Leslie Polzer <leslie.polzer@gmx.net>
+* libparted/unit.c: fixed off-by-one error
+* doc/parted.texi: removed passage on ``='' notation and changed it
+ to document the new range handling.
+
+2005-07-01 Leslie Polzer <leslie.polzer@gmx.net>
+* libparted/unit.c: moved handling of negative locations to the right
+ place.
+
+2005-06-30 Leslie Polzer <leslie.polzer@gmx.net>
+* include/parted/unit.h (ped_unit_format): changed signature (swapped
+ order of arguments).
+* include/parted/unit.h (ped_unit_format_custom): changed signature to
+ match new API interface.
+* include/parted/unit.h (ped_unit_parse): changed signature to match
+ new API
+ interface (added range argument).
+* include/parted/unit.h (ped_unit_parse_custom): changed signature to
+ match new API (added ``range'' argument)
+* include/parted/unit.h (ped_unit_get_size): added.
+* parted/parted.c: fixed typo in help ("MUMBER").
+* parted/parted.c (_solution_check_distant): changed calls to match new
+ ped_unit_format signature.
+* parted/parted.c (_grow_over_small_freespace): removed handling of
+ is_start_exact and is_end_exact.
+* parted/parted.c (do_mkpart, do_mkpartfs, do_move, do_resize): changed
+ calls to command_line_get_sector and constraint_from_start_end to match
+ new signatures.
+* parted/parted.c (do_move, do_print): changed calls to ped_unit_format
+ to match new signature.
+* parted/parted.c (do_print): changed calls to ped_unit_format_custom
+ to match new signature.
+* parted/ui.h (command_line_get_sector): changed signature
+ (replaced ``int* is_exact'' with ``PedRange** range'')
+* parted/ui.c (command_line_get_integer): changed calls to
+ ped_unit_format to match new signature.
+* parted/ui.c (command_line_get_sector): removed handling of
+ is_start_exact and is_end_exact and changed signature accordingly.
+* libparted/unit.c: added API documentation.
+* libparted/unit.c (ped_unit_format): rewrote call to
+ ped_unit_format_custom to match new signature.
+* libparted/unit.c: (clip): added.
+* libparted/unit.c (geometry_from_centre_radius): added.
+* libparted/unit.c (ped_unit_parse_custom): removed differentiation
+ between double and long - double should be enough.
+* libparted/unit.c (ped_unit_parse_custom): vast simplification due to
+ new range handling and usage of new functions
+ geometry_from_centre_radius and ped_unit_get_size.
+* libparted/unit.c (get_sectors_per_cent): added.
+* libparted/unit.c (ped_unit_get_size): added.
+* libparted/disk.c (ped_disk_check): changed calls to match new
+ ped_unit_format signature.
+* libparted/fs_fat/calc.c (fat_check_resize_geometry): changed calls to
+ match new ped_unit_format signature.
+
+2005-06-18 Andrew Clausen <clausen@gnu.org>
+* libparted/constraint.c: more comments.
+
+2005-06-15 Andrew Clausen <clausen@gnu.org>
+* po/zh_TW: added. From Wei-Lun Chao <chaoweilun@pcmail.com.tw>.
+
+2005-06-12 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_dos.c (probe_partition_for_geom): some OEM partitioning
+ software (?) has an out-by-one error for numbering the ending cylinder
+ of partitions. This change supresses any exceptions, and treats the
+ CHS information as if the correct information had been given.
+
+2005-06-11 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_dos.c (probe_partition_for_geom): the old code couldn't
+ infer any information when the start head didn't divide the end head.
+
+2005-06-04 Andrew Clausen <clausen@gnu.org>
+* libparted/linux.c (init_scsi, scsi_get_product_info,
+ scsi_query_product_info, read_device_sysfs_file): Use /sys to
+ fetch vendor/product names before trying the deprecated ioctl,
+ SCSI_IOCTL_SEND_COMMAND. Based on a patch by Chris Lumens (thanks!)
+* libparted/geom.c: added more comments.
+* libparted/natmath.c: added more comments.
+* libparted/constraint.c: added more comments.
+* libparted/device.c: added more comments.
+* libparted/timer.c: added more comments.
+* libparted/filesys.c: added more comments.
+* libparted/disk.c: added more comments.
+
+2005-06-03 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_mac.c (_rawpart_is_active): empty partition names with
+ the type "Apple_Free" can also be free space partitions.
+
+2005-06-02 Andrew Clausen <clausen@gnu.org>
+* libparted/fs_fat/fat.c (fat_check): typecast -1 to (FatCluster). (gcc
+ complains otherwise)
+* libparted/linux.c (init_ide): call strip_name() on the prepared buffer
+ rather than the raw input.
+
+2005-05-14 Andrew Clausen <clausen@gnu.org>
+* libparted/fs_fat/fat.c (fat_check): don't complain about the information
+ sector reporting the number of free clusters as -1 ("I don't know").
+
+2005-05-10 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_mac.c (mac_partition_set_flag): put curly braces around
+ the if body in the PED_PARTITION_BOOT case.
+
+2005-04-20 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_mac.c (_rawpart_is_active): treat Apple_Free partitions
+ with names other than Extra as normal (active) partitions.
+* parted/parted (do_resize): allow resizing of extended partitions,
+ even if some logical partitions are mounted.
+
+2005-03-29 Andrew Clausen <clausen@gnu.org>
+* everything: more punctuation / grammatical fixes from Benno Schulenberg
+ <benno@nietvergeten.nl>.
+* libparted/disk_dvh.c (_handle_no_volume_header): only give a lax
+ constraint on the new volume header. (Previously, if there wasn't
+ much space, then the volume header would not be created. Now, a smaller
+ one gets created.)
+* libparted/disk_dvh.c (_parse_partition, _generate_partition): retire the
+ hack in which the start of the volume header was temporarily represented
+ as 1 rather than 0.
+* libparted/disk_dvh.c (_get_strict_extended_constraint): added.
+* libparted/disk_dvh.c (dvh_partition_align): allow the volume header
+ (extended partition) to begin on sector 0 in both strict and lax
+ constraint forms.
+* libparted/disk_dvh.c (dvh_alloc_metadata): only protect the partition
+ table with a metadata partition if the volume header (extended partition)
+ does not protect it already.
+* libparted/disk_dvh.c (dvh_alloc_metadata): always protect the partition
+ table, but use a logical metadata partition if the volume header
+ includes the partition table.
+
+2005-03-28 Andrew Clausen <clausen@gnu.org>
+* everything: more punctuation / grammatical fixes from Benno Schulenberg
+ <benno@nietvergeten.nl>.
+* everything: filesystem -> file system. (messages / comments only)
+* parted/parted.c (init_commands): describe "=" notation.
+* doc/parted.texi: describe "=" notation.
+* doc/parted.texi: link www.namesys.com/pub/libreiserfs
+
+2005-03-27 Andrew Clausen <clausen@gnu.org>
+* parted/parted.c (_rescue_add_partition()): fixed memory leaks.
+* parted/parted.c (_rescue_pass()): now accepts partitions that end within
+ the allowed end range. (Was previously buggy.)
+* parted/parted.c (_rescue_add_partition()): use ped_constraint_exact()
+ to force the partition geometry to match the probed filesystem's
+ geometry.
+* libparted/unit.c, doc/parted.texi: changes units to match SI standards.
+ eg: Mb -> MB, Kb -> kB.
+* libparted/libparted.c (init_disk_types, done_disk_types): put in
+ alphabetical order.
+* parted/ui.c parted/ui.h (command_line_get_integer, command_line_get_sector,
+ command_line_get_state, command_line_get_device, command_line_get_disk,
+ command_line_get_partition, command_line_get_fs_type,
+ command_line_get_disk_type):
+ all command_line_get_*() functions now take their default input value from
+ the same location as the output value.
+* parted/ui.c (command_line_get_sector): "=" specifies that the user
+ would like the partition to be exactly in that location, without
+ any possibility of being moved due to alignment or other reasons.
+* parted/parted.c (do_check, do_cp, do_mklabel, do_mkfs, do_mkpart,
+ do_mkpartfs, do_move, do_name, do_print, do_rescue, do_resize, do_rm,
+ do_select, do_set): updated to new ui.h interface.
+* parted/parted.c (do_name): include the old name as default.
+* everything: applied many punctuation / grammatical fixes from
+ Benno Schulenberg <benno@nietvergeten.nl>.
+
+2005-03-21 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_mac.c (mac_partition_set_flag, _rawpart_is_lvm):
+ Now uses "Linux_LVM" in the system name, not "lvm" in the volume name.
+* libparted/disk_mac.c (mac_partition_set_flag, _rawpart_is_raid,
+ _rawpart_analyse): Added analogous support for RAID partitions.
+* libparted/unit.c (ped_unit_parse_custom): throw an exception if the
+ location doesn't have any numbers as input.
+* parted/parted.c (do_print): remove padding spaces from text, and replace
+ them with numbers. This should make life easier for the translation
+ team.
+
+2005-03-20 Andrew Clausen <clausen@gnu.org>
+* include/parted/unit.h: added.
+* include/parted/parted.h: now includes unit.h.
+* include/parted/device.h: PED_SECTOR_SIZE is now defined in unit.h.
+* libparted/unit.c: added.
+* libparted/disk.c (ped_disk_check): use new unit.h formatting code.
+* libparted/fs_fat/calc.c (fat_check_resize_geometry): use new unit.h
+ formatting code.
+* parted/parted.c (do_unit): added a command for selecting the default unit.
+* parted/parted.c (_solution_check_distant): uses new unit.h formatting code.
+ The prototype changed to include "dev", which is required to format the "%"
+ and "cyl" units.
+* parted/parted.c (partition_print, do_print, _rescue_add_partition):
+ uses new unit.h formatting code.
+* parted/parted.c (do_print): changed "Minor" -> "Number".
+* parted/ui.c (command_line_get_sector): changed to use new unit.h
+ parsing and formatting code.
+* parted/ui.c (command_line_get_unit): added.
+* parted/ui.h: added command_line_get_unit() prototype.
+* doc/API: added documentation for PedUnit.
+* parted/parted.c: updated help text to reflect change from Minor to Number.
+* doc/parted.texi: update documentation to reflect change from Minor to Number.
+* doc/parted.texi: update documentation to reflect units changes.
+* include/parted/unit.h: added CHS support. (PED_UNIT_CHS)
+* libparted/unit.c: added CHS support.
+* parted/parted.c: display the size of partitions, except if the unit is CHS.
+
+2005-03-20 Andrew Clausen <clausen@gnu.org>
+* released 1.6.22
+
+2005-03-14 Chris Lumens <clumens@redhat.com>
+* libparted/fs_fat/fat.h: Change name to a char array in _FatDirEntry.
+* libparted/fs_fat/traverse.c (fat_dir_entry_is_active): One last unsigned
+ char vs. char compiler warning fix.
+* libparted/device.c: Functions named things like read, write, and check
+ can be implemented as macros which will get expanded here and cause
+ problems. Surround the names with parentheses to prevent macro expansion.
+* libparted/linux.c (_mount_table_search): Ignore sccanf result.
+
+2005-03-11 Guillaume Knispel <k_guillaume@libertysurf.fr>
+* libparted/fs_hfs/hfs.c, libparted/fs_hfs/reloc.c,
+ libparted/fs_hfs/reloc_plus.c: Make use of ped_geometry_sync_fast in hfs
+ and hfs+ code.
+
+2005-03-08 Chris Lumens <clumens@redhat.com>
+* libparted/disk_amiga.c, libparted/disk_gpt.c, libparted/disk_pc98.c,
+ libparted/disk_sun.c, libparted/linux.c, libparted/fs_hfs/reloc.c: Fix up
+ unsigned char vs. char compiler warnings.
+
+2005-03-07 Chris Lumens <clumens@redhat.com>
+* libparted/disk_mac.c: support LVM on PPC by setting the proper flags on the
+ partition (patch from Paul Nasrat <pnasrat@redhat.com>).
+
+2005-03-06 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_sun.c: many changes, including:
+ - replaced hw_geom with bios_geom.
+ - disk_specific->length is now set to cylinder_size * label->ncyl.
+ - label->acyl is now set to 0 by default.
+
+2005-03-05 Andrew Clausen <clausen@gnu.org>
+* doc/parted.8: changed "mips" to "dvh" to be consistent with the Parted
+ user interface.
+* doc/parted.texi: added http:// and ftp:// onto some URLs.
+
+2005-03-04 Chris Lumens <clumens@redhat.com>
+* libparted/fs_fat/context.c: fix casting typo.
+* include/parted/constraint.h, libparted/constraint.c: remove
+ ped_constraint_none that wasn't being referenced anywhere.
+
+2005-03-04 Andrew Clausen <clausen@gnu.org>
+* libparted/fs_fat/count.c (flag_traverse_fat): in the assignment to
+ cluster_info [clst].units_used, store 0, rather than 64. The code
+ has the same semantics, but no gcc4 compiler warning. (0 == 64 when
+ you use 6-bit integers; 0 is interpreted as 64 in all relevant code)
+ (problem reported by Chris Lumens <clumens@redhat.com>)
+
+2005-02-19 Guillaume Knispel <k_guillaume@libertysurf.fr>
+* libparted/fs_hfs/hfs.c (hfs_resize): do nothing when nothing to do.
+* libparted/fs_hfs/hfs.c (hfsplus_resize): do nothing when nothing to do.
+* libparted/fs_hfs/hfs.c (hfsplus_open): leak in the error handling code
+ corrected.
+
+2005-02-17 Guillaume Knispel <k_guillaume@libertysurf.fr>
+* include/parted/device.h (_PedDeviceArchOps): field sync_fast added.
+* include/parted/device.h (ped_device_sync_fast): added.
+* include/parted/geom.h (ped_geometry_sync_fast): added.
+* libparted/device.c (ped_device_sync_fast): added.
+* libparted/geom.c (ped_geometry_sync_fast): added.
+* libparted/gnu.c (gnu_dev_ops): sync_fast pointing to gnu_sync added.
+* libparted/linux.c (linux_sync_fast): added.
+* libparted/linux.c (linux_dev_ops): sync_fast pointing to linux_sync_fast
+ added.
+* doc/API : new ped_device_sync_fast and ped_geometry_sync_fast API
+ documented.
+
+2005-02-14 Chris Lumens <clumens@redhat.com>
+* parted/parted.c : on the help for the mkfs, mkpart, and resize commands,
+ only list filesystem types that are supported
+
+2005-02-02 Guillaume Knispel <k_guillaume@libertysurf.fr>
+* integrated HFS Patch 16 :
+* libparted/fs_hfs/hfs.c
+* libparted/fs_hfs/hfs.h
+* libparted/fs_hfs/probe.c
+* libparted/fs_hfs/probe.h
+* libparted/fs_hfs/cache.c
+* libparted/fs_hfs/cache.h
+* libparted/fs_hfs/advfs.c
+* libparted/fs_hfs/advfs.h
+* libparted/fs_hfs/file.c
+* libparted/fs_hfs/file.h
+* libparted/fs_hfs/reloc.c
+* libparted/fs_hfs/reloc.h
+* libparted/fs_hfs/advfs_plus.c
+* libparted/fs_hfs/advfs_plus.h
+* libparted/fs_hfs/file_plus.c
+* libparted/fs_hfs/file_plus.h
+* libparted/fs_hfs/reloc_plus.c
+* libparted/fs_hfs/reloc_plus.h
+* libparted/Makefile.am : modified according new source files listed above
+* libparted/disk_mac.c (mac_partition_set_system): tag partition with type
+ "Apple_HFS" if the filesystem is "hfs+" in addition to "hfs"
+* debug/test/test_fs_hfs : new non-regression tests for hfs
+* debug/test/test_fs_hfsplus : new non-regression tests for hfs+
+* debug/test/test (ped_test_get_val): allow bash evaluation of $post_command
+* doc/parted.texi (Supported File Systems): added resize operation for hfs
+ and hfs+, and a note stating they can only be made smaller.
+* doc/parted.texi (Command explanation Resize): talk about hfs.
+
+2005-01-16 Andrew Clausen <clausen@gnu.org>
+* released 1.6.21
+
+2005-01-10 Sven Luther <luther@debian.org>
+* libparted/disk.c, doc/parted.texi : renamed prep-boot prep partition name to
+ prep.
+
+2005-01-08 Andrew Clausen <clausen@gnu.org>
+* libparted/linux.c (linux_disk_commit): if the BLKPG method fails, try
+ the BLKRRPART method.
+
+2005-01-06 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_dos.c (msdos_write): put in a unique identifier (which
+ is misleadingly called the "MBR signature" by Microsoft docs and
+ EFI specs). Based on a patch by Matt Domsch <Matt_Domsch@dell.com>.
+
+2005-01-05 Sven Luther <luther@debian.org>
+* include/parted/endian.h : fixed PED_SWAP macros missing (), since it broke
+ on 64bit hardware as shown in the PED_CPU_TO_BE32(part ? part_num : LINK_END)
+ code snipplet, which applied the uint32 cast to part, and not the value.
+* libparted/disk_amiga.c, libparted/fs_amiga/amiga.c : Added some uint32 casts.
+
+2005-01-05 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_sun.c (sun_alloc, sun_read, sun_write): fixed
+ cylinder recording stuff. pcylcount is now 2 more, and ncyl is now
+ 2 less than it was before.
+* libparted/filesys.c (ped_file_system_clobber): removed a useless
+ (always-thrown) assertion for file system support for clobbering.
+
+2004-12-26 Harley D. Eades III <hde@grics.net>
+* libparted/gnu.c (gnu_new): Added three new variables ro_err, rw_err and
+ ispath. The ispath variables is set to 1 if path is indeed a path and not a
+ store type name. This prevents having to use strchr more then once. Added
+ a check for determining if the inputted path is a path and not a store-type
+ name. If (const char *)path is a path then use store_open (). If (const
+ char *)path is a store-type name use store_typed_open ().
+
+2004-12-21 Andrew Clausen <clausen@gnu.org>
+* libparted/linux.c (_disk_sync_part_table): removed duplicate error message.
+
+2004-12-19 Andrew Clausen <clausen@gnu.org>
+* libparted/linux.c (_device_get_part_path): only treat the device as
+ devfs if it has /disc on the end.
+* libparted/linux.c (_partition_get_part_dev): added.
+* libparted/linux.c (_partition_is_mounted_by_dev ): added.
+* libparted/linux.c (_partition_is_mounted): now uses
+ _partition_is_mounted_by_dev(). This is more reliable than guessing
+ the partition's device name.
+* libparted/linux.c (_device_probe_type): sets the type to
+ PED_DEVICE_UNKNOWN on block devices that don't fall into the
+ standard categories. This makes libparted correctly update
+ the kernel's view of partition tables, etc.
+
+2004-12-18 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_dos.c (probe_partition_for_geom): improved heuristic
+ for finding broken partition tables: test if any feasible solution
+ geometry exists against the end cylinder rather than 1024. This
+ heuristic now has fewer false negatives and no false positives.
+
+2004-12-18 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_dos.c (msdos_probe): look for SBML signature at offset 0x40,
+ rather than 0x39. (oops!)
+* libparted/disk_amiga.c: added (from Sven Luther)
+ Note: I did some cleanups, added assertions, etc.
+* libparted/fs_amiga/affs.c: added.
+* libparted/fs_amiga/affs.h: added.
+* libparted/fs_amiga/amiga.c: added.
+* libparted/fs_amiga/amiga.h: added.
+* libparted/fs_amiga/apfs.c: added.
+* libparted/fs_amiga/apfs.h: added.
+* libparted/fs_amiga/asfs.c: added.
+* libparted/fs_amiga/asfs.h: added.
+* libparted/fs_amiga/interface.c: added.
+* released 1.6.20
+
+2004-12-14 Harley D. Eades III <hde@grics.net>
+* libparted/disk_dos.c (msdos_probe): Fixed typo changed strcmp to
+ strncmp.
+
+2004-12-08 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_dvh.c (_generate_boot_file): zero out the boot file name
+ record before writing the name in. Previously, there was a misplaced
+ null-terminator that caused gcc to complain.
+
+2004-12-04 Andrew Clausen <clausen@gnu.org>
+* libparted/filesys.c (ped_file_system_resize, ped_file_system_copy):
+ only attempt to check file systems if checking is implemented for
+ that file system type.
+
+2004-11-29 Andrew Clausen <clausen@gnu.org>
+* libparted/fs_fat/bootsector.c (fat_boot_sector_analyse): when correcting
+ the boot sector, use fat_boot_sector_write() to make sure the backup
+ copy gets written (if applicable).
+* libparted/disk_dos.c (msdos_probe): don't treat Smart Boot Manager Loader
+ boot blocks as FAT file systems.
+
+2004-11-28 Sven Luther <luther@debian.org>
+* libparted/disk_dos.c: Added support for the prep-boot partition type.
+
+2004-11-28 Andrew Clausen <clausen@gnu.org>
+* libparted/fs_fat/boot_sector.c (fat_boot_sector_analyse): if the
+ file system's CHS geometry is insane, then let the user fix it.
+ This is important, because Linux refuses to mount FAT file systems
+ with insane CHS geometry. Moreover, a few recent versions of Parted
+ wrote some insane values here, so this allows users to fix the damage.
+* released 1.6.19
+
+2004-11-22 Andrew Clausen <clausen@gnu.org>
+* parted/ui.c (_construct_prompt): previously forgot to assign "prompt = ..."
+ in a realloc_and_cat() call. Patch from Woody Suwalski <woodys@xandros.com>
+
+2004-11-21 Andrew Clausen <clausen@gnu.org>
+* libparted/linux.c (linux_new): get rid of pointless exception for
+ exotic block devices.
+* configure.in, libparted/fs_reiserfs/reiserfs.c (reiserfs_fs_check):
+ applied patch by Yury to do a proper file system check.
+
+2004-11-20 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_dos.c (probe_partition_for_geom): don't attempt
+ to infer geometry from a partition whose end can't possibly be addressed
+ with CHS (regardless of the CHS geometry).
+* libparted/disk_dos.c (msdos_read): initialize bios_geom to the old
+ value, in case no better geometry can be found.
+* released 1.6.18
+* libparted/disk_gpt.c (_generate_header): changed a misleading comment
+ "per 1.02 spec" -> "per 1.00 spec".
+* libparted/disk_mac.c (mac_duplicate): don't create a partition map
+ entry - leave that for later.
+* libparted/disk_dos.c (msdos_read): avoid infinite recursion.
+* libparted/disk_dos.c (msdos_partition_align): refuse to resize
+ Windows Dynamic Disk partitions.
+
+2004-11-19 Andrew Clausen <clausen@gnu.org>
+* libparted/fs_fat/resize.c (create_resize_context): copy CHS info across.
+ (Was previously uninitialized - bug)
+* released 1.6.17
+
+2004-11-11 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_dos.c (msdos_partition_set_system): sun-ufs partitions
+ now have an ID of 0xbf.
+* libparted/disk_dos.c (probe_partition_for_geom): rewrote with lots
+ more comments + mathematical paranoia.
+
+2004-11-10 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_dos.c (realloc_metadata, msdos_read): better solution...
+ just call msdos_read() again if the CHS geometry needs to be changed.
+* libparted/disk_gpt.c (write_pmbr): if the partition is longer than
+ 32-bits can fit, then write 0xffffffff as per GPT spec. Patch from
+ Matt Domsch <Matt_Domsch@dell.com>.
+
+2004-11-08 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_dos.c (realloc_metadata): stupid bug fix: reset the start/end
+ to be the same as what they were before.
+* released 1.6.16
+
+2004-10-17 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_dos.c (probe_partition_for_geom): ignore CHS geometry
+ if the start cylinder is greater than the end cylinder.
+* libparted/fs_fat/bootsector.h: add another __attribute__ ((packed))
+ thingy to ensure the right alignment.
+* parted/parted.c (do_print, _rescue_add_partition): removed bogus
+ (int) casts. (%f, what was I thinking?!)
+
+2004-09-19 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_dos.c: replaced magic number 1023 with MAX_CHS_CYLINDER,
+ and set this constant to >1021 rather than >=1023. Some partition tables
+ in the wild have 1022 as a "partition-too-big-for-CHS" indicator.
+* released 1.6.15
+
+2004-09-13 Harley D. Eades III <hde@grics.net>
+* libparted/gnu.c (_device_probe_geometry): Variable declaration had
+ wrong name.
+
+2004-09-08 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_dos.c (realloc_metadata, read_table): added an ugly hack to
+ force metadata to be reallocated according to the new BIOS geometry.
+* libparted/disk_dos.c (msdos_alloc_metadata): yet another overlapping case
+ I missed: the extended partition's partition table area needs to be
+ small enough to leave room for the logical partition (or logical partition
+ table) that follows it.
+* libparted/linux.c (linux_check): s/int/PedSector/ to be on the safe side.
+
+2004-09-07 Andrew Clausen <clausen@gnu.org>
+* libparted/gnu.c (_device_probe_geometry): fixed compile bug with the
+ bios_geom initialization, and now initializes hw_geom as well.
+
+2004-09-06 Andrew Clausen <clausen@gnu.org>
+* released 1.6.14
+
+2004-09-05 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_dos.c (partition_probe_bios_geometry): fixed the
+ call ped_partition_is_active... it wasn't a function call before!
+
+2004-09-04 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_dos.c (chs_get_sector): a bitmask operation is more elegant.
+* libparted/disk_dos.c (chs_to_sector, probe_partition_for_geom):
+ replaced 1022 with 1023 for consistency.
+* libparted/disk_dos.c (probe_partition_for_geom): added assertions that
+ test if the goal has been met.
+* libparted/disk_dos.c (read_table, msdos_alloc_metadata):
+ Use PED_PARTITION_NORMAL instead of 0.
+* libparted/disk_dos.c (msdos_alloc_metadata, add_startend_metadata):
+ Now make sure the placeholder/metadata partitions never overlap with real
+ partitions. Should get rid of the "overlapping partitions" error message
+ bug.
+* released 1.6.13
+
+2004-09-03 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_dos.c (disk_probe_bios_geometry): check if the partition
+ is active before querying if it has the boot flag set. This prevents
+ some spurious error exceptions from ped_partition_get_flag().
+* libparted/disk_dos.c (read_table): if we have an invalid partition table
+ signature, we now ignore the entire partition table rather than processing
+ dodgey data.
+
+2004-08-31 Andrew Clausen <clausen@gnu.org>
+* doc/API: fixed PedDevice documentation.
+* libparted/disk_dos.c (msdos_partition_duplicate): now duplicates
+ partition->dos_data->orig.
+
+2004-08-29 Andrew Clausen <clausen@gnu.org>
+* libparted/linux.c (_mount_table_search): now works by comparing device
+ major/minor rather than device names.
+* libparted/linux.c (_partition_is_mounted, _partition_is_mounted_by_path,
+ linux_is_busy): minor cosmetic changes.
+* parted/parted.c (_partition_warn_busy): removed the "Ignore" option.
+ Users *must* unmount!
+
+2004-08-17 Andrew Clausen <clausen@gnu.org>
+* libparted/exception.c (log2): renamed to ped_log2 to avoid clash with
+ a new gcc builtin. Bug reported by David Ronis (thanks!)
+
+2004-08-16 Andrew Clausen <clausen@gnu.org>
+* released 1.6.12
+
+2004-08-15 Andrew Clausen <clausen@gnu.org>
+* include/parted/device.h (PedDevice): replaced sectors, heads, cylinders
+ with hw_geom and bios_geom.
+* libparted/disk_dos.c: rewrote to use better heuristics and have a more
+ "subjective" view of CHS geometry. (i.e. each partition's "opinion"
+ may differ now)
+* configure.in parted/Makefile.am: fixed linker invocation. Rumored
+ to fix ppc64 build issues. Sent by Jeremy Katz <katzj@redhat.com>.
+
+2004-06-26 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_dos.c (read_table): big cleanup
+* libparted/disk_dos.c (read_table, process_bad_chs): now probes Microsoft
+ file systems for BIOS CHS geometry. This idea was suggested by
+ Steffen Winterfeldt <snwint@suse.de>.
+
+2004-06-21 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_dvh.c: some cleanups and change to fill in all fields in the
+ header from Eric Sandeen (sandeen@sgi.com)
+
+2004-06-16 Andrew Clausen <clausen@gnu.org>
+* libparted/fs_fat/bootsector.c: bs->cluster_size is 8-bit; removed byteswap.
+ Patch from John Gilmore gnu@toad.com (thanks!)
+
+2004-05-01 Andrew Clausen <clausen@gnu.org>
+* libparted/debug.c include/parted/debug.h (ped_assert): change prototype
+ to have all (pointer) parameters to be const. (char* -> const char *)
+
+2004-04-25 Andrew Clausen <clausen@gnu.org>
+* libparted/linux.c (linux_read, linux_write): don't do the kludge ioctl
+ for linux >= 2.6.0. Patch from Matt Domsch. (Thanks!)
+* libparted/fs_reiserfs/geom_dal.c, libparted/geom.c, libparted/gnu.c,
+ libparted/linux.c: trivial patch to move pointers dereferences after
+ "not-NULL" assertions. Patch from Guillaume. (Thanks!)
+* released 1.6.11
+
+2004-04-16 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_mac.c (mac_alloc): fixed incorrect malloc() check
+ (alex.kiernan@thus.net)
+* libparted/linux.c (_device_get_sector_size): always return a sane value.
+* added new translation: it (thanks to Giuseppe Sacco)
+* added new translation: uk (thanks to Maxim V. Dziumanenko)
+* released 1.6.10
+
+2004-04-04 Andrew Clausen <clausen@gnu.org>
+* re-ran libtoolize. (Patrick LoPresti <patl@users.sf.net> pointed out that
+ ltmain.sh was way out of date)
+* released 1.6.9
+
+2004-03-27 Andrew Clausen <clausen@gnu.org>
+* configure.in: removed intl/ from AC_OUTPUT
+* released 1.6.8
+
+2004-03-20 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_sun.c: avoid endian conversion on a constant (Sven Luther)
+* libparted/linux.c (BLKGETSIZE64): pass type directly, not sizeof().
+ (Sven Luther)
+* libparted/fs_reiserfs/reiserfs.h libparted/fs_ufs/ufs.c: fix padding sizes
+ (Roman Zippel)
+* include/parted/disk.h libparted/disk_dos.c: add HP palo partition type.
+ (Richard Hirst)
+* released 1.6.7
+
+2004-03-11 gettextize <bug-gnu-gettext@gnu.org>
+ * Makefile.am (SUBDIRS): Add m4.
+ (SUBDIRS): Remove intl.
+ (ACLOCAL_AMFLAGS): New variable.
+ (EXTRA_DIST): Add config.rpath.
+ * configure.in (AC_OUTPUT): Add m4/Makefile.
+
+2003-07-26 Andrew Clausen <clausen@gnu.org>
+* added new translation: zh_CN (thanks Wang Li :)
+* updated translation: tr
+* released 1.6.6
+
+2003-07-21 Andrew Clausen <clausen@gnu.org>
+* applied updated translations: cs, fr, ja, pl
+
+2003-06-30 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_*.c (*_partition_duplicate): added new_part->num = part->num
+ or result->num = part->num.
+* libparted/fs_ext2/ext2.c (ext2_open): changed "not cleanly unmounted"
+ from a warning to an error, and default to cancel. Added a message saying
+ not ignoring could cause severe corruption.
+* parted/parted.c (_partition_warn_busy): added a message saying not ignoring
+ could cause severe corruption.
+* released 1.6.6-pre2
+* libparted/fs_ext2/ext2_resize.c (ext2_resize): offer to disable dir_index,
+ explaining how to reenable it later.
+* libparted/fs_ext2/ext2_fs.h libparted/fs_ext2/ext2.c: added DIR_INDEX
+ stuff... now doesn't complain too much about dir_index.
+* doc/parted.texi: applied Thomas Hood's changes. (thanks!)
+
+2003-06-29 Andrew Clausen <clausen@gnu.org>
+* libparted/disk.c (ped_disk_get_maximum_geom): applied a tight constraint
+ for restoring the geometry. (It was loose before, and sometimes being
+ reverted incorrectly. Ooops!)
+* parted/parted.c (start_end_msg): describe semantics of negative values.
+* released 1.6.6-pre1
+* added Czech translations (thanks Miloslav :)
+* updated Turkish, Danish translations
+
+2003-06-22 Andrew Clausen <clausen@gnu.org>
+* applied new Polish translations.
+* doc/parted.texi: s/mkparted/mkpart/ (Kent Robotti's program)
+* libparted/disk_gpt.c: changed some large constants to LL (long long).
+* parted/parted.c (do_print): translate partition type names. ("primary", etc.)
+* switched to new autoconf/automake/libtool. This means acconfig.h was
+ removed, and comments were added to AC_DEFINE invocations in configure.in.
+
+2003-02-23 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_gpt.c: applied patch from Arun Sharma <arun.sharma@intel.com>
+ to use write version 1.0, not 1.02 on the table, for compatibility reasons.
+ Insignificant for copyright purposes, IMHO.
+* released 1.6.5
+
+2003-02-16 Andrew Clausen <clausen@gnu.org>
+* libparted/linux.c (_disk_sync_part_table): fixed an array over-run
+ bug reported by Sven Hartrumpf <Sven.Hartrumpf@FernUni-Hagen.de>.
+ Applied a modified version of this patch. Insignificant for copyright
+ purposes, IMHO.
+* doc/parted.texi: fixed somes of typos and broken URLs.
+
+2003-01-03 Andrew Clausen <clausen@gnu.org>
+* released 1.6.5-pre1
+
+2002-12-26 Andrew Clausen <clausen@gnu.org>
+* libparted/linux.c (_match_rd_device, _compare_digit_state,
+ _probe_proc_partitions): added, added and modified respectively to
+ match raid devices looking like /dev/rd/c0d0, which are not partitions.
+* libparted/disk_dvh.c, libparted/Makefile.am, libparted/libparted.c:
+ renamed from everything from mips to dvh, including the file name
+ libparted/disk_mips.c.
+
+2002-12-08 Andrew Clausen <clausen@gnu.org>
+* applied updated translations: de
+
+2002-12-07 Andrew Clausen <clausen@gnu.org>
+* applied updated translations: fr, gl, tr, ja
+* configure.in parted/Makefile.am partprobe/Makefile.am:
+ renamed PARTED_LDFLAGS to PARTEDLDFLAGS... it was causing automake to
+ do some odd things (name-space collision?)
+* released 1.6.4
+
+2002-12-06 Andrew Clausen <clausen@gnu.org>
+* libparted/fs_fat/calc.c (fat_calc_sizes, fat_recommend_min_cluster_size):
+ for fat32, try to avoid getting more than 2,000,000 clusters by increasing
+ the cluster size. Otherwise, Windows coughs.
+* released 1.6.4-pre2
+
+2002-11-15 Andrew Clausen <clausen@gnu.org>
+* released 1.6.4-pre1
+
+2002-11-13 Andrew Clausen <clausen@gnu.org>
+* debug/test/test_fs_ext2: added a test for creating 0-length fs
+* doc/API: fixed docs for ped_disk_get_partition_by_sector() and
+ ped_constraint_any()
+* doc/parted.texi: updated section on bootdisks
+* libparted/fs_fat/bootsector.c (fat_boot_sector_read): defined the
+ role of error checking in this function better. [It should guarantee
+ fat_boot_sector_probe_type() will work]. Added a check for
+ bs->cluster_size != 0) to satisfy this clarification. (msw reported
+ divide-by-zero)
+* libparted/linux.c (init_file): replaced assertion dev->length > 0 with
+ a check + error message.
+* (_partition_is_root_device): now returns -1 ("unknown") on error
+* (_partition_is_mounted_by_path): re-did the logic with case statements,
+ and now remembers if /proc/mounts and /etc/mtab are broken. Gives
+ a better error message.
+* parted/parted.c (do_print): removed cruft: we don't print free-space
+ partitions
+* applied updated translations: fr, ja
+
+2002-08-31 Andrew Clausen <clausen@gnu.org>
+* parted/parted.c (do_mkpart): moved ped_constraint_destroy() to just
+ before the return, so error handling occurs correctly.
+
+2002-08-11 Andrew Clausen <clausen@gnu.org>
+* released 1.6.3
+
+2002-08-10 Andrew Clausen <clausen@gnu.org>
+* libparted/linux.c (_kernel_has_blkgetsize64, _device_get_length):
+ applied patch from Matt Domsch that adds support for a new ioctl,
+ BLKGETSIZE64
+* parted/parted.c (_done): surpress the /etc/fstab advice in script mode
+
+2002-08-08 Andrew Clausen <clausen@gnu.org>
+* updated translations: da, de, es, fr, gl
+* new translations: tr (Turkish) - thanks Eyp :)
+
+2002-07-06 Andrew Clausen <clausen@gnu.org>
+* doc/parted.texi: more fixes for name, print
+* released 1.6.2
+
+2002-07-03 Andrew Clausen <clausen@gnu.org>
+* doc/pt_BR-parted.texi doc/pt_BR-FAQ: added (by Bernardo Joo Torres da
+ Silveira)
+* doc/Makefile.am: changes for the pt translations
+* doc/API: misc. fixes
+* doc/parted.texi: point people interested in reiserfs to reiserfs.osdn.org.ua
+* doc/parted.texi: updated docs for "rescue"
+* configure.in libparted/Makefile.am: fixed reiserfs linking issues with
+ --enable-all-static --disable-dynamic-loading
+* libparted/disk.c (_disk_check_sanity): removed ugly MSDOS sanity-check.
+ The code's well tested, and occassionally the "insane" condition occurs
+ legitimately.
+* libparted/disk_pc98.c (pc98_probe, check_partition_consistency): made
+ probing a bit stricter.
+* libparted/fs_fat/table.c (fat_table_read): fixed a bug in the
+ initialization of ft->cluster_count. It was calculating (incorrectly),
+ rather than using fs_info->cluster_count. This was causing assertions to
+ fail soon after, in some situations. This is always harmless (if you
+ ignore).
+* libparted/linux.c (_mount_table_search): don't confuse "/dev/hda12"
+ with "/dev/hda1", etc.
+* parted/parted.c (_timer_handler): rewrote, much simpler. Also,
+ friendlier to epileptics!
+* (do_check): added a check to see if the partition in busy
+* (do_rescue): new implementation: now only searches in a small radius
+ around the start for signatures. Much faster.
+* (wipe_line): from parted.c to ui.c
+
+2002-05-12 Andrew Clausen <clausen@gnu.org>
+* updated translations: ca, es, fr, gl
+* debug/test/test_fs_ext2: added a test for creating "0 size" fs's. (the
+ constraint solver should deal with this)
+* libparted/fs_fat/bootsector.c (fat_boot_sector_analyse): when the FATs
+ are apparantly too small... this isn't an error! Just assume there are
+ fewer clusters.
+* partprobe/Makefile.am: move @PARTED_LIBS@ to end of partprobe_LDADD.
+ Static linking (--enable-all-static) failed without this.
+* released 1.6.1
+
+2002-04-30 Andrew Clausen <clausen@gnu.org>
+* doc/parted.texi: removed duplication of commands
+* updated translations: ca, es
+* released 1.6.0
+
+2002-04-28 Andrew Clausen <clausen@gnu.org>
+* parted/Makefile.am: moved @PARTED_LIBS@ after libparted in the parted
+ rule, to satisfy dependencies correctly (--enable-all-static seemed
+ to need this)
+* doc/parted.texi: updated to reflect current state of reiserfs support.
+ Also updated legal notices to match the current situation.
+* doc/pt_BR-parted.8: added (thanks Minami!)
+* doc/Makefile.am: some automake gymnastics to get pt_BR-parted.8 installed
+ in the right place.
+* updated translations: de, fr, gl, ja
+* debug/test/fs_reiserfs: added reiserfs regression tests
+* libparted/fs_reiserfs/reiserfs.c (reiserfs_get_create_constraint):
+ was setting the minimum size too low, since it was returning in (4k) blocks,
+ not libparted 512 blocks.
+* released 1.6.0-pre11
+
+2002-04-25 Andrew Clausen <clausen@gnu.org>
+* libparted/fs_reiserfs/reiserfs.c libparted/fs_reiserfs/reiserfs.h
+ libparted/fs_reiserfs/geom_dal.c libparted/fs_reiserfs/geom_dal.h:
+ basically rewrote. Now interfaces to Yura Umanets' libreiserfs
+ which can be found at: http://reiserfs.linux.kiev.ua/
+ This patch is mainly by Yura himself. It supplies a similar level
+ of support to that of current ext2 support. (resize-the-end, etc.)
+ Note: libreiserfs has not been widely tested yet. Use your own judgement.
+* configure.in: added a "dynamic linking" option, enabled by default.
+ Components that support this feature will only be enabled if their
+ respective dependencies are available at *run-time*. Only reiserfs
+ supports this. (It has a *soft* dependency on libreiserfs)
+* released 1.6.0-pre10
+* libparted/fs_fat/bootsector.c libparted/fs_fat/bootsector.h
+ (fat_boot_sector_probe_fat_type): renamed from probe_fat_type(), and
+ made global.
+* libparted/fs_fat/fat.c (fat_probe): doesn't fail on failure in
+ fat_boot_sector_analyse() anymore.
+
+2002-04-23 Andrew Clausen <clausen@gnu.org>
+* updated translations: fr.po gl.po
+* debug/tests/test_fs_ext2 (test_mkpartfs): added test for creating 0
+ size file system. (Should succeed, by constraint solver finding closest
+ match...)
+* libparted/disk_gpt.c (gpt_alloc): minor bug fix (forgot /512)
+* (gpt_partition_new): forgot to initialize gpt_part_data->hp_service
+* libparted/fs_ext2/ext2_mkfs.c (ext2_mkfs): complain if the fs is too small
+* (_ext2_get_create_constraint): oops, the minimum size needs to be 64
+ sectors
+* libparted/timer.c (ped_timer_update): need to cast to long, because the
+ language lawyers tell us it is necessary for ia64
+* parted/parted.c (_timer_handler): moved fflush() and cleaned up a bit
+* (_solution_check_distant): better heuristic
+* (main): script mode now means "non-interactive mode". This might hurt
+ some people... please scream if it does!
+* parted/ui.c (command_line_get_word): minor changes in semantics.
+* (command_line_get_sector): use doubles, not long doubles. (yet-another
+ gcc bug work-around)
+
+2002-04-10 Andrew Clausen <clausen@gnu.org>
+* "all over": moved #include <libintl.h> and friends inside #ifdef ENABLE_NLS
+ (reported by umanets)
+* libparted/disk_mips.c (_flush_stale_flags): moved outside of
+ #ifdef DISCOVER_ONLY (reported by Umanets :)
+* updated translations: es
+* include/parted/disk.h libparted/disk.c: added a flag PED_PARTITION_HPSERVICE
+* libparted/disk_gpt.c (gpt_partition_set_flag): fixed... wasn't setting system
+* libparted/disk_gpt.c: added the hp-service flag
+* libparted/fs_ufs/ufs.c: fixed struct ufs_super_block... wrong types for
+ some fields... and added an assertion to ped_file_system_ufs_init() to
+ make sure it's right (reported by Richard Hirst)
+* released 1.6.0-pre9
+
+2002-04-08 Andrew Clausen <clausen@gnu.org>
+* "all over": #include <stdint.h> and use standard types
+* configure.in: removed checks for __u8 and friends
+* updated translations: de, fr, gl, nn
+* libparted/disk_gpt.c: comment out __attribute__ ((packed))... work around
+ a gcc bug.
+* released 1.6.0-pre8
+
+2002-04-05 Andrew Clausen <clausen@gnu.org>
+* libparted/linux.c (_flush_cache): count from 1. (first partition is 1)
+* (_device_get_part_path): was a bit broken for devfs, causing segfaults
+* libparted/fs_fat/fat.c (fat_clobber): remove the "FAT16" or "FAT32"
+ signatures as well, since lots of programs look for them.
+* parted/ui.c (non_interactive_mode): push each argument on as a line,
+ so quoted parameters are parsed correctly, like "mkpartfs primary"
+ is parsed as two words.
+* libparted/disk_mac.c (_rawpart_analyse): ignore boot region stuff,
+ so it works properly with Mac OSX.
+* released 1.6.0-pre7
+
+2002-04-02 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_dos.c (msdos_probe): removed lots of pc98 voodoo... really
+ unnecessary since pc98_probe() is very conservative.
+
+2002-04-01 Andrew Clausen <clausen@gnu.org>
+* updated/new translations: da, de, es (new! thanks Vicente!), fr, gl, nn
+* doc/parted.8: updated (Timshel)
+* doc/partprobe.8: added (Timshel)
+* doc/parted.texi: updated - removed a lot of (now) unnecessary commentary
+* include/parted/endian.h (PED_LE64_TO_CPU): fixed... now uses PED_SWAP64
+* libparted/fs_linux_swap/linux_swap.c: complete restructure
+* parted/parted.c (do_check): return failure if ped_file_system_check()
+ fails
+* (do_mkpart): removed leak on peek_word
+* (do_print, partition_print_flags, partition_print): added a more
+ detailed print option for a single partition. (eg: "print 5")
+* parted/ui.c (command_line_get_fs_type): s/unkown/unknown/
+* (_can_create_primary): out-by-one bug on for loop
+* (command_line_get_new_part_type): if you can't create anymore partitions,
+ fail here.
+* released 1.6.0-pre6
+
+2002-03-23 Andrew Clausen <clausen@gnu.org>
+* parted/parted.c (main): return 1 (error) if no device is found
+* libparted/linux.c (_dev_get_part_path): for devfs: strip off "/disc"
+ (suggested by Woody Suwalski <woodys@xandros.com>)
+* libparted/disk_dos.c (msdos_partition_set_system): for raid/lvm,
+ call ped_partition_set_system(), like everyone else.
+
+2002-03-16 Andrew Clausen <clausen@gnu.org>
+* parted/ui.c (command_line_push_line): rewrote, and commented more.
+* (command_line_get_sector): now accepts "-XXX" notation, to count from the
+ end of the device (idea from Timshel, but rewritten to a 2-line change...)
+* libparted/disk.c (_partition_get_overlap_constraint): subtle fixes
+* parted/parted.c (do_resize): set default start/end to the old start/end
+* debug/test/test_disk_*: updated tests to test for correction (rather than
+ failure) of overlap problemas (via the constraint solver)
+* updated translations: fr, gl, ja
+* released 1.6.0-pre5
+
+2002-03-13 Andrew Clausen <clausen@gnu.org>
+* libparted/filesys.c (_test_open): now calls fs_type->ops->close,
+ not ped_file_system_close(), to be consistent with the call to
+ fs_type->ops->open() (it opens in a non-standard way).
+ This also happens to fix a dev->open_count bug, since
+ ped_file_system_close() calls ped_device_close().
+
+2002-03-11 Andrew Clausen <clausen@gnu.org>
+* libparted/linux.c (_flush_cache): only flush partition devices if they
+ aren't mounted.
+* libparted/constraint.c (_constraint_get_end_range): fixed fencepost
+ (out-by-one) error in maths
+* libparted/disk.c (_partition_get_overlap_constraint): rewrote, this
+ time running in update mode.
+* (ped_disk_add_partition, ped_disk_set_partition_geom): adjusted to
+ call _partition_get_overlap_constraint() in update mode. Much
+ cleaner now :) (Also, there were subtle cases that were broken
+ before, that are correct now, since neither function require
+ the disk to be in update mode...)
+* applied updated translations: ca da de
+* libparted/linux.c (_flush_cache): set the device to clean after flushing
+* released 1.6.0-pre4
+
+2002-03-09 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_dos.c: applied patch from Andreas Dilger... replaced
+ partition magic values with #defines
+* libparted/linux.c (_disk_sync_part_table): applied patch from Andreas
+ Dilger... delete all non-busy partitions and add them all back, to
+ avoid overlap problems
+
+2002-03-09 Timshel Knoll <timshel@debian.org>
+* libparted/disk_mips.c (_handle_no_volume_header): fixes to "variable might
+ be used uninitialised in this function" compile warnings. (The wrong
+ exit goto was being called from the PED_EXCEPTION_CANCEL case)
+* parted.m4: don't call AC_CANONICAL_HOST, AC_REQUIRE(AC_CANONICAL_HOST)
+ instead! This fixes getting an autoconf warning about AC_CANONICAL_HOST
+ being invoked multiple times
+
+2002-03-03 Andrew Clausen <clausen@gnu.org>
+* libparted/device.c (_ped_device_probe): don't need to canonicalize
+ the path (again). (pointed out by Andreas)
+* libparted/disk.c (_partition_get_overlap_constraint,
+ _disk_check_part_overlaps, _partition_check_basic_sanity,
+ _check_extended_partition, _check_partition ped_disk_add_partition,
+ _calc_aligned_geom, _check_new_extended_geometry, _check_changed_geometry,
+ ped_disk_set_partition_geom, ped_disk_get_max_partition_geometry):
+ major surgery: when creating/modifying a partition, we compute an overlap
+ constraint rather than checking if the partition overlaps after going
+ through the alignment process
+* libparted/disk_dos.c (msdos_partition_set_system): check fs_type is
+ non-null, and get the strcmp right (needed a !)
+* parted/parted.c (_solution_check_distant): fixed a bug... it was
+ only saying that >=10% bigger was "distant" (not >=10% smaller)
+* parted/ui.c (command_line_prompt_words): if there is one possibility,
+ then set it to default
+* (command_line_get_fs_type): complain if the user doesn't type in something
+ that matches a file system
+* released 1.6.0-pre3
+
+2002-02-21 Andrew Clausen <clausen@gnu.org>
+* libparted/exception.c (default_handler): default_handler now writes to
+ stderr, not stdout (patch from Andreas Dilger)
+
+2002-01-26 Anderw Clausen <clausen@gnu.org>
+* libparted/filesys.c (ped_file_system_copy): don't ped_device_close()
+ new_fs->geom. (It's still open!) (reported by "andreas t"
+ <FNEUWUOUTPKR@spammotel.com>)
+* libparted/fs_fat/resize.c (create_resize_context): copy old serial number
+ on resizing (fs_info->serial_number) (reported by Andreas Dilger)
+* libparted/linux.c (_probe_proc_partitions): use fgets(), so we don't barf
+ on junk at end-of-line (patch by Andreas Dilger)
+* (linux_probe_all): call _probe_standard_devices unconditionally...
+ /proc/partitions might give devfs paths, even if there is no devfs,
+ making /proc/partitions somewhat useless :/
+* included new/updated translations: 1.6: fr, nn 1.4: ca, da, de
+* released 1.6.0-pre2
+
+2002-01-24 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_dos.c (msdos_probe): changed strcmp (x, "FAT") to
+strncmp (x, "FAT", 3)... stupid bug
+
+2002-01-23 Andrew Clausen <clausen@gnu.org>
+* libparted/filesys.c (ped_file_system_open): now calls fs_type->ops->open
+ on the probed geometry returned by fs_type->ops->probe. If this doesn't
+ lie within the geometry passed to ped_file_system_open, then we complain
+ loudly. Also, this means that:
+ ped_geometry_test_inside (geom,
+ ped_file_system_probe_specific (fs->type, geom))
+ is always true.
+* doc/parted.texi doc/USER/Makefile.am doc/fdl.texi doc/COPYING.doc:
+ replaced plaintext docs with texinfo versions. This conversions was
+ done by Richard M. Kreuter (thanks!)
+* released 1.6.0-pre1
+
+2002-01-21 Matt Domsch <matt_domsch@dell.com>
+* libparted/disk_gpt.c (gpt_probe, _is_pmbr_valid): needed a few
+ PED_CPU_TO_LEXX conversions to be safe
+* (swap_uuid_and_efi_guid, gpt_alloc, gpt_partition_new): Due to Intel
+ madness, RFC-defined UUIDs and GUIDs and Intel's specification
+ of efi_guid_t aren't quite the same. Close, but no cigar...
+ So, uuid_generate(uuid) gives a perfectly valid big-endian uuid, but needs
+ to have some fields byte-swapped to be considered an efi_guid_t. Likewise,
+ an efi_guid_t needs to be byte-swapped back to a big-endian uuid prior to
+ calling uuid_unparse() on it.
+
+2002-01-20 Andrew Clausen <clausen@gnu.org>
+* libparted/linux.c (linux_refresh_close): only flush caches if there have
+ been writes.
+* updated po/nn.po (thanks Kjetil)
+* debug/test/HOWTO: wrote/added
+
+-----------------------------------------------------------------------------
+1.5.x
+-----------------------------------------------------------------------------
+
+2002-01-16 Andrew Clausen <clausen@gnu.org>
+CHANGE SUMMARY:
+ updated the user documentation, fixed minor FAT bugs, major MIPS
+ partition table bugs, minor changes to UI, fixed all regression tests
+ - all pass :)
+* debug/clearfat/clearfat.c (main): check if fs->type->name is fat16/fat32,
+ not FAT
+* debug/test/test (ped_test_get_val, ped_test, ped_test_expect_fail):
+ now operate in parted's script mode. Removed support for parsing input
+ in stdin (it gets ignored in script mode)
+* debug/test/test_*: remove extra parameter for stdin input
+* debug/test/test_disk_* (test_outside_boundary): removed... the front end
+ deals with this, and obviously works ;)
+* debug/test/test_disk_msdos debug/test/test_disk_pc98 (test_primary_overlap):
+ use fat16, not fat
+* debug/test/test_disk_mips: added
+* debug/test/test_fs_ext2 (do_diff, prepare_resize_tests): to make the diff
+ "right", make diff ignore lost+found, rather than deleting it before
+ the diff.
+* debug/test/test_fs_ext2: e2fsck -n... otherwise new version refuse to run
+ non-interactively
+* debug/test/test_fs_fat (test_mkpartfs): added two tests for creating
+ minimum size fat16 and fat32. Give the constraint solver some work ;)
+* libparted/disk_*.c (*_partition_set_system): removed "special" cases
+ for partition types, if the special case is the default
+* libparted/disk_mips.c (mips_read, mips_write, mips_partition_new,
+ mips_partition_get_flag, mips_partition_set_flag):
+ MIPSDiskData now uses partition numbers, not pointers to maintain the
+ swap/boot/root flags. There was a dangling pointer bug on removing
+ partitions, which was fundamental to the old bogus design.
+* (_flush_stale_flags, mips_partition_enumerate): detect dangling partition
+ nubers on swap/boot/root flags, and remove them.
+* (_handle_no_volume_header, mips_read): deal with missing volume header
+ partitions better.
+* (_generate_partition): fixed out-by-2 bug... should be ajdusting upwards
+ not downwards
+* (_get_strict_primary_constraint): renamed from (_get_strict_constraint)
+* (_get_strict_primary_constraint): now won't "align" a partition on top
+ the volume header
+* libparted/disk_pc98.c (pc98_partition_set_flag): removed old cruft wrt
+ part->fs_type
+* libparted/disk_sun.c (sun_partition_set_flag): removed old cruft wrt
+ part->fs_type
+* libparted/fs_fat/calc.c libparted/fs_fat/calc.h
+ (fat_min_cluster_size, fat_max_cluster_size): added
+* (calc_sizes, fat_calc_sizes): replaced first parameter (geom) with a length
+* (calc_sizes): make the "fat_space" adjustment only if the old value was
+ impossible. (This is what Windows does FWICT, but I need to collect more
+ info)
+* (fat_calc_sizes, fat_calc_resize_sizes): iterate between
+ (fat_min_cluster_size, fat_max_cluster_size)
+* libparted/fs_fat/fat.c (fat_create): call (fat_table_set_cluster_count),
+ so the free cluster count is calculated properly on FAT32
+* (_test_resize_size): renamed from (_test_size)
+* (_get_min_resize_size): renamed from (_get_min_size)
+* (fat_get_create_constraint_fat16, fat_get_create_constraint_fat32):
+ plugged in magic constants instead of computing. Computing is hard, and
+ the hack used is commented out (it's fragile). Should be fixed...
+* libparted/fs_fat/resize.c (fat_resize, free_root_dir): when the fs
+ is converted fat32 -> fat16, the root directory was been duplicated,
+ but not referenced (fat16 has a separate area for the root dir). This
+ lead to these clusters appearing as "lost clusters" in dosfsck, etc.
+ Now, we free the root directory.
+* parted/parted.c (_grow_over_small_freespace): only grow over freespace
+ for big partitions
+* parted/parted.c (_done): give warnings about lilo and /etc/fstab
+* (do_mkpart): made the file system parameter optional
+* doc/USER: updated to match 1.5.x
+* released 1.5.6
+
+2002-01-14 Andrew Clausen <clausen@gnu.org>
+CHANGE SUMMARY:
+ updated API docs, fixed the regression tests, fixed UI code that
+ does stupid things for non-interactive runs and bug fixes.
+* doc/API: updated to be consistent with the libparted API. This involved
+ lots of small changes, and also the addition of the new PedTimer API.
+* include/parted.h libparted/libparted.c libparted/disk.c: removed the PedID
+ interface. It was for a dead-end idea.
+* include/timer.h: added some comments
+* libparted/disk.c: misc cleanups, added assertions, etc.
+* libparted/disk_dos.c (read_table): merged bugfix from 1.4.x. Nested calls
+ to read_tables() (on nested extended partitions) are moved out into a
+ separate loop, to make sure they are called after logical partitions are
+ added. This makes the numbering consistent with Linux and fdisk. Some
+ versions of Disk Druid appear to make such partition tables.
+* libparted/disk_dos.c (msdos_partition_set_flag): use part->fs_type, rather
+ than other magic for calling ped_partition_set_system()
+* libparted/linux.c: removed all <linux/*> includes, and copied relevant
+ bits into linux.c
+* (linux_close): added a call to _flush_cache()
+* (_disk_sync_part_table): iterate to PED_MAX(last_part, 16), not PED_MIN.
+* parted/parted.c (_timer_handler_timer_handler): don't display a progress
+ meter if stdout isn't a terminal.
+* parted/ui.c (exception_handler): don't ask the user for another chance
+ to select an option, if stdin isn't a terminal.
+* (command_line_get_ex_opt): return PED_EXCEPTION_UNHANDLED on error, not
+ 0. (They are the same number... just a philosophical change)
+* (command_line_get_ex_opt): iterate from PED_EXCEPTION_OPTION_FIRST not 0
+ - likewise, same number.
+* debug/test/test_disk_dos (test_logical_outside_extended): uncommented
+ test, and modified to test that the constraint solver fixes this (i.e. puts
+ the logical partition inside the extended partition)
+* (test_shrink_extended_too_far): likewise
+* (test_outside_boundary): removed. (the front end will "correct" this to
+ a certain amount... there are enough assertions to catch problems
+ with this already)
+* (test_move_primary, test_move_logical): use fat16 instead of fat. (fat
+ has been removed)
+* released 1.5.6-pre3
+
+2002-01-01 Andrew Clausen <clausen@gnu.org>
+* renamed discover to partprobe in all occurances (the binary, the directory,
+ etc.)
+* libparted/disk.c (ped_disk_check): when reporting a mismatch in
+ partition and file system sizes, was out by a factor of 4
+* (_disk_alloc_freespace): wasn't allocating the first sector of the device
+ to a freespace partition, even if it was free. (in all cases except
+ loopback, this is occupied by partition table metadata, so it didn't
+ manifest itself much)
+* parted/parted.c (_grow_over_small_freespace): rewrote, old version didn't
+ deal with some special cases gracefully
+* released 1.5.6-pre2
+
+2001-12-31 Andrew Clausen <clausen@gnu.org>
+* configure.in: added --enable-debug, --enable-read-only,
+ --enable-discover-only --enable-fs, and made correspond #define's appear
+ in config.h (via acconfig.h beaurocracy), with the macros defined as
+ DEBUG, READ_ONLY, DISCOVER_ONLY, ENABLE_FS respectively. DISCOVER_ONLY
+ #ifdef's out sanity checks in libparted/disk.c, and all write support
+ in libparted/disk_*.c, and everything except probing in libparted/fs*/*
+* clearfat/clearfat.c: hacked up to compile to a no-op if
+ --enable-discover-only is selected (it acceses fs_fat internals which
+ are #ifndef DISCOVER_ONLY)
+* parted/debug.h: added #include "config.h", to see if it should enable
+ PED_ASSERT (if DEBUG is defined)
+* include/parted/device.h (ped_device_get_part_path): removed stale prototype
+* include/parted/disk.h libparted/disk.c (ped_disk_commit_to_os,
+ ped_disk_commit_to_arch): added to API and implemented.
+* (_ped_partition_attempt_align): added to internal API. It replaces
+ (_try_constraint) that was cut&pasted in libparted/disk_*.c. Removed
+ (_try_constraint), and replaced all references
+* include/parted/timer.h libparted/timer.c (ped_timer_destroy_nested):
+ added to API. Calling (ped_timer_destroy) leaked the timer's context.
+* libparted/constraint.c (_constraint_get_canonical_start_range): fixed,
+ so it never attempts to initialize start_min_max_range() outside the
+ device (and thus throw an exception, etc.)
+* libparted/disk_*.c libparted/fs_*: removed method prototypes, and moved
+ the vtable and registration functions to the end of the file.
+* libparted/disk_gpt.c: fixed endianness in *_GUID defines
+* libparted/disk_gpt.c libparted/disk_mac.c (_grow_over_small_freespace):
+ removed all references, etc. Now the responsibility of the frontend
+* parted/parted.c (_grow_over_small_freespace, do_mkpart, do_mkpartfs,
+ do_move, do_resize): added _grow_over_small_freespace, and do_* call it.
+* libparted/filesys.c (_raw_copy, _raw_copy_and_resize): added timer
+* libparted/fs_fat/clstdup.c (fat_duplicate_clusters, count_frags_to_dup,
+ write_fragments): better timer heuristic
+* parted/ui.c (_readline): in script mode, don't call readline(), because
+ it doesn't deal with EOF properly
+* parted/ui.c (screen_width): return a big number in script mode, so we
+ don't do wrapping. (Makes parsing output easier)
+* parted/ui.c parted/ui.h (command_line_get_sector): now has an extra
+ parameter, dev. This is used to "round" sectors outside of the device
+ inside, to avoid the annoying "can't create partition outside disk"
+ error message
+* released 1.5.6-pre1
+
+2001-12-28 Andrew Clausen <clausen@gnu.org>
+* include/parted/timer.h libparted/timer.c: added timer API
+* include/parted/filesys.h (ped_file_system_create, ped_file_system_copy,
+ ped_file_system_check, ped_file_system_resize): now use a timer.
+ Updated all file systems that implement these to match the new API,
+ and implemented basic timers.
+* parted/parted.c: added a timer, and use it for all FS operations than
+ support it
+* released 1.5.5
+
+2001-12-27 Andrew Clausen <clausen@gnu.org>
+* include/parted/constraint.h libparted/constraint.c: added a max_size
+ field to PedConstraint, and updated the constraint solver, etc. to
+ support it.
+* (ped_file_system_get_create_constraint,
+ ped_file_system_get_copy_constraint): added to API, and implemented for
+ all file systems.
+* parted/parted.c (do_move, do_resize, do_mkfs, do_mkpartfs): use
+ (ped_file_system_get_resize_constraint, ped_file_system_get_copy_constraint)
+* applied ext2/ext3 split change that exists in 1.4.x.
+
+2001-12-18 Andrew Clausen <clausen@gnu.org>
+* libparted/linux.c: applied modified patch from Hong H. Pham
+<hhp@xandros.com>:
+ - (linux_disk_commit): Force reread of partition table if DevFS is active.
+ - (_have_devfs): added, checks if the system is using DevFS.
+ - (linux_disk_commit, _device_get_part_path): modified to use (_have_devfs).
+ - (_get_linux_version): modified to use uname(2), rather than probing
+ /proc/sys/kernel/osrelease. Kernel version checking is done using by
+ using the KERNEL_VERSION() macro in <linux/version.h>
+ Affected functions are (_device_get_sector_size, _have_blkpg).
+ - (linux_probe_all): if (_probe_proc_partitions) fails, resort
+ to doing a blind device probe (_probe_standard_devices). Since
+ /proc/partitions contains all the block devices and partitions that
+ the kernel has detected and is currently using, I do not see why we
+ have to waste time probing for devices that do not exist, or devices
+ that have already been probed. A few seconds in initialisation time
+ can be saved if we avoid the blind device probe.
+
+2001-12-17 Andrew Clausen <clausen@gnu.org>
+* include/parted/disk.h (set_system): added to interface
+* (set_extended_system): removed from interface
+* include/parted/filesys.h libparted/filesys.c (copy, ped_file_system_copy):
+ now returns the newly created file system
+* (set_system, ped_file_system_set_system): removed. (has now become PedDisk
+ implementations' responsibility)
+* libparted/disk.c (ped_partition_set_system): is now just a simple wrapper
+ for disk->type->ops->set_system
+* updated all file systems and disk labels to new interface
+* libparted/disk_mips.c (_checksum, mips_read, mips_write): now check and set
+ checksum appropriately
+* libparted/fs_fat/fat.c libparted/fs_fat/resize.c (ped_file_system_fat_init,
+ fat_create, fat_probe, fat_copy, resize_context_assimilate): split fat_type
+ into fat16_type and fat32_type
+* parted/parted.c (do_cp, do_resize): update to the new ped_file_system_copy
+ and ped_partition_set_system interface/semantics
+* released 1.5.5-pre6
+
+2001-12-02 Andrew Clausen <clausen@gnu.org>
+* libparted/disk_gpt.c: basically rewritten (based on the same file from
+1.4.x)
+* released 1.5.5-pre4
+* libparted/disk_mips.c: implemented
+* libparted/dvh.h: thieved from dvhtools
+* include/parted/disk_mips.h: added
+* po/POTFILES.IN: updated
+* updated all file systems to support GPT and MIPS
+* fixed Makefile.am, so MIPS and GPT support build properly
+* released 1.5.5-pre5
+
+2001-12-01 Andrew Clausen <clausen@gnu.org>
+* PedDiskOps.free() now returns void
+* ped_disk_destroy() now returns void
+
+2001-11-29 Andrew Clausen <clausen@gnu.org>
+* merged changes from 1.4.21
+* released 1.5.5-pre3
+
+2001-11-20 Andrew Clausen <clausen@gnu.org>
+* libparted/linux.c (init_ide, init_scsi, init_file, init_generic,
+ linux_destroy): applied patch from Hong H. Pham <hhp@unitycode.org>
+ (with modifications). All dev->model assignments now allocate
+ memory properly (rather than returning const strings - i.e. the old
+ code leaked, but didn't corrupt memory), and linux_destroy() frees
+ properly. SCSI code completely cleaned up (replaced magic numbers
+ with good structs, etc.)
+
+2001-11-19 Neal H Walfield <neal@cs.uml.edu>
+* libparted/gnu.c (gnu_partition_get_path): Fix typo
+
+2001-11-14 Andrew Clausen <clausen@gnu.org>
+* libparted/disk.c (ped_disk_new, ped_disk_new_fresh, ped_disk_commit,
+ped_disk_clobber, ped_disk_clobber_exclude): now calls ped_device_open and
+ped_device_close
+* libparted/disk_*.c: removed calls to ped_device_open and ped_device_close
+* libparted/filesys.c (ped_file_system_open, ped_file_system_create,
+ped_file_system_copy, ped_file_system_probe, ped_file_system_clobber):
+added to calls to ped_device_open and ped_device_close (on error, and for
+normal exit for probe and clobber)
+* libparted/filesys.c (ped_file_system_close): now calls ped_device_close
+
+2001-10-11 Andrew Clausen <clausen@gnu.org>
+* fixed some minor bugs in libparted/gnu.c (spelling mistakes, etc.)
+* released 1.5.5-pre2
+
+2001-10-09 Andrew Clausen <clausen@gnu.org>
+* OVERVIEW OF CHANGES:
+ The _arch_* functions in include/parted/device.h and
+include/parted/disk.h where removed, and replaced by vtables. The
+vtables are controlled by the ped_set_architecture() function. The
+motivation for this change is to allow the same libparted shared library
+to support multiple architectures. "architecture" could mean IBM's EVMS,
+or any library that wants to expose it's own virtual devices to libparted,
+not just "operating system".
+
+* include/parted/device_gnu.h, include/parted/device_linux.h:
+renamed to gnu.h and linux.h respectively
+* include/parted/device.h (_arch_device_new, _arch_device_destroy,
+_arch_device_open, _arch_device_refresh_open, _arch_device_close,
+_arch_device_refresh_close, _arch_device_read, _arch_device_write,
+_arch_device_check, _arch_device_sync, _arch_device_probe_all):
+removed these functions, and added them as fields to the new vtable
+"struct _PedDeviceArchOps". Also, a device_is_busy() method was added.
+* include/parted/device.h (ped_device_is_busy): added to the API
+* include/parted/disk.h (_arch_partition_is_busy, _arch_disk_is_busy,
+_arch_disk_commit): removed these functions.
+* include/parted/disk.h: added "struct _PedDiskArchOps". Contains
+methods partition_get_path, partition_is_busy and disk_commit.
+* include/parted/disk.h (ped_disk_is_busy): Removed from API. (Can be
+implemented trivially via ped_device_is_busy (disk->dev)). Is this a bad
+idea?
+* include/parted/disk.h (ped_partition_get_path): added to the API
+* include/parted/parted.h (ped_set_architecture): added to the API
+* include/parted/parted.h: added "struct _PedArchitecture" and
+_ped_architecture.
+* libparted/Makefile.am: updated to reflect that all linux-specific stuff
+is now in linux.c, and gnu/hurd stuff in gnu.c
+* libparted/disk_arch_gnu.c, libparted/disk_arch_linux.c,
+libparted/device_gnu.c, libparted/device_linux.c: contents moved to
+libparted/gnu.c and libparted/linux.c respectively
+* libparted/device.c: s/_arch_/ped_architecture->dev_ops->/g
+* libparted/device.c (ped_device_is_busy): new function
+* libparted/device.c (ped_device_get_part_path): removed. Use
+ped_partition_get_path() instead
+* libparted/disk.c: s/_arch_/ped_architecture->disk_ops->/g
+* libparted/disk.c (ped_disk_is_busy): removed (use ped_device_is_busy instead)
+* libparted/disk.c (ped_partition_get_path): new function
+* libparted/parted.c (ped_set_architecture): new function
+* libparted/parted.c (ped_architecture): new global variable
+* parted/ui.c (_readline): call to readline needs to cast away from
+(const char*) to char*, due to C brain damage. (readline 4.1 assigns to a
+global variable...)
+* released 1.5.5-pre1
+
+2001-10-07 Andrew Clausen <clausen@gnu.org>
+* merged changes to 1.4.20-pre3, except gpt
+* released 1.5.4
+
+2001-08-23 Neal H Walfield <neal@cs.uml.edu>
+* configure.in (libshouldbeinlibc): Correct the text.
+(libstore): Likewise.
+
+2001-08-24 Neal H Walfield <neal@cs.uml.edu>
+* include/parted/device_gnu.h (ped_device_new_from_store): Remove the consume
+flag.
+* libparted/device_gnu.c (ped_device_new_from_store): Likewise.
+
+2001-08-24 Andrew Clausen <clausen@gnu.org>
+* released 1.5.4-pre3
+
+2001-08-21 Neal H Walfield <neal@cs.uml.edu>
+* parted.m4 (PARTED_CHECK_LIBPARTED): Renamed from AC_CHECK_LIBPARTED.
+There are only two resevered autoconf namespaces: AC_* and AM_*;
+avoid them. Be more verbose when printing error messages.
+
+2001-08-23 Andrew Clausen <clausen@gnu.org>
+* doc/API: updated to reflect new (ped_device_open, ped_device_close,
+ped_device_new_from_*, ped_device_destroy) semantics
+
+2001-08-21 Neal H Walfield <neal@cs.uml.edu>
+* include/parted/device_gnu.h (_GNUSpecific): New member, consume.
+(ped_device_new_from_store): Prototype it.
+* libparted/device_gnu.c (_init_device): General PedDevice initializer ripped
+from _arch_device_new.
+(_arch_device_new): Use _init_device.
+(_done_device): General PedDevice destructor, ripped from _arch_device_destroy.
+(_arch_device_destory): Reimplemented using _done_device.
+(_arch_device_open): Functionality moved from here...
+(_arch_device_new): ... here.
+(ped_device_new_from_store): New function.
+(_arch_device_close): Do not close the store here.
+(_arch_device_destory): Close it here if ARCH_SPECIFIC->consume is true.
+
+2001-08-20 Andrew Clausen <clausen@gnu.org>
+* include/parted/device.h (ped_device_destroy): added prototype
+* libparted/device.c (added ped_device_destroy): implemented
+* libparted/device.c (added ped_device_free_all): now calls ped_device_destroy
+* released 1.5.4-pre2
+
+2001-08-20 Neal H Walfield <neal@cs.uml.edu>
+* parted.m4: Rename AM_PATH_PARTED to AC_CHECK_LIBPARTED.
+ (AC_CHECK_LIBPARTED): Do proper quoting.
+ [host_os=gnu]: Check for libshouldbeinlibc and libstore.
+ Set PARTED_LIBS to detected libraries.
+* configure.in: Before checking for libstore, see if an old version of
+ libparted is installed. When checking for libstore, include all libraries
+ that we might need (and that were detected).
+
+2001-08-20 Andrew Clausen <clausen@gnu.org>
+* merged changes to 1.4.18
+
+2001-08-16 Andrew Clausen <clausen@gnu.org>
+* include/parted.c: removed ped_init and ped_done prototypes
+* libparted/libparted.c (ped_init, ped_done): replaced with a gcc constructor
+/ destructor, (_init, _done), respectively.
+* libparted/exception.c (ped_exception_set_handler): if NULL is passed,
+default_handler() is set.
+* parted/parted.c (_init, _done): remove calls to ped_init() and ped_done()
+* debug/clearfat.c (main): likewise
+* parted/ui.c (done_ui): return to default exception handler
+* libparted/device.c (devices): Remove superfluous zero initializer.
+(thanks tim/neal/msw!)
+
+2001-08-15 Marcus Brinkmann <marcus@gnu.org>
+* configure.in: Correctly detect large file support using
+AC_SYS_LARGEFILE, not getconf LFS_CFLAGS.
+
+2001-08-12 Neal H Walfield <neal@cs.uml.edu>
+* configure.in: Add check for canonicalize_file_name.
+* config.h (HAVE_CANONICALIZE_FILE_NAME): New marcro.
+* libparted/device.c (_GNU_SOURCE): Enable GNU extensions.
+[!HAVE_CANONICALIZE_FILE_NAME] (canonicalize_file_name):
+Implement it.
+(_readlink): Depreciated and removed in favor of
+canonicalize_file_name.
+(_strcut): Likewise.
+(_remove_double_slash): Likewise.
+(_remove_dots): Likewise.
+(_normalize_path): Likewise.
+(_ped_device_probe): Use canonicalize_file_name, not
+_normalize_path.
+(ped_device_get): Likewise.
+* doc/API: Fix errors. Update section the section on ped_disk.
+* libparted/device_gnu.c (_arch_device_open): Call store_typed_open, not
+store_open. Don't save the error message, save the error code.
+
+August 13th 2001 - Andrew Clausen <clausen@gnu.org>
+* merged changes to 1.4.18-pre2
+* released 1.5.4-pre1
+
+August 12th 2001 - Andrew Clausen <clausen@gnu.org>
+* added a private OS-specific partition table interface, and moved relevant code
+from device.c to disk_arch_{linux,gnu}.c.
+* added blkpg sync support (for Linux)
+
+August 5th 2001 - Andrew Clausen <clausen@gnu.org>
+* fixed mkpartfs on extended partitions
+* Hurd fixes (Neal)
+
+July 27th 2001 - Andrew Clausen <clausen@gnu.org>
+* moved FAT table backup comparison out of fat_open() to fat_check()
+* added a checked flag to PedFileSystem. ped_file_system_{copy,resize}()
+make sure a check happens first.
+* released 1.5.3
+
+July 24th 2001 - Andrew Clausen <clausen@gnu.org>
+* merged changes to 1.4.17
+
+July 15th 2001 - Andrew Clausen <clausen@gnu.org>
+* fixed jfs prober (oops)
+* fixed bug in ext2 mkfs code and in ext2_commit_meta(): s_block_group_nr was 0
+* _ext2_probe() is now intelligent about finding a superblock that has
+s_block_group_nr != 0: it looks for the group 0 super block.
+* changed the heuristics for ped_file_system_probe() and ped_disk_check(),
+to become less significant for when "the numbers are close". (motivation:
+jfs doesn't create a small block group at the end, so it doesn't utilize
+the fs fully. We don't want jfs to lose to ext2 in the probe, on a minor
+difference like this...)
+* merged changes to 1.4.16-pre1
+
+July 14th 2001 - Andrew Clausen <clausen@gnu.org>
+* added ped_constraint_new_from_{min,max,min_max}() to the constraint API,
+and removed their equivalents from parted/parted.c. Also, used them in
+libparted/disk_* where appropriate.
+
+July 13th 2001 - Andrew Clausen <clausen@gnu.org>
+* hacked /usr/share/aclocal/gettext.m4, replacing ac_given_srcdir with
+ac_srcdir. This fixes the problem of po/Makefile not being generated. (Also
+notified bug-gnu-utils@gnu.org) The problem seems to be that gettext 0.10.38
+is incompatible with autoconf 2.50.
+* released 1.5.3-pre1
+
+July 12th 2001 - Andrew Clausen <clausen@gnu.org>
+* updated reiserfs_probe(), to return the probed size, rather than what was
+given to it. (All that remain are hfs and ntfs)
+* in theory, fixed ufs's probe() (need to test this)
+* added xfs and jfs probe()/clobber() support (properly ;-)
+
+July 11th 2001 - Andrew Clausen <clausen@gnu.org>
+* added ped_disk_check()
+* removed assertions in file system code for fs->geom == probed geometry.
+(This is now done ped_disk_check())
+* released 1.5.2
+
+July 10th 2001 - Andrew Clausen <clausen@gnu.org>
+* removed PED_PARTITION_PRIMARY - think of PedPartitionType as a bit-field
+* changed PedFileSystemOps.probe() to return a PedGeometry* (rather than int),
+corresponding to the size/location of the discovered file system. Updated
+ped_file_system_probe() to use this as a heuristic
+* added a rescue command
+* made command_line_prompt_words() use "def" (if available) in script mode
+
+June 26th 2001 - Andrew Clausen <clausen@gnu.org>
+* released 1.5.2-pre3 (internally)
+
+June 23rd 2001 - Andrew Clausen <clausen@gnu.org>
+* applied more GNU/Hurd patches from Neal, and autoconfused them
+
+June 17th 2001 - Andrew Clausen <clausen@gnu.org>
+* replaced PedGeometry's PedDisk* disk field with PedDevice* dev
+* released 1.5.2-pre2
+
+June 13th 2001 - Andrew Clausen <clausen@gnu.org>
+* backed out some experimental changes (checkpoints) in PedDisk
+* cleaned up autoconfusion for device_*.c
+* merged changes to 1.4.15-pre1
+* released 1.5.2-pre1
+
+March 16th 2001 - Andrew Clausen <clausen@gnu.org>
+* put libparted/device/* into one file
+
+January 31st 2001 - Andrew Clausen <clausen@gnu.org>
+* added ped_disk_duplicate(), and implemented the code for all disk labels
+* added a PedDisk checkpoint API
+* released 1.5.1-pre1
+
+January 29th 2001 - Andrew Clausen <clausen@gnu.org>
+* added Sun regression tests
+* added non-interactive mode support to new UI
+* released 1.5.0
+
+January 26th 2001 - Andrew Clausen <clausen@gnu.org>
+* merged changes in 1.4.8-pre2
+* ported disk_sun.[ch] to the new interface
+
+January 25th 2001 - Andrew Clausen <clausen@gnu.org>
+* merged forked parted-ui branch (which was unreleased). Makes the
+interactive interface much cooler :-)
+* released 1.5.0-pre2
+
+January 24th 2001 - Andrew Clausen <clausen@gnu.org>
+* added ped_disk_clobber_exclude(PedDevice* dev, PedDiskType* exclude). This
+is now used by ped_disk_commit(), because you shouldn't clobber the old disk
+label, if it is of the same type, because it might contain information (like
+boot strapping) that we want to preserve.
+
+January 23rd 2001 - Andrew Clausen <clausen@gnu.org>
+* first stage of new PedDisk interface: replaced
+ped_disk_{open,create,read,write,close}
+with ped_disk_{new,new_fresh,destroy,commit}
+* changed the interface between disk modules and the API, and updated the
+modules accordingly
+* released 1.5.0-pre1
+
+-----------------------------------------------------------------------------
+1.4.x (before fork for development version)
+-----------------------------------------------------------------------------
+
+January 18th 2001 - Andrew Clausen <clausen@gnu.org>
+* we now require autoconf 2.49b to build configure from configure.in,
+because it provides the new AC_CHECK_SIZEOF
+* use new AC_CHECK_SIZEOF for off_t.
+* changed configure.in to match the new AC_CHECK_TYPE
+* hacked libtool.m4 (!)... I hope this all gets fixed properly, soon...
+
+January 17th 2001 - Andrew Clausen <clausen@gnu.org>
+* tried to make libparted/device.c more portable
+* libparted/fs_fat/bootsector.h - fixed the size of the FAT16 part of the
+union... needed an extra byte in boot_code. (purely aesthetic ;-)
+
+January 15th 2001 - Andrew Clausen <clausen@gnu.org>
+* released 1.4.7
+
+January 10th 2001 - Andrew Clausen <clausen@gnu.org>
+* fixed ped_file_system_clobber() - wasn't leaving/fetching exceptions
+properly
+
+January 9th 2001 - Andrew Clausen <clausen@gnu.org>
+* fixed _calc_min_logical_start() - was horribly broken. Only affects the new
+work-around for "cylinder not aligned", etc.
+* released 1.4.7-pre4 (internally)
+* don't try to guess the geometry for a second time... (introduced
+geom_already_guessed to PedDevice)
+* released 1.4.7-pre5
+
+January 8th 2001 - Andrew Clausen <clausen@gnu.org>
+* ext2_mkfs now enables file-type by default.
+* ped_partition_new() (not DISK_partition_new()) calls
+ped_partition_set_system() now. Makes sure it calls ped_partition_set_system()
+for extended partitions too!
+* released 1.4.7-pre1 (internally)
+* added documentation for ped_file_system_clobber()
+* fixed semantics for ped_file_system_clobber() - they need to change, since
+ped_file_system_probe() is different...
+* released 1.4.7-pre2 (internally)
+* released 1.4.7-pre3
+
+January 6th 2001 - Andrew Clausen <clausen@gnu.org>
+* msdos_partition_new() if there is no file system passed, sets the system
+to 0x83. 0 is a bad choice, because it means it isn't a partition. It's
+an even worse choice, because it will make msdos_probe() fail.
+* released 1.4.6
+
+January 5th 2001 - Andrew Clausen <clausen@gnu.org>
+* "partition not aligned" workaround (similar to that in 1.2.x)
+* uses dgettext (PACKAGE, ...) instead of gettext (...). Updated API docs,
+to reflect this (for ped_partition_flag_get_name(), etc.)
+* released 1.4.6-pre1
+* fixed brain-dead bug, dealing with min_geom in _primary_constraint()
+in libparted/disk_dos.c
+* released 1.4.6-pre2 (internally)
+* fixed another bug (out-by-one, in _primary_constraint(), again)
+* added bindtextdomain() to ped_init()
+* released 1.4.6-pre3 (internally)
+
+January 4th 2001 - Andrew Clausen <clausen@gnu.org>
+* removed that annoying "Parted's boot loader" message
+* ped_file_system_probe() now attempts ped_file_system_open(), if there
+is any ambiguouity
+
+December 29th 2000 - Andrew Clausen <clausen@gnu.org>
+* mac_clobber() now nukes the partition map as well ;-)
+
+December 28th 2000 - Andrew Clausen <clausen@gnu.org>
+* documented PedConstraint and PedAlignment (doc/API)
+* released 1.4.5
+* applied BSD disk label support patch (thanks Matt!)
+
+December 27th 2000 - Andrew Clausen <clausen@gnu.org>
+* made incompatible change to API: changed ped_constraint_exact() now takes
+a PedGeometry, not a PedPartition (what was I thinking?!)
+
+December 21st 2000 - Andrew Clausen <clausen@gnu.org>
+* the bug fix in 1.4.5-pre3 (wrap-around bug) was wrong. Fixed properly now.
+* made the FAT16 <-> FAT32 conversion messages more friendly
+* released 1.4.5-pre4
+
+December 20th 2000 - Andrew Clausen <clausen@gnu.org>
+* ext2_mkfs() now makes sparse file systems by default
+* rearranged ext2_mkfs() a bit, and separated generation of the super block
+* fixed bug in ext2_mkfs(): if there isn't enough room for per-group
+metadata in the last block group, then chop it off!
+* fixed ext2 bug in ext2_is_data_block() in ext2.h. I forgot to
+endian-awarenize (?) it!!!
+* FAT resizer now avoids changing the fat type (FAT16 or FAT32) in script
+mode
+* removed error checking, after the "point of no return" in the FAT resizer
+* updated documentation, adding info about FAT16 <-> FAT32, and boot loaders
+
+December 19th 2000 - Andrew Clausen <clausen@gnu.org>
+* fixed nasty wrap-around bug in fat_construct_directory() and
+fat_convert_directory(), when directories have their last cluster/sector
+filled.
+* merged in FAT32 boot loader fix (now copies the "hidden sectors")
+* released 1.4.5-pre3
+
+December 15th 2000 - Andrew Clausen <clausen@gnu.org>
+* merge FAT fix from 1.2.14-pre1
+* Apple_Free partitions have status 0x0 (not 0x33)
+* released 1.4.5-pre2
+
+December 8th 2000 - Andrew Clausen <clausen@gnu.org>
+* fixed _ext2_get_resize_constraint(). constraint->min_size was calculated
+in (ext2) blocks, not 512 byte sectors. (patch from Matt Wilson)
+
+December 5th 2000 - Andrew Clausen <clausen@gnu.org>
+* commented out "this is not a block device", because it already warns about
+"this is not SCSI/IDE", etc.
+* added another example to the documentation
+* released 1.4.5-pre1
+
+December 4th 2000 - Andrew Clausen <clausen@gnu.org>
+* made the "unable to align partition" error message a bit more understandable,
+and allow the problem to be ignored.
+* added an assertion to ext2_is_data_block(), to make sure the block
+is in the file-system.
+* added a note about "make install-libs" for e2fsprogs
+
+November 30th 2000 - Andrew Clausen <clausen@gnu.org>
+* fixed a brain-dead bug in ext2_meta.c:109. This bug causes growth of ext2
+all file systems, that require more GDT blocks to get corrupted!!! OUCH!!!
+* fixed regression tests, to test GDT growth
+* released 1.4.4
+
+November 29th 2000 - Andrew Clausen <clausen@gnu.org>
+* ped_device_add() adds to the end now
+* added a check in /proc/partitions for devices
+* released 1.4.4-pre1
+
+November 28th 2000 - Andrew Clausen <clausen@gnu.org>
+* added error checking to both versions doinode(). Hmmm, do I like this
+idea of 2 doinode()'s?
+* finalized the copyright assignments, and now we can get rid of lots of
+annoying bureaucracy (read: s/Andrew Clausen, Lennert .../Free Softw.../g)
+* changed "cp FROM-MINOR [TO-DEVICE] TO-MINOR" to
+"cp [FROM-DEVICE] FROM-MINOR TO-MINOR"
+
+November 24th 2000 - Andrew Clausen <clausen@gnu.org>
+* added ped_file_system_clobber_exclude(), and resize/copy now use it.
+* fixed hfs_clobber() and reiserfs_clobber()
+* released 1.4.3
+
+November 19th 2000 - Andrew Clausen <clausen@gnu.org>
+* fixed a few mistakes in doc/USER (thanks Stefan!)
+* now uses the en_US locale for numbers. (quick fix, because the "lexer"
+isn't properly i18nized yet - I'll fix this properly next week, because
+I intend to do Major Surgery TM on the command parser anyway). Basic
+problem is: the lexer says a number is [0-9.]+, but in Europe, s/\./,/.
+* released 1.4.2
+
+November 16th 2000 - Andrew Clausen <clausen@gnu.org>
+* loop-back is now probed last.
+* removed dependance on <linux/fs.h>
+* discovered that type-casts have high precedence. oops.
+s/(long) EXPR/(long) (EXPR)/, which fixes seg faults on PPC.
+
+November 15th 2000 - Andrew Clausen <clausen@gnu.org>
+* added read-only support (useful for disk imaging from CD-ROMs)
+* changed default behaviour to warnings such as "not a block device" (in
+libparted/device.c) to PED_EXCEPTION_IGNORE.
+* released 1.4.1
+
+November 14th 2000 - Andrew Clausen <clausen@gnu.org>
+* removed the scary "development version only TM" message. OOPS!
+
+November 13th 2000 - Andrew Clausen <clausen@gnu.org>
+* merged in changes from 1.2.13
+* released 1.4.0
+
+-----------------------------------------------------------------------------
+1.3.x
+-----------------------------------------------------------------------------
+
+November 11th 2000 - Andrew Clausen <clausen@gnu.org>
+* added ./configure --enable-all-static
+* mac_partition_new() now sets the name to "untitled".
+
+November 8th 2000 - Andrew Clausen <clausen@gnu.org>
+* added an assertion, that the disk has the PED_DISK_TYPE_EXTENDED feature,
+for extended partitions, in ped_partition_new()
+
+November 4th 2000 - Andrew Clausen <clausen@gnu.org>
+* released 1.4.0-pre8
+* file systems only get ped_file_system_clobber()'d if mkfs is supported for
+that fs
+* fixed hfs_probe()
+
+November 3rd 2000 - Andrew Clausen <clausen@gnu.org>
+* fixed some bugs with the mac_partition_align() stuff
+* cleaned the doc/USER a bit more
+
+November 2nd 2000 - Andrew Clausen <clausen@gnu.org>
+* Mac bug fixes & reorganisation
+* mac_partition_align() - greedily takes up free space now, if it is consistent
+with the constraints.
+* set policy for _partition_align() - must be in update mode. Changed
+other functions to meet this.
+* released 1.4.0-pre6
+* fixed a stupid bug introduced in 1.4.0-pre6, in libparted/disk_dos.c,
+read_table() Was passing a pointer to a pointer of a constraint, as opposed to
+the pointer.
+* released 1.4.0-pre7
+
+October 31st 2000 - Andrew Clausen <clausen@gnu.org>
+* much hacking on Mac support
+* merged in changes to 1.2.12-pre3
+* released 1.4.0-pre5
+
+October 22nd 2000 - Andrew Clausen <clausen@gnu.org>
+* fixed a bug in libparted/disk_mac.c, that broke mkpart*. In
+mac_partition_new(), it was checking for failure, but missed out the '!'.
+* released 1.4.0-pre4
+
+October 21st 2000 - Andrew Clausen <clausen@gnu.org>
+* commented out the linux-swap Linux 2.0 warning. It annoys more users than it
+helps.
+* merged 1.2.11
+* hacked around the mac-boot & no-HFS problem, by setting the file system
+temporarily, in mac_partition_set_system() (YUCK!)
+* applied a patch from Masahiro Sakai <ZVM01052@nifty.ne.jp>. Now uses
+mbs* as opposed to iconv. That fixes lots of brokeness, but there may be
+problems for utf-8 users... but this will be solved by gettext in future.
+* released 1.4.0-pre3
+* fixed the annoying linux-swap on mac bug (it was trying to set the swap
+flag, before setting the partition type to linux-swap, which caused the
+Mac disk label code to complain)
+
+October 16th 2000 - Andrew Clausen <clausen@gnu.org>
+* uses Apple_UNIX_SVR2 (instead of Unix)
+* merged 1.2.11-pre1
+
+October 15th 2000 - Andrew Clausen <clausen@gnu.org>
+* fixed a bug in ped_constraint_solve_nearest() - errr to complicated to
+explain - easier to look at the diff. Basically: I wasn't taking the
+intersection of the allowable start and end ranges properly, WRT min_start.
+* removed some memory leaks from libparted/disk_dos.c, around the constraint
+stuff.
+* released 1.4.0-pre2
+
+October 14th 2000 - Andrew Clausen <clausen@gnu.org>
+* fixed boot flag stuff for Mac
+* docs have been massively updated (ages ago...)
+* merged in changes to 1.2.10-pre3 (notably: malloc() debugging, and all the
+bugs / leaks fixed as a result ;-)
+
+September 25th 2000 - Andrew Clausen <clausen@gnu.org>
+* added ped_disk_remove_partition()
+
+September 24th 2000 - Andrew Clausen <clausen@gnu.org>
+* mac fixes: writes new signature now, s/Apple_Unix/Apple_UNIX/g
+
+September 23rd 2000 - Andrew Clausen <clausen@gnu.org>
+* reiserfs_probe() - doesn't probe outside of the partition any more ;-)
+* lots of work on API docs
+
+September 21st 2000 - Andrew Clausen <clausen@gnu.org>
+* added a bit to the documentation about how to deal with the boot disk, when
+it doesn't support your hardware
+* released 1.4.0-pre1
+
+September 20th 2000 - Andrew Clausen <clausen@gnu.org>
+* added the LBA partition flag
+* ped_partition_is_busy() - for extended partitions, now checks all logical
+partitions for business.
+* constraint solver will always satisfy constraint->min_size, if possible, now.
+The constraint solver is now complete (the existence of a solution implies
+that a solution will be found :-)
+* fixed semantics for _best_solution() in disk_dos.c
+* added documentation WRT LVM and RAID
+* updated documentation, to much current command set
+
+September 17th 2000 - Andrew Clausen <clausen@gnu.org>
+* constraint solver is a bit more expressive - the start and end of partitions
+are constrained independently. This allows constraints for extended partitions,
+keeping the extended partitions big enough to fit the logical partitions.
+* used the new constraint solver, to fix the extended partition Issues.
+* released 1.3.3
+
+September 10th 2000 - Andrew Clausen <clausen@gnu.org>
+* merged in changes from 1.2.8 to 1.2.9
+
+September 3rd 2000 - Andrew Clausen <clausen@gnu.org>
+* ped_disk_add_partition() allows the right number of primary partitions now!
+
+August 25th 2000 - Andrew Clausen <clausen@gnu.org>
+* fixed msdos_probe() - it didn't like LBA partitions
+* reverted ped_partition_set_flag(). Doesn't call ped_partition_set_system()
+anymore. What was I thinking? It's the responsibiltiy of *_set_flag() to call
+ped_partition_set_system().
+* added RAID and LVM partition flags
+* fixed a bug in alloc_root_dir() - now allocates enough clusters in
+FAT16 -> FAT32 conversions (!) Rarely does damage (and always avoidable,
+if you follow the advise)
+* fat_get_resize_constraint() is 100% accurate now (min_size wasn't accurate
+before)
+
+August 19th 2000 - Andrew Clausen <clausen@gnu.org>
+* fixed ext2_mkfs() inode thingy (!)
+* fixed semantics of ped_partition_set_flag() - now calls
+ped_partition_set_system()
+* added "select" command
+* added "move" command
+* fixed a bug in ped_disk_set_partition_geom() - partition list wasn't getting
+re-ordered, if the partition was moved about.
+* fixed a bug in libparted/disk_mac.c:762 _disk_count_active_partitions(). It
+assumed that the last partition would be the highest numbered partition.
+* get rid of that "BIOS geometry" message for non IDE/SCSI devices, or on
+non x86 arch's.
+* merged in changes to 1.2.8
+
+August 14th 2000 - Andrew Clausen <clausen@gnu.org>
+* added stubs for HFS, Reiserfs and NTFS
+
+August 12th 2000 - Andrew Clausen <clausen@gnu.org>
+* added ped_file_system_clobber() stuff (hint: needed for reiserfs :-)
+* merged in changes from 1.2.4-pre1 to 1.2.7
+* released 1.3.0
+
+August 6th 2000 - Andrew Clausen <clause@gnu.org>
+* ext2 code now works on big-endian machines :-)
+* released 1.3.0-pre7
+
+August 5th 2000 - Andrew Clausen <clausen@gnu.org>
+* more hacking on ext2 mac support.
+* random code-cleanup.
+
+July 31st 2000 - Andrew Clausen <clausen@gnu.org>
+* made libparted/fs_ext2/* big-endian-aware
+
+July 27th 2000 - Andrew Clausen <clausen@gnu.org>
+* wrote a constraint solver :-) libparted/natmath.c, libparted/constraint.c,
+include/parted/natmath.h and include/parted/constraint.h
+
+July 15th 2000 - Andrew Clauesn <clausen@gnu.org>
+* Mac read/write is looking good :-)
+* released 1.3.0-pre3
+
+July 14th 2000 - Andrew Clausen <clausen@gnu.org>
+* merged in changes between 1.2.3 and 1.2.4-pre1.
+
+July 13th 2000 - Masahiro SAKAI <ZVM01052@nifty.ne.jp>
+* improved _set_system() on PC98 disk label.
+* changed fat_set_system(), to preserve original ID when possible.
+* changed _ext2_set_system() and swap_set_system(), to correct "bootable"
+flag. (Linux/98 uses this flag to make a distinction between ext2 and
+linux-swap.)
+
+July 9th 2000 - Andrew Clausen <clausen@gnu.org>
+* read-only Mac partition map support is semi-working :-)
+* PC98 is looking a bit nicer now.
+* released 1.3.0-pre2
+
+July 3nd 2000 - Andrew Clausen <clausen@gnu.org>
+* got PC98 and loopback semi-working :-)
+* released 1.3.0-pre1
+
+June 23rd 2000 - Andrew Clausen <clausen@gnu.org>
+* merged in changes, up to 1.2.3-pre1. (I've been hacking on
+libparted/disk_mac.c, not finished yet)
+
+June 15th 2000 - Andrew Clausen <clausen@gnu.org>
+* forked off 1.3.x series
+
+-----------------------------------------------------------------------------
+1.2.x Before fork off development series
+-----------------------------------------------------------------------------
+June 15th 2000 - Andrew Clausen <clausen@gnu.org>
+* fixed minor build bug: fixed include problem in debug/clearfat/Makefile.am.
+* released 1.2.1
+
+June 14th 2000 - Andrew Clausen <clausen@gnu.org>
+* all looks well ;-)
+* released 1.2.0
+
+-----------------------------------------------------------------------------
+1.1.x
+-----------------------------------------------------------------------------
+
+June 11th 2000 - Andrew Clausen <clausen@gnu.org>
+* merged in changes to 1.0.17.
+* released 1.1.6
+
+May 27th 2000 - Andrew Clausen <clausen@gnu.org>
+* rearranged tools and clearfat stuff. Updated test scripts (from devtools),
+and included them.
+* released 1.1.5
+
+May 20th 2000 - Andrew Clausen <clausen@gnu.org>
+* fixed bugs in maintaining free_cluster_count and bad_cluster_count in
+libparted/fs_fat/table.c
+* fixed fat_check_resize_geometry()
+* added Galacian translations (thanks Jacobo :-)
+* added tools/
+* added tools/clearfat
+* released 1.1.5-pre1
+
+May 13th 2000 - Andrew Clausen <clausen@gnu.org>
+* merged in changes to 1.0.15
+* released 1.1.4
+
+April 16th 2000 - Andrew Clausen <clausen@gnu.org>
+* merged in changes to 1.0.14
+* got it to compile ;-)
+
+April 13th 2000 - Andrew Clausen <clausen@gnu.org>
+* merged in changes to 1.0.14-pre1
+* released 1.1.4-pre1
+
+April 11th 2000 - Andrew Clausen <clausen@gnu.org>
+* merged in changes to 1.0.13
+
+March 26th 2000 - Andrew Clausen <clausen@gnu.org>
+* merged in changes to 1.0.12
+
+March 24th 2000 - Andrew Clausen <clausen@gnu.org>
+* merged in changes to 1.0.11
+* released 1.1.3
+
+March 14th 2000 - Andrew Clausen <clausen@gnu.org>
+* merged in changes to 1.0.11-pre1
+* released 1.1.3-pre1
+
+March 13th 2000 - Andrew Clausen <clausen@gnu.org>
+* finally got the off_t checks working properly!
+
+March 4th 2000 - Andrew Clausen <clausen@gnu.org>
+* merged changes to 1.0.10 in
+* released 1.1.2
+
+March 2nd 2000 - Andrew Clausen <clausen@gnu.org>
+* hacked it to work on linux-ppc (probably breaks on the Alpha now :-)
+Don't get too excited. I haven't added the disk-label support yet.
+
+February 15th 2000 - Andrew Clausen <clausen@alphalink.com.au>
+* merged changes to 1.0.9 in
+* completed cluster resize down code :-) Now to begin debugging...
+
+February 11th 2000 - Andrew Clausen <clausen@alphalink.com.au>
+* merged 1.0.8 with other work, to create 1.1.0-pre1, which includes the
+following items
+* made ped_device_* POSIX compliant
+* added fat_collect_cluster_info() - replaces the "flag map", to provide
+fat_get_cluster_usage() and fat_get_cluster_flag()
+
+-----------------------------------------------------------------------------
+1.0.x After fork off development series
+-----------------------------------------------------------------------------
+
+June 14th 2000 - Andrew Clausen <clausen@gnu.org>
+* released 1.0.18
+
+June 13th 2000 - Andrew Clausen <clausen@gnu.org>
+* merged in lots more translations (sorry, didn't keep track!)
+* changed the new ped_geometry_test_[overlap|inside]() functions, to
+require a positive result to be on the same disk ;-)
+* updated documentation for ped_geometry_*()
+
+June 6th 2000 - Andrew Clausen <clausen@gnu.org>
+* merged in Galician, Dutch, Japanese and Russion translations.
+
+June 5th 2000 - Andrew Clausen <clausen@gnu.org>
+* now tolerates empty extended partitions created with Partition Magic.
+(PM fills the first sector with 0xf6). read_table() in libparted/disk_dos.c
+* read_table() in libparted/disk_dos.c. Now handles the exception correctly,
+for a bad signature (the brackets where around the wrong way)
+* new German and Brazillian Portugese translations.
+* released 1.0.17
+
+June 1st 2000 - Andrew Clausen <clausen@gnu.org>
+* fixed some problems with RPMs (parted.spec.in).
+* major work on libparted/disk.c. Resizing extended partitions should work
+properly now. Marginally less messy. (Layout is still really bad, but you can
+breathe on the code without it exploding now ;-)
+* released 1.0.17-pre1
+
+May 27th 2000 - Andrew Clausen <clausen@gnu.org>
+* updated Japanese translations
+* updated documentation, to encourage reading of Partition mini-HOWTO
+* released 1.0.16
+
+May 22nd 2000 - Andrew Clausen <clausen@gnu.org>
+* fixed bug in libparted/device.c: if probe_geometry() fails, then
+dev->sector_size is now set to 512.
+* removed redundant ped_device_probe_all() in parted/parted.c. Should be
+quicker now ;-)
+* released 1.0.16-pre2
+
+May 20th 2000 - Andrew Clausen <clausen@gnu.org>
+* merged bug-fixes from 1.1.5-pre1 in maintaining free_cluster_count and
+bad_cluster_count in libparted/fs_fat/table.c
+* added Galacian translations (thanks Jacobo :-)
+* released 1.0.16-pre1
+
+May 12th 2000 - Andrew Clausen <clausen@gnu.org>
+* updated documentation (and Japanese documentation - thanks Okuji :-)
+* released 1.0.15
+
+May 6th 2000 - Andrew Clausen <clausen@gnu.org>
+* fixed minor bugs with word wrapping.
+* added --help (-h) --version (-v) --script (-s) --interactive (-i)
+* released 1.0.15-pre3
+
+May 2nd 2000 - Andrew Clausen <clausen@gnu.org>
+* new version of Japanese translations.
+
+April 29th 2000 - Andrew Clausen <clausen@gnu.org>
+* after much agonizing and procrastination, decided not to have a mode command.
+Why would you want interactive mode if you're not an a tty? I'm open to
+persuasion ;-) (Also, it seems wrong making it "mode". It should be a
+--option instead).
+* released 1.0.15-pre2
+* fixed device_get_sector_size() - now tells the user what the real sector
+size is (as opposed to -1). (Thanks to Phillip Garland :-)
+
+April 25th 2000 - Andrew Clausen <clausen@gnu.org>
+* all PED_EXCEPTION_WARNING and PED_EXCEPTION_ERROR exceptions now continue
+with a good default, if they get a PED_EXCEPTION_UNHANDLED.
+
+April 23rd 2000 - Andrew Clausen <clausen@gnu.org>
+* parted.spec.in: now installs binaries/libraries in /sbin and /lib.
+
+April 20th 2000 - Andrew Clausen <clausen@gnu.org>
+* fixed CTRL-D bug -> seg violation in _readline() (parted/ui.c)
+
+April 15th 2000 - Andrew Clausen <clausen@gnu.org>
+* Parted boot disk image now available from ftp sites in gnu/parted/bootdisk.
+
+April 14th 2000 - Andrew Clausen <clausen@gnu.org>
+* renamed PedExceptionClass, and PedException's member class to
+PedExceptionType and type, to avoid clashes with C++.
+
+April 13th 2000 - Andrew Clausen <clausen@gnu.org>
+* released 1.0.14-pre1
+
+April 12th 2000 - Andrew Clausen <clausen@gnu.org>
+* changed configure.in: now refuses to attempt to build included gettext.
+Gives appropriate (hopefully ;-) advice on how to fix the problem...
+
+April 11th 2000 - Andrew Clausen <clausen@gnu.org>
+* uses SCSI_BLK_MAJOR rather than SCSI_DISK_MAJOR
+
+April 9th 2000 - Andrew Clausen <clausen@gnu.org>
+* did lots more testing. All seems well ;-)
+* released 1.0.13
+
+April 8th 2000 - Andrew Clausen <clausen@gnu.org>
+* finally discovered that BLKSSZGET is broken < 2.3.3. Andries Brouwer
+suggests using, only if <linux/blkpg.h> exists.
+* added doc/USER.jp (Japanese translation of doc/USER). (Thanks Ryoji!)
+* fixed severe bug: fat_convert_directory(): new_trav and old_trav went
+out of sync, in some circumstances!!! OUCH!!! (Probably didn't show up
+on 99.9% people's systems, because it usually will either be out-by-zero
+or out-by>=two. In both cases, there would be no problems)
+* fixed severe bug: fs_info->root_dir_entry_count should be set when converting
+FAT32 -> FAT16. OUCH!!! Why no bug reports??!!
+* released 1.0.13-pre1
+
+April 4rd 2000 - Andrew Clausen <clausen@gnu.org>
+* restructured libparted/device.c somewhat. Now uses BLKGETSIZE ioctl to
+get size of device, which can address 2 ^ (32 + 9) == 2048Gb.
+* ped_partition_is_busy() in libparted/disk.c now checks /proc/swaps as well as
+/proc/mounts.
+
+April 2nd 2000 - Andrew Clausen <clausen@gnu.org>
+* warns very strongly that Parted isn't good with sector size != 512 bytes,
+in fat code (libparted/fs_fat/bootsector.c)
+
+March 28th 2000 - Andrew Clausen <clausen@gnu.org>
+* now tells the kernel to keep trying to read the partition table. (patch from
+Fernando Fuganti)
+* released 1.0.12
+
+March 26th 2000 - Andrew Clausen <clausen@gnu.org>
+* fixed boot loader code, and uncommented code to install it.
+* released 1.0.12-pre1
+
+March 24th 2000 - Andrew Clausen <clausen@gnu.org>
+* moved parted.8 to doc/ directory
+* released 1.0.11
+
+March 22nd 2000 - Andrew Clausen <clausen@gnu.org>
+* moved documentation into doc/ directory. Changed licence of documentation
+to the GNU Free Documentation Licence 1.1.
+* released 1.0.11-pre2
+
+March 19th 2000 - Andrew Clausen <clausen@gnu.org>
+* now checks /proc/mounts (if available) for testing if a partition is mounted.
+
+March 14th 2000 - Andrew Clausen <clausen@gnu.org>
+* only unset LINGUAS if its non-empty in parted.spec.in (thanks Fabian :-)
+* reintroduce %build (thanks Fabian :-)
+* released 1.0.11-pre1
+
+March 11th 2000 - Andrew Clausen <clausen@gnu.org>
+* fixed minor bug in mkpartfs command parsing.
+* #include <sys/sysmacros.h> directly.
+
+February 29th 2000 - Andrew Clausen <clausen@gnu.org>
+* fixed buffer overflow bug in ext2_mkfs
+* fixed bug in ped_malloc(), so running out of memory will fail cleanly
+* made ped_exception_throw() use malloc(), to prevent infinite recursion.
+* released 1.0.10
+
+February 27th 2000 - Andrew Clausen <clausen@gnu.org>
+* now warns the user about system files that may be unmovable
+* released 1.0.10-pre3
+
+February 25th 2000 - Andrew Clausen <clausen@gnu.org>
+* found out semantics for drives that are slightly longer than C*H*S:
+last bit is simply ignored... adjusted probe_real_geom() to match behaviour
+* added probe_acceptable_geom()
+* released 1.0.10-pre2
+
+February 23rd 2000 - Andrew Clausen <clausen@alphalink.com.au>
+* added docs for Windows NT/2000 (largely contributed by Stefan Kanthak)
+* added Dutch translations (contributed by Ivo Timmermans)
+* made process_inconsistent_table() a bit more leanient.
+* released 1.0.10-pre1
+
+February 14th 2000 - Andrew Clausen <clausen@alphalink.com.au>
+* released 1.0.9
+
+February 13th 2000 - Andrew Clausen <clausen@alphalink.com.au>
+* for partitions ending cylinder > 1024, now writes the CHS value as if the
+partition ended on cylinder 1024.
+* released 1.0.9-pre1
+
+
+-----------------------------------------------------------------------------
+1.0.x Before fork off development series
+-----------------------------------------------------------------------------
+
+February 7th 2000 - Andrew Clausen <clausen@alphalink.com.au>
+* released 1.0.8
+
+February 3rd 2000 - Andrew Clausen <clausen@alphalink.com.au>
+* fixed bug in fat_get_system() introduced in 1.0.8-pre1 (when fs == NULL)
+* released 1.0.8-pre2
+
+February 1st 2000 - Andrew Clausen <clausen@alphalink.com.au>
+* changed fat_get_system(), to use LBA partition types for partitions with
+end > cylinder 1024.
+* released 1.0.8-pre1
+
+January 23rd 2000 - Andrew Clausen <clausen@alphalink.com.au>
+* made ped_device_seek() a bit more portable
+* released 1.0.7
+
+January 22nd 2000 - Andrew Clausen <clausen@alphalink.com.au>
+* changed type of PedDevice's heads, sector, cyl fields to int's.
+* added a man page, contributed by Timshel Knoll <timshel@pobox.com>
+* released 1.0.7-pre1
+
+January 20th 2000 - Andrew Clausen <clausen@alphalink.com.au>
+* released 1.0.6
+
+January 19th 2000 - Andrew Clausen <clausen@alphalink.com.au>
+* fixed >16gig bug in libparted/disk_dos.c (need LE32, not LE16!!!)
+* released 1.0.6-pre1
+
+January 12th 2000 - Andrew Clausen <clausen@alphalink.com.au>
+* applied typo-clean-up patch from Tim Waugh <twaugh@redhat.com>
+* released 1.0.5
+
+January 9th 2000 - Andrew Clausen <clausen@alphalink.com.au>
+* added autoconfuse checks up-to-date linux/ext2_fs.h
+* imported new ext2_fs.h
+* imported changes from ext2resize, to add support the ext2 "filetype"
+feature
+* released 1.0.5-pre3
+
+January 8th 2000 - Andrew Clausen <clausen@alphalink.com.au>
+* removed -Wno-sign-compare, because it breaks older gcc
+* moved checks for termcap up before readline check, and get readline check
+to use the result of the termcap check.
+* the "termcap" library can be now be one of: -ltermcap, -ltermlib, -lcurses,
+-lncurses.
+* released 1.0.5-pre2
+
+January 7th 2000 - Andrew Clausen <clausen@alphalink.com.au>
+* fixed buglet for FAT16 cluster entries
+* fixed (hopefully) str_list_print_wrap()
+* use static for do_* in parted/parted.c
+* cleaned up parted.spec.in
+* released 1.0.5-pre1
+
+January 5th 2000 - Andrew Clausen <clausen@alphalink.com.au>
+* Fixed a silly bug in ped_partition_set_system() for extended partitions
+* released 1.0.4
+
+January 4th 2000 - Andrew Clausen <clausen@alphalink.com.au>
+* Arrghh! Found (and fixed) a VERY nasty bug during partition table writes.
+* released 1.0.3
+
+January 3rd 2000 - Andrew Clausen <clausen@alphalink.com.au>
+* Arrghh! Found (and fixed) a nasty bug in the string printing code.
+* released 1.0.2
+
+January 1st 2000 - Andrew Clausen <clausen@alphalink.com.au>
+* added some documentation about --without-readline and --disable-nls
+* released 1.0.1
+
+December 29th 1999 - Andrew Clausen <clausen@alphalink.com.au>
+* disable-nls works now
+* added --without-readline option
+* added Brazillian Portugese translations (thanks Eliphas!)
+* released 1.0.1-pre1
+
+December 21st 1999 - Andrew Clausen <clausen@alphalink.com.au>
+* fixed some typo's in the documentation
+* passed lots of testing :-)
+* released 1.0.0
+
+December 18th 1999 - Andrew Clausen <clausen@alphalink.com.au>
+* fixed bug in front-end: when the BIOS geometry doesn't match Linux's, the
+guessed geometry wasn't being used immediately in do_print, do_mk[part]fs,
+and do_resize
+* released 1.0.0-pre14
+
+December 17th 1999 - Andrew Clausen <clausen@alphalink.com.au>
+* fixed lots of bugs: lots of fence-post errors (it's 4n - 4 !!!) in fat code
+* released 1.0.0-pre13
+
+December 15th 1999 - Andrew Clausen <clausen@alphalink.com.au>
+* fixed bug in ext2_do_inode() - ext2_brelse() getting called on an
+ uninitialized buffer on an error. Thanks Tim!
+* added PED_ASSERT macro, and used it all over the place
+* fixed cosmetic bugs in front-end
+* released 1.0.0-pre12
+
+December 12th 1999 - Andrew Clausen <clausen@alphalink.com.au>
+* added ped_file_system_get_min_size()
+* fixed bug in ext2 code
+* released 1.0.0-pre11
+
+December 11th 1999 - Andrew Clausen <clausen@alphalink.com.au>
+* fixed bug with extended partition handling
+* fixed bug in ext2 code
+* added support for checking minimum size of partition
+* released 1.0.0-pre10
+
+December 7th 1999 - Andrew Clausen <clausen@alphalink.com.au>
+* fixed character set issues for Japanese and Russian
+* released 1.0.0-pre9
+
+November 8th 1999 - Andrew Clausen <clausen@alphalink.com.au>
+* fixed gettext issues: includes intl/ when using included gettext, and
+--disable-nls works
+* released 1.0.0-pre6
+
+November 6th 1999 - Andrew Clausen <clausen@alphalink.com.au>
+* added French translations (thanks Jean-Marc :-)
+* fixed front-end, to use gettext properly. Big changes.
+* added lots of const's to libparted
+* released 1.0.0-pre5
+
+November 5th 1999 - Andrew Clausen <clausen@alphalink.com.au>
+* removed journalling code
+* added German translations (thanks Martin :-)
+
+November 1st 1999 - Andrew Clausen <clausen@alphalink.com.au>
+* released 0.0.9-pre3
+* now uses GNU readline
+
+October 31st 1999 - Andrew Clausen <clausen@alphalink.com.au>
+* released 0.0.9-pre2
+* added PED_EXCEPTION_NO_FEATURE. Reserve PED_EXCEPTION_BUG for REAL bugs.
+
+October 29th 1999 - Andrew Clausen <clausen@alphalink.com.au>
+* released 0.0.9-pre1
+* updated docs
+* added some safety checks
+
+October 26th 1999 - Andrew Clausen <clausen@alphalink.com.au>
+* released 0.0.8
+* added to the docs.
+
+October 25th 1999 - Andrew Clausen <clausen@alphalink.com.au>
+* released version 0.0.8-pre2
+* better behaviour for weird geometry and inconsistant partition tables
+
+October 18th 1999 - Andrew Clausen <clausen@alphalink.com.au>
+* released version 0.0.8-pre1
+* added i18n support
+* fixed some bugs in boot-loader. Still not working properly though, but I
+got it to boot out of DOS debug :-)
+
+October 16th 1999 - Andrew Clausen <clausen@alphalink.com.au>
+* released version 0.0.7
+* ext2 mkfs support
+* manipulation of partition flags
+* better error handling (particularly ext2)
+* lots of bug fixes.
+
+October 7th 1999 - Andrew Clausen <clausen@alphalink.com.au>
+* released 0.0.6
+* fixes a major bug introduced in 0.0.5 in the FAT resizer
+
+October 5th 1999 - Andrew Clausen <clausen@alphalink.com.au>
+* released 0.0.5
+* bug fixes and speed-ups
+
+October 2nd 1999 - Andrew Clausen <clausen@alphalink.com.au>
+* released 0.0.4
+* fixed major bug in FAT16->FAT32 upgrade
+* fixed some portability issues for Alpha Linux
+* many minor bug fixes
+
+September 27th 1999 - Andrew Clausen <clausen@alphalink.com.au>
+* released 0.0.3
+* Added linux-swap support
+* fixed problem with large hard disks
+* implemented better error handling for ext2
+
+September 20th 1999 - Andrew Clausen <clausen@alphalink.com.au>
+* released 0.0.1
+
+June 6th 1999 - Andrew Clausen <clausen@alphalink.com.au>
+* created initial version
+
+-----------------------------------------------------------------------------
+
+This file is part of GNU Parted
+Copyright (C) 1999 - 2006 Free Software Foundation Inc.
+
+This file may be modified and/or distributed without restriction. This is
+not an invitation to misrepresent the history of GNU Parted.
+
diff --git a/Doxyfile b/Doxyfile
new file mode 100644
index 0000000..5d32f7c
--- /dev/null
+++ b/Doxyfile
@@ -0,0 +1,1084 @@
+# Doxyfile 1.4.2
+
+PROJECT_NAME = libparted
+PROJECT_NUMBER = 1.7
+
+OUTPUT_DIRECTORY = doc/libparted/API
+CREATE_SUBDIRS = NO
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF =
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like the Qt-style comments (thus requiring an
+# explicit @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF = YES
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the DETAILS_AT_TOP tag is set to YES then Doxygen
+# will output the detailed description near the top, like JavaDoc.
+# If set to NO, the detailed description appears after the member
+# documentation.
+
+DETAILS_AT_TOP = NO
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+TAB_SIZE = 8
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = NO
+EXTRACT_PRIVATE = NO
+EXTRACT_STATIC = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = NO
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = YES
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation.
+
+SHOW_DIRECTORIES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from the
+# version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the progam writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = NO
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = libparted/device.c libparted/unit.c libparted/cs/constraint.c libparted/disk.c libparted/exception.c libparted/filesys.c libparted/cs/geom.c libparted/arch/gnu.c libparted/libparted.c libparted/arch/linux.c libparted/cs/natmath.c libparted/timer.c libparted/unit.c include
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm
+
+FILE_PATTERNS =
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories.
+
+EXCLUDE_PATTERNS =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS =
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES (the default)
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES (the default)
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX = Ped _Ped
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = YES
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_PREDEFINED tags.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = YES
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will
+# generate a call dependency graph for every global function or class method.
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_WIDTH = 1024
+
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_HEIGHT = 1024
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that a graph may be further truncated if the graph's
+# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH
+# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default),
+# the graph is not depth-constrained.
+
+MAX_DOT_GRAPH_DEPTH = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, which results in a white background.
+# Warning: Depending on the platform used, enabling this option may lead to
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
+# read).
+
+DOT_TRANSPARENT = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = YES
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..e0c890e
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,55 @@
+ACLOCAL_AMFLAGS = -I m4
+SUBDIRS = po libparted parted partprobe include doc debug
+
+EXTRA_DIST = config.rpath \
+ ABOUT-NLS \
+ AUTHORS \
+ BUGS \
+ COPYING \
+ THANKS \
+ TODO \
+ parted.spec.in \
+ parted.m4 \
+ scripts/data/abi/baseline_symbols.txt \
+ scripts/extract_symvers
+
+aclocaldir=$(datadir)/aclocal
+aclocal_DATA=parted.m4
+
+dist-hook: parted.spec
+ cp parted.spec $(distdir)
+
+### ABI Checking scripts ###
+
+baseline_file = ${top_srcdir}/scripts/data/abi/baseline_symbols.txt
+extract_symvers = $(top_srcdir)/scripts/extract_symvers
+
+current_symbols.txt: ${extract_symvers}
+ -@(sh ${extract_symvers} libparted/.libs/libparted.so current_symbols.txt)
+
+baseline_symbols:
+ -@(output=${baseline_file}; \
+ if test ! -f $${output}; then \
+ echo "Baseline file doesn't exist."; \
+ echo "Try 'make new-abi-baseline' to create it."; \
+ exit 1; \
+ fi; true)
+
+new-abi-baseline:
+ -@$(mkinstalldirs) ${baseline_dir}
+ -@(output=${baseline_file}; \
+ if test -f $${output}; then \
+ output=$${output}.new; \
+ t=`echo $${output} | sed 's=.*config/abi/=='`; \
+ echo "Baseline file already exists, writing to $${t} instead."; \
+ fi; \
+ sh ${extract_symvers} libparted/.libs/libparted.so $${output})
+
+# Use 'new-abi-baseline' to create an initial symbol file. Then run
+# 'check-abi' to test for changes against that file.
+check-abi: baseline_symbols current_symbols.txt
+ @diff -u ${baseline_file} ./current_symbols.txt 2>&1 \
+ | tee libparted.abi-diff
+ @test `wc -l < libparted.abi-diff` -gt 0 \
+ && (echo "ABI has changed. Please, update you ABI package version."; exit 1) \
+ || exit 0
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..719dab6
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,32 @@
+1.7.0
+=====
+libparted:
+* support for Apple GUIDs to GPT code
+* BeOS/ZETA/Haiku support
+* probe /dev/hd? before /dev/sd?
+* prefer /sys/block to /proc/partitions where possible
+* fix of ext2 "strange layout" bug (EXPERIMENTAL)
+* Linux: detection of sector sizes not equal to 512
+* GPT handles sector sizes not equal to 512 correctly now (EXPERIMENTAL)
+* ext2 handles sector sizes not equal to 512 correctly now (EXPERIMENTAL)
+* added ped_device_get_constraint to support device-dependent constraints
+* API documentation moved to Doxygen
+
+parted:
+* new formatter for "print" command
+* removed copyright preamble and introduced "version" command
+* SIGSEGV handler
+* fixed "rescue" command core dump
+* 'mkpart' and 'mkpartfs' align partitions to physical block size boundaries
+ now
+* 'mkpart' and 'mkpartfs' let the user set a partition name where supported now
+* 'print' accepts 'free' argument to display free space information
+* 'print' accepts 'all' argument to display information about all
+ detected devices
+* position and size of partitions are displayed with up to two
+ digits after the decimal dot (depending on the unit and value)
+
+manual:
+* cut down substantially. Lots of general content will be moved to the GNU
+ Storage Guide.
+
diff --git a/README b/README
new file mode 100644
index 0000000..1edacd5
--- /dev/null
+++ b/README
@@ -0,0 +1,63 @@
+GNU Parted
+----------
+
+GNU Parted is a program for creating, destroying, resizing, checking and
+copying partitions, and the filesystems on them. This is useful for creating
+space for new operating systems, reorganising disk usage, copying data between
+hard disks, and disk imaging.
+
+ * documentation is in the doc/ directory. The User's documentation is in
+texinfo format, and is built into a format viewable by info/pinfo when
+you run make. i.e.
+
+ $ ./configure
+ $ cd doc
+ $ make
+ $ info -f parted.info
+
+Yes, it sucks that you need to run ./configure before you can read the manual.
+If you have problems with it, doc/parted.texi should be fairly easy to read,
+just a bit less userfriendly.
+ If you prefer html format, you can run:
+
+ $ cd doc
+ $ makeinfo --html parted.texi
+
+ * an online tutorial is available at http://www.luv.asn.au/overheads/parted
+ * the GNU Parted home page is http://www.gnu.org/software/parted
+ * the GNU Parted FAQ can be found at
+ http://www.gnu.org/software/parted/faq.html
+ * send bug reports, requests for help, feature requests, comments, etc. to
+bug-parted@gnu.org. The authors can be contacted directly (see the AUTHORS
+file).
+
+
+NOTE TO DISTRIBUTIONS
+---------------------
+
+(1) When compiling Parted for distribution for general use, we recommend using
+the default configuration:
+
+ CFLAGS=-Os ./configure
+
+This includes --enable-debug (by default), which contains many assertions.
+Obviously, these "waste" space, but in the past, they have caught potentially
+dangerous bugs before they would have done damage, so we think it's worth
+it. Also, it means we get more bug reports ;)
+
+
+(2) When doing dependencies, remember that libreiserfs is a *soft* dependency,
+so I guess that means Debian-look-alikes should do a "suggests", but
+not a "requires".
+
+
+(3) When space is important, we suggest --without-readline, --disable-shared,
+and possibly --disable-nls and --disable-dynamic-loading.
+
+If Parted is only going to be used for probing / discovery (and not
+"editing"), there is a --enable-discovery-only and --disable-fs (when you're
+only interested in partition tables). Since it's readonly, --enable-debug
+gains you nothing wrt safety, so use --disable-debug ;) The "discover"
+program is about 35k (gzipped) when compiled this way (not counting libc
+and libuuid).
+
diff --git a/THANKS b/THANKS
new file mode 100644
index 0000000..466ccac
--- /dev/null
+++ b/THANKS
@@ -0,0 +1,28 @@
+In no particular order:
+
+ * Jonathan duSaint <jon@rockgeeks.net> for binary unit support and more.
+ * Kamil Ignacak <acerion@wp.pl> for help with the migration of the API documentation.
+ * Conectiva, www.conectiva.com, for sponsoring Parted's development (in the
+past). Eliphas, beber (aka Pato), baretta, fuganti, claudio, olive (anyone
+else?)
+ * Stefan Kanthak <101.33761@germanynet.de> for lots of info on boot-loaders,
+and some corrections to the documentation
+ * Fabian Emmes <fab@orlen.de> for RPM spec file, help with hidden
+partitions and autoconfusion :-) - and lots of other misc. help.
+ * Falk Hueffner <falk.hueffner@student.uni-tuebingen.de> for bug fixes.
+ * Kevin Lindsay <klindsay@stormix.com> for lots of bug reports, etc.
+ * John Weismiller <john@stormix.com> for lots of bug reports, etc.
+ * Andries Brouwer <Andries.Brouwer@cwi.nl> for advice on BIOS geometry
+ * Simon Kirby <sim@stormix.com> for advice on BIOS geometry
+ * Glenn McGrath <Glenn.McGrath@jcu.edu.au>
+ * Timshel Knoll <timshel@pobox.com> for Debian stuff
+ * Tim Waugh <twaugh@redhat.com> for bug reports and fixes
+ * My friends for helping with testing: Tristan Zwalf, Menaka Lashitha Bandara,
+Thomas Hambleton
+ * Ryan Weaver <ryanw@infohwy.com> for parted.spec.in patches
+ * Benjamin Herrenschmidt <bh40@calva.net> for answering all of our questions
+on Mac's
+ * Ethan Benson <erbenson@alaska.net> for lots of advice / testing on ppc
+ * Charles Stevenson <csteven@terraplex.com> - ppc stuff
+ * heaps of people we left out!
+
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..019cd74
--- /dev/null
+++ b/TODO
@@ -0,0 +1,98 @@
+
+See http://wiki.debian.org/Parted
+
+=== everything below is old and for reference purposes only ===
+
+* regression tests:
+ - add specific tests for FAT16 -> FAT32, FAT32 -> FAT16, cluster
+resizing 8k -> 4k, etc. Also, compare output, to catch other "unexpected"
+errors (like partitions going missing, <cough> not that that's ever
+happened <cough>)
+
+* ui:
+ - support a cylinder interface for the masochistic.
+ - warn when partition numbers change (?) in UI?
+
+* make *_read() do ped_file_system_probe(), and warn if it isn't sane for
+the partition ID on-disk.
+
+* disk label implementations:
+ - OS/2 DLAT support
+ - read-only flag for Mac partitions, and the macufs partition type
+ - lba flag - default flag?
+ - PC98: relax cylinder boundary restrictions (create conforming
+ partitions, but allow non-conforming partitions ;-)
+
+* docs for RAWRITE, etc.
+
+* write a summary of operation list things, and get discussion going...
+* ped_file_system_is_flag_available()
+* ped_file_system_commit() ? polymorphic operations, with apply() and
+revert() in memory, and commit all fs's and disk's to commit on-disk.
+* ped_operation_queue (ped_operation_new (PED_OP_PARTITION_SET_FLAG, ...)),
+ or ped_partition_set_flag() (with a "transparent" queue?)
+
+* separate domains libparted and parted (for nls)
+* merge with partimage.sourceforge.net
+* merge with gpart
+* "renumber"
+* "reconstruct"
+* "resizepart"
+* make an errata web page
+* bootdisk: try getting readline & nls support in, use a newer version of
+busybox. Also, write some scripts for disk imaging.
+* Rawrite3 IS free, it seems. Find the source (version 1.3 == version 3), and
+stick source+bin up on the ftp site.
+* improve website (check out texinfo. Does it create much autoconfusion?)
+
+* /proc/meminfo, mlock()
+
+* create an FAQ, and stick lots of examples in it.
+
+* ped_file_system_resize_online()
+
+* reiser fs (almost there), ntfs support!
+
+* when Windows doesn't shut down properly, it knows about it. How?
+* FAT boot sector reconstruction, in fat_check() - actually, fat_open(),
+since it won't open properly if it's broken... Tell panov@iacp.vl.ru when
+done. Perhaps connect this to the front-end via a "force MINOR FS-TYPE"
+command, since it's sometimes hard to detect broken file systems.
+
+* FreeBSD support (get a copy - I want to try it anyway!)
+
+* LBA support in boot loader
+
+* OS/2 Boot manager
+
+* documentation of the internal API, tutorial on external API, and perhaps a bit
+on how the resizers, etc. work [MOSTLY DONE]
+
+* logical sectors (?) byte addressing?
+
+* libbootload ?
+ - update LILO/GRUB/Quik
+
+* command-line interface: i18n issues, "Yes, No or Cancel?". This issue is
+hard, for free software in general. We need a community (i.e. mailing list)
+that specializes in this, IMHO.
+
+* ped_geometry_{map|unmap}(), and kill the libparted/fs_ext2 buffer cache
+
+* injecting/ejecting partitions into/out of extended partitions. But to
+keep alignment rules, would have to move the start of the partition. No
+problem for FAT. Absolute pain for ext2.
+
+* ext2 resizer:
+ - add ability to move the start of the file system.
+ - fix "strange layout" problem
+ - add an incompat feature to ext2 that is a special resize-the-start
+journal, and add support in e2fsck / mount / linux (?) for it.
+
+* RAID? LVM? EVMS? grand-unified system TM?
+
+* support finding bad-blocks. Use ped_device_check() in ped_geometry_check()
+
+* generic resizing/converting with the inplace copy via sparse loopback idea
+ from Serguei Tzukanov
+
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..00184f7
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+aclocal
+autoconf -f
+autoheader
+autopoint
+libtoolize -c -f
+automake -a -c
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..7e89974
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,462 @@
+dnl GNU Parted - a library and front end for manipulation hard disk partitions
+dnl Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005
+dnl Free Software Foundation, Inc.
+dnl
+dnl This file may be modified and/or distributed without restriction.
+
+AC_PREREQ(2.50)
+
+AC_INIT(include/parted/parted.h)
+
+dnl Versioning
+dnl Shamelessly pulled straight from glib's configure.in ...
+dnl Making releases:
+dnl PED_MICRO_VERSION += 1;
+dnl PED_INTERFACE_AGE += 1;
+dnl PED_BINARY_AGE += 1;
+dnl if any functions have been added, set PED_INTERFACE_AGE to 0.
+dnl if backwards compatibility has been broken (eg. functions removed,
+dnl function signatures changed),
+dnl set PED_BINARY_AGE _and_ PED_INTERFACE_AGE to 0.
+PED_MAJOR_VERSION=1
+PED_MINOR_VERSION=7
+PED_MICRO_VERSION=0
+PED_INTERFACE_AGE=0
+PED_BINARY_AGE=0
+PED_VERSION_SUFFIX=trunk
+PED_VERSION=$PED_MAJOR_VERSION.$PED_MINOR_VERSION.$PED_MICRO_VERSION$PED_VERSION_SUFFIX
+
+LT_RELEASE=$PED_MAJOR_VERSION.$PED_MINOR_VERSION
+LT_CURRENT=`expr $PED_MICRO_VERSION - $PED_INTERFACE_AGE`
+LT_REVISION=$PED_INTERFACE_AGE
+LT_AGE=`expr $PED_BINARY_AGE - $PED_INTERFACE_AGE`
+
+AC_SUBST(LT_RELEASE)
+AC_SUBST(LT_CURRENT)
+AC_SUBST(LT_REVISION)
+AC_SUBST(LT_AGE)
+
+PACKAGE=parted
+VERSION=$PED_VERSION
+
+AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
+
+AM_CONFIG_HEADER(config.h)
+
+AC_CANONICAL_HOST
+case "$host_os" in
+ linux*) OS=linux ;;
+ gnu*) OS=gnu ;;
+ beos*) OS=beos ;;
+ *) AC_MSG_ERROR([Unknown or unsupported OS "$host_os". Only "linux", "gnu" and "beos" are supported in this version of GNU Parted.]) ;;
+esac
+AC_SUBST(OS)
+
+dnl Command-line options
+AC_ARG_WITH(readline,
+ [ --with-readline support fancy command line editing], ,
+ with_readline=yes
+)
+
+AC_ARG_ENABLE(mtrace,
+ [ --enable-mtrace enable malloc() debugging], ,
+ enable_mtrace=no
+)
+if test "$enable_mtrace" = yes; then
+ AC_DEFINE(ENABLE_MTRACE, 1, [Mtrace malloc() debugging])
+fi
+
+AC_ARG_ENABLE(discover-only,
+ [ --enable-discover-only support only reading/probing [default=no]], ,
+ enable_discover_only=no
+)
+if test "$enable_discover_only" = yes; then
+ AC_DEFINE(DISCOVER_ONLY, 1, [Probing functionality only])
+fi
+
+PARTED_LIBS=""
+AC_ARG_ENABLE(dynamic-loading,
+[ --enable-dynamic-loading support dynamic fs libraries [default=yes]], ,
+ if test "$enable_discover_only" = yes; then
+ enable_dynamic_loading=no
+ else
+ enable_dynamic_loading=yes
+ fi
+)
+if test "$enable_discover_only" = yes -a "$enable_dynamic_loading" = yes; then
+ AC_MSG_ERROR(
+[You can't use --enable-dynamic-loading and --disable-discover-only together]
+ )
+fi
+
+AC_ARG_ENABLE(fs,
+ [ --enable-fs include filesystem support [default=yes]], ,
+ enable_fs=yes
+)
+if test "$enable_fs" = yes; then
+ AC_DEFINE(ENABLE_FS, 1,
+ [Include file system support. i.e. libparted/fs_...])
+fi
+
+AC_ARG_ENABLE(debug,
+ [ --enable-debug compile in assertions [default=yes]], ,
+ enable_debug=yes
+)
+
+if test "$enable_debug" = yes; then
+ AC_DEFINE(DEBUG, 1, [Enable assertions, etc.])
+fi
+
+AC_ARG_ENABLE(read-only,
+ [ --enable-read-only disable writing (for debugging) [default=no]]
+ , ,
+ enable_read_only=no
+)
+if test "$enable_read_only" = yes; then
+ AC_DEFINE(READ_ONLY, 1, [Disable all writing code])
+fi
+
+PARTEDLDFLAGS=
+AC_SUBST(PARTEDLDFLAGS)
+
+AC_ARG_ENABLE(pc98,
+ [ --enable-pc98 build with pc98 support [default=yes]], ,
+ enable_pc98=yes
+)
+if test "$enable_pc98" = yes; then
+ AC_DEFINE(ENABLE_PC98, 1,
+ [Include PC98 partition tables. (Sometimes excluded to avoid
+ collisions with msdos partition tables])
+fi
+
+AC_ARG_ENABLE(Werror,
+ [ --enable-Werror build with gcc -Werror [default=yes]], ,
+ enable_Werror=yes
+)
+
+AC_ARG_ENABLE(hfs-extract-fs,
+ [ --enable-hfs-extract-fs Extract special HFS files for debugging [default=no]], ,
+ enable_hfs_extract_fs=no
+)
+if test "$enable_hfs_extract_fs" = yes; then
+ AC_DEFINE(HFS_EXTRACT_FS, 1,
+ [Extract low level special HFS(+) files for debugging purposes
+ when using the "check" command (NOT FOR PACKAGING)])
+fi
+
+dnl make libc threadsafe (not required for us, but useful other users of
+dnl libparted)
+CFLAGS="$CFLAGS -D_REENTRANT"
+
+dnl Check for programs.
+AC_ISC_POSIX
+AC_PROG_CC
+AC_PROG_GCC_TRADITIONAL
+
+dnl This test must come as early as possible after the compiler configuration
+dnl tests, because the choice of the file model can (in principle) affect
+dnl whether functions and headers are available, whether they work, etc.
+AC_SYS_LARGEFILE
+
+CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=${ac_cv_sys_file_offset_bits}"
+AC_CHECK_SIZEOF(off_t, 64, [
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+])
+
+AM_ENABLE_SHARED
+if test "$OS" = linux -a $ac_cv_sizeof_off_t -lt 8; then
+ dnl Need to disable shared libraries, to get llseek() to work. Long
+ dnl story. The short story is: lseek() isn't in glibc, so a syscall
+ dnl must be made. syscalls can't be made from within shared libraries,
+ dnl because of a bug (?) in gcc.
+ AC_MSG_WARN(
+off_t is less than 8 bytes. Using llseek syscall, and disabling shared
+libraries.)
+ AM_DISABLE_SHARED
+fi
+AM_PROG_LIBTOOL
+
+dnl Initialize i18n:
+ALL_LINGUAS="ca cs da de es fr gl id it ja nl nn hu pl pt pt_BR ru sv tr uk vi zh_CN zh_TW"
+AM_GNU_GETTEXT_VERSION([0.12.1])
+AM_GNU_GETTEXT([external])
+CFLAGS="$CFLAGS -DLOCALEDIR=\"\\\"$datadir/locale\\\"\""
+if test "$USE_INCLUDED_LIBINTL" = "yes"; then
+ AC_MSG_ERROR(
+GNU Parted requires gettext to be installed for compilation -
+if native language support is desired. Either disable native language support
+with:
+ $ ./configure --disable-nls
+Or install gettext. GNU gettext is available from
+ http://ftp.gnu.org/gnu/gettext
+)
+ exit
+fi
+CFLAGS="$CFLAGS -DLOCALEDIR=\"\\\"$datadir/locale\\\"\""
+
+dnl Check for libdl, if we are doing dynamic loading
+DL_LIBS=""
+if test "$enable_dynamic_loading" = yes; then
+ AC_CHECK_LIB(dl, dlopen,
+ DL_LIBS="-ldl"
+ PARTED_LIBS="$PARTED_LIBS -ldl"
+ AC_DEFINE(DYNAMIC_LOADING, 1, [Lazy linking to fs libs]),
+ AC_MSG_ERROR(
+ [-ldl not found! Try using --disable-dynamic-loading]
+ )
+ exit
+ )
+fi
+AC_SUBST(DL_LIBS)
+
+dnl Check for libuuid
+UUID_LIBS=""
+AC_CHECK_LIB(uuid, uuid_generate, UUID_LIBS="-luuid",
+ AC_MSG_ERROR(
+GNU Parted requires libuuid - a part of the e2fsprogs package (but
+sometimes distributed separately in uuid-devel or similar)
+This can probably be found on your distribution's CD or FTP site or at:
+ http://web.mit.edu/tytso/www/linux/e2fsprogs.html
+Note: if you are using precompiled packages you will also need the development
+package as well (which may be called e2fsprogs-devel or something similar).
+If you compile e2fsprogs yourself then you need to do 'make install' and
+'make install-libs'.
+ )
+ exit
+)
+AC_SUBST(UUID_LIBS)
+
+dnl Check for libreiserfs
+REISER_LIBS=""
+if test "$enable_dynamic_loading" = no -a "$enable_discover_only" = no; then
+ OLD_LIBS="$LIBS"
+ AC_CHECK_LIB(dal, dal_equals,
+ LIBS="-ldal"
+ AC_CHECK_LIB(reiserfs, reiserfs_fs_probe,
+ REISER_LIBS="-ldal -lreiserfs"
+ AC_DEFINE(HAVE_LIBREISERFS, 1, [Have libreiserfs])
+ )
+ AC_CHECK_LIB(reiserfs, reiserfs_fs_check,
+ AC_DEFINE(HAVE_REISERFS_FS_CHECK, 1, [Have reiserfs_fs_check()])
+ )
+ )
+ LIBS="$OLD_LIBS"
+fi
+AC_SUBST(REISER_LIBS)
+
+dnl Check for termcap
+if test "$with_readline" = yes; then
+ OLD_LIBS="$LIBS"
+ LIBS=""
+ AC_SEARCH_LIBS(tgetent, ncurses curses termcap termlib,
+ PARTED_LIBS="$PARTED_LIBS $LIBS",
+ AC_MSG_ERROR(
+termcap could not be found which is required for the
+--with-readline option (which is enabled by default). Either disable readline
+support with --without-readline or download and install termcap from:
+ ftp.gnu.org/gnu/termcap
+Note: if you are using precompiled packages you will also need the development
+ package as well (which may be called termcap-devel or something similar).
+Note: (n)curses also seems to work as a substitute for termcap. This was
+ not found either - but you could try installing that as well.
+)
+ exit
+ )
+ LIBS="$OLD_LIBS"
+fi
+
+dnl Check for readline
+if test "$with_readline" = yes; then
+ OLD_LIBS="$LIBS"
+ LIBS="$LIBS $PARTED_LIBS"
+ AC_CHECK_LIB(readline, readline,
+ PARTED_LIBS="-lreadline $PARTED_LIBS"
+ AC_DEFINE(HAVE_LIBREADLINE, 1, [have readline]),
+ AC_MSG_ERROR(
+GNU Readline could not be found which is required for the
+--with-readline (which is enabled by default). Either disable readline support with
+--without-readline or downloaded and install it from:
+ ftp.gnu.org/gnu/readline
+Note: if you are using precompiled packages you will also need the development
+package as well (which may be called readline-devel or something similar).
+)
+ exit,
+ $PARTED_LIBS
+ )
+ LIBS="$OLD_LIBS"
+fi
+
+AC_SUBST(PARTED_LIBS)
+
+dnl Check for OS specific libraries
+
+dnl GNU/Hurd:
+if test "$OS" = gnu; then
+ CFLAGS="$CFLAGS -D_GNU_SOURCE=1"
+
+dnl libshouldbeinlibc
+ AC_CHECK_LIB(shouldbeinlibc, vm_deallocate,
+ OS_LIBS="$OS_LIBS -lshouldbeinlibc",
+ AC_MSG_ERROR(
+GNU Parted requires libshouldbeinlibc when running on
+GNU/Hurd systems. It is a standard part of a GNU/Hurd system.
+ )
+ exit
+ )
+
+dnl libstore may depend on libparted being present.
+dnl Aren't circular dependencies wonderful?
+ OLD_LIBS="$LIBS"
+ LIBS=
+
+ AC_CHECK_LIB(parted, ped_device_read)
+
+dnl libstore
+ AC_CHECK_LIB(store, store_open,
+ OS_LIBS="$OS_LIBS -lstore",
+ AC_MSG_ERROR(
+GNU Parted requires libstore when running on GNU/Hurd
+systems. It is a standard part of a GNU/Hurd system.
+ )
+ exit,
+ $OS_LIBS $UUID_LIBS $LIBS
+ )
+ LIBS="$OLD_LIBS"
+fi
+
+dnl BeOS/ZETA/Haiku:
+
+if test "$OS" = beos; then
+ dnl Include the socket library, as it is a depedency of libuuid
+ dnl and so also of us (due to socket() call in libuuid)
+ OS_LIBS="$OS_LIBS -lsocket"
+fi
+
+AC_SUBST(OS_LIBS)
+
+dnl One day, gettext might support libtool...
+dnl if test "$USE_INCLUDED_LIBINTL" = "yes"; then
+dnl INTLINCS='-I$(top_srcdir)/intl'
+dnl fi
+AC_SUBST(INTLINCS)
+
+
+dnl Checks for header files.
+AC_CHECK_HEADER(uuid/uuid.h, ,
+ AC_MSG_ERROR(
+GNU Parted requires libuuid - a part of the e2fsprogs package.
+You seem to have the library installed but not the headers. These are usually
+found in a corresponding development package (usually called e2fsprogs-devel).
+If you can't find one try:
+ http://web.mit.edu/tytso/www/linux/e2fsprogs.html
+)
+ exit
+)
+
+AC_CHECK_HEADERS(getopt.h)
+
+dnl required for libparted/llseek.c (TODO: make linux-x86 only)
+if test "$OS" = linux; then
+ AC_CHECK_HEADER(linux/unistd.h)
+fi
+
+if test "$with_readline" = yes; then
+ AC_CHECK_HEADERS(readline/readline.h readline/history.h, ,
+ AC_MSG_ERROR(
+The headers for GNU Readline could not be found which
+are required for the --with-readline option. You seem to have the GNU readline
+library installed but not the headers. These are usually found in a
+corresponding development package (usually called readline-devel). If you can't
+find one try:
+ ftp.gnu.org/gnu/readline
+Alternatively you can disable readline support with --without-readline
+)
+ exit
+ )
+fi
+
+AC_CHECK_HEADERS(termcap.h)
+
+if test "$USE_NLS" = yes; then
+ AC_CHECK_HEADERS(wctype.h, ,
+ AC_MSG_ERROR(
+One or more of the header files that are required for
+native language support (wctype.h) could not be found. Either get a newer
+version of GNU libc and its headers - which can be obtained from:
+ ftp.gnu.org/gnu/glibc
+Or disable native language support with the --disable-nls option
+)
+ exit
+ )
+fi
+
+dnl Checks for typedefs, structures and compiler characteristics.
+AC_PROG_LD
+
+AC_C_BIGENDIAN
+AC_C_INLINE
+AC_C_CONST
+AC_C_RESTRICT
+
+
+dnl Checks for library functions.
+AC_CHECK_FUNCS(sigaction)
+AC_CHECK_FUNCS(getuid)
+
+if test "$with_readline" = yes; then
+ OLD_LIBS="$LIBS"
+ LIBS="$LIBS $PARTED_LIBS -lreadline"
+ AC_CHECK_FUNCS(rl_completion_matches)
+ LIBS="$OLD_LIBS"
+fi
+
+OLD_CFLAGS="$CFLAGS"
+CFLAGS=-D_GNU_SOURCE=1
+AC_CHECK_FUNCS(canonicalize_file_name)
+CFLAGS="$OLD_CFLAGS"
+
+CFLAGS="$CFLAGS -W -Wall -Wno-unused -Wno-switch -Wno-format"
+
+if test "$enable_Werror" = yes; then
+ CFLAGS="$CFLAGS -Werror"
+fi
+
+DATE=$(date '+%d %b %Y %H:%M')
+USER=$(whoami)
+HOST=$(hostname)
+BUILDINFO="$USER@$HOST, $DATE"
+AC_SUBST(BUILDINFO)
+
+AC_OUTPUT([
+Makefile
+include/Makefile
+include/parted/Makefile
+libparted/Makefile
+libparted/labels/Makefile
+libparted/fs/Makefile
+libparted/fs/amiga/Makefile
+libparted/fs/ext2/Makefile
+libparted/fs/fat/Makefile
+libparted/fs/hfs/Makefile
+libparted/fs/jfs/Makefile
+libparted/fs/linux_swap/Makefile
+libparted/fs/ntfs/Makefile
+libparted/fs/reiserfs/Makefile
+libparted/fs/ufs/Makefile
+libparted/fs/xfs/Makefile
+parted/Makefile
+partprobe/Makefile
+doc/Makefile
+doc/C/Makefile
+doc/pt_BR/Makefile
+debug/Makefile
+debug/clearfat/Makefile
+debug/test/Makefile
+po/Makefile.in
+parted.spec
+])
+
+echo
+echo Type \'make\' to compile parted.
diff --git a/debug/Makefile.am b/debug/Makefile.am
new file mode 100644
index 0000000..802198d
--- /dev/null
+++ b/debug/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = clearfat test
diff --git a/debug/clearfat/Makefile.am b/debug/clearfat/Makefile.am
new file mode 100644
index 0000000..76b16c2
--- /dev/null
+++ b/debug/clearfat/Makefile.am
@@ -0,0 +1,12 @@
+noinst_PROGRAMS = clearfat
+
+clearfat_SOURCES = clearfat.c
+
+clearfat_LDADD = @LIBS@ @PARTED_LIBS@ \
+ $(top_builddir)/libparted/libparted.la
+
+
+partedincludedir = -I$(top_srcdir)/include
+
+INCLUDES = $(partedincludedir) @INTLINCS@
+
diff --git a/debug/clearfat/clearfat.c b/debug/clearfat/clearfat.c
new file mode 100644
index 0000000..6cda308
--- /dev/null
+++ b/debug/clearfat/clearfat.c
@@ -0,0 +1,283 @@
+/*
+ clear_fat - a tool to clear unused space (for testing purposes)
+ Copyright (C) 2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#include "config.h"
+
+#include <string.h>
+#include <stdio.h>
+
+#ifndef DISCOVER_ONLY
+
+#include "../../libparted/fs/fat/fat.h"
+
+static char* help_msg =
+"Usage: clearfat DEVICE MINOR\n"
+"\n"
+"This program is used to enhance the automated testing. It is not useful for\n"
+"anything much else.\n";
+
+#define CLEAR_BUFFER_SIZE (1024 * 1024)
+#define CLEAR_BUFFER_SECTORS (CLEAR_BUFFER_SIZE/512)
+
+static char buffer [CLEAR_BUFFER_SIZE];
+
+static int
+_do_help ()
+{
+ printf (help_msg);
+ exit (1);
+}
+
+/* generic clearing code ***************************************************/
+
+static int
+_clear_sectors (PedGeometry* geom, PedSector start, PedSector count)
+{
+ PedSector pos;
+ PedSector to_go = count;
+
+ for (pos = start;
+ pos < start + count;
+ pos += CLEAR_BUFFER_SECTORS, to_go -= CLEAR_BUFFER_SECTORS) {
+ if (!ped_geometry_write (geom, buffer, start,
+ PED_MIN (CLEAR_BUFFER_SECTORS, to_go)))
+ return 0;
+ }
+
+ return 1;
+}
+
+static int
+_clear_sector_range (PedGeometry* geom, PedSector start, PedSector end)
+{
+ return _clear_sectors (geom, start, end - start + 1);
+}
+
+static int
+_clear_sector (PedGeometry* geom, PedSector sector)
+{
+ return _clear_sectors (geom, sector, 1);
+}
+
+static int
+_clear_partial_sector (PedGeometry* geom, PedSector sector,
+ int offset, int count)
+{
+ if (!ped_geometry_read (geom, buffer, sector, 1))
+ goto error;
+ memset (buffer + offset, 0, count);
+ if (!ped_geometry_write (geom, buffer, sector, 1))
+ goto error;
+
+ memset (buffer, 0, 512);
+ return 1;
+
+error:
+ memset (buffer, 0, 512);
+ return 0;
+}
+
+static int
+_clear_partial_range (PedGeometry* geom, PedSector sector, int start, int end)
+{
+ return _clear_partial_sector (geom, sector, start, end - start + 1);
+}
+
+static int
+_clear_clusters (PedFileSystem* fs, FatCluster start, FatCluster count)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ return _clear_sectors (fs->geom, fat_cluster_to_sector(fs, start),
+ count * fs_info->cluster_sectors);
+}
+
+/* FAT code ******************************************************************/
+
+static void
+_clear_before_fat (PedFileSystem* fs)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ PedSector sector;
+
+ for (sector = 1; sector < fs_info->fat_offset; sector++) {
+ if (sector == fs_info->info_sector_offset)
+ continue;
+ if (sector == fs_info->boot_sector_backup_offset)
+ continue;
+ _clear_sector (fs->geom, sector);
+ }
+}
+
+static int
+_calc_fat_entry_offset (PedFileSystem* fs, FatCluster cluster)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+
+ switch (fs_info->fat_type) {
+ case FAT_TYPE_FAT16:
+ return cluster * 2;
+
+ case FAT_TYPE_FAT32:
+ return cluster * 4;
+ }
+ return 0;
+}
+
+static void
+_clear_unused_fats (PedFileSystem* fs)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ PedSector table_start;
+ int table_num;
+ int last_active_offset;
+ PedSector last_active_sector;
+ int last_active_sector_offset;
+
+ last_active_offset
+ = _calc_fat_entry_offset (fs, fs_info->fat->cluster_count);
+ last_active_sector = last_active_offset / 512;
+ last_active_sector_offset = last_active_offset % 512 + 4;
+
+ for (table_num = 0; table_num < fs_info->fat_table_count; table_num++) {
+ table_start = fs_info->fat_offset
+ + table_num * fs_info->fat_sectors;
+
+ if (last_active_sector_offset < 512) {
+ _clear_partial_range (
+ fs->geom,
+ table_start + last_active_sector,
+ last_active_sector_offset,
+ 512);
+ }
+
+ if (last_active_sector < fs_info->fat_sectors - 2) {
+ _clear_sector_range (
+ fs->geom,
+ table_start + last_active_sector + 1,
+ table_start + fs_info->fat_sectors - 1);
+ }
+ }
+}
+
+static int
+_clear_unused_clusters (PedFileSystem* fs)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ FatCluster cluster;
+ FatCluster run_start = 0; /* shut gcc up! */
+ FatCluster run_length = 0;
+
+ for (cluster = 2; cluster < fs_info->cluster_count + 2; cluster++) {
+ if (fat_table_is_available (fs_info->fat, cluster)) {
+ if (!run_length) {
+ run_start = cluster;
+ run_length = 1;
+ } else {
+ run_length++;
+ }
+ } else {
+ if (run_length)
+ _clear_clusters (fs, run_start, run_length);
+ run_length = 0;
+ }
+ }
+
+ if (run_length)
+ _clear_clusters (fs, run_start, run_length);
+
+ return 1;
+}
+
+static void
+_clear_unused_fat (PedFileSystem* fs)
+{
+ memset (buffer, 0, CLEAR_BUFFER_SIZE);
+
+ _clear_before_fat (fs);
+ _clear_unused_fats (fs);
+ _clear_unused_clusters (fs);
+}
+
+/* bureaucracy ***************************************************************/
+
+int
+main (int argc, char* argv[])
+{
+ PedDevice* dev;
+ PedDisk* disk;
+ PedPartition* part;
+ PedFileSystem* fs;
+
+ if (argc < 3)
+ _do_help ();
+
+ dev = ped_device_get (argv [1]);
+ if (!dev)
+ goto error;
+ if (!ped_device_open (dev))
+ goto error;
+
+ disk = ped_disk_new (dev);
+ if (!disk)
+ goto error_close_dev;
+
+ part = ped_disk_get_partition (disk, atoi (argv[2]));
+ if (!part) {
+ printf ("Couldn't find partition `%s'\n", argv[2]);
+ goto error_destroy_disk;
+ }
+
+ fs = ped_file_system_open (&part->geom);
+ if (!fs)
+ goto error_destroy_disk;
+
+ if (strncmp (fs->type->name, "fat", 3)) {
+ printf ("Not a FAT file system!\n");
+ goto error_close_fs;
+ }
+
+ _clear_unused_fat (fs);
+
+ ped_file_system_close (fs);
+ ped_disk_destroy (disk);
+ ped_device_close (dev);
+ return 0;
+
+error_close_fs:
+ ped_file_system_close (fs);
+error_destroy_disk:
+ ped_disk_destroy (disk);
+error_close_dev:
+ ped_device_close (dev);
+error:
+ return 1;
+}
+
+#else /* DISCOVER_ONLY */
+
+/* hack! */
+int
+main()
+{
+ printf ("You must compile libparted with full read/write support\n");
+ return 1;
+}
+
+#endif /* DISCOVER_ONLY */
+
diff --git a/debug/test/HOWTO b/debug/test/HOWTO
new file mode 100644
index 0000000..74ff2e2
--- /dev/null
+++ b/debug/test/HOWTO
@@ -0,0 +1,241 @@
+==============================================================================
+ PARTED REGRESSION TEST HOWTO
+==============================================================================
+
+ by Andrew Clausen
+
+ Copyright (C) 2002 Free Software Foundation, Inc.
+ This document may be distributed and/or modified
+ without restriction
+
+
+CONTENTS
+--------
+
+1 Introduction
+2 What you need
+3 Setting up testrc
+4 Running the tests
+
+5 How the tests work
+
+
+------------------------------------------------------------------------------
+1 INTRODUCTION
+------------------------------------------------------------------------------
+
+This document describes how to safely configure and run the GNU Parted
+regression tests.
+
+Regression tests are a set of "test cases" (or program inputs, whatever),
+that have a well defined "correct" and "broken". The idea is to run
+regression tests after making changes, to check you didn't break anything.
+They are also useful for testing Parted in a new environment... perhaps
+you're computer has something peculiar that breaks it.
+
+Therefore, it's helpful for you to run Parted regression tests.
+
+
+------------------------------------------------------------------------------
+2 WHAT YOU NEED
+------------------------------------------------------------------------------
+
+You need:
+ * a spare hard drive (for GNU/Linux... haven't tried GNU/Hurd)
+ This is because only gendisk block devices can have partition tables.
+ * msdos partition table support in the kernel (for Linux). (FIXME: can
+ use our shiny new partprobe!)
+ * file system support for ext2 and fat
+ * a reasonably standard GNU system, with diff(1), bash(1), e2fsck(8),
+ dosfsck(8), etc.
+ * parted, compiled in it's source directory. i.e. ./configure && make
+ * a test data source, between 100 and 150 Mb, that contains all
+ lower-case filenames, and no symlinks. It must have a significant
+ (i.e. at least 5%) amount of data in a subdirectory.
+ You can convert filenames to lowercase with:
+
+ cd /data-source
+ echo 'mv $1 $( echo $1 | tr A-Z a-z )' > tolower
+ chmod a+x tolower
+ find | grep [A-Z] | xargs -l1 ./tolower
+ rm tolower
+
+ (Hint: if you don't trust me, stick an "echo" before mv, and
+ it'll print out what it's going to do ;)
+
+
+------------------------------------------------------------------------------
+3 SETTING UP TESTRC
+------------------------------------------------------------------------------
+
+The testrc must be configured for your system. The tests will refuse
+to run if you don't. I'll work from top-to-bottom, describing how
+to fill in each value:
+
+
+3.1 TEST_HOST
+-----------------
+This field must match the output of hostname(1). This is just a safety
+check, so you don't use the wrong testrc file, and destroy the wrong
+data ;)
+
+Example:
+ TEST_HOST=mirkwood
+
+3.2 TEST_PARTED_BASE
+------------------------
+This is the directory where you untarred and compiled parted:
+
+Example:
+ TEST_PARTED_BASE=~clausen/parted-1.4.20
+
+3.3 TEST_PARTED_COMMAND
+---------------------------
+You shouldn't need to change this. It's just where to find parted.
+
+Example:
+ TEST_PARTED_COMMAND=$TEST_PARTED_BASE/parted/parted
+
+3.4 TEST_PARTED_CLEARFAT
+----------------------------
+You shouldn't need to change this. It's just where to find clearfat,
+a special tool to help test Parted's fat code. All it does is zero
+out unused (meta)data. (There were cases in the past where stale
+metadata was making it appear that parted was working, when it wasn't)
+
+Example:
+ TEST_PARTED_CLEARFAT=$TEST_PARTED_BASE/debug/clearfat/clearfat
+
+3.5 TEST_DRIVE
+------------------
+The drive to be completely clobbered! i.e. where testing will occur.
+Needless to say, I hope you don't have anything important there.
+Example:
+
+Example:
+ TEST_DRIVE=/dev/hdc
+
+3.6 TEST_DRIVE
+------------------
+The size of the disk, in megabytes, excluding the fractional part (decimal
+point). You can get this from Parted's print output. (Geometry of
+/dev/hdc is 0.0-*THIS IS IT*).
+
+Example:
+ TEST_DRIVE_SIZE=8063
+
+3.7 TEST_MOUNT_POINT
+------------------------
+A mount point that the tests can use, to mount $TEST_DRIVE. Obviously, you
+need to create it with mkdir(1).
+
+Example:
+ TEST_MOUNT_POINT=/mnt/test
+
+3.8 TEST_DATA
+-----------------
+Where to get test data from. See advice in section 2 for requirements
+on the test data.
+
+Example:
+ TEST_DATA=/var/www
+
+3.9 TEST_DATA_HOLE
+----------------------
+A directory inside $TEST_DATA, that will be deleted to create some
+fragmentation. It should be at least 5% and at most 80% of the
+test data.
+
+Example:
+ TEST_DATA_HOLE=icons
+
+3.10 TEST_FS_USE_DISK_LABEL
+------------------------------
+Which disk label to use for testing file systems. At the moment, only
+msdos is supported/tested, although most should work.
+
+Example:
+ TEST_FS_USE_DISK_LABEL=msdos
+
+3.11 QUIET_KERNEL
+--------------------
+Set to 1 if you want to shut up the kernel's annoying messages
+
+Example:
+ QUIET_KERNEL=1
+
+3.12 VERBOSE_LOGS
+--------------------
+Set to 1 if you want logging of everything, including successful tests.
+
+Example:
+ VERBOSE_LOGS=1
+
+3.13 MALLOC_TRACE
+--------------------
+Uncomment this if you want to do malloc() debugging with mtrace.
+TODO: document this.
+
+
+------------------------------------------------------------------------------
+4 RUNNING THE TESTS
+------------------------------------------------------------------------------
+
+4.1 Starting the tests
+--------------------------
+To run the tests, you must be root. To run all tests, type:
+
+ ./test
+
+To run a subset of tests, you can type part of the file name of
+those tests. For example, to run all partition table tests, type:
+
+ ./test disk
+
+Or the FAT tests:
+
+ ./test fat
+
+4.2 Stopping the tests
+--------------------------
+If you want to interrupt the tests, the easiest way is:
+
+ (1) hit ctrl-z on the controlling virtual console / terminal
+ (2) run "ps", with no arguments
+ (3) run "kill -9 [PID]", where [PID] is the process id of
+ "test"
+
+4.3 Examining the logs
+--------------------------
+In progress logs are written to test_out. After each test completes,
+it's output (from test_out), among other things is appended to test_log
+
+To check if any tests failed, type:
+
+ grep failed test_log > /dev/null && echo FAILED || echo PASSED
+
+If some tests failed, check the logs to see what the problem is. You
+may have set up the regression tests incorrectly.
+
+4.4 Sending bug reports
+---------------------------
+If you think it's a bug (or you're not sure), email us!
+
+ bug-parted@gnu.org
+
+Please attach the test_log. Gzip it first ;)
+
+
+------------------------------------------------------------------------------
+5 HOW THE TESTS WORK
+------------------------------------------------------------------------------
+
+Parted has regression tests for all partition table formats, and for
+the ext2, fat and linuxswap. The partition table tests are mainly
+"Create problem X and test that parted complains about it". It
+doesn't compare output... only if parted reports error, and that it
+doesn't segfault.
+ The file system tests are mainly "do some operation on the
+file system, and check it's still got the same data", via diff(1).
+Also, it runs dosfsck(1) and e2fsck(1).
+
diff --git a/debug/test/Makefile.am b/debug/test/Makefile.am
new file mode 100644
index 0000000..4e81e22
--- /dev/null
+++ b/debug/test/Makefile.am
@@ -0,0 +1,18 @@
+noinst_SCRIPTS = test \
+ test_disk_bsd \
+ test_disk_dos \
+ test_disk_dvh \
+ test_disk_gpt \
+ test_disk_pc98 \
+ test_disk_mac \
+ test_disk_sun \
+ test_fs_ext2 \
+ test_fs_fat \
+ test_fs_linux_swap \
+ test_fs_reiserfs \
+ build_leak_list
+
+EXTRA_DIST = HOWTO testrc $(noinst_SCRIPTS)
+
+CLEANFILES = test_log test_out
+
diff --git a/debug/test/build_leak_list b/debug/test/build_leak_list
new file mode 100755
index 0000000..f217eff
--- /dev/null
+++ b/debug/test/build_leak_list
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+if test "x$TEST_PARTED_BASE" = "x"; then
+ TEST_PARTED_BASE=~parted/parted-dev
+fi
+
+mtrace $TEST_PARTED_BASE/parted/.libs/parted $MALLOC_TRACE \
+ | grep libparted \
+ | sed 's/ at.*//' \
+ | sed 's/^\(0x[0-9a-f]\+\) \+\(0x[0-9a-f]\+\) */ {\1, \2},/' \
+ | less
+
diff --git a/debug/test/test b/debug/test/test
new file mode 100755
index 0000000..941d252
--- /dev/null
+++ b/debug/test/test
@@ -0,0 +1,262 @@
+#! /bin/bash
+
+do_help()
+{
+ echo You need to fill out the testrc with your machine\'s details before
+ echo using this script.
+ exit;
+}
+
+do_test()
+{
+ test_prog=$1
+ test_name=`echo -n $test_prog | sed "s/test_//" | sed "s/_/ /" \
+ | tr '[:lower:]' '[:upper:]'`
+
+ echo "-----------------------------------------------------------------"
+ echo "TESTING $test_name..."
+ echo "-----------------------------------------------------------------"
+
+ echo "-----------------------------------------------------------------"\
+ >> test_log
+ echo "TESTING $test_name..." >> test_log
+ echo "-----------------------------------------------------------------"\
+ >> test_log
+
+ if [ -e core* ]; then
+ rm core*
+ fi
+ ./$test_prog
+ if [ -e test_out ]; then
+ echo > test_out
+ fi
+}
+
+do_tests()
+{
+ for walk in $TEST_LIST; do
+ if [ -x $walk ]; then
+ do_test $walk
+ fi
+ done
+}
+
+################################################
+# GLOBAL HELPER FUNCTIONS
+################################################
+
+ped_testing()
+{
+ echo -n "testing $1... "
+ echo -n "testing $1... " >> test_log
+}
+
+ped_testing_expect_fail()
+{
+ echo -n "testing for failure on $1... "
+ echo -n "testing for failure on $1... " >> test_log
+}
+
+ped_test_ok()
+{
+ echo "ok"
+ echo "ok" >> test_log
+
+ if [ "x$VERBOSE_LOGS" = "x1" ]; then
+ cat test_out >> test_log
+ echo >> test_log
+ fi
+
+ export OK_COUNT=$[ $OK_COUNT + 1 ]
+}
+
+ped_test_failed()
+{
+ echo "failed"
+ echo "failed" >> test_log
+
+ cat test_out >> test_log
+ echo >> test_log
+
+ export FAILED_COUNT=$[ $FAILED_COUNT + 1 ]
+
+ if [ -e core ]; then
+ echo core dumped, saving to core-$CORE_COUNTER\
+ >> test_log
+ echo >> test_log
+ mv core core-$CORE_COUNTER
+ export CORE_COUNTER=$[ $CORE_COUNTER + 1 ]
+ fi
+}
+
+check_leaks()
+{
+ if test "x$MALLOC_TRACE" != "x"; then
+ ./build_leak_list > leaks
+ if test -s leaks; then
+ printf \
+'Found memory leaks: (add this list to dodgey_malloc_list in\n'\
+'libparted/libparted.c to debug them)\n' \
+ >> test_out
+ cat leaks >> test_out
+ return 0
+ fi
+ rm leaks
+ fi
+
+ return 1
+}
+
+ped_test_get_val()
+{
+ post_command=$2
+ if test "x$input" = "x"; then
+ input="Cancel"
+ fi
+ if test "x$post_command" = "x"; then
+ post_command="true"
+ fi
+
+ if test -e leaks; then
+ rm leaks
+ fi
+ if test "x$MALLOC_TRACE" != "x"; then
+ if test -e $MALLOC_TRACE; then
+ rm $MALLOC_TRACE
+ fi
+ fi
+
+ if $TEST_PARTED_COMMAND -s $TEST_DRIVE $1 2>&1 > test_out; then
+ if [ -e core ]; then
+ return 0
+ fi
+
+ if check_leaks; then
+ return 0
+ fi
+
+ if ( echo >> test_out ; ( eval $post_command ) 2>&1 >> test_out ); then
+ return 1
+ else
+ return 0
+ fi
+ else
+ return 0
+ fi
+}
+
+ped_test()
+{
+ ped_testing "$1"
+ if ped_test_get_val "$2" "$3"; then
+ ped_test_failed
+ return 1
+ else
+ ped_test_ok
+ return 0
+ fi
+}
+
+ped_test_expect_fail()
+{
+ ped_testing_expect_fail "$1"
+ if ped_test_get_val "$2" "$3"; then
+
+ # we expect a CLEAN fail :-)
+ if [ -e core ]; then
+ ped_test_failed
+ return 1
+ fi
+ if check_leaks; then
+ ped_test_failed
+ return 1
+ fi
+
+ ped_test_ok
+ return 0
+ else
+ ped_test_failed
+ return 1
+ fi
+}
+
+################################################
+# the rest...
+################################################
+
+init_environment()
+{
+ if [ "x$UID" != "x0" ]; then
+ echo Warning: you should probably be running this as root.
+ echo
+ fi
+
+ . testrc
+ `cat testrc | grep "^[^#].*=" | sed "s/=.*//" | sed "s/^/export /" `
+
+ if [ "x$HOSTNAME" != "x$TEST_HOST" ]; then
+ do_help
+ fi
+
+ export OLD_KERNEL_PRINTK=`cat /proc/sys/kernel/printk`
+
+ if [ "x$QUIET_KERNEL" = "x1" ]; then
+ echo 1 1 1 1 > /proc/sys/kernel/printk
+ fi
+
+ renice 20 $$ > /dev/null
+
+ export CORE_COUNTER=1
+ export OK_COUNT=0
+ export FAILED_COUNT=0
+
+ export -f ped_testing
+ export -f ped_testing_expect_fail
+ export -f ped_test_ok
+ export -f ped_test_failed
+ export -f ped_test_get_val
+ export -f ped_test
+ export -f ped_test_expect_fail
+ export -f check_leaks
+}
+
+done_environment()
+{
+ echo $OLD_KERNEL_PRINTK > /proc/sys/kernel/printk
+}
+
+open_log()
+{
+ if [ -e test_log ]; then
+ echo -n > test_log;
+ fi
+}
+
+print_version()
+{
+ echo -n "Testing "
+ $TEST_PARTED_COMMAND --version
+ echo
+
+ echo -n "Testing " >> test_log
+ $TEST_PARTED_COMMAND --version >> test_log
+ echo >> test_log
+}
+
+main()
+{
+ init_environment
+ open_log
+ print_version
+ do_tests
+ done_environment
+}
+
+if [ "x$1" != "x" ]; then
+ export TEST_LIST="test_*$1*"
+else
+ export TEST_LIST="test_*"
+fi
+
+main
+
diff --git a/debug/test/test_disk_bsd b/debug/test/test_disk_bsd
new file mode 100755
index 0000000..3bcf0f0
--- /dev/null
+++ b/debug/test/test_disk_bsd
@@ -0,0 +1,94 @@
+#! /bin/bash
+
+test_mklabel()
+{
+ ped_test "mklabel" "mklabel bsd"
+}
+
+test_mkpart()
+{
+ ped_test "mkpart" "mklabel bsd mkpart primary ext2 10 20"
+}
+
+test_mkpartfs()
+{
+ ped_test "mkpartfs" "mklabel bsd mkpartfs primary ext2 10 20"
+}
+
+test_rm()
+{
+ ped_test "rm" "mklabel bsd mkpart primary ext2 10 20 rm 1"
+}
+
+test_too_many_primary()
+{
+ ped_test_expect_fail "too many primary partitions" \
+ "mklabel bsd \
+ mkpart primary ext2 10 20 \
+ mkpart primary ext2 20 30 \
+ mkpart primary ext2 30 40 \
+ mkpart primary ext2 40 50 \
+ mkpart primary ext2 50 60 \
+ mkpart primary ext2 60 70 \
+ mkpart primary ext2 70 80 \
+ mkpart primary ext2 80 90 \
+ mkpart primary ext2 90 100"
+}
+
+test_primary_overlap()
+{
+ ped_test "correction of partition overlapping"\
+ "mklabel bsd \
+ mkpart primary ext2 0 100\
+ mkpart primary ext2 50 150"
+}
+
+test_nonexistent_remove()
+{
+ ped_test_expect_fail "removal of non-existent partition"\
+ "mklabel bsd \
+ rm 1"
+}
+
+test_create_extended()
+{
+ ped_test_expect_fail "creation of extended partition"\
+ "mklabel bsd \
+ mkpart extended 0 100"
+}
+
+test_create_small()
+{
+ ped_test "create small partition"\
+ "mklabel bsd \
+ mkpartfs primary ext2 1 2"
+}
+
+test_move()
+{
+ ped_test "move partition"\
+ "mklabel bsd \
+ mkpartfs primary ext2 0 100 \
+ mkpartfs primary ext2 101 200 \
+ move 1 201 301"
+}
+
+main()
+{
+ if ! test_mklabel; then
+ exit 1
+ fi
+
+ test_mkpart
+ test_mkpartfs
+ test_rm
+ test_too_many_primary
+ test_primary_overlap
+ test_nonexistent_remove
+ test_create_extended
+ test_create_small
+ test_move
+}
+
+main
+
diff --git a/debug/test/test_disk_dos b/debug/test/test_disk_dos
new file mode 100755
index 0000000..08c5d7f
--- /dev/null
+++ b/debug/test/test_disk_dos
@@ -0,0 +1,173 @@
+#! /bin/bash
+
+test_mklabel()
+{
+ ped_test "mklabel" "mklabel msdos"
+}
+
+test_mkpart()
+{
+ ped_test "mkpart" "mklabel msdos mkpart primary ext2 10 20"
+}
+
+test_create_extended_at_start()
+{
+ ped_test "creating an extended partition at the start of the disk"\
+ "mklabel msdos \
+ mkpart extended 0 500"
+}
+
+
+test_mkpartfs()
+{
+ ped_test "mkpartfs" "mklabel msdos mkpartfs primary ext2 10 20"
+}
+
+test_rm()
+{
+ ped_test "rm" "mklabel msdos mkpart primary ext2 10 20 rm 1"
+}
+
+test_too_many_primary()
+{
+ ped_test_expect_fail "too many primary partitions" \
+ "mklabel msdos \
+ mkpart primary ext2 10 20 \
+ mkpart primary ext2 20 30 \
+ mkpart primary ext2 30 40 \
+ mkpart primary ext2 40 50 \
+ mkpart primary ext2 50 60"
+}
+
+test_logical_without_extended()
+{
+ ped_test_expect_fail "logical partitions without extended partition"\
+ "mklabel msdos \
+ mkpart logical ext2 10 20"
+}
+
+# Parted's constraint solver "corrects" this. Hmmm... is this wise?
+test_logical_outside_extended()
+{
+ ped_test "correction of logical partitions outside extended partition"\
+ "mklabel msdos \
+ mkpart extended 50 100\
+ mkpart logical ext2 90 150"
+}
+
+test_shrink_extended_too_far()
+{
+ ped_test "correction of excessive extended partition shrink"\
+ "mklabel msdos \
+ mkpart extended 50 150\
+ mkpart logical ext2 90 110\
+ resize 1 50 100"
+}
+
+test_shrink_extended()
+{
+ ped_test "extended partition shrink"\
+ "mklabel msdos \
+ mkpart extended 50 150\
+ mkpart logical ext2 90 110\
+ resize 1 80 110"
+}
+
+test_many_logical()
+{
+ ped_test "many logical partitions"\
+ "mklabel msdos \
+ mkpart extended 100 1000 \
+ mkpart logical ext2 100 200 \
+ mkpart logical ext2 200 300 \
+ mkpart logical ext2 300 400 \
+ mkpart logical ext2 400 500 \
+ mkpart logical ext2 500 600 \
+ mkpart logical ext2 600 700 \
+ mkpart logical ext2 700 800"
+}
+
+test_primary_overlap()
+{
+ ped_test "correction of primary partition overlapping"\
+ "mklabel msdos \
+ mkpart primary ext2 0 100\
+ mkpart primary ext2 50 150"
+}
+
+test_extended_primary_overlap()
+{
+ ped_test "correction of primary with extended partition overlapping"\
+ "mklabel msdos \
+ mkpart extended 1 100\
+ mkpart primary ext2 50 150"
+}
+
+test_nonexistent_remove()
+{
+ ped_test_expect_fail "removal of non-existent partition"\
+ "mklabel msdos \
+ rm 1"
+}
+
+test_create_small()
+{
+ ped_test "create small partition"\
+ "mklabel msdos \
+ mkpartfs primary ext2 1 2"
+}
+
+test_move_primary()
+{
+ ped_test "move primary partition"\
+ "mklabel msdos \
+ mkpartfs primary fat16 0 100 \
+ mkpartfs primary fat16 100 200 \
+ move 1 200 300"
+}
+
+test_move_logical()
+{
+ ped_test "move logical partition"\
+ "mklabel msdos \
+ mkpart extended 0 500
+ mkpartfs logical fat16 0 100 \
+ mkpartfs logical fat16 100 200 \
+ move 5 200 300"
+}
+
+test_create_end()
+{
+ ped_test "create partition at end-of-disk"\
+ "mklabel msdos \
+ mkpartfs primary ext2 \
+ $[TEST_DRIVE_SIZE - 10] $[TEST_DRIVE_SIZE]"
+}
+
+main()
+{
+ if ! test_mklabel; then
+ exit 1
+ fi
+
+ test_mkpart
+ test_create_extended_at_start
+ test_mkpartfs
+ test_rm
+ test_too_many_primary
+ test_logical_without_extended
+ test_logical_outside_extended
+ test_shrink_extended_too_far
+ test_shrink_extended
+ test_many_logical
+ test_primary_overlap
+ test_extended_primary_overlap
+ test_nonexistent_remove
+ test_create_small
+ test_move_primary
+ test_move_logical
+ test_create_end
+}
+
+main
+
diff --git a/debug/test/test_disk_dvh b/debug/test/test_disk_dvh
new file mode 100755
index 0000000..29caf1f
--- /dev/null
+++ b/debug/test/test_disk_dvh
@@ -0,0 +1,94 @@
+#! /bin/bash
+
+test_mklabel()
+{
+ ped_test "mklabel" "mklabel mips"
+}
+
+test_mkpart()
+{
+ ped_test "mkpart" "mklabel mips mkpart primary ext2 11 20"
+}
+
+test_mkpartfs()
+{
+ ped_test "mkpartfs" "mklabel mips mkpartfs primary ext2 11 20"
+}
+
+test_rm()
+{
+ ped_test "rm" "mklabel mips mkpart primary ext2 10 20 rm 2"
+}
+
+test_too_many_primary()
+{
+ ped_test_expect_fail "too many primary partitions" \
+ "mklabel mips \
+ mkpart primary ext2 10 20 \
+ mkpart primary ext2 20 30 \
+ mkpart primary ext2 30 40 \
+ mkpart primary ext2 40 50 \
+ mkpart primary ext2 50 60 \
+ mkpart primary ext2 60 70 \
+ mkpart primary ext2 70 80 \
+ mkpart primary ext2 80 90 \
+ mkpart primary ext2 90 100 \
+ mkpart primary ext2 100 110 \
+ mkpart primary ext2 110 120 \
+ mkpart primary ext2 120 130 \
+ mkpart primary ext2 130 140 \
+ mkpart primary ext2 140 150 \
+ mkpart primary ext2 150 160 \
+ mkpart primary ext2 160 170 \
+ mkpart primary ext2 170 180"
+}
+
+test_primary_overlap()
+{
+ ped_test "correction of primary partition overlapping"\
+ "mklabel mips \
+ mkpart primary ext2 1 100\
+ mkpart primary ext2 50 150"
+}
+
+test_nonexistent_remove()
+{
+ ped_test_expect_fail "removal of non-existent partition"\
+ "mklabel mips \
+ rm 2"
+}
+
+test_create_small()
+{
+ ped_test "create small partition"\
+ "mklabel mips \
+ mkpartfs primary ext2 1 2"
+}
+
+test_move()
+{
+ ped_test "move partition"\
+ "mklabel mips \
+ mkpartfs primary ext2 1 100 \
+ mkpartfs primary ext2 101 200 \
+ move 2 201 301"
+}
+
+main()
+{
+ if ! test_mklabel; then
+ exit 1
+ fi
+
+ test_mkpart
+ test_mkpartfs
+ test_rm
+ test_too_many_primary
+ test_primary_overlap
+ test_nonexistent_remove
+ test_create_small
+ test_move
+}
+
+main
+
diff --git a/debug/test/test_disk_gpt b/debug/test/test_disk_gpt
new file mode 100755
index 0000000..8e86f79
--- /dev/null
+++ b/debug/test/test_disk_gpt
@@ -0,0 +1,78 @@
+#! /bin/bash
+
+test_mklabel()
+{
+ ped_test "mklabel" "mklabel gpt"
+}
+
+test_mkpart()
+{
+ ped_test "mkpart" "mklabel gpt mkpart primary ext2 10 20"
+}
+
+test_mkpartfs()
+{
+ ped_test "mkpartfs" "mklabel gpt mkpartfs primary ext2 10 20"
+}
+
+test_rm()
+{
+ ped_test "rm" "mklabel gpt mkpart primary ext2 10 20 rm 1"
+}
+
+test_primary_overlap()
+{
+ ped_test "correction of primary partition overlapping"\
+ "mklabel gpt \
+ mkpart primary ext2 0 100\
+ mkpart primary ext2 50 150"
+}
+
+test_nonexistent_remove()
+{
+ ped_test_expect_fail "removal of non-existent partition"\
+ "mklabel gpt \
+ rm 1"
+}
+
+test_create_extended()
+{
+ ped_test_expect_fail "creation of extended partition"\
+ "mklabel gpt \
+ mkpart extended 0 100"
+}
+
+test_create_small()
+{
+ ped_test "create small partition"\
+ "mklabel gpt \
+ mkpartfs primary ext2 1 2"
+}
+
+test_move()
+{
+ ped_test "move partition"\
+ "mklabel gpt \
+ mkpartfs primary ext2 0 100 \
+ mkpartfs primary ext2 101 200 \
+ move 1 201 301"
+}
+
+main()
+{
+ if ! test_mklabel; then
+ exit 1
+ fi
+
+ test_mkpart
+ test_mkpartfs
+ test_rm
+ test_primary_overlap
+ test_nonexistent_remove
+ test_create_extended
+ test_create_small
+ test_move
+}
+
+main
+
diff --git a/debug/test/test_disk_mac b/debug/test/test_disk_mac
new file mode 100755
index 0000000..1d0e894
--- /dev/null
+++ b/debug/test/test_disk_mac
@@ -0,0 +1,78 @@
+#! /bin/bash
+
+test_mklabel()
+{
+ ped_test "mklabel" "mklabel mac"
+}
+
+test_mkpart()
+{
+ ped_test "mkpart" "mklabel mac mkpart primary ext2 10 20"
+}
+
+test_mkpartfs()
+{
+ ped_test "mkpartfs" "mklabel mac mkpartfs primary ext2 10 20"
+}
+
+test_rm()
+{
+ ped_test "rm" "mklabel mac mkpart primary ext2 10 20 rm 2"
+}
+
+test_primary_overlap()
+{
+ ped_test "correction of primary partition overlapping"\
+ "mklabel mac \
+ mkpart primary ext2 0.01 100\
+ mkpart primary ext2 50 150"
+}
+
+test_nonexistent_remove()
+{
+ ped_test_expect_fail "removal of non-existent partition"\
+ "mklabel mac \
+ rm 2"
+}
+
+test_create_extended()
+{
+ ped_test_expect_fail "creation of extended partition"\
+ "mklabel mac \
+ mkpart extended 0.01 100"
+}
+
+test_create_small()
+{
+ ped_test "create small partition"\
+ "mklabel mac \
+ mkpartfs primary ext2 1 2"
+}
+
+test_move()
+{
+ ped_test "move partition"\
+ "mklabel mac \
+ mkpartfs primary ext2 1 100 \
+ mkpartfs primary ext2 101 200 \
+ move 2 201 301"
+}
+
+main()
+{
+ if ! test_mklabel; then
+ exit 1
+ fi
+
+ test_mkpart
+ test_mkpartfs
+ test_rm
+ test_primary_overlap
+ test_nonexistent_remove
+ test_create_extended
+ test_create_small
+ test_move
+}
+
+main
+
diff --git a/debug/test/test_disk_pc98 b/debug/test/test_disk_pc98
new file mode 100755
index 0000000..748424e
--- /dev/null
+++ b/debug/test/test_disk_pc98
@@ -0,0 +1,102 @@
+#! /bin/bash
+
+test_mklabel()
+{
+ ped_test "mklabel" "mklabel pc98"
+}
+
+test_mkpart()
+{
+ ped_test "mkpart" "mklabel pc98 mkpart primary ext2 10 20"
+}
+
+test_mkpartfs()
+{
+ ped_test "mkpartfs" "mklabel pc98 mkpartfs primary ext2 10 20"
+}
+
+test_rm()
+{
+ ped_test "rm" "mklabel pc98 mkpart primary ext2 10 20 rm 1"
+}
+
+test_too_many_primary()
+{
+ ped_test_expect_fail "too many primary partitions" \
+ "mklabel pc98 \
+ mkpart primary ext2 10 20 \
+ mkpart primary ext2 20 30 \
+ mkpart primary ext2 30 40 \
+ mkpart primary ext2 40 50 \
+ mkpart primary ext2 50 60 \
+ mkpart primary ext2 60 70 \
+ mkpart primary ext2 70 80 \
+ mkpart primary ext2 80 90 \
+ mkpart primary ext2 90 100 \
+ mkpart primary ext2 100 110 \
+ mkpart primary ext2 110 120 \
+ mkpart primary ext2 120 130 \
+ mkpart primary ext2 130 140 \
+ mkpart primary ext2 140 150 \
+ mkpart primary ext2 150 160 \
+ mkpart primary ext2 160 170 \
+ mkpart primary ext2 170 180 "
+}
+
+test_primary_overlap()
+{
+ ped_test "correction of primary partition overlapping"\
+ "mklabel pc98 \
+ mkpart primary ext2 0 100\
+ mkpart primary ext2 50 150"
+}
+
+test_nonexistent_remove()
+{
+ ped_test_expect_fail "removal of non-existent partition"\
+ "mklabel pc98 \
+ rm 1"
+}
+
+test_create_extended()
+{
+ ped_test_expect_fail "creation of extended partition"\
+ "mklabel pc98 \
+ mkpart extended 0 100"
+}
+
+test_create_small()
+{
+ ped_test "create small partition"\
+ "mklabel pc98 \
+ mkpartfs primary ext2 1 2"
+}
+
+test_move()
+{
+ ped_test "move partition"\
+ "mklabel pc98 \
+ mkpartfs primary fat16 0 100 \
+ mkpartfs primary fat16 100 200 \
+ move 1 200 300"
+}
+
+main()
+{
+ if ! test_mklabel; then
+ exit 1
+ fi
+
+ test_mkpart
+ test_mkpartfs
+ test_rm
+ test_too_many_primary
+ test_primary_overlap
+ test_nonexistent_remove
+ test_create_extended
+ test_create_small
+ test_move
+}
+
+main
+
diff --git a/debug/test/test_disk_sun b/debug/test/test_disk_sun
new file mode 100755
index 0000000..b9d7e29
--- /dev/null
+++ b/debug/test/test_disk_sun
@@ -0,0 +1,94 @@
+#! /bin/bash
+
+test_mklabel()
+{
+ ped_test "mklabel" "mklabel sun"
+}
+
+test_mkpart()
+{
+ ped_test "mkpart" "mklabel sun mkpart primary ext2 10 20"
+}
+
+test_mkpartfs()
+{
+ ped_test "mkpartfs" "mklabel sun mkpartfs primary ext2 10 20"
+}
+
+test_rm()
+{
+ ped_test "rm" "mklabel sun mkpart primary ext2 10 20 rm 1"
+}
+
+test_too_many_primary()
+{
+ ped_test_expect_fail "too many primary partitions" \
+ "mklabel sun \
+ mkpart primary ext2 10 20 \
+ mkpart primary ext2 20 30 \
+ mkpart primary ext2 30 40 \
+ mkpart primary ext2 40 50 \
+ mkpart primary ext2 50 60 \
+ mkpart primary ext2 60 70 \
+ mkpart primary ext2 70 80 \
+ mkpart primary ext2 80 90 \
+ mkpart primary ext2 90 100"
+}
+
+test_primary_overlap()
+{
+ ped_test "correction primary partition overlapping"\
+ "mklabel sun \
+ mkpart primary ext2 0 100\
+ mkpart primary ext2 50 150"
+}
+
+test_nonexistent_remove()
+{
+ ped_test_expect_fail "removal of non-existent partition"\
+ "mklabel sun \
+ rm 1"
+}
+
+test_create_extended()
+{
+ ped_test_expect_fail "creation of extended partition"\
+ "mklabel sun \
+ mkpart extended 0 100"
+}
+
+test_create_small()
+{
+ ped_test "create small partition"\
+ "mklabel sun \
+ mkpartfs primary ext2 1 2"
+}
+
+test_move()
+{
+ ped_test "move partition"\
+ "mklabel sun \
+ mkpartfs primary ext2 0 100 \
+ mkpartfs primary ext2 101 200 \
+ move 1 201 301"
+}
+
+main()
+{
+ if ! test_mklabel; then
+ exit 1
+ fi
+
+ test_mkpart
+ test_mkpartfs
+ test_rm
+ test_too_many_primary
+ test_primary_overlap
+ test_nonexistent_remove
+ test_create_extended
+ test_create_small
+ test_move
+}
+
+main
+
diff --git a/debug/test/test_fs_ext2 b/debug/test/test_fs_ext2
new file mode 100755
index 0000000..9bb9141
--- /dev/null
+++ b/debug/test/test_fs_ext2
@@ -0,0 +1,98 @@
+#! /bin/bash
+
+do_diff()
+{
+ mount "${TEST_DRIVE}1" $TEST_MOUNT_POINT -t ext2 > /dev/null
+
+ if diff -rq $1 $2 --exclude lost+found >> test_log; then
+ ped_test_ok
+ else
+ ped_test_failed
+ fi
+
+ umount $TEST_MOUNT_POINT 2>&1 > /dev/null
+}
+
+do_test_diff()
+{
+ ped_testing "$1"
+ if ped_test_get_val "$4" "$5" "$6"; then
+ ped_test_failed
+ return 1
+ fi
+ do_diff "$2" "$3"
+}
+
+test_mkpartfs()
+{
+ ped_test "mkpartfs 1 ext2 1 1"\
+ "mklabel $TEST_FS_USE_DISK_LABEL\
+ mkpartfs 1 ext2 1 1\
+ check 1"\
+ "/sbin/e2fsck -n -f ${TEST_DRIVE}1"
+
+ ped_test "mkpartfs"\
+ "mklabel $TEST_FS_USE_DISK_LABEL\
+ mkpartfs primary ext2 1 $DEFAULT_END\
+ check 1"\
+ "/sbin/e2fsck -n -f ${TEST_DRIVE}1"
+
+ ped_test "mkfs"\
+ "mkfs 1 ext2\
+ check 1"\
+ "/sbin/e2fsck -n -f ${TEST_DRIVE}1"
+}
+
+prepare_resize_tests()
+{
+ part_num=1
+ part=$TEST_DRIVE$part_num
+
+ umount $TEST_MOUNT_POINT 2>&1 > /dev/null
+
+ mount $part $TEST_MOUNT_POINT -t ext2 \
+ && cp $TEST_DATA/* $TEST_MOUNT_POINT -r
+ umount $TEST_MOUNT_POINT 2>&1 > /dev/null
+}
+
+test_resize_move_end_forward()
+{
+ do_test_diff "resize: move end forward"\
+ $TEST_DATA $TEST_MOUNT_POINT \
+ "resize 1 1 $[ $DEFAULT_END + 5 ] check 1"\
+ "/sbin/e2fsck -n -f ${TEST_DRIVE}1"
+}
+
+test_resize_move_end_forward_big()
+{
+ do_test_diff "resize: move end forward (big)"\
+ $TEST_DATA $TEST_MOUNT_POINT \
+ "resize 1 1 $[ $DEFAULT_END + 200 ] check 1"\
+ "/sbin/e2fsck -n -f ${TEST_DRIVE}1"
+}
+
+test_resize_move_end_backward()
+{
+ do_test_diff "resize: move end backward"\
+ $TEST_DATA $TEST_MOUNT_POINT \
+ "resize 1 1 $DEFAULT_END check 1"\
+ "/sbin/e2fsck -n -f ${TEST_DRIVE}1"
+}
+
+main()
+{
+ export DEFAULT_END=200
+
+ if ! test_mkpartfs; then
+ return 1
+ fi
+
+ prepare_resize_tests
+ test_resize_move_end_forward
+ test_resize_move_end_backward
+ test_resize_move_end_forward_big
+ test_resize_move_end_backward
+}
+
+main
+
diff --git a/debug/test/test_fs_fat b/debug/test/test_fs_fat
new file mode 100755
index 0000000..7a51e4e
--- /dev/null
+++ b/debug/test/test_fs_fat
@@ -0,0 +1,181 @@
+#! /bin/bash
+
+do_diff()
+{
+ mount -t vfat ${TEST_DRIVE}1 $TEST_MOUNT_POINT > /dev/null
+
+ if diff -rq $1 $2 >> test_log; then
+ ped_test_ok
+ else
+ ped_test_failed
+ fi
+
+ umount $TEST_MOUNT_POINT 2>&1 > /dev/null
+}
+
+do_test_diff()
+{
+ ped_testing "$1"
+ if ped_test_get_val "$4" "$5" "$6" "$7"; then
+ ped_test_failed
+ return 1
+ fi
+ do_diff "$2" "$3"
+}
+
+test_mkpartfs()
+{
+ ped_test "mkpartfs fat16 minimum size"\
+ "mklabel $TEST_FS_USE_DISK_LABEL\
+ mkpartfs primary fat16 0 1\
+ check 1"\
+ "/sbin/dosfsck ${TEST_DRIVE}1"
+
+ ped_test "mkpartfs fat32 minimum size"\
+ "mklabel $TEST_FS_USE_DISK_LABEL\
+ mkpartfs primary fat32 0 1\
+ check 1"\
+ "/sbin/dosfsck ${TEST_DRIVE}1"
+
+ ped_test "mkpartfs"\
+ "mklabel $TEST_FS_USE_DISK_LABEL\
+ mkpartfs primary fat32 1 $DEFAULT_END\
+ check 1"\
+ "/sbin/dosfsck ${TEST_DRIVE}1"
+
+ ped_test "mkfs"\
+ "mkfs 1 fat32\
+ check 1"\
+ "/sbin/dosfsck ${TEST_DRIVE}1"
+}
+
+prepare_resize_tests()
+{
+ part_num=1
+ part=$TEST_DRIVE$part_num
+ hole_parent=`echo $TEST_DATA_HOLE | sed -e "s/[-_.a-zA-Z0-9]+\///g"`
+
+ umount $TEST_MOUNT_POINT 2>&1 > /dev/null
+
+ mount $part $TEST_MOUNT_POINT -t vfat \
+ && cp -r $TEST_DATA/* $TEST_MOUNT_POINT \
+ && cp -r $TEST_DATA $TEST_MOUNT_POINT/tmp_copy \
+ && rm -rf $TEST_MOUNT_POINT/$TEST_DATA_HOLE \
+ && mv $TEST_MOUNT_POINT/tmp_copy/$TEST_DATA_HOLE \
+ $TEST_MOUNT_POINT/$hole_parent \
+ && rm -rf $TEST_MOUNT_POINT/tmp_copy
+ umount $TEST_MOUNT_POINT
+}
+
+clearfat()
+{
+ $TEST_PARTED_CLEARFAT $TEST_DRIVE $1
+}
+
+test_resize_move_start_forward()
+{
+# geometry beforehand: 1 to $DEFAULT_END
+ do_test_diff "resize: move start forward"\
+ $TEST_DATA $TEST_MOUNT_POINT \
+ "resize 1 5 $DEFAULT_END check 1"\
+ "/sbin/dosfsck ${TEST_DRIVE}1"
+ clearfat 1
+}
+
+test_resize_move_start_backward()
+{
+# geometry beforehand: 5 to $DEFAULT_END
+ do_test_diff "resize: move start backward"\
+ $TEST_DATA $TEST_MOUNT_POINT \
+ "resize 1 1 $DEFAULT_END check 1"\
+ "/sbin/dosfsck ${TEST_DRIVE}1"
+ clearfat 1
+}
+
+test_resize_move_end_forward()
+{
+# geometry beforehand: 1 to $DEFAULT_END
+ do_test_diff "resize: move end forward"\
+ $TEST_DATA $TEST_MOUNT_POINT \
+ "resize 1 1 $[ $DEFAULT_END + 5 ] check 1"\
+ "/sbin/dosfsck ${TEST_DRIVE}1"
+ clearfat 1
+}
+
+test_resize_move_end_backward()
+{
+# geometry beforehand: 1 to $[$DEFAULT_END + 5]
+ do_test_diff "resize: move end backward"\
+ $TEST_DATA $TEST_MOUNT_POINT \
+ "resize 1 1 $DEFAULT_END check 1"\
+ "/sbin/dosfsck ${TEST_DRIVE}1"
+ clearfat 1
+}
+
+test_convert_fat16_fat32_shrink_cluster()
+{
+# geometry beforehand: 1 to $DEFAULT_END
+ do_test_diff \
+ "resize: convert from FAT16 to FAT32, shrinking the cluster size"\
+ $TEST_DATA $TEST_MOUNT_POINT \
+ "resize 1 1 $FAT32_END check 1"\
+ "/sbin/dosfsck ${TEST_DRIVE}1"
+ clearfat 1
+}
+
+test_convert_fat32_fat16()
+{
+# geometry beforehand: 1 to $FAT16_SMALL_END
+ do_test_diff "resize: convert from FAT32 to FAT16"\
+ $TEST_DATA $TEST_MOUNT_POINT \
+ "resize 1 1 $FAT32_END check 1"\
+ "/sbin/dosfsck ${TEST_DRIVE}1"
+ clearfat 1
+}
+
+test_convert_fat16_fat32()
+{
+# geometry beforehand: 1 to $FAT32_END
+ do_test_diff "resize: convert from FAT16 to FAT32"\
+ $TEST_DATA $TEST_MOUNT_POINT \
+ "resize 1 1 $FAT16_SMALL_END check 1"\
+ "/sbin/dosfsck ${TEST_DRIVE}1"
+ clearfat 1
+}
+
+#test_convert_fat32_fat16_shrink_cluster()
+#{
+#}
+
+#test_fat16_shrink_cluster()
+#{
+#}
+
+#test_fat32_shrink_cluster()
+#{
+#}
+
+main()
+{
+ export DEFAULT_END=300
+ export FAT32_END=600
+ export FAT16_SMALL_END=200
+
+ if ! test_mkpartfs; then
+ return 1
+ fi
+
+ prepare_resize_tests
+ test_resize_move_start_forward
+ test_resize_move_start_backward
+ test_resize_move_end_forward
+ test_resize_move_end_backward
+
+# prepare_resize_tests
+ test_convert_fat16_fat32_shrink_cluster
+ test_convert_fat32_fat16
+ test_convert_fat16_fat32
+}
+
+main
+
diff --git a/debug/test/test_fs_hfs b/debug/test/test_fs_hfs
new file mode 100644
index 0000000..d0f88c0
--- /dev/null
+++ b/debug/test/test_fs_hfs
@@ -0,0 +1,91 @@
+#!/bin/bash
+# fsck_hfs seems to be broken : it doesn't even succeed in scanning a freshly
+# created by newfs_hfs partition.
+
+do_diff()
+{
+ mount "${TEST_DRIVE}1" $TEST_MOUNT_POINT -t $FILE_SYSTEM > /dev/null
+
+ if diff -rq $1 $2 --exclude lost+found >> test_log; then
+ ped_test_ok
+ else
+ ped_test_failed
+ fi
+
+ umount $TEST_MOUNT_POINT 2>&1 > /dev/null
+}
+
+do_test_diff()
+{
+ ped_testing "$1"
+ if ped_test_get_val "$4" "$5" "$6"; then
+ ped_test_failed
+ return 1
+ fi
+ do_diff "$2" "$3"
+}
+
+
+test_newfs_hfs()
+{
+# -h option for newfs_hfs makes it use legacy HFS (not Plus)
+# -dfn for fsck_hfs means Debug, Force, No
+# Debug => print more informations
+# Force => force check even if clean bit is set
+# No => don't modify the F.S.
+ ped_test "mkpart && newfs_hfs && fsck_hfs"\
+ "mklabel $TEST_FS_USE_DISK_LABEL\
+ mkpart primary $FILE_SYSTEM 1 $DEFAULT_END"\
+ "newfs_hfs -h -v \"PED HFS TEST\" ${TEST_DRIVE}1"
+# &&\
+# fsck_hfs -dfn ${TEST_DRIVE}1"
+}
+
+prepare_resize_tests()
+{
+ part_num=1
+ part=$TEST_DRIVE$part_num
+ hole_parent=`echo $TEST_DATA_HOLE | sed -e "s/[-_.a-zA-Z0-9]+\///g"`
+
+ umount $TEST_MOUNT_POINT 2>&1 > /dev/null
+
+ mount $part $TEST_MOUNT_POINT -t $FILE_SYSTEM \
+ && cp $TEST_DATA/* $TEST_MOUNT_POINT -r \
+ && cp -r $TEST_DATA $TEST_MOUNT_POINT/tmp_copy \
+ && rm -rf $TEST_MOUNT_POINT/$TEST_DATA_HOLE \
+ && mv $TEST_MOUNT_POINT/tmp_copy/$TEST_DATA_HOLE \
+ $TEST_MOUNT_POINT/$hole_parent \
+ && rm -rf $TEST_MOUNT_POINT/tmp_copy
+
+ umount $TEST_MOUNT_POINT 2>&1 > /dev/null
+}
+
+test_resize_move_end_backward()
+{
+# -dfn for fsck_hfs means Debug, Force, No
+# Debug => print more informations
+# Force => force check even if clean bit is set
+# No => don't modify the F.S.
+ do_test_diff "resize: move end backward"\
+ $TEST_DATA $TEST_MOUNT_POINT \
+ "resize 1 1 $RESIZE_END"\
+ ""
+#fsck_hfs -dfn ${TEST_DRIVE}1 2>&1"
+}
+
+main()
+{
+ export DEFAULT_END=250
+ export RESIZE_END=200
+ export FILE_SYSTEM=hfs
+
+ if ! test_newfs_hfs; then
+ return 1
+ fi
+
+ prepare_resize_tests
+ test_resize_move_end_backward
+}
+
+main
+
diff --git a/debug/test/test_fs_hfsplus b/debug/test/test_fs_hfsplus
new file mode 100644
index 0000000..3de185f
--- /dev/null
+++ b/debug/test/test_fs_hfsplus
@@ -0,0 +1,95 @@
+#!/bin/bash
+# fsck_hfs seems to be broken : it doesn't even succeed in scanning a freshly
+# created by newfs_hfs partition.
+# update : retry with my newfs_hfs that round file system size down to 4 ko
+
+do_diff()
+{
+ mount "${TEST_DRIVE}1" $TEST_MOUNT_POINT -t $FILE_SYSTEM > /dev/null
+
+ if diff -rq $1 $2 --exclude lost+found >> test_log; then
+ ped_test_ok
+ else
+ ped_test_failed
+ fi
+
+ umount $TEST_MOUNT_POINT 2>&1 > /dev/null
+}
+
+do_test_diff()
+{
+ ped_testing "$1"
+ if ped_test_get_val "$4" "$5" "$6"; then
+ ped_test_failed
+ return 1
+ fi
+ do_diff "$2" "$3"
+}
+
+
+test_newfs_hfs()
+{
+# -w option for newfs_hfs adds an HFS wrapper around the HFS+ F.S.
+# update : don't use -w yet because it doesn't works well
+# it seems that the wrapper bad block file is stored differently by
+# newfs_hfs than by mac os X install format program
+# -dfn for fsck_hfs means Debug, Force, No
+# Debug => print more informations
+# Force => force check even if clean bit is set
+# No => don't modify the F.S.
+ ped_test "mkpart && newfs_hfs && fsck_hfs"\
+ "mklabel $TEST_FS_USE_DISK_LABEL\
+ mkpart primary $FILE_SYSTEM 1 $DEFAULT_END"\
+ "newfs_hfs -v \"PED HFS TEST\" ${TEST_DRIVE}1"
+# &&\
+# fsck_hfs -dfn ${TEST_DRIVE}1"
+}
+
+prepare_resize_tests()
+{
+ part_num=1
+ part=$TEST_DRIVE$part_num
+ hole_parent=`echo $TEST_DATA_HOLE | sed -e "s/[-_.a-zA-Z0-9]+\///g"`
+
+ umount $TEST_MOUNT_POINT 2>&1 > /dev/null
+
+ mount $part $TEST_MOUNT_POINT -t $FILE_SYSTEM \
+ && cp $TEST_DATA/* $TEST_MOUNT_POINT -r \
+ && cp -r $TEST_DATA $TEST_MOUNT_POINT/tmp_copy \
+ && rm -rf $TEST_MOUNT_POINT/$TEST_DATA_HOLE \
+ && mv $TEST_MOUNT_POINT/tmp_copy/$TEST_DATA_HOLE \
+ $TEST_MOUNT_POINT/$hole_parent \
+ && rm -rf $TEST_MOUNT_POINT/tmp_copy
+
+ umount $TEST_MOUNT_POINT 2>&1 > /dev/null
+}
+
+test_resize_move_end_backward()
+{
+# -dfn for fsck_hfs means Debug, Force, No
+# Debug => print more informations
+# Force => force check even if clean bit is set
+# No => don't modify the F.S.
+ do_test_diff "resize: move end backward"\
+ $TEST_DATA $TEST_MOUNT_POINT \
+ "resize 1 1 $RESIZE_END"\
+ ""
+#fsck_hfs -dfn ${TEST_DRIVE}1 2>&1"
+}
+
+main()
+{
+ export DEFAULT_END=250
+ export RESIZE_END=200
+ export FILE_SYSTEM=hfsplus
+
+ if ! test_newfs_hfs; then
+ return 1
+ fi
+
+ prepare_resize_tests
+ test_resize_move_end_backward
+}
+
+main
+
diff --git a/debug/test/test_fs_linux_swap b/debug/test/test_fs_linux_swap
new file mode 100755
index 0000000..2fb3028
--- /dev/null
+++ b/debug/test/test_fs_linux_swap
@@ -0,0 +1,69 @@
+#! /bin/bash
+
+test_mkpartfs()
+{
+ ped_test "mkpartfs"\
+ "mklabel $TEST_FS_USE_DISK_LABEL\
+ mkpartfs primary linux-swap 1 $DEFAULT_END\
+ check 1"
+
+ ped_test "mkfs"\
+ "mkfs 1 linux-swap\
+ check 1"
+}
+
+do_test_swap()
+{
+ ped_testing "$1"
+ if ped_test_get_val "$2" "$3"; then
+ ped_test_failed
+ return 1
+ fi
+ if /sbin/swapon "${TEST_DRIVE}1"; then
+ /sbin/swapoff "${TEST_DRIVE}1"
+ ped_test_ok
+ else
+ ped_test_failed
+ fi
+}
+
+test_resize_move_start_forward()
+{
+ do_test_swap "resize: move start forward"\
+ "resize 1 5 $DEFAULT_END check 1"
+}
+
+test_resize_move_start_backward()
+{
+ do_test_swap "resize: move start backward"\
+ "resize 1 1 $DEFAULT_END check 1"
+}
+
+test_resize_move_end_forward()
+{
+ do_test_swap "resize: move end forward"\
+ "resize 1 1 $[ $DEFAULT_END + 5 ] check 1"
+}
+
+test_resize_move_end_backward()
+{
+ do_test_swap "resize: move end backward"\
+ "resize 1 1 $DEFAULT_END check 1"
+}
+
+main()
+{
+ export DEFAULT_END=200
+
+ if ! test_mkpartfs; then
+ return 1
+ fi
+
+ test_resize_move_start_forward
+ test_resize_move_start_backward
+ test_resize_move_end_forward
+ test_resize_move_end_backward
+}
+
+main
+
diff --git a/debug/test/test_fs_reiserfs b/debug/test/test_fs_reiserfs
new file mode 100755
index 0000000..69a1e60
--- /dev/null
+++ b/debug/test/test_fs_reiserfs
@@ -0,0 +1,98 @@
+#! /bin/bash
+
+do_diff()
+{
+ mount "${TEST_DRIVE}1" $TEST_MOUNT_POINT -t reiserfs > /dev/null
+
+ if diff -rq $1 $2 --exclude lost+found >> test_log; then
+ ped_test_ok
+ else
+ ped_test_failed
+ fi
+
+ umount $TEST_MOUNT_POINT 2>&1 > /dev/null
+}
+
+do_test_diff()
+{
+ ped_testing "$1"
+ if ped_test_get_val "$4" "$5" "$6"; then
+ ped_test_failed
+ return 1
+ fi
+ do_diff "$2" "$3"
+}
+
+test_mkpartfs()
+{
+ ped_test "mkpartfs primary reiserfs 1 1"\
+ "mklabel $TEST_FS_USE_DISK_LABEL\
+ mkpartfs primary reiserfs 1 1\
+ check 1"\
+ "echo Yes | /sbin/reiserfsck -q ${TEST_DRIVE}1 2>&1"
+
+ ped_test "mkpartfs"\
+ "mklabel $TEST_FS_USE_DISK_LABEL\
+ mkpartfs primary reiserfs 1 $DEFAULT_END\
+ check 1"\
+ "echo Yes | /sbin/reiserfsck -q ${TEST_DRIVE}1 2>&1"
+
+ ped_test "mkfs"\
+ "mkfs 1 reiserfs\
+ check 1"\
+ "echo Yes | /sbin/reiserfsck -q ${TEST_DRIVE}1 2>&1"
+}
+
+prepare_resize_tests()
+{
+ part_num=1
+ part=$TEST_DRIVE$part_num
+
+ umount $TEST_MOUNT_POINT 2>&1 > /dev/null
+
+ mount $part $TEST_MOUNT_POINT -t reiserfs \
+ && cp $TEST_DATA/* $TEST_MOUNT_POINT -r
+ umount $TEST_MOUNT_POINT 2>&1 > /dev/null
+}
+
+test_resize_move_end_forward()
+{
+ do_test_diff "resize: move end forward"\
+ $TEST_DATA $TEST_MOUNT_POINT \
+ "resize 1 1 $[ $DEFAULT_END + 5 ] check 1"\
+ "echo Yes | /sbin/reiserfsck -q ${TEST_DRIVE}1 2>&1"
+}
+
+test_resize_move_end_forward_big()
+{
+ do_test_diff "resize: move end forward (big)"\
+ $TEST_DATA $TEST_MOUNT_POINT \
+ "resize 1 1 $[ $DEFAULT_END + 200 ] check 1"\
+ "echo Yes | /sbin/reiserfsck -q ${TEST_DRIVE}1 2>&1"
+}
+
+test_resize_move_end_backward()
+{
+ do_test_diff "resize: move end backward"\
+ $TEST_DATA $TEST_MOUNT_POINT \
+ "resize 1 1 $DEFAULT_END check 1"\
+ "echo Yes | /sbin/reiserfsck -q ${TEST_DRIVE}1 2>&1"
+}
+
+main()
+{
+ export DEFAULT_END=200
+
+ if ! test_mkpartfs; then
+ return 1
+ fi
+
+ prepare_resize_tests
+ test_resize_move_end_forward
+ test_resize_move_end_backward
+ test_resize_move_end_forward_big
+ test_resize_move_end_backward
+}
+
+main
+
diff --git a/debug/test/testrc b/debug/test/testrc
new file mode 100644
index 0000000..c4dff00
--- /dev/null
+++ b/debug/test/testrc
@@ -0,0 +1,41 @@
+# fill this in! It'll refuse to run if you don't. I don't want this
+# configuration used to clobber your machine :-)
+TEST_HOST=satisfactory
+
+# Parted distribution base
+# TEST_PARTED_BASE=../..
+TEST_PARTED_BASE=/home/parted/cvs/stable
+
+# where to find GNU parted
+TEST_PARTED_COMMAND=$TEST_PARTED_BASE/parted/parted
+
+# where to find clearfat
+TEST_PARTED_CLEARFAT=$TEST_PARTED_BASE/debug/clearfat/clearfat
+
+# the drive to be completely clobbered!
+TEST_DRIVE=/dev/hdb
+
+# The size of the disk, in megabytes
+TEST_DRIVE_SIZE=19092
+
+# where TEST_DRIVE gets mounted
+TEST_MOUNT_POINT=/mnt/test
+
+# where to get test data from. Clear text is nice - easier to debug.
+TEST_DATA=/usr/src/kernel-source-2.4.20
+
+# data to delete and replace, to "fragment" the drive.
+TEST_DATA_HOLE=include
+
+# which disk label to use for testing file systems
+TEST_FS_USE_DISK_LABEL=msdos
+
+# set to 1 if you want to shut up the kernel's annoying messages
+QUIET_KERNEL=1
+
+# set to 1 if you want logging of everything, including successful tests
+VERBOSE_LOGS=1
+
+# set this if you want to do malloc() debugging with mtrace
+#MALLOC_TRACE=malloc-trace
+
diff --git a/doc/API b/doc/API
new file mode 100644
index 0000000..677beca
--- /dev/null
+++ b/doc/API
@@ -0,0 +1,288 @@
+===============================================================================
+ GNU libparted API
+===============================================================================
+
+
+
+
+
+
+
+
+ <<< This file is deprecated and being converted
+ to Doxygen in-line documentation.
+ Until this is finished, both are incomplete
+ but fully document the API together. >>>
+
+
+ ( scroll down to read )
+
+
+
+
+
+ by Andrew Clausen <clausen@gnu.org>,
+ Leslie P. Polzer <polzer@gnu.org>
+
+ Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005, 2006
+ Free Software Foundation, Inc.
+
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.1
+ or any later version published by the Free Software Foundation;
+ with the no Invariant Sections, with the no Front-Cover Texts, and
+ with no Back-Cover Texts. A copy of the license is included in the
+ file, COPYING.DOC.
+
+
+CONTENTS
+--------
+
+1 Introduction
+2 Initialising libparted
+3 PedDevice
+4 PedDisk, PedDiskType
+5 PedGeometry
+6 PedPartition, PedPartitionType
+7 PedFileSystem, PedFileSystemType
+8 PedConstraint, PedAlignment
+9 PedTimer
+10 PedUnit
+11 Exceptions
+
+-------------------------------------------------------------------------------
+1 INTRODUCTION
+-------------------------------------------------------------------------------
+
+GNU Parted is built on top of libparted, which does all of the real work.
+libparted provides an API capable of manipulating partition tables, and
+the filesystems on them.
+
+The main motivation for separating the back-end into a separate library was
+to encourage different GNU/Linux distributions to encorporate their own
+customized front-end into the install process.
+
+This documents the API -- not the implementation details of libparted.
+Documentation that is not relevant to programs using the API are marked with
+INTERNAL. Apart from this file, a good place to look would be
+parted/parted.c, the front-end's source, and the TUTORIAL file (not finished
+yet!).
+
+This documentation isn't as complete as it should be. Feel free to ask
+questions, either to me personally (clausen@gnu.org), or to the mailing list
+(bug-parted@gnu.org).
+
+1.1 TERMINOLOGY
+-------------------
+Some of the terminology is a bit weird, so you might want to read this.
+
+CONSTRAINT a set of conditions that must be satisfied, for
+ a given GEOMETRY of a PARTITION.
+
+DEVICE a storage device.
+
+DISK a storage device, with a valid partition table.
+
+EXCEPTION an event that needs attention.
+
+EXTENDED PARTITION a PRIMARY PARTITION, that may contain LOGICAL
+ PARTITIONS instead of a file system. There is at most
+ one extended partition.
+
+FILE SYSTEM any data that resides on a partition. For the purposes
+ for GNU Parted, this includes swap devices.
+
+GEOMETRY a description of a continuous region on a disk. eg,
+ partitions have a geometry.
+
+HIDDEN PARTITION a partition that is hidden from MS operating systems.
+ Only FAT partitions may be hidden.
+
+LOGICAL PARTITION like normal partitions, but they lie inside the
+ extended partition.
+
+PARTITION a continuous region on a disk where a file system may
+ reside.
+
+PRIMARY PARTITION a normal, vanilla, partition.
+
+PARTITION TABLE also, DISK LABEL. A description of where the
+ partitions lie, and information about those partitions.
+ For example, what type of file system resides on them.
+ The partition table is usually at the start of the
+ disk.
+
+TIMER a progress meter. It is an entity that keeps track
+ of time, and who to inform when something interesting
+ happens.
+
+1.2 DESIGN
+--------------
+libparted has a fairly object-oriented design. The most important objects are:
+
+PedArchitecture describes support for an "archicture", which is sort
+ of like "operating system", but could also be,
+ for example, another libparted environment, EVMS, etc.
+PedConstraint a constraint on the geometry of a partition
+PedDevice a storage device
+PedDisk a device + partition table
+PedFileSystem a filesystem, associated with a PedGeometry, NOT a
+ PedPartition.
+PedGeometry a continious region on a device
+PedPartition a partition (basically PedGeometry plus some attributes)
+PedTimer a timer keeps track of progress and time
+
+All functions return 0 (or NULL) on failure and non-zero (or non-NULL) on
+success. If a function fails, an exception is thrown. This may be handled by
+either an exception handler, or the calling function (see the section on
+exceptions).
+
+All objects should be considered read-only; they should only be modified by
+calls to libparted's API.
+
+-------------------------------------------------------------------------------
+2 INITIALISING LIBPARTED
+-------------------------------------------------------------------------------
+
+Headers for libparted can be included with:
+
+#include <parted/parted.h>
+
+Parted automatically initialises itself via an __attribute__ ((constructor))
+function.
+
+However, you might want to set the exception handler with
+ped_exception_set_handler(). libparted does come with a default exception
+handler, if you're feeling lazy.
+
+Here's a minimal example:
+
+#include <parted/parted.h>
+
+int
+main()
+{
+ /* automatically initialized */
+ ped_exception_set_handler(exception_handler); /* see section 7 */
+ return 0;
+ /* automatically cleaned up */
+}
+
+-----------------------------------------------------------------------------
+5 PEDGEOMETRY
+-----------------------------------------------------------------------------
+
+5.1 FIELDS
+--------------
+
+5.2 FUNCTIONS
+-----------------
+
+
+-----------------------------------------------------------------------------
+6 PEDPARTITION, PEDPARTITIONTYPE
+-----------------------------------------------------------------------------
+
+interface: <parted/disk.h>
+implementation: libparted/disk.c
+
+A PedPartition represents a partition (surprise!). PedPartitions have weird
+relationships with PedDisks. Hence, many functions for manipulating partitions
+will be called ped_disk_* - so have a look at the PedDisk documentation as well.
+
+Parted creates "imaginary" free space and metadata partitions. You can't
+do any operations on these partitions (like set_geometry, {set,get}_flag, etc.)
+Partitions that are not free space or metadata partitions are said to
+be "active" partitions. You can use ped_partition_is_active() to check.
+
+6.1 FIELDS
+--------------
+
+
+6.2 FUNCTIONS
+-----------------
+
+
+-----------------------------------------------------------------------------
+7 PEDFILESYSTEM, PEDFILESYSTEMTYPE
+-----------------------------------------------------------------------------
+
+
+7.1 FIELDS
+--------------
+
+
+7.2 FUNCTIONS
+-----------------
+
+
+-----------------------------------------------------------------------------
+8 PEDCONSTRAINT, PEDALIGNMENT
+-----------------------------------------------------------------------------
+
+
+"Alignments" are restrictions on the location of a sector in the form of:
+
+ sector = offset + X * grain_size
+
+For example, logical partitions on msdos disk labels usually have a constraint
+with offset = 63 and grain_size = 16065 (Long story!). An important
+(and non-obvious!) property of alignment restrictions is they are closed
+under intersection, i.e. if you take two constraints, like (offset, grain_size)
+= (63, 16065) and (0, 4), then either:
+ * there are no valid solutions
+ * all solutions can be expressed in the form of (offset + X * grain_size)
+In the example, the intersection of the constraint is (16128, 64260).
+
+For more information on the maths, see the source -- there's a large comment
+containing proofs above ped_alignment_intersect() in libparted/natmath.c
+
+The restrictions on the location of the start and end are in the form of
+PedGeometry objects -- continous regions in which the start and end must lie.
+Obviously, these restrictions are also closed under intersection.
+
+The other restriction -- the minimum size -- is also closed under intersection.
+(The intersection of 2 minimum size restrictions is the maximum of the
+2 values)
+
+FIXME: mention ped_alignment_any
+
+8.2 FUNCTIONS
+-----------------
+
+
+
+-----------------------------------------------------------------------------
+9 PEDTIMER
+-----------------------------------------------------------------------------
+
+9.1 FIELDS
+--------------
+
+typedef void PedTimerHandler (PedTimer* timer, void* context);
+
+
+9.2 FUNCTIONS
+-----------------
+
+
+-----------------------------------------------------------------------------
+10 PEDUNIT
+-----------------------------------------------------------------------------
+
+
+10.1 CONSTANTS
+-----------------
+
+10.2 FUNCTIONS
+-----------------
+
+
+-----------------------------------------------------------------------------
+11 EXCEPTIONS
+-----------------------------------------------------------------------------
+
+11.1 FIELDS
+--------------
+
+
diff --git a/doc/C/Makefile.am b/doc/C/Makefile.am
new file mode 100644
index 0000000..863e0d8
--- /dev/null
+++ b/doc/C/Makefile.am
@@ -0,0 +1,26 @@
+## Process this file with automake to produce Makefile.in
+
+dist_man_MANS = \
+ parted.8 \
+ partprobe.8
+
+man_MANS = $(dist_man_MANS)
+
+.PHONY: updatepo
+# Update the POT in srcdir
+# Make sure the update does not only consist in a new POT-Creation-Date
+updatepo:
+ cd $(srcdir); \
+ for name in $(dist_man_MANS); do \
+ echo $$name; \
+ cp po/$$name.pot po/$$name.new.pot; \
+ po4a-updatepo -f man -m $$name -p po/$$name.new.pot; \
+ diff -I '^\"POT-Creation-Date: ' po/$$name.pot po/$$name.new.pot 2>&1 > /dev/null; \
+ if [ $$? ]; then \
+ mv po/$$name.new.pot po/$$name.pot; \
+ else \
+ rm -f po/$$name.new.pot; \
+ fi; \
+ done
+
+dist-hook: updatepo
diff --git a/doc/C/parted.8 b/doc/C/parted.8
new file mode 100644
index 0000000..4bb50df
--- /dev/null
+++ b/doc/C/parted.8
@@ -0,0 +1,117 @@
+.TH PARTED 8 "18 Mar, 2002" parted "GNU Parted Manual"
+.SH NAME
+GNU Parted \- a partition manipulation program
+.SH SYNOPSIS
+.B parted
+[options] [device [command [options...]...]]
+.SH DESCRIPTION
+This manual page documents briefly the
+.BR parted
+command. Complete documentation is distributed with the package in
+GNU Info format; see below.
+.PP
+.B parted
+is a disk partitioning and partition resizing program. It allows you to
+create, destroy, resize, move and copy ext2, ext3, linux-swap, FAT, FAT32, and reiserfs
+partitions. It can create, resize and move Macintosh HFS partitions, as well as detect jfs,
+ntfs, ufs, and xfs partitions. It is useful for creating space for new operating systems,
+reorganising disk usage, and copying data to new hard disks.
+.SH OPTIONS
+.TP
+.B -h, --help
+displays a help message.
+.TP
+.B -i, --interactive
+where necessary, prompts for user intervention.
+.TP
+.B -s, --script
+never prompts for user intervention.
+.TP
+.B -v, --version
+displays the version.
+.SH COMMANDS
+.TP
+.B [device]
+The block device to partition.
+.TP
+.B [command [options]]
+Specifies a command to parted. If no command is given, parted will give you
+a command prompt. Commands are:
+.RS
+.TP
+.B check \fIpartition\fP
+does a simple check on \fIpartition\fP.
+.TP
+.B cp \fI[source-device]\fP \fIsource\fP \fIdest\fP
+copies the \fIsource\fP partition's filesystem on \fIsource-device\fP (or the
+current device if no other device was specified) to the \fIdest\fP partition
+on the current device.
+.TP
+.B help \fI[command]\fP
+prints general help, or help on \fIcommand\fP if specified.
+.TP
+.B mkfs \fIpartition\fP \fIfs-type\fP
+make a filesystem \fIfs-type\fP on \fIpartition\fP. \fIfs-type\fP can be one
+of "fat16", "fat32", "ext2", "linux-swap" or "reiserfs".
+.TP
+.B mklabel \fIlabel-type\fP
+Creates a new disklabel (partition table) of \fIlabel-type\fP.
+\fIlabel-type\fP should be one of "bsd", "dvh", "gpt", "loop", "mac", "msdos",
+"pc98" or "sun".
+.TP
+.B mkpart \fIpart-type\fP \fI[fs-type]\fP \fIstart\fP \fIend\fP
+make a \fIpart-type\fP partition with filesystem \fIfs-type\fP (if specified),
+beginning at \fIstart\fP and ending at \fIend\fP (in megabytes).
+\fIfs-type\fP can be one of
+"fat16", "fat32", "ext2", "HFS", "linux-swap", "NTFS", "reiserfs" or "ufs".
+\fIpart-type\fP should be one of "primary", "logical" or "extended"
+.TP
+.B mkpartfs \fIpart-type\fP \fIfs-type\fP \fIstart\fP \fIend\fP
+make a \fIpart-type\fP partition with filesystem \fIfs-type\fP beginning at
+\fIstart\fP and ending at \fIend\fP (in megabytes)
+.TP
+.B move \fIpartition\fP \fIstart\fP \fIend\fP
+move \fIpartition\fP to start at \fIstart\fP and end at \fIend\fP. Note: move
+never changes the minor number
+.TP
+.B name \fIpartition\fP \fIname\fP
+set the name of \fIpartition\fP to \fIname\fP. This option works only on Mac
+and PC98 disklabels. The name can be placed in quotes, if necessary
+.TP
+.B print
+displays the partition table
+.TP
+.B quit
+exits parted
+.TP
+.B resize \fIpartition\fP \fIstart\fP \fIend\fP
+resize the filesystem on \fIpartition\fP to start at \fIstart\fP and end at
+\fIend\fP megabytes
+.TP
+.B rm \fIpartition\fP
+deletes \fIpartition\fP
+.TP
+.B select \fIdevice\fP
+choose \fIdevice\fP as the current device to edit. \fIdevice\fP should usually
+be a Linux hard disk device, but it can be a partition, software raid device or
+a LVM logical volume if that is necessary
+.TP
+.B set \fIpartition\fP \fIflag\fP \fIstate\fP
+change the state of the \fIflag\fP on \fIpartition\fP to \fIstate\fP. Flags
+supported are: "boot", "root", "swap", "hidden", "raid", "lvm", "lba" and
+"palo".
+\fIstate\fP should be either "on" or "off"
+.RE
+.SH REPORTING BUGS
+Report bugs to <bug-parted@gnu.org>
+.SH SEE ALSO
+.BR fdisk (8),
+.BR mkfs (8),
+The \fIparted\fP program is fully documented in the
+.BR info(1)
+format
+.IR "GNU partitioning software"
+manual.
+.SH AUTHOR
+This manual page was written by Timshel Knoll <timshel@debian.org>,
+for the Debian GNU/Linux system (but may be used by others).
diff --git a/doc/C/partprobe.8 b/doc/C/partprobe.8
new file mode 100644
index 0000000..7385feb
--- /dev/null
+++ b/doc/C/partprobe.8
@@ -0,0 +1,54 @@
+.\" Hey, EMACS: -*- nroff -*-
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH PARTPROBE 8 "March 18, 2002" parted "GNU Parted Manual"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh disable hyphenation
+.\" .hy enable hyphenation
+.\" .ad l left justify
+.\" .ad b justify to both left and right margins
+.\" .nf disable filling
+.\" .fi enable filling
+.\" .br insert line break
+.\" .sp <n> insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+partprobe \- inform the OS of partition table changes
+.SH SYNOPSIS
+.B partprobe
+.RI [ -d ]
+.RI [ -s ]
+.RI [ devices... ]
+.SH DESCRIPTION
+This manual page documents briefly the
+.B partprobe
+command.
+.PP
+.\" TeX users may be more comfortable with the \fB<whatever>\fP and
+.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
+.\" respectively.
+\fBpartprobe\fP is a program that informs the operating system kernel of
+partition table changes, by requesting that the operating system re-read
+the partition table.
+.SH OPTIONS
+This program uses short UNIX style options.
+.TP
+.B \-d
+Don't update the kernel.
+.TP
+.B \-s
+Show a summary of devices and their partitions.
+.TP
+.B \-h
+Show summary of options.
+.TP
+.B \-v
+Show version of program.
+.SH SEE ALSO
+.BR parted (8).
+.SH AUTHOR
+This manual page was written by Timshel Knoll <timshel@debian.org>,
+for the Debian GNU/Linux system (but may be used by others).
diff --git a/doc/C/po/parted.8.pot b/doc/C/po/parted.8.pot
new file mode 100644
index 0000000..db53b72
--- /dev/null
+++ b/doc/C/po/parted.8.pot
@@ -0,0 +1,394 @@
+# SOME DESCRIPTIVE TITLE
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"POT-Creation-Date: 2006-05-21 3:21-0300\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: ENCODING"
+
+# type: TH
+#: parted.8:1
+#, no-wrap
+msgid "PARTED"
+msgstr ""
+
+# type: TH
+#: parted.8:1
+#, no-wrap
+msgid "18 Mar, 2002"
+msgstr ""
+
+# type: TH
+#: parted.8:1
+#, no-wrap
+msgid "parted"
+msgstr ""
+
+# type: TH
+#: parted.8:1
+#, no-wrap
+msgid "GNU Parted Manual"
+msgstr ""
+
+# type: SH
+#: parted.8:2
+#, no-wrap
+msgid "NAME"
+msgstr ""
+
+# type: Plain text
+#: parted.8:4
+msgid "GNU Parted - a partition manipulation program"
+msgstr ""
+
+# type: SH
+#: parted.8:4
+#, no-wrap
+msgid "SYNOPSIS"
+msgstr ""
+
+# type: Plain text
+#: parted.8:7
+msgid "B<parted> [options] [device [command [options...]...]]"
+msgstr ""
+
+# type: SH
+#: parted.8:7
+#, no-wrap
+msgid "DESCRIPTION"
+msgstr ""
+
+# type: Plain text
+#: parted.8:12
+msgid ""
+"This manual page documents briefly the B<parted> command. Complete "
+"documentation is distributed with the package in GNU Info format; see below."
+msgstr ""
+
+# type: Plain text
+#: parted.8:19
+msgid ""
+"B<parted> is a disk partitioning and partition resizing program. It allows "
+"you to create, destroy, resize, move and copy ext2, ext3, linux-swap, FAT, "
+"FAT32, and reiserfs partitions. It can create, resize and move Macintosh "
+"HFS partitions, as well as detect jfs, ntfs, ufs, and xfs partitions. It is "
+"useful for creating space for new operating systems, reorganising disk "
+"usage, and copying data to new hard disks."
+msgstr ""
+
+# type: SH
+#: parted.8:19
+#, no-wrap
+msgid "OPTIONS"
+msgstr ""
+
+# type: TP
+#: parted.8:20
+#, no-wrap
+msgid "B<-h, --help>"
+msgstr ""
+
+# type: Plain text
+#: parted.8:23
+msgid "displays a help message."
+msgstr ""
+
+# type: TP
+#: parted.8:23
+#, no-wrap
+msgid "B<-i, --interactive>"
+msgstr ""
+
+# type: Plain text
+#: parted.8:26
+msgid "where necessary, prompts for user intervention."
+msgstr ""
+
+# type: TP
+#: parted.8:26
+#, no-wrap
+msgid "B<-s, --script>"
+msgstr ""
+
+# type: Plain text
+#: parted.8:29
+msgid "never prompts for user intervention."
+msgstr ""
+
+# type: TP
+#: parted.8:29
+#, no-wrap
+msgid "B<-v, --version>"
+msgstr ""
+
+# type: Plain text
+#: parted.8:32
+msgid "displays the version."
+msgstr ""
+
+# type: SH
+#: parted.8:32
+#, no-wrap
+msgid "COMMANDS"
+msgstr ""
+
+# type: TP
+#: parted.8:33
+#, no-wrap
+msgid "B<[device]>"
+msgstr ""
+
+# type: Plain text
+#: parted.8:36
+msgid "The block device to partition."
+msgstr ""
+
+# type: TP
+#: parted.8:36
+#, no-wrap
+msgid "B<[command [options]]>"
+msgstr ""
+
+# type: Plain text
+#: parted.8:40
+msgid ""
+"Specifies a command to parted. If no command is given, parted will give you "
+"a command prompt. Commands are:"
+msgstr ""
+
+# type: TP
+#: parted.8:41
+#, no-wrap
+msgid "B<check >I<partition>"
+msgstr ""
+
+# type: Plain text
+#: parted.8:44
+msgid "does a simple check on I<partition>."
+msgstr ""
+
+# type: TP
+#: parted.8:44
+#, no-wrap
+msgid "B<cp >I<[source-device]>B< >I<source>B< >I<dest>"
+msgstr ""
+
+# type: Plain text
+#: parted.8:49
+msgid ""
+"copies the I<source> partition's filesystem on I<source-device> (or the "
+"current device if no other device was specified) to the I<dest> partition on "
+"the current device."
+msgstr ""
+
+# type: TP
+#: parted.8:49
+#, no-wrap
+msgid "B<help >I<[command]>"
+msgstr ""
+
+# type: Plain text
+#: parted.8:52
+msgid "prints general help, or help on I<command> if specified."
+msgstr ""
+
+# type: TP
+#: parted.8:52
+#, no-wrap
+msgid "B<mkfs >I<partition>B< >I<fs-type>"
+msgstr ""
+
+# type: Plain text
+#: parted.8:56
+msgid ""
+"make a filesystem I<fs-type> on I<partition>. I<fs-type> can be one of "
+"\"fat16\", \"fat32\", \"ext2\", \"linux-swap\" or \"reiserfs\"."
+msgstr ""
+
+# type: TP
+#: parted.8:56
+#, no-wrap
+msgid "B<mklabel >I<label-type>"
+msgstr ""
+
+# type: Plain text
+#: parted.8:61
+msgid ""
+"Creates a new disklabel (partition table) of I<label-type>. I<label-type> "
+"should be one of \"bsd\", \"dvh\", \"gpt\", \"loop\", \"mac\", \"msdos\", "
+"\"pc98\" or \"sun\"."
+msgstr ""
+
+# type: TP
+#: parted.8:61
+#, no-wrap
+msgid "B<mkpart >I<part-type>B< >I<[fs-type]>B< >I<start>B< >I<end>"
+msgstr ""
+
+# type: Plain text
+#: parted.8:68
+msgid ""
+"make a I<part-type> partition with filesystem I<fs-type> (if specified), "
+"beginning at I<start> and ending at I<end> (in megabytes). I<fs-type> can "
+"be one of \"fat16\", \"fat32\", \"ext2\", \"HFS\", \"linux-swap\", \"NTFS\", "
+"\"reiserfs\" or \"ufs\". I<part-type> should be one of \"primary\", "
+"\"logical\" or \"extended\""
+msgstr ""
+
+# type: TP
+#: parted.8:68
+#, no-wrap
+msgid "B<mkpartfs >I<part-type>B< >I<fs-type>B< >I<start>B< >I<end>"
+msgstr ""
+
+# type: Plain text
+#: parted.8:72
+msgid ""
+"make a I<part-type> partition with filesystem I<fs-type> beginning at "
+"I<start> and ending at I<end> (in megabytes)"
+msgstr ""
+
+# type: TP
+#: parted.8:72
+#, no-wrap
+msgid "B<move >I<partition>B< >I<start>B< >I<end>"
+msgstr ""
+
+# type: Plain text
+#: parted.8:76
+msgid ""
+"move I<partition> to start at I<start> and end at I<end>. Note: move never "
+"changes the minor number"
+msgstr ""
+
+# type: TP
+#: parted.8:76
+#, no-wrap
+msgid "B<name >I<partition>B< >I<name>"
+msgstr ""
+
+# type: Plain text
+#: parted.8:80
+msgid ""
+"set the name of I<partition> to I<name>. This option works only on Mac and "
+"PC98 disklabels. The name can be placed in quotes, if necessary"
+msgstr ""
+
+# type: TP
+#: parted.8:80
+#, no-wrap
+msgid "B<print>"
+msgstr ""
+
+# type: Plain text
+#: parted.8:83
+msgid "displays the partition table"
+msgstr ""
+
+# type: TP
+#: parted.8:83
+#, no-wrap
+msgid "B<quit>"
+msgstr ""
+
+# type: Plain text
+#: parted.8:86
+msgid "exits parted"
+msgstr ""
+
+# type: TP
+#: parted.8:86
+#, no-wrap
+msgid "B<resize >I<partition>B< >I<start>B< >I<end>"
+msgstr ""
+
+# type: Plain text
+#: parted.8:90
+msgid ""
+"resize the filesystem on I<partition> to start at I<start> and end at I<end> "
+"megabytes"
+msgstr ""
+
+# type: TP
+#: parted.8:90
+#, no-wrap
+msgid "B<rm >I<partition>"
+msgstr ""
+
+# type: Plain text
+#: parted.8:93
+msgid "deletes I<partition>"
+msgstr ""
+
+# type: TP
+#: parted.8:93
+#, no-wrap
+msgid "B<select >I<device>"
+msgstr ""
+
+# type: Plain text
+#: parted.8:98
+msgid ""
+"choose I<device> as the current device to edit. I<device> should usually be "
+"a Linux hard disk device, but it can be a partition, software raid device or "
+"a LVM logical volume if that is necessary"
+msgstr ""
+
+# type: TP
+#: parted.8:98
+#, no-wrap
+msgid "B<set >I<partition>B< >I<flag>B< >I<state>"
+msgstr ""
+
+# type: Plain text
+#: parted.8:104
+msgid ""
+"change the state of the I<flag> on I<partition> to I<state>. Flags supported "
+"are: \"boot\", \"root\", \"swap\", \"hidden\", \"raid\", \"lvm\", \"lba\" "
+"and \"palo\". I<state> should be either \"on\" or \"off\""
+msgstr ""
+
+# type: SH
+#: parted.8:105
+#, no-wrap
+msgid "REPORTING BUGS"
+msgstr ""
+
+# type: Plain text
+#: parted.8:107
+msgid "Report bugs to E<lt>bug-parted@gnu.orgE<gt>"
+msgstr ""
+
+# type: SH
+#: parted.8:107
+#, no-wrap
+msgid "SEE ALSO"
+msgstr ""
+
+# type: Plain text
+#: parted.8:115
+msgid ""
+"B<fdisk>(8), B<mkfs>(8), The I<parted> program is fully documented in the "
+"B<info(1)> format I<GNU partitioning software> manual."
+msgstr ""
+
+# type: SH
+#: parted.8:115
+#, no-wrap
+msgid "AUTHOR"
+msgstr ""
+
+# type: Plain text
+#: parted.8:117
+msgid ""
+"This manual page was written by Timshel Knoll E<lt>timshel@debian.orgE<gt>, "
+"for the Debian GNU/Linux system (but may be used by others)."
+msgstr ""
diff --git a/doc/C/po/partprobe.8.pot b/doc/C/po/partprobe.8.pot
new file mode 100644
index 0000000..e4d1b9e
--- /dev/null
+++ b/doc/C/po/partprobe.8.pot
@@ -0,0 +1,173 @@
+# SOME DESCRIPTIVE TITLE
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"POT-Creation-Date: 2006-05-21 3:27-0300\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: ENCODING"
+
+# type: TH
+#: partprobe.8:5
+#, no-wrap
+msgid "PARTPROBE"
+msgstr ""
+
+# type: TH
+#: partprobe.8:5
+#, no-wrap
+msgid "March 18, 2002"
+msgstr ""
+
+# type: TH
+#: partprobe.8:5
+#, no-wrap
+msgid "parted"
+msgstr ""
+
+# type: TH
+#: partprobe.8:5
+#, no-wrap
+msgid "GNU Parted Manual"
+msgstr ""
+
+#. Please adjust this date whenever revising the manpage.
+#. Some roff macros, for reference:
+#. .nh disable hyphenation
+#. .hy enable hyphenation
+#. .ad l left justify
+#. .ad b justify to both left and right margins
+#. .nf disable filling
+#. .fi enable filling
+#. .br insert line break
+#. .sp <n> insert n+1 empty lines
+#. for manpage-specific macros, see man(7)
+# type: SH
+#: partprobe.8:18
+#, no-wrap
+msgid "NAME"
+msgstr ""
+
+# type: Plain text
+#: partprobe.8:20
+msgid "partprobe - inform the OS of partition table changes"
+msgstr ""
+
+# type: SH
+#: partprobe.8:20
+#, no-wrap
+msgid "SYNOPSIS"
+msgstr ""
+
+# type: Plain text
+#: partprobe.8:25
+msgid "B<partprobe> [I<-d>] [I<-s>] [I<devices...>]"
+msgstr ""
+
+# type: SH
+#: partprobe.8:25
+#, no-wrap
+msgid "DESCRIPTION"
+msgstr ""
+
+# type: Plain text
+#: partprobe.8:29
+msgid "This manual page documents briefly the B<partprobe> command."
+msgstr ""
+
+#. TeX users may be more comfortable with the \fB<whatever>\fP and
+#. \fI<whatever>\fP escape sequences to invode bold face and italics,
+#. respectively.
+# type: Plain text
+#: partprobe.8:36
+msgid ""
+"B<partprobe> is a program that informs the operating system kernel of "
+"partition table changes, by requesting that the operating system re-read the "
+"partition table."
+msgstr ""
+
+# type: SH
+#: partprobe.8:36
+#, no-wrap
+msgid "OPTIONS"
+msgstr ""
+
+# type: Plain text
+#: partprobe.8:38
+msgid "This program uses short UNIX style options."
+msgstr ""
+
+# type: TP
+#: partprobe.8:38
+#, no-wrap
+msgid "B<-d>"
+msgstr ""
+
+# type: Plain text
+#: partprobe.8:41
+msgid "Don't update the kernel."
+msgstr ""
+
+# type: TP
+#: partprobe.8:41
+#, no-wrap
+msgid "B<-s>"
+msgstr ""
+
+# type: Plain text
+#: partprobe.8:44
+msgid "Show a summary of devices and their partitions."
+msgstr ""
+
+# type: TP
+#: partprobe.8:44
+#, no-wrap
+msgid "B<-h>"
+msgstr ""
+
+# type: Plain text
+#: partprobe.8:47
+msgid "Show summary of options."
+msgstr ""
+
+# type: TP
+#: partprobe.8:47
+#, no-wrap
+msgid "B<-v>"
+msgstr ""
+
+# type: Plain text
+#: partprobe.8:50
+msgid "Show version of program."
+msgstr ""
+
+# type: SH
+#: partprobe.8:50
+#, no-wrap
+msgid "SEE ALSO"
+msgstr ""
+
+# type: Plain text
+#: partprobe.8:52
+msgid "B<parted>(8)."
+msgstr ""
+
+# type: SH
+#: partprobe.8:52
+#, no-wrap
+msgid "AUTHOR"
+msgstr ""
+
+# type: Plain text
+#: partprobe.8:54
+msgid ""
+"This manual page was written by Timshel Knoll E<lt>timshel@debian.orgE<gt>, "
+"for the Debian GNU/Linux system (but may be used by others)."
+msgstr ""
diff --git a/doc/FAT b/doc/FAT
new file mode 100644
index 0000000..cecc53a
--- /dev/null
+++ b/doc/FAT
@@ -0,0 +1,766 @@
+===============================================================================
+ GNU Parted FAT file system documentation
+===============================================================================
+
+ by Andrew Clausen <clausen@gnu.org>
+
+ Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.1
+ or any later version published by the Free Software Foundation;
+ with the no Invariant Sections, with the no Front-Cover Texts, and
+ with no Back-Cover Texts. A copy of the license is included in the
+ file, COPYING.DOC.
+
+
+CONTENTS
+--------
+
+ PART I - THE FAT FILE SYSTEM
+
+1 Introduction
+
+2 Overview
+
+3 The Boot Sector
+3.1 Data Layout
+3.2 Descriptions of Fields
+3.3 Calculating the ignored fields
+3.4 DOS/Windows bootstrap process
+
+4 The Info Sector
+4.1 Data Layout
+4.2 Descriptions of Fields
+
+5 File Allocation Tables
+
+6 Directory tree
+6.1 Directory entries
+
+ PART II - GNU PARTED'S FAT IMPLEMENTATION
+
+7 Resizing "issues"
+
+8 Overview of GNU Parted's Strategy
+
+===============================================================================
+ PART I - THE FAT FILE SYSTEM
+===============================================================================
+
+-------------------------------------------------------------------------------
+1 INTRODUCTION
+-------------------------------------------------------------------------------
+
+This document describes the FAT filesystem, and GNU Parted's support for it.
+
+Unfortunately, there are no particularly good sources of information on the FAT
+filesystem. The information here was deduced from the source code of about 10
+different programs, documentation from about 20 different sources and testing.
+There are many cases where documentation for FAT from various sources
+(including Microsoft) are misleading, or just plain wrong. For us,
+documentation is correct if it matches the behaviour of Microsoft's
+implementation.
+
+
+-------------------------------------------------------------------------------
+2 OVERVIEW
+-------------------------------------------------------------------------------
+
+FAT is a filesystem that is mainly used by Microsoft DOS, Windows 95,
+Windows 98 and Windows 2000. FAT also stands for File Allocation Table - a
+part of the FAT filesystem.
+
+FAT comes in three flavors: FAT12, FAT16 and FAT32.
+FAT12 is used on floppy disks, and REALLY old hard drives <32Mb. FAT16 is
+typically used on small hard drives <500Mb, and is very inefficient for large
+hard drives. FAT32 is used on hard drives >500Mb under Windows 95 OSR2 and
+later and Windows 2000. These three flavors have important differences (not
+JUST an increase in the maximum possible number of clusters). On FAT12 and
+FAT16 cluster size directly relates to the filesystem size: the number of
+clusters is always between 2041 and 4080 resp. 32761 and 65520.
+
+The FAT filesystem has these parts (on disk, in this order):
+ * a bootsector. This contains all of the information about the filesystem
+- whether it's FAT12, FAT16 or FAT32, how big it is, etc.
+
+ * an information sector (FAT32 only). This contains additional information
+that couldn't fit in the boot sector.
+
+ * file allocation tables (FATs). There are usually two identical copies.
+This is used to store the sequence of clusters that make of files. Essentially,
+if you want to know the number of the cluster that comes after cluster X
+in a file, you look up the number for X. If X is a magic number, it means
+it's the end of the file.
+
+ * clusters. The data inside files are stored in clusters. Most directory
+information is stored in clusters (except the root directory in FAT12 and
+FAT16). Clusters may be 1, 2, 4, 8, etc. sectors. Clusters are numbered,
+counting from 2.
+
+ * directory tree. The FAT filesystem has files and directories (no named
+pipes, links, or anything fancy like that), that are stored in clusters. The
+root directory on FAT12 and FAT16 is stored separately. In FAT32, the root
+directory is stored inside a normal cluster, just like everything else.
+
+
+-------------------------------------------------------------------------------
+3 THE BOOT SECTOR
+-------------------------------------------------------------------------------
+
+The boot sector contains all of the information about the filesystem
+- whether it's FAT12, FAT16 or FAT32, how big it is, etc. It also contains
+the boot loader for the operating system, if there is an operating system
+on the file system. It is always the first thing to appear in the filesystem
+- i.e. it's found at sector 0.
+
+A word of warning: while the values inside the boot sector will always be
+consistent with the file system, many of these values are not read by
+Microsoft's implementation - they are calculated independently.
+
+
+3.1 The Data Layout
+-------------------------------------------------------------------------------
+
+Taken from libparted/fs_fat/bootsector.h:
+
+struct _FatBootSector {
+ __u8 boot_jump[3]; /* 00: Boot strap short or near jump */
+ __u8 system_id[8]; /* 03: system name */
+ __u16 sector_size; /* 0b: bytes per logical sector */
+ __u8 cluster_size; /* 0d: sectors/cluster */
+ __u16 reserved; /* 0e: reserved sectors */
+ __u8 fats; /* 10: number of FATs */
+ __u16 dir_entries; /* 11: number of root directory entries */
+ __u16 sectors; /* 13: if 0, sector_count supersedes */
+ __u8 media; /* 15: media code */
+ __u16 fat_length; /* 16: sectors/FAT for FAT12/16 */
+ __u16 secs_track; /* 18: sectors per track */
+ __u16 heads; /* 1a: number of heads */
+ __u32 hidden; /* 1c: hidden sectors (partition start) */
+ __u32 sector_count; /* 20: no. of sectors (if sectors == 0) */
+
+union {
+/* FAT16 fields */
+struct {
+ __u8 drive_num; /* 24: */
+ __u8 empty_1; /* 25: */
+ __u8 ext_signature; /* 26: always 0x29 */
+ __u32 serial_number; /* 27: */
+ __u8 volume_name [11]; /* 2b: */
+ __u8 fat_name [8]; /* 37: */
+
+ __u8 boot_code[448]; /* 3f: Boot code (or message) */
+} __attribute__ ((packed)) fat16;
+
+/* FAT32 fields */
+struct {
+ __u32 fat_length; /* 24: size of FAT in sectors */
+ __u16 flags; /* 28: bit8: fat mirroring, low4: active fat */
+ __u16 version; /* 2a: minor * 256 + major */
+ __u32 root_dir_cluster; /* 2c: */
+ __u16 info_sector; /* 30: */
+ __u16 backup_sector; /* 32: */
+
+ __u8 empty_1 [12]; /* 34: */
+
+ __u16 drive_num; /* 40: */
+ __u8 ext_signature; /* 42: always 0x29 */
+ __u32 serial_number; /* 43: */
+ __u8 volume_name [11]; /* 47: */
+ __u8 fat_name [8]; /* 52: */
+
+ __u8 boot_code[420]; /* 5a: Boot code (or message) */
+} __attribute__ ((packed)) fat32;
+} u;
+
+ __u16 boot_sign; /* 1fe: always 0xAA55 */
+} __attribute__ ((packed));
+
+
+3.2 Descriptions of Fields
+-------------------------------------------------------------------------------
+
+3.2.1 Fields common to FAT12, FAT16 and FAT32
+-----------------------------------------------
+ __u8 boot_jump[3]; /* 00: Boot strap short or near jump */
+This contains the Intel x86 instruction to "jump" to further down in the
+boot sector. This is necessary, because on PC systems, the first sector of
+the disk is loaded and executed. On hard disks of PC systems, the first
+sector of the disk is in fact the Master Boot Record - which contains the
+partition table. The master boot record loads the first sector of the boot
+partition, so the end result is the same for floppy's and hard disks.
+
+
+ __u8 system_id[8]; /* 03: system name */
+This contains the name of the program or operatings system that created the
+file system. For FAT32, it seems you must have "MSWIN4.1" here.
+If this is "MSDMF3.2" (afaik only the "MSDMF" is checked") the partition
+can't be written under Windows 9x, Windows NT and Windows 2000. This is
+how Microsoft realizes read-only installation or distribution floppy disks.
+
+
+ __u16 sector_size; /* 0b: bytes per logical sector */
+This is bizarre. Sectors are always 512 bytes. However, a "logical" sector
+is a hack that allows sectors to be bigger (a multiple of 512 bytes). This
+is rarely used, and untested in GNU Parted at the moment. (Side note: is
+it possible to use this to avoid requiring a cluster resize?)
+
+
+ __u8 cluster_size; /* 0d: sectors/cluster */
+THIS IS IGNORED BY MICROSOFT'S IMPLEMENTATION OF FAT12 AND FAT16! (See section
+3.3) This contains the size of all clusters, given in sectors. This value is
+"read-only".
+
+
+ __u16 reserved; /* 0e: reserved sectors */
+The number of sectors before the file allocation tables begin. i.e. The
+number of the first sector of the first file allocation table.
+
+
+ __u8 fats; /* 10: number of FATs */
+The number of file allocation tables (usually 2).
+
+
+ __u16 dir_entries; /* 11: number of root directory entries */
+The size of the root directory (FAT12 and FAT16 only), in "directory entries"
+(32 bytes). The root directory is immediately after the FATs (FAT12 and
+FAT16 only). The first cluster (i.e. cluster number 2) starts immediately
+after the root directory (or after the FATs for FAT32).
+
+
+ __u16 sectors; /* 13: if 0, sector_count supersedes */
+THIS IS IGNORED BY MICROSOFT'S IMPLEMENTATION! The total size of the file
+system. If the file system is bigger than 65536 sectors, this is set to 0,
+and a 32 bit field is used instead. Microsoft's implementation gets this
+values from hardware (for floppy disks), or the partition table (for hard
+disks), rather than reading it off disk.
+
+
+ __u8 media; /* 15: media code */
+For hard disks, this should always be 0xf8.
+
+
+ __u16 fat_length; /* 16: sectors/FAT for FAT12/16 */
+THIS IS IGNORED BY MICROSOFT'S IMPLEMENTATION! (See section 3.3) The size in
+sectors of each file allocation table (FAT12 and FAT16 only). A 32-bit field
+is used for FAT32. This value is "read-only".
+
+
+
+ __u16 secs_track; /* 18: sectors per track */
+ __u16 heads; /* 1a: number of heads */
+These should match the BIOS geometry. The GNU Parted README file explains
+BIOS geometry.
+
+
+ __u32 hidden; /* 1c: hidden sectors (partition start) */
+On a hard disk, this should be the number of sectors from the start of the
+head (in terms of BIOS geometry) to the start of the partition. i.e. the
+S in the CHS partition start.
+
+
+ __u32 sector_count; /* 20: no. of sectors (if sectors == 0) */
+The size of the file system in sectors (if sectors is 0).
+
+
+ __u16 boot_sign; /* 1fe: always 0xAA55 */
+Boot sector signature. Don't use this exclusively to detect FAT file systems!
+It's also the signature for partition table sectors (and it appears in the
+same place too!) Idiots.
+
+3.2.2 Fields in FAT12 and FAT16
+---------------------------------
+
+ __u8 drive_num; /* 24: */
+Always 0x80.
+
+
+ __u8 ext_signature; /* 26: always 0x29 */
+Always 0x29.
+
+
+ __u32 serial_number; /* 27: */
+Serial number: Used to detect media change on floppy disk and removable drives.
+
+
+ __u8 volume_name [11]; /* 2b: */
+The disk label.
+
+
+ __u8 fat_name [8]; /* 37: */
+"FAT12\0\0\0" or "FAT16\0\0\0".
+
+
+3.2.3 Fields in FAT32
+-----------------------
+
+ __u32 fat_length; /* 24: size of FAT in sectors */
+The size in sectors of each file allocation table.
+
+
+ __u16 flags; /* 28: bit8: fat mirroring, low4: active fat */
+No idea what these are.
+
+
+ __u16 version; /* 2a: minor * 256 + major */
+Seems to be 0 (?)
+
+
+ __u32 root_dir_cluster; /* 2c: */
+The number of the first cluster in the root directory.
+
+
+ __u16 info_sector; /* 30: */
+The number of the information sector.
+
+
+ __u16 backup_sector; /* 32: */
+The number of the backup of the boot sector (i.e. this sector).
+
+
+ __u16 drive_num; /* 40: */
+Always 0x80.
+
+
+ __u8 ext_signature; /* 42: always 0x29 */
+Always 0x29.
+
+
+ __u32 serial_number; /* 43: */
+Serial number (for Echelon, or something)
+
+
+ __u8 volume_name [11]; /* 47: */
+The disk label.
+
+
+ __u8 fat_name [8]; /* 52: */
+"FAT32\0\0\0".
+
+
+3.3 Calculating the ignored fields
+-------------------------------------------------------------------------------
+The cluster_size and fat_length fields are ignored by Microsoft's
+implementation of FAT12 and FAT16, but NOT FAT32. That is, they are written out
+correctly, but NOT READ IN. (Note: if FAT32 file system is configured to
+have less than 65520 clusters, then Windows assumes it's FAT16)
+
+Since these values don't usually change unless you resize a filesystem, this
+causes no problems. However, if you want to resize the filesystem, you have to
+calculate these values to what Microsoft calculates them to, from the size of
+the filesystem. It took me 2 months to figure this out (I want to KILL
+somebody...)
+
+Here's the algorithm I came up with that seemed to match all my test data:
+(from libparted/fs_fat/calc.c)
+
+FatCluster
+fat_max_cluster_count (FatType fat_type) {
+ switch (fat_type) {
+ case FAT_TYPE_FAT12: return 0xff0;
+ case FAT_TYPE_FAT16: return 0xfff0;
+ case FAT_TYPE_FAT32: return 0x0ffffff0;
+ }
+ return 0;
+}
+
+FatCluster
+fat_min_cluster_count (FatType fat_type) {
+ switch (fat_type) {
+ case FAT_TYPE_FAT12:
+ case FAT_TYPE_FAT16:
+ return fat_max_cluster_count (fat_type) / 2;
+
+ case FAT_TYPE_FAT32: return 0xfff0;
+ }
+ return 0;
+}
+
+static int
+calc_sizes (PedGeometry* geom, PedSector align, int cluster_size,
+ PedSector root_dir_sectors, FatCluster* out_cluster_count,
+ PedSector* out_fat_size, FatType fat_type)
+{
+ PedSector data_fat_size;
+ PedSector fat_sectors;
+ PedSector cluster_sectors;
+ FatCluster cluster_count;
+ int i;
+
+ data_fat_size = geom->length - fat_min_reserved_sector_count (fat_type)
+ - align;
+ if (fat_type == FAT_TYPE_FAT16)
+ data_fat_size -= root_dir_sectors;
+
+ fat_sectors = 0;
+ for (i = 0; i < 2; i++) {
+ if (fat_type == FAT_TYPE_FAT32)
+ cluster_sectors = data_fat_size - fat_sectors;
+ else
+ cluster_sectors = data_fat_size - 2 * fat_sectors;
+
+ cluster_count = cluster_sectors / (cluster_size / 512);
+ fat_sectors = div_round_up (cluster_count + 2,
+ entries_per_sector (fat_type));
+ }
+
+ cluster_sectors = data_fat_size - 2 * fat_sectors;
+ cluster_count = cluster_sectors / (cluster_size / 512);
+
+ if (cluster_count > fat_max_cluster_count (fat_type)
+ || cluster_count < fat_min_cluster_count (fat_type))
+ return 0;
+
+ *out_cluster_count = cluster_count;
+ *out_fat_size = fat_sectors;
+
+ return 1;
+}
+
+FIXME: this is the "trial and error" algorithm. What happened to my simple,
+test one?
+
+If the implications of the above code aren't that clear, here are some of
+them:
+ * for FAT16, the minimum number of clusters is 32760.
+ * the cluster size is completely determined by the size of the file system,
+for FAT16. That means, if a file system is to be resized, it is quite
+possible that the cluster size must be changed just to be compatible
+with Microsoft's implementation (Linux, for example, doesn't calculate the
+numbers independently, so it would work fine. So always test your code on
+Microsoft as well as Linux)
+
+
+3.4 DOS/Windows bootstrap process
+-------------------------------------------------------------------------------
+All of the information that follows is from me reverse-engineering different
+versions of Microsoft's boot sectors. It's pretty weird code (as you can
+imagine...), so there might be mistakes here.
+ There are many different versions of the boot sector:
+* Windows 98/2000/ME FAT12/FAT16 (supports CHS and LBA)
+* Windows 98/2000/ME FAT32 (supports CHS and LBA)
+
+(1) The MBR, LILO, or whatever loads in the first sector of the FAT
+partition into 0000:7c00, and executes it.
+
+(2) The first sector of the FAT partition (the "boot sector") does:
+ (a) loads the Master Boot Record (sector 0 of the disk) using the
+ BIOS's CHS calls, and finds the boot partition. If the boot partition
+ has the LBA flag marked, it writes 0xe to [bp+2] (0000:7c02). The "read
+ sectors" function in the boot loader checks for 0xe here, and uses LBA if
+ it finds it, and CHS otherwise.
+
+ (b) If it is the FAT32 version of the boot sector, it loads sectors 1
+ through 3 of the partition (it finds this from the "hidden" field in the
+ FAT boot sector, that was loaded by the MBR/LILO) at address 0000:7e00, and
+ continues executing at 0000:8000. Note: the FAT16 version doesn't require
+ any more sectors to be read (they crammed it all in!), and it goes
+ directly to step 3.
+
+(3) The code loads IO.SYS (starting at address 0000:0700), off the same
+partition, and executes it, beginning execution at 0070:0200. (Note:
+According to the x86 real mode segmentation scheme, 0070:0200 refers to the
+same physical memory as 0000:0900)
+
+
+-------------------------------------------------------------------------------
+4 THE INFO SECTOR
+-------------------------------------------------------------------------------
+
+The info sector is used in FAT32 to store additional information about the
+file system.
+
+
+4.1 Data Layout
+-------------------------------------------------------------------------------
+
+struct _FatInfoSector {
+ __u32 signature_1; /* should be 0x41615252 */
+ __u8 unused [480];
+ __u32 signature_2; /* should be 0x61417272 */
+ __u32 free_clusters;
+ __u32 next_cluster; /* most recently allocated cluster */
+ __u8 unused2 [0xe];
+ __u16 signature_3; /* should be 0xaa55 */
+} __attribute__ ((packed));
+
+
+4.2 Descriptions of Fields
+-------------------------------------------------------------------------------
+
+ __u32 signature_1; /* should be 0x41615252 */
+Always 0x41615252 ("AaRR")
+
+
+ __u32 signature_2; /* should be 0x61417272 */
+Always 0x61417272 ("aArr")
+
+
+ __u32 free_clusters;
+The number of free clusters. This could be calculated by going through the
+FATs, but this is stored on shutdown to speed things up.
+
+
+ __u32 next_cluster; /* most recently allocated cluster */
+This contains the number of the last cluster allocated. This speeds up
+cluster allocation, because free clusters usually come in chunks, so you
+can scan right for free clusters in the FAT.
+
+
+ __u16 signature_3; /* should be 0xaa55 */
+Always 0xaa55.
+
+
+-------------------------------------------------------------------------------
+5 FILE ALLOCATION TABLES
+-------------------------------------------------------------------------------
+
+File allocation table (FAT) is a strange name, come to think of it. Perhaps it
+should be called cluster allocation table, or something (?). Essentially,
+it is used to represent file chains (i.e. linked lists) for files and
+directories. There are usually two FATs (one is a backup, and should be
+identical).
+
+Anyway, a FAT is essentially an array. In FAT12, each entry is 12 bits,
+FAT16 - 16 bits, FAT32 - 32 bits. Hence the names.
+
+The first byte of each FAT must match the "media" field in the boot sector.
+The rest of the first 2 entries are filled with 0xff.
+
+All remaining entries - from 2 onwards - correspond to a cluster. i.e.
+the second entry corresponds to cluster 2. Clusters are numbered from 2 onwards
+(i.e. there is no cluster 1).
+
+The number in each entry gives the number of the cluster that occurs next in
+the file chain (linked list). However, there are a few magic numbers:
+
+ * unused (0). Indicates the cluster is unused.
+ * end of file (0xff0 for FAT12, 0xfff0 for FAT16, 0x0ffffff0 for FAT32).
+Indicates this is the last cluster in the file or directory. Obviouslly for
+FAT32, the number of clusters must be < 0x0ffffff0. So it should be called
+FAT28, perhaps...
+ * bad cluster (0xff7 for FAT12, 0xfff7 for FAT16, 0x0ffffff7 for FAT32).
+Indicates the disk is physically damaged where the cluster is stored.
+
+
+-------------------------------------------------------------------------------
+6 DIRECTORY TREE
+-------------------------------------------------------------------------------
+
+The directory tree is simple: there are files and directories. Files and
+directories are stored in clusters (except the root directory on FAT12 and
+FAT16). Directories are essentially special files that contain directory
+entries.
+
+In FAT12 and FAT16, the root directory is stored immediately after the FATs.
+In FAT32, the first cluster of the root directory is given in the FAT. (To
+get the second cluster - if there is one - you just look up the FAT)
+
+
+6.1 Directory Entries
+------------------------------------------------------------------------------
+Directories are made up of directory entries, each of which represent a file,
+a directory or part of a file name (the VFAT extension - YUCK!!!).
+
+Each directory (except the root directory) contains a '.' (this directory) and
+'..' (parent directory) entry.
+
+6.1.1 Fields
+--------------
+
+From libparted/fs_fat/fat.h:
+
+struct _FatDirEntry {
+ __u8 name[8];
+ __u8 extension[3];
+ __u8 attributes;
+ __u8 is_upper_case_name;
+ __u8 creation_time_low; /* milliseconds */
+ __u16 creation_time_high;
+ __u16 creation_date;
+ __u16 access_date;
+ __u16 first_cluster_high; /* for FAT32 */
+ __u16 time;
+ __u16 date;
+ __u16 first_cluster;
+ __u32 length;
+} __attribute__ ((packed));
+
+6.1.2 Field Descriptions
+--------------------------
+
+ __u8 name[8];
+The first part of the file name. Eg, for a file called README.TXT, this is
+README. Files with names longer than 8 characters use the VFAT extension (not
+described here). When a file is deleted, the first character is set to 0xe5.
+If the first character is 0x0, then the entire directory entry is unused.
+
+
+ __u8 extension[3];
+The last part of the file name. Eg, for a file called README.TXT, this is TXT.
+This explains all those .HTM files around the place...
+
+
+ __u8 attributes;
+If this is 0x0f, then this directory entry is a VFAT entry, and stores part
+of a file name. Otherwise, it's treated as various bit fields:
+
+ 0x1 read-only
+ 0x2 hidden
+ 0x4 system
+ 0x8 volume label
+ 0x10 directory
+ 0x20 archived
+
+
+ __u8 is_upper_case_name;
+A Microsoft cludge: create a file with 8.3 name BUT containing small letters
+(like ReadMe.Txt) which is treated as an LFN (long file name) and occupies
+three directory entries. Now when you rename this file to all uppercase
+README.TXT,- under Windows NT 4 the then superfluous LFN-VFAT entries are
+removed, resulting in a smaller directory, but under Windows 9x the LFN-VFAT
+entries are just upd- and this flag is set. Executing DEFRAG on such entries
+MIGHT then remove the superfluous LFN-VFAT entries and shrink the directory.
+
+
+ __u8 creation_time_low; /* milliseconds */
+ __u16 creation_time_high;
+ __u16 creation_date;
+Creation time and date. Not used wih MS-DOS <7.0!
+
+
+ __u16 access_date;
+Last access date. Not used wih MS-DOS <7.0!
+
+
+ __u16 first_cluster_high; /* for FAT32 */
+High 32 bits of the first cluster in the file or directory (FAT32 only)
+
+
+ __u16 time;
+ __u16 date;
+?
+
+
+ __u16 first_cluster;
+Low 16 bits of first cluster.
+
+
+ __u32 length;
+Length of file in bytes.
+
+
+
+===============================================================================
+ PART II - GNU PARTED'S FAT IMPLEMENTATION
+===============================================================================
+
+-------------------------------------------------------------------------------
+7 RESIZING "ISSUES"
+-------------------------------------------------------------------------------
+
+To resize a FAT file system, a program must:
+ * copy all used clusters that lie outside of the new partition onto free
+space on that partition. The directory tree and FATs must be updated to
+reflect this.
+ * grow or shrink the file allocation table(s) to the size corresponding
+to the size of the partition.
+ * convert between FAT16 and FAT32 if necessary. This involves:
+ - changing the form of the root directory (FAT16 has it's before the
+ clusters whereas FAT32 stores it in normal clusters).
+ - creating space for the backup boot sector and info sector.
+ - updating the directory tree to use 32 bit first cluster entries.
+ * align the start of the clusters (using the "reserved" field in the
+boot sector), so that the clusters that are common to the old and new
+partition can be preserved.
+ * re-number clusters. e.g. if you chop out some clusters from the beginning
+(i.e. move the start forward), then the first cluster (i.e. number 2) will
+be refer to a different cluster on the disk. The directory tree and FATs must
+be updated to reflect this.
+ * create a new boot sector (and the info sector and backup boot sector for
+FAT32)
+
+
+-------------------------------------------------------------------------------
+8 OVERVIEW OF GNU PARTED'S STRATEGY
+-------------------------------------------------------------------------------
+
+GNU Parted copies all clusters that are not accessible from the new file system
+(either because it lies outside the file system, or file system meta-data must
+reside there instead) to an accessible place.
+
+Since all clusters must be renumbered (in most cases), the entire directory
+tree must be updated. However converting the directory tree from one numbering
+system to another would break the file system if it was interrupted halfway
+through. Instead, GNU Parted duplicates the directory tree (except the root
+directory for FAT16) along with clusters that need to be copied because they
+lie outside the new file system. The directory tree is duplicated at the same
+time as inaccessible clusters are. The relevant function,
+needs_duplicating() in libparted/fs_fat/clstdup.c is:
+
+ static int
+ needs_duplicating (FatOpContext* ctx, FatCluster cluster)
+ {
+ FatSpecific* fs_info = FAT_SPECIFIC (ctx->old_fs);
+
+ return (fs_info->fat_flag_map [cluster] == FAT_FLAG_FILE
+ && !fat_op_context_map_static_cluster (ctx, cluster))
+ || fs_info->fat_flag_map [cluster]
+ == FAT_FLAG_DIRECTORY;
+ }
+
+
+
+A good overview of this implementation is in the fat_resize() function, in
+libparted/fs_fat/resize.c (slightly edited):
+
+ int
+ fat_resize (PedFileSystem* fs, PedGeometry* geom)
+ {
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ FatSpecific* new_fs_info;
+ FatOpContext* ctx;
+ PedFileSystem* new_fs;
+
+ ctx = create_resize_context (fs, geom);
+ if (!ctx)
+ return 0;
+ new_fs = ctx->new_fs;
+ new_fs_info = FAT_SPECIFIC (new_fs);
+
+ if (!fat_duplicate_clusters (ctx))
+ return 0;
+ if (fs_info->fat_type == FAT_TYPE_FAT16
+ && new_fs_info->fat_type == FAT_TYPE_FAT32) {
+ if (!alloc_root_dir (ctx))
+ return 0;
+ }
+ if (!fat_construct_new_fat (ctx))
+ return 0;
+ if (!fat_construct_dir_tree (ctx))
+ return 0;
+ if (!fat_table_write_all (new_fs_info->fat, new_fs))
+ return 0;
+
+ if (!fat_boot_sector_generate (&new_fs_info->boot_sector,
+ new_fs))
+ return 0;
+ if (!fat_boot_sector_write (&new_fs_info->boot_sector, new_fs))
+ return 0;
+ if (new_fs_info->fat_type == FAT_TYPE_FAT32) {
+ if (!fat_info_sector_generate (
+ &new_fs_info->info_sector, new_fs))
+ return 0;
+ if (!fat_info_sector_write (&new_fs_info->info_sector,
+ new_fs))
+ return 0;
+ }
+
+ if (!resize_context_assimilate (ctx))
+ return 0;
+
+ return 1;
+ }
+
+
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 0000000..f04e7de
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,17 @@
+# C must be the first sub-directory because it contains the POT files.
+SUBDIRS = C pt_BR
+
+info_TEXINFOS = parted.texi
+MAKEINFO = makeinfo --no-split
+
+EXTRA_DIST = FAT \
+ USER.jp \
+ API \
+ fdl.texi \
+ parted-pt_BR.texi
+
+.PHONY: updatepo
+updatepo:
+ list='$(SUBDIRS)'; for dir in $$list; do \
+ $(MAKE) -C "$$dir" updatepo; \
+ done
diff --git a/doc/USER.jp b/doc/USER.jp
new file mode 100644
index 0000000..162ac07
--- /dev/null
+++ b/doc/USER.jp
@@ -0,0 +1,1788 @@
+==============================================================================
+ GNU Parted ܸ
+==============================================================================
+
+ written by Andrew Clausen <clausen@gnu.org>
+ translated by Yoshinori K. Okuji <okuji@gnu.org>
+
+ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001 Yoshinori K. Okuji
+
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.1
+ or any later version published by the Free Software Foundation;
+ with the no Invariant Sections, with the no Front-Cover Texts, and
+ with no Back-Cover Texts. A copy of the license is included in the
+ file, COPYING.DOC.
+
+
+--------
+
+1 Ƴ
+2 Parted λ
+3 BIOS ȥե०
+4 ֡ȡ
+5 ڥ졼ƥ󥰡ƥ
+6 ե롦ƥ
+7 LVMեȥ RAID ľŪʥե롦ƥؤΥ
+8 ǥ᡼
+9 ʤȴϢեȥ
+
+
+1 Ƴ
+1.1 ɬפʥեȥ
+1.2 ݡȤץåȥۡ
+1.3 饤
+1.4 ѥ
+1.5 GNU Parted ֡ȡǥ
+
+2 Parted λ
+2.1 Parted μ¹
+2.2 ץ
+2.3 ޥɤγ
+2.4 ޥɤξܺ٤ʲ
+2.5
+
+3 BIOS ȥե०
+3.1 PC BIOS
+3.2 Macintosh OpenFirmware
+3.3 PC98 BIOS
+
+4 ֡ȡ
+4.1 LILO (Linux Loader)
+4.2 GNU GRUB (GRand Unified Bootloader)
+4.3 MS DOSMS Windows 9xMS Windows ME
+4.4 MS Windows NT
+4.5 MS Windows 2000
+4.6 Quik
+4.7 Yaboot
+
+5 ڥ졼ƥ󥰡ƥ
+5.1 GNU/Linux FreeBSD
+5.2 MS Windows OS/2
+5.3 MacOS
+
+6 ե롦ƥ
+6.1 Ext2
+6.2 FAT16 FAT32
+6.3 Reiserfs
+
+7 LVMեȥ RAID ľŪʥե롦ƥؤΥ
+7.1 եȥ RAID LVM ѡƥκ
+7.2 եȥ RAID LVM ܥ塼Υե롦ƥ
+
+8 ǥ᡼
+
+9 ʤȴϢեȥ
+
+
+------------------------------------------------------------------------------
+1 Ƴ
+------------------------------------------------------------------------------
+
+GNU Parted ϥѡƥ䤽ξۤե륷ƥꡢ
+˴ꡢ礭ѹꡢꡢʣ뤿ΥץǤ
+
+ڥ졼ƥ󥰡ƥΰꡢǥλˡ
+ꡢϡɡǥ֤ǥǡ򥳥ԡꡢ
+ԥ塼˷֤󥹥ȡ뤵줿Ķʣ֥ǥ
+᡼󥰡פԤΤˡΩޤ
+
+βǤϡѡƥե륷ƥ˴ؤμꤷƤޤ
+⤷äٶСPartition mini-HOWTO ɤɤǤ礦
+
+ϤäȤʤΥǥȥӥ塼˴ޤޤƤ뤫ʲ
+ѲǽǤ:
+
+ http://www.linuxdoc.org/HOWTO/mini/Partition/index.html
+
+GNU Parted ϥǡ»βǽǾ¤α褦߷פޤ
+㤨С(­Τ褦) 㳲δ֤˥ǡ»Τ򤱤
+褦߷פ졢¿ΰԤޤParted ˥Х
+⤷ʤΤǡפʥեХååפƤ٤Ǥ
+
+GNU Parted Υۡڡ www.gnu.org/software/parted Ǥ
+ftp.gnu.org/gnu/parted ɤǤޤ
+
+Parted Υᥤ󥰡ꥹȤ parted@gnu.org Ǥɤˤϡ̾
+subscribeפȽ񤤤 bug-parted-request@gnu.org ˥᡼ФƤ
+ɤξ䥢֤ϰʲѲǽǤ:
+
+ http://mail.gnu.org/mailman/listinfo/bug-parted
+
+Х bug-parted@gnu.org äƤХȤ
+GNU Parted ΥСޤƤ⤷ΥХѡƥ
+ơ֥˴طƤʤ顢ΥޥɤνϤƤ:
+
+ # fdisk /dev/hda -l
+ # fdisk /dev/hda
+ Command (m for help): p
+ Command (m for help): x
+ Extended command (m for help): p
+
+ڤˤΥꥹȤ˽Ƥ - ޤʤμ䤬
+ƤʤȤǧƤ⤷⤬ʬʤСäȾ꤯
+Ǥ褦桹˶ƤŪů: ⤷ʤ
+ɬפʤ顢ʤ (¾ο͡) ɬפʤ褦ˡ
+ɬפޤ
+
+ޤ桹ϤʤΰոȤƤʹפäƤޤ :-)
+
+
+1.1 ɬפʥեȥ
+------------------------------------------------------------------------------
+ * e2fsprogs ѥåΰǤ롢libuuid⤷äƤʤʤ顢
+
+ http://web.mit.edu/tytso/www/linux/e2fsprogs.html
+
+ Ǥޤ
+
+⤷ Parted e2fsprogs 򥳥ѥ뤷ʤ顢e2fsprogs "make
+install" "make install-libs" ɬפ뤳ȤդƤ
+
+ * GNU Readline (Ǥ)
+
+ ftp://ftp.gnu.org/gnu/readline
+
+ Ǥޤ
+
+⤷ Parted 򥳥ѥ뤷Ƥơreadline äƤʤʤ顢Parted
+readline ݡȤ ./configure ؤ --disable-readline ץ̵
+ˤǤޤ
+
+ * ⤷ݲݡȤ˾ޤʤ顢ѥѤ GNU gettext
+ (뤤ϡߴեȥ)
+
+ ftp://ftp.gnu.org/gnu/gettext
+
+
+1.2 ݡȤץåȥۡ
+------------------------------------------------------------------------------
+˾餯ϡΰɽä礹뤳Ȥ򡣤⤷Υץåȥۡ
+ΰĤäƤʤʤ (ΤȤ Linux!)֡ȡǥȤޤ
+( 1.5 򻲾)
+
+ * Linux >= 2.0.x, 2.2.x (Alphax86 PCPC98Macintosh PowerPCSun)
+
+
+: GNU libc 2.1 ʾ夬ɬפǤ餯 --disable-nls ץ
+뤳ȤˤäơäȸŤСѤǤޤ (: ɬ
+ϤڤȤȻפޤ ٤: libc 2.0 ưǧ!)
+
+
+1.3 饤
+------------------------------------------------------------------------------
+GNU Parted ϥե꡼եȥǤꡢGNU General Public License
+С2ŬѤƤޤ Parted ʪȤȤˡCOPYING
+ե˴ޤƤϤǤ⤷ʤС
+Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+˼񤤤Ƥ
+
+: libparted GNU Parted ΰȹͤƤޤ GNU General
+Public License ˤäݸƤޤ GNU Lesser General Public
+License (LGPL) βǤϥ꡼ơؤޤ١
+
+
+1.4 ѥ
+------------------------------------------------------------------------------
+GNU Parted 򥳥ѥ뤷С̾盧Τ褦ˤƹԤޤ:
+
+ $ ./configure
+ $ make
+
+./configure ФƿĤΥץѰդƤޤ:
+
+ --without-readline readline Ѥޤ󡣤Ϥޤ
+ ¿Υ饤֥꤬ѤǤʤ褦ʡ
+ ۵ѥǥʤɤΤǤ
+
+ --disable-nls 쥵ݡȤäޤ
+ glibc θŤС۵ѥǥ
+ Ŭǽ︺glibc Ȱ˻
+ ΤǤ
+
+ --disable-shared ͭ饤̵֥ˤޤϤ⤷
+ ֤蘆줿쥸 (spilled register)
+ ˴ؤ륳ѥ롦顼ä顢
+ GNU libc θŤСȰ˻Ȥ
+ ɬפˤʤ뤫⤷ޤ󡣥֡/۵
+ ǥˤͭѤǤ礦
+
+ --enable-all-static ŪʥХʥȤơParted ΥХ
+ ʥۤޤϥ֡ȡǥ
+ ǡȤΤ⡢ʤ饤֥
+ ֡ȡǥ˥󥹥ȡ뤹ɬפ
+ ʤǤ (¾ΥץबɬפȤ뤫
+ ⤷ʤ...): strip(1)
+ Ǥ礦
+
+
+1.5 GNU Parted ֡ȡǥ
+------------------------------------------------------------------------------
+GNU/Linux 򥤥󥹥ȡ뤷Ƥʤޥ Parted ¹Ԥ뤤ϡ
+롼ȡѡƥ֡ȡѡƥ礭ѹʤ顢
+֡ȡǥѤɬפǤ礦
+
+֡ȡǥΥ᡼ϰʲǽǤ:
+
+ ftp://ftp.gnu.org/gnu/parted/bootdisk/partboot.img
+
+ºݤ˥֡ȡǥˤϡ(GNU/Linux Ǥ) Ǥ
+:
+
+ # dd if=partboot.img of=/dev/fd0 bs=1440k
+
+뤤ϡDOS RAWRITE.EXE ȤäƤ
+
+Աˤ⡢Υ֡ȡǥϤޤ깭ϰϤΥϡɥ򥵥ݡȤ
+ޤ󡣤⤷ʤΥϡɡǥݡȤƤʤʤ顢ʬ
+Υ֡ȡǥɬפǤ礦parted ΥХʥ parted
+֡ȡǥ¾Υǥإԡ (ˡϰʲ) ȤǤ
+ޤ¾Υ֡ȡǥꡢʬѤΤΤ뤳ȤǤޤ
+Ĥ館 parted ֡ȡǥ뤿Υ롦ץȡmkparted
+⤷ޤ󡣤ϤǤޤ:
+
+ ftp://ftp.tux.org/pub/people/kent-robotti/mkparted
+
+֡ȡǥ¾Υǥ parted 򥳥ԡˤ:
+(1) Parted Υ֡ȡǥǵưޤ
+(2) ¾ (ext2 ) եåԥǥޤ⤷줬եޥå
+Ƥʤʤ顢"parted /dev/fd0 mklabel loop mkfs 1 ext2"
+ե륷ƥǤޤ
+(3) ΥեåԥǥޥȤޤ
+("mount -t ext2 /dev/fd0 /mnt/floppy")
+(4) /sbin/parted 򤽤Υեåԥ˥ԡޤ
+("cp /sbin/parted /mnt/floppy")
+(5) /lib/* 򤽤Υեåԥ˥ԡޤ ("cp /lib/* /mnt/floppy)
+(6) Υեåԥ򥢥ޥȤޤ ("umount /mnt/floppy")
+(7) ʤΥϡɡǥ򥵥ݡȡؤƤ٥֡ȡǥդ
+ޤ (ҥ: 礭ʥߥ顼ȾǤޤޤʥǥȥӥ塼󤫤
+۵ѥǥõƤߤ褦Ȥʤ)
+(8) ʤζ۵ѥǥǵưޤ Parted 򥳥ԡǥ
+ޥȤޤ
+(9) Parted ¹Ԥޤ:
+ # cd /mnt/floppy
+ # LD_LIBRARY_PATH=. ./parted
+
+
+------------------------------------------------------------------------------
+2 Parted λ
+------------------------------------------------------------------------------
+ˤǥʬϴʬäƤޤϹθɬפ
+롢ΰۤʤäƥ֤ǤߺѤ뤫Ǥ:
+
+ * BIOS ե० - ΥåʤɤԤʤΥԥ塼
+ ROM åפȤ߹ޤ줿ץࡣΥƥΥץ(ưפˤ)
+ѹǤޤBIOS ե०ץ: AmiBIOSAward
+PhoenixOpenFirmwareΥץΤĤäƤǤ礦
+
+ * ֡ȡ - Ȥڥ졼ƥ󥰡ƥ򤹤뤳Ȥ
+ǽˤΥڥ졼ƥ󥰡ƥɤץࡣ: LILO
+GRUBYabootQuikäʣμΥڥ졼ƥ󥰡ƥ򥤥󥹥ȡ
+Ƥʤ顢ʣΥ֡ȡ򥤥󥹥ȡ뤷Ƥ뤫⤷ޤ
+
+ * Parted ư륪ڥ졼ƥ󥰡ƥ (¤ϡ GNU/Linux
+˰㤤ޤ)ơʤѤ¾Υڥ졼ƥ󥰡ƥࡣ
+
+ * ե롦ƥμ - ǡѡƥ˳Ǽʡ
+: ext2fathfsreiserfsФаۤʤե롦ƥ
+ޤѡƥäƤǤ礦
+
+Parted Ͼ嵭ΤȤ߹碌򥵥ݡȤƤꡢϤäȥݡ
+Ǥ礦椨3Ϥ BIOS ˴ؤơ4Ϥ֡ȡˤĤơ
+5Ϥڥ졼ƥ󥰡ƥˤĤơơ6Ϥե롦ƥ
+Ĥƽ񤫤Ƥޤ
+ ξϤ Parted λˡ򵭽ҤƤꡢϤɤʥƥȤ
+Ƥ뤫ˤ餺ƱǤξϤɤߡơ3456ϡ
+줾ɤ٤Ǥʤ˴ط륻ɤɬ
+ޤ㤨С⤷֡ȡȤ LILO ȤäƤʤ顢
+Ƴȡ4Ϥ LILO ˴ؤ륻ɤɬפޤ
+
+
+2.1 Parted μ¹
+------------------------------------------------------------------------------
+
+Parted Ĥͼޥɡ饤÷äƤޤParted Ͼ
+Τ褦˳Ϥ٤Ǥ:
+
+ # parted DEVICE
+
+ǡDEVICE Խϡɡǥɥ饤֤Ǥ(⤷ʤդ
+Ƥʤ顢Parted ϤɤΥǥХ˾ǤΤ¬褦Ȼߤޤ)
+
+ޥɡ饤Υ⡼ɤǤϡθ˰ĤʾΥޥɤ³ޤ
+:
+
+ # parted /dev/sda resize 1 52 104 mkfs 2 fat
+
+(--help Τ褦) ץϥޥɡ饤ǤΤ߻ꤹ뤳ȤǤޤ
+
+÷⡼ɤǤϡޥɤϰ٤˰ĤĥץץȤϤޤ:
+
+ (parted) resize 1 52.0005 104.5
+ (parted) mkfs 2 fat
+
+ۣǤʤάϵޤ㤨Сprintפˡpפ򡢡resize
+ˡreפǤĤȤǤޤޥɤϱѸǤ⡢ʤǤ
+Ǥޤ (⤷ʤθ줬Ƥʤ)ΤȤۣ椵
+Ф⤷ޤ
+
+ޤѡƥΰ֤б˾̤Ǥ뤳Ȥդ
+ (ᥬХñ̤)
+
+
+2.2 ץ
+------------------------------------------------------------------------------
+-h, --help إסåɽޤ
+-i, --interactive ɬפʾ̤ǡ桼δĤ¥ޤ
+-s, --script 褷ƥ桼δĤ¥ޤ
+-v, --version Сɽޤ
+
+
+2.3 ޥɤγ
+------------------------------------------------------------------------------
+check MINOR ե륷ƥ˴ñʸԤޤ
+cp [FROM-DEVICE] FROM-MINOR TO-MINOR ե륷ƥ¾Υѡƥ
+ ˥ԡޤ
+help [COMMAND] ŪʥإפCOMMAND ˴ؤإפ
+ ɽޤ
+mklabel LABEL-TYPE ǥ٥(ѡƥ
+ ơ֥)ޤ
+mkfs MINOR FS-TYPE ѡƥ MINOR ˥ե륷ƥ
+ FS-TYPE ޤ
+mkpart PART-TYPE [FS-TYPE] START END ѡƥޤ
+mkpartfs PART-TYPE FS-TYPE START END ե롦ƥȰ˥ѡ
+ ƥޤ
+move MINOR START END ѡƥ MINOR ưޤ
+name MINOR NAME ѡƥ MINOR NAME ̾դޤ
+print ѡƥ󡦥ơ֥ɽޤ
+quit ץλޤ
+resize MINOR START END ѡƥ MINOR Υե륷ƥ
+ 礭ѹޤ
+rm MINOR ѡƥ MINOR ޤ
+select DEVICE ԽǥХӤޤ
+set MINOR FLAG STATE ѡƥ MINOR Υե饰ѹޤ
+
+FLAG bootrootswaphiddenraidlvmlba ΤΰĤǤ
+
+FS-TYPE ext2FAThfslinux-swapntfsreiserfs ΤΰĤǤ
+
+LABEL-TYPE sunbsdmaclooppc98msdosgpt ΤΰĤǤ
+
+MINOR Linux ˻ȤѡƥֹǤ
+
+PART-TYPE primarylogicalextended ΤΰĤǤ
+ (primary) ѡƥɸŪʡĥΤʤѡƥǤ
+ĥ (extended) ѡƥϤ¾ΥѡƥΤˤ
+(logical) ѡƥ󡢤ޤΥѡƥǤˤ
+ˤϡĥѡƥϥǥɥ饤֤Τ褦˹ۤƤꡢ
+ִܡץѡƥ (ѡƥ) ȡǤդǡ̤Ρֳĥ
+ѡƥݻ줬ƤӺʬ ...
+ǤĥѡƥϰĤǤʤФʤʤơĤδ
+ѡƥΰޤ⤷ msdos ǥ٥Ȥä
+ʤʤ顢ܥѡƥĤȤǤޤ
+
+START END ϥϤޤ롢ᥬХȤɽޤȤäƤ
+ޤ (: 1258.9)
+
+
+2.4 ޥɤξܺ٤ʲ
+------------------------------------------------------------------------------
+
+2.4.1 check
+-------------
+ check MINOR ե륷ƥ˴ñʸԤޤ
+
+check ޥɤϥե륷ƥ˥顼뤫ɤ򸡺ޤ
+
+:
+
+ (parted) check 1
+
+
+2.4.2 cp
+----------
+ cp [FROM-DEVICE] FROM-MINOR TO-MINOR ե륷ƥ¾
+ ѡƥ˥ԡޤ
+
+ѡƥ¾Υѡƥ˥ԡŪΥѡƥ
+äȤޤǽ MINOR ֹϸΥѡƥؤ
+ܤŪΥѡƥؤޤ
+
+ǤդΥѥ᡼ȤơǥХͿ뤳ȤǤŪ
+ѡƥ󤬤ɤΥǥХˤ뤫ꤷޤ
+
+ݡȤƤե륷ƥ:
+ * ext2 (ŪΥѡƥ󤬸Υѡƥ礭Ȥ)
+ * FAT
+ * linux-swap (Ūѡƥˤ mkfs )
+
+:
+
+ (parted) cp /dev/hdb 2 3
+
+ /dev/hdb Υѡƥ2 (Ĥޤꡢ/dev/hdb2) Parted
+ Ȥ˻ȤäǥХΥѡƥ3˥ԡѡƥ3
+ ΰƤ˲ޤ
+
+
+2.4.3 help
+------------
+ help [COMMAND] ŪʥإפCOMMAND ˴ؤ
+ إפɽޤ
+
+:
+
+ (parted) help resize
+
+
+2.4.4 mklabel
+---------------
+ mklabel LABEL-TYPE ǥ٥(ѡƥ
+ ơ֥)ޤ
+
+ǥ٥򡢥 LABEL-TYPE Ǻޤǥ
+٥ϥѡƥĤޤ󡣤Υޥɤ (̾)Ū
+äơǡ˲ޤ󤬡ŪǽˤƤޤѡƥ
+ˤϡgpart ( 9 򻲾) Τ褦ʥץѤɬ
+Ǥ礦(Τ¤) gpart msdos ǥ٥ˤȤޤ
+桹Τεǽ Parted ˲ä뤫⤷ޤ󡢤뤤ϡ٤Ǥ礦
+
+: ߤʡ֥ǥ٥פ˰㤦դȤ褦Ǥ - ʲƱ
+ΤǤ: ѡƥ󡦥ơ֥롢ѡƥ󡦥ޥåסޤx86 ޥ
+Υޥ֡ȡ쥳ɤϥѡƥ󡦥ơ֥Ʊ˼
+Ƥޤ (Parted ѤΤˤΤȤΤɬפϤޤ)
+
+ݡȤƤǥ٥:
+ * bsd
+ * loop (ľŪʥǥ)
+ * gpt
+ * mac
+ * msdos
+ * pc98
+ * sun
+
+:
+
+ (parted) mklabel msdos
+
+
+2.4.5 mkfs
+------------
+ mkfs MINOR FS-TYPE ѡƥ MINOR ˥ե륷ƥ
+ FS-TYPE ޤ
+
+ѡƥ˿ե륷ƥΥѡƥ
+¸ߤǡ˲ޤ
+
+ݡȤƤե롦ƥ:
+ * ext2
+ * FAT
+ * linux-swap
+
+:
+
+ (parted) mkfs 2 fat
+
+
+2.4.6 mkpart
+--------------
+ mkpart PART-TYPE [FS-TYPE] START END ()ե륷ƥ
+ 餺˥ѡƥ
+ ޤǡѡƥ
+ ǤϡFS-TYPE ɬ
+ Ȥޤ
+
+ե륷ƥؤˡ١ѡƥޤ
+϶˺ƤޤäѡƥΤΩޤ
+
+PART-TYPE ϤΤΰĤǤ: primary ()extended (ĥ)
+logical ()extended logical msdos ǥ٥ФƤΤ
+Ѥޤ
+
+ݡȤƤե롦ƥ:
+ * ext2
+ * FAT
+ * HFS
+ * linux-swap
+ * NTFS
+ * reiserfs
+
+:
+
+ (parted) mkpart logical ext2 0.0 692.1
+
+
+2.4.7 mkpartfs
+----------------
+ mkpartfs PART-TYPE FS-TYPE START END ե륷ƥȰ
+ ѡƥޤ
+
+
+ե륷ƥդǿѡƥޤ
+ޤäѡƥΤˡΥޥɤȤʤǤ
+( mkpart ȤäƤ)
+
+PART-TYPE ϤΤΰĤǤ: primary ()extended (ĥ)
+logical ()extended logical msdos ǥ٥ФƤΤ
+Ѥޤ
+
+ݡȤƤե롦ƥ:
+ * ext2
+ * FAT
+ * linux-swap
+
+:
+
+ (parted) mkpartfs logical ext2 440 670
+
+
+2.4.8 move
+------------
+ move MINOR START [END] ѡƥ MINOR ưޤ
+
+ѡƥưޤ : move Ϸ褷ƥޥʡֹѹޤ
+
+⤷ END ꤵʤСѡƥ礭Ʊޤޤˤʤޤ
+
+ݡȤƤե롦ƥ:
+ * ext2 (ŪΥѡƥ󤬸Υѡƥ礭Ȥ)
+ * FAT
+ * linux-swap
+
+
+2.4.9 name
+------------
+ name MINOR NAME ѡƥ MINOR NAME ̾դ
+ ޤ
+
+ѡƥ̾դޤ (Mac PC98 ) ̾ϥȤǰϤ
+ޤ :
+
+ (parted) name 2 'Secret Documents'
+
+
+2.4.10 print
+-------------
+ print ѡƥ󡦥ơ֥ɽޤ
+
+ѡƥ󡦥ơ֥ɽޤ
+
+:
+
+ (parted) print
+ Disk geometry for /dev/hda: 0.000-2445.679 megabytes
+ Disk label type: msdos
+ Minor Start End Type Filesystem Flags
+ 1 0.031 945.000 primary FAT boot, lba
+ 2 945.000 2358.562 primary ext2
+ 3 2358.562 2445.187 primary linux-swap
+
+
+2.4.11 resize
+--------------
+ resize MINOR START END ѡƥ MINOR Υե
+ ƥ礭ѹޤ
+
+ѡƥ礭ѹޤ : resize Ϸ褷ƥޥʡֹѹ
+ޤ󡣺Ƥӡ: ĥѡƥ󤬴Ƥѡƥ
+ޤǤ¤ꡢĥѡƥ礭ѹǤޤ
+
+Parted ϥե롦ƥब֥ǥե饰פƤ뤳Ȥ׵ᤷʤȤ
+դƤ (ɬפʤ顢Parted ϰ˥ǡưǤޤ)ǥե饰
+Τϻ̵֤̤Ǥ⤷ʤ!
+
+ݡȤƤե롦ƥ:
+ * ext2 - : START ϸŤ START ƱǤʤФʤޤ
+ * FAT
+ * linux-swap
+
+:
+
+ (parted) resize 3 200 850
+
+
+2.4.12 rm
+----------
+ rm MINOR ѡƥ MINOR ޤ
+
+ѡƥޤ⤷ˤΥޥɤǥѡƥ
+Ƥޤä顢᤹ mkpart ȤäƤ (mkpartfs Ǥ
+ؤޤ)ޤ»ǥ٥뤿ˡ
+gpart ץȤȤǽǤ (6Ϥ򻲾)
+
+msdos ǥ٥Τ: ⤷ѡƥС
+礭ޥʡֹդѡƥֹ椬դľ
+Ǥ礦㤨С⤷ 6 ΥޥʡֹѡƥС
+ֹ椬 789 ä logical ѡƥϤ줾 678 ˤʤޤ
+ΤȤΤˡ/etc/fstab 򹹿ʤФʤޤ
+
+:
+
+ (parted) rm 3
+
+
+2.4.13 select
+--------------
+ select DEVICE ԽǥХ򤷤ޤ
+
+Parted ԽǥХ򤷤ޤǥХ̾ Linux Υϡɡǥ
+ǥХ뤤ϡ⤷ե롦ƥؤľܥ׵ᤵ
+ʤ顢ѡƥ䡢եȥ RAID ǥХLVM ܥ塼
+Ǥ礦
+
+:
+
+ (parted) select /dev/hdb
+
+
+2.4.14 set
+-----------
+ set MINOR FLAG STATE ѡƥ MINOR Υե饰
+ ѹޤ
+
+ѡƥΥե饰ѹޤե饰ϡonפoffפΤɤ餫
+Υե饰ΰ뤤ϡʤȤäƤǥ
+٥˱ơѤǤǤ礦:
+ * boot (MacMSDOSPC98) - Υѡƥ󤫤鵯ưСͭ
+٤Ǥΰ̣ϥǥ٥֤ǤޤޤǤMSDOS ǥ
+٥ǤϡĤΥѡƥưǽˤʤޤ⤷ѡƥ
+ LILO 򥤥󥹥ȡ뤷Ƥʤ顢ΥѡƥϵưǽǤʤ
+ФʤޤPC98 ǥ٥ǤϡƤ ext2 ѡƥ󤬵ư
+ǽǤʤФʤޤ ( Parted ˶ޤ)
+ * lba (MSDOS) - MSDOSMS Windows 9x MS Windows ME ܤȤ륪ڥ졼
+ƥ󥰡ƥ˥˥ (LBA) ⡼ɤȤ褦˻ؼ뤿ˡΥե饰
+ͭˤǤޤ
+ * root (Mac) - Υѡƥ Linux ˤäƻѤ롼ȡǥХ
+ʤ顢Υե饰ͭˤ٤Ǥ
+ * swap (Mac) - Υѡƥ Linux ˤäƻѤ륹åסǥ
+ʤ顢Υե饰ͭˤ٤Ǥ
+ * hidden (MSDOS, PC98) - ޥեȤΥڥ졼ƥ󥰡ƥफ
+ѡƥ򱣤ˡΥե饰ͭˤǤޤ
+ * raid (MSDOS) - Linux ˤΥѡƥ󤬥եȥ RAID ѡƥ
+Ǥ뤳Ȥ򶵤뤿ˡΥե饰ͭǤޤ
+ * LVM (MSDOS) - Linux ˤΥѡƥʪܥ塼Ǥ뤳Ȥ򶵤
+뤿ˡΥե饰ͭˤǤޤ
+
+print ޥɤϳƥѡƥФͭˤƤե饰Ƥɽ
+
+:
+
+ (parted) set 1 boot on
+
+
+2.4.15 quit
+------------
+ quit ץλޤ
+
+Parted λޤLinux ͥ뤬 Parted ǥФƹԤä
+ѹΤΤϡParted λǤʤ顢ޥɤǤ
+ǰѹϡؤ餯١ޥɤǤƤФޥǥ
+ȿǤǤ礦Ǥ⡢Linux ΥåǥΥϡɥ
+å夬ٱ䤵뤫⤷ޤ
+
+
+2.5
+------------------------------------------------------------------------------
+
+ʲǡǤ⤢դ줿ޤ褦˻ߤޤ㳰ϥǥ
+᡼󥰤ǡ8ϤǰƤޤ
+
+2.5.1 1
+-----------------
+
+
+
+ʤΥǥγƤΤ褦ǤȹͤƤ:
+
+ (parted) print
+ Disk geometry for /dev/hda: 0.000-1000.000 megabytes
+ Disk label type: msdos
+ Minor Start End Type Filesystem Flags
+ 1 0.063 500.000 primary ext2
+ 2 500.000 625.000 primary linux-swap
+
+ΥǥκǸ (ѡƥ 2 θ) 375 Mb ζΰ褬ޤ
+ѡƥ 1 ext2 ե롦ƥ줬롼ȡǥХ
+ѡƥ 2 ϥåסǥХǤ
+
+ΥǥκǸζΰѡƥ 1 Υե롦ƥѤ˻
+äȤޤ
+
+
+(1) ʲʳǡѡƥ 1 Υ롼ȡե롦ƥȥѡƥ
+ 2 ΥåסǥХξޤ椨ɤΥѡ
+ƥѤƤƤϤޤ¿ʬ Parted Υ֡ȡǥ
+Ѥ٤Ǥ ( 1.5 򻲾)Υ֡ȡǥ顢Parted
+¹Ԥޤ:
+
+ # parted /dev/hda
+
+(2) ѡƥ 2 (åסѡƥ) ޤ̡ǡ
+äƤѡƥϤʤǤ礦֥åס
+ (ޥ) ƤʤȤåסѡƥϥǡޤ
+ǤޤΤǡΥåסѡƥǺ뤳
+Ǥޤ
+
+ (parted) rm 2
+
+(3) ΥǥκǸ˿åסѡƥޤ:
+
+ (parted) mkpartfs primary linux-swap 875 999.9
+ (parted) print
+ Disk geometry for /dev/hda: 0.000-1000.000 megabytes
+ Disk label type: msdos
+ Minor Start End Type Filesystem Flags
+ 1 0.063 500.000 primary ext2
+ 2 875.000 1000.000 primary linux-swap
+
+(4) ܤΰ˸äơѡƥ 1 礵ޤ:
+
+ (parted) resize 1 0.063 874.9
+
+ޤ!
+
+ (parted) print
+ Disk geometry for /dev/hda: 0.000-1000.000 megabytes
+ Disk label type: msdos
+ Minor Start End Type Filesystem Flags
+ 1 0.063 874.999 primary ext2
+ 2 875.000 1000.000 primary linux-swap
+
+
+2.5.2 2
+-----------------
+
+
+
+ʤΥǥγ갸ƤΤ褦ˤʤäƤȹͤƤ:
+
+ Disk geometry for /dev/hda: 0-8063.5 megabytes
+ Disk label type: msdos
+ Minor Start End Type Filesystem Flags
+ 1 0.0 23.5 primary ext2 boot
+ 2 23.5 8056.0 extended
+ 5 23.6 3545.6 logical ext2
+ 6 3545.6 7067.7 logical ext2
+ 7 7067.7 7326.5 logical ext2
+ 8 7326.5 7585.4 logical ext2
+ 9 7585.4 7844.2 logical linux-swap
+
+ Filesystem Size Used Avail Use% Mounted on
+ /dev/hda8 251M 31M 207M 13% /
+ /dev/hda1 23M 2.4M 19M 11% /boot
+ /dev/hda5 3.4G 577M 2.7G 18% /usr
+ /dev/hda6 3.4G 289M 2.9G 9% /home
+ /dev/hda7 251M 12M 226M 5% /var
+
+/home (/dev/hda6) ΰȤäơ/var ѡƥ (/dev/hda7) 1GB
+䤷äȤޤ
+
+Parted ǥѡƥ礭ѹΤˡresize ޥɤѤޤ:
+
+ (parted) resize PARTITION_NUMBER NEW_START NEW_END
+
+NEW_START (ˤ) ext2 ѡƥǤϰγƱǤʤ
+ʤޤ󡣤顢μ³ϤʤʣˤʤޤϲǽǤϤޤ
+ :-)
+
+: ⤷ (FAT ѡƥǤǤ褦) Parted ext2 ѡƥ
+ΰư򥵥ݡȤƤʤ顢ϼ­ʤäǤ礦:
+
+ (parted) resize 6 3545.6 6200
+ (parted) resize 7 6200 7326.5
+
+θ:
+
+(1) /home ѡƥ (/dev/hda6) 500MB ̤ޤ:
+
+ # parted /dev/hda
+ (parted) resize 6 3545.6 6200
+
+(2) ξ˿ѡƥޤϺǽŪˤ /var
+ʤȤǤοѡƥ 10 ֹդޤ
+
+ (parted) mkpartfs logical ext2 6200 7067.7
+
+(3) /var ѡƥ (/dev/hda7) 򿷤 (/dev/hda10) إԡ
+
+ (parted) cp 7 10
+
+(4) /var ޤ
+
+ (parted) rm 7
+
+
+λǡƤ 7 ʹߤѡƥֹ椬ѤäȤǤ
+顢8910 Ϥ줾 789 ˤʤޤ
+
+ֹκƳƤϡΥǥβ餫Υѡƥ󤬥ޥ
+Ƥ֤ˤϹԤޤ (ϺƵưȤ˵ޤ)ηٹ
+åäƤΤϤΤȤǤ顢⤷Υå
+äʤ顢Parted ˤäƱƶͿ줿 (Parted ˤä礭ѹ
+줿ꡢ줿ꤷ) ե륷ƥ򡢺Ƶư˥ޥȤ褦
+ȻߤƤФޤ
+
+(5) (Ǥ 9 ֹդ줿) /var ѡƥ礭
+ /var ѡƥɲä뤳Ȥǡѹޤ:
+ (parted) resize 9 6200 7326.5
+ (parted) quit
+ Warning: The kernel was unable to re-read the partition table on
+ /dev/hda (Device or resource busy). This means Linux knows nothing
+ about any modifications you made. You should reboot your computer
+ before doing anything with /dev/hda.
+
+(6) ѡƥֹ椬ѹ줿Τǡ/etc/fstab 򹹿ʤФʤ
+ޤ󡣥롼ȡǥХ Parted ˤäƱƶʤäΤǡ
+Ƶư˹Ԥޤ(⤷ Parted Ȥäƥ롼ȡǥХ˲
+ΤǤС֡ȡǥȤɬפޤ)
+
+⤷ޤǤ /etc/fstab ʴä:
+
+/dev/hda8 / ext2 defaults 1 1
+/dev/hda1 /boot ext2 defaults 1 2
+/dev/hda6 /home ext2 grpquota,usrquota 0 2
+/dev/cdrom /mnt/cdrom iso9660 noauto,owner,ro 0 0
+/dev/hda5 /usr ext2 defaults 1 2
+/dev/hda7 /var ext2 grpquota,usrquota 0 2
+/dev/fd0 /mnt/floppy auto noauto,owner 0 0
+none /proc proc defaults 0 0
+none /dev/pts devpts gid=5,mode=620 0 0
+/dev/hda9 swap swap defaults 0 0
+
+Ԥѹɬפޤ:
+ * /var ϺǤ /dev/hda9 Ǥ (ѡƥ˥ԡ)
+ * /dev/hda8 (롼ȡǥХ) /dev/hda7 ֹ椬ѹƤޤ
+ * /dev/hda9 (åסǥХ) /dev/hda8 ֹ椬ѹƤޤ
+
+ /etc/fstab ϤʴǤ:
+
+/dev/hda7 / ext2 defaults 1 1
+/dev/hda1 /boot ext2 defaults 1 2
+/dev/hda6 /home ext2 grpquota,usrquota 0 2
+/dev/cdrom /mnt/cdrom iso9660 noauto,owner,ro 0 0
+/dev/hda5 /usr ext2 defaults 1 2
+/dev/hda9 /var ext2 grpquota,usrquota 0 2
+/dev/fd0 /mnt/floppy auto noauto,owner 0 0
+none /proc proc defaults 0 0
+none /dev/pts devpts gid=5,mode=620 0 0
+/dev/hda8 swap swap defaults 0 0
+
+(7) ƵưƤǤޤ
+
+[: ȡ /var ΤäȤ̤ѤΤޤ޻ĤƤޤ
+ΤǡäȤäʤ... ä5%ȤäƤʤ顢
+tar ǸǤơ/home ˤǤ֤Ȥơѡƥľơtar
+ɤΤǤϡ]
+
+
+------------------------------------------------------------------------------
+3 BIOS ȥե०
+------------------------------------------------------------------------------
+BIOS (ϥƥ) ȡ֥ե०פƱΤ̣ޤ
+PC PC98 ˴Ťԥ塼ǤϡBIOS Ȥդ̤Ǥ
+Apple Macintosh Sun Υԥ塼Ǥϡ֥ե०פȤդ
+̤Ǥ
+ BIOS ե०Υץϥԥ塼 ROM åפ
+Ȥ߹ޤƤꡢθʤɤԤޤΥץ (ưפˤ)
+ѹǤޤ󡣺 BIOS ϰŪ 20 ǯ˻Ȥ줿 BIOS ȸߴʤΤǡ
+ΥץϸŤᤫ߷פǤ뷹ޤǯˤϤäơ
+ȿľŪˡǵǽɲäƤƤꡢǤ¿κ⤿餹
+ޤѻʥƥƳƤޤäƤޤ
+
+3.1 PC BIOS
+------------------------------------------------------------------------------
+ڤ PC BIOS ޤ: AmiBIOSAwardPhoenix ¾ΤΤǤ
+ƻ褦ʤưޤ BIOS Ϥɤѡƥ
+󡦥ơ֥򤷤ꡢΤäƤϤޤ󡣤ϴŪ˥ѡ
+ƥ˥󥰤˱ƶޤ
+ ʤΥԥ塼ưȤ:
+(1) BIOS ϥϡɡǥ MBR (ޥ֡ȡ쥳)
+˼줿֡ȡץκǽΤ鷺ʬɤޤ
+(2) BIOS ϤΥ֡ȡκǽΤ鷺ʬ¹Ԥޤ
+(3) Υ֡ȡץϤ켫ȤλĤɤΤˡBIOS
+Ѥޤ
+(4) Υ֡ȡϥڥ졼ƥ󥰡ƥ (뤤ϡ¾Υ֡ȡ
+ξϥƥå 2 ˺Ƥޤ) ɤΤˡBIOS
+(5) Υڥ졼ƥ󥰡ƥ̾Υե롦ƥؤΥ
+ԤΤˡBIOS Ѥꡢʤäꤷޤ (Windows ̹ԤLinux
+ BSD Ϥޤ)
+
+ ƥå (3) (5) ϡǥä褦׵᤹Τˡ
+BIOS ̿ץޤߤޤBIOS äΤĤΤ
+ޤ: CHS (إåɡơ) Ȥäơ뤤ϡLBA
+(˥֥åɥå) ȤäơŤ BIOS CHS
+ݡȤޤCHS ݡȤϾä뤫⤷ޤ󤬡 BIOS
+ LBA CHS ξ򥵥ݡȤƤޤ (CHS ϳƤޤʪ
+ȹͤƤޤ) (: ä뤳ȤϤʤǤ礦PC ¤)
+ ֡ȡˤäƹԤ롢ƥå (3) (4) ϾƱ
+ˡȤǤ礦 - LBA CHS ǡWindows Υ֡ȡ
+ξ硢 Windows Υ֡ȡѡƥ LBA ե饰ˤäƷ
+ޤ(ե饰˴ؤϡ2.4.14 򻲾) Linux ξ硢餯
+LILO GRUB ֡ȡȤƻѤƤǤ礦 GRUB Ѳǽ
+顢LBA Ȥʤ CHS Ȥޤ LILO ϥ󥹥ȡ뤹Ȥ
+򤹤뤳Ȥ׵ᤷޤ (linear뤤 lba32 ץ)
+ ƥå (5) - ڥ졼ƥ󥰡ƥˤäϤԤ -
+Windows BIOS ˤäϤԤޤ [桹ϤޤˤĤ
+ʬˤʬޤ󤬡Windows CHS ⡼ɤǤ켫ȤƤ
+褦˸ޤ͡ Windows 켫ȤΥե롦ƥʤɤܤ
+ˤĤƶƤޤ桹ˤϡƤΤΤΤ
+˺ǤǤ뤳Ȥʤ顢LBA ȤȤ򶯤ޤ!]
+ 顢ĤξꤨƤǥСƤޤ:
+(1) CHS ⡼ɤȤäƤơʤ BIOS CHS ⡼ɤ򥵥ݡȤ
+(2) CHS ⡼ɤȤäƤơʤ BIOS CHS LBA ξ򥵥ݡȤ
+Ƥޤ顢CHS ⡼ɤ LBA ⡼ɤءǽʸ¤᤯Ѵ
+(3) LBA ⡼ɤ򤹤Ǥ˻ȤäƤޤ
+
+3.1.1 CHS ⡼ɤǤ Parted λ
+----------------------------------
+Linux ̾ BIOS ΥȥưŪ˸ФޤȤɤְ㤤
+Ȥޤξ硢Linux إѥ᡼ϤȤˤäơʬǶƤ
+٤Ǥ㤨СLinux ϡɡɥ饤 /dev/hda ϥȥ 256/64/63
+ĤȹͤBIOS ץϤΥȥ 512/32/63 Ƚ񤤤Ƥ
+ʤ顢Υѥ᡼ Linux ϤɤǤ礦:
+
+ hda=512,32,63
+
+ѥ᡼ϡɤʥ֡ȡȤäƤ뤫˰ͤꡢۤäˡϤ
+ޤ餯 LILO ȤäƤޤξ硢ιԤ /etc/lilo.conf ɲ
+ޤ: (ơѹȿǤ褦ˡ/sbin/lilo ¹ԤƵư
+ɬפޤ)
+
+ append="hda=512,32,63"
+
+Parted Linux ְäȥ򸡽Фɤ򸡽ФǤޤ
+ǥΥѡƥ󤬤ʤȡϤǤޤ󡣤ξ硢ʬ
+٤ǤԤΤ˽פǤ
+ ȤɤParted ϥѡƥ󤬥·äƤʤʸ
+Ǥ礦Parted ̵뤹뤿Υץ󶡤Ǥ礦⤷
+̵뤹ʤ顢Parted ϥѡƥ󡦥ơ֥ˤĤηԤǤ礦
+Linux ˤϲʤǤ礦DOS Windows ϡ⤷ LBA ⡼ɤȤä
+ʤ顢ʤǤ礦⤷ DOS/Windows CHS ⡼ɤȤäƤʤ顢
+Υ֡ȡƥ󥹥ȡ뤹 ( 4.3 򻲾)ɤ
+褹ϤǤ - Ǥ⡢LBA ⡼ɤؤڤ괹˾ޤǤ (ʲΡ
+3.1.2 򻲾)
+ ֡Ȳ˴طѡƥϡ⤷ CHS ⡼ɤȤƤ
+ʤ顢 1024 ǽäƤʤФʤޤ󡣤ѡƥ
+֡Ȳ˴طƤ뤫ɤꤹΤˡ֡ȡ˴ؤ륻
+򸫤ƤŵŪϡ Linux /boot ѡƥ
+Windows Υѡƥ󡢤ơLinux ΥѡƥäƤΤǤ
+
+3.1.2 CHS LBA ؤѴ
+----------------------------------
+Windows Υ֡ȡڤӡڥ졼ƥ󥰡ƥ LBA ⡼ɤ
+Ȥ碌ˤϡƤ FAT ѡƥ LBA ե饰ΩƤǤ
+( 2.4.14 򻲾)ʤϤǤ⤷ Windows ư
+Τ꤬СWindows Υ֡ȡƥ󥹥ȡ뤹뤳Ȥˤä
+ľޤ ( 4.3 򻲾)
+ Linux Ϥ BIOS Ȥޤ󡣤֡ȡ (LILO
+GRUB) Ϥ뤫⤷ޤ󡣤⤷ǽʤ顢GRUB ϼưŪ LBA Ȥޤ
+LILO ϡlinearפlba32ץץɬפȤޤ顢⤷ LILO
+/etc/lilo.conf ѹ/sbin/lilo Ǻƥ󥹥ȡ ( 4.1 򻲾)
+Ǥⵯưʤ顢äƤޤ! (⤷꤬Сlinearפ
+lba32פ֡ȡǥ LILO ƥ󥹥ȡ뤹뤳Ȥˤäơ
+CHS ᤷƤ)
+
+ LBA ȤäƤΤǡɤ߿ʤǤ...
+
+3.1.3 LBA ⡼
+----------------
+LBA CHS Ƥ褷ޤLinux Parted LBA Ȥ
+Ƥ뤳Ȥʬ롢ǤˡϤʤΤǡParted ·äƤʤ
+䡢̷⤷ BIOS ȥˤĤƷٹͿ뤫⤷ޤ󡣤⤷ LBA
+⡼ɤȤäƤʤ顢Υå̵뤷Ƥޤޤ (Parted
+θŤСǤ꤬ޤƲѤߤǤ)
+
+⤷ǥ LBA ⡼ɤǤʤ顢Parted (¾ΤۤȤɤΥץ)
+CHS ȥ X/255/63 ǤɽǤ礦 - CHS LBA ڤ괹
+ΤǤʤС
+
+3.2 Macintosh OpenFirmware
+------------------------------------------------------------------------------
+PowerMac OpenFirmware ˤĤμפʥС󤬤ޤ - ָŤ
+(old world) ǻȤƤΤȡֿ (new world) PowerMac
+ΤΤǤˤϽʰ㤤ޤξȤѡƥ
+ơ֥򤷤ޤ
+ ξȤ⡢桼̩˰ĤΥѡƥ֡ȡѡƥ
+(֡ȡΤѡƥ) ֤Ȥ׵ᤷޤ
+ԤΤˡϰäȤߤѤޤ
+
+3.2.1 Ť OpenFirmware
+------------------------------
+ư褦Ф줿ѡƥϡQuik Τ褦ʡޤޤʥ֡ȡ
+ˤäꤵޤ顢ʤϲ⤷ʤɤϤǤ桹
+Ф륵ݡȤ Parted ɲäǤ礦⤷ïʬ
+...
+
+3.2.2 OpenFirmware
+------------------------------
+ OpenFirmware ϥ֡ȡѡƥ HFS Ǥꡢ֡ȡ
+ѡƥȤưդƤ뤳ȤɬפȤޤ֡ȡѡƥ
+ȤưդΤˡۤʤȤߤȤޤ Parted Ρboot
+ե饰Ǵޤ㤨:
+
+ (parted) set 2 boot on
+
+
+3.3 PC98 BIOS
+------------------------------------------------------------------------------
+PC98 BIOS ϤĤΥѡƥˤǤ⡢ưǽȰդ褦
+ƤޤParted Ρbootץե饰ǡѡƥưǽȰդ
+ꡢǤޤ㤨:
+
+ (parted) set 2 boot off
+
+
+------------------------------------------------------------------------------
+4 ֡ȡ
+------------------------------------------------------------------------------
+֡ȡϡȤڥ졼ƥ󥰡ƥꡢΥ
+졼ƥ󥰡ƥɤ뤳ȤǽˤץǤäˡ
+⤷ʣμΥڥ졼ƥ󥰡ƥ򥤥󥹥ȡ뤷Ƥʤ顢ʣ
+Υ֡ȡ򥤥󥹥ȡ뤷Ƥ뤫⤷ޤ󡣥֡ȡˤȤäơ
+¾Υ֡ȡɤǤΤΤȤǤ
+
+ѡƥ礭ѹȤ¿̤Υǡưޤ¿
+֡ȡϥե롦ƥ򤷤ޤ󡣤ñɬפȤ
+֡ȡξ󤬥ǥΤɤˤ뤫򵭲ƤǤ⤷
+ξư줿顢줬ɤ˰ư줿ƤʤФʤ
+ޤ󡣤ϤΥ֡ȡƥ󥹥ȡ뤹뤳ȤˤäƹԤޤ
+(ĤޤꡢΥ֡ȡΥ󥹥ȡ顦ץƤ餻롢
+̾亮ñΥޥɤȯԤ뤳ȤɬפȤޤ)֡ȡ
+ΤȤɬפȤ櫓ǤϤޤ
+
+4.1 LILO (Linux Loader)
+---------------------------
+LILO x86 Ѥͭ̾ʥ֡ȡǤLILO Υ֡ȡ̾ʲ
+󥹥ȡ뤵ޤ:
+
+ # /sbin/lilo
+
+⤷֡ȡǥȤäƤʤ顢˼Ԥ٤Ǥ: (ǡ
+/dev/hda1 ϤʤΥ롼ȡǥХ֤٤Ǥ)
+
+ # mount /dev/hda1 /mnt
+ # chroot /mnt /sbin/lilo
+ # umount /dev/hda1
+
+LILO (ۤɤǤϤʤ) ŤС LBA ⡼ɤ򥵥ݡȤƤ
+ ( 3.1 򻲾)LBA ⡼ɤ /etc/lilo.conf ǡlba32
+linear ץˤäͭޤ (äȾΤˡLILO β
+򻲾ȤƤ)
+ ⤷ LBA ⡼ɤȤʤ顢ʤ BIOS LBA 򥵥ݡȤƤ
+¤ꡢʤϤǤ
+ ⤷ CHS ⡼ɤȤʤ顢/boot ǥ쥯ȥĥѡƥ
+ 1024 ˼ޤäƤʤФʤޤ󡣤顢⤷礭ʥǥ
+(äƤߤС8 Ķ) äƤʤ顢ǥνդˡ/boot ѡ
+ƥäƤ٤Ǥ
+
+4.2 GNU GRUB (GRand Unified Bootloader)
+-------------------------------------------
+GRUB x86 ѤΡŪ֡ȡǤɤä GRUB
+ȡ뤵Ƥ뤫ˤäơϥե롦ƥ򤹤뤫⤷ʤ
+ñ˵ưե뤬Ƥ뤫ФƤ⤷ޤ
+Stage 1.5פȤäƤʤ顢ե롦ƥ򤷤ޤ⤷ Stage 1.5
+ȤäƤʤѡƥֹ椬Ѥä顢Stage 2 ƥ󥹥ȡ
+ɬפޤ (GRUB βɤǤ)Ǥʤʤ顢⤷
+ƹޤ
+ GRUB LBA ѲǽưŪ˸Ф⤷Ѳǽʤ顢
+ȤǤ礦 (LILO Ρlba32ץץƱ)
+
+4.3 MS DOSMS Windows 9xMS Windows ME
+--------------------------------------------
+DOS Windows ϡ⤷֡ȡѡƥ FAT μ (FAT16 FAT32)
+ѹСΥ֡ȡƥ󥹥ȡ뤹뤳Ȥ׵ᤷޤ
+Parted ϤԤȻߤ˷ٹ𤹤Ǥ礦Υ֡ȡ
+󥹥ȡ뤹뤿ˡ֡ȡǥ뤫֡ CDROM
+Ǥޤ֡ȡǥˡ Windows ME ǤƯޤ
+
+֡ȡǥˡ: (DOS/Windows 9x)
+
+ (1) Windows ֡ȡǥκ
+ * Windows ưޤؤΤȤ Parted Ȥˡ֡ȡ
+ǥ٤ǤỌ̇̄Ƥޤ
+ * Windows ץΥեåԥɥ饤֤DZåޤ
+ * ֥եޥåȡפ򥯥åޤ
+ * ֥ƥࡦե򥳥ԡפ˰դޤ
+ * ֥եޥåȡפ򥯥åޤ
+ * C:\WINDOWS\COMMAND\SYS.COM A:\ ˥ԡޤ: C:\WINDOWS
+ ̤̾ɤǤ뤫⤷ޤC:\WIN98 Τ褦ʡ
+ (2) ưȤ˥եåԥɥ饤֤ˤΥ֡ȡǥĤƤơ
+Windows Υ֡ȡǥ鵯ưޤ
+ (3) DOS ץץȤǼǤޤ:
+ A:\>sys c:
+
+: Ԥϵפܸ Windows 򿨤äȤʤΤǡ줬äƤʤ
+⤷ޤ󡣰äƤ顢Ƥ
+
+CDROM ˡ: (Windows 9x/ME)
+
+ (1) Windows CDROM ޤ줫鵯ưޤ(CDROM ݡȤʤ
+ưפӤޤ)
+ (2) Τ褦Ǥޤ:
+ A:\>c:
+ C:\>cd \windows\command (\win98\command 褦ʤΤ)
+ C:\WINDOWS\COMMAND>sys c:
+
+
+ޤDOS Windows ϿĤ¤򲡤դޤ:
+
+ * ֡ȡѡƥϡbootץե饰򤵤Ƥ٤Ǥä
+ĤΥ֡ȡѡƥ򤵤ޤ (Ȥɤ֥ƥ֡
+(active) ѡƥȸƤФޤ)㤨Сѡƥ 3 ֡ȡ
+ѡƥꤹˤϡޤ:
+
+ (parted) set 3 boot on
+
+ * MS DOS MS Windows 9x/ME Ϻǽ FAT ѡƥ󤫤餷ưǤ
+ޤ󡣤ʤ־إޥʡֹġƤʤ FAT ѡ
+ƥǤGRUB LILO Τ褦ʥ֡ȡ (ơĤ BIOS)
+Ϥο񤤤ѹǤ뤳ȤդƤ...
+
+ * ⤷ (LBA ɥå󥰤ǤϤʤ) CHS ɥå󥰤ȤäƤʤ顢
+֡ȡѡƥγϥ 1024 ⾮ʤФʤޤ
+֡ȡѡƥ LBA ե饰ͭˤꡢ̵ˤ뤳Ȥˤäơ
+MS DOS LBA ɥå󥰤Ȥ (뤤ϡȤʤ) 褦˶뤳Ȥ
+Ǥޤ㤨Сѡƥ 2 LBA ե饰ͭˤϡޤ:
+
+ (parted) set 2 lba on
+
+: LBA ɥå󥰤ϡPC-DOS ƥСǤʤMS-DOS 6.22
+ǤϥݡȤƤޤ
+
+ٹ: Ĥ BIOS ǤϡBIOS ǤͭˤʤȡLBA ɥå󥰤
+ͭˤʤʤǤ礦餫ͳǡWindows Υե饰ѹ
+ưʤʤ顢줬餯Ǥ
+
+ * ΡMS-DOS (ĤޤꡢС 6.22 ޤ) MS-DOS 7.0 (Ĥޤꡢ
+Windows 95/95a) FAT32 Τޤ󡣤ΤᡢغǽΡ FAT ѡƥ
+ FAT32 ΤȤ ܤΡ FAT (FAT16 Τ)
+ѡƥ󤫤鵯ư뤳ȤǽǤξȤܥѡƥǤʤ
+Фʤ餺ư򥢥ƥ֡ѡƥꤹɬפ
+Ǥ礦
+
+4.4 MS Windows NT
+--------------------------------------
+Windows NT FAT32 ѡƥɤꡢư뤳ȤǤޤ
+椨⤷ Windows NT ǻȤʤ顢FAT16 ѡƥ󤫤 FAT32
+ѡƥѹƤФޤ
+
+4.5 MS Windows 2000
+-----------------------
+Windows 2000 ϡƥࡦѡƥ FAT μ (FAT16 FAT32)
+ѹ顢Υ֡ȡƥ󥹥ȡ뤹뤳Ȥ׵ᤷޤParted
+ϤԤȻߤ˷ٹ𤹤Ǥ礦Υ֡ȡƥ󥹥ȡ
+뤹ˤϡΤ褦ˤޤ:
+ (1) Windows 2000 CD 鵯ưޤ
+ (2) 󥹥ȡ˼꤫ꤿɤ֤Ǥ礦Enter Ǥޤ
+ (3) ơƥ򥤥󥹥ȡ뤷¸ߤ륷ƥ
+ҤͤǤ礦ԤӤޤ (Rפ򲡤)
+ (4) ưԤ쥳󥽡 (recovery console) Ȥ
+֤Ǥ礦쥳󥽡Ȥ򤷤ޤ
+ (5) Υ󥽡ǡǤޤ:
+
+ C:\>fixboot
+
+NT/2000 Υ֡ȡϤޤʲɬפȤޤ:
+ * شܡ FAT12FAT16뤤ϡNTFS ѡƥ (Windows 2000 Ǥ
+FAT32 ǽ)ϡ֥ƥࡦѡƥפȸƤФޤˡ
+켫ȤΥ֡ȡΥɤ뤳ȡΥѡƥϡboot
+ե饰 Parted ΩƤƤ٤Ǥ
+ * ե NTLDRBOOT.INI NTDETECT.COM ƥࡦѡƥ
+뤳ȡBOOT.INI ϴܥѡƥʪ֤֥֡ȡѡƥ
+ȸƤФ롢Windows NT 󥹥ȡ뤵줿ɥ饤֤ˤĤƤξݻ
+ޤ֡ȡѡƥȥƥࡦѡƥϰĤδܥѡƥ
+˰֤Ƥ⤫ޤޤ
+ * Ǥդǡե NTBOOTDD.SYS ƥࡦѡƥˤ뤳ȡ
+ϡȤ BIOS ʤ (뤤ϡ BIOS 礭ʥǥ˥
+Ǥʤ) ȤΡSCSI IDE ȥ̾Ѥ줿ǥ
+ɥ饤ФǤ
+ * MS Windows NT Ǥϡƥࡦѡƥϥ 1024 ǽ
+٤ǡ 1024 ˳ϤؤʤФʤޤ١⤷ 1024
+ʹߤǽꡢưɬפʥե뤬ζʹߤư줿顢MS Windows
+NT ϤϤ䳫ϤʤǤ礦!
+ * ֡Ȥȥƥࡦѡƥξϡ¾ѹʤˡ礭
+ѹƤ⤫ޤޤ
+ * ⤷֡ȡѡƥֹ (ĤޤꡢΡإޥʡֹ) ѹ
+СBOOT.INIT 򹹿ʤФʤޤ
+
+4.6 Quik
+------------
+Quik ϡֵ (old world)פ Macintosh PowerPC ѤΡڤ֡ȡ
+Ǥ⤷ext2 ѡƥ礭Ѥ顢Quik ƥ󥹥ȡ
+뤹ɬפޤ:
+
+ # /sbin/quik
+
+4.7 Yaboot
+--------------
+Yaboot ϡֿ (new world)פ Macintosh PowerPC ѤΡڤ֡ȡ
+Ǥ(ֿפ 1999 ¤Ƥ롢դ PowerPC
+°Ƥޤ)
+ Yaboot ϡʤȤ 800k ʤФʤʤ켫Ȥεưѡƥ
+ɬפȤޤ顢⤷ GNU/Linux 򿿤ÿ饤󥹥ȡ뤷Ƥ
+ʤ顢Τ褦ʤȤ򤹤Ǥ礦:
+
+ (parted) mklabel mac
+ (parted) print
+ Disk geometry for /dev/sda: 0.000-6149.882 megabytes
+ Disk label type: mac
+ Minor Start End Filesystem Name Flags
+ 1 0.000 0.031 Apple
+ (parted) mkpart primary hfs 0.032 1
+ (parted) print
+ Disk geometry for /dev/hdb: 0.000-6149.882 megabytes
+ Disk label type: mac
+ Minor Start End Filesystem Name Flags
+ 1 0.000 0.031 Apple
+ 2 0.031 1.000
+ (parted) set 2 boot on
+ (parted) print
+ Disk geometry for /dev/hdb: 0.000-6149.882 megabytes
+ Disk label type: mac
+ Minor Start End Filesystem Name Flags
+ 1 0.000 0.031 Apple
+ 2 0.031 1.000 boot
+
+ ѡƥ礭ѹ Yaboot ƥ󥹥ȡ뤹
+ɬפϤޤYaboot ybin ǥ󥹥ȡ뤵ޤ
+
+
+------------------------------------------------------------------------------
+5 ڥ졼ƥ󥰡ƥ
+------------------------------------------------------------------------------
+ΤȤParted GNU/Linux βǤΤưޤ¾Υڥ졼
+ƥ󥰡ƥˤäƻȤƤ롢뤤ϡͭ줿ѡƥ
+礭ѹΤѤǤޤ
+
+ե롦ƥ礭ѹȤޥȤƤʤȤǧ
+ƤParted ϥޥȤ줿ѡƥ礭ѹǤޤ
+(ϾѤ뤫⤷ޤ...)
+
+⤷롼Ȥ֡ȡѡƥ礭ѹʤ顢֡ȡǥ
+Ȥ ( 1.5 򻲾) ext2resize ѥå˴ޤޤƤ롢
+Andreas Dilger online ext2 resizer (ܤϡ6Ϥ򻲾) ȤäƤ
+
+⤷ޥȤ줿ѡƥ󤬤ǥΥѡƥ󡦥ơ֥
+ʤ顢˺Ƶư٤ǤLinux ϥѡƥ󡦥ơ֥
+äѹˤĤʬʤǤ礦 (ϥͥ 2.4 ǡΥݡ
+ȤɲäȤľǤ礦)
+
+
+5.1 GNU/Linux FreeBSD
+------------------------------------------------------------------------------
+ξΥƥϥǥ٥ˤϤʤǡΰۤʤǥ
+٥μ򥵥ݡȤƤޤ
+ FreeBSD ϡMSDOS ѡƥ󡦥ơ֥ȤϸߴΤʤ
+ǥ٥롦ƥȡMSDOS ѡƥ󡦥ơ֥ȸߴʡ
+ѡƥ󡦥饤ƥޤParted BSD ǥ
+٥롦ƥ򥵥ݡȤޤΥѡƥ󡦥饤ƥ
+򥵥ݡȤ뤳ȤϤꤽˤʤʤʤ顢ΰ̣Ϥ̯ǡ
+̤Ρץѡƥ󡦥ơ֥뤬褦ˤƯʤǤ
+
+
+5.2 MS Windows OS/2
+------------------------------------------------------------------------------
+MS Windows OS/2 msdos ǥ٥򥵥ݡȤƤޤ
+⤷ǥ٥ʤ顢ʲѤ٤Ǥ:
+
+ (parted) mklabel msdos
+
+
+5.3 MacOS
+------------------------------------------------------------------------------
+MacOS ( OpenFirmware) mac ǥ٥򤷤ޤ椨
+⤷ǥ٥ʤ顢ʲѤ٤Ǥ:
+
+ (parted) mklabel mac
+
+: Mac ѡƥ󡦥ޥåפǤϡΰϥѡƥ󡦥ޥåפι
+ȤäƤޤ (ơLinux 15 ĶܤĤȤ򹥤ޤʤ) Τǡ
+ΰĤΤ򤱤٤Ǥ㤨С⤷ʲԤ:
+
+ (parted) print
+ Disk geometry for /dev/sda: 0.000-6149.882 megabytes
+ Disk label type: mac
+ Minor Start End Filesystem Name Flags
+ 1 0.000 0.031 Apple
+ 2 0.031 1.000 boot
+ 3 1.000 1000.000 ext2 root root
+ (parted) mkpartfs primary ext2 1001 2000
+ (parted) print
+ Disk geometry for /dev/sda: 0.000-6149.882 megabytes
+ Disk label type: mac
+ Minor Start End Filesystem Name Flags
+ 1 0.000 0.031 Apple
+ 2 0.031 1.000 boot
+ 3 1.000 1000.000 ext2 root root
+ 4 1001.000 2000.000 ext2
+
+ѡƥ 3 4 δ֤ˡ1 ᥬХȤζΰ褬ޤѡƥ
+ 0.1M Υƺ뤳Ȥˤäơ򤱤ޤ (ξ硢
+Parted ϼưŪˤˡֲߡפޤ)顢ǤϡѤ
+˼Ԥ٤Ǥ:
+
+ (parted) mkpartfs primary ext2 1000.1 2000
+ (parted) print
+ Disk geometry for /dev/sda: 0.000-6149.882 megabytes
+ Disk label type: mac
+ Minor Start End Filesystem Name Flags
+ 1 0.000 0.031 Apple
+ 2 0.031 1.000 boot
+ 3 1.000 1000.000 ext2 root root
+ 4 1000.000 2000.000 ext2
+
+
+------------------------------------------------------------------------------
+6 ե롦ƥ
+------------------------------------------------------------------------------
+
+Parted ϰʲФ륵ݡȤäƤޤ:
+
+ե롦ƥ 礭ѹ ԡ
+ext2 * * *1 *2 *3
+ext3 * *1 *2 *3
+fat * * *4 *4 *
+hfs *
+jfs *
+linux-swap * * * * *
+ntfs *
+reiserfs *
+ufs *
+xfs *
+
+:
+(1) ext2 ext3 ǤϡѡƥγϸꤵƤʤФʤޤ
+
+(2) ԡΥѡƥϡԡΥѡƥ礭 (뤤ϡ
+Ʊ) ʤФʤޤ
+
+(3) ե롦ƥबȤˡꤵ줿Ԥޤ줬
+ΤȤͣǤ⤷ե롦ƥ˲餫θ(ơ
+˸Ⱦ) С(resize ޤ) ƤΥޥɤϤμԤ꤯
+Υե롦ƥϼդΤޤޤˤʤޤ
+
+(4) fat Ǥϡ礭ѹ䥳ԡθ塢ѡƥ礭ϥ
+礭¤ޤ ( FAT16 ˱ƶޤ)Ϥʤͤ
+ⰭơȤΤ⡢饹礭֤ȤϤǤʤǤ
+( Windows ΥХǤߴߤǤ?)
+ 顢ºŪˤϡ(Parted ϥ饹礭̾ǤΤ) ѡ
+ƥ˽̾뤳ȤǤޤʤߤ礭ˡѡƥ
+礵뤳ȤϤǤʤ⤷ޤ󡣤⤷ FAT32 ȤȤ˲
+꤬ʤʤ顢ˤʤߤ礭˥ѡƥ礵
+礦
+ : ĤǤѡƥ̾Ǥޤ⤷餫ͳ FAT32
+Ȥʤʤ顢ѡƥ礵ʤ⤷ޤ
+
+
+6.1 Ext2
+------------------------------------------------------------------------------
+Parted (ޤ) ext2 ե롦ƥΥԡľܤϥݡȤƤޤ
+ʤ顢٤뤲ˡޤ:
+ * Parted mkfs ޥ ( mkfs.ext2) Ȥ줫饷
+ʲ¹Ԥޤ:
+ ľƤ졪 Ϥޤ꤯Ԥʤ - Ǥοͤˤ
+ ʤϤ...
+
+ # mount -t ext2 /dev/hda2 /mnt/dst
+ # find /mnt/src -depth | cpio -pm /mnt/dst
+
+ * ⤷ʣΥѡƥ󤬸礭ʤʤ顢뤳ȤǤޤ:
+ޤ ext2 ѡƥޤ줫:
+
+ # dd if=/dev/src-device of=/dev/dst-device bs=1024 count=(OLD SIZE)
+ # parted /dev/hda resize 2 (START) (END)
+
+ǡ(OLD SIZE) ϸΥѡƥ򥭥ХȤɽ礭Ǥ
+(START) (END) ʣѡƥФ롢ȽüǤ
+
+
+6.2 FAT16 FAT32
+------------------------------------------------------------------------------
+Parted (ޤ) FAT ե롦ƥΥ饹礭礵ޤ
+󡣤ΤȤΤˡѡƥ礭ѹ䥳ԡ¤ߤ
+ϤФǡȤΤ⡢Parted FAT16 FAT32 Υե
+롦ƥѴǤ뤫ǡ饹礭ɤۤɤˤʤ뤫ˤĤ
+ơۤʤ¤ޤ
+
+㤨С饹礭 4k Ǥ 100Mb Υѡƥ󤬤ȤƤߤ
+礦Υѡƥ 400Mb ѹ뤳ȤϤǤޤ󡣤ʤʤ顢
+Υ饹礭 16k ѹɬפ뤫Ǥ⤷ FAT32
+ȤС 600Mb ѹ뤳ȤǤޤ600Mb FAT32 ե롦
+ƥФơդΩޤ
+
+: ե롦ƥ򥳥ԡꡢ礭ѹȤParted (⤷
+ǽʤ) FAT16 FAT32 δ֤ѴҤͤǤ礦椨
+ѡƥ (礭ѹ) FAT32 Ѵʤ顢Υѡ
+ƥƱ礭ѹǤǤޤ
+
+6.2.1 MS DriveSpace ѡƥ
+--------------------------------
+MS DriveSpace MS Windows 95 °ƤץǡFAT ե롦
+ƥ򰵽̤Τ˻ѤǤޤϤ DoubleSpace Ʊ褦ư
+ȹͤƤΤǡ˽񤫤Ƥ뤳ȤϤɤǤ DoubleSpace ˤ
+ϤޤϤǤ
+
+Υѡƥ礭ѹꥳԡ뤿 Parted Ѥ
+ȤϲǽǤ23;ʬˤʤȤޤ...
+
+6.2.1.1 DriveSpace ѡƥ
+--------------------------------------
+(1) ѡƥ˾ߤ礭礵ΤˡParted resize ޥ
+Ȥޤ
+
+(2) ΰۥȡɥ饤֤鰵̥ɥ饤֤ذܤˡMS DriveSpace
+Ѥޤ
+
+6.2.1.2 DriveSpace ѡƥν̾
+----------------------------------------
+(1) ̥ɥ饤֤ۥȡɥ饤֤ضΰܤˡMS DriveSpace
+Ѥޤܤΰ̤ϥѡƥ̾롢˾ߤ̤
+פޤ
+
+(2) ѡƥ˾ߤ礭˽̾뤿ˡParted resize ޥ
+Ѥޤ: Parted ϤΥѡƥɤ̾Τʬ
+褦ο꤯֤ƤϤޤ󡣤Ϥ٤ȤΥꥹȤ˵
+Ƥޤ
+
+6.2.1.3 DriveSpace ѡƥΥԡ
+--------------------------------------
+⤷ DriveSpace ѡƥä礭ѡƥ˥ԡʤ顢
+˾ߤΥѡƥ礭ѤΤǤϤʤԡ뤳Ȥơ
+DriveSpace ѡƥѤ˽äƤơDriveSpace
+ǤοѡƥȤäƤ뤳ȤǧƤ
+
+⤷ DriveSpace ѡƥ꾮ʥѡƥ˥ԡ
+ʤ顢ʪϾʣˤʤޤ:
+
+(1) ̥ɥ饤֤鸻Ǥۥȡɥ饤֤˶ΰܤˡMS
+DriveSpace Ȥޤܤΰ̤ϸΥѡƥʣѡƥ
+˾ߤ礭κ礭٤Ǥ
+
+(2) ΥѡƥʣΥѡƥإԡ뤿ᡢParted Ȥ
+
+(3) Υۥȡɥ饤֤鰵̥ɥ饤֤ضΰ᤹ᡢMS DriveSpace
+Ȥޤ
+
+(4) ʣۥȡɥ饤֤鰵̥ɥ饤֤ضΰ᤹ᡢMS DriveSpace
+Ȥޤ
+
+6.3 Reiserfs
+------------------------------------------------------------------------------
+Parted reiserfs 򥵥ݡȤƤޤ󡣤reiserfs ˤϤ켫Ȥ
+礭ѹġ롢resize_reiserfs դƤޤʤΤ餻뤿
+ ;-)
+
+
+------------------------------------------------------------------------------
+7 LVMRAID ľŪʥե롦ƥؤΥ
+------------------------------------------------------------------------------
+
+LVM (ܥ塼ࡦޥ͡) ϥѡƥ˥󥰤إƥǤ
+ܥ塼 (Ĥޤꡢֲۥѡƥ) ʪܥ塼
+(Ĥޤꡢϡɡǥѡƥ) ˹뤳ȤޤLVM
+Linux С 2.4 ʹߤǥݡȤƤޤ
+
+RAID (²ʥǥξĹ) ϤΥǥѡƥ
+ˡֲۥѡƥפȤƻȤΥƥǤեȥ RAID
+ѤΤˡΰۤʤ⡼ɤꡢܼŪˤ:
+ * ǽ夵ΰñΥե롦ƥѤǤ褦ˤ
+ᡢʣ () ǥñΥե롦ƥΤ˻ѡ
+ * ǽ夵뤿ᡢξĹʥԡΤʣΥǥ
+եȥ RAID Linux С 2.0 ʹߤǥݡȤƤޤ
+
+ϡɥ RAID ϤդĤ Parted ǥݡȤޤ - 顢⤷ (
+ȥ RAID Ф) ϡɥ RAID ȤäƤʤ顢Υ
+ɤɬפϤޤ
+
+LVMեȥ RAID ѡƥϤФƱ˻Ѥޤ
+Ω˻Ȥޤ:
+ * LVM ȥեȥ RAID ϤФСΥϡɡǥǤϤʤѡ
+ƥ󤫤Ωޤ
+ * !!! ľƤ (: LVM ǻȤ줿 RAID Ϥޤ Linux ǥݡȤ
+ʤ (?))
+
+GNU Parted LVM 䥽եȥ RAID ˤϥݡȤƤޤ󤬡
+θġΥġȤ߹碌ƻȤȤǤʤͭѤǤParted ϰʲ
+ȤΩޤ:
+ * եȥ RAID LVM ѡƥκ
+ * ܥ塼 (뤤ϡֲۥѡƥ) Υե롦ƥ
+κ礭ѹ䥳ԡ
+
+
+7.1 RAID LVM ѡƥκ
+-------------------------------------------------------------------------------
+
+RAID LVM ѡƥ뤿ˡʲ򤷤ʤФʤޤ:
+(1) mkpart ޥɤǥѡƥޤ
+(2) Υѡƥ LVM RAID ե饰ΩƤޤ
+
+㤨:
+
+ (parted) mkpart primary ext2 0 4000
+ (parted) set 1 lvm on
+
+: LVM RAID ѡƥϤޤѽäƤʤǤ礦
+ǤϤꡢRAID ФƤ mkraid(8) ¹Ԥꡢʪܥ塼
+ꡢ롼פʤɤΤˡLVM ġȤɬפޤ
+
+
+7.2 եȥ RAID LVM ܥ塼Υե롦ƥ
+-------------------------------------------------------------------------------
+
+Parted RAID LVM 򤷤ޤ󤬡RAID LVM ܥ塼
+ȤǤޤ Linux RAID LVM ΥݡȤѤޤ椨
+ʤ Linux ͥ뤬 RAID LVM 򥵥ݡȤƤ˸¤ꡢ
+ˡȤޤ
+
+RAID LVM ܥ塼 (뤤ϡ줬פʤ顢Υѡƥ)
+Υե롦ƥ뤿ˡܥ塼 (ѡƥ) ǥХ
+֤Ȥˤäơparted 򳫻ϤǤޤ㤨:
+
+ # parted /dev/md0
+
+ξϤλĤǤϡֲۥǥХפ Parted ԽƤǥХؤ
+礦 (Ǥ: /dev/md0)
+
+
+7.2.1 ե롦ƥκ
+------------------------------
+(1) loop ǥ٥ޤϵΥǥ٥ǡ
+Parted ˲ۥǥХñΥե롦ƥȤư褦˶ޤ
+εΥǥ٥ǤϡޤϡĤΥѡƥ󤬤ޤ
+
+ (parted) mklabel loop
+
+(2) Parted mkpartfs ޥɤȤäơΥե롦ƥޤ
+Υե롦ƥγ򥼥ˤ٤ǤΥѡƥϲ
+ǥХΤɤǽäƤ⤫ޤޤ󡣲ۥǥХ礭 print
+ɤǸФȤǤޤ:
+
+ (parted) print
+ Disk geometry for /dev/md0: 0.000-47.065 megabytes
+ Disk label type: loop
+ Minor Start End Filesystem Flags
+ (parted) mkpartfs primary ext2 0 47.065
+ (parted) print
+ Disk geometry for /dev/md0: 0.000-47.065 megabytes
+ Disk label type: loop
+ Minor Start End Filesystem Flags
+ 1 0.000 47.065 ext2
+
+7.2.2 ե롦ƥ礭ѹ
+------------------------------
+̾ۥǥХ礭ѹΤƱˡե롦ƥ礭
+ѹޤ⤷ե롦ƥȲۥǥХ礭礵Ƥ
+ʤ顢ޤΥǥХ (RAID LVM ġ) 礵٤ǡƤ
+ե롦ƥ礵ޤ⤷ե롦ƥȲۥǥХ̾
+Ƥʤ顢ޤΥե롦ƥ̾ơβۥǥХ
+ǹԤ٤Ǥ
+
+Parted ǥե롦ƥ礭ѹ뤿ˡresize ޥɤȤ
+ޤ㤨:
+
+ (parted) select /dev/md0
+ (parted) resize 1 0 20
+
+7.2.3 ۥǥХѡƥؤΥե롦ƥΥԡ
+------------------------------------------------------------------
+ñ cp ޥɤȤޤ㤨:
+
+ (parted) select /dev/hda
+ (parted) cp /dev/md0 1 3
+
+7.2.4 ե롦ƥफ鲾ۥǥХؤΥե롦ƥΥԡ
+-------------------------------------------------
+(1) ۥǥХ loop ǥ٥ޤ㤨:
+
+ (parted) select /dev/md0
+ (parted) mklabel loop
+
+(2) mkpartfs ޥɤȤäơۥǥХ˥ե롦ƥޤ
+㤨:
+
+ (parted) mkpartfs primary ext2 0 47.065
+
+(3) cp ޥɤǥѡƥ򥳥ԡޤ:
+
+ (parted) select /dev/hda
+ (parted) cp /dev/md0 3 1
+
+
+------------------------------------------------------------------------------
+8 ǥ᡼
+------------------------------------------------------------------------------
+
+ǥ᡼󥰤 Windows Υ󥹥ȡȤ򤹤뤿
+ˡǤ㤨С⤷ Windows Office 1000 ޥ˥󥹥ȡ뤷
+ʤ顢¿ʬ 1000 ֤ 5 ܤ餤Ǥ礦GNU/Linux ȡRed Hat
+ kickstart Τ褦ʥץबΤǡʤˤҤɤϤޤ
+Υץ¾ΥץΥ󥹥ȡ䡢ºŪˤϡʤ
+ɬפΤ뤳Ȥ򲿤Ǥ⼫ư뤳ȤǤޤΤᡢǥ
+᡼󥰤 Windows ޥΤ˻ȤƤޤ餫ˡ
+桹 Windows (䡢ʤ뼫ͳǤʤեȥ) Ȥʤ褦
+ƤޤۤȤɤȿǤϡξΥƥबѤǤ֤ˤ
+ܹԴФ뤳ȤʤWindows GNU/Linux (¾Υե꡼եȥ)
+ڤ괹뤳ȤǤʤȤ򤷤Ƥޤ
+
+ǥ᡼󥰤ȤС֡ȡǥ CD ޤߡ
+ФȤˤäơWindows Office ޤѡƥΥǥ
+᡼ CD ˾ƤΥѡƥľƤΥԥ塼Υϡɡ
+ǥ˥ԡ뤳ȤǤޤ Windows ΥǥΥѡƥ
+Ϥ餯ä礭ʤǤ礦顢ΥѡƥϤޤ
+ѹͤФʤʤǤ礦ϲͤο͡ν֤ Linux
+֡ȡեåԥ Parted ȤäƤޤưʹƤޤ
+եåԥ CD Υ֡ȡ᡼ȤѤ뤳ȤˤäơCDROM
+ȤȤǽǤ¿ξΤ뤿 CD writing HOWTO ɤ
+ǤΤƯ뤿ˤʤȤʤԲĻ׵Ĥ
+Ȥޤ (ϼΰľǤ礦)ˤ衢
+ʲŪˡǤ:
+
+(1) ˾ߤǡޥ Windows 򥤥󥹥ȡ뤷ޤ640 Mb ʾ
+Ȥ鷺 Linux Υ󥹥ȡ CD Υ᡼ʬΥԡѤ
+1300 Mb Τ˽ʬ;ϤĤ¤ꡢΥѡƥ򹥤ʤ礭
+ƹޤ
+
+(2) Υޥ Linux 򥤥󥹥ȡ뤷ޤ
+
+(3) CD Υ᡼ΤΥǥ쥯ȥޤ (: /root/cdimage/)
+
+(4) CD Υ᡼Υǥ쥯ȥ 640 Mb Υǥ᡼Υե
+(: /root/cdimage/diskimage) ޤ:
+
+ # dd if=/dev/zero of=/root/cdimage/diskimage bs=1M count=640
+
+(5) Windows ѡƥǥ᡼إԡ뤿ᡢParted
+Ѥޤ:
+
+ # parted /root/cdimage/diskimage mklabel msdos mkpart primary fat 0 639
+ # parted /root/cdimage/diskimage cp /dev/hda 1 1
+
+(6) CD Υ᡼Υǥ쥯ȥ꤫ CD ᡼򤢤ʤ
+ߤ CD 񤭹ߥġ CD ˾Ƥޤ
+
+(7) 쥵ݡȤ readline ݡȤ̵ˤParted ̤ʥС
+򥳥ѥ뤷ޤ (뤤ϡFreshmeat ̤ RPM ɤޤ):
+
+ localhost:~/parted-1.0.0# ./configure --disable-nls
+ --without-readline --disable-shared; make
+
+(8) Linux Υ֡ȡǥޤ (Bootdisk HOWTO 򻲾)
+
+(9) Υ֡ȡǥ (佼Υ롼ȡǥ) ˾άǤ Parted
+֤ޤ
+
+(10) ʲԤ롦ץȤ񤭤ޤ:
+
+ mount /dev/cdrom /mnt/cdrom
+ parted --script /dev/hda mklabel msdos mkpartfs primary fat 0 SOME-SIZE
+ parted --script /dev/hda cp /mnt/cdrom/diskimage 1 1
+ parted --script /dev/hda set 1 boot on
+ /sbin/halt
+
+(11) 󥹥ȡ볫ϡ Υեåԥ CD ƥԥ塼ޤߡ
+󤷤Ƥޤ...
+
+餫ˡϤˡ򤺤äȴñˤ뤳ȤǤޤǤ礦
+桹ϤԤΤ˾Υǥȥӥ塼ȹͤƤȤ
+ǤˤϤΤ֤ޤ֤ͭϤޤ󤫡
+
+
+------------------------------------------------------------------------------
+9 ʤȴϢեȥ
+------------------------------------------------------------------------------
+
+⤷äȤξȯ顢ڤ parted@gnu.org ˼ä
+(!) Ϥ餯ʤΥǥȥӥ塼˴ޤޤƤ
+եȥ򼨤Ƥޤ
+
+GNU Parted ʪΤΥեϤʤޤǤޤ:
+ * ABOUT-NLS - 쥵ݡȤλѤ Free Translation Project ˤĤƤ
+
+ * API - libparted API β
+ * AUTHORS - ï񤤤
+ * BUGS - ̤ΥХ
+ * ChangeLog - GNU Parted ˤʤ줿ѹ
+ * COPYING - GNU Parted ۾Ǥ롢GNU General Public License
+ * COPYING.DOC - Parted βۤƤ褤Ǥ롢GNU Free
+Documentation Licence
+ * FAT - FAT 礭ѹץưλȤ˴ؤ (ץ)
+ * INSTALL - GNU Parted ¾ΤۤȤɤΥե꡼եȥΥѥˡ
+ * TODO - ޤƤʤײħ
+
+ʲβ GNU Parted ȤϰۤƤޤ󤬡ΩĤ
+ޤ󡣤ΤۤȤɤ¿ʬʤΥǥȥӥ塼
+äƤǤ礦㤨СRed Hat Linux ǤϡCD /doc/HOWTO
+/doc/FAQ 򸫤Ƥ
+
+[: ¿ LDP ɥȤ֤ͭμˤܸƤꡢJF
+ΥڡɤǤޤ:
+ http://jf.linux.or.jp/
+ʲǤϥꥸʥURLΤޤޤˤƤޤ]
+
+ * Filesystems HOWTO http://penguin.cz/~mhi/fs/
+ * Hard Disk Upgrade mini-HOWTO (!): http://sunsite.unc.edu/LDP/HOWTO
+ * Large Disk HOWTO http://www.win.tue.nl/~aeb/linux/Large-Disk.html
+ * LILO mini-HOWTO (!) http://sunsite.unc.edu/LDP/HOWTO
+ * MILO HOWTO (!) http://sunsite.unc.edu/LDP/HOWTO
+ * Linux+OS mini-HOWTOs (!): Linux+DOS+Win95+OS2, Linux+FreeBSD-mini-HOWTO,
+Linux+Win95, Linux+FreeBSD, Linux+NT-Loader. ϰʲǤޤ:
+ http://sunsite.unc.edu/LDP/HOWTO
+ * Partition mini-HOWTO (!):
+ http://www.linuxdoc.org/HOWTO/mini/Partition/index.html
+ * Partition Table HOWTO
+ http://www.win.tue.nl/~aeb/partitions/partition_tables.html
+ * Partition Types list
+ http://www.win.tue.nl/~aeb/partitions/partition_types.html
+ * Software RAID HOWTO
+ http://linas.org/linux/Software-RAID/Software-RAID.html
+
+¾δϢץ󤲤ޤΰͭѤʲä
+ޤ:
+ * Disk Drake. www.linux-mandrake.com/diskdrake. Parted ȵǽŪ
+ƤޤDisk Drake FAT ɤϲ桹 Parted ΥɤˤƤ
+ޤDisk Drake ɤΤ褦 Parted ɤŨ뤫Ƥߤޤ礦: (桹
+ξԤƱդƤޤ :-) Disk Drake :
+
+ - ȤΤäȴñǡְ㤤Ȥʤ褦˼äƤޤ
+ - äȴ٤ι⤤ˡ (/etc/fstablilo ʤɤޤ)
+ - FAT ΥݡȤϤäϼ (FAT16FAT32 ֤ѴǤʤ
+ ѡƥ򥳥ԡǤޤ)
+ - ext2 ΥݡȤϤäϼ (ΤȤ)
+ - () DOS Windows ƥȤθߴ򤢤ޤθƤޤ
+ - PC ƥˤϥݡȤʤ
+
+ * dosfsck
+ * e2fsck, resize2fs e2fsprogs (!)
+ http://web.mit.edu/tytso/www/linux/e2fsprogs.html
+ * ext2resize - Parted ƱɤȤޤޥȤɬפȤʤ
+online ext2 resizer Τ褦ʡ¾ΤΤ򤤤ĤޤǤޤ
+ http://ext2resize.sourceforge.net
+ * fdisk (!)
+ * FIPS (!) (First Interactive Partition Splitter)
+ http://www.igd.fhg.de/~aschaefe/fips/
+ * GPart - 줿ѡƥ󡦥ơ֥ޤ
+ http://www.stud.uni-hannover.de/user/76201/gpart
+ * GNU GRUB - GRand Unified Bootloader
+ http://www.gnu.org/software/grub/grub.html
+ * LILO (!) (LInux LOader) ftp://tsx-11.mit.edu/pub/linux/packages/lilo/
+ * LVM http://linux.msede.com/lvm
+ * mkdosfs (!) (Ȥɤ mkfs.msdos ȸƤФޤ)
+ * mke2fs (!) (Ȥɤ mkfs.ext2 ȸƤФޤ)
+ * mkfs (!)
+ * mkswap (!)
+ * quik (!)
+ * reiserfs: : reiserfs 礭ѹġ̾ reiserfs ʪ˴ޤ
+Ƥޤ
+ http://devlinux.com/projects/reiserfs
+ * yaboot (!) http://ppclinux.apple.com/~benh/
+
diff --git a/doc/fdl.texi b/doc/fdl.texi
new file mode 100644
index 0000000..faa0f3b
--- /dev/null
+++ b/doc/fdl.texi
@@ -0,0 +1,403 @@
+
+@node GNU Free Documentation License
+@appendixsec GNU Free Documentation License
+
+@cindex FDL, GNU Free Documentation License
+@center Version 1.1, March 2000
+
+@display
+Copyright @copyright{} 2000 Free Software Foundation, Inc.
+51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+@end display
+
+@enumerate 0
+@item
+PREAMBLE
+
+The purpose of this License is to make a manual, textbook, or other
+written document @dfn{free} in the sense of freedom: to assure everyone
+the effective freedom to copy and redistribute it, with or without
+modifying it, either commercially or noncommercially. Secondarily,
+this License preserves for the author and publisher a way to get
+credit for their work, while not being considered responsible for
+modifications made by others.
+
+This License is a kind of ``copyleft'', which means that derivative
+works of the document must themselves be free in the same sense. It
+complements the GNU General Public License, which is a copyleft
+license designed for free software.
+
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does. But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book. We recommend this License
+principally for works whose purpose is instruction or reference.
+
+@item
+APPLICABILITY AND DEFINITIONS
+
+This License applies to any manual or other work that contains a
+notice placed by the copyright holder saying it can be distributed
+under the terms of this License. The ``Document'', below, refers to any
+such manual or work. Any member of the public is a licensee, and is
+addressed as ``you''.
+
+A ``Modified Version'' of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+
+A ``Secondary Section'' is a named appendix or a front-matter section of
+the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall subject
+(or to related matters) and contains nothing that could fall directly
+within that overall subject. (For example, if the Document is in part a
+textbook of mathematics, a Secondary Section may not explain any
+mathematics.) The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+
+The ``Invariant Sections'' are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License.
+
+The ``Cover Texts'' are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License.
+
+A ``Transparent'' copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, whose contents can be viewed and edited directly and
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters. A copy made in an otherwise Transparent file
+format whose markup has been designed to thwart or discourage
+subsequent modification by readers is not Transparent. A copy that is
+not ``Transparent'' is called ``Opaque''.
+
+Examples of suitable formats for Transparent copies include plain
+@sc{ascii} without markup, Texinfo input format, La@TeX{} input format,
+@acronym{SGML} or @acronym{XML} using a publicly available
+@acronym{DTD}, and standard-conforming simple @acronym{HTML} designed
+for human modification. Opaque formats include PostScript,
+@acronym{PDF}, proprietary formats that can be read and edited only by
+proprietary word processors, @acronym{SGML} or @acronym{XML} for which
+the @acronym{DTD} and/or processing tools are not generally available,
+and the machine-generated @acronym{HTML} produced by some word
+processors for output purposes only.
+
+The ``Title Page'' means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page. For works in
+formats which do not have any title page as such, ``Title Page'' means
+the text near the most prominent appearance of the work's title,
+preceding the beginning of the body of the text.
+
+@item
+VERBATIM COPYING
+
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no other
+conditions whatsoever to those of this License. You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute. However, you may accept
+compensation in exchange for copies. If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+
+@item
+COPYING IN QUANTITY
+
+If you publish printed copies of the Document numbering more than 100,
+and the Document's license notice requires Cover Texts, you must enclose
+the copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover. Both covers must also clearly and legibly identify
+you as the publisher of these copies. The front cover must present
+the full title with all words of the title equally prominent and
+visible. You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+
+If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+
+If you publish or distribute Opaque copies of the Document numbering
+more than 100, you must either include a machine-readable Transparent
+copy along with each Opaque copy, or state in or with each Opaque copy
+a publicly-accessible computer-network location containing a complete
+Transparent copy of the Document, free of added material, which the
+general network-using public has access to download anonymously at no
+charge using public-standard network protocols. If you use the latter
+option, you must take reasonably prudent steps, when you begin
+distribution of Opaque copies in quantity, to ensure that this
+Transparent copy will remain thus accessible at the stated location
+until at least one year after the last time you distribute an Opaque
+copy (directly or through your agents or retailers) of that edition to
+the public.
+
+It is requested, but not required, that you contact the authors of the
+Document well before redistributing any large number of copies, to give
+them a chance to provide you with an updated version of the Document.
+
+@item
+MODIFICATIONS
+
+You may copy and distribute a Modified Version of the Document under
+the conditions of sections 2 and 3 above, provided that you release
+the Modified Version under precisely this License, with the Modified
+Version filling the role of the Document, thus licensing distribution
+and modification of the Modified Version to whoever possesses a copy
+of it. In addition, you must do these things in the Modified Version:
+
+@enumerate A
+@item
+Use in the Title Page (and on the covers, if any) a title distinct
+from that of the Document, and from those of previous versions
+(which should, if there were any, be listed in the History section
+of the Document). You may use the same title as a previous version
+if the original publisher of that version gives permission.
+
+@item
+List on the Title Page, as authors, one or more persons or entities
+responsible for authorship of the modifications in the Modified
+Version, together with at least five of the principal authors of the
+Document (all of its principal authors, if it has less than five).
+
+@item
+State on the Title page the name of the publisher of the
+Modified Version, as the publisher.
+
+@item
+Preserve all the copyright notices of the Document.
+
+@item
+Add an appropriate copyright notice for your modifications
+adjacent to the other copyright notices.
+
+@item
+Include, immediately after the copyright notices, a license notice
+giving the public permission to use the Modified Version under the
+terms of this License, in the form shown in the Addendum below.
+
+@item
+Preserve in that license notice the full lists of Invariant Sections
+and required Cover Texts given in the Document's license notice.
+
+@item
+Include an unaltered copy of this License.
+
+@item
+Preserve the section entitled ``History'', and its title, and add to
+it an item stating at least the title, year, new authors, and
+publisher of the Modified Version as given on the Title Page. If
+there is no section entitled ``History'' in the Document, create one
+stating the title, year, authors, and publisher of the Document as
+given on its Title Page, then add an item describing the Modified
+Version as stated in the previous sentence.
+
+@item
+Preserve the network location, if any, given in the Document for
+public access to a Transparent copy of the Document, and likewise
+the network locations given in the Document for previous versions
+it was based on. These may be placed in the ``History'' section.
+You may omit a network location for a work that was published at
+least four years before the Document itself, or if the original
+publisher of the version it refers to gives permission.
+
+@item
+In any section entitled ``Acknowledgments'' or ``Dedications'',
+preserve the section's title, and preserve in the section all the
+substance and tone of each of the contributor acknowledgments
+and/or dedications given therein.
+
+@item
+Preserve all the Invariant Sections of the Document,
+unaltered in their text and in their titles. Section numbers
+or the equivalent are not considered part of the section titles.
+
+@item
+Delete any section entitled ``Endorsements''. Such a section
+may not be included in the Modified Version.
+
+@item
+Do not retitle any existing section as ``Endorsements''
+or to conflict in title with any Invariant Section.
+@end enumerate
+
+If the Modified Version includes new front-matter sections or
+appendices that qualify as Secondary Sections and contain no material
+copied from the Document, you may at your option designate some or all
+of these sections as invariant. To do this, add their titles to the
+list of Invariant Sections in the Modified Version's license notice.
+These titles must be distinct from any other section titles.
+
+You may add a section entitled ``Endorsements'', provided it contains
+nothing but endorsements of your Modified Version by various
+parties---for example, statements of peer review or that the text has
+been approved by an organization as the authoritative definition of a
+standard.
+
+You may add a passage of up to five words as a Front-Cover Text, and a
+passage of up to 25 words as a Back-Cover Text, to the end of the list
+of Cover Texts in the Modified Version. Only one passage of
+Front-Cover Text and one of Back-Cover Text may be added by (or
+through arrangements made by) any one entity. If the Document already
+includes a cover text for the same cover, previously added by you or
+by arrangement made by the same entity you are acting on behalf of,
+you may not add another; but you may replace the old one, on explicit
+permission from the previous publisher that added the old one.
+
+The author(s) and publisher(s) of the Document do not by this License
+give permission to use their names for publicity for or to assert or
+imply endorsement of any Modified Version.
+
+@item
+COMBINING DOCUMENTS
+
+You may combine the Document with other documents released under this
+License, under the terms defined in section 4 above for modified
+versions, provided that you include in the combination all of the
+Invariant Sections of all of the original documents, unmodified, and
+list them all as Invariant Sections of your combined work in its
+license notice.
+
+The combined work need only contain one copy of this License, and
+multiple identical Invariant Sections may be replaced with a single
+copy. If there are multiple Invariant Sections with the same name but
+different contents, make the title of each such section unique by
+adding at the end of it, in parentheses, the name of the original
+author or publisher of that section if known, or else a unique number.
+Make the same adjustment to the section titles in the list of
+Invariant Sections in the license notice of the combined work.
+
+In the combination, you must combine any sections entitled ``History''
+in the various original documents, forming one section entitled
+``History''; likewise combine any sections entitled ``Acknowledgments'',
+and any sections entitled ``Dedications''. You must delete all sections
+entitled ``Endorsements.''
+
+@item
+COLLECTIONS OF DOCUMENTS
+
+You may make a collection consisting of the Document and other documents
+released under this License, and replace the individual copies of this
+License in the various documents with a single copy that is included in
+the collection, provided that you follow the rules of this License for
+verbatim copying of each of the documents in all other respects.
+
+You may extract a single document from such a collection, and distribute
+it individually under this License, provided you insert a copy of this
+License into the extracted document, and follow this License in all
+other respects regarding verbatim copying of that document.
+
+@item
+AGGREGATION WITH INDEPENDENT WORKS
+
+A compilation of the Document or its derivatives with other separate
+and independent documents or works, in or on a volume of a storage or
+distribution medium, does not as a whole count as a Modified Version
+of the Document, provided no compilation copyright is claimed for the
+compilation. Such a compilation is called an ``aggregate'', and this
+License does not apply to the other self-contained works thus compiled
+with the Document, on account of their being thus compiled, if they
+are not themselves derivative works of the Document.
+
+If the Cover Text requirement of section 3 is applicable to these
+copies of the Document, then if the Document is less than one quarter
+of the entire aggregate, the Document's Cover Texts may be placed on
+covers that surround only the Document within the aggregate.
+Otherwise they must appear on covers around the whole aggregate.
+
+@item
+TRANSLATION
+
+Translation is considered a kind of modification, so you may
+distribute translations of the Document under the terms of section 4.
+Replacing Invariant Sections with translations requires special
+permission from their copyright holders, but you may include
+translations of some or all Invariant Sections in addition to the
+original versions of these Invariant Sections. You may include a
+translation of this License provided that you also include the
+original English version of this License. In case of a disagreement
+between the translation and the original English version of this
+License, the original English version will prevail.
+
+@item
+TERMINATION
+
+You may not copy, modify, sublicense, or distribute the Document except
+as expressly provided for under this License. Any other attempt to
+copy, modify, sublicense or distribute the Document is void, and will
+automatically terminate your rights under this License. However,
+parties who have received copies, or rights, from you under this
+License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+@item
+FUTURE REVISIONS OF THIS LICENSE
+
+The Free Software Foundation may publish new, revised versions
+of the GNU Free Documentation License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns. See
+@uref{http://www.gnu.org/copyleft/}.
+
+Each version of the License is given a distinguishing version number.
+If the Document specifies that a particular numbered version of this
+License ``or any later version'' applies to it, you have the option of
+following the terms and conditions either of that specified version or
+of any later version that has been published (not as a draft) by the
+Free Software Foundation. If the Document does not specify a version
+number of this License, you may choose any version ever published (not
+as a draft) by the Free Software Foundation.
+@end enumerate
+
+@page
+@appendixsubsec ADDENDUM: How to use this License for your documents
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and
+license notices just after the title page:
+
+@smallexample
+@group
+ Copyright (C) @var{year} @var{your name}.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.1
+ or any later version published by the Free Software Foundation;
+ with the Invariant Sections being @var{list their titles}, with the
+ Front-Cover Texts being @var{list}, and with the Back-Cover Texts being @var{list}.
+ A copy of the license is included in the section entitled ``GNU
+ Free Documentation License''.
+@end group
+@end smallexample
+
+If you have no Invariant Sections, write ``with no Invariant Sections''
+instead of saying which ones are invariant. If you have no
+Front-Cover Texts, write ``no Front-Cover Texts'' instead of
+``Front-Cover Texts being @var{list}''; likewise for Back-Cover Texts.
+
+If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License,
+to permit their use in free software.
+
+@c Local Variables:
+@c ispell-local-pdict: "ispell-dict"
+@c End:
+
diff --git a/doc/gendocs.sh b/doc/gendocs.sh
new file mode 100755
index 0000000..f097cf0
--- /dev/null
+++ b/doc/gendocs.sh
@@ -0,0 +1,285 @@
+#!/bin/sh
+# gendocs.sh -- generate a GNU manual in many formats. This script is
+# mentioned in maintain.texi. See the help message below for usage details.
+# $Id: gendocs.sh,v 1.16 2005/05/15 00:00:08 karl Exp $
+#
+# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, you can either send email to this
+# program's maintainer or write to: The Free Software Foundation,
+# Inc.; 51 Franklin Street, Fifth Floor; Boston, MA 02110-1301, USA.
+#
+# Original author: Mohit Agarwal.
+# Send bug reports and any other correspondence to bug-texinfo@gnu.org.
+
+prog="`basename \"$0\"`"
+srcdir=`pwd`
+
+scripturl="http://savannah.gnu.org/cgi-bin/viewcvs/texinfo/texinfo/util/gendocs.sh"
+templateurl="http://savannah.gnu.org/cgi-bin/viewcvs/texinfo/texinfo/util/gendocs_template"
+
+: ${MAKEINFO="makeinfo"}
+: ${TEXI2DVI="texi2dvi -t @finalout"}
+: ${DVIPS="dvips"}
+: ${DOCBOOK2TXT="docbook2txt"}
+: ${DOCBOOK2HTML="docbook2html"}
+: ${DOCBOOK2PDF="docbook2pdf"}
+: ${DOCBOOK2PS="docbook2ps"}
+: ${GENDOCS_TEMPLATE_DIR="."}
+unset CDPATH
+
+rcs_revision='$Revision: 1.16 $'
+rcs_version=`set - $rcs_revision; echo $2`
+program=`echo $0 | sed -e 's!.*/!!'`
+version="gendocs.sh $rcs_version
+
+Copyright (C) 2005 Free Software Foundation, Inc.
+There is NO warranty. You may redistribute this software
+under the terms of the GNU General Public License.
+For more information about these matters, see the files named COPYING."
+
+usage="Usage: $prog [OPTION]... PACKAGE MANUAL-TITLE
+
+Generate various output formats from PACKAGE.texinfo (or .texi or .txi) source.
+See the GNU Maintainers document for a more extensive discussion:
+ http://www.gnu.org/prep/maintain_toc.html
+
+Options:
+ -o OUTDIR write files into OUTDIR, instead of manual/.
+ --docbook convert to DocBook too (xml, txt, html, pdf and ps).
+ --html ARG pass indicated ARG to makeinfo for HTML targets.
+ --help display this help and exit successfully.
+ --version display version information and exit successfully.
+
+Simple example: $prog emacs \"GNU Emacs Manual\"
+
+Typical sequence:
+ cd YOURPACKAGESOURCE/doc
+ wget \"$scripturl\"
+ wget \"$templateurl\"
+ $prog YOURMANUAL \"GNU YOURMANUAL - One-line description\"
+
+Output will be in a new subdirectory \"manual\" (by default, use -o OUTDIR
+to override). Move all the new files into your web CVS tree, as
+explained in the Web Pages node of maintain.texi.
+
+MANUAL-TITLE is included as part of the HTML <title> of the overall
+manual/index.html file. It should include the name of the package being
+documented. manual/index.html is created by substitution from the file
+$GENDOCS_TEMPLATE_DIR/gendocs_template. (Feel free to modify the
+generic template for your own purposes.)
+
+If you have several manuals, you'll need to run this script several
+times with different YOURMANUAL values, specifying a different output
+directory with -o each time. Then write (by hand) an overall index.html
+with links to them all.
+
+You can set the environment variables MAKEINFO, TEXI2DVI, and DVIPS to
+control the programs that get executed, and GENDOCS_TEMPLATE_DIR to
+control where the gendocs_template file is looked for.
+
+Email bug reports or enhancement requests to bug-texinfo@gnu.org.
+"
+
+calcsize()
+{
+ size="`ls -ksl $1 | awk '{print $1}'`"
+ echo $size
+}
+
+outdir=manual
+html=
+PACKAGE=
+MANUAL_TITLE=
+
+while test $# -gt 0; do
+ case $1 in
+ --help) echo "$usage"; exit 0;;
+ --version) echo "$version"; exit 0;;
+ -o) shift; outdir=$1;;
+ --docbook) docbook=yes;;
+ --html) shift; html=$1;;
+ -*)
+ echo "$0: Unknown or ambiguous option \`$1'." >&2
+ echo "$0: Try \`--help' for more information." >&2
+ exit 1;;
+ *)
+ if test -z "$PACKAGE"; then
+ PACKAGE=$1
+ elif test -z "$MANUAL_TITLE"; then
+ MANUAL_TITLE=$1
+ else
+ echo "$0: extra non-option argument \`$1'." >&2
+ exit 1
+ fi;;
+ esac
+ shift
+done
+
+if test -s $srcdir/$PACKAGE.texinfo; then
+ srcfile=$srcdir/$PACKAGE.texinfo
+elif test -s $srcdir/$PACKAGE.texi; then
+ srcfile=$srcdir/$PACKAGE.texi
+elif test -s $srcdir/$PACKAGE.txi; then
+ srcfile=$srcdir/$PACKAGE.txi
+else
+ echo "$0: cannot find .texinfo or .texi or .txi for $PACKAGE in $srcdir." >&2
+ exit 1
+fi
+
+if test ! -r $GENDOCS_TEMPLATE_DIR/gendocs_template; then
+ echo "$0: cannot read $GENDOCS_TEMPLATE_DIR/gendocs_template." >&2
+ echo "$0: it is available from $templateurl." >&2
+ exit 1
+fi
+
+echo Generating output formats for $srcfile
+
+cmd="${MAKEINFO} -o $PACKAGE.info $srcfile"
+echo "Generating info files... ($cmd)"
+eval $cmd
+mkdir -p $outdir/
+tar czf $outdir/$PACKAGE.info.tar.gz $PACKAGE.info*
+info_tgz_size="`calcsize $outdir/$PACKAGE.info.tar.gz`"
+# do not mv the info files, there's no point in having them available
+# separately on the web.
+
+cmd="${TEXI2DVI} $srcfile"
+echo "Generating dvi ... ($cmd)"
+eval $cmd
+
+# now, before we compress dvi:
+echo Generating postscript...
+${DVIPS} $PACKAGE -o
+gzip -f -9 $PACKAGE.ps
+ps_gz_size="`calcsize $PACKAGE.ps.gz`"
+mv $PACKAGE.ps.gz $outdir/
+
+# compress/finish dvi:
+gzip -f -9 $PACKAGE.dvi
+dvi_gz_size="`calcsize $PACKAGE.dvi.gz`"
+mv $PACKAGE.dvi.gz $outdir/
+
+cmd="${TEXI2DVI} --pdf $srcfile"
+echo "Generating pdf ... ($cmd)"
+eval $cmd
+pdf_size="`calcsize $PACKAGE.pdf`"
+mv $PACKAGE.pdf $outdir/
+
+cmd="${MAKEINFO} -o $PACKAGE.txt --no-split --no-headers $srcfile"
+echo "Generating ASCII... ($cmd)"
+eval $cmd
+ascii_size="`calcsize $PACKAGE.txt`"
+gzip -f -9 -c $PACKAGE.txt >$outdir/$PACKAGE.txt.gz
+ascii_gz_size="`calcsize $outdir/$PACKAGE.txt.gz`"
+mv $PACKAGE.txt $outdir/
+
+cmd="${MAKEINFO} --no-split --html -o $PACKAGE.html $html $srcfile"
+echo "Generating monolithic html... ($cmd)"
+rm -rf $PACKAGE.html # in case a directory is left over
+eval $cmd
+html_mono_size="`calcsize $PACKAGE.html`"
+gzip -f -9 -c $PACKAGE.html >$outdir/$PACKAGE.html.gz
+html_mono_gz_size="`calcsize $outdir/$PACKAGE.html.gz`"
+mv $PACKAGE.html $outdir/
+
+cmd="${MAKEINFO} --html -o $PACKAGE.html $html $srcfile"
+echo "Generating html by node... ($cmd)"
+eval $cmd
+split_html_dir=$PACKAGE.html
+(
+ cd ${split_html_dir} || exit 1
+ tar -czf ../$outdir/${PACKAGE}.html_node.tar.gz -- *.html
+)
+html_node_tgz_size="`calcsize $outdir/${PACKAGE}.html_node.tar.gz`"
+rm -f $outdir/html_node/*.html
+mkdir -p $outdir/html_node/
+mv ${split_html_dir}/*.html $outdir/html_node/
+rmdir ${split_html_dir}
+
+echo Making .tar.gz for sources...
+srcfiles=`ls *.texinfo *.texi *.txi *.eps 2>/dev/null`
+tar cvzfh $outdir/$PACKAGE.texi.tar.gz $srcfiles
+texi_tgz_size="`calcsize $outdir/$PACKAGE.texi.tar.gz`"
+
+if test -n "$docbook"; then
+ cmd="${MAKEINFO} -o - --docbook $srcfile > ${srcdir}/$PACKAGE-db.xml"
+ echo "Generating docbook XML... $(cmd)"
+ eval $cmd
+ docbook_xml_size="`calcsize $PACKAGE-db.xml`"
+ gzip -f -9 -c $PACKAGE-db.xml >$outdir/$PACKAGE-db.xml.gz
+ docbook_xml_gz_size="`calcsize $outdir/$PACKAGE-db.xml.gz`"
+ mv $PACKAGE-db.xml $outdir/
+
+ cmd="${DOCBOOK2HTML} -o $split_html_db_dir ${outdir}/$PACKAGE-db.xml"
+ echo "Generating docbook HTML... ($cmd)"
+ eval $cmd
+ split_html_db_dir=html_node_db
+ (
+ cd ${split_html_db_dir} || exit 1
+ tar -czf ../$outdir/${PACKAGE}.html_node_db.tar.gz -- *.html
+ )
+ html_node_db_tgz_size="`calcsize $outdir/${PACKAGE}.html_node_db.tar.gz`"
+ rm -f $outdir/html_node_db/*.html
+ mkdir -p $outdir/html_node_db
+ mv ${split_html_db_dir}/*.html $outdir/html_node_db/
+ rmdir ${split_html_db_dir}
+
+ cmd="${DOCBOOK2TXT} ${outdir}/$PACKAGE-db.xml"
+ echo "Generating docbook ASCII... ($cmd)"
+ eval $cmd
+ docbook_ascii_size="`calcsize $PACKAGE-db.txt`"
+ mv $PACKAGE-db.txt $outdir/
+
+ cmd="${DOCBOOK2PS} ${outdir}/$PACKAGE-db.xml"
+ echo "Generating docbook PS... $(cmd)"
+ eval $cmd
+ gzip -f -9 -c $PACKAGE-db.ps >$outdir/$PACKAGE-db.ps.gz
+ docbook_ps_gz_size="`calcsize $outdir/$PACKAGE-db.ps.gz`"
+ mv $PACKAGE-db.ps $outdir/
+
+ cmd="${DOCBOOK2PDF} ${outdir}/$PACKAGE-db.xml"
+ echo "Generating docbook PDF... ($cmd)"
+ eval $cmd
+ docbook_pdf_size="`calcsize $PACKAGE-db.pdf`"
+ mv $PACKAGE-db.pdf $outdir/
+fi
+
+echo Writing index file...
+curdate="`date '+%B %d, %Y'`"
+sed \
+ -e "s!%%TITLE%%!$MANUAL_TITLE!g" \
+ -e "s!%%DATE%%!$curdate!g" \
+ -e "s!%%PACKAGE%%!$PACKAGE!g" \
+ -e "s!%%HTML_MONO_SIZE%%!$html_mono_size!g" \
+ -e "s!%%HTML_MONO_GZ_SIZE%%!$html_mono_gz_size!g" \
+ -e "s!%%HTML_NODE_TGZ_SIZE%%!$html_node_tgz_size!g" \
+ -e "s!%%INFO_TGZ_SIZE%%!$info_tgz_size!g" \
+ -e "s!%%DVI_GZ_SIZE%%!$dvi_gz_size!g" \
+ -e "s!%%PDF_SIZE%%!$pdf_size!g" \
+ -e "s!%%PS_GZ_SIZE%%!$ps_gz_size!g" \
+ -e "s!%%ASCII_SIZE%%!$ascii_size!g" \
+ -e "s!%%ASCII_GZ_SIZE%%!$ascii_gz_size!g" \
+ -e "s!%%TEXI_TGZ_SIZE%%!$texi_tgz_size!g" \
+ -e "s!%%DOCBOOK_HTML_NODE_TGZ_SIZE%%!$html_node_db_tgz_size!g" \
+ -e "s!%%DOCBOOK_ASCII_SIZE%%!$docbook_ascii_size!g" \
+ -e "s!%%DOCBOOK_PS_GZ_SIZE%%!$docbook_ps_gz_size!g" \
+ -e "s!%%DOCBOOK_PDF_SIZE%%!$docbook_pdf_size!g" \
+ -e "s!%%DOCBOOK_XML_SIZE%%!$docbook_xml_size!g" \
+ -e "s!%%DOCBOOK_XML_GZ_SIZE%%!$docbook_xml_gz_size!g" \
+ -e "s,%%SCRIPTURL%%,$scripturl,g" \
+ -e "s!%%SCRIPTNAME%%!$prog!g" \
+$GENDOCS_TEMPLATE_DIR/gendocs_template >$outdir/index.html
+
+echo "Done! See $outdir/ subdirectory for new files."
diff --git a/doc/gendocs_template b/doc/gendocs_template
new file mode 100644
index 0000000..0d2bf3d
--- /dev/null
+++ b/doc/gendocs_template
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<!-- $Id: gendocs_template,v 1.7 2005/05/15 00:00:08 karl Exp $ -->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+
+<head>
+<title>%%TITLE%% - GNU Project - Free Software Foundation (FSF)</title>
+<meta http-equiv="content-type" content='text/html; charset=utf-8' />
+<link rel="stylesheet" type="text/css" href="/gnu.css" />
+<link rev="made" href="webmasters@gnu.org" />
+</head>
+
+<!-- This document is in XML, and xhtml 1.0 -->
+<!-- Please make sure to properly nest your tags -->
+<!-- and ensure that your final document validates -->
+<!-- consistent with W3C xhtml 1.0 and CSS standards -->
+<!-- See validator.w3.org -->
+
+<body>
+
+<h3>%%TITLE%%</h3>
+
+<address>Free Software Foundation</address>
+<address>last updated %%DATE%%</address>
+<p>
+<a href="/graphics/gnu-head.jpg">
+ <img src="/graphics/gnu-head-sm.jpg"
+ alt=" [image of the head of a GNU] "
+ width="129" height="122" />
+</a>
+<a href="/philosophy/gif.html">(no gifs due to patent problems)</a>
+</p>
+<hr />
+
+<p>This manual (%%PACKAGE%%) is available in the following formats:</p>
+
+<ul>
+ <li><a href="%%PACKAGE%%.html">HTML
+ (%%HTML_MONO_SIZE%%K characters)</a> - entirely on one web page.</li>
+ <li><a href="html_node/index.html">HTML</a> - with one web page per
+ node.</li>
+ <li><a href="%%PACKAGE%%.html.gz">HTML compressed
+ (%%HTML_MONO_GZ_SIZE%%K gzipped characters)</a> - entirely on
+ one web page.</li>
+ <li><a href="%%PACKAGE%%.html_node.tar.gz">HTML compressed
+ (%%HTML_NODE_TGZ_SIZE%%K gzipped tar file)</a> -
+ with one web page per node.</li>
+ <li><a href="%%PACKAGE%%.info.tar.gz">Info document
+ (%%INFO_TGZ_SIZE%%K characters gzipped tar file)</a>.</li>
+ <li><a href="%%PACKAGE%%.txt">ASCII text
+ (%%ASCII_SIZE%%K characters)</a>.</li>
+ <li><a href="%%PACKAGE%%.txt.gz">ASCII text compressed
+ (%%ASCII_GZ_SIZE%%K gzipped characters)</a>.</li>
+ <li><a href="%%PACKAGE%%.dvi.gz">TeX dvi file
+ (%%DVI_GZ_SIZE%%K characters gzipped)</a>.</li>
+ <li><a href="%%PACKAGE%%.ps.gz">PostScript file
+ (%%PS_GZ_SIZE%%K characters gzipped)</a>.</li>
+ <li><a href="%%PACKAGE%%.pdf">PDF file
+ (%%PDF_SIZE%%K characters)</a>.</li>
+ <li><a href="%%PACKAGE%%.texi.tar.gz">Texinfo source
+ (%%TEXI_TGZ_SIZE%%K characters gzipped tar file)</a></li>
+</ul>
+
+<p>(This page generated by the <a href="%%SCRIPTURL%%">%%SCRIPTNAME%%
+script</a>.)</p>
+
+<div class="copyright">
+<p>
+Return to the <a href="/home.html">GNU Project home page</a>.
+</p>
+
+<p>
+Please send FSF &amp; GNU inquiries to
+<a href="mailto:gnu@gnu.org"><em>gnu@gnu.org</em></a>.
+There are also <a href="/home.html#ContactInfo">other ways to contact</a>
+the FSF.
+<br />
+Please send broken links and other corrections (or suggestions) to
+<a href="mailto:webmasters@gnu.org"><em>webmasters@gnu.org</em></a>.
+</p>
+
+<p>
+Copyright (C) 2004 Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02111, USA
+<br />
+Verbatim copying and distribution of this entire article is
+permitted in any medium, provided this notice is preserved.
+</p>
+
+<p>
+Updated:
+<!-- timestamp start -->
+$Date: 2005/05/15 00:00:08 $ $Author: karl $
+<!-- timestamp end -->
+</p>
+</div>
+
+</body>
+</html>
diff --git a/doc/mdate-sh b/doc/mdate-sh
new file mode 100755
index 0000000..233f395
--- /dev/null
+++ b/doc/mdate-sh
@@ -0,0 +1,97 @@
+#!/bin/sh
+# Get modification time of a file or directory and pretty-print it.
+# Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
+# written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Prevent date giving response in another language.
+LANG=C
+export LANG
+LC_ALL=C
+export LC_ALL
+LC_TIME=C
+export LC_TIME
+
+# Get the extended ls output of the file or directory.
+# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
+if ls -L /dev/null 1>/dev/null 2>&1; then
+ set - x`ls -L -l -d $1`
+else
+ set - x`ls -l -d $1`
+fi
+# The month is at least the fourth argument
+# (3 shifts here, the next inside the loop).
+shift
+shift
+shift
+
+# Find the month. Next argument is day, followed by the year or time.
+month=
+until test $month
+do
+ shift
+ case $1 in
+ Jan) month=January; nummonth=1;;
+ Feb) month=February; nummonth=2;;
+ Mar) month=March; nummonth=3;;
+ Apr) month=April; nummonth=4;;
+ May) month=May; nummonth=5;;
+ Jun) month=June; nummonth=6;;
+ Jul) month=July; nummonth=7;;
+ Aug) month=August; nummonth=8;;
+ Sep) month=September; nummonth=9;;
+ Oct) month=October; nummonth=10;;
+ Nov) month=November; nummonth=11;;
+ Dec) month=December; nummonth=12;;
+ esac
+done
+
+day=$2
+
+# Here we have to deal with the problem that the ls output gives either
+# the time of day or the year.
+case $3 in
+ *:*) set `date`; eval year=\$$#
+ case $2 in
+ Jan) nummonthtod=1;;
+ Feb) nummonthtod=2;;
+ Mar) nummonthtod=3;;
+ Apr) nummonthtod=4;;
+ May) nummonthtod=5;;
+ Jun) nummonthtod=6;;
+ Jul) nummonthtod=7;;
+ Aug) nummonthtod=8;;
+ Sep) nummonthtod=9;;
+ Oct) nummonthtod=10;;
+ Nov) nummonthtod=11;;
+ Dec) nummonthtod=12;;
+ esac
+ # For the first six month of the year the time notation can also
+ # be used for files modified in the last year.
+ if (expr $nummonth \> $nummonthtod) > /dev/null;
+ then
+ year=`expr $year - 1`
+ fi;;
+ *) year=$3;;
+esac
+
+# The result.
+echo $day $month $year
diff --git a/doc/parted-pt_BR.texi b/doc/parted-pt_BR.texi
new file mode 100644
index 0000000..bffabbb
--- /dev/null
+++ b/doc/parted-pt_BR.texi
@@ -0,0 +1,2903 @@
+\input texinfo @c -*-texinfo-*-
+@c %**start of header
+@setfilename parted-pt_BR.info
+@settitle Manual do Usurio do Parted
+@c %**end of header
+
+@c RMK: for definitions and discussion of my methods, skip to the end
+@c of the file, after the "bye" directive.
+
+@include version.texi
+
+@paragraphindent 4
+
+@direntry
+* parted: (parted). software de particionamento GNU
+@c RMK: the following doesn't work. 'info --usage' is improperly documented.
+@c * Chamando o parted: (parted)Chamando o Parted. Opes de linha de comando e comandos
+@end direntry
+
+@c RMK: texi: an info section describing the file is texinfo custom.
+@ifinfo
+This file documents the use of GNU Parted, a program for creating,
+resising, checking and copy partitions, and file systems on them.
+
+Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.1 or
+any later version published by the Free Software Foundation; with the
+no Invariant Sections, with the no Front-Cover Texts, and with no
+Back-Cover Texts. A copy of the license is included in the section
+entitled ``GNU Free Documentation License''.
+
+@end ifinfo
+
+@c RMK: texi : the titlepage section is texinfo custom.
+@titlepage
+@title Manual do GNU Parted
+@subtitle GNU Parted, verso @value{VERSION}, @value{UPDATED}
+@author Andrew Clausen @email{clausen@@gnu.org}
+@c FDL: Following section 4.B of the GNU Free Documentation License,
+@c I am required to list myself as an author of this work.
+@author Richard M. Kreuter @email{kreuter@@anduril.rutgers.edu}
+@author Bernardo Joo Torres da Silveira (Traduo Portuguesa) @email{bernardojts@@ig.com.br}
+
+@page
+@vskip 0pt plus 1filll
+
+Copyright @copyright{} 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.1 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+Texts. A copy of the license is included in the section entitled ``GNU
+Free Documentation License''.
+@end titlepage
+
+@ifnottex
+@node Top
+@top TITLE
+
+@c RMK: added Top node describing this manual Should it be more verbose?
+This document describes the use of GNU Parted, a program for creating,
+destroying, resizing, checking and copying hard drive partitions, and
+the file systems on them.
+
+This document applies to @value{VERSION} of GNU Parted. Its content is
+substantially similar to the user's manual included in the source
+distribution of GNU Parted @value{VERSION}. That file was written by
+Andrew Clausen.
+@end ifnottex
+
+@c if we don't get menus (eg: HTML), use contents instead
+@shortcontents
+
+@menu
+* Instroduo:: Overview
+* Usando o Parted:: Particionando um Disco Rgido
+* BIOSes e Firmwares:: Entre ligar e carregar
+* Carregadores de Boot:: Como o sistema operacional inicia
+* Sistemas Operacionais:: Sistemas Operacionais e sistemas de arquivo
+* Sistemas de Arquivo:: Sistemas de arquivo suportados, e seus truques
+* LVM e RAID:: Volumes virtuais de disco
+* Espelhamento de Disco:: Clonando instalaes
+* Software Relacionado:: Leitura posterior em tpicos relacionados
+* Copiando esse Manual:: Como fazer cpias desse manual
+* Histria:: A histria desse manual
+@ifnotplaintext
+* ndice:: ndice de conceitos citados
+@end ifnotplaintext
+@end menu
+
+@node Introduo
+@chapter Introduo
+
+@menu
+* Overview:: GNU Parted e conhecimentos necessrios
+* Software Necessrio:: Dependncias de software do GNU Parted
+* Plataformas Suportadas:: Aonde voc pode usar o GNU Parted
+* Licena:: O que voc pode e o que no pode com o GNU Parted
+* Compilando:: Como compilar o GNU Parted
+* Discos de boot do Parted:: Como usar o Parted em plataformas no suportadas
+@end menu
+
+@node Overview
+@section Overview do GNU Parted
+@cindex descrio do parted
+@cindex overview
+@cindex descrio do parted
+@cindex bugs, como relatar
+@cindex relatando bugs
+@cindex falando com os desenvolvedores
+
+O GNU Parted um programa para criar, destruir, redimensionar,
+checar e copiar parties, e os sistemas de arquivos nelas.
+Ele til para criar espao para novos sistemas operacionais,
+reorganizar o uso de disco, copiar dados entre discos rgidos, e
+``espelhamento de discos'' --- clonar instalaes em muitos
+computadores.
+
+Esta documentao assume que voc conhece parties e sistemas de
+arquivos. Se voc pode querer aprender mais sobre eles, a Partition
+mini-HOWTO leitura recomendada. Ela provavelmente vem com a sua
+distribuio, ou est disponvel em
+
+@c FIXME: standards: howto labelled non-free by LDP
+@uref{http://www.linuxdoc.org/HOWTO/mini/Partition/index.html}
+
+O GNU Parted foi feito para minizar as chances de perdas de dados.
+Por exemplo, ele foi feito para evitar perda de dados durante
+interrupes (como falta de luz) e realiza muitas checagens de erro.
+Contudo podem existir bugs no Parted, ento voc deve fazer backup de
+arquivos importantes.
+
+A pgina do GNU Parted @uref{www.gnu.org/software/parted}. Ele pode
+ser baixado em @uref{ftp.gnu.org/gnu/parted}.
+
+A lista de e-mails do Parted @email{parted@@gnu.org}. Para se
+inscrever, escreve para @email{bug-parted-request@@gnu.org} com @samp{subscribe} no assunto. Informaes para inscrio e os arquivos esto disponveis em:
+
+@uref{http://mail.gnu.org/mailman/listinfo/bug-parted}
+
+Por favor mande relatos de bugs para @email{bug-parted@@gnu.org}.
+Quando enviar relatos de bugs, por favor inclua a verso do GNU Parted.
+Se o bug relativo a tabelas de partio, ento por favor inclua a
+sada desses comandos:
+
+@example
+@group
+# @kbd{fdisk /dev/hda -l}
+# @kbd{fdisk /dev/hda}
+Command (m for help): @kbd{p}
+Command (m for help): @kbd{x}
+Extended command (m for help): @kbd{p}
+@end group
+@end example
+
+Sinta-se vontade para pedir ajuda nessa lista --- somente confira se
+a sua pergunta no foi respondida aqui ainda. Se voc no entende a
+documentao, por favor nos diga, para que possamos explicar melhor.
+Nossa filosofia : se voc precisar pedir por ajuda, ento algo precisa
+ser ajustado para que voc (e outros) no precisem pedir por ajuda.
+
+Do mesmo modo, adoraramos ouvir suas idias :-)
+
+@node Software Necessrio
+@section Software necessrio para usar o Parted
+@cindex dependncias de software
+@cindex software necessrio
+@cindex libuuid
+@cindex e2fsprogs
+@cindex readline
+@cindex gettext
+
+O GNU Parted depende dos seguintes pacotes para compilar corretamente:
+
+@itemize @bullet
+
+@item libuuid, part of the e2fsprogs package. Se voc no tem, voc
+pode peg-la em:
+
+ @uref{http://web.mit.edu/tytso/www/linux/e2fsprogs.html}
+
+Se voc quer compilar o Parted e a e2fsprogs, note que voc vai
+predcisar fazer @kbd{make install} and @kbd{make install-libs} e2fsprogs.
+
+@item GNU Readline (opcional), disponvel em
+
+ @uref{ftp://ftp.gnu.org/gnu/readline}
+
+Se voc est compilando o Parted, e voc no tem readline, voc
+pode desabilitar o suporte do Parted a readline com o a opo
+@kbd{--disable-readline} para o @command{configure}.
+
+@item GNU gettext (ou software compatvel) para compilao, se
+voc dese suporte a internacionalizao.
+
+ @uref{ftp://ftp.gnu.org/gnu/gettext}
+
+@item libreiserfs, se voc quiser suporte a reiserfs:
+
+ @uref{http://reiserfs.linux.kiev.ua}
+
+Preste ateno que o parted vai automaticamente detectar a libreiserfs
+quando rodar, e vai habilitar o suporte a reiserfs. A libreiserfs
+nova e no foi muito testada ainda.
+
+@end itemize
+
+@node Plataformas Suportadas
+@section Platformas aonde o GNU Parted roda
+@cindex plataformas suportadas
+@cindex platformas, suportadas
+
+Esperamos que essa lista cresa bastante. Se voc no tem uma dessas
+plataformas (Linux no momento!), ento voc precisar usar um disco de
+boot. @xref{Discos de boot do Parted, Usando os Discos de Boot do Parted}.
+
+@table @asis
+@item GNU/Linux
+Linux verses 2.0 para cima, no Alpha, PCs x86, PC98, Macintosh PowerPC, e Sun.
+
+@c RMK: veracidade: bem, *Eu* nunca ussei o parted num GNU/Hurd ... :)
+@item GNU/Hurd
+Suporte experimental.
+
+@end table
+
+A GNU libc 2.1 ou superior necessria. Voc provavelmente pode usar
+verses anteriores usando a opo @samp{--disable-nls}.
+@xref{Compilando o GNU Parted}. (Nota: Eu acho que ns j tiramos essa
+necessidade. fazer: checar se funciona na libc 2.0!)
+
+@node Licena
+@section Termos de distribuio para o GNU Parted
+@cindex termos da licena
+@cindex terms da distribuio
+@cindex gnu gpl
+@cindex gpl
+
+O GNU Parted software livre, previsto pela GNU General Public
+Licese Version 2. Ela deve vir com a distribuio do Parted, no arquivo
+COPYING. Se no, escreva para a Free Software Foundation, Inc.,
+51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+
+Libparted considerada parte do GNU Parted. Ela prevista pela GNU
+General Public License. NO lanada sobre a GNU Lesser General Public
+License (LGPL).
+
+@node Compilando
+@section Compilando o GNU Parted
+@cindex compilando o parted
+@cindex compilando o parted
+
+Se voc quer compilar o GNU Parted, geralmente feito com:
+
+@example
+@group
+$ @kbd{./configure}
+$ @kbd{make}
+@end group
+@end example
+
+Contudo h algumas opes para o @command{configure}:
+
+@table @code
+@item --without-readline
+desliga o uso de readline. Isso til para fazer discos de boot,
+etc., onde poucas bibliotecas esto disponveis.
+
+@item --disable-debug
+no inclui smbolos para debugar
+
+@item --disable-dynamic-loading
+desabilita o carregamento dinmico de algumas biblioteas (somente
+reiserfs no momento, apesar de haver pretenses de expanso). Carregamento
+dinmico til porque ele permite voc reusar as bibliotecas compartilhadas
+do libparted mesmo quando voc no sabe se algumas bibliotecas vo estar
+disponveis. Isso tem um pequeno aumento (principalmente ligando com a
+libdl), ento pode ser til desabilitar isso em discos de boot se voc
+no precisa de flexibilidade.
+
+@item --disable-fs
+desabilita o suporte a todos os sistemas de arquivo
+
+@item --disable-nls
+desativa o suporte a lngua nativa. Isso til par usar com verses
+antigas da glibc, ou uma verso reduzida da glibc boa para discos de
+boot.
+
+@item --disable-shared
+desabilita o uso de bibliotecas compartilhadas. Ela pode ser necessria
+para uso com verses antigas da GNU libc, se voc receber um erro sobre
+algum ``registrador cuspido''. Tambm til para discos de boot.
+
+@item --disable-Werror
+ignorar avisos na compilao
+
+@item --enable-all-static
+compila o executvel do Parted como um binrio completamente esttico
+Isto conveniente para discos de boot, porque voc no precisa instalar
+qualquer bibliotecas no disco de boot (contudo, alguns programas podem
+precisar delas@dots{}) Nota: voc tambm vai precisar rodar o strip(1).
+
+@item --enable-discover-only
+suporta somente leitura/checagem
+
+@item --enable-mtrace
+habilita debugar os malloc()'s
+
+@item --enable-read-only
+desabilita escrita (para debugar)
+
+@end table
+
+@node Discos de Boot do Parted
+@section Usando um Disco de Boot do Parted
+@cindex disco de boot
+@cindex disquete de boot
+@cindex plataformas no-suportadas
+
+Se voc quer rodar o Parted numa mquina sem o GNU/Linux instalado, ou
+vo quer redimensionar uma partio raz ou de boot, voc vai precisar
+usar um disco de boot.
+
+Uma imagem para um disco de boot est disponvel em:
+
+@uref{ftp://ftp.gnu.org/gnu/parted/bootdisk/partboot.img}
+
+@c RMK: printing: added some wording here to make the paragraph look
+@c acceptable in print
+Para criar os discos de boot, a imagem de disco deve ser escrita para
+um disquete de boot. No GNU/Linux, isso pode ser feito com
+
+@example
+# @kbd{dd if=partboot.img of=/dev/fd0 bs=1440k}
+@end example
+
+@noindent Ou use o RAWRITE.EXE dentro do DOS.
+
+Infelizmente, o disco de boot no d suporte a vrios tipos de hardware.
+Se o seu disco rgido no suportado, ento voc vai precisar fazer o
+seu prprio disco de boot. Voc pode copiar o binrio do parted do disco
+de boot do parted para outro disco, ou tentar outros discos de boot, ou
+fazer o seu prprio. Voc pode achar o mkparted til, que um script
+shell para fazer seus prprios discos de boot do parted. Ele est
+disponvel em:
+
+@uref{ftp://ftp.tux.org/pub/people/kent-robotti/mkparted}
+
+Para copiar o parted do disco de boot para outro disco:
+
+@enumerate
+@item Fazer o Boot de um disco de boot do Parted.
+
+@item Insira outro disquete de boot formatado em ext2. Se ele no est
+formatado, voc pode criar um sistema de arquivo com, por exemplo:
+
+@example
+$ @kbd{parted /dev/fd0 mklabel loop mkpartfs primary ext2 0 1.4}
+@end example
+
+@item Monte o disquete, ex:
+
+@example
+$ @kbd{mount -t ext2 /dev/fd0 /mnt/floppy}
+@end example
+
+@item Copie o @file{/sbin/parted} para o disquete, ex:
+
+@example
+$ @kbd{cp /sbin/parted /mnt/floppy}
+@end example
+
+@item Copie @file{/lib/*} para o disquete, ex:
+
+@example
+$ @kbd{cp /lib/* /mnt/floppy}
+@end example
+
+@item Desmonte o disquete, ex:
+
+@example
+$ @kbd{umount /mnt/floppy}
+@end example
+
+@item Ache um disquete de boot que @emph{realmente} suporte o seu
+disco rgidos. (Dica: try looking for rescue disks from various
+distributions on big mirror sites)
+
+@item Tire o seu disquete de boot. Monte o disquete aonde voc copiou o Parted.
+
+@item Rode o Parted. Por exemplo,
+
+@example
+# @kbd{cd /mnt/floppy}
+# @kbd{LD_LIBRARY_PATH=. ./parted}
+@end example
+@end enumerate
+
+@node Usando o Parted
+@chapter Usando o Parted
+@cindex comandos
+
+@menu
+* Particionando:: Particionamento de disco no context
+* Rodando o Parted:: Particionamento com o Parted
+* Chamando o Parted:: Chamando o parted e suas opes
+* Explicao dos command:: Explicao completa dos comandos do parted
+* Exemplos:: Sesses de exemplo do Parted
+@end menu
+
+@node Particionando
+@section Conceitos de Particionamento
+@cindex overview do particionamento
+
+Infelizmente, particionar o disco mais complicado. Isto porque
+exisstem interaes entre muitos sistemas operacionais diferentes
+que precisam ser levadas em conta:
+
+@itemize @bullet
+@item
+A BIOS ou firmware - o programa que colocado numa ROm dentro do seu
+computador, que faz checagem de memria, etc. Voc no pode (facilmente)
+mudar os programas nesse sistema. Exemplos de BIOS ou programas firmware:
+AmiBIOS, Award, Phoenix, OpenFirmware. Voc somente vai ter um desses
+programas.
+
+@item
+O carregador de boot - o programa que permite voc selecionar qual
+sistema operacional que voc quer usar, e carrega aquele sistema
+operacional. Exemplos: LILO, GRUB, Yaboot, Quik. Voc pode ter mais de
+um carregador de boot instalado, especialmente se voc tem mais de um
+tipo de sistema operacional instalado.
+
+@item
+O sistema operacional (nesse momento, este deve ser o GNU/Linux) que
+rode Parted e outros sistemas operacionais que voc use.
+
+@item
+Os tipos de sistemas de arquivo - a maneira como os dados devem ser
+guardados nas parties. Exemplos deles so: ext2, fat32, hfs, reiserfs.
+Voc freqentemente ter parties de sistemas de arquivo diferente.
+@end itemize
+
+O Parted suporta muitas combinaes de BIOS, carregadores de boot,
+sistemas operacionais, e sistemas de arquivo, e vai suportar mais
+ainda no futuro. Para melhor entender as regras de cada, por favor
+veja @ref{BIOSes and Firmware}, @ref{Boot Loaders},
+@ref{Sistemas operacionais}, e @ref{Sistemas de arquivo}.
+
+Este captulo descreve como usar o Parted, que sempre o mesmo, no
+importa que sistemas que voc est usando. Voc deve ler esse captulo,
+ento cada um dos captulos sobre BIOS's, carregadores de boot, sistemas
+operacionais, e sistemas de arquivo. Contudo, voc s precisa ler as
+sees que so relevantes pra voc. Por exemplo, se voc s usa o LILO
+como carregador de boot, voc s precisar ler a introduo e
+@ref{LILO, the section on LILO}.
+
+@node Rodando o Parted
+@section Usando o GNU Parted
+@cindex modos de uso
+
+O Parted tem dois modos: linha de comando e interativo. O Parted
+sempre deve comear com:
+
+@example
+# @kbd{parted @var{device}}
+@end example
+
+@noindent aonde @var{device} o dispositivo de disco rgido que voc
+quer editar. (Se voc malandro, o Parted vai tentar adivinhar qual
+dispositivo voc quer.)
+
+No modo de linha de comando, ele seguido por um ou mais comandos.
+Por exemplo:
+
+@example
+# @kbd{parted /dev/sda resize 1 52 104 mkfs 2 fat16}
+@end example
+
+@noindent Opes (como @kbd{--help}) s podem ser especificadas na
+linha de comando.
+
+No modo interativo, os comandos so inseridos um de cada vez num prompt,
+e voc modifica o disco imediatamente. Por exemplo:
+
+@example
+(parted) @kbd{resize 1 52.0005 104.5}
+(parted) @kbd{mkfs 2 fat16}
+@end example
+
+@c RMK MARK
+
+@noindent Abreviaes no-ambguas so permitidas. Por exemplo, voc pode
+digitar ``p'' ao invs de ``print'', e ``re'' ao invs de ``resize''.
+Comandos podem ser digitados, tanto em ingls, ou em portugus. Isto
+pode criar ambiguidades.
+
+Tambm perceba que voc pode specificar casas decimais nos nmeros
+correspondentes (em megabytes). Nmeros negativos so contados a partir
+do final do disco, com "-0" sendo o final do disco.
+
+Se voc no der um paramtro para um comando, o Parted vai perguntar para
+voc. Por exemplo:
+
+@example
+(parted) @kbd{resize 1}
+Start? @kbd{0}
+End? @kbd{400}
+@end example
+
+O Parted sempre vai avisar voc antes de fazer algo que potencialmente
+perigoso, a no ser que algo seja algo obviamente perigoso (por exemplo:
+rm, mklabel, mkfs). Por exemplo, se voc tenta diminuir ``muito'' uma
+partio (por exemplo, menos que o espao disponvel), o Parted vai
+automaticamente redimensionar para o mnimo que ele pode fazer sem perder
+dados. Se este mnimo muito diferente do que voc pediu, ele vai avisar
+que vai fazer uma coisa significantemente diferente do que voc pediu.
+Por causa dos sistemas de particionamento terem restries complicadas,
+o Parted geralmente vai fazer algo diferente do que voc pediu (Por
+exemplo, criar um particionamento comeando em 10.352, e no 10.4).
+
+@node Chamando o Parted
+@section Opes de Linha de Comando
+@cindex opes na chamada
+@cindex comandos, overview
+@cindex opes na chamada
+
+Quando chamado na linha de comando, o parted suporta a seguinte sintaxe:
+
+@example
+# @kbd{parted [@var{opo}] @var{dispositivo} [@var{comando} [@var{argumento}]]}
+@end example
+
+As seguintes opes e comandos esto disponveis. Para explicaes
+detalhadas do uso dos comandos do parted, veja @ref{Command explanations}.
+Opes comeam com um hfen, e comandos no:
+
+Opes
+
+@table @samp
+@item -h
+@itemx --help
+mostra uma mensagem de ajuda
+
+@item -i
+@itemx --interactive
+quando necessrio, pede ao usurio por interveno
+
+@item -s
+@itemx --script
+nunca pede pela interveno do usurio
+
+@item -v
+@itemx --version
+mostra a verso
+display the vesion
+@end table
+
+@node Explicao dos comandos
+@section Comandos de Sesso no Parted
+@cindex sintaxe dos comandos
+@cindex listagem detalhada dos comandos
+@cindex comandos, lista detalhada
+
+O GNU Parted nos d os seguintes comandos:
+
+@menu
+* check::
+* cp::
+* help::
+* mklabel::
+* mkfs::
+* mkpart::
+* mkpartfs::
+* move::
+* name::
+* print::
+* quit::
+* rescue::
+* resize::
+* rm::
+* select::
+* set::
+@end menu
+
+@node check
+@subsection check
+@cindex check, descrio do comando
+@cindex descrio do comando, check
+
+@deffn Comando check @var{minor}
+
+Checa se o sistemas de arquivo na partio @var{minor}
+tem algum erro.
+
+Exemplo:
+
+@example
+(parted) @kbd{check 1}
+@end example
+
+Checa o sistema na partio 1.
+@end deffn
+
+@node cp
+@subsection cp
+@cindex cp, descrio do comando
+@cindex descrio do comando, cp
+
+@deffn Comando cp [@var{qual-dispositivo}] @var{from-minor} @var{to-minor}
+
+Copia o sistemas de arquivo na partio @var{from-minor} para a partio
+@var{to-minor}, apagando o contedo original da partio de destino.
+
+Um parmetro opcional pode ser dado, @var{qual-dispositivo}, que
+especifica de qual dispositivo a partio de origem .
+
+Sistemas de arquivo suportados
+@itemize
+@item ext2, ext3
+(desde que a partio de destino maior que a partio de origem)
+
+@item fat16, fat32
+@item linux-swap
+(equivalente ao mkswap na partio de destino)
+@item reiserfs (se a libreiserfs est instalada)
+
+@end itemize
+
+Exemplo:
+
+@example
+(parted) @kbd{cp /dev/hdb 2 3}
+@end example
+
+@c FIXME: this doesn't format right.
+
+Copia a partio 2 do @file{/dev/hdb} (por exemplo, @file{/dev/hdb2})
+para a partio em 3, no dispositivo aonde o Parted foi carregado,
+destruindo o contedo original da partio 3.
+@end deffn
+
+@node help
+@subsection help
+@cindex help, descrio do comando
+@cindex descrio do comando, help
+
+@deffn Comando help [@var{comando}]
+
+Mostra a ajuda geral, ou a ajuda no @var{comando}.
+
+Exemplo:
+
+@example
+(parted) @kbd{help resize}
+@end example
+
+Mostra a ajuda para o comando resize.
+@end deffn
+
+@node mklabel
+@subsection mklabel
+@cindex mklabel, descrio do comando
+@cindex descrio do comando, mkindex
+
+@deffn Comando mklabel @var{tipo-de-etiqueta}
+
+Cria uma nova etiqueta de disco, do tipo @var{tipo-de-etiqueta}. A nova
+etiqueta de disco no vai ter parties. Este comando (normalmente) no
+vai tecnicamente destruir seus dados, mas vai faz-los inutilizveis,
+e voc vai precisar usar o comando rescue (@pxref{Softwares Relacionados})
+para recuperar qualquer partio. Gpart s trabalha com etiquetas de
+disco do msdos (AFAIK), mas muito melhor que o parted para recuperar
+parties. O Parted funciona em todas as tabelas de partio.
+@footnote{Todo mundo parece ter diferentes palavras para ``etiqueta
+de disco'' --- todas essas palavras significam a mesma coisa: tabela
+de parties, mapa das parties. Tambm o Registro Mestre do Boot em
+mquinas x86 guardado no mesmo setor das Tabelas de Partio (voc
+no precisa saber disso para usar o Parted).}
+
+@var{tipo-de-etiqueta} deve ser de um desses tipos de tabelas de partio suportados:
+@itemize
+@item bsd
+@item loop (acesso bruto ao disco)
+@item gpt
+@item mac
+@item msdos
+@item pc98
+@item sun
+@end itemize
+
+Exemplo:
+
+@example
+(parted) @kbd{mklabel msdos}
+@end example
+
+Cria uma etiqueta de disco ao estilo msdos.
+@end deffn
+
+@node mkfs
+@subsection mkfs
+@cindex mkfs, descrio do comando
+@cindex descrio do comando, mkfs
+
+@deffn Command mkfs @var{minor} @var{tipo-de-sistema-de-arquivo}
+
+Faz um sistemas de arquivo @var{tipo-de-sistema-de-arquivo} na partio
+@var{minor}, destruindo todos os dados que residem naquela partio.
+
+Tipos de arquivo suportados:
+@itemize
+@item ext2
+@item mips
+@item fat16
+@item fat32
+@item linux-swap
+@item reiserfs (se a libreiserfs estiver instalada)
+@end itemize
+
+Exemplo:
+
+@example
+(parted) @kbd{mkfs 2 fat32}
+@end example
+
+Faz um sistemas de arquivo @var{fat32} na partio 2.
+@end deffn
+
+@node mkpart
+@subsection mkpart
+@cindex mkpart, descrio do comando
+@cindex descrio do comando, mkpart
+
+@deffn Comando mkpart @var{tipo-de-partio} [@var{tipo-de-sistemas-de-arquivo}] @var{comeo} @var{fim}
+
+Cria uma nova partio, @emph{sem} criar um novo sistemas de arquivo
+na partio. Ela til para criar parties para sistemas de arquivo
+(ou LVM, etc.) que o Parted no suporta. Voc pode especificar tipo
+de sistemas de arquivo, para definir o cdigo de partio apropriado
+na tabela de parties para a nova partio. @var{tipo-de-sistemas-de-arquivo}
+ necessrio para parties de dados (por exemplo, parties no-
+extendidas). @var{comeo} e @var{fim} so a distncia do comeo do
+didco, isto , a ``distncia'' do comeo do disco.
+
+@var{tipo-de-partio} uma dessas: primary (primria), extended
+(extendida), logical (lgica). Extendida e lgica somente so usadas
+para tabelas de partio do tipo msdos e mips.
+
+@var{tipo-de-sistemas-de-arquivo} deve ser um dos suportados:
+@itemize
+@item ext2
+@item fat32
+@item fat16
+@item HFS
+@item linux-swap
+@item NTFS
+@item reiserfs
+@item ufs
+@end itemize
+
+Exemplo:
+
+@example
+(parted) @kbd{mkpart logical 0.0 692.1}
+@end example
+
+Cria uma partio lgica que vai conter um sistemas de arquivo ext2.
+A partio vai comear no comeo do disco, e finalizar em 692.1
+megabytes naquele disco.
+
+@end deffn
+
+@node mkpartfs
+@subsection mkpartfs
+@cindex mkpartfs, descrio do comando
+@cindex descrio do comando, mkpartfs
+
+@deffn Comando mkpartfs @var{tipo-de-partio} @var{tipo-de-sistemas-de-arquivos} @var{comeo} @var{fim}
+
+Cria uma nova partio do tipo @var{tipo-de-partio} com um novo
+sistemas de arquivo do tipo @var{tipo-de-sistemas-de-arquivo} nele.
+a nova partio vai comear em @var{comeo} megabytes, e tem fim em
+@var{fim} megabytes do comeo do disco.
+No use esse comando para recuperar uma partio (use mkpart ao invs
+disso).
+
+@var{tipo-de-partio} uma dessas: primary (primria), extended
+(extendida), logical (lgica). Extendida e lgica so somente usadas
+por tabelas de partio do tipo msdos e mips.
+
+@var{tipo-de-sistemas-de-arquivo} deve ser um dos seguintes suportados:
+@itemize
+@item ext2
+@item fat32
+@item fat16
+@item linux-swap
+@item reiserfs (se a libreiserfs est instalada)
+@end itemize
+
+Exemplo:
+
+@example
+(parted) @kbd{mkpartfs logical ext2 440 670}
+@end example
+
+Cria uma partio lgica e coloca um sistemas de arquivo do tipo
+ext2, comeando em 440 megabytes e finalizando em 670 megabytes
+do comeo do disco.
+@end deffn
+
+@node move
+@subsection move
+@cindex move, descrio do comando
+@cindex descrio do comando, move
+
+@deffn Comando move @var{minor} @var{comeo} [@var{fim}]
+
+Move a partio no disco, movendo seu comeo para @var{comeo}.
+Nota: mover nunca muda o nmero do minor.
+
+Se nenhum @var{fim} dado, o tamanho da partio permanece o mesmo.
+
+Sistemas de arquivo suportados:
+@itemize
+@item ext2, ext3
+(desde que a partio de destino maior que a partio de origem)
+@item fat32
+@item fat16
+@item linux-swap
+@item reiserfs (se a libreiserfs est instalada)
+@end itemize
+
+Exemplo:
+
+@example
+(parted) move 2 150
+@end example
+
+Move a partio com o minor nmero 2 para que ela comece 150 megabytes
+do incio do disco.
+
+@end deffn
+
+@node name
+@subsection name
+@cindex name, descrio do comando
+@cindex descrio do comando, name
+
+@deffn Comando name @var{minor} @var{nome}
+
+Define um nome para a partio @var{minor} (Mac e PC98 somente). O
+nome poder ser colocado entre aspas.
+
+Exemplo:
+
+@example
+(parted) @kbd{name 2 'Secreto'}
+@end example
+
+Define o nome da partio 2 para `Secreto'.
+@end deffn
+
+@node print
+@subsection print
+@cindex print, descrio do comando
+@cindex descrio do comando, print
+
+@deffn Comando print
+
+Mostra a tabela de parties que o parted est editando.
+
+Exemplo:
+
+@example
+@group
+(parted) @kbd{print}
+Disk geometry for /dev/hda: 0.000-2445.679 megabytes
+Disk label type: msdos
+Minor Start End Type Filesystem Flags
+1 0.031 945.000 primary FAT boot, lba
+2 945.000 2358.562 primary ext2
+3 2358.562 2445.187 primary linux-swap
+@end group
+@end example
+@end deffn
+
+@node quit
+@subsection quit
+@cindex quit, descrio do comando
+@cindex descrio do comando, quit
+
+@deffn Comando quit
+
+Sai do Parted.
+
+@c RMK: generality: the following will apply to any operating system on
+@c which parted will run, not only Linux-based ones.
+@c clausen: yeah... just that the way hurd and linux work are totally
+@c different, and it's actually very hard to speak in general. Need to
+@c discuss this more
+ somente depois que o Parted sai que o kernel do Linux fica sabendo
+das mudanas que o Parted fez nos discos. Contudo, as mudanas causadas
+quando voc digita um comando vai @emph{provavelmente} serem feitas para
+o disco imediatamente aps digitar um comando. Mas, Linux cache, e o
+cache do hardware do disco pode por uma demora nisso.
+@end deffn
+
+@node rescue
+@subsection rescue
+@cindex rescue, descrio do comando
+@cindex descrio do comando, rescue
+
+@deffn Comando rescue @var{comeo} @var{fim}
+resgata parties perdidas entre @var{comeo} e @var{fim}
+Procura entre @var{comeo} e @var{fim} por assinaturas de sistemas de
+arquivo. Se alguma encontrada, ele vai perguntar se voc quer criar
+uma partio pra ele. Isto til quando voc acidentalmente apagou uma
+partio com o comando rm do parted, por exemplo.
+
+Infelizmente no h uma barra de progresso, porque difcil (uma
+possvel correo!) para dizer quanto vai demorar. Se o Parted no acha
+nada, ele vai demorar muito tempo procurando (o que um bug que deve
+ser corrigido). No entanto, no exemplo abaixo, a partio
+instantaneamente recuperada.
+
+Exemplo:
+
+@example
+(parted) @kbd{print}
+@group
+Disk geometry for /dev/hdc: 0.000-8063.507 megabytes
+Disk label type: msdos
+Minor Start End Type Filesystem Flags
+1 0.031 8056.032 primary ext3
+@end group
+(parted) @kbd{rm}
+Partition number? 1
+(parted) @kbd{print}
+@group
+Disk geometry for /dev/hdc: 0.000-8063.507 megabytes
+Disk label type: msdos
+Minor Start End Type Filesystem Flags
+@end group
+@end example
+
+AI! Ns deletamos a nossa partio ext3!!! Parted vem para nos salvar...
+
+@example
+(parted) @kbd{rescue}
+Start? 0.0005?
+End? 8063.5073?
+Information: A ext3 primary partition was found at 0.031Mb ->
+8056.030Mb. Do you want to add it to the partition table?
+Yes/No/Cancel? @kbd{y}
+(parted) @kbd{print}
+@group
+Disk geometry for /dev/hdc: 0.000-8063.507 megabytes
+Disk label type: msdos
+Minor Start End Type Filesystem Flags
+1 0.031 8056.032 primary ext3
+@end group
+@end example
+
+Est de volta! :)
+
+@end deffn
+
+@node resize
+@subsection resize
+@cindex resize, descrio do comando
+@cindex descrio do comando, resize
+
+@deffn Comando resize @var{minor} @var{comeo} @var{fim}
+
+Redimensiona a partio com o nmero @var{minor}. A partio vai comear
+em @var{comeo} do comeo do disco, e terminar em @var{fim} do comeo do
+disco. O resize nunca muda o nmero do minor. Parties extendidas podem
+ser redimensionadas, desde que a nova partio entendida contenha
+todas as parties lgicas.
+
+Note que o Parted no requer que um sistema seja ``desfragmentado''
+(Parted pode mover os dados seguramente se necessrio). uma perda
+de tempo desframentar. No se preocupe!
+
+Sistemas de arquivo suportados:
+@itemize
+@item ext2, ext3 - restrio: o novo @var{comeo} deve ser o mesmo do antigo @var{comeo}.
+
+@item fat16, fat32
+
+@item linux-swap
+@item reiserfs (se a libreiserfs estiver instalada)
+@end itemize
+
+Exemplo:
+
+@example
+(parted) @kbd{resize 3 200 850}
+@end example
+
+Redimensiona a partio 3, para que ela comea em 200 megabytes
+e termine em 850 megabytes do comeo do disco.
+@end deffn
+
+@node rm
+@subsection rm
+@cindex rm, descrio do comando
+@cindex descrio do comando, rm
+
+
+@deffn Comando rm @var{minor}
+
+Remove a partio com nmero @var{minor}. Se voc acidentalmente apagar
+a partio com esse comando, use o mkpart (@emph{no} o mkpartfs) para
+recuper-la. Voc tambm pode usar o programa gpart (@pxref{Programas
+Relacionados}) para recuperar tabelas de partio danificadas.
+
+Nota para tabelas de partio do tipo msdos: se voc apagar uma partio
+lgica, todas as parties lgicas com um nmero maior que essa vo ser
+apagados. Por exemplo, se voc apagar uma partio lgica com um nmero
+minor 6, ento as parties que eram nmero 7, 8 e 9 devem ser renumeradas
+para 6, 7 e 8 respectivamente. Isto significa que voc deve atualizar a
+@file{/etc/fstab} em sistemas GNU/Linux.
+
+Exemplo:
+
+@example
+(parted) @kbd{rm 3}
+@end example
+
+Remove a partio 3.
+@end deffn
+
+@node select
+@subsection select
+@cindex select, descrio do comando
+@cindex descrio do comando, select
+
+@deffn Comando select @var{dispositivo}
+
+Seleciona o dispositivo, @var{dispositivo}, para o Parted editar. O
+dispositivo geralmente um dispositivo de disco rgido do Linux, ou,
+se acesso direto a um arquivo necessrio --- uma partio, dispositivo
+RAID em software, ou um volume lgico LVM.
+
+Exemplo:
+
+@example
+(parted) @kbd{select /dev/hdb}
+@end example
+
+Seleciona @file{/dev/hdb} (o disco slave na primeira controladora ide
+no Linux) como um dispositivo para editar.
+@end deffn
+
+@node set
+@subsection set
+@cindex set, descrio do comando
+@cindex descrio do comando, set
+
+@deffn Comando set @var{minor} @var{sinalizador} @var{estado}
+
+Muda um sinalizador na partio de nmero @var{minor}. Um
+sinalizador pode ser ``on'' ou ``off''. Algumas ou todas essas
+flags estaro disponveis, dependendo qual tabela de parties
+voc est usando:
+
+@table @samp
+@item boot
+(Mac, MSDOS, PC98) - s deve ser habilitada se voc quer fazer
+boot da partio. A semntica poder variar entre as tabelas de
+partio. Para tabelas de partio do MSDOS, somente uma partio
+pode ser carregvel. Se voc est instalando LILO numa partio
+(@pxref{LILO}), ento aquela partio deve ser carregvel. Para tabelas
+de partio do PC98, todas as parties ext2 devem ser carregveis
+(Isto reforado pelo Parted).
+
+@item lba
+(MSDOS) - este sinalizador pode ser habilitado, para dizer ao MS DOS,
+o MS Windows 9x ao MS Windows ME e outros sistemas baseados neles
+para usar o modo Linear (LBA).
+
+@item root
+(Mac) - este sinalizador deve ser habilitado se a partio est na
+partio raiz a ser usada pelo Linux.
+
+@item swap
+(Mac) - este sinalizador deve ser habilitado se a partio a swap
+que vai ser usada pelo Linux.
+
+@item hidden
+(MSDOS, PC98) - esta flag deve ser habilitada para esconder parties
+de sistemas operacionais Microsoft.
+
+@item raid
+(MSDOS) - este sinalizador pode ser habilitado para dizer ao Linux que
+essa partio uma partio de software RAID @xref{LVM e RAID}.
+
+@item LVM
+(MSDOS) - este sinalizador pode ser habilitado para dizer partio
+linux que a partio um volume fsico.
+
+@end table
+
+O comando print mostra todas os sinalizadores para cada partio.
+
+Exemplo:
+
+@example
+(parted) @kbd{set 1 boot on}
+@end example
+
+Define o sinalizador de @samp{boot} na partio 1.
+@end deffn
+
+@node Exexmplos
+@section Sesses de Exemplo do Parted
+@cindex sesses de exemplo do parted
+@cindex sesses de exemplo do parted
+
+Estes exemplos tenta cobrir a maior parte das circunstncias, com a
+exceo de espelhamento de disco, que discutido em @ref{Espelhamento
+de disco}.
+
+@menu
+* Aumentando uma partio usando espao no-usado::
+* Redimensionando uma partio ext2 num disco cheio::
+@end menu
+
+@node Aumentando uma partio usando espao inusado
+@subsection Exemplo: Aumentando uma partio para usar espao inusado
+@cindex aumentando uma partio, exemplo
+@cindex exemplo, aumentando uma partio
+
+Suponh que seu disco se parea com isso:
+
+@example
+@group
+(parted) @kbd{print}
+Disk geometry for /dev/hda: 0.000-1000.000 megabytes
+Disk label type: msdos
+Minor Start End Type Filesystem Flags
+1 0.063 500.000 primary ext2
+2 500.000 625.000 primary linux-swap
+@end group
+@end example
+
+@noindent Existem 375 Mb de espao livre no final do disco (depois da
+partio 2). A Partio 1 tem um sistemas de arquivo ext2, que o
+dispositivo riaz. A partio 2 um dispositivo de swap.
+
+Suponha que voc queira usar o espao livre no final do disco para o
+sistemas de arquivo na partio 1. Voc pode fazer o seguinte:
+
+@enumerate
+@item Estes passos vo modificar tanto o sistemas de arquivo raiz na
+partio 1, quanto o dispositivo de swap na partio 2. Portanto, voc
+no deveria estar usando nenhuma das duas parties. Voc provavelmente
+deve usar um disco de boot do Parted. @xref{Discos de boot do Parted}.
+Do disco de boot, rode o Parted:
+
+@example
+# @kbd{parted /dev/hda}
+@end example
+
+@item Remove a partio 2 (a partio de swap). Normalmente, voc no
+ia querer apagar uma partio com dados nela. Mas, uma partio no
+contm dados enquanto no est montada, ento voc pode remov-la, e
+criar uma outra partio de swap no seu lugar.
+
+@example
+(parted) @kbd{rm 2}
+@end example
+
+@item Cria uma nova partio de swap no fim do disco:
+
+@example
+@group
+(parted) @kbd{mkpartfs primary linux-swap 875 999.9}
+(parted) @kbd{print}
+Disk geometry for /dev/hda: 0.000-1000.000 megabytes
+Disk label type: msdos
+Minor Start End Type Filesystem Flags
+1 0.063 500.000 primary ext2
+2 875.000 1000.000 primary linux-swap
+@end group
+@end example
+
+@item Aumenta a partio 1 no espao que est sobrando
+
+@example
+(parted) @kbd{resize 1 0.063 874.9}
+@end example
+
+Tudo feito!
+
+@example
+@group
+(parted) @kbd{print}
+Disk geometry for /dev/hda: 0.000-1000.000 megabytes
+Disk label type: msdos
+Minor Start End Type Filesystem Flags
+1 0.063 874.999 primary ext2
+2 875.000 1000.000 primary linux-swap
+@end group
+@end example
+@end enumerate
+
+
+@node Redimensionando uma partio ext2 em um disco cheio
+@subsection Exemplo: Redimensionando uma partio ext2 num disco cheio
+@cindex redimensionando uma partio num disco cheio, exemplo
+@cindex exemplo, redimensionando uma partio num disco cheio
+
+Suponha que o seu disco se parea com isso:
+
+@example
+@group
+(parted) @kbd{print}
+Disk geometry for /dev/hda: 0-8063.5 megabytes
+Disk label type: msdos
+Minor Start End Type Filesystem Flags
+1 0.0 23.5 primary ext2 boot
+2 23.5 8056.0 extended
+5 23.6 3545.6 logical ext2
+6 3545.6 7067.7 logical ext2
+7 7067.7 7326.5 logical ext2
+8 7326.5 7585.4 logical ext2
+9 7585.4 7844.2 logical linux-swap
+@end group
+
+@group
+$ @kbd{df -h}
+Filesystem Size Used Avail Use% Mounted on
+/dev/hda8 251M 31M 207M 13% /
+/dev/hda1 23M 2.4M 19M 11% /boot
+/dev/hda5 3.4G 577M 2.7G 18% /usr
+/dev/hda6 3.4G 289M 2.9G 9% /home
+/dev/hda7 251M 12M 226M 5% /var
+@end group
+@end example
+
+Suponha que voc queira aumentar a partio do @file{/var}
+@file{/dev/hda7}) para 1GB, usando algum espao da partio
+do @file{/home} (@file{/dev/hda6}).
+
+Para redimensionar uma partio usando o Parted, voc pode usar
+o comando resize:
+
+@example
+(parted) resize @var{numero-da-particao} @var{novo-comeo} @var{novo-fim}
+@end example
+
+@noindent @var{novo comeo} deve ser o mesmo que o antigo comeo em
+parties ext2 (infelizmente). Ento esse processo vai ficar mais
+complicado. @emph{} possvel, portanto. @footnote{Se o Parted suportasse
+mover o comeo de parties ext2 (como ele faz com parties FAT), ento
+seria muito mais simples:
+
+@example
+@group
+(parted) @kbd{resize 6 3545.6 6200}
+(parted) @kbd{resize 7 6200 7326.5}
+@end group
+@end example
+}
+
+@enumerate
+@item Diminuir a partio do @file{/home} (@file{/dev/hda6}) em 500MB:
+
+@example
+# @kbd{parted /dev/hda}
+(parted) @kbd{resize 6 3545.6 6200}
+@end example
+
+@item Cria uma nova partio no seu lugar. Ali onde @file{/var} vai
+estar, eventualmente. Esta nova partio vai ser numerada como 10.
+
+@example
+(parted) @kbd{mkpartfs logical ext2 6200 7067.7}
+@end example
+
+@item Copia a antiga partio do @file{/var} (@file{/dev/hda7}) para
+a nova (@file{/dev/hda10}).
+
+@example
+(parted) @kbd{cp 7 10}
+@end example
+
+@item Apaga a antiga @file{/var}
+
+@example
+(parted) rm 7
+@end example
+
+Nesse momento: todas as parties lgicas com nmero maior que 7
+mudaram de nmero. Ento 8, 9 e 10 viraram 7, 8 e 9 respectivamente.
+
+Esta renumerao no vai acontecer de verdade enquanto qualquer uma delas
+estiver montadas naquele disco (s vai acontecer quando voc reiniciar).
+Isto do que essa mensagem de aviso trata. Ento voc @emph{nunca} deve
+tentar montar um sistemas de arquivo tocado pelo Parted (redimensionado
+ou criado pelo Parted), antes de reiniciar se voc receber essa mensagem.
+
+@item Redimensiona a nova partio do @file{/var} (agora numerada para 9),
+adicionando o espao da antiga partio do @file{/var}:
+
+@example
+@group
+(parted) @kbd{resize 9 6200 7326.5}
+(parted) @kbd{quit}
+Warning: The kernel was unable to re-read the partition table on
+/dev/hda (Device or resource busy). This means Linux knows nothing
+about any modifications you made. You should reboot your computer
+before doing anything with /dev/hda.
+@end group
+@end example
+
+@item Pelos nmeros das parties terem mudado, a @file{/etc/fstab} deve
+ser atualizada. Isto pode ser feito antes de reiniciar, porque a partio
+raiz no foi tocada pelo Parted. (Se voc quer que o Parted faa algo com
+a partio raiz, voc precisa usar o disco de boot).
+
+Se a antiga @file{/etc/fstab} se parece com isso:
+
+@example
+@group
+/dev/hda8 / ext2 defaults 1 1
+/dev/hda1 /boot ext2 defaults 1 2
+/dev/hda6 /home ext2 grpquota,usrquota 0 2
+/dev/cdrom /mnt/cdrom iso9660 noauto,owner,ro 0 0
+/dev/hda5 /usr ext2 defaults 1 2
+/dev/hda7 /var ext2 grpquota,usrquota 0 2
+/dev/fd0 /mnt/floppy auto noauto,owner 0 0
+none /proc proc defaults 0 0
+none /dev/pts devpts gid=5,mode=620 0 0
+/dev/hda9 swap swap defaults 0 0
+@end group
+@end example
+
+Algumas linhas precisam ser alteradas:
+A few lines need to be changed:
+@itemize
+@item @file{/var} is now /dev/hda9 (because we copied it to a new
+partition)
+
+@item @file{/dev/hda8} (the root device) has been renumbered to
+@file{/dev/hda7}
+
+@item @file{/dev/hda9} (the swap device) has been renumbered to
+@file{/dev/hda8}
+@end itemize
+
+The new @file{/etc/fstab} looks like this:
+
+@example
+@group
+/dev/hda7 / ext2 defaults 1 1
+/dev/hda1 /boot ext2 defaults 1 2
+/dev/hda6 /home ext2 grpquota,usrquota 0 2
+/dev/cdrom /mnt/cdrom iso9660 noauto,owner,ro 0 0
+/dev/hda5 /usr ext2 defaults 1 2
+/dev/hda9 /var ext2 grpquota,usrquota 0 2
+/dev/fd0 /mnt/floppy auto noauto,owner 0 0
+none /proc proc defaults 0 0
+none /dev/pts devpts gid=5,mode=620 0 0
+/dev/hda8 swap swap defaults 0 0
+@end group
+@end example
+
+@item Reboot. That's it!
+@end enumerate
+
+@node BIOSes and Firmware
+@chapter BIOSes and Firmware
+@cindex bios
+@cindex firmware
+
+``BIOS'' (Basic Input/Output System) and ``firmware'' mean the same
+thing. However, on PC and PC98 based computers, the word BIOS is more
+common. On Apple Macintosh and Sun computers, the word ``firmware'' is
+more common. The BIOS or firmware program is built into a ROM chip
+inside your computer, that does memory checks, etc. You can not
+(easily) change this program. Since BIOSes today are generally
+compatible with BIOSes in use 20 years ago, these programs tend to have
+an antiquated design. Features have been added in counter-intuitive
+ways over the years, leading to overly complicated systems that cause a
+lot of confusion today.
+
+@menu
+* PC BIOSes:: The Legacy of IBM
+* Macintosh OpenFirmware:: Go Forth, Young Hacker!
+* PC98 BIOS:: The BIOS of the PC98 computer
+* SGI / MIPS Firmware:: The firmware of SGI MIPS computers
+@end menu
+
+@node PC BIOSes
+@section The PC BIOS
+@cindex pc bios
+@cindex bios, pc
+
+There are a few popular PC BIOSes: AmiBIOS, Award, Phoenix, and others.
+They all work in a similar way. None of these BIOSes understand or know
+about partition tables. They affect partitioning indirectly.
+
+There are a few popular PC BIOSes: AmiBIOS, Award, Phoenix, and others.
+They all work in a similar way. None of these BIOSes understand or know
+about partition tables. They affect partitioning indirectly.
+
+outras. Elas todas trabalham de modo semelhante. Nenhma dessas BIOSs
+entende ou conhecem sobre tabelas de partio, mas elas a afetam
+indiretamente.
+
+O seguinte ocorre quando o seu computador ligado:
+
+@enumerate
+@item Estas BIOSs carregam o primeiro bit do programa carregador de boot,
+guardado na MBR (Master Boot Record - Registro Mestre do Boot) no
+disco rgido.
+
+@item A BIOS execute o primeiro bit do carregador de boot, guardado na MBR
+(Master Boot Record - Registro Mestre do Boot) no disco rgido.
+
+@item O programa carregador de boot usa a BIOS para carregar o resto do
+prprio programa.
+
+@item O carregador de boot usa a BIOS para carregar o sistema operacional
+(ou quem sabe, outro carregador de boot, nesse caso, voc vai para o passo
+2 de novo).
+
+@item O sistema operacional pode ou no usar a bios para acessar arquivos
+(o Windows geralmente usa, o Linux ou o BSd no).
+@end enumerate
+
+@c RMK: FIXME: learn how to refer to entries in the above list, so that
+@c the following paragraphs doesn't depend on the order details of the
+@c list.
+
+Os passos (3) a (5) involvem programas comunicando-se com a BIOS, para
+pedir para falar com os discos. Existem duas maneiras de se comunicar
+com a BIOS para fazer isso: usando CHS (Cylinders Heads and Sectors -
+Cilindros Trilhas e Setores) ou LBA (Linear Block Addressing -
+Endereamento de Blocos Linear). BIOSs antigas somente vo suportar CHS.
+As novas BIOSs geralmente suportam tanto LBA quanto CHS, apesar do
+suporte a CHS ser interrompido no futuro. (o CHS considerado um sistema
+legado horrvel.)
+
+Passos (3) e (4), feitos pelo carregador deboot, sempre vo usar o mesmo
+mtodo de acesso --- sempre LBA ou sempre CHS. No caso do carregador de
+boot do Windows, ele determinado pelo indicador de LBA na partio de
+boot do Windows (@pxref{definida} para informaes sobre indicadores).
+No caso do Linux, voc provavelmente estar usando LILO ou GRUB como
+carregador de boot. O GRUB usa LBA se estiver disponvel, e CHS se no.
+O LILO requer que voc escolha quando voc instala ele (com as opes
+"linear" ou "lba32").
+
+@c RMK: FIXME: find way to refer to above steps by @-command
+Passo (5) - E/S feita pelo sistema operacional - somente o Windows
+faz E/S pela BIOS. [Ns ainda no sabemos o suficiente sobre os
+problemas, mas parece que o Windows pode ter seus prprios problemas
+com o modo CHS. As pessoas nos disseram de vezes em que o Windows
+corrompe seu prprio sistemas de arquivo, etc. realmente difcil
+para ns saber o que est acontecendo. Ns recomendamos fortemente
+que voc use LBA, se voc pode!]
+
+Ento existem 3 possveis situaes, todas discutidas aqui:
+
+@enumerate
+@item Voc est usando o modo CHS, e a sua BIOS s suporta o modo CHS.
+@item Voc est usando o modo CHS, e a sua BIOS suporta tanto LBA quanto CHS.
+Ento, voc quer converter do modo CHS para LBA O Mais Rpido Possvel
+@sc{tm}.
+@item Voc j est usando o modo LBA.
+@end enumerate
+
+@menu
+* O Parted e o modo CHS:: Usando o Parted em BIOSs com modo CHS
+* Do modo CHS para LBA:: Convertendo a BIOS do modo CHS para LBA
+* O Parted e o modo LBA:: Usando o Parted com o modo LBA
+@end menu
+
+@node O Parted e o modo CHS
+@subsection Usando o Parted em BIOS do modo CHS
+@cindex bios de modo chs
+@cindex chs, bios com geometria de disco do modo
+
+O Linux normalmente detecta a geometria da BIOS automaticamente. Contudo,
+s vezes isso d errado. Neste caso, voc mesmo deve dizer ao Linux,
+passando um parmetro para ele. Por exemplo, se o Linux pensa que o seu
+disco rgido @file{/dev/hda} tem a geometria 256/64/63, mas o programa
+de configurao da BIOS diz que a geometria 512/32/63, ento voc deve
+passar esse parmetro ao Linux:
+
+@example
+@kbd{hda=512,32,63}
+@end example
+
+Os parmetros so passados de diversas maneiras, dependendo do carregador
+de boot que voc est usando. Voc provavelmente est usando o LILO. Neste
+caso, voc adiciona a seguinte linha para o @file{/etc/lilo.conf}: (Voc
+ento precisa rodar o @command{/sbin/lilo}, e reiniciar para as mudanas
+terem efeito)
+
+@c RMK: FIXME: can't get the quotes right: texinfo double quotes ``'' don't
+@c work in example's, and keyboard double quotes "" don't look right in text.
+@example
+append="hda=512,32,63"
+@end example
+
+O Parted geralmente pode detectar se o Linux detectou a geometria incorreta.
+Contudo, ele no pode fazer isso se no existem parties no disco. Neste
+caso, voc mesmo pode checar. muito importante que voc faa isso.
+
+Algumas vezes, o Parted vai reclamar que as parties no esto alinhadas
+aos limites dos cilindros. O Parted vai te dar a opo de ignorar. Se voc
+ignorar, ento o Parted via fazer alguns truques com a sua tabela de
+parties. No Linux no vai ter problemas. No DOS e no Windows no vo ter
+problemas se eles esto usando o modo LBA. Se o DOS/Windows est usando
+o modo CHS, ento reinstalar o gerenciador de boot (@pxref{MS DOS
+MS Windows 9x MS Windows ME}) deve resolver qualquer problema - mas mudar
+pro modo LBA prefervel (veja @pxref{Do modo CHS para LBA}).
+
+Parties que esto envolvidas no processo de boot devem finalizar antes
+do cilindro 1024, se o modo CHS est sendo usado. Veja a seo sobre
+o processo de boot para determinar se a partio est envolvida no
+processo de boot. A configurao tpica ter uma pequena partio
+Linux para o @file{/boot}, uma partio Windows, e ento a(s)
+partio(es) Linux.
+
+@node Do modo CHS para o LBA
+@subsection Convertendo do modo CHS para o LBA
+@cindex chs para lba, converting de
+
+Para fazer com que o carregador de boot do Windows e o sistema
+operacional usarem o modo LBA, somente defina o indicador LBA em todas
+as parties FAT @ref{set}. Voc no deve ter problemas. Se voc
+tiver problemas carregando o Windows, ento reinstalar o carregador
+de boot do Windows vai consertar isso @ref{MS DOS MS Windows 9x MS
+Windows ME}.
+
+O Linux no usa a BIOS para E/S. Contudo, o carregador de boot (LILO
+ou GRUB) pode. O GRUB automaticamente usa LBA, caso esteja disponvel.
+O LILO exige a opo ``linear'' ou ``lba32''. Ento, se o LILO ainda
+carrega aps mudar o @file{/etc/lilo.conf} e rodar o @command{/sbin/lilo},
+ento est tudo feito! @xref{LILO}. (Se voc tiver problemas, reverta
+para CHS de volta, removendo a opo ``linear'' ou ``lba32'', e
+reinstalando o lilo do disco de boot.)
+
+Agora que voc est usando LBA continue lendo@dots{}
+
+@node O Parted e o modo LBA
+@subsection Usando o Parted no modo LBA
+@cindex modo lba
+@cindex lba, geometria de disco do modo
+
+O modo LBA resolve todos os problemas do CHS. Contudo, no existe uma
+maneira confivel para o Linux ou o Parted saber que voc est usando
+LBA, ento o Parted pode te dar avisos sobre cilindros no alinhados,
+ou a geometria da BIOS ser inconsistente, etc. Voc pode ignorar essas
+mensagens, se voc est usando o modo LBA. (Verses antigas do Parted
+tinham problemas, mas todos foram resolvidos).
+
+Quando o seu disco est no modo LBA, o Parted (e a maioria dos outros
+programas) vai dizer que a sua geometria X/255/63 - a menos que
+voc tenha mudado do CHS para LBA.
+
+@node Macintosh OpenFirmware
+@section OpenFirmware do the Apple Macintosh
+@cindex open firmware, macintosh
+@cindex macintosh open firmware
+
+Existem duas verses do OpenFirmware do PowerMac - uma usada no
+``antigo mundo'' do PowerMac, e outra usada no ``novo mundo''. O
+``Novo mundo'' se refere aos PowerPCs coloridos feitos desde 1999.
+Eles tem diferenas significantes. Contudo, ambos entendem tabelas
+de partio.
+
+Ambas requerem que o usurio escolha exatamente uma partio para ser
+a partio de boot (a partio com o carregador de boot). Contudo,
+eles usam mecanismos diferentes para fazer isso.
+
+@menu
+* Velho Mundo::
+* Novo Mundo::
+@end menu
+
+@node Velho Mundo
+@subsection OpenFirware Macintosh do Velho Mundo
+@cindex firmware macintosh do velho mundo
+@cindex velho mundo, firmware macintosh do
+@cindex firmware macintosh do velho mundo
+
+A partio escolhida para dar boot definida por vrios carregadores
+de boot, como o Quik. Ento, voc no deve precisar fazer nada. Ns
+poderamos adicionar suporte a isso no Parted, se algum gritar muito
+alto@dots{}
+
+@node Novo Mundo
+@subsection OpenFirware Macintosh do Novo Mundo
+@cindex firware macintosh do velho mundo
+@cindex novo mundo, firwarem macintosh do
+@cindex firwarem macintosh do novo mundo
+
+@c RMK: completeness: do we have a description of HFS anywhere here?
+OpenFirmware do novo mundo requer que a partio que d boot seja HFS
+e marcada como partio de boot. Ela usa um mecanismo diferente para
+ser marcada como a partio de boot. Isto controlado com o indicador
+``boot'' no Parted. Por exemplo:
+
+@example
+(parted) @kbd{set 2 boot on}
+@end example
+
+@node BIOS dos PC98
+@section As BIOS dos PC98
+@cindex bios do pc98
+
+@c RMK: completeness : should we describe what machines are likely to
+@c have a PC 98 bios?
+@c RMK: illiteracy: the only pages I found for PC98 info were in Japanese,
+@c which I can't read :(
+A BIOS dos PC98 permitem a voc marcar qualquer nmero de partio
+como bootvel. Voc pode desmarcar ou marcar uma partio como bootvel
+com o indicador ``boot'' do Parted. Por exemplo:
+
+@example
+(parted) @kbd{set 2 boot off}
+@end example
+
+
+@node Firmwares dos SGI / MIPS
+@section Firmware dos SGI / MIPS
+@cindex firmware dos sgi
+@cindex firmware dos mips
+
+
+
+O firmware dos SGI / MIPS permite voc fazer o boot de arquivos de
+boot especiais, que so gerenciados pela tabela de parties. No
+Parted, esses arquivos de boot so tratados como parties lgicas
+dentro das parties extendidas.
+
+Por exemplo:
+
+@example
+Disk label type: mips
+Minor Start End Type Filesystem Name Flags
+9 0.000 2.732 extended
+17 0.002 0.002 logical sgilabel
+18 0.003 1.162 logical symmon
+19 1.404 1.670 logical sash
+1 2.732 8555.212 primary xfs root
+2 8555.213 8682.270 primary swap
+@end example
+
+A Partio 9 a partio extendida (um cabealho de volume, na terminologia
+dos SGI/MIPS) aonde o arquivo de boot pode ficar. As parties 17, 18 e 19
+so os arquivos de boot. Seus nomes podem ser manipulados com o comando name
+do Parted. A partio 1 e 2 so parties normais. Elas no podem ter nomes.
+
+Note que o Linux no v os arquivos de boot como parties (talvez devesse?).
+Ento o /dev/hda17 no existe no Linux. Voc deve usar o dvhtool(8) para
+manipular arquivos de boot.
+
+@node Carregadores de Boot
+@chapter Carregadores de Boot
+@cindex carregadores de boot
+
+O carregador de boot o programa que permite que voc selecione qual
+sistema operacional voc quer usar, e carrega aquele sistema operacional.
+Voc pode ter mais de um carregador de boot instalado, especialmente se
+voc tem mais de um tipo de sistema operacional instalado. comum para
+carregadores de boot poderem carregar outros carregadores de boot.
+
+Quando se redimensiona uma partio, muitos dados se movem. Muitos
+carregadores de boot no entendem o sistemas de arquivo. Eles s lembram
+aonde que as informaes necessrias para o carregador de boot reside.
+Se esta informao movida, deve-se dizer ao carregador de boot pra
+onde elas se moveram. Isto feito reinstalando o carregador de boot
+(por exemplo, rodando novamente o programa instalador do carregador de
+boot, que normalmente envolve digitar um nico comando na shell). Nem
+todos os carregadores de boot exigem isso.
+
+@menu
+* LILO:: O LInux LOader
+* GNU GRUB:: GNU GRand Unified Boot-loader
+* MS DOS MS Windows 9x MS Windows ME:: Software Legado da MS
+* MS Windows NT:: Carregador do MS Windows NT
+* MS Windows 2000:: Carregador do MS Windows 2000
+* Quik:: Quik
+* Yaboot:: Yaboot
+
+@end menu
+
+@node LILO
+@section LILO: um carregador de boot para o kernel do Linux
+@cindex lilo
+
+LILO um carregador de boot popular para os x86. O carregador de
+boot do LILO geralmente instalado com:
+
+@example
+# @kbd{/sbin/lilo}
+@end example
+
+Se voc est usando um disco de boot, ento voc deve fazer isso:
+(aonde @file{/dev/hda1} deve ser substitudo com a partio raiz)
+
+@example
+# @kbd{mount /dev/hda1 /mnt}
+# @kbd{chroot /mnt /sbin/lilo}
+# @kbd{umount /dev/hda1}
+@end example
+
+Verses antigas do LILO no suportam o modo LBA (@pxref{BIOSs de PC}).
+O modo LBA habilitado com as opes lba32 ou linear, no @file{/etc/lilo.conf}
+(veja a documentao do LILO para maiores informaes).
+
+Se voc usa o modo LBA, voc no deve ter problemas, contanto que a
+sua BIOS suporte LBA.
+
+Se voc usa o modo CHS, ento a partio com o diretrio @file{/boot}
+deve acabar antes do cilindro 1024. Ento, se voc tem um disco grande
+(vamos dizer, com mais de 8 gigabytes), voc deve ter um partio para
+o @file{/boot} prximo ao comeo do disco.
+
+@node GNU GRUB
+@section GRUB: O GNU GRand Unified Bootloader
+@cindex grub
+
+GRUB um carregador de boot relativamente novo, para x86. Dependendo
+de como o GRUB instalado, ele pode entender o sistemas de arquivo,
+ou simplesmente lembrar aonde os arquivos de boot esto guardados. Ele
+entende o sistemas de arquivo se ele est usando ``Stage1.5''. Se ele
+no est usando Stage1.5, ou o nmero da partio muda, ento voc precisa
+reinstalar o Stage2 (por favor veja a documentao do GRUB). Do modo
+contrrio, voc no precisa fazer nada.
+
+O GRUB automaticamente detecta se LBA est disponvel, e vai us-lo
+se ele est disponvel (equivalente opo ``lba32'' do LILO).
+
+@node MS DOS MS Windows 9x MS Windows ME
+@section Carregadores de Boot Legados dos Sistemas Operacionais Microsoft
+@cindex carregador de boot do win32
+@cindex carregador de boot legado dos sistemas operacinais microsoft
+
+O DOS e Windows requerem que voc reinstale o carregador de boot se voc
+mudar o tipo de FAT (FAT16 ou FAT32) da partio de boot. O Parted vai
+avisar voc antes de fazer isso. Para reinstalar o carregador de boot,
+voc pode tanto criar um disco de boot, ou usar o CDROM de boot. O
+mtodo do disco de boot no funciona com o Windows ME.
+
+@itemize @minus
+@item MTODO DO DISCO DE BOOT (DOS/Windows 9x)
+
+@enumerate
+
+@item Criar um disco de boot do Windows
+
+@itemize @bullet
+
+@item Carregue o Windows. @emph{Isto implica que voc deve
+fazer um disco de boot antes de usar o parted}.
+
+@item Clique com o direito no drive de disquete no Windows Explorer.
+
+@item Clique em ``Formatar''.
+
+@item Selecione ``Copiar somente os arquivos de sistema''.
+
+@item Clique em ``Formatar''.
+
+@item Copie o C:\WINDOWS\COMMAND\SYS.COM para o A:\ Nota: voc deve
+ter chamado o C:\WINDOWS de algo mais, como C:\WIN98.
+
+@end itemize
+
+@item Carregue o disco de boot do Windows, deixando o disco de boot no
+drive de disquete quando carregar. Voc pode precisar dizer sua BIOS
+para usar o disquete como boot.
+
+@item Digite o seguinte no prompt do DOS:
+
+@example
+A:\>@kbd{sys c:}
+@end example
+
+@end enumerate
+
+@item MTODO DO CDROM: (Windows 9x/ME)
+
+@enumerate
+
+@item Insira o CDROM do Windows, e faa boot dele. (Selecione ``boot sem
+suporte a CDROM'').
+
+@item Digite:
+
+@example
+A:\>@kbd{c:}
+C:\>@kbd{cd \windows\command} (pode ser \win98\command, ou similar)
+C:\WINDOWS\COMMAND>@kbd{sys c:}
+@end example
+
+Isto tudo.
+
+@end enumerate
+@end itemize
+
+Alm disso, o DOS e Windows impe algumas restries:
+
+@itemize @bullet
+
+@item A partio de boot deve ser selecionada com o indicador ``boot''.
+Somente uma partio podem ser selecionadas (algumas vezes chamadas de
+parties ``ativas''). Por exemplo, para definir a partio 3 como a
+partio de boot faa:
+
+@example
+(parted) @kbd{set 3 boot on}
+@end example
+
+@item O MS DOS e o MS Windows 9x/ME s podem fazer boot da primeira
+partio FAT. Isto , a partio FAT com o menor nmero de partio,
+que no est oculta. Note que os carregadores de boot como o GRUB e o
+LILO (e algumas BIOSs) podem mudar esse comportamento@dots{}
+
+@item Se voc est usando endereamento CHS (ao invs de endereamento
+LBA), ento o incio da partio de boot deve ser antes do cilindro 1024.
+Voc pode dizer ao MS DOS para usar (ou no usar) o endereamento LBA,
+habilitando ou desabilitando o indicador LBA na partio de boot. Por
+exemplo, habilitar o indicador LBA na partio 2, faa:
+
+@example
+(parted) @kbd{set 2 lba on}
+@end example
+
+Nota: o endereamento LBA no suportado pelo MS-DOS 6.22 ou inferior,
+bem como todas as verses do PC-DOS.
+
+Aviso: algumas BIOSs no vo habilitar o endereamento LBA, ao menos
+que voc habilite na BIOS tambm. Se, por alguma razo, o Windows no
+inicializar aps mudar esse indicador, ento este provavelmente o
+problema.
+
+@item o MS-DOS ``real'' (por exemplo, verso 6.2 pra cima) e o MS-DOS
+7.0 (por exemplo, o Windows 95/98a) no conhecem FAT32. Ento possvel
+inicializar eles da @emph{segunda partio fat} (somente FAT16, claro),
+quando @emph{a primeira partio fat} FAT32. Ambas tem que ser parties
+primrias, ento voc provavelmente vai ter que definir qual voc quer
+inicializar como partio ativa.
+
+@end itemize
+
+@node MS Windows NT
+@section O Carregador de Boot do Microsoft Windows NT
+@cindex carregador de boot do microsoft windows nt
+
+O Windows NT no pode ler ou inicializar de parties FAT32. Portanto,
+voc no deve nunca converter parties FAT16 para FAT32, se voc quer
+us-las com o Windows NT.
+
+@node MS Windows 2000
+@section O Carregador de Boot do Microsoft Windows 2000
+@cindex carregador de boot do microsoft windows 2000
+
+O Windows 2000 requer que voc reinstale o carregador de boot se voc
+mudar o tipo de FAT (FAT16 ou FAT32) do sistemas de parties. O Parted
+vai avisar voc antes de tentar fazer isso. Para reinstalar o carregador
+de boot, faa:
+
+@enumerate
+@item Faa boot do CD do Windows 2000.
+@item Ele vai perguntar se voc quer continuar. Aperte Enter.
+@item Ele ento vai perguntar se voc quer instalar um novo sistema, ou
+Consertar um sistema pr-existente. Escolha a ltima (apertando ``R'').
+Ele vai perguntar se voc quer reparar automaticamente, ou se voc quer
+usar o console de recuperao. Escolha usar o console de recuperao.
+@item No console, digite:
+
+@example
+C:\>@kbd{fixboot}
+@end example
+
+O sistema deve inicializar com sucesso agora.
+@end enumerate
+
+O carregador de boot do NT/2000 tambm precisa:
+
+@itemize @bullet
+
+@item seu prprio cdigo no setor de boot de uma partio PRIMRIA
+FAT12, FAT16 ou NTFS (FAT32 possvel com o Windows 2000), que
+chamada de ``partio de sistema''. Esta partio deve ser marcada
+com o indicador de ``boot'' no Parted.
+
+@item os arquivos NTLDR, BOOT.INI e NTDETECT.COM dentro do sistema
+da partio. O BOOT.INI guarda toda a informao sobre a localizao
+fsica da primeira partio ou de um drive lgico aonde o Windows NT
+foi instalado, chamado de ``partio de boot''. A partio de boot e
+a partio de sistema podem estar localizadas juntas numa partio
+primria.
+
+@c RMK: usage: ambiguous use of 'this': it refers to disk controller?
+@item opcionalmente, o arquivo NTBOOTDD.SYS dentro do sistemas de
+parties que renomeado driver de disco para o seu controlador SCSI
+ou IDE, quando ele no tem BIOS prpria (ou sua BIOS no acessa discos
+grandes).
+
+@item com o MS Windows NT, o sistemas de parties deve terminar antes
+do cilindro 1024 e @emph{deve} comear antes do cilindro 1024. Se ele
+termina antes do cilindro 1024 e os arquivos necessrios para a
+inicializao so movidos depois dessa borda, o MS Windows NT no vai mais
+inicializar.
+@item ambos a partio de boot e de sistemas deve ser redimensionada, sem
+a necessidade de qualquer outra mudana.
+
+@item se o nmero da partio de boot muda (por exemplo, seu nmero
+de partio), ento o BOOT.INI deve ser atualizado.
+
+@end itemize
+
+@node Quik
+@section Quik: um carregador de boot para PowerPCs Macintosh
+@cindex carregador de boot para macintoshs do velho mundo
+@cindex velho mundo, carregador de boot do macintosh do
+
+O Quik um carregador de boot popular para PowerPCs Macintosh do
+``Velho Mundo''. Voc precisa reinstalar o Quik se voc redimensionar
+uma partio ext2, usando:
+
+@example
+# @kbd{/sbin/quik}
+@end example
+
+@node Yaboot
+@section Yaboot: um carregador de boot para PowerPCs Macintosh
+@cindex carregador de boot para macintoshs do velho mundo
+@cindex velho mundo, carregadores de boot para macintoshs do
+O Yaboot um carregador de boot popular para Power PCs Macintosh
+do ``velho mundo''. (``Novo-mundo'' se refere aos PowerPCs coloridos
+fabricados desde 1999.)
+
+O Yaboot precisa de sua partio de boot que deve ser pelo menos 800k.
+Ento, se voc est instalando o GNU/Linux do zero, voc faria algo
+como isso:
+
+@example
+(parted) @kbd{mklabel mac}
+@group
+(parted) @kbd{print}
+Disk geometry for /dev/sda: 0.000-6149.882 megabytes
+Disk label type: mac
+Minor Start End Filesystem Name Flags
+1 0.000 0.031 Apple
+@end group
+(parted) @kbd{mkpart primary hfs 0.032 1}
+@group
+(parted) @kbd{print}
+Disk geometry for /dev/hdb: 0.000-6149.882 megabytes
+Disk label type: mac
+Minor Start End Filesystem Name Flags
+1 0.000 0.031 Apple
+2 0.031 1.000
+@end group
+(parted) @kbd{set 2 boot on}
+@group
+(parted) @kbd{print}
+Disk geometry for /dev/hdb: 0.000-6149.882 megabytes
+Disk label type: mac
+Minor Start End Filesystem Name Flags
+1 0.000 0.031 Apple
+2 0.031 1.000 boot
+@end group
+@end example
+
+Voc no precisa reinstalar o Yaboot depois de redimensionar uma partio.
+O Yaboot instalado com o ybin @ref{Software Relacionado}.
+
+@node Sistemas Operacionais
+@chapter Sistemas Operacionais
+@cindex sistemas operacionais
+
+O Parted somente roda sob o GNU/Linux e o GNU/Hurd, no momento. Contudo,
+ele pode ser usado para redimensionar parties usadas por, ou
+compartilhadas com outros sistemas operacionais.
+
+Quando voc quer redimensionar um sistemas de arquivo, certifique-se
+de que no est montado. O Parted no pode redimensionar parties
+montadas (isto pode mudar no futuro@dots{}).
+Se voc modificar a tabela de parties num disco com um partio montada
+nela, voc deve reiniciar imediatamente. O Linux no vai saber sobre as
+mudanas que voc fez na tabela de parties. (Isto vai ser corrigido,
+com o kernel 2.4, e quando ns adicionarmos suporte a ele.)
+
+Se voc quer redimensionar sua partio root ou de boot, use um disco
+de boot @xref{Discos de boot do Parted}, ou use o redimensionador
+online do Andreas Dilger, includo no pacote ext2resize @ref{Ext2}.
+
+@menu
+* GNU/Linux e FreeBSD:: Suporte a tabelas de partio nesses sistemas livres
+* MS Windows and OS/2:: Suporte a tabelas de partio nesses sistemas
+* MacOS:: As tabelas de partio suportadas pelo MacOS
+@end menu
+
+@node GNU/Linux e FreeBSD
+@section Tabelas de partio usadas pelo GNU/Linux e FreeBSD
+@cindex tabelas de partio do gnu/linux
+@cindex tabelas de partio do freebsd
+@cindex freebsd, tabelas de partio do
+@cindex linux, tabelas de partio do
+
+Ambos os sistemas GNU/Linux e FreeBSD so mais mais flexveis quanto
+a tabelas de partio, suportando muitos tipos de tabelas de partio.
+
+@c RMK: padding: added notes about disklabel support for Linux kernel
+Por ser mais difcil para uma mquina usar discos rgidos com tabelas
+de partio normalmente usadas por outras arquiteturas, distribuies
+padro do kernel do Linux somente suportam as tabelas de partio
+populares para a arquitetura para as quais foram compiladas. Por
+exemplo, um kernel do Linux padro compilado para o PC provavelmente
+no vai ter suporte a tabelas de partio do Mac ou da Sun. Para acessar
+os sistemas de arquivo em discos com tabelas de partio no suportados,
+o kernel vai ter que ser recompilado.
+
+O FreeBSD tem um sistemas de tabelas de parties que incompatvel
+com as tabelas de parties do MSDOS. O Parted somente suporta o
+sistemas de tabelas de partio dos BSDs. improvvel que suporte
+o sistemas de parties em fatias, porque a semntica muito estranha,
+e no trabalha como tabelas de partio ``normais''.
+
+@node O MS Windows e o OS/2
+@section Tabelas de partio de disco suportadas por sistemas Microsoft e o OS/2
+@cindex tabelas de partio legadas pela microsoft e a ibm
+@cindex microsoft e ibm, tabelas de partio legadas pela
+
+O MS Windows e o OS/2 somente suportam as tabelas de partio do MSDOS.
+Portanto, se voc criar uma nova tabela de parties, voc deve usar:
+
+@example
+(parted) @kbd{mklabel msdos}
+@end example
+
+@node MacOS
+@section Suporte a Tabelas de Partio no Sistema Operacional Macintosh
+@cindex tabelas de partio do macintosh
+@cindex macintosh, tabelas de partio do
+
+@c RMK: completeness: does Mac OS X understand non-mac disklabels?
+O MacOS (e o OpenFirmware) somente entende as tabelas de partio
+do mac. Portanto se voc criar uma nova tabelas de parties,
+voc deve usar:
+
+@example
+(parted) @kbd{mklabel mac}
+@end example
+
+Note que para tabelas de partio do Mac, voc deve evitar deixar
+espaos livres em volta, porque as regies de espao livre deixam
+entradas na tabela de parties (e o Linux no gosta de ter mais de
+15 entradas). Por exemplo, se voc fizer:
+
+@example
+@group
+(parted) @kbd{print}
+Disk geometry for /dev/sda: 0.000-6149.882 megabytes
+Disk label type: mac
+Minor Start End Filesystem Name Flags
+1 0.000 0.031 Apple
+2 0.031 1.000 boot
+3 1.000 1000.000 ext2 root root
+@end group
+(parted) @kbd{ mkpartfs primary ext2 1001 2000}
+@group
+(parted) @kbd{print}
+Disk geometry for /dev/sda: 0.000-6149.882 megabytes
+Disk label type: mac
+Minor Start End Filesystem Name Flags
+1 0.000 0.031 Apple
+2 0.031 1.000 boot
+3 1.000 1000.000 ext2 root root
+4 1001.000 2000.000 ext2
+@end group
+@end example
+
+Existe 1 megabyte de espao livre entre as parties 3 e 4. Voc pode
+evitar isso, criando parties de 0.1M (no caso, o Parted automaticamente
+``junta'' elas). Ento, no exemplo acima, voc deveria fazer isso ao invs:
+
+@example
+(parted) @kbd{mkpartfs primary ext2 1000.1 2000}
+@group
+(parted) @kbd{print}
+Disk geometry for /dev/sda: 0.000-6149.882 megabytes
+Disk label type: mac
+Minor Start End Filesystem Name Flags
+1 0.000 0.031 Apple
+2 0.031 1.000 boot
+3 1.000 1000.000 ext2 root root
+4 1000.000 2000.000 ext2
+@end group
+@end example
+
+@node Sistemas de Arquivo
+@chapter Sistemas de Arquivo suportados pelo Parted
+@cindex sistemas de arquivo
+
+@menu
+* Sistemas Suportados:: File systems operations supported by GNU Parted
+* Ext2:: Sistemas ext2 do Linux no Parted
+* FAT16 and FAT32:: Sistemas Legados e o Parted da Microsoft e o Parted
+* Reiserfs:: Sistema jornalstico Reiser e o Parted
+@end menu
+
+@node Sistemas de Arquivo Suportados
+@section Sistemas de Arquivo Suportados pelo GNU Parted
+@cindex sistemas de arquivo suportados
+@cindex sistemas de arquivo suportados
+
+O Parted tem suporte a essas operaes:
+
+@c RMK: FIXME: can we put in nicer marks for "true", and note markers
+@c to associate notes below with entries in this table?
+
+@multitable {Filesystem} {detect} {create} {resize} {copy} {check}
+@item Sistema de Arquivo @tab detecta @tab cria @tab redimensiona @tab copia @tab checa
+@item ext2 @tab * @tab * @tab *1 @tab *2 @tab *3
+@item ext3 @tab * @tab @tab *1 @tab *2 @tab *3
+@item fat16 @tab * @tab * @tab *4 @tab *4 @tab *
+@item fat32 @tab * @tab * @tab * @tab * @tab *
+@item hfs @tab * @tab @tab @tab @tab
+@item jfs @tab * @tab @tab @tab @tab
+@item linux-swap @tab * @tab * @tab * @tab * @tab *
+@item ntfs @tab * @tab @tab @tab @tab
+@item reiserfs @tab * @tab *5 @tab *1,5 @tab *5 @tab *3,5
+@item ufs @tab * @tab @tab @tab @tab
+@item xfs @tab * @tab @tab @tab @tab
+@end multitable
+
+@c RMK: note: the following is not an enumerated list, just a bunch of
+@c notes associated to entries in the above matrix. That's bad.
+
+@noindent NOTAS:
+(1) O incio da partio deve estar fixa para ext2, ext3 e reiserfs.
+
+(2) A partio que voc copia deve ser maior (ou exatament o mesmo
+tamanho) da partio que voc est copiando.
+
+(3) Checagem limitada feita quando o sistemas de arquivo aberto.
+Esta a nica checagem no momento. Todos os comandos (incluindo o
+resize) vo falhar graciosamente, deixando o sistemas de arquivo
+intacto, se no existir erros no sistemas de arquivo (e a vasta maioria
+de erros no geral).
+
+(4) O tamanho da nova partio, aps redimensionar ou copiar, restrito
+pelo tamanho de cluster para a fat (principalmente afeta FAT16). Isto
+ pior do que voc pensa, porque voc no chega a escolher o tamanho
+do cluster (isso um bug no Windows, mas voc quer compatibilidade,
+certo?).
+
+Ento, em prtica, voc sempre pode diminuir sua partio (porque o
+Parted pode diminuir o tamanho do cluster), voc no vai poder aumentar
+a partio pro tamanho que voc quer. Se voc no tiver problemas em
+usar FAT32, voc sempre vai poder aumentar a partio pro tamanho
+que voc quiser.
+
+Resumo: voc sempre pode diminuir a sua partio. Se voc no pode
+usar FAT32 por alguma razo, ento voc no vai poder aumentar sua
+partio.
+
+(5) O suporte a reiserfs habilitado se voc instalar libreiserfs,
+disponvel em @uref{reiserfs.linux.kiev.ua}. ( provvel que esteja
+disonvel logo em www.namesys.com... nos diga se/quando isso acontecer!)
+
+@node Ext2
+@section O GNU Parted e o Second Extended Filesystem
+@cindex suporte a sistema de arquivo ext2
+@cindex suporte a sistemas second extended
+
+O Parted no suporta diretamente cpia de sistemas de arquivo ext2
+(ainda). Contudo, existem algumas maneiras de se conseguir isso:
+
+@itemize
+@item Use o comando mkfs (ou mkfs.ext2), e ento rode na shell:
+
+ME CONSERTE!!! isto ainda no funciona muito bem - mas deve estar OK
+para a maioria das pessoas@dots{}
+
+@example
+# @kbd{mount -t ext2 /dev/hda2 /mnt/dst}
+# @kbd{find /mnt/src -depth | cpio -pm /mnt/dst}
+@end example
+
+@item Se voc duplicar uma partio que ser maior que o original,
+isto tambm pode ser feito: primeiro, crie uma nova partio ext2.
+Ento:
+
+@example
+# @kbd{dd if=/dev/dsp-antigo of=/dev/dsp-novo bs=1024 count=@var{tam_ant}}
+# @kbd{parted /dev/hda resize 2 @var{incio} @var{fim}}
+@end example
+
+@noindent aonde @var{tam_ant} o tamanho da partio original em kilobytes.
+@var{incio} e @var{fim} so o novo comeo e fim para a partio duplicada.
+@end itemize
+
+@node FAT16 e FAT32
+@section Suporte a Sistemas de Arquivo da Microsoft
+@cindex suporte a sistemas de arquivo fat
+@cindex suporte a sistemas de arquivo legados da microsoft
+
+O Parted no pode aumentar o tamanho do cluster de sistemas de arquivo
+FAT (ainda). Isto pe restries em redimensionar e copiar parties.
+Isto geralmente bizarro, porque o Parted pode converter sistemas de
+arquivo entre FAT16 e FAT32, que tem restries diferentes no que o
+tamanho do cluster pode ser.
+
+Por exemplo, vamos dizer que uma partio de 100Mb com um tamanho de
+cluster de 4k. Esta partio no pode ser redimensionados para 400Mb,
+porque o tamanho do cluster deveria ser mudado para 16k. Contudo, ele
+pode ser redimensionado para 600Mb se voc usar FAT32. O contrrio
+verdade para sistemas de arquivo FAT32 de 600Mb.
+
+Note: quando voc copia ou redimensiona um sistemas de arquivo, o Parted
+vai perguntar se voc quer converter entre FAT16 e FAT32 (se isso for
+possvel). Portanto, se voc s quer converter um partio para FAT32
+(sem redimensionar), voc s precisa redimensionar a partio para o
+mesmo tamanho.
+
+@menu
+* MS DriveSpace:: Parties MS DriveSpace
+@end menu
+
+
+@node MS DriveSpace
+@subsection Parties MS DriveSpace
+@cindex parties drivespace
+
+O MS DriveSpace um programa que vem com o MS Windows 95 que pdoe ser
+usado para comprimir sistemas de arquivo FAT. Eu acredito que ele
+funcione do mesmo jeito que o DoubleSpace, ento tudo dito aqui pode
+ser aplicado no DoubleSpace tambm.
+
+ possvel para o Parted redimensionar e copiar essas parties, mas
+voc tem que fazer algumas coisas a mais@dots{}
+
+@menu
+* Aumentando uma partio DriveSpace::
+* Diminuindo um partio DriveSpace::
+* Copiando uma partio DriveSpace::
+@end menu
+
+
+@node Aumentando uma partio DriveSpace
+@subsection Aumentando uma partio DriveSpace
+@cindex partio drivespace, aumentando uma
+
+Para aumentar o tamanho de uma partio DriveSpace, faa o seguinte
+@enumerate
+@item Use o comando resize do Parted para aumentar a partio para o tamanho desejado.
+
+@item Use o MS DriveSpace para enviar o espao livre do drive de origem
+para o drive comprimido.
+
+@end enumerate
+
+@node Diminuindo uma partio DriveSpace
+@subsubsection Diminuindo uma partio DriveSpace
+@cindex partio drivespace, diminuindo uma
+
+Para aumentar o tamanho de uma partio DriveSpace, faa o seguinte:
+
+@enumerate
+@item Use o MS DriveSpace para jogar o espao livre do drive comprimido
+para o drive de origem. O nmero de espao jogado corresponde ao
+montante que se deve diminuir a partio.
+
+@c RMK: usage: "Parted doesn't give good feedback on what the nubmers" huh?
+@item Use o comando resize do Parted para diminuir uma partio para o
+tamanho desejado. NOTA: O Parted no tem uma boa resposta com os nmeros
+pelo qual se pede para uma partio diminuir. Isto est na lista de
+afazeres.
+
+@end enumerate
+
+@node Copiando uma partio DriveSpace
+@subsubsection Copiando uma partio DriveSpace
+@cindex partio drivespace, copiando uma
+
+Se voc quer copiar uma partio DriveSpace para uma partio que
+maior, ento voc pode seguir as instrues para aumentar uma partio
+DriveSpace, exceto se voc copiar ao invs de redimensionar para a
+partio desejada, e ter certeza de que voc usou a nova partio no
+DriveSpace.
+
+Contudo, se voc quer copiar uma partio DriveSpace que menor, as
+coisas ficam um pouco mais complicadas:
+
+@enumerate
+@item Use o MS DriveSpace para empurrar o espao livre do disco
+comprimido para o drive de origem. O montante de disco empurrado deve ser
+mais que a diferena entre o disco de origem e o tamanho desejado de
+uma das parties duplicadas.
+
+@item Use o Parted para copiar a partio de destino para a partio
+duplicada.
+
+@item Use o MS DriveSpace para empurrar o espao livre do disco de
+origem de volta para o disco comprimido.
+
+@item Use o MS DriveSpace para empurrar o espao livre do drive duplicado
+de volta para o drive comprimido.
+@end enumerate
+
+
+@node Reiserfs
+@section Sistemas de Arquivo Jornalstico Reiserfs
+@cindex reiserfs
+
+O Parted suporta reiserfs se a libreiserfs est instalada. O Parted
+detecta isso ao rodar, e automaticamente ativa o suporte. Voc pode
+baixar a libreiserfs em:
+
+ @uref{http://reiserfs.linux.kiev.ua}
+
+Note que a libreiserfs software novo, e no foi largamente testado.
+
+
+@node LVM e RAID
+@chapter LVM e RAID
+@cindex lvm e raid
+@cindex raid e lvm
+
+@menu
+* Viso geral da LVM e RAID:: Viso geral da LVM e RAID
+* Criando parties RAID ou LVM:: Configurando parties RAID e LVM
+* Manipulando um volume RAID ou LVM:: Operaes em parties RAID ou LVM
+@end menu
+
+@node Viso geral do LVM e RAID
+@section Logical Volume Manager e Redundant Arrays of Inexpensive Disks
+@cindex lvm e raid, viso geral do
+@cindex lvw, viso geral
+@cindex raid, viso geral
+
+O LVM (Logical Volume Manager) um sistema alternativo para
+particionamento. Ele permite volumes lgicos (por exemplo, ``parties
+virtuais'') a serem espalhadas em muitos volumes fsicos (por exemplo,
+discos e/ou parties). O LVM suportado no Linux verso 2.4 e
+superior.
+
+RAID (Redundant Array of Inexpensive Disks - Ordem Redundante de Discos
+Baratos) um sistema para usar muitos discos e/ou parties juntas, como
+uma ``partio virtual''. Existem muito poucos modos de usar software
+RAID, e so essencialmente:
+
+@c RMK: if there are only two options, why not put them into a sentence?
+@itemize
+@item usar mltiplos (pequenos) discos par um nico sistemas de arquivo,
+aumentar a performance e fazer todo o espao disponvel ser disponvel
+num nico sistemas de arquivo.
+@item usar mltiplos discos para guardar cpias redundantes de informao,
+para aumentar a confiana e performance.
+@end itemize
+RAID por software suportado no Linux verso 2.0 e superior.
+
+@c RMK: usage: what does ``is supported normally by Parted'' mean?
+RAID por hardware normalmente suportado pelo Parted - ento voc no
+precisa ler essa seo se voc est usando RAID por hardware (o
+oposto para RAID por software).
+
+LVM, RAID por software e parties so comumente usadas simultaneamente,
+mas elas todas podem ser usadas independentemente. LVM e RAID por
+software so geralmente compostas de parties, mais do que discos
+rgidos.
+
+O GNU Parted no suporta LVM e RAID por software completamente,
+mas ele ainda til quando usado em combinao com suas ferramentas
+respectivas. O Parted til para essas tarefas:
+
+@itemize
+@item criar uma partio RAID ou LVM de software
+
+@item criando, redimensionando ou copiando um sistema de arquivo num
+volume lgico (ou ``partio lgica'')
+@end itemize
+
+@node Criando parties LVM ou RAID
+@section Criando parties LVM ou RAID
+@cindex criao de parties lvm
+@cindex criao de parties raid
+
+Para criar uma partio RAID ou LVM, voc deve:
+@enumerate
+@item Criar uma partio com o comando mkpart
+@item Definir o indicador LVM ou RAID na partio.
+@end enumerate
+
+Por exemplo:
+
+@example
+(parted) @kbd{mkpart primary ext2 0 4000}
+(parted) @kbd{set 1 lvm on}
+@end example
+
+Nota: a partio LVM ou RAID no vai estar pronta para uso ainda. Voc
+ainda precisa rodar o mkraid(8) para RAIDs, ou usar as ferramentas de
+LVM para inicializar o volume fsico, e criar grupos lgicos, etc.
+
+@node Manipulando um volume RAID ou LVM
+@section Manipulando um Sistema de Arquivo num volume RAID ou LVM
+@cindex operao em parties raid
+@cindex operaes em parties lvm
+
+O Parted pode manipular volumes lgicos RAID e LVM, mesmo no entendendo
+RAID ou LVM. Ele utiliza o suporte do Linux a RAID e LVM. Portanto, voc
+somente pode usar esses mtodos se o seu kernel do Linux suporta RAID
+e/ou LVM.
+
+Para manipular um sistema de arquivo num volume lgico RAID ou LVM (ou,
+uma partio sozinha, para esse intuito), voc pode iniciar o parted
+selecionando o dispositivo do volume (partio) lgico. Por exemplo:
+
+@example
+# @kbd{parted /dev/md0}
+@end example
+
+Para o resto desse captulo, ``dispositivo virtual'' vai se referir
+ao dispositivo que o Parted est editando (no nosso exemplo, @file{/dev/md0}).
+For the rest of this chapter, ``virtual device'' will refer to the
+device Parted is editting (in our example cases, @file{/dev/md0}).
+
+@menu
+* Criando um sistema de arquivo num dispositivo RAID ou LVM::
+* Redimensionando um sistema de arquivo::
+* Copiando um sistema de arquivo de um dispositivo virtual para uma partio::
+* Copiando um sistema de arquivo para um dispositivo virtual::
+@end menu
+
+@node Criando um Sistema de Arquivo num dispositivo RAID ou LVM
+@subsection Criando um Sistema de Arquivo num Dispositivo VIrtual LVM ou RAID
+@cindex lvm, criando um sistema de arquivo em
+@cindex raid, criando um sistema de arquivo em
+
+Para criar um sistema de arquivo num volume LVM, use os seguintes passos:
+
+@enumerate
+@item Crie uma tabelas de partio de loop. Este uma tabela de parties
+falsa, que diz ao Parted para tratar o dispositivo virtual como um nico
+sistema de arquivo. Com essa falsa tabela de parties, existe ou nenhuma
+ou uma partio.
+
+@example
+(parted) @kbd{mklabel loop}
+@end example
+
+@item Crie o sistema de arquivo, usando o comando mkpartfs do Parted.
+Voc deve deixar o incio do sistema de arquivo 0. A partio pode
+terminar em qualquer lugar dentro do dispositivo virtual. Voc pode
+encontrar o tamanho do dispositivo virtual com o comando print. Por
+exemplo:
+
+@example
+(parted) @kbd{print}
+@group
+Disk geometry for /dev/md0: 0.000-47.065 megabytes
+Disk label type: loop
+Minor Start End Filesystem Flags
+@end group
+(parted) @kbd{mkpartfs primary ext2 0 47.065}
+(parted) @kbd{print}
+@group
+Disk geometry for /dev/md0: 0.000-47.065 megabytes
+Disk label type: loop
+Minor Start End Filesystem Flags
+1 0.000 47.065 ext2
+@end group
+@end example
+@end enumerate
+
+@node Redimensionando um sistemas de arquivo
+@subsection Redimensionando um Sistema de Arquivos num Dispositivo Virtual LVM ou RAID
+@cindex lvm, redimensionando um sistema de arquivo
+@cindex raid, redimensionando um sistema de arquivo
+
+Voc geralmente redimensiona o sistema de arquivo ao mesmo tempo que
+voc redimensiona o seu dispositivo virtual. Se voc est aumentando
+o sistema de arquivo e o dispositivo virtual, voc deve primeiro
+aumentar o dispositivo virtual (com as ferramentas RAID ou LVM), e ento
+aumentar o sistema de arquivo. Se voc est diminuindo o sistema de
+arquivo e o dispositivo virtual, voc deve diminuir o sistema de arquivo
+primeiro, e ento o dispositivo virtual.
+
+Para redimensionar o sistema de arquivo no Parted, use o comando resize.
+Por exemplo:
+
+@example
+(parted) @kbd{select /dev/md0}
+(parted) @kbd{resize 1 0 20}
+@end example
+
+@node Copiando um sistema de arquivo de um dispositivo virtual para uma partio
+@subsection Copiando um Sistema de Arquivo de um Dispositivo LVM ou RAID para uma partio
+@cindex lvm, copiando de um lvm para uma partio
+@cindex raid, copiando de um raid para uma partio
+
+Para copiar um sistema de arquivo de um dispositivo virtual LVM ou RAID,
+ s usar o comando cp. Por exemplo:
+
+(parted) @kbd{select /dev/hda}
+(parted) @kbd{cp /dev/md0 1 3}
+@node Copiando um sistema de arquivo para um dispositivo virtual
+@subsection Copiando um Sistema de Arquivo de um Dispositivo Virtual RAID ou LVM
+@cindex lvm, copiando de uma partio lvm para um volume
+@cindex raid, copiando de uma partio para um volume raid
+
+Para copiar o sistema de arquivo para um dispositivo virtual LVM ou RAID,
+use a seguinte receita:
+
+@enumerate
+@item Crie a tabela de parties de loop no dispositivo virtual. Por exemplo:
+
+@example
+(parted) @kbd{select /dev/md0}
+(parted) @kbd{mklabel loop}
+@end example
+
+@item Crie um sistema de arquivo no dispositivo virtual, com o comando
+mkpartfs. Por exemplo:
+
+@example
+(parted) @kbd{mkpartfs primary ext2 0 47.065}
+@end example
+
+@item Copie a partio com o comando cp:
+
+@example
+(parted) @kbd{select /dev/hda}
+(parted) @kbd{cp /dev/md0 3 1}
+@end example
+@end enumerate
+
+@node Espelhamento de Discos
+@chapter Espelhamento de Discos
+@cindex espelhamento de discos
+
+Espelhamento de disco o mtodo para evitar o tedioso processo de
+instalao do Windows. Por exemplo, se voc quer instalar o Windows e
+o Office em 1000 mquinas, vai levar provavelmente 5 vezes 1000 horas.
+As coisas no so to ruins com o GNU/Linux, porque existem programas
+como o kickstart da Red Hat, que permite voc automatizar a instalao
+de outros programas, ou praticamente qualquer coisa que voc precise
+fazer. Portanto, o espelhamento de disco somente usado para mquinas
+Windows (ou qualquer software no-livre) em geral, mas ns imaginamos
+que a maioria das organizaes achariam impossvel migrar do Windows
+para o GNU/Linux (ou qualquer outro software livre) sem um perodo de
+transio, aonde ambos os sistemas esto disponveis.
+
+@c FIXME: standards: the CD-Writing howto is listed as non-free by LDP
+Com o espelhamento de disco, voc pode torrar um CD com uma imagem de
+disco ou de uma partio contendo o Windows e o Office, e copiar a
+partio diretamente nos discos rgidos de todos os computadores,
+colocando um disco de boot e um CD, e deixando rolar. Mas a partio
+no disco Windows vai provavelmente ser maior, ento a partio tambm
+vai ter de ser redimensionada. Eu j vi vrias pessoas comentarem que
+elas gerenciaram esse processo usando discos de boot do Linux e o Parted.
+ possvel usar o CDROM somente, usando o disquete de boot como a imagem
+de boot do CD. Leia a CD writing HOWTO para maiores informaes. Existem
+algumas coisas peculiares que voc tem que fazer pra coisa toda funcionar
+(que vai ser resolvida na prxima srie estvel do Parted). De qualquer
+modo, este o processo geral:
+
+@enumerate
+@item Instale o Windows numa mquina, com a configurao que voc
+quiser. Voc pode ter uma partio do tamanho que quiser, contanto
+que no use mais de 640Mb, e deixe espao para um instalao completa
+do Linux, e outros 1300Mb para duas cpias da imagem de disco.
+
+@item Instale o Linux na mquina.
+
+@item Faa um diretrio para imagem do CD (exemplo: @file{/root/imagem})
+
+@item Crie um arquivo de imagem de disco (exemplo: @file{/root/imagem/disco})
+no diretrio do CD:
+
+@example
+# @kbd{dd if=/dev/zero of=/root/imagem/disco bs=1M count=640}
+@end example
+
+@item Use o Parted para copiar a partio Windows para a imagem de disco:
+
+@example
+# @kbd{parted /root/cdimage/diskimage mklabel msdos}
+# @kbd{parted /root/cdimage/diskimage mkpart primary fat32 0 639}
+# @kbd{parted /root/cdimage/diskimage cp /dev/hda 1 1}
+@end example
+
+@item Crie uma imagem de CD do diretrio da imagem de CD e torre esse
+CD com a sua ferramenta favorita de gravao.
+
+@item Compile uma verso especial do Parted sem suporte a lngua
+nacional e suporte a readline (ou baixe a RPM especial da Freshmeat):
+
+@example
+localhost:~/parted-1.0.0# @kbd{./configure --disable-nls --without-readline --disable-shared; make}
+@end example
+
+@c FIXME: standards: LDP labelled the Bootdisk HOWTO non-free.
+@item Crie um disquete de boot do Linux (veja a Bootdisk HOWTO).
+
+@item Ponha a verso reduzida do Parted no disquete de boot (ou
+um disco raiz suplementar).
+
+@item Escreva um script shell para fazer o seguinte:
+
+@example
+@asis{mount /dev/cdrom /mnt/cdrom}
+@asis{parted --script /dev/hda mklabel msdos}
+@asis{parted --script /dev/hda mkpartfs primary fat 0 @var{algum-tamanho}}
+@asis{parted --script /dev/hda cp /mnt/cdrom/diskimage 1 1}
+@asis{parted --script /dev/hda set 1 boot on}
+@asis{/sbin/halt}
+@end example
+
+@var{algum-tamanho} o tamanho que voc quer que a primeira partio use.
+
+@item Inicie a instalao! Ponha o disquete + CD dentro de cada computador,
+e deixe rolar@dots{}
+@end enumerate
+
+Obviamente eu posso e vou fazer esse processo muito mais fcil. Ns
+estamos considerando fazer uma mini-distribuio para fazer isso.
+Eu no teria tempo para fazer isso --- algum voluntrio?
+
+@node Software Relacionado
+@chapter Software Relacionado
+@cindex software relacionado
+@cindex leitura posterior
+@cindex documentao relacionada
+
+Se voc quer procurar mais informaes, sinta-se vontade para enviar
+perguntas para @email{parted@@gnu.org}. (!) indica que a
+informao/software est provavelmente includa na sua distribuio.
+
+Estes arquivos na distribuio do Parted contm informaes adicionais:
+
+@itemize @bullet
+
+@item ABOUT-NLS - informaes sobre usar o Suporte a Lngua Nativa, e o Projeto de Traduo Livre
+
+@item API - a documentao sobre a API da libparted
+
+@item AUTHORS - quem escreveu o que
+
+@item BUGS - erros no arrumados
+
+@item ChangeLog - mudanas feitas no Parted
+
+@item COPYING - a GNU General Public License, os termos pelos quais o GNU Parted pode ser distribuido
+
+@item COPYING.DOC - a GNU Free Documentation Licence, o termo pelo qual
+a documentao do Parted pode ser distribuda.
+
+@item FAT -- informaes sobre como o redimensionador de FAT funciona (para programadores)
+
+@item INSTALL --- como compilar e instalar o Parted, e a maioria dos outros softwares livres
+
+@item TODO --- recursos planejados que ainda no foram implementados
+@end itemize
+
+Estes documentos no so distribudos com o Parted, mas voc pode achar
+eles teis. A maioria deles provavelmente vai estar na sua distribuio.
+Por exemplo, no Red Hat Linux, olhe no cd dentro de @file{/doc/HOWTO} e
+@file{/doc/FAQ}.
+
+@itemize @bullet
+
+@c RMK: usefulness: available at the LDP -- should these urls be updated?
+@c RMK: standards: GPL'd documentation.
+@item Filesystems HOWTO @uref{http://penguin.cz/~mhi/fs}
+
+@c RMK: usefulness: available at the LDP -- should these urls be updated?
+@c FIXME: standards: LDP labelled this non-free
+@item Hard Disk Upgrade mini-HOWTO (!): @uref{http://sunsite.unc.edu/LDP/HOWTO}
+
+@c RMK: usefulness: available at the LDP -- should these urls be updated?
+@c FIXME: standards: LDP labelled this non-free
+@item Large Disk HOWTO @uref{http://www.win.tue.nl/~aeb/linux/Large-Disk.html}
+
+@item LILO mini-HOWTO (!) @uref{http://sunsite.unc.edu/LDP/HOWTO}
+
+@c RMK: usefulness: available at the LDP -- should these urls be updated?
+@item MILO HOWTO (!) @uref{http://sunsite.unc.edu/LDP/HOWTO}
+
+@c FIXME: standards: in short, none of the following is free documenation
+@c FIXME: standards: Linux+DOS+Win95+OS2 labelled non-free by LDP
+@c FIXME: standards: Linux+FreeBSD-mini labelled non-free by LDP
+@c FIXME: reference: can't find a Linux+Win95, only Linux+Win95-mini
+@c FIXME: standards: Linux+Win95-mini labelled non-free by LDP
+@c FIXME: reference: can't find a Linux+FreeBSD, only Linux+FreeBSD-mini
+@c FIXME: reference: can't find a Linux+NT-Loader, only "NT OS Loader +
+@c Linux mini
+@c FIXME: standards: NT OS Loader + Linux mini labelled non-free by LDP
+@item Linux+OS mini-HOWTOs (!): Linux+DOS+Win95+OS2, Linux+FreeBSD-mini-HOWTO,
+Linux+Win95, Linux+FreeBSD, Linux+NT-Loader. You can get these from: @uref{http://sunsite.unc.edu/LDP/HOWTO}
+
+@c FIXME: standards: Partition mini labelled non-free by LDP
+@item Partition mini-HOWTO (!): @uref{http://www.linuxdoc.org/HOWTO/mini/Partition/index.html}
+
+@c RMK: standards: no clear distribution terms
+@item Partition Table HOWTO @uref{http://www.win.tue.nl/~aeb/partitions/partition_tables.html}
+
+@c FIXME: standards: no clear distribution terms
+@item Lista de Tipos de Parties @uref{http://www.win.tue.nl/~aeb/partitions/partition_types.html}
+
+@item Software RAID HOWTO @uref{http://linas.org/linux/Software-RAID/Software-RAID.html}
+
+@end itemize
+
+Outros programas relacionados esto listados aqui. Alguns deles tambm
+tem documentao til:
+
+@itemize @bullet
+
+@item Disk Drake. Disponvel em @uref{www.linux-mandrake.com/diskdrake}
+Ele simular em funcionalidade ao Parted. O cdigo de FAT no Disk Drake
+ baseado no nosso cdigo do Parted. Aqui como o Disk Drake se
+compara ao Parted: (que ambos concordamos :-) O Disk Drake :
+
+@itemize @minus
+@item mais fcil de usar, te proteje de cometer enganos
+@item uma soluo mais completa (lida com o @file{/etc/fstab}, lilo, etc.)
+@item menos suporte FAT (no pode converter FAT16<->FAT32, no copia parties)
+@item menos suporte a ext2 (no momento)
+@item menos ateno compatibilidade entre sistemas DOS/Windows (mais antigos)
+@item sem suporte a arquiteturas no-PC
+@end itemize
+
+@item dvhtool (para SGI/MIPS) (!)
+
+@c RMK: standards: unchecked
+@item dosfsck (!)
+
+@item e2fsck, resize2fs e2fsprogs (!) @uref{http://web.mit.edu/tytso/www/linux/e2fsprogs.html}
+
+@item ext2resize - usa o mesmo cdigo do Parted, mas inclui algumas
+outras coisas tambm, como um redimensionar ext2 na hora, que no
+requer desmontagem. @uref{http://ext2resize.sourceforge.net}
+
+@item fdisk (!)
+
+@item FIPS (!) (First Interactive Partition Splitter - Primeiro Divisor de Parties Interativo) @uref{http://www.igd.fhg.de/~aschaefe/fips}
+
+@ RMK: standards: GPL'd
+@item GPart - recupera tabelas de partio quebradas. @uref{http://www.stud.uni-hannover.de/user/76201/gpart}
+
+@item GNU GRUB - GRand Unified Boot-loader @uref{http://www.gnu.org/software/grub/grub.html}
+
+@item LILO (!) (LInux LOader) @uref{ftp://tsx-11.mit.edu/pub/linux/packages/lilo}
+
+@item LVM @uref{http://linux.msede.com/lvm}
+
+@c RMK: standards: is mkdosfs Free?
+@item mkdosfs (!) (s vezes chamada de mkfs.msdos)
+
+@item mke2fs (!) (s vezes chamada de mkfs.ext2)
+
+@item mkfs (!)
+
+@item mkswap (!)
+
+@item quik (!)
+
+@item reiserfs: NOTA: um redimensionador reiserfs includo com a
+distribuio reiserfs normal. @uref{http://devlinux.com/projects/reiserfs}
+Tambm, uma implementao independente da raiserfs userland (que o parted
+tambm utiliza) @uref{http://reiserfs.linux.kiev.ua}. Ele pode ser adotado
+por outros usurios no futuro...
+
+@item yaboot (!) @uref{http://penguinppc.org/bootloaders/yaboot/}
+
+@item ybin (!) @uref{http://penguinppc.org/bootloaders/yaboot/}
+
+@end itemize
+
+@node Copiando Este Manual
+@appendix Copiando Este Manual
+
+@menu
+* GNU Free Documentation License:: Licena para copiar esse manual
+@end menu
+
+@include fdl.texi
+
+@c FDL: FDL 4.I suggests a HISTORY section be included in
+@c the documentation. In this case it seems superfluous, but
+@c here's one, in case it is desired. As far as I'm concerned,
+@c this node doesn't fit well into the structure of the document
+@c at present.
+@node Histria
+@appendix A histria desse manual
+@cindex a histria desse manual
+
+Esse manual baseado no arquivo, USER, includo na verso 1.4.22.
+O cdigo-fonte do GNU Parted est disponvel em @uref{ftp.gnu.org/gnu/parted}.
+
+Formatao texinfo por Richard M. Kreuter, 2002.
+
+Este manual distribudo sob a GNU Free Documentation License,
+verso 1.1 ou superior, sua discrio, sem Sees Invariantes,
+sem Textos na Capa, e sem Textos na Contra-capa. @xref{Copiando
+este Manual}, para mais detalhes.
+
+@c FIXME: why doesn't this @ifnotplaintext work?!
+@c @ifnotplaintext
+@node ndice
+@unnumbered ndice
+@printindex cp
+@c @end ifnotplaintext
+
+@bye
+
+@ignore
+I've (that is, RMK) included (too much) commentary in this file.
+
+Lines of the form
+
+ FIXME:<category>:
+
+are bugs, and should be fixed. The categories are sort of vague, but
+"standards" means that something doesnt't meet somebody's (probably
+I've tried to check the license for each program and documentation
+referenced, but have missed some. As a rule, if a Howto or mini-Howto
+has been labelled as non-free by the LDP, then I've assumed it's also
+non-Free for GNU purposes. I've also tried to note the free software
+and documentation, since omission of such notes lead me to recheck things
+I'd forgotten I'd check, etc.
+
+Many nodes give some detailed explanation of how to use parted along
+with a non-free operating system using non-free utilities that are part
+of that system. This may be a violation of the GNU standards,
+node/section "References". I've marked up the text anyhow, in case the
+content is deemed acceptable by decision makers, and hope that my
+contribution here doesn't sway decisions.
+
+For what it's worth, I've noted references to non-free software as
+"acceptable" in case the reference includes a description of what the
+software can't do (e.g., not suck, not harm mankind). This idiosyncratic
+assessment of the permissibility of reference of non-free software is
+meant partly as a joke.
+
+Note: there is a free (GPL'd) DOS compatible operating system, FreeDOS,
+that I've tested and found to work pretty well, better in many respects
+that Micros~1's DOS. Many of the tips and tricks described in the
+manual might work with or be needed for a FreeDOS based system. In
+principle, one could rewrite the sections of this manual to make
+reference only to 'DOS-compatible' systems, and refer people to FreeDOS.
+
+I, for one, would be happy to refer people to FreeDOS, since it's a nice
+project that could play a valuable role among free operating systems
+(actually, it does: it's the DOS kernel for DOSEMU). But would
+reworking references to MS DOS and its progeny to refer to FreeDOS just
+be a clever hack around the GNU standards? I dunno...
+
+<Sigh> Screed over.
+
+Notes on possible (unimplemented!) modifications:
+
+The output samples from parted's print command, fdisk's p command, etc.,
+might be made into tables (multi-column tables) to ensure spiffy formatting.
+
+I'd like to find a way to make *entry: see *synonym type references in
+the index, so, e.g., to refer people looking for Apple to Macintosh, and
+PowerPC to Macintosh, etc. Probably texinfo does this already; I dunno.
+
+
+Notes on general fixes:
+
+RMK: usage: eg -> e.g. ("e.g." is customarily spelled thus).
+
+RMK: usage: "its" is English possessive third person singular adjective
+(cf "sein/ihr", "son/sa/ses"). "it's" is a contraction of "it is",
+i.e., third person singular present active indicative of "to be" (cf
+"das ist", "il est"). I hope that description doesn't come off too
+snotty. I've changed 'it's' to 'its' more times than noted above.
+
+RMK: usage (punctuation): in English, commas are only used to separate
+relative clauses when the information in the clause is deemed
+non-essential for identifying the referent of the noun on which the
+clause depends (German uses commas around every relative clause, by
+contrast). So: "I have read the book that was assigned" doesn't have a
+comma because the clause 'that was assigned' is needed to identify which
+book is the object of 'read', whereas "I have read the book, which
+wasn't very good" implies that the fact that the book wasn't very good
+is extra information, not required for the identification of the book,
+e.g. its identity has already been established).
+
+@end ignore
+
diff --git a/doc/parted.texi b/doc/parted.texi
new file mode 100644
index 0000000..cd44340
--- /dev/null
+++ b/doc/parted.texi
@@ -0,0 +1,1246 @@
+\input texinfo @c -*-texinfo-*-
+@c %**start of header
+@setfilename parted.info
+@settitle Parted User's Manual
+@include version.texi
+@paragraphindent 2
+@c %**end of header
+
+@ifinfo
+This file documents the use of GNU Parted, a program for creating,
+resizing, checking and copy partitions and file systems on them.
+@end ifinfo
+
+@ifnottex @c texi2pdf don't understand copying and insertcopying ???
+@c modifications must also be done in the titlepage
+@copying
+Copyright @copyright{} 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+Free Software Foundation, Inc.
+
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.1 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+Texts. A copy of the license is included in the section entitled ``GNU
+Free Documentation License''.
+@end copying
+@c WTF does the info get the copying output and the plaintext output not ????
+@ifplaintext
+@insertcopying
+@end ifplaintext
+@end ifnottex
+
+@direntry
+* parted: (parted). GNU partitioning software
+@end direntry
+
+@titlepage
+@title GNU Parted User Manual
+@subtitle GNU Parted, version @value{VERSION}, @value{UPDATED}
+@author Andrew Clausen @email{clausen@@gnu.org}
+@author Richard M. Kreuter @email{kreuter@@anduril.rutgers.edu}
+@author Leslie Patrick Polzer @email{polzer@@gnu.org}
+
+
+@c @page
+@c @vskip 0pt plus 1filll
+
+@c modifications must also be done in the copying block
+Copyright @copyright{} 1999, 2000, 2001, 2002, 2003, 2004, 2005
+Free Software Foundation, Inc.
+
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.1 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+Texts. A copy of the license is included in the section entitled ``GNU
+Free Documentation License''.
+@end titlepage
+
+@ifnottex
+@node Top
+@top GNU Parted User Manual
+
+@c WTF doesn't texi2html include the titlepage?
+@ifhtml
+@insertcopying
+@end ifhtml
+
+This document describes the use of GNU Parted, a program for creating,
+destroying, resizing, checking and copying hard drive partitions, and
+the file systems on them.
+
+This document applies roughly to version @strong{@value{VERSION}} of GNU Parted.
+
+The original version was written by Andrew Clausen in text format.
+Richard M. Kreuter translated it into Texinfo format in 2002, to be heavily
+edited by Leslie P. Polzer in 2006.
+@end ifnottex
+
+@shortcontents
+
+@menu
+* Introduction:: Overview
+* Using Parted:: Partitioning a Hard Drive
+* Related information:: Further reading on related topics
+* Copying This Manual:: How to make copies of this manual
+* History:: This manual's history
+@ifnotplaintext
+* Index:: Index of referenced concepts
+@end ifnotplaintext
+@end menu
+
+@node Introduction
+@chapter Introduction
+
+@menu
+* Overview:: GNU Parted and prerequisite knowledge
+* Software Required:: GNU Parted's software dependencies
+* Supported Platforms:: Where you can use GNU Parted
+* License:: What you may and may not do with GNU Parted
+* Compiling:: How to build GNU Parted
+* Static binaries:: How to get and use a static version of GNU
+ Parted
+@end menu
+
+@node Overview
+@section Overview of GNU Parted
+@cindex description of parted
+@cindex overview
+@cindex parted description
+@cindex bugs, reporting
+@cindex reporting bugs
+@cindex contacting developers
+
+GNU Parted is a program for creating, destroying, resizing, checking
+and copying partitions, and the file systems on them.
+
+This is useful for creating space for new operating systems, for
+reorganizing disk usage, for copying data between hard disks and for
+``disk imaging'' --- replicating an installation on another computer.
+
+This documentation is written with the assumption that the reader
+has some understanding of partitioning and file systems. If you want to
+learn more about these, the upcoming GNU Storage Guide is recommended
+reading.
+
+GNU Parted was designed to minimize the chance of data loss. For
+example, it was designed to avoid data loss during interruptions (like
+power failure) and performs many safety checks. However, there could
+be bugs in GNU Parted, so you should back up your important files before
+running Parted.
+Also note that reiserfs support relies on libreiserfs, which does not
+fulfil the aforementioned requirement. The same holds for any external
+tools like @kbd{ntfsresize}.
+
+The GNU Parted homepage is @uref{http://www.gnu.org/software/parted}. The
+library and frontend themselves can be downloaded from
+@uref{ftp://ftp.gnu.org/gnu/parted}.
+You can also find a listing of mailing lists, notes for contributing and
+more useful information on the web site.
+
+Please send bug reports to @email{bug-parted@@gnu.org}. When sending bug
+reports, please include the version of GNU Parted.
+Please include the output from these commands (for disk @file{/dev/hda}):
+
+@example
+@group
+# @kbd{parted /dev/hda print unit s print unit chs print}
+@end group
+@end example
+
+Feel free to ask for help on this list --- just check that your question
+isn't answered here first. If you don't understand the documentation,
+please tell us, so we can explain it better. General philosophy is:
+if you need to ask for help, then something needs to be fixed so you
+(and others) don't need to ask for help.
+
+Also, we'd love to hear your ideas :-)
+
+@node Software Required
+@section Software Required for the use of Parted
+@cindex software dependencies
+@cindex required software
+@cindex libuuid
+@cindex e2fsprogs
+@cindex readline
+@cindex gettext
+
+If you're installing or compiling Parted yourself, you'll need to
+have some other programs installed. If you are compiling Parted,
+you will need both the normal and devel packages of these programs
+installed:
+
+@itemize @bullet
+
+@item libuuid, part of the e2fsprogs package. If you don't have this,
+you can get it from:
+
+ @uref{http://web.mit.edu/tytso/www/linux/e2fsprogs.html}
+
+If you want to compile Parted and e2fsprogs, note that you will need to
+@kbd{make install} and @kbd{make install-libs} e2fsprogs.
+
+@item GNU Readline (optional), available from
+
+ @uref{ftp://ftp.gnu.org/gnu/readline}
+
+If you are compiling Parted, and you don't have readline, you can
+disable Parted's readline support with the @kbd{--disable-readline}
+option for @command{configure}.
+
+@item GNU gettext (or compatible software) for compilation, if
+internationalisation support is desired.
+
+ @uref{ftp://ftp.gnu.org/gnu/gettext}
+
+@item libreiserfs, if you want reiserfs support:
+
+ @uref{http://reiserfs.osdn.org.ua}
+
+Note that parted will automatically detect libreiserfs at runtime, and enable
+reiserfs support. libreiserfs is new, and hasn't been widely tested yet.
+
+@end itemize
+
+@node Supported Platforms
+@section Platforms on which GNU Parted runs
+@cindex supported platforms
+@cindex platforms, supported
+
+Hopefully, this list will grow a lot. If you do not have one of these
+platforms, then you can use a rescue disk and a static binary of GNU Parted.
+@xref{Static binaries}.
+
+@table @asis
+@item GNU/Linux
+Linux versions 2.0 and up, on Alpha, x86 PCs, PC98, Macintosh PowerPC, Sun hardware.
+
+@item GNU/Hurd
+@end table
+
+GNU libc 2.1 or higher is required. You can probably use older versions
+by using the @samp{--disable-nls} option. @xref{Compiling, Building GNU
+Parted}. (Note: I think we have now dropped this requirement. TODO:
+check if libc 2.0 works!)
+
+@node License
+@section Terms of distribution for GNU Parted
+@cindex license terms
+@cindex terms of distribution
+@cindex gnu gpl
+@cindex gpl
+
+GNU Parted is free software, covered by the GNU General Public License
+Version 2. This should have been included with the Parted distribution,
+in the COPYING file. If not, write to the Free Software Foundation,
+Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+
+Libparted is considered part of GNU Parted. It is covered by the GNU
+General Public License. It is NOT released under the GNU Lesser General
+Public License (LGPL).
+
+@node Compiling
+@section Building GNU Parted
+@cindex compiling parted
+@cindex building parted
+
+If you want to compile GNU Parted, this is generally done with:
+
+@example
+@group
+$ @kbd{./configure}
+$ @kbd{make}
+@end group
+@end example
+
+However, there are a few options for @command{configure}:
+
+@table @code
+@item --without-readline
+turns off use of readline. This is useful for making rescue disks,
+etc., where few libraries are available.
+
+@item --disable-debug
+don't include assertions
+
+@item --disable-dynamic-loading
+disables dynamic loading of some libraries (only libreiserfs for now,
+although we hope to expand this). Dynamic loading is useful because it
+allows you to reuse libparted shared libraries even when you don't know
+if some libraries will be available. It has a small overhead (mainly
+linking with libdl), so it may be useful to disable it on bootdisks if
+you don't need the flexibility.
+
+@item --disable-fs
+disable all file system support
+
+@item --disable-nls
+turns off native language support. This is useful for use with old
+versions of glibc, or a trimmed down version of glibc suitable for
+rescue disks.
+
+@item --disable-shared
+turns off shared libraries. This may be necessary for use with old
+versions of GNU libc, if you get a compile error about a ``spilled
+register''. Also useful for boot/rescue disks.
+
+@item --disable-Werror
+ignore warning messages in compilation
+
+@item --enable-discover-only
+support only reading/probing (reduces size considerably)
+
+@item --enable-mtrace
+enable malloc() debugging
+
+@item --enable-read-only
+disable writing (for debugging)
+
+@end table
+
+@node Static binaries
+@section Using static binaries of GNU Parted
+@cindex static binary
+@cindex unsupported platforms
+@cindex resizing root device
+
+@subsection Introduction
+If you want to run GNU Parted on a machine without GNU/Linux installed, or you
+want to resize a root or boot partition, you will need to use a boot disk.
+
+Special boot disk images for GNU Parted used to be available, but with the
+emergence of a plethora of rescue disks and Live CDs that all
+include GNU Parted this is no longer necessary.
+However, please note that these disks often ship with out-of-date
+versions of Parted. To compensate for this a static binary
+of the latest GNU Parted version is available, which you can use thus:
+
+@c There should be instructions for CD and USB here.
+
+@subsection Creating the Parted disk
+@enumerate
+@item Boot your system
+
+@item Download @file{parted-static-VERSION.tgz} from @uref{ftp://ftp.gnu.org/parted/static}
+@item Unpack the tarball, resulting in a file called ``parted.static".
+
+@item Insert a floppy.
+
+@item Do a low-level format on it (on GNU/Linux this can be achieved with
+ the tool ``fdformat" from the ``util-linux" package.
+ This is basically a sanity check because floppy disks often
+ contain bad blocks.
+
+@item Create a file system. Example:
+
+@example
+$ @kbd{parted /dev/fd0 mklabel loop mkpartfs primary ext2 0 1.4}
+@end example
+
+@item Mount the floppy disk, e.g.,
+
+@example
+$ @kbd{mount -t ext2 /dev/fd0 /mnt/floppy}
+@end example
+
+@item Copy @file{parted.static} to the floppy, e.g.,
+
+@example
+$ @kbd{cp parted.static /mnt/floppy}
+@end example
+
+@item Unmount the floppy, e.g.,
+
+@example
+$ @kbd{umount /mnt/floppy}
+@end example
+@end enumerate
+
+@subsection Using the Parted disk
+@enumerate
+@item Choose a rescue disk that suits you.
+
+@item Boot off your rescue disk. Mount the disk you copied Parted onto.
+
+@item Run Parted. For example,
+
+@example
+# @kbd{cd /mnt/floppy}
+# @kbd{./parted-static}
+@end example
+@end enumerate
+
+@node Using Parted
+@chapter Using Parted
+@cindex commands
+
+@menu
+* Partitioning:: Disk partitioning in context
+* Running Parted:: Partitioning with Parted
+* Invoking Parted:: Parted's invocation options and commands
+* Command explanations:: Full explanation of parted's commands
+@end menu
+
+@node Partitioning
+@section Introduction to Partitioning
+@cindex partitioning overview
+
+Unfortunately, partitioning your disk is rather complicated. This is
+because there are interactions between many different systems that need
+to be taken into consideration.
+
+This manual used to introduce the reader to these systems and their
+working. This content has moved to the GNU Storage Guide.
+
+@node Running Parted
+@section Using GNU Parted
+@cindex modes of use
+
+Parted has two modes: command line and interactive. Parted should
+always be started with:
+
+@example
+# @kbd{parted @var{device}}
+@end example
+
+@noindent where @var{device} is the hard disk device to edit. (If you're
+lazy and omit the DEVICE argument, Parted will attempt to guess which
+device you want.)
+
+In command line mode, this is followed by one or more commands. For
+example:
+
+@example
+# @kbd{parted /dev/sda resize 1 52Mb 104Mb mkfs 2 fat16}
+@end example
+
+@noindent Options (like @kbd{--help}) can only be specified on the
+command line.
+
+In interactive mode, commands are entered one at a time at a prompt, and
+modify the disk immediately. For example:
+
+@example
+(parted) @kbd{resize 1 52.0005Mb 104.5Mb}
+(parted) @kbd{mkfs 2 fat16}
+@end example
+
+@noindent Unambiguous abbreviations are allowed. For example, you can
+type ``p'' instead of ``print'', and ``resi'' instead of ``resize''.
+Commands can be typed either in English, or your native language (if
+your language has been translated). This may create ambiguities.
+Commands are case-insensitive.
+
+Numbers indicating partition locations can be whole numbers or decimals.
+The suffix selects the unit, which may be one of those described in
+@ref{unit}, except CHS and compact. If no suffix is given, then the default
+unit is assumed. Negative numbers count back from the end of the disk,
+with ``-1s'' indicating the end of the disk. Parted will compute sensible
+ranges for the locations you specify (e.g. a range of +/- 500 MB when you
+specify the location in ``G''). Use the sector unit ``s'' to specify exact
+locations.
+
+If you don't give a parameter to a command, Parted will prompt you for it.
+For example:
+
+@example
+(parted) @kbd{resize 1}
+Start? @kbd{0Gb}
+End? @kbd{40Gb}
+@end example
+
+Parted will always warn you before doing something that is potentially
+dangerous, unless the command is one of those that is inherently
+dangerous (viz., rm, mklabel and mkfs). For example, if you attempt to
+shrink a partition ``too much'' (i.e., by more than the free space
+available), Parted will automatically reduce the shrinkage so that the
+partition is the smallest it can be without losing data. If this size is
+significantly different from the size requested, Parted will warn you.
+Since many partitioning systems have complicated constraints, Parted will
+usually do something slightly different to what you asked. (For example,
+create a partition starting at 10.352Mb, not 10.4Mb)
+If the calculated values differ too much, Parted will ask you for
+confirmation.
+
+@node Invoking Parted
+@section Command Line Options
+@cindex options at invocation
+@cindex commands, overview
+@cindex invocation options
+
+When invoked from the command line, Parted supports the following syntax:
+
+@example
+# @kbd{parted [@var{option}] @var{device} [@var{command} [@var{argument}]]}
+@end example
+
+Available options and commands follow. For detailed explanations of the
+use of Parted commands, see @ref{Command explanations}. Options begin
+with a hyphen, commands do not:
+
+Options:
+
+@table @samp
+@item -h
+@itemx --help
+display a help message
+
+@item -i
+@itemx --interactive
+prompt for user intervention
+
+@item -s
+@itemx --script
+never prompt the user
+
+@item -v
+@itemx --version
+display the version
+@end table
+
+@node Command explanations
+@section Parted Session Commands
+@cindex command syntax
+@cindex detailed command listing
+@cindex commands, detailed listing
+
+GNU Parted provides the following commands:
+
+@menu
+* check::
+* cp::
+* help::
+* mklabel::
+* mkfs::
+* mkpart::
+* mkpartfs::
+* move::
+* name::
+* print::
+* quit::
+* rescue::
+* resize::
+* rm::
+* select::
+* set::
+* unit::
+@end menu
+
+@node check
+@subsection check
+@cindex check, command description
+@cindex command description, check
+
+@deffn Command check @var{number}
+
+Checks if the file system on partition @var{number} has
+any errors.
+
+Example:
+
+@example
+(parted) @kbd{check 1}
+@end example
+
+Check the file system on partition 1.
+@end deffn
+
+@node cp
+@subsection cp
+@cindex cp, command description
+@cindex command description, cp
+
+@deffn Command cp [@var{from-device}] @var{from-number} @var{to-number}
+
+Copies the file system on the partition @var{from-number} to partition
+@var{to-number}, deleting the original contents of the destination
+partition.
+
+An optional device parameter, @var{from-device} can be given, which
+specifies which device the source partition is on.
+
+Supported file systems:
+@itemize @bullet
+@item ext2, ext3
+(provided the destination partition is larger than the source partition)
+
+@item fat16, fat32
+@item linux-swap
+(equivalent to mkswap on destination partition)
+@item reiserfs (if libreiserfs is installed)
+
+@end itemize
+
+Example:
+
+@example
+(parted) @kbd{cp /dev/hdb 2 3}
+@end example
+
+@c FIXME: this doesn't format right.
+Copy partition 2 of @file{/dev/hdb} (i.e., @file{/dev/hdb2}) to partition
+on 3, on the device Parted was loaded with, destroying the original
+contents of partition 3.
+@end deffn
+
+@node help
+@subsection help
+@cindex help, command description
+@cindex command description, help
+
+@deffn Command help [@var{command}]
+
+Prints general help, or help on @var{command}.
+
+Example:
+
+@example
+(parted) @kbd{help resize}
+@end example
+
+Print help for the resize command.
+@end deffn
+
+@node mklabel
+@subsection mklabel
+@cindex mklabel, command description
+@cindex command description, mkindex
+
+@deffn Command mklabel @var{label-type}
+
+Creates a new disk label, of type @var{label-type}. The new disk label
+will have no partitions. This command (normally) won't technically
+destroy your data, but it will make it basically unusable,
+and you will need to use the rescue command (@pxref{Related information})
+to recover any partitions.
+Parted works on all partition tables. @footnote{Everyone seems to
+have a different word for ``disk label'' --- these are all the same
+thing: partition table, partition map.}
+
+@var{label-type} must be one of these supported disk labels:
+@itemize @bullet
+@item bsd
+@item loop (raw disk access)
+@item gpt
+@item mac
+@item msdos
+@item pc98
+@item sun
+@end itemize
+
+Example:
+
+@example
+(parted) @kbd{mklabel msdos}
+@end example
+
+Create an MS-DOS disk label. This is still the most common disk label for
+PCs.
+@end deffn
+
+@node mkfs
+@subsection mkfs
+@cindex mkfs, command description
+@cindex command description, mkfs
+
+@deffn Command mkfs @var{number} @var{fs-type}
+
+Makes a file system @var{fs-type} on partition @var{number}, destroying
+all data that resides on that partition.
+
+Supported file systems:
+@itemize @bullet
+@item ext2
+@item fat16, fat32
+@item linux-swap
+@item reiserfs (if libreiserfs is installed)
+@end itemize
+
+Example:
+
+@example
+(parted) @kbd{mkfs 2 fat32}
+@end example
+
+Make a @var{fat32} file system on partition 2.
+@end deffn
+
+@node mkpart
+@subsection mkpart
+@cindex mkpart, command description
+@cindex command description, mkpart
+
+@deffn Command mkpart @var{part-type} [@var{fs-type}] @var{start} @var{end}
+
+Creates a new partition, @emph{without} creating a new file system on
+that partition. This is useful for creating partitions for file systems
+(or LVM, etc.) that Parted doesn't support. You may specify a file
+system type, to set the appropriate partition code in the partition
+table for the new partition. @var{fs-type} is required for data
+partitions (i.e., non-extended partitions). @var{start} and @var{end}
+are the offset from the beginning of the disk, that is, the ``distance''
+from the start of the disk.
+
+@var{part-type} is one of: primary, extended, logical. Extended and
+logical are only used for msdos and dvh disk labels.
+
+@var{fs-type} must be on of these supported file systems:
+@itemize @bullet
+@item ext2
+@item fat16, fat32
+@item hfs, hfs+, hfsx
+@item linux-swap
+@item NTFS
+@item reiserfs
+@item ufs
+@end itemize
+
+Example:
+
+@example
+(parted) @kbd{mkpart logical 0.0 692.1}
+@end example
+
+Create a logical partition that will contain an ext2 file system. The
+partition will start at the beginning of the disk, and end 692.1
+megabytes into the disk.
+
+@end deffn
+
+@node mkpartfs
+@subsection mkpartfs
+@cindex mkpartfs, command description
+@cindex command description, mkpartfs
+
+@deffn Command mkpartfs @var{part-type} @var{fs-type} @var{start} @var{end}
+
+Creates a new partition of type @var{part-type} with a new file system
+of type @var{fs-type} on it. The new partition will start @var{start}
+megabytes, and end @var{end} megabytes from the beginning of the disk.
+Do not use this command to recover a deleted partition (use mkpart
+instead).
+
+@var{part-type} is one of: primary, extended, logical. Extended and logical
+are only used for msdos and dvh disk labels.
+
+@var{fs-type} must be one of these supported file systems:
+@itemize @bullet
+@item ext2
+@item fat16, fat32
+@item linux-swap
+@item reiserfs (if libreiserfs is installed)
+@end itemize
+
+Example:
+
+@example
+(parted) @kbd{mkpartfs logical ext2 440 670}
+@end example
+
+Make a logical partition and write an ext2 file system, starting 440
+megabytes and ending 670 megabytes from the beginning of the disk.
+@end deffn
+
+@node move
+@subsection move
+@cindex move, command description
+@cindex command description, move
+
+@deffn Command move @var{number} @var{start} @var{end}
+
+Moves partition on the disk, by moving its beginning to @var{start}.
+You can't move a partition so that the old and new positions overlap.
+That is, you can only move partitions into free space. If you want
+to resize a partition in-place, use @command{resize}.
+
+Move never changes the partition number.
+
+Supported file systems:
+@itemize @bullet
+@item ext2, ext3
+(provided the destination partition is larger than the source partition)
+
+@item fat16, fat32
+
+@item linux-swap
+
+@item reiserfs (if libreiserfs is installed)
+@end itemize
+
+Example:
+
+@example
+(parted) move 2 150M 500M
+@end example
+
+Move the partition numbered 2 so that it begins 150 megabytes from the start of
+the disk, and ends 500 megabytes from the start.
+
+@end deffn
+
+@node name
+@subsection name
+@cindex name, command description
+@cindex command description, name
+
+@deffn Command name @var{number} @var{name}
+
+Sets the name for the partition @var{number} (GPT, Mac, MIPS and PC98 only).
+The name can be placed in quotes.
+
+Example:
+
+@example
+(parted) @kbd{name 2 'Secret Documents'}
+@end example
+
+Set the name of partition 2 to `Secret Documents'.
+@end deffn
+
+@node print
+@subsection print
+@cindex print, command description
+@cindex command description, print
+
+@deffn Command print [@var{number}]
+
+Displays the partition table on the device parted is editing, or
+detailed information about a particular partition.
+
+Example:
+
+@example
+@group
+(parted) @kbd{print}
+Disk geometry for /dev/hda: 0.000-2445.679 megabytes
+Disk label type: msdos
+Minor Start End Type Filesystem Flags
+1 0.031 945.000 primary fat32 boot, lba
+2 945.000 2358.562 primary ext2
+3 2358.562 2445.187 primary linux-swap
+(parted) @kbd{print 1}
+Minor: 1
+Flags: boot, lba
+File System: fat32
+Size: 945.000Mb (0%)
+Minimum size: 84.361Mb (0%)
+Maximum size: 2445.679Mb (100%)
+@end group
+@end example
+@end deffn
+
+@node quit
+@subsection quit
+@cindex quit, command description
+@cindex command description, quit
+
+@deffn Command quit
+
+Quits Parted.
+
+@c RMK: generality: the following will apply to any operating system on
+@c which parted will run, not only Linux-based ones.
+@c clausen: yeah... just that the way hurd and linux work are totally
+@c different, and it's actually very hard to speak in general. Need to
+@c discuss this more
+It is only after Parted exits that the Linux kernel knows about the changes
+Parted has made to the disks. However, the changes caused by typing your
+commands will @emph{probably} be made to the disk immediately after typing a
+command. However, the operating system's cache and the disk's hardware cache
+may delay this.
+@end deffn
+
+@node rescue
+@subsection rescue
+@cindex rescue, command description
+@cindex command description, rescue
+
+@deffn Command rescue @var{start} @var{end}
+Rescue a lost partition that used to be located approximately between
+@var{start} and @var{end}. If such a partition is found, Parted will
+ask you if you want to create a partition for it. This is useful if you
+accidently deleted a partition with parted's rm command, for example.
+
+Example:
+
+@example
+(parted) @kbd{print}
+@group
+Disk geometry for /dev/hdc: 0.000-8063.507 megabytes
+Disk label type: msdos
+Minor Start End Type Filesystem Flags
+1 0.031 8056.032 primary ext3
+@end group
+(parted) @kbd{rm}
+Partition number? 1
+(parted) @kbd{print}
+@group
+Disk geometry for /dev/hdc: 0.000-8063.507 megabytes
+Disk label type: msdos
+Minor Start End Type Filesystem Flags
+@end group
+@end example
+
+OUCH! We deleted our ext3 partition!!! Parted comes to the rescue...
+
+@example
+(parted) @kbd{rescue}
+Start? 0
+End? 8056
+Information: A ext3 primary partition was found at 0.031MB ->
+8056.030MB. Do you want to add it to the partition table?
+Yes/No/Cancel? @kbd{y}
+(parted) @kbd{print}
+@group
+Disk geometry for /dev/hdc: 0.000-8063.507 megabytes
+Disk label type: msdos
+Minor Start End Type Filesystem Flags
+1 0.031 8056.032 primary ext3
+@end group
+@end example
+
+It's back! :)
+
+@end deffn
+
+@node resize
+@subsection resize
+@cindex resize, command description
+@cindex command description, resize
+
+@deffn Command resize @var{number} @var{start} @var{end}
+
+Resizes the partition with number @var{number}. The partition will start
+@var{start} from the beginning of the disk, and end @var{end} from the
+beginning of the disk. resize never changes the partition number. Extended
+partitions can be resized only so long as the new extended partition
+completely contains all logical partitions.
+
+Note that Parted can manipulate partitions whether or not they have been
+defragmented, so you do not need to defragmenting the disk before
+using Parted.
+
+Supported file systems:
+@itemize @bullet
+@item ext2, ext3 -- restriction: the new @var{start} must be the same as
+the old @var{start}.
+@item fat16, fat32
+@item hfs, hfs+, hfsx -- restriction: the new @var{start} must be the same as
+the old @var{start} and the new @var{end} must be smaller than the old
+@var{end}.
+@item linux-swap
+@item reiserfs (if libreiserfs is installed)
+@end itemize
+
+Example:
+
+@example
+(parted) @kbd{resize 3 200M 850M}
+@end example
+
+Resize partition 3, so that it begins 200 megabytes and ends 850
+megabytes from the beginning of the disk.
+@end deffn
+
+@node rm
+@subsection rm
+@cindex rm, command description
+@cindex command description, rm
+
+
+@deffn Command rm @var{number}
+
+Removes the partition with number @var{number}. If you accidently delete
+a partition with this command, use mkpart (@emph{not} mkpartfs) to
+recover it. Also, you can use the gpart program (@pxref{Related information})
+to recover damaged disk labels.
+
+Note for msdos disk labels: if you delete a logical partition, all
+logical partitions with a larger partition number will be renumbered. For
+example, if you delete a logical partition with a partition number of 6,
+then logical partitions that were number 7, 8 and 9 would be renumbered
+to 6, 7 and 8 respectively. This means, for example, that you have to
+update @file{/etc/fstab} on GNU/Linux systems.
+
+Example:
+
+@example
+(parted) @kbd{rm 3}
+@end example
+
+Remove partition 3.
+@end deffn
+
+@node select
+@subsection select
+@cindex select, command description
+@cindex command description, select
+
+@deffn Command select @var{device}
+
+Selects the device, @var{device}, for Parted to edit. The device can
+be a Linux hard disk device, a partition, a software RAID device or
+LVM logical volume.
+
+Example:
+
+@example
+(parted) @kbd{select /dev/hdb}
+@end example
+
+Select @file{/dev/hdb} (the slave device on the first ide controller on
+Linux) as the device to edit.
+@end deffn
+
+@node set
+@subsection set
+@cindex set, command description
+@cindex command description, set
+
+@deffn Command set @var{number} @var{flag} @var{state}
+
+Changes a flag on the partition with number @var{number}. A flag can be
+either ``on'' or ``off''. Some or all of these flags will be available,
+depending on what disk label you are using:
+
+@table @samp
+@item boot
+(Mac, MS-DOS, PC98) - should be enabled if you want to boot off the
+partition. The semantics vary between disk labels. For MS-DOS disk
+labels, only one partition can be bootable. If you are installing LILO
+on a partition that partition must be bootable.
+For PC98 disk labels, all ext2 partitions must be bootable (this is
+enforced by Parted).
+
+@item lba
+(MS-DOS) - this flag can be enabled to tell MS DOS, MS Windows 9x and
+MS Windows ME based operating systems to use Linear (LBA) mode.
+
+@item root
+(Mac) - this flag should be enabled if the partition is the root device
+to be used by Linux.
+
+@item swap
+(Mac) - this flag should be enabled if the partition is the swap
+device to be used by Linux.
+
+@item hidden
+(MS-DOS, PC98) - this flag can be enabled to hide partitions from
+Microsoft operating systems.
+
+@item raid
+(MS-DOS) - this flag can be enabled to tell linux the partition is a
+software RAID partition.
+
+@item LVM
+(MS-DOS) - this flag can be enabled to tell linux the partition is a
+physical volume.
+
+@item PALO
+(MS-DOS) - this flag can be enabled so that the partition can be used
+by the Linux/PA-RISC boot loader, palo.
+
+@item PREP
+(MS-DOS) - this flag can be enabled so that the partition can be used
+as a PReP boot partition on PowerPC PReP or IBM RS6K/CHRP hardware.
+
+@end table
+
+The print command displays all enabled flags for each partition.
+
+Example:
+
+@example
+(parted) @kbd{set 1 boot on}
+@end example
+
+Set the @samp{boot} flag on partition 1.
+@end deffn
+
+@node unit
+@subsection unit
+@cindex unit, command description
+@cindex command description, unit
+
+@deffn Command unit @var{unit}
+
+Selects the current default unit that Parted will use to display
+locations and capacities on the disk and to interpret those given
+by the user if they are not suffixed by an @var{unit}.
+
+@var{unit} may be one of:
+
+@table @samp
+@item s
+sector (n bytes depending on the sector size, often 512)
+
+@item B
+byte
+
+@item kB
+kilobyte (1000 bytes)
+
+@item MB
+megabyte (1000000 bytes)
+
+@item GB
+gigabyte (1000000000 bytes)
+
+@item TB
+terabyte (1000000000000 bytes)
+
+@item %
+percentage of the device (between 0 and 100)
+
+@item cyl
+cylinders (related to the BIOS CHS geometry)
+
+@item chs
+cylinders, heads, sectors addressing (related to the BIOS CHS geometry)
+
+@item compact
+This is a special unit that defaults to megabytes for input, and picks a
+unit that gives a compact human readable representation for output.
+@end table
+
+The default unit apply only for the output and when no unit is
+specified after an input number. Input numbers can be followed by
+an unit (without any space or other character between them), in
+which case this unit apply instead of the default unit for this
+particular number, but CHS and cylinder units are not supported as
+a suffix. If no suffix is given, then the default unit is assumed.
+Parted will compute sensible ranges for the locations you specify
+(e.g. a range of +/- 500 MB when you specify the location in ``G'')
+and will select the nearest location in this range from the one you
+wrote that satisfies constraints from both the operation, the
+filesystem being worked on, the disk label, other partitions and so
+on. Use the sector unit ``s'' to specify exact locations (if they
+do not satisfy all onstraints, Parted will ask you for the nearest
+solution). Note that negative numbers count back from the end of
+the disk, with ``-1s'' pointing to the end of the disk.
+
+Example:
+
+@example
+@group
+(parted) unit compact
+(parted) print
+Disk geometry for /dev/hda: 0kB - 123GB
+Disk label type: msdos
+Number Start End Size Type File system Flags
+1 32kB 1078MB 1077MB primary reiserfs boot
+2 1078MB 2155MB 1078MB primary linux-swap
+3 2155MB 123GB 121GB extended
+5 2155MB 7452MB 5297MB logical reiserfs
+@end group
+@group
+(parted) unit chs print
+Disk geometry for /dev/hda: 0,0,0 - 14946,225,62
+BIOS cylinder,head,sector geometry: 14946,255,63. Each cylinder
+is 8225kB.
+Disk label type: msdos
+Number Start End Type File system Flags
+1 0,1,0 130,254,62 primary reiserfs boot
+2 131,0,0 261,254,62 primary linux-swap
+3 262,0,0 14945,254,62 extended
+5 262,2,0 905,254,62 logical reiserfs
+@end group
+@group
+(parted) unit mb print
+Disk geometry for /dev/hda: 0MB - 122942MB
+Disk label type: msdos
+Number Start End Size Type File system Flags
+1 0MB 1078MB 1077MB primary reiserfs boot
+2 1078MB 2155MB 1078MB primary linux-swap
+3 2155MB 122935MB 120780MB extended
+5 2155MB 7452MB 5297MB logical reiserfs
+@end group
+@end example
+
+@end deffn
+
+@node Related information
+@chapter Related information
+@cindex further reading
+@cindex related documentation
+
+If you want to find out more information, please see the GNU Parted web site.
+
+These files in the Parted distribution contain further information:
+
+@itemize @bullet
+
+@item @kbd{ABOUT-NLS} - information about using Native Language Support, and the Free Translation Project.
+
+@item @kbd{AUTHORS} - who wrote what.
+
+@item @kbd{ChangeLog} - record of changes made to Parted.
+
+@item @kbd{COPYING} - the GNU General Public License, the terms under which GNU Parted may be distributed.
+
+@item @kbd{COPYING.DOC} - the GNU Free Documentation Licence, the term under
+which Parted's documentation may be distributed.
+
+@item @kbd{INSTALL} --- how to compile and install Parted, and most other free
+software
+
+@end itemize
+
+@node Copying This Manual
+@appendix Copying This Manual
+
+@menu
+* GNU Free Documentation License:: License for copying this manual
+@end menu
+
+@include fdl.texi
+
+@node History
+@appendix This manual's history
+@cindex history of this manual
+
+This manual was based on the file @kbd{USER} included in GNU Parted version
+1.4.22 source distribution. The GNU Parted source distribution is
+available at @uref{ftp.gnu.org/gnu/parted}.
+
+Initial Texinfo formatting by Richard M. Kreuter, 2002.
+
+Maintainance by Andrew Clausen from 2002 to 2005 and by Leslie P. Polzer
+from July 2005 onwards.
+
+This manual is distributed under the GNU Free Documentation License,
+version 1.1 or later, at your discretion, any later version published
+by the Free Software Foundation; with no Invariant Sections, with no
+Front-Cover Texts, and with no Back-Cover Texts. @xref{Copying
+This Manual}, for details.
+
+@c FIXME: why doesn't this @ifnotplaintext work?!
+@c @ifnotplaintext
+@node Index
+@unnumbered Index
+@printindex cp
+@c @end ifnotplaintext
+
+@bye
+
+@ignore
+
+Notes by RMK:
+Notes on possible (unimplemented!) modifications:
+
+The output samples from parted's print command, fdisk's p command, etc.,
+might be made into tables (multi-column tables) to ensure spiffy formatting.
+
+I'd like to find a way to make *entry: see *synonym type references in
+the index, so, e.g., to refer people looking for Apple to Macintosh, and
+PowerPC to Macintosh, etc. Probably texinfo does this already; I dunno.
+
+Notes by Leslie:
+
+TODO:
+ - add "version" command.
+ - read through and correct.
+ - role of FreeDOS?
+
+@end ignore
diff --git a/doc/po4a.mk b/doc/po4a.mk
new file mode 100644
index 0000000..761edb1
--- /dev/null
+++ b/doc/po4a.mk
@@ -0,0 +1,93 @@
+#
+# You must set the $(lang) variable when you include this makefile.
+#
+# You can use the $(po4a_translate_options) variable to specify additional
+# options to po4a.
+# For example: po4a_translate_options=-L KOI8-R -A KOI8-R
+#
+#
+# This makefile deals with the manpages generated from POs with po4a, and
+# should be included in an automake Makefile.am.
+#
+# The po must be named:
+# <man>.$(lang).po
+# If a man page require an addendum, you must name it:
+# <man>.$(lang).po.addendum
+# Where <man> corresponds to a filename in the C directory (which contains
+# the English man pages).
+#
+# The POs suffix is $(lang).po to allow dl10n to detect the outdated POs.
+#
+#
+# If a man page cannot be generated (it is not sufficiently translated; the
+# threshold is 80%), it won't be distributed, and the build won't fail.
+#
+
+mandir = @mandir@/$(lang)
+
+# Inform automake that we want to install some man pages in section 1, 5
+# and 8.
+# We can't simply use:
+# dist_man_MANS = $(wildcard *.[1-9])
+# Because when Makefile.in is generated, dist_man_MANS is empty, and
+# automake do not generate the install-man targets.
+dist_man_MANS = fake-page.1 fake-page.5 fake-page.8
+
+# Do not fail if these man pages do not exist
+.PHONY: fake-page.1 fake-page.5 fake-page.8
+
+# Override the automake's install-man target.
+# And set dist_man_MANS according to the pages that could be generated
+# when this target is called.
+install-man: dist_man_MANS = $(wildcard *.[1-9])
+install-man: install-man1 install-man5 install-man8
+
+# For each .po, try to generate the man page
+all-local:
+ for po in $(srcdir)/*.$(lang).po; do \
+ $(MAKE) $$(basename $${po%.$(lang).po}); \
+ done
+
+# Remove the man pages that were generated from a .po
+clean-local:
+ for po in $(srcdir)/*.$(lang).po; do \
+ rm -f $$(basename $${po%.$(lang).po}); \
+ done
+
+.PHONY: updatepo
+# Update the PO in srcdir, according to the POT in C.
+# Based on the gettext po/Makefile.in.in
+updatepo:
+ tmpdir=`pwd`; \
+ cd $(srcdir); \
+ for po in *.$(lang).po; do \
+ pot=../C/po/$${po%$(lang).po}pot; \
+ echo "$(MSGMERGE) $$po $$pot -o $${po%po}new.po"; \
+ if $(MSGMERGE) $$po $$pot -o $$tmpdir/$${po%po}new.po; then \
+ if cmp $$po $$tmpdir/$${po%po}new.po >/dev/null 2>&1; then \
+ rm -f $$tmpdir/$${po%po}new.po; \
+ else \
+ if mv -f $$tmpdir/$${po%po}new.po $$po; then \
+ :; \
+ else \
+ echo "msgmerge for $$po failed: cannot move $$tmpdir/$${po%po}new.po to $$po" 1>&2; \
+ exit 1; \
+ fi; \
+ fi; \
+ else \
+ echo "msgmerge for $$po failed!" 1>&2; \
+ rm -f $$tmpdir/$${po%po}new.po; \
+ fi; \
+ msgfmt -o /dev/null --statistics $$po; \
+ done
+
+dist-hook: updatepo
+
+# Build the pages with an addendum
+%: $(srcdir)/%.$(lang).po $(srcdir)/../C/% $(srcdir)/%.$(lang).po.addendum
+ po4a-translate -f man -m $(srcdir)/../C/$@ -p $< -l $@ -a $(srcdir)/$@.$(lang).po.addendum $(po4a_translate_options)
+
+# Build the pages without addendum
+%: $(srcdir)/%.$(lang).po $(srcdir)/../C/%
+ po4a-translate -f man -m $(srcdir)/../C/$@ -p $< -l $@ $(po4a_translate_options)
+
diff --git a/doc/pt_BR-parted.8 b/doc/pt_BR-parted.8
new file mode 100644
index 0000000..3413802
--- /dev/null
+++ b/doc/pt_BR-parted.8
@@ -0,0 +1,248 @@
+.\" Hey, EMACS: -*- nroff -*-
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.\" .TH PARTED 8 "18 Mar, 2002" parted "GNU Parted Manual"
+.TH PARTED 8 "18 Mar, 2002" parted "Manual do GNU Parted"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh disable hyphenation
+.\" .hy enable hyphenation
+.\" .ad l left justify
+.\" .ad b justify to both left and right margins
+.\" .nf disable filling
+.\" .fi enable filling
+.\" .br insert line break
+.\" .sp <n> insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.\"
+.\" 20020425 traduo para pt_BR por Fbio Minami
+.\"
+.\" .SH NAME
+.\" GNU Parted \- a partition manipulation program
+.SH NOME
+GNU Parted \- ferramenta para manipulao de parties
+.\" .SH SYNOPSIS
+.\" .B parted
+.\" [options] [device [command [options...]...]]
+.SH SINOPSE
+.B parted
+[opes] [dispositivo [comando [opes...]...]]
+.\" .SH DESCRIPTION
+.\"This manual page documents briefly the
+.\".BR parted
+.\"command. Complete documentation is distributed with the package in
+.\"GNU Info format; see below.
+.SH DESCRIO
+Esta pgina de manual descreve brevemente o comando
+.BR parted.
+A documentao completa distribuda junto ao cdigo-fonte no
+formato GNU Info; veja abaixo.
+.\" .PP
+.\" .B parted
+.\" is a disk partitioning and partition resizing program. It allows you to
+.\" create, destroy, resize, move and copy ext2, ext3, linux-swap, FAT and FAT32
+.\" partitions. This is useful for creating space for new operating systems,
+.\" reorganising disk usage, and copying data to new hard disks.
+.PP
+O
+.B parted
+ uma ferramenta para particionamento de discos e redimensionamento de
+parties. Sua funo criar, destruir, redimensionar, mover e copiar
+parties ext2, ext3, linux-swap, FAT e FAT32. Isso til para criar
+espao para um novo sistema operacional, reorganizar o uso do disco e
+copiar dados para um novo disco rgido.
+.\" .SH OPTIONS
+.\" .TP
+.\" .B -h, --help
+.\" displays a help message.
+.\" .TP
+.\" .B -i, --interactive
+.\" where necessary, prompts for user intervention.
+.\" .TP
+.\" .B -s, --script
+.\" never prompts for user intervention.
+.\" .TP
+.\" .B -v, --version
+.\" displays the version.
+.SH OPES
+.TP
+.B -h, --help
+exibe a mensagem de ajuda.
+.TP
+.B -i, --interactive
+onde necessrio, pede a interveno do usurio.
+.TP
+.B -s, --script
+nunca pede a interveno do usurio.
+.TP
+.B -v, --version
+exibe a verso.
+.\" .SH COMMANDS
+.\" .TP
+.\" .B [device]
+.\" The block device to partition.
+.\" .TP
+.\" .B [command [options]]
+.\" Specifies a command to parted. If no command is given, parted will give you
+.\" a command prompt. Commands are:
+.\" .RS
+.\" .TP
+.SH COMANDOS
+.TP
+.B [dispositivo]
+O dispositivo de bloco da partio.
+.TP
+.B [comando [opes]]
+Especifica um comando ao parted. Se nenhum comando fornecido, o parted
+ir para o prompt de comando. Os comandos so:
+.RS
+.TP
+.\" .B check \fIpartition\fP
+.\" does a simple check on \fIpartition\fP.
+.\" .TP
+.B check \fIpartition\fP
+faz uma checagem simples em \fIpartio\fP
+.TP
+.\" .B cp \fI[source-device]\fP \fIsource\fP \fIdest\fP
+.\" copies the \fIsource\fP partition's filesystem on \fIsource-device\fP (or the
+.\" current device if no other device was specified) to the \fIdest\fP partition
+.\" on the current device.
+.\" .TP
+.B cp \fIsource\fP [dispositivo] \fIdest\fP
+copia o sistema de arquivos da partio \fIsource\fP em \fIsource-device\fP
+(ou o dispositivo atual se nenhum outro dispositivo for especificado)
+para a partio \fIdest\fP do dispositivo atual.
+.TP
+.\" .B help \fI[command]\fP
+.\" prints general help, or help on \fIcommand\fP if specified.
+.\" .TP
+.B help [comando]
+imprime a ajuda geral, ou ajuda sobre o [comando] se especificado
+.TP
+.\" .B mkfs \fIpartition\fP \fIfs-type\fP
+.\" make a filesystem \fIfs-type\fP on \fIpartition\fP. \fIfs-type\fP can be one
+.\" of "FAT", "ext2" or "linux-swap".
+.\" .TP
+.B mkfs \fIpartition\fP \fIfs-type\fP
+cria o sistema de arquivos \fIfs-type\fP em \fIpartition\fP.
+\fIfs-type\fP pode ser "FAT", "ext2" ou "linux-swap"
+.TP
+.\" .B mklabel \fIlabel-type\fP
+.\" Creates a new disklabel (partition table) of \fIlabel-type\fP.
+.\" \fIlabel-type\fP should be one of "bsd", "gpt", "loop", "mac", "mips", "msdos",
+.\" "pc98" or "sun".
+.\" .TP
+.B mklabel \fIlabel-type\fP
+cria um novo disklabel (tabela de parties) de \fIlabel-type\fP.
+\fIlabel-type\fP pode ser "bsd", "gpt", "loop", "mac", "mips", "msdos",
+"pc98" ou "sun"
+.TP
+.\" .B mkpart \fIpart-type\fP \fI[fs-type]\fP \fIstart\fP \fIend\fP
+.\" make a \fIpart-type\fP partition with filesystem \fIfs-type\fP (if specified),
+.\" beginning at \fIstart\fP and ending at \fIend\fP (in megabytes).
+.\" \fIpart-type\fP should be one of "primary", "logical" or "extended"
+.\" .TP
+.B mkpart \fIpart-type\fP [fs-type] \fIstart\fP \fIend\fP
+cria uma partio \fIpart-type\fP com o sistema de arquivos \fIfs-type\fP
+(se especificado), com incio em \fIstart\fP e fim em \fIend\fP (em megabytes).
+\fIpart-type\fP pode ser "primary", "logical" ou "extended"
+.TP
+.\" .B mkpartfs \fIpart-type\fP \fIfs-type\fP \fIstart\fP \fIend\fP
+.\" make a \fIpart-type\fP partition with filesystem \fIfs-type\fP beginning at
+.\" \fIstart\fP and ending at \fIend\fP (in megabytes)
+.\" .TP
+.B mkpartfs \fIpart-type\fP \fIfs-type\fP \fIstart\fP \fIend\fP
+cria a partio \fIpart-type\fP com o sistema de arquivos \fIfs-type\fP
+com incio em \fIstart\fP e fim em \fIend\fP (em megabytes).
+.TP
+.\" .B move \fIpartition\fP \fIstart\fP \fIend\fP
+.\" move \fIpartition\fP to start at \fIstart\fP and end at \fIend\fP. Note: move
+.\" never changes the minor number
+.\" .TP
+.B move \fIpartition\fP \fIstart\fP \fIend\fP
+move \fIpartition\fP para iniciar em \fIstart\fP e terminar em \fIend\fP. Nota:
+mover nunca muda o minor number
+.TP
+.\" .B name \fIpartition\fP \fIname\fP
+.\" set the name of \fIpartition\fP to \fIname\fP. This option works only on Mac
+.\" and PC98 disklabels. The name can be placed in quotes, if necessary
+.\" .TP
+.B name \fIpartition\fP \fIname\fP
+configura o nome da \fIpartition\fP para \fIname\fP. Esta opo funciona
+somente em disklabels Mac e PC98. O nome pode ser colocado entre aspas, se
+necessrio
+.TP
+.\" .B print
+.\" displays the partition table
+.\" .TP
+.B print
+exibe a tabela de parties
+.TP
+.\" .B quit
+.\" exits parted
+.\" .TP
+.B quit
+sai do parted
+.TP
+.\" .B resize \fIpartition\fP \fIstart\fP \fIend\fP
+.\" resize the filesystem on \fIpartition\fP to start at \fIstart\fP and end at
+.\" \fIend\fP megabytes
+.\" .TP
+.B resize \fIpartition\fP \fIstart\fP \fIend\fP
+redimensiona o sistema de arquivos da \fIpartition\fP com incio em \fIstart\fP
+e fim em \fIend\fP megabytes
+.TP
+.\" .B rm \fIpartition\fP
+.\" deletes \fIpartition\fP
+.\" .TP
+.B rm \fIpartition\fP
+apaga \fIpartition\fP
+.TP
+.\" .B select \fIdevice\fP
+.\" choose \fIdevice\fP as the current device to edit. \fIdevice\fP should usually
+.\" be a Linux hard disk device, but it can be a partition, software raid device or
+.\" a LVM logical volume if that is necessary
+.\" .TP
+.B select \fIdevice\fP
+seleciona \fIdevice\fP para editar como o dispositivo atual. \fIdevice\fP deve
+usualmente ser um dispositivo de disco rgido do Linux, mas no pode ser uma
+partio, software de dispositivo raid ou um volume lgico LVM se isso for
+necessrio
+.TP
+
+.\" .B set \fIpartition\fP \fIflag\fP \fIstate\fP
+.\" change the state of the \fIflag\fP on \fIpartition\fP to \fIstate\fP. Flags
+.\" supported are: "boot", "root", "swap", "hidden", "raid", "lvm" and "lba".
+.\" \fIstate\fP should be either "on" or "off"
+.B set \fIpartition\fP \fIflag\fP \fIstate\fP
+muda o estado do \fIflag\fP na \fIpartition\fP para \fIstate\fP. As flags
+suportadas so "boot", "root", "swap", "hidden", "raid", "lvm" e "lba".
+\fIstate\fP deve ser "on" ou "off
+.\" .RS
+.\" .SH REPORTING BUGS
+.\" Report bugs to <bug-parted@gnu.org>
+.\" .SH SEE ALSO
+.\" .BR fdisk (8),
+.\" .BR mkfs (8),
+.\" The \fIparted\fP program is documented fully in the
+.\" .IR "GNU partitioning software"
+.\" manual available via the Info system.
+.\" .SH AUTHOR
+.\" This manual page was written by Timshel Knoll <timshel@debian.org>,
+.\" for the Debian GNU/Linux system (but may be used by others).
+.RS
+.SH PROBLEMAS
+Relate bugs para <bug-parted@gnu.org>
+.SH VEJA TAMBM
+.BR fdisk (8),
+.BR mkfs (8),
+O \fIparted\fP est completamente documentado no manual
+.IR "GNU partitioning software"
+disponvel via Info system.
+.SH AUTOR
+Esta pgina de manual foi escrita por Timshel Knoll <timshel@pobox.com>,
+para o sistema Debian GNU/Linux (mas pode ser usada por terceiros).
+.SH TRADUZIDO em 25/04/2002.
+\&\fR\&\f(CWFbio Minami <minami@brturbo.com> (traduo)\fR
diff --git a/doc/pt_BR/Makefile.am b/doc/pt_BR/Makefile.am
new file mode 100644
index 0000000..d5c994d
--- /dev/null
+++ b/doc/pt_BR/Makefile.am
@@ -0,0 +1,5 @@
+## Process this file with automake to produce Makefile.in
+
+lang=pt_BR
+
+include ../po4a.mk
diff --git a/doc/pt_BR/parted.8.pt_BR.po b/doc/pt_BR/parted.8.pt_BR.po
new file mode 100644
index 0000000..22e0505
--- /dev/null
+++ b/doc/pt_BR/parted.8.pt_BR.po
@@ -0,0 +1,442 @@
+# SOME DESCRIPTIVE TITLE
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+msgid ""
+msgstr "pt_BR utf-8\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"POT-Creation-Date: 2006-05-21 3:21-0300\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Tassia Camoes Araujo <tassia@debian-ba.org>\n"
+"Language-Team: l10n portuguese <debian-l10n-portuguese@lists.debian.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+# type: TH
+#: parted.8:1
+#, no-wrap
+msgid "PARTED"
+msgstr "PARTED"
+
+# type: TH
+#: parted.8:1
+#, no-wrap
+msgid "18 Mar, 2002"
+msgstr "18 de Março de 2002"
+
+# type: TH
+#: parted.8:1
+#, no-wrap
+msgid "parted"
+msgstr "parted"
+
+# type: TH
+#: parted.8:1
+#, no-wrap
+msgid "GNU Parted Manual"
+msgstr "Manual do GNU Parted"
+
+# type: SH
+#: parted.8:2
+#, no-wrap
+msgid "NAME"
+msgstr "NOME"
+
+# type: Plain text
+#: parted.8:4
+msgid "GNU Parted - a partition manipulation program"
+msgstr "GNU Parted - um programa para manipulação de partição"
+
+# type: SH
+#: parted.8:4
+#, no-wrap
+msgid "SYNOPSIS"
+msgstr "SINOPSE"
+
+# type: Plain text
+#: parted.8:7
+msgid "B<parted> [options] [device [command [options...]...]]"
+msgstr "B<parted> [opções] [dispositivo [comando [opções...]...]]"
+
+# type: SH
+#: parted.8:7
+#, no-wrap
+msgid "DESCRIPTION"
+msgstr "DESCRIÇÃO"
+
+# type: Plain text
+#: parted.8:12
+msgid ""
+"This manual page documents briefly the B<parted> command. Complete "
+"documentation is distributed with the package in GNU Info format; see below."
+msgstr ""
+"Esta página de manual documenta brevemente o comando B<parted>. "
+"Documentação completa é distribuída com o pacote no formato GNU Info; veja "
+"abaixo."
+
+# type: Plain text
+#: parted.8:19
+msgid ""
+"B<parted> is a disk partitioning and partition resizing program. It allows "
+"you to create, destroy, resize, move and copy ext2, ext3, linux-swap, FAT, "
+"FAT32, and reiserfs partitions. It can create, resize and move Macintosh "
+"HFS partitions, as well as detect jfs, ntfs, ufs, and xfs partitions. It is "
+"useful for creating space for new operating systems, reorganising disk "
+"usage, and copying data to new hard disks."
+msgstr ""
+"B<parted> é um programa de particionamento de disco e redimensionamento de "
+"partição. Ele permite que você crie, destrua, redimensione, mova e copie "
+"partições ext2, ext3, linux-swap, FAT, FAT32 e reiserfs. Ele pode criar, "
+"redimensionar e mover partições Macintosh HFS, assim como detectar partições "
+"jfs, ntfs, ufs e xfs. Ele é útil para criar espaço para novos sistemas "
+"operacionais, reorganizar utilização de disco e copiar dados para novos "
+"discos rígidos."
+
+# type: SH
+#: parted.8:19
+#, no-wrap
+msgid "OPTIONS"
+msgstr "OPÇÕES"
+
+# type: TP
+#: parted.8:20
+#, no-wrap
+msgid "B<-h, --help>"
+msgstr "B<-h, --help>"
+
+# type: Plain text
+#: parted.8:23
+msgid "displays a help message."
+msgstr "mostra uma mensagem de ajuda."
+
+# type: TP
+#: parted.8:23
+#, no-wrap
+msgid "B<-i, --interactive>"
+msgstr "B<-i, --interactive>"
+
+# type: Plain text
+#: parted.8:26
+msgid "where necessary, prompts for user intervention."
+msgstr "onde necessário, pede intervenção do usuário."
+
+# type: TP
+#: parted.8:26
+#, no-wrap
+msgid "B<-s, --script>"
+msgstr "B<-s, --script>"
+
+# type: Plain text
+#: parted.8:29
+msgid "never prompts for user intervention."
+msgstr "nunca pede intervenção do usuário."
+
+# type: TP
+#: parted.8:29
+#, no-wrap
+msgid "B<-v, --version>"
+msgstr "B<-v, --version>"
+
+# type: Plain text
+#: parted.8:32
+msgid "displays the version."
+msgstr "mostra a versão."
+
+# type: SH
+#: parted.8:32
+#, no-wrap
+msgid "COMMANDS"
+msgstr "COMANDOS"
+
+# type: TP
+#: parted.8:33
+#, no-wrap
+msgid "B<[device]>"
+msgstr "B<[dispositivo]>"
+
+# type: Plain text
+#: parted.8:36
+msgid "The block device to partition."
+msgstr "O dispositivo a ser particionado."
+
+# type: TP
+#: parted.8:36
+#, no-wrap
+msgid "B<[command [options]]>"
+msgstr "B<[comando [opções]]>"
+
+# type: Plain text
+#: parted.8:40
+msgid ""
+"Specifies a command to parted. If no command is given, parted will give you "
+"a command prompt. Commands are:"
+msgstr ""
+"Especifica um comando para o parted. Se nenhum comando for dado, o parted "
+"apresentará um pedido de comando. Os comandos são:"
+
+# type: TP
+#: parted.8:41
+#, no-wrap
+msgid "B<check >I<partition>"
+msgstr "B<check >I<partição>"
+
+# type: Plain text
+#: parted.8:44
+msgid "does a simple check on I<partition>."
+msgstr "faz uma checagem simples em I<partição>."
+
+# type: TP
+#: parted.8:44
+#, no-wrap
+msgid "B<cp >I<[source-device]>B< >I<source>B< >I<dest>"
+msgstr "B<cp >I<[dispositivo-origem]>B< >I<origem>B< >I<destino>"
+
+# type: Plain text
+#: parted.8:49
+msgid ""
+"copies the I<source> partition's filesystem on I<source-device> (or the "
+"current device if no other device was specified) to the I<dest> partition on "
+"the current device."
+msgstr ""
+"copia o sistema de arquivos da partição I<origem> do dispositivo "
+"I<dispositivo-origem> (ou o dispositivo atual caso nenhum dispositivo tenha "
+"sido especificado) para a partição I<destino> no dispositivo atual."
+
+# type: TP
+#: parted.8:49
+#, no-wrap
+msgid "B<help >I<[command]>"
+msgstr "B<help >I<[comando]>"
+
+# type: Plain text
+#: parted.8:52
+msgid "prints general help, or help on I<command> if specified."
+msgstr "imprime ajuda geral ou sobre I<comando>, caso especificado."
+
+# type: TP
+#: parted.8:52
+#, no-wrap
+msgid "B<mkfs >I<partition>B< >I<fs-type>"
+msgstr "B<mkfs >I<partição>B< >I<tipo-sistema-arquivos>"
+
+# type: Plain text
+#: parted.8:56
+msgid ""
+"make a filesystem I<fs-type> on I<partition>. I<fs-type> can be one of "
+"\"fat16\", \"fat32\", \"ext2\", \"linux-swap\" or \"reiserfs\"."
+msgstr ""
+"faz um sistema de arquivos I<tipo-sistema-arquivos> em I<partição>. "
+"I<tipo-sistema-arquivos> pode ser um dos \"fat16\", \"fat32\", \"ext2\", "
+"\"linux-swap\" ou \"reiserfs\"."
+
+# type: TP
+#: parted.8:56
+#, no-wrap
+msgid "B<mklabel >I<label-type>"
+msgstr "B<mklabel >I<tipo-marca>"
+
+# type: Plain text
+#: parted.8:61
+msgid ""
+"Creates a new disklabel (partition table) of I<label-type>. I<label-type> "
+"should be one of \"bsd\", \"dvh\", \"gpt\", \"loop\", \"mac\", \"msdos\", "
+"\"pc98\" or \"sun\"."
+msgstr ""
+"Cria uma nova marca de disco (tabela de partição) do tipo I<tipo-marca>. "
+"I<tipo-marca> pode ser um dos \"bsd\", \"dvh\", \"gpt\", \"loop\", \"mac\", "
+"\"msdos\", \"pc98\" ou \"sun\"."
+
+# type: TP
+#: parted.8:61
+#, no-wrap
+msgid "B<mkpart >I<part-type>B< >I<[fs-type]>B< >I<start>B< >I<end>"
+msgstr "B<mkpart >I<tipo-partição>B< >I<[tipo-sistema-arquivos]>B< >I<começo>B< >I<fim>"
+
+# type: Plain text
+#: parted.8:68
+msgid ""
+"make a I<part-type> partition with filesystem I<fs-type> (if specified), "
+"beginning at I<start> and ending at I<end> (in megabytes). I<fs-type> can "
+"be one of \"fat16\", \"fat32\", \"ext2\", \"HFS\", \"linux-swap\", \"NTFS\", "
+"\"reiserfs\" or \"ufs\". I<part-type> should be one of \"primary\", "
+"\"logical\" or \"extended\""
+msgstr ""
+"faz uma partição I<tipo-partição> com o sistema de arquivos "
+"I<tipo-sistema-arquivos> (se especificado), começando em I<começo> e "
+"terminando em I<fim> (em megabytes). I<tipo-sistema-arquivos> pode ser um "
+"dos \"fat16\", \"fat32\", \"ext2\", \"HFS\", \"linux-swap\", \"NTFS\", "
+"\"reiserfs\" ou \"ufs\". I<tipo-partição> deve ser um dos \"primary\", "
+"\"logical\" ou \"extended\""
+
+# type: TP
+#: parted.8:68
+#, no-wrap
+msgid "B<mkpartfs >I<part-type>B< >I<fs-type>B< >I<start>B< >I<end>"
+msgstr "B<mkpartfs >I<tipo-partição>B< >I<tipo-sistema-arquivos>B< >I<começo>B< >I<fim>"
+
+# type: Plain text
+#: parted.8:72
+msgid ""
+"make a I<part-type> partition with filesystem I<fs-type> beginning at "
+"I<start> and ending at I<end> (in megabytes)"
+msgstr ""
+"faz uma partição I<tipo-partição> com sistema de arquivos "
+"I<tipo-sistema-arquivos> começando em I<começo> e terminando em I<end> (em "
+"megabytes)"
+
+# type: TP
+#: parted.8:72
+#, no-wrap
+msgid "B<move >I<partition>B< >I<start>B< >I<end>"
+msgstr "B<move >I<partição>B< >I<começo>B< >I<fim>"
+
+# type: Plain text
+#: parted.8:76
+msgid ""
+"move I<partition> to start at I<start> and end at I<end>. Note: move never "
+"changes the minor number"
+msgstr ""
+"move I<partição> para começar em I<começo> e terminar em I<fim>. Nota: move "
+"nunca altera o menor número"
+
+# type: TP
+#: parted.8:76
+#, no-wrap
+msgid "B<name >I<partition>B< >I<name>"
+msgstr "B<name >I<partição>B< >I<nome>"
+
+# type: Plain text
+#: parted.8:80
+msgid ""
+"set the name of I<partition> to I<name>. This option works only on Mac and "
+"PC98 disklabels. The name can be placed in quotes, if necessary"
+msgstr ""
+"estabelece o nome de I<partição> como I<nome>. Esta opção funciona apenas em "
+"tabelas de partição de Mac e PC98. O nome pode ser colocado entre aspas, se "
+"necessário"
+
+# type: TP
+#: parted.8:80
+#, no-wrap
+msgid "B<print>"
+msgstr "B<print>"
+
+# type: Plain text
+#: parted.8:83
+msgid "displays the partition table"
+msgstr "mostra a tabela de partição"
+
+# type: TP
+#: parted.8:83
+#, no-wrap
+msgid "B<quit>"
+msgstr "B<quit>"
+
+# type: Plain text
+#: parted.8:86
+msgid "exits parted"
+msgstr "sai do parted"
+
+# type: TP
+#: parted.8:86
+#, no-wrap
+msgid "B<resize >I<partition>B< >I<start>B< >I<end>"
+msgstr "B<resize >I<partição>B< >I<começo>B< >I<fim>"
+
+# type: Plain text
+#: parted.8:90
+msgid ""
+"resize the filesystem on I<partition> to start at I<start> and end at I<end> "
+"megabytes"
+msgstr ""
+"redimensiona o sistema de arquivos em I<partição> para começar em I<começo> "
+"e terminar em I<fim> megabytes"
+
+# type: TP
+#: parted.8:90
+#, no-wrap
+msgid "B<rm >I<partition>"
+msgstr "B<rm >I<partição>"
+
+# type: Plain text
+#: parted.8:93
+msgid "deletes I<partition>"
+msgstr "deletes I<partição>"
+
+# type: TP
+#: parted.8:93
+#, no-wrap
+msgid "B<select >I<device>"
+msgstr "B<select >I<dispositivo>"
+
+# type: Plain text
+#: parted.8:98
+msgid ""
+"choose I<device> as the current device to edit. I<device> should usually be "
+"a Linux hard disk device, but it can be a partition, software raid device or "
+"a LVM logical volume if that is necessary"
+msgstr ""
+"escolhe I<dispositivo> como o atual dispositivo para edição. Normalmente "
+"I<dispositivo> deveria ser um dispositivo de disco rígido Linux, mas pode "
+"ser uma partição, dispositivo raid ou um volume lógico LVM se for "
+"necessário"
+
+# type: TP
+#: parted.8:98
+#, no-wrap
+msgid "B<set >I<partition>B< >I<flag>B< >I<state>"
+msgstr "B<set >I<partição>B< >I<sinal>B< >I<estado>"
+
+# type: Plain text
+#: parted.8:104
+msgid ""
+"change the state of the I<flag> on I<partition> to I<state>. Flags supported "
+"are: \"boot\", \"root\", \"swap\", \"hidden\", \"raid\", \"lvm\", \"lba\" "
+"and \"palo\". I<state> should be either \"on\" or \"off\""
+msgstr ""
+"muda o estado do I<sinal> em I<partição> para I<estado>. Sinais suportados "
+"são: \"boot\", \"root\", \"swap\", \"hidden\", \"raid\", \"lvm\", \"lba\" "
+"e \"palo\". I<estado> deve ser \"on\" ou \"off\""
+
+# type: SH
+#: parted.8:105
+#, no-wrap
+msgid "REPORTING BUGS"
+msgstr "REPORTANDO ERROS"
+
+# type: Plain text
+#: parted.8:107
+msgid "Report bugs to E<lt>bug-parted@gnu.orgE<gt>"
+msgstr "Reporte erros para E<lt>bug-parted@gnu.orgE<gt>"
+
+# type: SH
+#: parted.8:107
+#, no-wrap
+msgid "SEE ALSO"
+msgstr "VEJA TAMBÉM"
+
+# type: Plain text
+#: parted.8:115
+msgid ""
+"B<fdisk>(8), B<mkfs>(8), The I<parted> program is fully documented in the "
+"B<info(1)> format I<GNU partitioning software> manual."
+msgstr ""
+"B<fdisk>(8), B<mkfs>(8), o programa I<parted> é completamente documentado no "
+"manual do I<programa de particionamento GNU> no formato B<info(1)>."
+
+# type: SH
+#: parted.8:115
+#, no-wrap
+msgid "AUTHOR"
+msgstr "AUTOR"
+
+# type: Plain text
+#: parted.8:117
+msgid ""
+"This manual page was written by Timshel Knoll E<lt>timshel@debian.orgE<gt>, "
+"for the Debian GNU/Linux system (but may be used by others)."
+msgstr ""
+"Esta página de manual foi escrita por Timshel Knoll "
+"E<lt>timshel@debian.orgE<gt>, para o sistema Debian GNU/Linux (mas pode ser "
+"usada por outros)."
diff --git a/doc/pt_BR/partprobe.8.pt_BR.po b/doc/pt_BR/partprobe.8.pt_BR.po
new file mode 100644
index 0000000..ac800df
--- /dev/null
+++ b/doc/pt_BR/partprobe.8.pt_BR.po
@@ -0,0 +1,178 @@
+# SOME DESCRIPTIVE TITLE
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+msgid ""
+msgstr "pt_BR utf-8\n""
+"Project-Id-Version: PACKAGE VERSION\n"
+"POT-Creation-Date: 2006-05-21 3:27-0300\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Tassia Camoes Araujo <tassia@debian-ba.org>\n"
+"Language-Team: l10n portuguese <debian-l10n-portuguese@lists.debian.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+# type: TH
+#: partprobe.8:5
+#, no-wrap
+msgid "PARTPROBE"
+msgstr "PARTPROBE"
+
+# type: TH
+#: partprobe.8:5
+#, no-wrap
+msgid "March 18, 2002"
+msgstr "18 de Março de 2002"
+
+# type: TH
+#: partprobe.8:5
+#, no-wrap
+msgid "parted"
+msgstr "parted"
+
+# type: TH
+#: partprobe.8:5
+#, no-wrap
+msgid "GNU Parted Manual"
+msgstr "Manual do GNU Parted"
+
+#. Please adjust this date whenever revising the manpage.
+#. Some roff macros, for reference:
+#. .nh disable hyphenation
+#. .hy enable hyphenation
+#. .ad l left justify
+#. .ad b justify to both left and right margins
+#. .nf disable filling
+#. .fi enable filling
+#. .br insert line break
+#. .sp <n> insert n+1 empty lines
+#. for manpage-specific macros, see man(7)
+# type: SH
+#: partprobe.8:18
+#, no-wrap
+msgid "NAME"
+msgstr "NOME"
+
+# type: Plain text
+#: partprobe.8:20
+msgid "partprobe - inform the OS of partition table changes"
+msgstr "partprobe - informa ao sistema operacional sobre mudanças na tabela de partição"
+
+# type: SH
+#: partprobe.8:20
+#, no-wrap
+msgid "SYNOPSIS"
+msgstr "SINOPSE"
+
+# type: Plain text
+#: partprobe.8:25
+msgid "B<partprobe> [I<-d>] [I<-s>] [I<devices...>]"
+msgstr "B<partprobe> [I<-d>] [I<-s>] [I<dispositivos...>]"
+
+# type: SH
+#: partprobe.8:25
+#, no-wrap
+msgid "DESCRIPTION"
+msgstr "DESCRIÇÃO"
+
+# type: Plain text
+#: partprobe.8:29
+msgid "This manual page documents briefly the B<partprobe> command."
+msgstr "Esta página de manual documenta brevemente o comando B<partprobe>"
+
+#. TeX users may be more comfortable with the \fB<whatever>\fP and
+#. \fI<whatever>\fP escape sequences to invode bold face and italics,
+#. respectively.
+# type: Plain text
+#: partprobe.8:36
+msgid ""
+"B<partprobe> is a program that informs the operating system kernel of "
+"partition table changes, by requesting that the operating system re-read the "
+"partition table."
+msgstr ""
+"B<partprobe> é uma programa que informa ao kernel do sistema operacional sobre "
+"mudanças na tabela de partição, requisitando que o sistema operacional releia "
+"a tabela de partição."
+
+# type: SH
+#: partprobe.8:36
+#, no-wrap
+msgid "OPTIONS"
+msgstr "OPÇÕES"
+
+# type: Plain text
+#: partprobe.8:38
+msgid "This program uses short UNIX style options."
+msgstr "Este programa usa opções de estilo curtas do UNIX."
+
+# type: TP
+#: partprobe.8:38
+#, no-wrap
+msgid "B<-d>"
+msgstr "B<-d>"
+
+# type: Plain text
+#: partprobe.8:41
+msgid "Don't update the kernel."
+msgstr "Não atualiza o kernel."
+
+# type: TP
+#: partprobe.8:41
+#, no-wrap
+msgid "B<-s>"
+msgstr "B<-s>"
+
+# type: Plain text
+#: partprobe.8:44
+msgid "Show a summary of devices and their partitions."
+msgstr "Mostra um sumário dos dispositivos e suas partições."
+
+# type: TP
+#: partprobe.8:44
+#, no-wrap
+msgid "B<-h>"
+msgstr "B<-h>"
+
+# type: Plain text
+#: partprobe.8:47
+msgid "Show summary of options."
+msgstr "Mostra sumário de opções."
+
+# type: TP
+#: partprobe.8:47
+#, no-wrap
+msgid "B<-v>"
+msgstr "B<-v>"
+
+# type: Plain text
+#: partprobe.8:50
+msgid "Show version of program."
+msgstr "Mostra versão do programa."
+
+# type: SH
+#: partprobe.8:50
+#, no-wrap
+msgid "SEE ALSO"
+msgstr "VEJA TAMBÉM"
+
+# type: Plain text
+#: partprobe.8:52
+msgid "B<parted>(8)."
+msgstr "B<parted>(8)."
+
+# type: SH
+#: partprobe.8:52
+#, no-wrap
+msgid "AUTHOR"
+msgstr "AUTOR"
+
+# type: Plain text
+#: partprobe.8:54
+msgid ""
+"This manual page was written by Timshel Knoll E<lt>timshel@debian.orgE<gt>, "
+"for the Debian GNU/Linux system (but may be used by others)."
+msgstr ""
+"Esta página de manual foi escrita por Timshel Knoll "
+"E<lt>timshel@debian.orgE<gt>, para o sistema Debian GNU/Linux (mas pode ser "
+"usado por outros)."
diff --git a/doc/texinfo.tex b/doc/texinfo.tex
new file mode 100644
index 0000000..dc2fcfc
--- /dev/null
+++ b/doc/texinfo.tex
@@ -0,0 +1,6200 @@
+% texinfo.tex -- TeX macros to handle Texinfo files.
+%
+% Load plain if necessary, i.e., if running under initex.
+\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
+%
+\def\texinfoversion{2000-12-12.07}
+%
+% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
+% Free Software Foundation, Inc.
+%
+% This texinfo.tex file is free software; you can redistribute it and/or
+% modify it under the terms of the GNU General Public License as
+% published by the Free Software Foundation; either version 2, or (at
+% your option) any later version.
+%
+% This texinfo.tex file is distributed in the hope that it will be
+% useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+% General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this texinfo.tex file; see the file COPYING. If not, write
+% to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301, USA.
+%
+% In other words, you are welcome to use, share and improve this program.
+% You are forbidden to forbid anyone else to use, share and improve
+% what you give them. Help stamp out software-hoarding!
+%
+% Please try the latest version of texinfo.tex before submitting bug
+% reports; you can get the latest version from:
+% ftp://ftp.gnu.org/gnu/texinfo.tex
+% (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
+% ftp://texinfo.org/tex/texinfo.tex
+% ftp://us.ctan.org/macros/texinfo/texinfo.tex
+% (and all CTAN mirrors, finger ctan@us.ctan.org for a list).
+% /home/gd/gnu/doc/texinfo.tex on the GNU machines.
+% The texinfo.tex in any given Texinfo distribution could well be out
+% of date, so if that's what you're using, please check.
+% Texinfo has a small home page at http://texinfo.org/.
+%
+% Send bug reports to bug-texinfo@gnu.org. Please include including a
+% complete document in each bug report with which we can reproduce the
+% problem. Patches are, of course, greatly appreciated.
+%
+% To process a Texinfo manual with TeX, it's most reliable to use the
+% texi2dvi shell script that comes with the distribution. For a simple
+% manual foo.texi, however, you can get away with this:
+% tex foo.texi
+% texindex foo.??
+% tex foo.texi
+% tex foo.texi
+% dvips foo.dvi -o # or whatever, to process the dvi file; this makes foo.ps.
+% The extra runs of TeX get the cross-reference information correct.
+% Sometimes one run after texindex suffices, and sometimes you need more
+% than two; texi2dvi does it as many times as necessary.
+%
+% It is possible to adapt texinfo.tex for other languages. You can get
+% the existing language-specific files from ftp://ftp.gnu.org/gnu/texinfo/.
+
+\message{Loading texinfo [version \texinfoversion]:}
+
+% If in a .fmt file, print the version number
+% and turn on active characters that we couldn't do earlier because
+% they might have appeared in the input file name.
+\everyjob{\message{[Texinfo version \texinfoversion]}%
+ \catcode`+=\active \catcode`\_=\active}
+
+% Save some parts of plain tex whose names we will redefine.
+\let\ptexb=\b
+\let\ptexbullet=\bullet
+\let\ptexc=\c
+\let\ptexcomma=\,
+\let\ptexdot=\.
+\let\ptexdots=\dots
+\let\ptexend=\end
+\let\ptexequiv=\equiv
+\let\ptexexclam=\!
+\let\ptexi=\i
+\let\ptexlbrace=\{
+\let\ptexrbrace=\}
+\let\ptexstar=\*
+\let\ptext=\t
+
+% We never want plain's outer \+ definition in Texinfo.
+% For @tex, we can use \tabalign.
+\let\+ = \relax
+
+\message{Basics,}
+\chardef\other=12
+
+% If this character appears in an error message or help string, it
+% starts a new line in the output.
+\newlinechar = `^^J
+
+% Set up fixed words for English if not already set.
+\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
+\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
+\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
+\ifx\putwordin\undefined \gdef\putwordin{in}\fi
+\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
+\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
+\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
+\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
+\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
+\ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi
+\ifx\putwordof\undefined \gdef\putwordof{of}\fi
+\ifx\putwordon\undefined \gdef\putwordon{on}\fi
+\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
+\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
+\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
+\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
+\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
+\ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi
+\ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi
+%
+\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
+\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
+\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
+\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
+\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
+\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
+\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
+\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
+\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
+\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
+\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
+\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
+%
+\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
+\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
+\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
+\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
+\ifx\putwordDeftypevar\undefined\gdef\putwordDeftypevar{Variable}\fi
+\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
+\ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi
+
+% Ignore a token.
+%
+\def\gobble#1{}
+
+\hyphenation{ap-pen-dix}
+\hyphenation{mini-buf-fer mini-buf-fers}
+\hyphenation{eshell}
+\hyphenation{white-space}
+
+% Margin to add to right of even pages, to left of odd pages.
+\newdimen \bindingoffset
+\newdimen \normaloffset
+\newdimen\pagewidth \newdimen\pageheight
+
+% Sometimes it is convenient to have everything in the transcript file
+% and nothing on the terminal. We don't just call \tracingall here,
+% since that produces some useless output on the terminal.
+%
+\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
+\ifx\eTeXversion\undefined
+\def\loggingall{\tracingcommands2 \tracingstats2
+ \tracingpages1 \tracingoutput1 \tracinglostchars1
+ \tracingmacros2 \tracingparagraphs1 \tracingrestores1
+ \showboxbreadth\maxdimen\showboxdepth\maxdimen
+}%
+\else
+\def\loggingall{\tracingcommands3 \tracingstats2
+ \tracingpages1 \tracingoutput1 \tracinglostchars1
+ \tracingmacros2 \tracingparagraphs1 \tracingrestores1
+ \tracingscantokens1 \tracingassigns1 \tracingifs1
+ \tracinggroups1 \tracingnesting2
+ \showboxbreadth\maxdimen\showboxdepth\maxdimen
+}%
+\fi
+
+% For @cropmarks command.
+% Do @cropmarks to get crop marks.
+%
+\newif\ifcropmarks
+\let\cropmarks = \cropmarkstrue
+%
+% Dimensions to add cropmarks at corners.
+% Added by P. A. MacKay, 12 Nov. 1986
+%
+\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
+\newdimen\cornerlong \cornerlong=1pc
+\newdimen\cornerthick \cornerthick=.3pt
+\newdimen\topandbottommargin \topandbottommargin=.75in
+
+% Main output routine.
+\chardef\PAGE = 255
+\output = {\onepageout{\pagecontents\PAGE}}
+
+\newbox\headlinebox
+\newbox\footlinebox
+
+% \onepageout takes a vbox as an argument. Note that \pagecontents
+% does insertions, but you have to call it yourself.
+\def\onepageout#1{%
+ \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
+ %
+ \ifodd\pageno \advance\hoffset by \bindingoffset
+ \else \advance\hoffset by -\bindingoffset\fi
+ %
+ % Do this outside of the \shipout so @code etc. will be expanded in
+ % the headline as they should be, not taken literally (outputting ''code).
+ \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
+ \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
+ %
+ {%
+ % Have to do this stuff outside the \shipout because we want it to
+ % take effect in \write's, yet the group defined by the \vbox ends
+ % before the \shipout runs.
+ %
+ \escapechar = `\\ % use backslash in output files.
+ \indexdummies % don't expand commands in the output.
+ \normalturnoffactive % \ in index entries must not stay \, e.g., if
+ % the page break happens to be in the middle of an example.
+ \shipout\vbox{%
+ % Do this early so pdf references go to the beginning of the page.
+ \ifpdfmakepagedest \pdfmkdest{\the\pageno} \fi
+ %
+ \ifcropmarks \vbox to \outervsize\bgroup
+ \hsize = \outerhsize
+ \vskip-\topandbottommargin
+ \vtop to0pt{%
+ \line{\ewtop\hfil\ewtop}%
+ \nointerlineskip
+ \line{%
+ \vbox{\moveleft\cornerthick\nstop}%
+ \hfill
+ \vbox{\moveright\cornerthick\nstop}%
+ }%
+ \vss}%
+ \vskip\topandbottommargin
+ \line\bgroup
+ \hfil % center the page within the outer (page) hsize.
+ \ifodd\pageno\hskip\bindingoffset\fi
+ \vbox\bgroup
+ \fi
+ %
+ \unvbox\headlinebox
+ \pagebody{#1}%
+ \ifdim\ht\footlinebox > 0pt
+ % Only leave this space if the footline is nonempty.
+ % (We lessened \vsize for it in \oddfootingxxx.)
+ % The \baselineskip=24pt in plain's \makefootline has no effect.
+ \vskip 2\baselineskip
+ \unvbox\footlinebox
+ \fi
+ %
+ \ifcropmarks
+ \egroup % end of \vbox\bgroup
+ \hfil\egroup % end of (centering) \line\bgroup
+ \vskip\topandbottommargin plus1fill minus1fill
+ \boxmaxdepth = \cornerthick
+ \vbox to0pt{\vss
+ \line{%
+ \vbox{\moveleft\cornerthick\nsbot}%
+ \hfill
+ \vbox{\moveright\cornerthick\nsbot}%
+ }%
+ \nointerlineskip
+ \line{\ewbot\hfil\ewbot}%
+ }%
+ \egroup % \vbox from first cropmarks clause
+ \fi
+ }% end of \shipout\vbox
+ }% end of group with \turnoffactive
+ \advancepageno
+ \ifnum\outputpenalty>-20000 \else\dosupereject\fi
+}
+
+\newinsert\margin \dimen\margin=\maxdimen
+
+\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
+{\catcode`\@ =11
+\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
+% marginal hacks, juha@viisa.uucp (Juha Takala)
+\ifvoid\margin\else % marginal info is present
+ \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
+\dimen@=\dp#1 \unvbox#1
+\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
+\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
+}
+
+% Here are the rules for the cropmarks. Note that they are
+% offset so that the space between them is truly \outerhsize or \outervsize
+% (P. A. MacKay, 12 November, 1986)
+%
+\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
+\def\nstop{\vbox
+ {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
+\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
+\def\nsbot{\vbox
+ {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
+
+% Parse an argument, then pass it to #1. The argument is the rest of
+% the input line (except we remove a trailing comment). #1 should be a
+% macro which expects an ordinary undelimited TeX argument.
+%
+\def\parsearg#1{%
+ \let\next = #1%
+ \begingroup
+ \obeylines
+ \futurelet\temp\parseargx
+}
+
+% If the next token is an obeyed space (from an @example environment or
+% the like), remove it and recurse. Otherwise, we're done.
+\def\parseargx{%
+ % \obeyedspace is defined far below, after the definition of \sepspaces.
+ \ifx\obeyedspace\temp
+ \expandafter\parseargdiscardspace
+ \else
+ \expandafter\parseargline
+ \fi
+}
+
+% Remove a single space (as the delimiter token to the macro call).
+{\obeyspaces %
+ \gdef\parseargdiscardspace {\futurelet\temp\parseargx}}
+
+{\obeylines %
+ \gdef\parseargline#1^^M{%
+ \endgroup % End of the group started in \parsearg.
+ %
+ % First remove any @c comment, then any @comment.
+ % Result of each macro is put in \toks0.
+ \argremovec #1\c\relax %
+ \expandafter\argremovecomment \the\toks0 \comment\relax %
+ %
+ % Call the caller's macro, saved as \next in \parsearg.
+ \expandafter\next\expandafter{\the\toks0}%
+ }%
+}
+
+% Since all \c{,omment} does is throw away the argument, we can let TeX
+% do that for us. The \relax here is matched by the \relax in the call
+% in \parseargline; it could be more or less anything, its purpose is
+% just to delimit the argument to the \c.
+\def\argremovec#1\c#2\relax{\toks0 = {#1}}
+\def\argremovecomment#1\comment#2\relax{\toks0 = {#1}}
+
+% \argremovec{,omment} might leave us with trailing spaces, though; e.g.,
+% @end itemize @c foo
+% will have two active spaces as part of the argument with the
+% `itemize'. Here we remove all active spaces from #1, and assign the
+% result to \toks0.
+%
+% This loses if there are any *other* active characters besides spaces
+% in the argument -- _ ^ +, for example -- since they get expanded.
+% Fortunately, Texinfo does not define any such commands. (If it ever
+% does, the catcode of the characters in questionwill have to be changed
+% here.) But this means we cannot call \removeactivespaces as part of
+% \argremovec{,omment}, since @c uses \parsearg, and thus the argument
+% that \parsearg gets might well have any character at all in it.
+%
+\def\removeactivespaces#1{%
+ \begingroup
+ \ignoreactivespaces
+ \edef\temp{#1}%
+ \global\toks0 = \expandafter{\temp}%
+ \endgroup
+}
+
+% Change the active space to expand to nothing.
+%
+\begingroup
+ \obeyspaces
+ \gdef\ignoreactivespaces{\obeyspaces\let =\empty}
+\endgroup
+
+
+\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
+
+%% These are used to keep @begin/@end levels from running away
+%% Call \inENV within environments (after a \begingroup)
+\newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
+\def\ENVcheck{%
+\ifENV\errmessage{Still within an environment; press RETURN to continue}
+\endgroup\fi} % This is not perfect, but it should reduce lossage
+
+% @begin foo is the same as @foo, for now.
+\newhelp\EMsimple{Press RETURN to continue.}
+
+\outer\def\begin{\parsearg\beginxxx}
+
+\def\beginxxx #1{%
+\expandafter\ifx\csname #1\endcsname\relax
+{\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else
+\csname #1\endcsname\fi}
+
+% @end foo executes the definition of \Efoo.
+%
+\def\end{\parsearg\endxxx}
+\def\endxxx #1{%
+ \removeactivespaces{#1}%
+ \edef\endthing{\the\toks0}%
+ %
+ \expandafter\ifx\csname E\endthing\endcsname\relax
+ \expandafter\ifx\csname \endthing\endcsname\relax
+ % There's no \foo, i.e., no ``environment'' foo.
+ \errhelp = \EMsimple
+ \errmessage{Undefined command `@end \endthing'}%
+ \else
+ \unmatchedenderror\endthing
+ \fi
+ \else
+ % Everything's ok; the right environment has been started.
+ \csname E\endthing\endcsname
+ \fi
+}
+
+% There is an environment #1, but it hasn't been started. Give an error.
+%
+\def\unmatchedenderror#1{%
+ \errhelp = \EMsimple
+ \errmessage{This `@end #1' doesn't have a matching `@#1'}%
+}
+
+% Define the control sequence \E#1 to give an unmatched @end error.
+%
+\def\defineunmatchedend#1{%
+ \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}%
+}
+
+
+% Single-spacing is done by various environments (specifically, in
+% \nonfillstart and \quotations).
+\newskip\singlespaceskip \singlespaceskip = 12.5pt
+\def\singlespace{%
+ % Why was this kern here? It messes up equalizing space above and below
+ % environments. --karl, 6may93
+ %{\advance \baselineskip by -\singlespaceskip
+ %\kern \baselineskip}%
+ \setleading \singlespaceskip
+}
+
+%% Simple single-character @ commands
+
+% @@ prints an @
+% Kludge this until the fonts are right (grr).
+\def\@{{\tt\char64}}
+
+% This is turned off because it was never documented
+% and you can use @w{...} around a quote to suppress ligatures.
+%% Define @` and @' to be the same as ` and '
+%% but suppressing ligatures.
+%\def\`{{`}}
+%\def\'{{'}}
+
+% Used to generate quoted braces.
+\def\mylbrace {{\tt\char123}}
+\def\myrbrace {{\tt\char125}}
+\let\{=\mylbrace
+\let\}=\myrbrace
+\begingroup
+ % Definitions to produce actual \{ & \} command in an index.
+ \catcode`\{ = 12 \catcode`\} = 12
+ \catcode`\[ = 1 \catcode`\] = 2
+ \catcode`\@ = 0 \catcode`\\ = 12
+ @gdef@lbracecmd[\{]%
+ @gdef@rbracecmd[\}]%
+@endgroup
+
+% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
+% Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H.
+\let\, = \c
+\let\dotaccent = \.
+\def\ringaccent#1{{\accent23 #1}}
+\let\tieaccent = \t
+\let\ubaraccent = \b
+\let\udotaccent = \d
+
+% Other special characters: @questiondown @exclamdown
+% Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss.
+\def\questiondown{?`}
+\def\exclamdown{!`}
+
+% Dotless i and dotless j, used for accents.
+\def\imacro{i}
+\def\jmacro{j}
+\def\dotless#1{%
+ \def\temp{#1}%
+ \ifx\temp\imacro \ptexi
+ \else\ifx\temp\jmacro \j
+ \else \errmessage{@dotless can be used only with i or j}%
+ \fi\fi
+}
+
+% Be sure we're in horizontal mode when doing a tie, since we make space
+% equivalent to this in @example-like environments. Otherwise, a space
+% at the beginning of a line will start with \penalty -- and
+% since \penalty is valid in vertical mode, we'd end up putting the
+% penalty on the vertical list instead of in the new paragraph.
+{\catcode`@ = 11
+ % Avoid using \@M directly, because that causes trouble
+ % if the definition is written into an index file.
+ \global\let\tiepenalty = \@M
+ \gdef\tie{\leavevmode\penalty\tiepenalty\ }
+}
+
+% @: forces normal size whitespace following.
+\def\:{\spacefactor=1000 }
+
+% @* forces a line break.
+\def\*{\hfil\break\hbox{}\ignorespaces}
+
+% @. is an end-of-sentence period.
+\def\.{.\spacefactor=3000 }
+
+% @! is an end-of-sentence bang.
+\def\!{!\spacefactor=3000 }
+
+% @? is an end-of-sentence query.
+\def\?{?\spacefactor=3000 }
+
+% @w prevents a word break. Without the \leavevmode, @w at the
+% beginning of a paragraph, when TeX is still in vertical mode, would
+% produce a whole line of output instead of starting the paragraph.
+\def\w#1{\leavevmode\hbox{#1}}
+
+% @group ... @end group forces ... to be all on one page, by enclosing
+% it in a TeX vbox. We use \vtop instead of \vbox to construct the box
+% to keep its height that of a normal line. According to the rules for
+% \topskip (p.114 of the TeXbook), the glue inserted is
+% max (\topskip - \ht (first item), 0). If that height is large,
+% therefore, no glue is inserted, and the space between the headline and
+% the text is small, which looks bad.
+%
+\def\group{\begingroup
+ \ifnum\catcode13=\active \else
+ \errhelp = \groupinvalidhelp
+ \errmessage{@group invalid in context where filling is enabled}%
+ \fi
+ %
+ % The \vtop we start below produces a box with normal height and large
+ % depth; thus, TeX puts \baselineskip glue before it, and (when the
+ % next line of text is done) \lineskip glue after it. (See p.82 of
+ % the TeXbook.) Thus, space below is not quite equal to space
+ % above. But it's pretty close.
+ \def\Egroup{%
+ \egroup % End the \vtop.
+ \endgroup % End the \group.
+ }%
+ %
+ \vtop\bgroup
+ % We have to put a strut on the last line in case the @group is in
+ % the midst of an example, rather than completely enclosing it.
+ % Otherwise, the interline space between the last line of the group
+ % and the first line afterwards is too small. But we can't put the
+ % strut in \Egroup, since there it would be on a line by itself.
+ % Hence this just inserts a strut at the beginning of each line.
+ \everypar = {\strut}%
+ %
+ % Since we have a strut on every line, we don't need any of TeX's
+ % normal interline spacing.
+ \offinterlineskip
+ %
+ % OK, but now we have to do something about blank
+ % lines in the input in @example-like environments, which normally
+ % just turn into \lisppar, which will insert no space now that we've
+ % turned off the interline space. Simplest is to make them be an
+ % empty paragraph.
+ \ifx\par\lisppar
+ \edef\par{\leavevmode \par}%
+ %
+ % Reset ^^M's definition to new definition of \par.
+ \obeylines
+ \fi
+ %
+ % Do @comment since we are called inside an environment such as
+ % @example, where each end-of-line in the input causes an
+ % end-of-line in the output. We don't want the end-of-line after
+ % the `@group' to put extra space in the output. Since @group
+ % should appear on a line by itself (according to the Texinfo
+ % manual), we don't worry about eating any user text.
+ \comment
+}
+%
+% TeX puts in an \escapechar (i.e., `@') at the beginning of the help
+% message, so this ends up printing `@group can only ...'.
+%
+\newhelp\groupinvalidhelp{%
+group can only be used in environments such as @example,^^J%
+where each line of input produces a line of output.}
+
+% @need space-in-mils
+% forces a page break if there is not space-in-mils remaining.
+
+\newdimen\mil \mil=0.001in
+
+\def\need{\parsearg\needx}
+
+% Old definition--didn't work.
+%\def\needx #1{\par %
+%% This method tries to make TeX break the page naturally
+%% if the depth of the box does not fit.
+%{\baselineskip=0pt%
+%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
+%\prevdepth=-1000pt
+%}}
+
+\def\needx#1{%
+ % Ensure vertical mode, so we don't make a big box in the middle of a
+ % paragraph.
+ \par
+ %
+ % If the @need value is less than one line space, it's useless.
+ \dimen0 = #1\mil
+ \dimen2 = \ht\strutbox
+ \advance\dimen2 by \dp\strutbox
+ \ifdim\dimen0 > \dimen2
+ %
+ % Do a \strut just to make the height of this box be normal, so the
+ % normal leading is inserted relative to the preceding line.
+ % And a page break here is fine.
+ \vtop to #1\mil{\strut\vfil}%
+ %
+ % TeX does not even consider page breaks if a penalty added to the
+ % main vertical list is 10000 or more. But in order to see if the
+ % empty box we just added fits on the page, we must make it consider
+ % page breaks. On the other hand, we don't want to actually break the
+ % page after the empty box. So we use a penalty of 9999.
+ %
+ % There is an extremely small chance that TeX will actually break the
+ % page at this \penalty, if there are no other feasible breakpoints in
+ % sight. (If the user is using lots of big @group commands, which
+ % almost-but-not-quite fill up a page, TeX will have a hard time doing
+ % good page breaking, for example.) However, I could not construct an
+ % example where a page broke at this \penalty; if it happens in a real
+ % document, then we can reconsider our strategy.
+ \penalty9999
+ %
+ % Back up by the size of the box, whether we did a page break or not.
+ \kern -#1\mil
+ %
+ % Do not allow a page break right after this kern.
+ \nobreak
+ \fi
+}
+
+% @br forces paragraph break
+
+\let\br = \par
+
+% @dots{} output an ellipsis using the current font.
+% We do .5em per period so that it has the same spacing in a typewriter
+% font as three actual period characters.
+%
+\def\dots{%
+ \leavevmode
+ \hbox to 1.5em{%
+ \hskip 0pt plus 0.25fil minus 0.25fil
+ .\hss.\hss.%
+ \hskip 0pt plus 0.5fil minus 0.5fil
+ }%
+}
+
+% @enddots{} is an end-of-sentence ellipsis.
+%
+\def\enddots{%
+ \leavevmode
+ \hbox to 2em{%
+ \hskip 0pt plus 0.25fil minus 0.25fil
+ .\hss.\hss.\hss.%
+ \hskip 0pt plus 0.5fil minus 0.5fil
+ }%
+ \spacefactor=3000
+}
+
+
+% @page forces the start of a new page
+%
+\def\page{\par\vfill\supereject}
+
+% @exdent text....
+% outputs text on separate line in roman font, starting at standard page margin
+
+% This records the amount of indent in the innermost environment.
+% That's how much \exdent should take out.
+\newskip\exdentamount
+
+% This defn is used inside fill environments such as @defun.
+\def\exdent{\parsearg\exdentyyy}
+\def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}}
+
+% This defn is used inside nofill environments such as @example.
+\def\nofillexdent{\parsearg\nofillexdentyyy}
+\def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount
+\leftline{\hskip\leftskip{\rm#1}}}}
+
+% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
+% paragraph. For more general purposes, use the \margin insertion
+% class. WHICH is `l' or `r'.
+%
+\newskip\inmarginspacing \inmarginspacing=1cm
+\def\strutdepth{\dp\strutbox}
+%
+\def\doinmargin#1#2{\strut\vadjust{%
+ \nobreak
+ \kern-\strutdepth
+ \vtop to \strutdepth{%
+ \baselineskip=\strutdepth
+ \vss
+ % if you have multiple lines of stuff to put here, you'll need to
+ % make the vbox yourself of the appropriate size.
+ \ifx#1l%
+ \llap{\ignorespaces #2\hskip\inmarginspacing}%
+ \else
+ \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
+ \fi
+ \null
+ }%
+}}
+\def\inleftmargin{\doinmargin l}
+\def\inrightmargin{\doinmargin r}
+%
+% @inmargin{TEXT [, RIGHT-TEXT]}
+% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
+% else use TEXT for both).
+%
+\def\inmargin#1{\parseinmargin #1,,\finish}
+\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0 > 0pt
+ \def\lefttext{#1}% have both texts
+ \def\righttext{#2}%
+ \else
+ \def\lefttext{#1}% have only one text
+ \def\righttext{#1}%
+ \fi
+ %
+ \ifodd\pageno
+ \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
+ \else
+ \def\temp{\inleftmargin\lefttext}%
+ \fi
+ \temp
+}
+
+% @include file insert text of that file as input.
+% Allow normal characters that we make active in the argument (a file name).
+\def\include{\begingroup
+ \catcode`\\=12
+ \catcode`~=12
+ \catcode`^=12
+ \catcode`_=12
+ \catcode`|=12
+ \catcode`<=12
+ \catcode`>=12
+ \catcode`+=12
+ \parsearg\includezzz}
+% Restore active chars for included file.
+\def\includezzz#1{\endgroup\begingroup
+ % Read the included file in a group so nested @include's work.
+ \def\thisfile{#1}%
+ \input\thisfile
+\endgroup}
+
+\def\thisfile{}
+
+% @center line outputs that line, centered
+
+\def\center{\parsearg\centerzzz}
+\def\centerzzz #1{{\advance\hsize by -\leftskip
+\advance\hsize by -\rightskip
+\centerline{#1}}}
+
+% @sp n outputs n lines of vertical space
+
+\def\sp{\parsearg\spxxx}
+\def\spxxx #1{\vskip #1\baselineskip}
+
+% @comment ...line which is ignored...
+% @c is the same as @comment
+% @ignore ... @end ignore is another way to write a comment
+
+\def\comment{\begingroup \catcode`\^^M=\other%
+\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
+\commentxxx}
+{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
+
+\let\c=\comment
+
+% @paragraphindent NCHARS
+% We'll use ems for NCHARS, close enough.
+% We cannot implement @paragraphindent asis, though.
+%
+\def\asisword{asis} % no translation, these are keywords
+\def\noneword{none}
+%
+\def\paragraphindent{\parsearg\doparagraphindent}
+\def\doparagraphindent#1{%
+ \def\temp{#1}%
+ \ifx\temp\asisword
+ \else
+ \ifx\temp\noneword
+ \defaultparindent = 0pt
+ \else
+ \defaultparindent = #1em
+ \fi
+ \fi
+ \parindent = \defaultparindent
+}
+
+% @exampleindent NCHARS
+% We'll use ems for NCHARS like @paragraphindent.
+% It seems @exampleindent asis isn't necessary, but
+% I preserve it to make it similar to @paragraphindent.
+\def\exampleindent{\parsearg\doexampleindent}
+\def\doexampleindent#1{%
+ \def\temp{#1}%
+ \ifx\temp\asisword
+ \else
+ \ifx\temp\noneword
+ \lispnarrowing = 0pt
+ \else
+ \lispnarrowing = #1em
+ \fi
+ \fi
+}
+
+% @asis just yields its argument. Used with @table, for example.
+%
+\def\asis#1{#1}
+
+% @math means output in math mode.
+% We don't use $'s directly in the definition of \math because control
+% sequences like \math are expanded when the toc file is written. Then,
+% we read the toc file back, the $'s will be normal characters (as they
+% should be, according to the definition of Texinfo). So we must use a
+% control sequence to switch into and out of math mode.
+%
+% This isn't quite enough for @math to work properly in indices, but it
+% seems unlikely it will ever be needed there.
+%
+\let\implicitmath = $
+\def\math#1{\implicitmath #1\implicitmath}
+
+% @bullet and @minus need the same treatment as @math, just above.
+\def\bullet{\implicitmath\ptexbullet\implicitmath}
+\def\minus{\implicitmath-\implicitmath}
+
+% @refill is a no-op.
+\let\refill=\relax
+
+% If working on a large document in chapters, it is convenient to
+% be able to disable indexing, cross-referencing, and contents, for test runs.
+% This is done with @novalidate (before @setfilename).
+%
+\newif\iflinks \linkstrue % by default we want the aux files.
+\let\novalidate = \linksfalse
+
+% @setfilename is done at the beginning of every texinfo file.
+% So open here the files we need to have open while reading the input.
+% This makes it possible to make a .fmt file for texinfo.
+\def\setfilename{%
+ \iflinks
+ \readauxfile
+ \fi % \openindices needs to do some work in any case.
+ \openindices
+ \fixbackslash % Turn off hack to swallow `\input texinfo'.
+ \global\let\setfilename=\comment % Ignore extra @setfilename cmds.
+ %
+ % If texinfo.cnf is present on the system, read it.
+ % Useful for site-wide @afourpaper, etc.
+ % Just to be on the safe side, close the input stream before the \input.
+ \openin 1 texinfo.cnf
+ \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi
+ \closein1
+ \temp
+ %
+ \comment % Ignore the actual filename.
+}
+
+% Called from \setfilename.
+%
+\def\openindices{%
+ \newindex{cp}%
+ \newcodeindex{fn}%
+ \newcodeindex{vr}%
+ \newcodeindex{tp}%
+ \newcodeindex{ky}%
+ \newcodeindex{pg}%
+}
+
+% @bye.
+\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
+
+
+\message{pdf,}
+% adobe `portable' document format
+\newcount\tempnum
+\newcount\lnkcount
+\newtoks\filename
+\newcount\filenamelength
+\newcount\pgn
+\newtoks\toksA
+\newtoks\toksB
+\newtoks\toksC
+\newtoks\toksD
+\newbox\boxA
+\newcount\countA
+\newif\ifpdf
+\newif\ifpdfmakepagedest
+
+\ifx\pdfoutput\undefined
+ \pdffalse
+ \let\pdfmkdest = \gobble
+ \let\pdfurl = \gobble
+ \let\endlink = \relax
+ \let\linkcolor = \relax
+ \let\pdfmakeoutlines = \relax
+\else
+ \pdftrue
+ \pdfoutput = 1
+ \input pdfcolor
+ \def\dopdfimage#1#2#3{%
+ \def\imagewidth{#2}%
+ \def\imageheight{#3}%
+ \ifnum\pdftexversion < 14
+ \pdfimage
+ \else
+ \pdfximage
+ \fi
+ \ifx\empty\imagewidth\else width \imagewidth \fi
+ \ifx\empty\imageheight\else height \imageheight \fi
+ {#1.pdf}%
+ \ifnum\pdftexversion < 14 \else
+ \pdfrefximage \pdflastximage
+ \fi}
+ \def\pdfmkdest#1{\pdfdest name{#1@} xyz}
+ \def\pdfmkpgn#1{#1@}
+ \let\linkcolor = \Blue % was Cyan, but that seems light?
+ \def\endlink{\Black\pdfendlink}
+ % Adding outlines to PDF; macros for calculating structure of outlines
+ % come from Petr Olsak
+ \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
+ \else \csname#1\endcsname \fi}
+ \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
+ \advance\tempnum by1
+ \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
+ \def\pdfmakeoutlines{{%
+ \openin 1 \jobname.toc
+ \ifeof 1\else\bgroup
+ \closein 1
+ \indexnofonts
+ \def\tt{}
+ \let\_ = \normalunderscore
+ % Thanh's hack / proper braces in bookmarks
+ \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
+ \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
+ %
+ \def\chapentry ##1##2##3{}
+ \def\unnumbchapentry ##1##2{}
+ \def\secentry ##1##2##3##4{\advancenumber{chap##2}}
+ \def\unnumbsecentry ##1##2{}
+ \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}}
+ \def\unnumbsubsecentry ##1##2{}
+ \def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}}
+ \def\unnumbsubsubsecentry ##1##2{}
+ \input \jobname.toc
+ \def\chapentry ##1##2##3{%
+ \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}}
+ \def\unnumbchapentry ##1##2{%
+ \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
+ \def\secentry ##1##2##3##4{%
+ \pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}}
+ \def\unnumbsecentry ##1##2{%
+ \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
+ \def\subsecentry ##1##2##3##4##5{%
+ \pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}}
+ \def\unnumbsubsecentry ##1##2{%
+ \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
+ \def\subsubsecentry ##1##2##3##4##5##6{%
+ \pdfoutline goto name{\pdfmkpgn{##6}}{##1}}
+ \def\unnumbsubsubsecentry ##1##2{%
+ \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
+ \input \jobname.toc
+ \egroup\fi
+ }}
+ \def\makelinks #1,{%
+ \def\params{#1}\def\E{END}%
+ \ifx\params\E
+ \let\nextmakelinks=\relax
+ \else
+ \let\nextmakelinks=\makelinks
+ \ifnum\lnkcount>0,\fi
+ \picknum{#1}%
+ \startlink attr{/Border [0 0 0]}
+ goto name{\pdfmkpgn{\the\pgn}}%
+ \linkcolor #1%
+ \advance\lnkcount by 1%
+ \endlink
+ \fi
+ \nextmakelinks
+ }
+ \def\picknum#1{\expandafter\pn#1}
+ \def\pn#1{%
+ \def\p{#1}%
+ \ifx\p\lbrace
+ \let\nextpn=\ppn
+ \else
+ \let\nextpn=\ppnn
+ \def\first{#1}
+ \fi
+ \nextpn
+ }
+ \def\ppn#1{\pgn=#1\gobble}
+ \def\ppnn{\pgn=\first}
+ \def\pdfmklnk#1{\lnkcount=0\makelinks #1,END,}
+ \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
+ \def\skipspaces#1{\def\PP{#1}\def\D{|}%
+ \ifx\PP\D\let\nextsp\relax
+ \else\let\nextsp\skipspaces
+ \ifx\p\space\else\addtokens{\filename}{\PP}%
+ \advance\filenamelength by 1
+ \fi
+ \fi
+ \nextsp}
+ \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax}
+ \ifnum\pdftexversion < 14
+ \let \startlink \pdfannotlink
+ \else
+ \let \startlink \pdfstartlink
+ \fi
+ \def\pdfurl#1{%
+ \begingroup
+ \normalturnoffactive\def\@{@}%
+ \leavevmode\Red
+ \startlink attr{/Border [0 0 0]}%
+ user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
+ % #1
+ \endgroup}
+ \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
+ \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
+ \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
+ \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
+ \def\maketoks{%
+ \expandafter\poptoks\the\toksA|ENDTOKS|
+ \ifx\first0\adn0
+ \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
+ \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
+ \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
+ \else
+ \ifnum0=\countA\else\makelink\fi
+ \ifx\first.\let\next=\done\else
+ \let\next=\maketoks
+ \addtokens{\toksB}{\the\toksD}
+ \ifx\first,\addtokens{\toksB}{\space}\fi
+ \fi
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \next}
+ \def\makelink{\addtokens{\toksB}%
+ {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
+ \def\pdflink#1{%
+ \startlink attr{/Border [0 0 0]} goto name{\mkpgn{#1}}
+ \linkcolor #1\endlink}
+ \def\mkpgn#1{#1@}
+ \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
+\fi % \ifx\pdfoutput
+
+
+\message{fonts,}
+% Font-change commands.
+
+% Texinfo sort of supports the sans serif font style, which plain TeX does not.
+% So we set up a \sf analogous to plain's \rm, etc.
+\newfam\sffam
+\def\sf{\fam=\sffam \tensf}
+\let\li = \sf % Sometimes we call it \li, not \sf.
+
+% We don't need math for this one.
+\def\ttsl{\tenttsl}
+
+% Use Computer Modern fonts at \magstephalf (11pt).
+\newcount\mainmagstep
+\mainmagstep=\magstephalf
+
+% Set the font macro #1 to the font named #2, adding on the
+% specified font prefix (normally `cm').
+% #3 is the font's design size, #4 is a scale factor
+\def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4}
+
+% Use cm as the default font prefix.
+% To specify the font prefix, you must define \fontprefix
+% before you read in texinfo.tex.
+\ifx\fontprefix\undefined
+\def\fontprefix{cm}
+\fi
+% Support font families that don't use the same naming scheme as CM.
+\def\rmshape{r}
+\def\rmbshape{bx} %where the normal face is bold
+\def\bfshape{b}
+\def\bxshape{bx}
+\def\ttshape{tt}
+\def\ttbshape{tt}
+\def\ttslshape{sltt}
+\def\itshape{ti}
+\def\itbshape{bxti}
+\def\slshape{sl}
+\def\slbshape{bxsl}
+\def\sfshape{ss}
+\def\sfbshape{ss}
+\def\scshape{csc}
+\def\scbshape{csc}
+
+\ifx\bigger\relax
+\let\mainmagstep=\magstep1
+\setfont\textrm\rmshape{12}{1000}
+\setfont\texttt\ttshape{12}{1000}
+\else
+\setfont\textrm\rmshape{10}{\mainmagstep}
+\setfont\texttt\ttshape{10}{\mainmagstep}
+\fi
+% Instead of cmb10, you many want to use cmbx10.
+% cmbx10 is a prettier font on its own, but cmb10
+% looks better when embedded in a line with cmr10.
+\setfont\textbf\bfshape{10}{\mainmagstep}
+\setfont\textit\itshape{10}{\mainmagstep}
+\setfont\textsl\slshape{10}{\mainmagstep}
+\setfont\textsf\sfshape{10}{\mainmagstep}
+\setfont\textsc\scshape{10}{\mainmagstep}
+\setfont\textttsl\ttslshape{10}{\mainmagstep}
+\font\texti=cmmi10 scaled \mainmagstep
+\font\textsy=cmsy10 scaled \mainmagstep
+
+% A few fonts for @defun, etc.
+\setfont\defbf\bxshape{10}{\magstep1} %was 1314
+\setfont\deftt\ttshape{10}{\magstep1}
+\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
+
+% Fonts for indices, footnotes, small examples (9pt).
+\setfont\smallrm\rmshape{9}{1000}
+\setfont\smalltt\ttshape{9}{1000}
+\setfont\smallbf\bfshape{10}{900}
+\setfont\smallit\itshape{9}{1000}
+\setfont\smallsl\slshape{9}{1000}
+\setfont\smallsf\sfshape{9}{1000}
+\setfont\smallsc\scshape{10}{900}
+\setfont\smallttsl\ttslshape{10}{900}
+\font\smalli=cmmi9
+\font\smallsy=cmsy9
+
+% Fonts for title page:
+\setfont\titlerm\rmbshape{12}{\magstep3}
+\setfont\titleit\itbshape{10}{\magstep4}
+\setfont\titlesl\slbshape{10}{\magstep4}
+\setfont\titlett\ttbshape{12}{\magstep3}
+\setfont\titlettsl\ttslshape{10}{\magstep4}
+\setfont\titlesf\sfbshape{17}{\magstep1}
+\let\titlebf=\titlerm
+\setfont\titlesc\scbshape{10}{\magstep4}
+\font\titlei=cmmi12 scaled \magstep3
+\font\titlesy=cmsy10 scaled \magstep4
+\def\authorrm{\secrm}
+
+% Chapter (and unnumbered) fonts (17.28pt).
+\setfont\chaprm\rmbshape{12}{\magstep2}
+\setfont\chapit\itbshape{10}{\magstep3}
+\setfont\chapsl\slbshape{10}{\magstep3}
+\setfont\chaptt\ttbshape{12}{\magstep2}
+\setfont\chapttsl\ttslshape{10}{\magstep3}
+\setfont\chapsf\sfbshape{17}{1000}
+\let\chapbf=\chaprm
+\setfont\chapsc\scbshape{10}{\magstep3}
+\font\chapi=cmmi12 scaled \magstep2
+\font\chapsy=cmsy10 scaled \magstep3
+
+% Section fonts (14.4pt).
+\setfont\secrm\rmbshape{12}{\magstep1}
+\setfont\secit\itbshape{10}{\magstep2}
+\setfont\secsl\slbshape{10}{\magstep2}
+\setfont\sectt\ttbshape{12}{\magstep1}
+\setfont\secttsl\ttslshape{10}{\magstep2}
+\setfont\secsf\sfbshape{12}{\magstep1}
+\let\secbf\secrm
+\setfont\secsc\scbshape{10}{\magstep2}
+\font\seci=cmmi12 scaled \magstep1
+\font\secsy=cmsy10 scaled \magstep2
+
+% \setfont\ssecrm\bxshape{10}{\magstep1} % This size an font looked bad.
+% \setfont\ssecit\itshape{10}{\magstep1} % The letters were too crowded.
+% \setfont\ssecsl\slshape{10}{\magstep1}
+% \setfont\ssectt\ttshape{10}{\magstep1}
+% \setfont\ssecsf\sfshape{10}{\magstep1}
+
+%\setfont\ssecrm\bfshape{10}{1315} % Note the use of cmb rather than cmbx.
+%\setfont\ssecit\itshape{10}{1315} % Also, the size is a little larger than
+%\setfont\ssecsl\slshape{10}{1315} % being scaled magstep1.
+%\setfont\ssectt\ttshape{10}{1315}
+%\setfont\ssecsf\sfshape{10}{1315}
+
+%\let\ssecbf=\ssecrm
+
+% Subsection fonts (13.15pt).
+\setfont\ssecrm\rmbshape{12}{\magstephalf}
+\setfont\ssecit\itbshape{10}{1315}
+\setfont\ssecsl\slbshape{10}{1315}
+\setfont\ssectt\ttbshape{12}{\magstephalf}
+\setfont\ssecttsl\ttslshape{10}{1315}
+\setfont\ssecsf\sfbshape{12}{\magstephalf}
+\let\ssecbf\ssecrm
+\setfont\ssecsc\scbshape{10}{\magstep1}
+\font\sseci=cmmi12 scaled \magstephalf
+\font\ssecsy=cmsy10 scaled 1315
+% The smallcaps and symbol fonts should actually be scaled \magstep1.5,
+% but that is not a standard magnification.
+
+% In order for the font changes to affect most math symbols and letters,
+% we have to define the \textfont of the standard families. Since
+% texinfo doesn't allow for producing subscripts and superscripts, we
+% don't bother to reset \scriptfont and \scriptscriptfont (which would
+% also require loading a lot more fonts).
+%
+\def\resetmathfonts{%
+ \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy
+ \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf
+ \textfont\ttfam = \tentt \textfont\sffam = \tensf
+}
+
+
+% The font-changing commands redefine the meanings of \tenSTYLE, instead
+% of just \STYLE. We do this so that font changes will continue to work
+% in math mode, where it is the current \fam that is relevant in most
+% cases, not the current font. Plain TeX does \def\bf{\fam=\bffam
+% \tenbf}, for example. By redefining \tenbf, we obviate the need to
+% redefine \bf itself.
+\def\textfonts{%
+ \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
+ \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
+ \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl
+ \resetmathfonts}
+\def\titlefonts{%
+ \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
+ \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
+ \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
+ \let\tenttsl=\titlettsl
+ \resetmathfonts \setleading{25pt}}
+\def\titlefont#1{{\titlefonts\rm #1}}
+\def\chapfonts{%
+ \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
+ \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
+ \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl
+ \resetmathfonts \setleading{19pt}}
+\def\secfonts{%
+ \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
+ \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
+ \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl
+ \resetmathfonts \setleading{16pt}}
+\def\subsecfonts{%
+ \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
+ \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
+ \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl
+ \resetmathfonts \setleading{15pt}}
+\let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf?
+\def\smallfonts{%
+ \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
+ \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
+ \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
+ \let\tenttsl=\smallttsl
+ \resetmathfonts \setleading{11pt}}
+
+% Set up the default fonts, so we can use them for creating boxes.
+%
+\textfonts
+
+% Define these so they can be easily changed for other fonts.
+\def\angleleft{$\langle$}
+\def\angleright{$\rangle$}
+
+% Count depth in font-changes, for error checks
+\newcount\fontdepth \fontdepth=0
+
+% Fonts for short table of contents.
+\setfont\shortcontrm\rmshape{12}{1000}
+\setfont\shortcontbf\bxshape{12}{1000}
+\setfont\shortcontsl\slshape{12}{1000}
+
+%% Add scribe-like font environments, plus @l for inline lisp (usually sans
+%% serif) and @ii for TeX italic
+
+% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
+% unless the following character is such as not to need one.
+\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
+\def\smartslanted#1{{\sl #1}\futurelet\next\smartitalicx}
+\def\smartitalic#1{{\it #1}\futurelet\next\smartitalicx}
+
+\let\i=\smartitalic
+\let\var=\smartslanted
+\let\dfn=\smartslanted
+\let\emph=\smartitalic
+\let\cite=\smartslanted
+
+\def\b#1{{\bf #1}}
+\let\strong=\b
+
+% We can't just use \exhyphenpenalty, because that only has effect at
+% the end of a paragraph. Restore normal hyphenation at the end of the
+% group within which \nohyphenation is presumably called.
+%
+\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
+\def\restorehyphenation{\hyphenchar\font = `- }
+
+\def\t#1{%
+ {\tt \rawbackslash \frenchspacing #1}%
+ \null
+}
+\let\ttfont=\t
+\def\samp#1{`\tclose{#1}'\null}
+\setfont\keyrm\rmshape{8}{1000}
+\font\keysy=cmsy9
+\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
+ \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
+ \vbox{\hrule\kern-0.4pt
+ \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
+ \kern-0.4pt\hrule}%
+ \kern-.06em\raise0.4pt\hbox{\angleright}}}}
+% The old definition, with no lozenge:
+%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
+\def\ctrl #1{{\tt \rawbackslash \hat}#1}
+
+% @file, @option are the same as @samp.
+\let\file=\samp
+\let\option=\samp
+
+% @code is a modification of @t,
+% which makes spaces the same size as normal in the surrounding text.
+\def\tclose#1{%
+ {%
+ % Change normal interword space to be same as for the current font.
+ \spaceskip = \fontdimen2\font
+ %
+ % Switch to typewriter.
+ \tt
+ %
+ % But `\ ' produces the large typewriter interword space.
+ \def\ {{\spaceskip = 0pt{} }}%
+ %
+ % Turn off hyphenation.
+ \nohyphenation
+ %
+ \rawbackslash
+ \frenchspacing
+ #1%
+ }%
+ \null
+}
+
+% We *must* turn on hyphenation at `-' and `_' in \code.
+% Otherwise, it is too hard to avoid overfull hboxes
+% in the Emacs manual, the Library manual, etc.
+
+% Unfortunately, TeX uses one parameter (\hyphenchar) to control
+% both hyphenation at - and hyphenation within words.
+% We must therefore turn them both off (\tclose does that)
+% and arrange explicitly to hyphenate at a dash.
+% -- rms.
+{
+ \catcode`\-=\active
+ \catcode`\_=\active
+ %
+ \global\def\code{\begingroup
+ \catcode`\-=\active \let-\codedash
+ \catcode`\_=\active \let_\codeunder
+ \codex
+ }
+ %
+ % If we end up with any active - characters when handling the index,
+ % just treat them as a normal -.
+ \global\def\indexbreaks{\catcode`\-=\active \let-\realdash}
+}
+
+\def\realdash{-}
+\def\codedash{-\discretionary{}{}{}}
+\def\codeunder{\ifusingtt{\normalunderscore\discretionary{}{}{}}{\_}}
+\def\codex #1{\tclose{#1}\endgroup}
+
+%\let\exp=\tclose %Was temporary
+
+% @kbd is like @code, except that if the argument is just one @key command,
+% then @kbd has no effect.
+
+% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
+% `example' (@kbd uses ttsl only inside of @example and friends),
+% or `code' (@kbd uses normal tty font always).
+\def\kbdinputstyle{\parsearg\kbdinputstylexxx}
+\def\kbdinputstylexxx#1{%
+ \def\arg{#1}%
+ \ifx\arg\worddistinct
+ \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
+ \else\ifx\arg\wordexample
+ \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
+ \else\ifx\arg\wordcode
+ \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
+ \fi\fi\fi
+}
+\def\worddistinct{distinct}
+\def\wordexample{example}
+\def\wordcode{code}
+
+% Default is kbdinputdistinct. (Too much of a hassle to call the macro,
+% the catcodes are wrong for parsearg to work.)
+\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}
+
+\def\xkey{\key}
+\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
+\ifx\one\xkey\ifx\threex\three \key{#2}%
+\else{\tclose{\kbdfont\look}}\fi
+\else{\tclose{\kbdfont\look}}\fi}
+
+% For @url, @env, @command quotes seem unnecessary, so use \code.
+\let\url=\code
+\let\env=\code
+\let\command=\code
+
+% @uref (abbreviation for `urlref') takes an optional (comma-separated)
+% second argument specifying the text to display and an optional third
+% arg as text to display instead of (rather than in addition to) the url
+% itself. First (mandatory) arg is the url. Perhaps eventually put in
+% a hypertex \special here.
+%
+\def\uref#1{\douref #1,,,\finish}
+\def\douref#1,#2,#3,#4\finish{\begingroup
+ \unsepspaces
+ \pdfurl{#1}%
+ \setbox0 = \hbox{\ignorespaces #3}%
+ \ifdim\wd0 > 0pt
+ \unhbox0 % third arg given, show only that
+ \else
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0 > 0pt
+ \ifpdf
+ \unhbox0 % PDF: 2nd arg given, show only it
+ \else
+ \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
+ \fi
+ \else
+ \code{#1}% only url given, so show it
+ \fi
+ \fi
+ \endlink
+\endgroup}
+
+% rms does not like angle brackets --karl, 17may97.
+% So now @email is just like @uref, unless we are pdf.
+%
+%\def\email#1{\angleleft{\tt #1}\angleright}
+\ifpdf
+ \def\email#1{\doemail#1,,\finish}
+ \def\doemail#1,#2,#3\finish{\begingroup
+ \unsepspaces
+ \pdfurl{mailto:#1}%
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
+ \endlink
+ \endgroup}
+\else
+ \let\email=\uref
+\fi
+
+% Check if we are currently using a typewriter font. Since all the
+% Computer Modern typewriter fonts have zero interword stretch (and
+% shrink), and it is reasonable to expect all typewriter fonts to have
+% this property, we can check that font parameter.
+%
+\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
+
+% Typeset a dimension, e.g., `in' or `pt'. The only reason for the
+% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
+%
+\def\dmn#1{\thinspace #1}
+
+\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
+
+% @l was never documented to mean ``switch to the Lisp font'',
+% and it is not used as such in any manual I can find. We need it for
+% Polish suppressed-l. --karl, 22sep96.
+%\def\l#1{{\li #1}\null}
+
+% Explicit font changes: @r, @sc, undocumented @ii.
+\def\r#1{{\rm #1}} % roman font
+\def\sc#1{{\smallcaps#1}} % smallcaps font
+\def\ii#1{{\it #1}} % italic font
+
+% @acronym downcases the argument and prints in smallcaps.
+\def\acronym#1{{\smallcaps \lowercase{#1}}}
+
+% @pounds{} is a sterling sign.
+\def\pounds{{\it\$}}
+
+
+\message{page headings,}
+
+\newskip\titlepagetopglue \titlepagetopglue = 1.5in
+\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
+
+% First the title page. Must do @settitle before @titlepage.
+\newif\ifseenauthor
+\newif\iffinishedtitlepage
+
+% Do an implicit @contents or @shortcontents after @end titlepage if the
+% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
+%
+\newif\ifsetcontentsaftertitlepage
+ \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
+\newif\ifsetshortcontentsaftertitlepage
+ \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
+
+\def\shorttitlepage{\parsearg\shorttitlepagezzz}
+\def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
+ \endgroup\page\hbox{}\page}
+
+\def\titlepage{\begingroup \parindent=0pt \textfonts
+ \let\subtitlerm=\tenrm
+ \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
+ %
+ \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
+ %
+ % Leave some space at the very top of the page.
+ \vglue\titlepagetopglue
+ %
+ % Now you can print the title using @title.
+ \def\title{\parsearg\titlezzz}%
+ \def\titlezzz##1{\leftline{\titlefonts\rm ##1}
+ % print a rule at the page bottom also.
+ \finishedtitlepagefalse
+ \vskip4pt \hrule height 4pt width \hsize \vskip4pt}%
+ % No rule at page bottom unless we print one at the top with @title.
+ \finishedtitlepagetrue
+ %
+ % Now you can put text using @subtitle.
+ \def\subtitle{\parsearg\subtitlezzz}%
+ \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}%
+ %
+ % @author should come last, but may come many times.
+ \def\author{\parsearg\authorzzz}%
+ \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi
+ {\authorfont \leftline{##1}}}%
+ %
+ % Most title ``pages'' are actually two pages long, with space
+ % at the top of the second. We don't want the ragged left on the second.
+ \let\oldpage = \page
+ \def\page{%
+ \iffinishedtitlepage\else
+ \finishtitlepage
+ \fi
+ \oldpage
+ \let\page = \oldpage
+ \hbox{}}%
+% \def\page{\oldpage \hbox{}}
+}
+
+\def\Etitlepage{%
+ \iffinishedtitlepage\else
+ \finishtitlepage
+ \fi
+ % It is important to do the page break before ending the group,
+ % because the headline and footline are only empty inside the group.
+ % If we use the new definition of \page, we always get a blank page
+ % after the title page, which we certainly don't want.
+ \oldpage
+ \endgroup
+ %
+ % If they want short, they certainly want long too.
+ \ifsetshortcontentsaftertitlepage
+ \shortcontents
+ \contents
+ \global\let\shortcontents = \relax
+ \global\let\contents = \relax
+ \fi
+ %
+ \ifsetcontentsaftertitlepage
+ \contents
+ \global\let\contents = \relax
+ \global\let\shortcontents = \relax
+ \fi
+ %
+ \ifpdf \pdfmakepagedesttrue \fi
+ %
+ \HEADINGSon
+}
+
+\def\finishtitlepage{%
+ \vskip4pt \hrule height 2pt width \hsize
+ \vskip\titlepagebottomglue
+ \finishedtitlepagetrue
+}
+
+%%% Set up page headings and footings.
+
+\let\thispage=\folio
+
+\newtoks\evenheadline % headline on even pages
+\newtoks\oddheadline % headline on odd pages
+\newtoks\evenfootline % footline on even pages
+\newtoks\oddfootline % footline on odd pages
+
+% Now make Tex use those variables
+\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
+ \else \the\evenheadline \fi}}
+\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
+ \else \the\evenfootline \fi}\HEADINGShook}
+\let\HEADINGShook=\relax
+
+% Commands to set those variables.
+% For example, this is what @headings on does
+% @evenheading @thistitle|@thispage|@thischapter
+% @oddheading @thischapter|@thispage|@thistitle
+% @evenfooting @thisfile||
+% @oddfooting ||@thisfile
+
+\def\evenheading{\parsearg\evenheadingxxx}
+\def\oddheading{\parsearg\oddheadingxxx}
+\def\everyheading{\parsearg\everyheadingxxx}
+
+\def\evenfooting{\parsearg\evenfootingxxx}
+\def\oddfooting{\parsearg\oddfootingxxx}
+\def\everyfooting{\parsearg\everyfootingxxx}
+
+{\catcode`\@=0 %
+
+\gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish}
+\gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{%
+\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish}
+\gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
+\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
+
+\gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
+\gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
+\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
+\gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
+ \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
+ %
+ % Leave some space for the footline. Hopefully ok to assume
+ % @evenfooting will not be used by itself.
+ \global\advance\pageheight by -\baselineskip
+ \global\advance\vsize by -\baselineskip
+}
+
+\gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}}
+%
+}% unbind the catcode of @.
+
+% @headings double turns headings on for double-sided printing.
+% @headings single turns headings on for single-sided printing.
+% @headings off turns them off.
+% @headings on same as @headings double, retained for compatibility.
+% @headings after turns on double-sided headings after this page.
+% @headings doubleafter turns on double-sided headings after this page.
+% @headings singleafter turns on single-sided headings after this page.
+% By default, they are off at the start of a document,
+% and turned `on' after @end titlepage.
+
+\def\headings #1 {\csname HEADINGS#1\endcsname}
+
+\def\HEADINGSoff{
+\global\evenheadline={\hfil} \global\evenfootline={\hfil}
+\global\oddheadline={\hfil} \global\oddfootline={\hfil}}
+\HEADINGSoff
+% When we turn headings on, set the page number to 1.
+% For double-sided printing, put current file name in lower left corner,
+% chapter name on inside top of right hand pages, document
+% title on inside top of left hand pages, and page numbers on outside top
+% edge of all pages.
+\def\HEADINGSdouble{
+\global\pageno=1
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\folio\hfil\thistitle}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chapoddpage
+}
+\let\contentsalignmacro = \chappager
+
+% For single-sided printing, chapter title goes across top left of page,
+% page number on top right.
+\def\HEADINGSsingle{
+\global\pageno=1
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\thischapter\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chappager
+}
+\def\HEADINGSon{\HEADINGSdouble}
+
+\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
+\let\HEADINGSdoubleafter=\HEADINGSafter
+\def\HEADINGSdoublex{%
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\folio\hfil\thistitle}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chapoddpage
+}
+
+\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
+\def\HEADINGSsinglex{%
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\thischapter\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chappager
+}
+
+% Subroutines used in generating headings
+% This produces Day Month Year style of output.
+% Only define if not already defined, in case a txi-??.tex file has set
+% up a different format (e.g., txi-cs.tex does this).
+\ifx\today\undefined
+\def\today{%
+ \number\day\space
+ \ifcase\month
+ \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
+ \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
+ \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
+ \fi
+ \space\number\year}
+\fi
+
+% @settitle line... specifies the title of the document, for headings.
+% It generates no output of its own.
+\def\thistitle{\putwordNoTitle}
+\def\settitle{\parsearg\settitlezzz}
+\def\settitlezzz #1{\gdef\thistitle{#1}}
+
+
+\message{tables,}
+% Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
+
+% default indentation of table text
+\newdimen\tableindent \tableindent=.8in
+% default indentation of @itemize and @enumerate text
+\newdimen\itemindent \itemindent=.3in
+% margin between end of table item and start of table text.
+\newdimen\itemmargin \itemmargin=.1in
+
+% used internally for \itemindent minus \itemmargin
+\newdimen\itemmax
+
+% Note @table, @vtable, and @vtable define @item, @itemx, etc., with
+% these defs.
+% They also define \itemindex
+% to index the item name in whatever manner is desired (perhaps none).
+
+\newif\ifitemxneedsnegativevskip
+
+\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
+
+\def\internalBitem{\smallbreak \parsearg\itemzzz}
+\def\internalBitemx{\itemxpar \parsearg\itemzzz}
+
+\def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
+\def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz}
+
+\def\internalBkitem{\smallbreak \parsearg\kitemzzz}
+\def\internalBkitemx{\itemxpar \parsearg\kitemzzz}
+
+\def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}%
+ \itemzzz {#1}}
+
+\def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}%
+ \itemzzz {#1}}
+
+\def\itemzzz #1{\begingroup %
+ \advance\hsize by -\rightskip
+ \advance\hsize by -\tableindent
+ \setbox0=\hbox{\itemfont{#1}}%
+ \itemindex{#1}%
+ \nobreak % This prevents a break before @itemx.
+ %
+ % If the item text does not fit in the space we have, put it on a line
+ % by itself, and do not allow a page break either before or after that
+ % line. We do not start a paragraph here because then if the next
+ % command is, e.g., @kindex, the whatsit would get put into the
+ % horizontal list on a line by itself, resulting in extra blank space.
+ \ifdim \wd0>\itemmax
+ %
+ % Make this a paragraph so we get the \parskip glue and wrapping,
+ % but leave it ragged-right.
+ \begingroup
+ \advance\leftskip by-\tableindent
+ \advance\hsize by\tableindent
+ \advance\rightskip by0pt plus1fil
+ \leavevmode\unhbox0\par
+ \endgroup
+ %
+ % We're going to be starting a paragraph, but we don't want the
+ % \parskip glue -- logically it's part of the @item we just started.
+ \nobreak \vskip-\parskip
+ %
+ % Stop a page break at the \parskip glue coming up. Unfortunately
+ % we can't prevent a possible page break at the following
+ % \baselineskip glue.
+ \nobreak
+ \endgroup
+ \itemxneedsnegativevskipfalse
+ \else
+ % The item text fits into the space. Start a paragraph, so that the
+ % following text (if any) will end up on the same line.
+ \noindent
+ % Do this with kerns and \unhbox so that if there is a footnote in
+ % the item text, it can migrate to the main vertical list and
+ % eventually be printed.
+ \nobreak\kern-\tableindent
+ \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
+ \unhbox0
+ \nobreak\kern\dimen0
+ \endgroup
+ \itemxneedsnegativevskiptrue
+ \fi
+}
+
+\def\item{\errmessage{@item while not in a table}}
+\def\itemx{\errmessage{@itemx while not in a table}}
+\def\kitem{\errmessage{@kitem while not in a table}}
+\def\kitemx{\errmessage{@kitemx while not in a table}}
+\def\xitem{\errmessage{@xitem while not in a table}}
+\def\xitemx{\errmessage{@xitemx while not in a table}}
+
+% Contains a kludge to get @end[description] to work.
+\def\description{\tablez{\dontindex}{1}{}{}{}{}}
+
+% @table, @ftable, @vtable.
+\def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
+{\obeylines\obeyspaces%
+\gdef\tablex #1^^M{%
+\tabley\dontindex#1 \endtabley}}
+
+\def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
+{\obeylines\obeyspaces%
+\gdef\ftablex #1^^M{%
+\tabley\fnitemindex#1 \endtabley
+\def\Eftable{\endgraf\afterenvbreak\endgroup}%
+\let\Etable=\relax}}
+
+\def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex}
+{\obeylines\obeyspaces%
+\gdef\vtablex #1^^M{%
+\tabley\vritemindex#1 \endtabley
+\def\Evtable{\endgraf\afterenvbreak\endgroup}%
+\let\Etable=\relax}}
+
+\def\dontindex #1{}
+\def\fnitemindex #1{\doind {fn}{\code{#1}}}%
+\def\vritemindex #1{\doind {vr}{\code{#1}}}%
+
+{\obeyspaces %
+\gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
+\tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
+
+\def\tablez #1#2#3#4#5#6{%
+\aboveenvbreak %
+\begingroup %
+\def\Edescription{\Etable}% Necessary kludge.
+\let\itemindex=#1%
+\ifnum 0#3>0 \advance \leftskip by #3\mil \fi %
+\ifnum 0#4>0 \tableindent=#4\mil \fi %
+\ifnum 0#5>0 \advance \rightskip by #5\mil \fi %
+\def\itemfont{#2}%
+\itemmax=\tableindent %
+\advance \itemmax by -\itemmargin %
+\advance \leftskip by \tableindent %
+\exdentamount=\tableindent
+\parindent = 0pt
+\parskip = \smallskipamount
+\ifdim \parskip=0pt \parskip=2pt \fi%
+\def\Etable{\endgraf\afterenvbreak\endgroup}%
+\let\item = \internalBitem %
+\let\itemx = \internalBitemx %
+\let\kitem = \internalBkitem %
+\let\kitemx = \internalBkitemx %
+\let\xitem = \internalBxitem %
+\let\xitemx = \internalBxitemx %
+}
+
+% This is the counter used by @enumerate, which is really @itemize
+
+\newcount \itemno
+
+\def\itemize{\parsearg\itemizezzz}
+
+\def\itemizezzz #1{%
+ \begingroup % ended by the @end itemize
+ \itemizey {#1}{\Eitemize}
+}
+
+\def\itemizey #1#2{%
+\aboveenvbreak %
+\itemmax=\itemindent %
+\advance \itemmax by -\itemmargin %
+\advance \leftskip by \itemindent %
+\exdentamount=\itemindent
+\parindent = 0pt %
+\parskip = \smallskipamount %
+\ifdim \parskip=0pt \parskip=2pt \fi%
+\def#2{\endgraf\afterenvbreak\endgroup}%
+\def\itemcontents{#1}%
+\let\item=\itemizeitem}
+
+% Set sfcode to normal for the chars that usually have another value.
+% These are `.?!:;,'
+\def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000
+ \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 }
+
+% \splitoff TOKENS\endmark defines \first to be the first token in
+% TOKENS, and \rest to be the remainder.
+%
+\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
+
+% Allow an optional argument of an uppercase letter, lowercase letter,
+% or number, to specify the first label in the enumerated list. No
+% argument is the same as `1'.
+%
+\def\enumerate{\parsearg\enumeratezzz}
+\def\enumeratezzz #1{\enumeratey #1 \endenumeratey}
+\def\enumeratey #1 #2\endenumeratey{%
+ \begingroup % ended by the @end enumerate
+ %
+ % If we were given no argument, pretend we were given `1'.
+ \def\thearg{#1}%
+ \ifx\thearg\empty \def\thearg{1}\fi
+ %
+ % Detect if the argument is a single token. If so, it might be a
+ % letter. Otherwise, the only valid thing it can be is a number.
+ % (We will always have one token, because of the test we just made.
+ % This is a good thing, since \splitoff doesn't work given nothing at
+ % all -- the first parameter is undelimited.)
+ \expandafter\splitoff\thearg\endmark
+ \ifx\rest\empty
+ % Only one token in the argument. It could still be anything.
+ % A ``lowercase letter'' is one whose \lccode is nonzero.
+ % An ``uppercase letter'' is one whose \lccode is both nonzero, and
+ % not equal to itself.
+ % Otherwise, we assume it's a number.
+ %
+ % We need the \relax at the end of the \ifnum lines to stop TeX from
+ % continuing to look for a <number>.
+ %
+ \ifnum\lccode\expandafter`\thearg=0\relax
+ \numericenumerate % a number (we hope)
+ \else
+ % It's a letter.
+ \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
+ \lowercaseenumerate % lowercase letter
+ \else
+ \uppercaseenumerate % uppercase letter
+ \fi
+ \fi
+ \else
+ % Multiple tokens in the argument. We hope it's a number.
+ \numericenumerate
+ \fi
+}
+
+% An @enumerate whose labels are integers. The starting integer is
+% given in \thearg.
+%
+\def\numericenumerate{%
+ \itemno = \thearg
+ \startenumeration{\the\itemno}%
+}
+
+% The starting (lowercase) letter is in \thearg.
+\def\lowercaseenumerate{%
+ \itemno = \expandafter`\thearg
+ \startenumeration{%
+ % Be sure we're not beyond the end of the alphabet.
+ \ifnum\itemno=0
+ \errmessage{No more lowercase letters in @enumerate; get a bigger
+ alphabet}%
+ \fi
+ \char\lccode\itemno
+ }%
+}
+
+% The starting (uppercase) letter is in \thearg.
+\def\uppercaseenumerate{%
+ \itemno = \expandafter`\thearg
+ \startenumeration{%
+ % Be sure we're not beyond the end of the alphabet.
+ \ifnum\itemno=0
+ \errmessage{No more uppercase letters in @enumerate; get a bigger
+ alphabet}
+ \fi
+ \char\uccode\itemno
+ }%
+}
+
+% Call itemizey, adding a period to the first argument and supplying the
+% common last two arguments. Also subtract one from the initial value in
+% \itemno, since @item increments \itemno.
+%
+\def\startenumeration#1{%
+ \advance\itemno by -1
+ \itemizey{#1.}\Eenumerate\flushcr
+}
+
+% @alphaenumerate and @capsenumerate are abbreviations for giving an arg
+% to @enumerate.
+%
+\def\alphaenumerate{\enumerate{a}}
+\def\capsenumerate{\enumerate{A}}
+\def\Ealphaenumerate{\Eenumerate}
+\def\Ecapsenumerate{\Eenumerate}
+
+% Definition of @item while inside @itemize.
+
+\def\itemizeitem{%
+\advance\itemno by 1
+{\let\par=\endgraf \smallbreak}%
+\ifhmode \errmessage{In hmode at itemizeitem}\fi
+{\parskip=0in \hskip 0pt
+\hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
+\vadjust{\penalty 1200}}%
+\flushcr}
+
+% @multitable macros
+% Amy Hendrickson, 8/18/94, 3/6/96
+%
+% @multitable ... @end multitable will make as many columns as desired.
+% Contents of each column will wrap at width given in preamble. Width
+% can be specified either with sample text given in a template line,
+% or in percent of \hsize, the current width of text on page.
+
+% Table can continue over pages but will only break between lines.
+
+% To make preamble:
+%
+% Either define widths of columns in terms of percent of \hsize:
+% @multitable @columnfractions .25 .3 .45
+% @item ...
+%
+% Numbers following @columnfractions are the percent of the total
+% current hsize to be used for each column. You may use as many
+% columns as desired.
+
+
+% Or use a template:
+% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
+% @item ...
+% using the widest term desired in each column.
+%
+% For those who want to use more than one line's worth of words in
+% the preamble, break the line within one argument and it
+% will parse correctly, i.e.,
+%
+% @multitable {Column 1 template} {Column 2 template} {Column 3
+% template}
+% Not:
+% @multitable {Column 1 template} {Column 2 template}
+% {Column 3 template}
+
+% Each new table line starts with @item, each subsequent new column
+% starts with @tab. Empty columns may be produced by supplying @tab's
+% with nothing between them for as many times as empty columns are needed,
+% ie, @tab@tab@tab will produce two empty columns.
+
+% @item, @tab, @multitable or @end multitable do not need to be on their
+% own lines, but it will not hurt if they are.
+
+% Sample multitable:
+
+% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
+% @item first col stuff @tab second col stuff @tab third col
+% @item
+% first col stuff
+% @tab
+% second col stuff
+% @tab
+% third col
+% @item first col stuff @tab second col stuff
+% @tab Many paragraphs of text may be used in any column.
+%
+% They will wrap at the width determined by the template.
+% @item@tab@tab This will be in third column.
+% @end multitable
+
+% Default dimensions may be reset by user.
+% @multitableparskip is vertical space between paragraphs in table.
+% @multitableparindent is paragraph indent in table.
+% @multitablecolmargin is horizontal space to be left between columns.
+% @multitablelinespace is space to leave between table items, baseline
+% to baseline.
+% 0pt means it depends on current normal line spacing.
+%
+\newskip\multitableparskip
+\newskip\multitableparindent
+\newdimen\multitablecolspace
+\newskip\multitablelinespace
+\multitableparskip=0pt
+\multitableparindent=6pt
+\multitablecolspace=12pt
+\multitablelinespace=0pt
+
+% Macros used to set up halign preamble:
+%
+\let\endsetuptable\relax
+\def\xendsetuptable{\endsetuptable}
+\let\columnfractions\relax
+\def\xcolumnfractions{\columnfractions}
+\newif\ifsetpercent
+
+% #1 is the part of the @columnfraction before the decimal point, which
+% is presumably either 0 or the empty string (but we don't check, we
+% just throw it away). #2 is the decimal part, which we use as the
+% percent of \hsize for this column.
+\def\pickupwholefraction#1.#2 {%
+ \global\advance\colcount by 1
+ \expandafter\xdef\csname col\the\colcount\endcsname{.#2\hsize}%
+ \setuptable
+}
+
+\newcount\colcount
+\def\setuptable#1{%
+ \def\firstarg{#1}%
+ \ifx\firstarg\xendsetuptable
+ \let\go = \relax
+ \else
+ \ifx\firstarg\xcolumnfractions
+ \global\setpercenttrue
+ \else
+ \ifsetpercent
+ \let\go\pickupwholefraction
+ \else
+ \global\advance\colcount by 1
+ \setbox0=\hbox{#1\unskip }% Add a normal word space as a separator;
+ % typically that is always in the input, anyway.
+ \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
+ \fi
+ \fi
+ \ifx\go\pickupwholefraction
+ % Put the argument back for the \pickupwholefraction call, so
+ % we'll always have a period there to be parsed.
+ \def\go{\pickupwholefraction#1}%
+ \else
+ \let\go = \setuptable
+ \fi%
+ \fi
+ \go
+}
+
+% This used to have \hskip1sp. But then the space in a template line is
+% not enough. That is bad. So let's go back to just & until we
+% encounter the problem it was intended to solve again.
+% --karl, nathan@acm.org, 20apr99.
+\def\tab{&}
+
+% @multitable ... @end multitable definitions:
+%
+\def\multitable{\parsearg\dotable}
+\def\dotable#1{\bgroup
+ \vskip\parskip
+ \let\item\crcr
+ \tolerance=9500
+ \hbadness=9500
+ \setmultitablespacing
+ \parskip=\multitableparskip
+ \parindent=\multitableparindent
+ \overfullrule=0pt
+ \global\colcount=0
+ \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}%
+ %
+ % To parse everything between @multitable and @item:
+ \setuptable#1 \endsetuptable
+ %
+ % \everycr will reset column counter, \colcount, at the end of
+ % each line. Every column entry will cause \colcount to advance by one.
+ % The table preamble
+ % looks at the current \colcount to find the correct column width.
+ \everycr{\noalign{%
+ %
+ % \filbreak%% keeps underfull box messages off when table breaks over pages.
+ % Maybe so, but it also creates really weird page breaks when the table
+ % breaks over pages. Wouldn't \vfil be better? Wait until the problem
+ % manifests itself, so it can be fixed for real --karl.
+ \global\colcount=0\relax}}%
+ %
+ % This preamble sets up a generic column definition, which will
+ % be used as many times as user calls for columns.
+ % \vtop will set a single line and will also let text wrap and
+ % continue for many paragraphs if desired.
+ \halign\bgroup&\global\advance\colcount by 1\relax
+ \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
+ %
+ % In order to keep entries from bumping into each other
+ % we will add a \leftskip of \multitablecolspace to all columns after
+ % the first one.
+ %
+ % If a template has been used, we will add \multitablecolspace
+ % to the width of each template entry.
+ %
+ % If the user has set preamble in terms of percent of \hsize we will
+ % use that dimension as the width of the column, and the \leftskip
+ % will keep entries from bumping into each other. Table will start at
+ % left margin and final column will justify at right margin.
+ %
+ % Make sure we don't inherit \rightskip from the outer environment.
+ \rightskip=0pt
+ \ifnum\colcount=1
+ % The first column will be indented with the surrounding text.
+ \advance\hsize by\leftskip
+ \else
+ \ifsetpercent \else
+ % If user has not set preamble in terms of percent of \hsize
+ % we will advance \hsize by \multitablecolspace.
+ \advance\hsize by \multitablecolspace
+ \fi
+ % In either case we will make \leftskip=\multitablecolspace:
+ \leftskip=\multitablecolspace
+ \fi
+ % Ignoring space at the beginning and end avoids an occasional spurious
+ % blank line, when TeX decides to break the line at the space before the
+ % box from the multistrut, so the strut ends up on a line by itself.
+ % For example:
+ % @multitable @columnfractions .11 .89
+ % @item @code{#}
+ % @tab Legal holiday which is valid in major parts of the whole country.
+ % Is automatically provided with highlighting sequences respectively marking
+ % characters.
+ \noindent\ignorespaces##\unskip\multistrut}\cr
+}
+
+\def\setmultitablespacing{% test to see if user has set \multitablelinespace.
+% If so, do nothing. If not, give it an appropriate dimension based on
+% current baselineskip.
+\ifdim\multitablelinespace=0pt
+\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
+\global\advance\multitablelinespace by-\ht0
+%% strut to put in table in case some entry doesn't have descenders,
+%% to keep lines equally spaced
+\let\multistrut = \strut
+\else
+%% FIXME: what is \box0 supposed to be?
+\gdef\multistrut{\vrule height\multitablelinespace depth\dp0
+width0pt\relax} \fi
+%% Test to see if parskip is larger than space between lines of
+%% table. If not, do nothing.
+%% If so, set to same dimension as multitablelinespace.
+\ifdim\multitableparskip>\multitablelinespace
+\global\multitableparskip=\multitablelinespace
+\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
+ %% than skip between lines in the table.
+\fi%
+\ifdim\multitableparskip=0pt
+\global\multitableparskip=\multitablelinespace
+\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
+ %% than skip between lines in the table.
+\fi}
+
+
+\message{conditionals,}
+% Prevent errors for section commands.
+% Used in @ignore and in failing conditionals.
+\def\ignoresections{%
+ \let\chapter=\relax
+ \let\unnumbered=\relax
+ \let\top=\relax
+ \let\unnumberedsec=\relax
+ \let\unnumberedsection=\relax
+ \let\unnumberedsubsec=\relax
+ \let\unnumberedsubsection=\relax
+ \let\unnumberedsubsubsec=\relax
+ \let\unnumberedsubsubsection=\relax
+ \let\section=\relax
+ \let\subsec=\relax
+ \let\subsubsec=\relax
+ \let\subsection=\relax
+ \let\subsubsection=\relax
+ \let\appendix=\relax
+ \let\appendixsec=\relax
+ \let\appendixsection=\relax
+ \let\appendixsubsec=\relax
+ \let\appendixsubsection=\relax
+ \let\appendixsubsubsec=\relax
+ \let\appendixsubsubsection=\relax
+ \let\contents=\relax
+ \let\smallbook=\relax
+ \let\titlepage=\relax
+}
+
+% Used in nested conditionals, where we have to parse the Texinfo source
+% and so want to turn off most commands, in case they are used
+% incorrectly.
+%
+\def\ignoremorecommands{%
+ \let\defcodeindex = \relax
+ \let\defcv = \relax
+ \let\deffn = \relax
+ \let\deffnx = \relax
+ \let\defindex = \relax
+ \let\defivar = \relax
+ \let\defmac = \relax
+ \let\defmethod = \relax
+ \let\defop = \relax
+ \let\defopt = \relax
+ \let\defspec = \relax
+ \let\deftp = \relax
+ \let\deftypefn = \relax
+ \let\deftypefun = \relax
+ \let\deftypeivar = \relax
+ \let\deftypeop = \relax
+ \let\deftypevar = \relax
+ \let\deftypevr = \relax
+ \let\defun = \relax
+ \let\defvar = \relax
+ \let\defvr = \relax
+ \let\ref = \relax
+ \let\xref = \relax
+ \let\printindex = \relax
+ \let\pxref = \relax
+ \let\settitle = \relax
+ \let\setchapternewpage = \relax
+ \let\setchapterstyle = \relax
+ \let\everyheading = \relax
+ \let\evenheading = \relax
+ \let\oddheading = \relax
+ \let\everyfooting = \relax
+ \let\evenfooting = \relax
+ \let\oddfooting = \relax
+ \let\headings = \relax
+ \let\include = \relax
+ \let\lowersections = \relax
+ \let\down = \relax
+ \let\raisesections = \relax
+ \let\up = \relax
+ \let\set = \relax
+ \let\clear = \relax
+ \let\item = \relax
+}
+
+% Ignore @ignore ... @end ignore.
+%
+\def\ignore{\doignore{ignore}}
+
+% Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text.
+%
+\def\ifinfo{\doignore{ifinfo}}
+\def\ifhtml{\doignore{ifhtml}}
+\def\ifnottex{\doignore{ifnottex}}
+\def\html{\doignore{html}}
+\def\menu{\doignore{menu}}
+\def\direntry{\doignore{direntry}}
+
+% @dircategory CATEGORY -- specify a category of the dir file
+% which this file should belong to. Ignore this in TeX.
+\let\dircategory = \comment
+
+% Ignore text until a line `@end #1'.
+%
+\def\doignore#1{\begingroup
+ % Don't complain about control sequences we have declared \outer.
+ \ignoresections
+ %
+ % Define a command to swallow text until we reach `@end #1'.
+ % This @ is a catcode 12 token (that is the normal catcode of @ in
+ % this texinfo.tex file). We change the catcode of @ below to match.
+ \long\def\doignoretext##1@end #1{\enddoignore}%
+ %
+ % Make sure that spaces turn into tokens that match what \doignoretext wants.
+ \catcode32 = 10
+ %
+ % Ignore braces, too, so mismatched braces don't cause trouble.
+ \catcode`\{ = 9
+ \catcode`\} = 9
+ %
+ % We must not have @c interpreted as a control sequence.
+ \catcode`\@ = 12
+ %
+ % Make the letter c a comment character so that the rest of the line
+ % will be ignored. This way, the document can have (for example)
+ % @c @end ifinfo
+ % and the @end ifinfo will be properly ignored.
+ % (We've just changed @ to catcode 12.)
+ \catcode`\c = 14
+ %
+ % And now expand that command.
+ \doignoretext
+}
+
+% What we do to finish off ignored text.
+%
+\def\enddoignore{\endgroup\ignorespaces}%
+
+\newif\ifwarnedobs\warnedobsfalse
+\def\obstexwarn{%
+ \ifwarnedobs\relax\else
+ % We need to warn folks that they may have trouble with TeX 3.0.
+ % This uses \immediate\write16 rather than \message to get newlines.
+ \immediate\write16{}
+ \immediate\write16{WARNING: for users of Unix TeX 3.0!}
+ \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).}
+ \immediate\write16{If you are running another version of TeX, relax.}
+ \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
+ \immediate\write16{ Then upgrade your TeX installation if you can.}
+ \immediate\write16{ (See ftp://ftp.gnu.org/pub/gnu/TeX.README.)}
+ \immediate\write16{If you are stuck with version 3.0, run the}
+ \immediate\write16{ script ``tex3patch'' from the Texinfo distribution}
+ \immediate\write16{ to use a workaround.}
+ \immediate\write16{}
+ \global\warnedobstrue
+ \fi
+}
+
+% **In TeX 3.0, setting text in \nullfont hangs tex. For a
+% workaround (which requires the file ``dummy.tfm'' to be installed),
+% uncomment the following line:
+%%%%%\font\nullfont=dummy\let\obstexwarn=\relax
+
+% Ignore text, except that we keep track of conditional commands for
+% purposes of nesting, up to an `@end #1' command.
+%
+\def\nestedignore#1{%
+ \obstexwarn
+ % We must actually expand the ignored text to look for the @end
+ % command, so that nested ignore constructs work. Thus, we put the
+ % text into a \vbox and then do nothing with the result. To minimize
+ % the change of memory overflow, we follow the approach outlined on
+ % page 401 of the TeXbook: make the current font be a dummy font.
+ %
+ \setbox0 = \vbox\bgroup
+ % Don't complain about control sequences we have declared \outer.
+ \ignoresections
+ %
+ % Define `@end #1' to end the box, which will in turn undefine the
+ % @end command again.
+ \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}%
+ %
+ % We are going to be parsing Texinfo commands. Most cause no
+ % trouble when they are used incorrectly, but some commands do
+ % complicated argument parsing or otherwise get confused, so we
+ % undefine them.
+ %
+ % We can't do anything about stray @-signs, unfortunately;
+ % they'll produce `undefined control sequence' errors.
+ \ignoremorecommands
+ %
+ % Set the current font to be \nullfont, a TeX primitive, and define
+ % all the font commands to also use \nullfont. We don't use
+ % dummy.tfm, as suggested in the TeXbook, because not all sites
+ % might have that installed. Therefore, math mode will still
+ % produce output, but that should be an extremely small amount of
+ % stuff compared to the main input.
+ %
+ \nullfont
+ \let\tenrm=\nullfont \let\tenit=\nullfont \let\tensl=\nullfont
+ \let\tenbf=\nullfont \let\tentt=\nullfont \let\smallcaps=\nullfont
+ \let\tensf=\nullfont
+ % Similarly for index fonts (mostly for their use in smallexample).
+ \let\smallrm=\nullfont \let\smallit=\nullfont \let\smallsl=\nullfont
+ \let\smallbf=\nullfont \let\smalltt=\nullfont \let\smallsc=\nullfont
+ \let\smallsf=\nullfont
+ %
+ % Don't complain when characters are missing from the fonts.
+ \tracinglostchars = 0
+ %
+ % Don't bother to do space factor calculations.
+ \frenchspacing
+ %
+ % Don't report underfull hboxes.
+ \hbadness = 10000
+ %
+ % Do minimal line-breaking.
+ \pretolerance = 10000
+ %
+ % Do not execute instructions in @tex
+ \def\tex{\doignore{tex}}%
+ % Do not execute macro definitions.
+ % `c' is a comment character, so the word `macro' will get cut off.
+ \def\macro{\doignore{ma}}%
+}
+
+% @set VAR sets the variable VAR to an empty value.
+% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
+%
+% Since we want to separate VAR from REST-OF-LINE (which might be
+% empty), we can't just use \parsearg; we have to insert a space of our
+% own to delimit the rest of the line, and then take it out again if we
+% didn't need it. Make sure the catcode of space is correct to avoid
+% losing inside @example, for instance.
+%
+\def\set{\begingroup\catcode` =10
+ \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR.
+ \parsearg\setxxx}
+\def\setxxx#1{\setyyy#1 \endsetyyy}
+\def\setyyy#1 #2\endsetyyy{%
+ \def\temp{#2}%
+ \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty
+ \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
+ \fi
+ \endgroup
+}
+% Can't use \xdef to pre-expand #2 and save some time, since \temp or
+% \next or other control sequences that we've defined might get us into
+% an infinite loop. Consider `@set foo @cite{bar}'.
+\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}}
+
+% @clear VAR clears (i.e., unsets) the variable VAR.
+%
+\def\clear{\parsearg\clearxxx}
+\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax}
+
+% @value{foo} gets the text saved in variable foo.
+{
+ \catcode`\_ = \active
+ %
+ % We might end up with active _ or - characters in the argument if
+ % we're called from @code, as @code{@value{foo-bar_}}. So \let any
+ % such active characters to their normal equivalents.
+ \gdef\value{\begingroup
+ \catcode`\-=12 \catcode`\_=12
+ \indexbreaks \let_\normalunderscore
+ \valuexxx}
+}
+\def\valuexxx#1{\expandablevalue{#1}\endgroup}
+
+% We have this subroutine so that we can handle at least some @value's
+% properly in indexes (we \let\value to this in \indexdummies). Ones
+% whose names contain - or _ still won't work, but we can't do anything
+% about that. The command has to be fully expandable, since the result
+% winds up in the index file. This means that if the variable's value
+% contains other Texinfo commands, it's almost certain it will fail
+% (although perhaps we could fix that with sufficient work to do a
+% one-level expansion on the result, instead of complete).
+%
+\def\expandablevalue#1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ {[No value for ``#1'']}%
+ \else
+ \csname SET#1\endcsname
+ \fi
+}
+
+% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
+% with @set.
+%
+\def\ifset{\parsearg\ifsetxxx}
+\def\ifsetxxx #1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ \expandafter\ifsetfail
+ \else
+ \expandafter\ifsetsucceed
+ \fi
+}
+\def\ifsetsucceed{\conditionalsucceed{ifset}}
+\def\ifsetfail{\nestedignore{ifset}}
+\defineunmatchedend{ifset}
+
+% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
+% defined with @set, or has been undefined with @clear.
+%
+\def\ifclear{\parsearg\ifclearxxx}
+\def\ifclearxxx #1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ \expandafter\ifclearsucceed
+ \else
+ \expandafter\ifclearfail
+ \fi
+}
+\def\ifclearsucceed{\conditionalsucceed{ifclear}}
+\def\ifclearfail{\nestedignore{ifclear}}
+\defineunmatchedend{ifclear}
+
+% @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text
+% following, through the first @end iftex (etc.). Make `@end iftex'
+% (etc.) valid only after an @iftex.
+%
+\def\iftex{\conditionalsucceed{iftex}}
+\def\ifnothtml{\conditionalsucceed{ifnothtml}}
+\def\ifnotinfo{\conditionalsucceed{ifnotinfo}}
+\defineunmatchedend{iftex}
+\defineunmatchedend{ifnothtml}
+\defineunmatchedend{ifnotinfo}
+
+% We can't just want to start a group at @iftex (for example) and end it
+% at @end iftex, since then @set commands inside the conditional have no
+% effect (they'd get reverted at the end of the group). So we must
+% define \Eiftex to redefine itself to be its previous value. (We can't
+% just define it to fail again with an ``unmatched end'' error, since
+% the @ifset might be nested.)
+%
+\def\conditionalsucceed#1{%
+ \edef\temp{%
+ % Remember the current value of \E#1.
+ \let\nece{prevE#1} = \nece{E#1}%
+ %
+ % At the `@end #1', redefine \E#1 to be its previous value.
+ \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}%
+ }%
+ \temp
+}
+
+% We need to expand lots of \csname's, but we don't want to expand the
+% control sequences after we've constructed them.
+%
+\def\nece#1{\expandafter\noexpand\csname#1\endcsname}
+
+% @defininfoenclose.
+\let\definfoenclose=\comment
+
+
+\message{indexing,}
+% Index generation facilities
+
+% Define \newwrite to be identical to plain tex's \newwrite
+% except not \outer, so it can be used within \newindex.
+{\catcode`\@=11
+\gdef\newwrite{\alloc@7\write\chardef\sixt@@n}}
+
+% \newindex {foo} defines an index named foo.
+% It automatically defines \fooindex such that
+% \fooindex ...rest of line... puts an entry in the index foo.
+% It also defines \fooindfile to be the number of the output channel for
+% the file that accumulates this index. The file's extension is foo.
+% The name of an index should be no more than 2 characters long
+% for the sake of vms.
+%
+\def\newindex#1{%
+ \iflinks
+ \expandafter\newwrite \csname#1indfile\endcsname
+ \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
+ \fi
+ \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
+ \noexpand\doindex{#1}}
+}
+
+% @defindex foo == \newindex{foo}
+%
+\def\defindex{\parsearg\newindex}
+
+% Define @defcodeindex, like @defindex except put all entries in @code.
+%
+\def\defcodeindex{\parsearg\newcodeindex}
+%
+\def\newcodeindex#1{%
+ \iflinks
+ \expandafter\newwrite \csname#1indfile\endcsname
+ \openout \csname#1indfile\endcsname \jobname.#1
+ \fi
+ \expandafter\xdef\csname#1index\endcsname{%
+ \noexpand\docodeindex{#1}}%
+}
+
+
+% @synindex foo bar makes index foo feed into index bar.
+% Do this instead of @defindex foo if you don't want it as a separate index.
+%
+% @syncodeindex foo bar similar, but put all entries made for index foo
+% inside @code.
+%
+\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
+\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
+
+% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
+% #3 the target index (bar).
+\def\dosynindex#1#2#3{%
+ % Only do \closeout if we haven't already done it, else we'll end up
+ % closing the target index.
+ \expandafter \ifx\csname donesynindex#2\endcsname \undefined
+ % The \closeout helps reduce unnecessary open files; the limit on the
+ % Acorn RISC OS is a mere 16 files.
+ \expandafter\closeout\csname#2indfile\endcsname
+ \expandafter\let\csname\donesynindex#2\endcsname = 1
+ \fi
+ % redefine \fooindfile:
+ \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
+ \expandafter\let\csname#2indfile\endcsname=\temp
+ % redefine \fooindex:
+ \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
+}
+
+% Define \doindex, the driver for all \fooindex macros.
+% Argument #1 is generated by the calling \fooindex macro,
+% and it is "foo", the name of the index.
+
+% \doindex just uses \parsearg; it calls \doind for the actual work.
+% This is because \doind is more useful to call from other macros.
+
+% There is also \dosubind {index}{topic}{subtopic}
+% which makes an entry in a two-level index such as the operation index.
+
+\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
+\def\singleindexer #1{\doind{\indexname}{#1}}
+
+% like the previous two, but they put @code around the argument.
+\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
+\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
+
+\def\indexdummies{%
+\def\ { }%
+% Take care of the plain tex accent commands.
+\def\"{\realbackslash "}%
+\def\`{\realbackslash `}%
+\def\'{\realbackslash '}%
+\def\^{\realbackslash ^}%
+\def\~{\realbackslash ~}%
+\def\={\realbackslash =}%
+\def\b{\realbackslash b}%
+\def\c{\realbackslash c}%
+\def\d{\realbackslash d}%
+\def\u{\realbackslash u}%
+\def\v{\realbackslash v}%
+\def\H{\realbackslash H}%
+% Take care of the plain tex special European modified letters.
+\def\oe{\realbackslash oe}%
+\def\ae{\realbackslash ae}%
+\def\aa{\realbackslash aa}%
+\def\OE{\realbackslash OE}%
+\def\AE{\realbackslash AE}%
+\def\AA{\realbackslash AA}%
+\def\o{\realbackslash o}%
+\def\O{\realbackslash O}%
+\def\l{\realbackslash l}%
+\def\L{\realbackslash L}%
+\def\ss{\realbackslash ss}%
+% Take care of texinfo commands likely to appear in an index entry.
+% (Must be a way to avoid doing expansion at all, and thus not have to
+% laboriously list every single command here.)
+\def\@{@}% will be @@ when we switch to @ as escape char.
+% Need these in case \tex is in effect and \{ is a \delimiter again.
+% But can't use \lbracecmd and \rbracecmd because texindex assumes
+% braces and backslashes are used only as delimiters.
+\let\{ = \mylbrace
+\let\} = \myrbrace
+\def\_{{\realbackslash _}}%
+\def\w{\realbackslash w }%
+\def\bf{\realbackslash bf }%
+%\def\rm{\realbackslash rm }%
+\def\sl{\realbackslash sl }%
+\def\sf{\realbackslash sf}%
+\def\tt{\realbackslash tt}%
+\def\gtr{\realbackslash gtr}%
+\def\less{\realbackslash less}%
+\def\hat{\realbackslash hat}%
+\def\TeX{\realbackslash TeX}%
+\def\dots{\realbackslash dots }%
+\def\result{\realbackslash result}%
+\def\equiv{\realbackslash equiv}%
+\def\expansion{\realbackslash expansion}%
+\def\print{\realbackslash print}%
+\def\error{\realbackslash error}%
+\def\point{\realbackslash point}%
+\def\copyright{\realbackslash copyright}%
+\def\tclose##1{\realbackslash tclose {##1}}%
+\def\code##1{\realbackslash code {##1}}%
+\def\uref##1{\realbackslash uref {##1}}%
+\def\url##1{\realbackslash url {##1}}%
+\def\env##1{\realbackslash env {##1}}%
+\def\command##1{\realbackslash command {##1}}%
+\def\option##1{\realbackslash option {##1}}%
+\def\dotless##1{\realbackslash dotless {##1}}%
+\def\samp##1{\realbackslash samp {##1}}%
+\def\,##1{\realbackslash ,{##1}}%
+\def\t##1{\realbackslash t {##1}}%
+\def\r##1{\realbackslash r {##1}}%
+\def\i##1{\realbackslash i {##1}}%
+\def\b##1{\realbackslash b {##1}}%
+\def\sc##1{\realbackslash sc {##1}}%
+\def\cite##1{\realbackslash cite {##1}}%
+\def\key##1{\realbackslash key {##1}}%
+\def\file##1{\realbackslash file {##1}}%
+\def\var##1{\realbackslash var {##1}}%
+\def\kbd##1{\realbackslash kbd {##1}}%
+\def\dfn##1{\realbackslash dfn {##1}}%
+\def\emph##1{\realbackslash emph {##1}}%
+\def\acronym##1{\realbackslash acronym {##1}}%
+%
+% Handle some cases of @value -- where the variable name does not
+% contain - or _, and the value does not contain any
+% (non-fully-expandable) commands.
+\let\value = \expandablevalue
+%
+\unsepspaces
+% Turn off macro expansion
+\turnoffmacros
+}
+
+% If an index command is used in an @example environment, any spaces
+% therein should become regular spaces in the raw index file, not the
+% expansion of \tie (\\leavevmode \penalty \@M \ ).
+{\obeyspaces
+ \gdef\unsepspaces{\obeyspaces\let =\space}}
+
+% \indexnofonts no-ops all font-change commands.
+% This is used when outputting the strings to sort the index by.
+\def\indexdummyfont#1{#1}
+\def\indexdummytex{TeX}
+\def\indexdummydots{...}
+
+\def\indexnofonts{%
+% Just ignore accents.
+\let\,=\indexdummyfont
+\let\"=\indexdummyfont
+\let\`=\indexdummyfont
+\let\'=\indexdummyfont
+\let\^=\indexdummyfont
+\let\~=\indexdummyfont
+\let\==\indexdummyfont
+\let\b=\indexdummyfont
+\let\c=\indexdummyfont
+\let\d=\indexdummyfont
+\let\u=\indexdummyfont
+\let\v=\indexdummyfont
+\let\H=\indexdummyfont
+\let\dotless=\indexdummyfont
+% Take care of the plain tex special European modified letters.
+\def\oe{oe}%
+\def\ae{ae}%
+\def\aa{aa}%
+\def\OE{OE}%
+\def\AE{AE}%
+\def\AA{AA}%
+\def\o{o}%
+\def\O{O}%
+\def\l{l}%
+\def\L{L}%
+\def\ss{ss}%
+\let\w=\indexdummyfont
+\let\t=\indexdummyfont
+\let\r=\indexdummyfont
+\let\i=\indexdummyfont
+\let\b=\indexdummyfont
+\let\emph=\indexdummyfont
+\let\strong=\indexdummyfont
+\let\cite=\indexdummyfont
+\let\sc=\indexdummyfont
+%Don't no-op \tt, since it isn't a user-level command
+% and is used in the definitions of the active chars like <, >, |...
+%\let\tt=\indexdummyfont
+\let\tclose=\indexdummyfont
+\let\code=\indexdummyfont
+\let\url=\indexdummyfont
+\let\uref=\indexdummyfont
+\let\env=\indexdummyfont
+\let\acronym=\indexdummyfont
+\let\command=\indexdummyfont
+\let\option=\indexdummyfont
+\let\file=\indexdummyfont
+\let\samp=\indexdummyfont
+\let\kbd=\indexdummyfont
+\let\key=\indexdummyfont
+\let\var=\indexdummyfont
+\let\TeX=\indexdummytex
+\let\dots=\indexdummydots
+\def\@{@}%
+}
+
+% To define \realbackslash, we must make \ not be an escape.
+% We must first make another character (@) an escape
+% so we do not become unable to do a definition.
+
+{\catcode`\@=0 \catcode`\\=\other
+ @gdef@realbackslash{\}}
+
+\let\indexbackslash=0 %overridden during \printindex.
+\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
+
+% For \ifx comparisons.
+\def\emptymacro{\empty}
+
+% Most index entries go through here, but \dosubind is the general case.
+%
+\def\doind#1#2{\dosubind{#1}{#2}\empty}
+
+% Workhorse for all \fooindexes.
+% #1 is name of index, #2 is stuff to put there, #3 is subentry --
+% \empty if called from \doind, as we usually are. The main exception
+% is with defuns, which call us directly.
+%
+\def\dosubind#1#2#3{%
+ % Put the index entry in the margin if desired.
+ \ifx\SETmarginindex\relax\else
+ \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}%
+ \fi
+ {%
+ \count255=\lastpenalty
+ {%
+ \indexdummies % Must do this here, since \bf, etc expand at this stage
+ \escapechar=`\\
+ {%
+ \let\folio = 0% We will expand all macros now EXCEPT \folio.
+ \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
+ % so it will be output as is; and it will print as backslash.
+ %
+ \def\thirdarg{#3}%
+ %
+ % If third arg is present, precede it with space in sort key.
+ \ifx\thirdarg\emptymacro
+ \let\subentry = \empty
+ \else
+ \def\subentry{ #3}%
+ \fi
+ %
+ % First process the index entry with all font commands turned
+ % off to get the string to sort by.
+ {\indexnofonts \xdef\indexsorttmp{#2\subentry}}%
+ %
+ % Now the real index entry with the fonts.
+ \toks0 = {#2}%
+ %
+ % If third (subentry) arg is present, add it to the index
+ % string. And include a space.
+ \ifx\thirdarg\emptymacro \else
+ \toks0 = \expandafter{\the\toks0 \space #3}%
+ \fi
+ %
+ % Set up the complete index entry, with both the sort key
+ % and the original text, including any font commands. We write
+ % three arguments to \entry to the .?? file, texindex reduces to
+ % two when writing the .??s sorted result.
+ \edef\temp{%
+ \write\csname#1indfile\endcsname{%
+ \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}%
+ }%
+ %
+ % If a skip is the last thing on the list now, preserve it
+ % by backing up by \lastskip, doing the \write, then inserting
+ % the skip again. Otherwise, the whatsit generated by the
+ % \write will make \lastskip zero. The result is that sequences
+ % like this:
+ % @end defun
+ % @tindex whatever
+ % @defun ...
+ % will have extra space inserted, because the \medbreak in the
+ % start of the @defun won't see the skip inserted by the @end of
+ % the previous defun.
+ %
+ % But don't do any of this if we're not in vertical mode. We
+ % don't want to do a \vskip and prematurely end a paragraph.
+ %
+ % Avoid page breaks due to these extra skips, too.
+ %
+ \iflinks
+ \ifvmode
+ \skip0 = \lastskip
+ \ifdim\lastskip = 0pt \else \nobreak\vskip-\lastskip \fi
+ \fi
+ %
+ \temp % do the write
+ %
+ %
+ \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi
+ \fi
+ }%
+ }%
+ \penalty\count255
+ }%
+}
+
+% The index entry written in the file actually looks like
+% \entry {sortstring}{page}{topic}
+% or
+% \entry {sortstring}{page}{topic}{subtopic}
+% The texindex program reads in these files and writes files
+% containing these kinds of lines:
+% \initial {c}
+% before the first topic whose initial is c
+% \entry {topic}{pagelist}
+% for a topic that is used without subtopics
+% \primary {topic}
+% for the beginning of a topic that is used with subtopics
+% \secondary {subtopic}{pagelist}
+% for each subtopic.
+
+% Define the user-accessible indexing commands
+% @findex, @vindex, @kindex, @cindex.
+
+\def\findex {\fnindex}
+\def\kindex {\kyindex}
+\def\cindex {\cpindex}
+\def\vindex {\vrindex}
+\def\tindex {\tpindex}
+\def\pindex {\pgindex}
+
+\def\cindexsub {\begingroup\obeylines\cindexsub}
+{\obeylines %
+\gdef\cindexsub "#1" #2^^M{\endgroup %
+\dosubind{cp}{#2}{#1}}}
+
+% Define the macros used in formatting output of the sorted index material.
+
+% @printindex causes a particular index (the ??s file) to get printed.
+% It does not print any chapter heading (usually an @unnumbered).
+%
+\def\printindex{\parsearg\doprintindex}
+\def\doprintindex#1{\begingroup
+ \dobreak \chapheadingskip{10000}%
+ %
+ \smallfonts \rm
+ \tolerance = 9500
+ \indexbreaks
+ %
+ % See if the index file exists and is nonempty.
+ % Change catcode of @ here so that if the index file contains
+ % \initial {@}
+ % as its first line, TeX doesn't complain about mismatched braces
+ % (because it thinks @} is a control sequence).
+ \catcode`\@ = 11
+ \openin 1 \jobname.#1s
+ \ifeof 1
+ % \enddoublecolumns gets confused if there is no text in the index,
+ % and it loses the chapter title and the aux file entries for the
+ % index. The easiest way to prevent this problem is to make sure
+ % there is some text.
+ \putwordIndexNonexistent
+ \else
+ %
+ % If the index file exists but is empty, then \openin leaves \ifeof
+ % false. We have to make TeX try to read something from the file, so
+ % it can discover if there is anything in it.
+ \read 1 to \temp
+ \ifeof 1
+ \putwordIndexIsEmpty
+ \else
+ % Index files are almost Texinfo source, but we use \ as the escape
+ % character. It would be better to use @, but that's too big a change
+ % to make right now.
+ \def\indexbackslash{\rawbackslashxx}%
+ \catcode`\\ = 0
+ \escapechar = `\\
+ \begindoublecolumns
+ \input \jobname.#1s
+ \enddoublecolumns
+ \fi
+ \fi
+ \closein 1
+\endgroup}
+
+% These macros are used by the sorted index file itself.
+% Change them to control the appearance of the index.
+
+\def\initial#1{{%
+ % Some minor font changes for the special characters.
+ \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
+ %
+ % Remove any glue we may have, we'll be inserting our own.
+ \removelastskip
+ %
+ % We like breaks before the index initials, so insert a bonus.
+ \penalty -300
+ %
+ % Typeset the initial. Making this add up to a whole number of
+ % baselineskips increases the chance of the dots lining up from column
+ % to column. It still won't often be perfect, because of the stretch
+ % we need before each entry, but it's better.
+ %
+ % No shrink because it confuses \balancecolumns.
+ \vskip 1.67\baselineskip plus .5\baselineskip
+ \leftline{\secbf #1}%
+ \vskip .33\baselineskip plus .1\baselineskip
+ %
+ % Do our best not to break after the initial.
+ \nobreak
+}}
+
+% This typesets a paragraph consisting of #1, dot leaders, and then #2
+% flush to the right margin. It is used for index and table of contents
+% entries. The paragraph is indented by \leftskip.
+%
+\def\entry#1#2{\begingroup
+ %
+ % Start a new paragraph if necessary, so our assignments below can't
+ % affect previous text.
+ \par
+ %
+ % Do not fill out the last line with white space.
+ \parfillskip = 0in
+ %
+ % No extra space above this paragraph.
+ \parskip = 0in
+ %
+ % Do not prefer a separate line ending with a hyphen to fewer lines.
+ \finalhyphendemerits = 0
+ %
+ % \hangindent is only relevant when the entry text and page number
+ % don't both fit on one line. In that case, bob suggests starting the
+ % dots pretty far over on the line. Unfortunately, a large
+ % indentation looks wrong when the entry text itself is broken across
+ % lines. So we use a small indentation and put up with long leaders.
+ %
+ % \hangafter is reset to 1 (which is the value we want) at the start
+ % of each paragraph, so we need not do anything with that.
+ \hangindent = 2em
+ %
+ % When the entry text needs to be broken, just fill out the first line
+ % with blank space.
+ \rightskip = 0pt plus1fil
+ %
+ % A bit of stretch before each entry for the benefit of balancing columns.
+ \vskip 0pt plus1pt
+ %
+ % Start a ``paragraph'' for the index entry so the line breaking
+ % parameters we've set above will have an effect.
+ \noindent
+ %
+ % Insert the text of the index entry. TeX will do line-breaking on it.
+ #1%
+ % The following is kludged to not output a line of dots in the index if
+ % there are no page numbers. The next person who breaks this will be
+ % cursed by a Unix daemon.
+ \def\tempa{{\rm }}%
+ \def\tempb{#2}%
+ \edef\tempc{\tempa}%
+ \edef\tempd{\tempb}%
+ \ifx\tempc\tempd\ \else%
+ %
+ % If we must, put the page number on a line of its own, and fill out
+ % this line with blank space. (The \hfil is overwhelmed with the
+ % fill leaders glue in \indexdotfill if the page number does fit.)
+ \hfil\penalty50
+ \null\nobreak\indexdotfill % Have leaders before the page number.
+ %
+ % The `\ ' here is removed by the implicit \unskip that TeX does as
+ % part of (the primitive) \par. Without it, a spurious underfull
+ % \hbox ensues.
+ \ifpdf
+ \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
+ \else
+ \ #2% The page number ends the paragraph.
+ \fi
+ \fi%
+ \par
+\endgroup}
+
+% Like \dotfill except takes at least 1 em.
+\def\indexdotfill{\cleaders
+ \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill}
+
+\def\primary #1{\line{#1\hfil}}
+
+\newskip\secondaryindent \secondaryindent=0.5cm
+
+\def\secondary #1#2{
+{\parfillskip=0in \parskip=0in
+\hangindent =1in \hangafter=1
+\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
+}}
+
+% Define two-column mode, which we use to typeset indexes.
+% Adapted from the TeXbook, page 416, which is to say,
+% the manmac.tex format used to print the TeXbook itself.
+\catcode`\@=11
+
+\newbox\partialpage
+\newdimen\doublecolumnhsize
+
+\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
+ % Grab any single-column material above us.
+ \output = {%
+ %
+ % Here is a possibility not foreseen in manmac: if we accumulate a
+ % whole lot of material, we might end up calling this \output
+ % routine twice in a row (see the doublecol-lose test, which is
+ % essentially a couple of indexes with @setchapternewpage off). In
+ % that case we just ship out what is in \partialpage with the normal
+ % output routine. Generally, \partialpage will be empty when this
+ % runs and this will be a no-op. See the indexspread.tex test case.
+ \ifvoid\partialpage \else
+ \onepageout{\pagecontents\partialpage}%
+ \fi
+ %
+ \global\setbox\partialpage = \vbox{%
+ % Unvbox the main output page.
+ \unvbox\PAGE
+ \kern-\topskip \kern\baselineskip
+ }%
+ }%
+ \eject % run that output routine to set \partialpage
+ %
+ % Use the double-column output routine for subsequent pages.
+ \output = {\doublecolumnout}%
+ %
+ % Change the page size parameters. We could do this once outside this
+ % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
+ % format, but then we repeat the same computation. Repeating a couple
+ % of assignments once per index is clearly meaningless for the
+ % execution time, so we may as well do it in one place.
+ %
+ % First we halve the line length, less a little for the gutter between
+ % the columns. We compute the gutter based on the line length, so it
+ % changes automatically with the paper format. The magic constant
+ % below is chosen so that the gutter has the same value (well, +-<1pt)
+ % as it did when we hard-coded it.
+ %
+ % We put the result in a separate register, \doublecolumhsize, so we
+ % can restore it in \pagesofar, after \hsize itself has (potentially)
+ % been clobbered.
+ %
+ \doublecolumnhsize = \hsize
+ \advance\doublecolumnhsize by -.04154\hsize
+ \divide\doublecolumnhsize by 2
+ \hsize = \doublecolumnhsize
+ %
+ % Double the \vsize as well. (We don't need a separate register here,
+ % since nobody clobbers \vsize.)
+ \vsize = 2\vsize
+}
+
+% The double-column output routine for all double-column pages except
+% the last.
+%
+\def\doublecolumnout{%
+ \splittopskip=\topskip \splitmaxdepth=\maxdepth
+ % Get the available space for the double columns -- the normal
+ % (undoubled) page height minus any material left over from the
+ % previous page.
+ \dimen@ = \vsize
+ \divide\dimen@ by 2
+ \advance\dimen@ by -\ht\partialpage
+ %
+ % box0 will be the left-hand column, box2 the right.
+ \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
+ \onepageout\pagesofar
+ \unvbox255
+ \penalty\outputpenalty
+}
+%
+% Re-output the contents of the output page -- any previous material,
+% followed by the two boxes we just split, in box0 and box2.
+\def\pagesofar{%
+ \unvbox\partialpage
+ %
+ \hsize = \doublecolumnhsize
+ \wd0=\hsize \wd2=\hsize
+ \hbox to\pagewidth{\box0\hfil\box2}%
+}
+%
+% All done with double columns.
+\def\enddoublecolumns{%
+ \output = {%
+ % Split the last of the double-column material. Leave it on the
+ % current page, no automatic page break.
+ \balancecolumns
+ %
+ % If we end up splitting too much material for the current page,
+ % though, there will be another page break right after this \output
+ % invocation ends. Having called \balancecolumns once, we do not
+ % want to call it again. Therefore, reset \output to its normal
+ % definition right away. (We hope \balancecolumns will never be
+ % called on to balance too much material, but if it is, this makes
+ % the output somewhat more palatable.)
+ \global\output = {\onepageout{\pagecontents\PAGE}}%
+ }%
+ \eject
+ \endgroup % started in \begindoublecolumns
+ %
+ % \pagegoal was set to the doubled \vsize above, since we restarted
+ % the current page. We're now back to normal single-column
+ % typesetting, so reset \pagegoal to the normal \vsize (after the
+ % \endgroup where \vsize got restored).
+ \pagegoal = \vsize
+}
+%
+% Called at the end of the double column material.
+\def\balancecolumns{%
+ \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
+ \dimen@ = \ht0
+ \advance\dimen@ by \topskip
+ \advance\dimen@ by-\baselineskip
+ \divide\dimen@ by 2 % target to split to
+ %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
+ \splittopskip = \topskip
+ % Loop until we get a decent breakpoint.
+ {%
+ \vbadness = 10000
+ \loop
+ \global\setbox3 = \copy0
+ \global\setbox1 = \vsplit3 to \dimen@
+ \ifdim\ht3>\dimen@
+ \global\advance\dimen@ by 1pt
+ \repeat
+ }%
+ %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
+ \setbox0=\vbox to\dimen@{\unvbox1}%
+ \setbox2=\vbox to\dimen@{\unvbox3}%
+ %
+ \pagesofar
+}
+\catcode`\@ = \other
+
+
+\message{sectioning,}
+% Chapters, sections, etc.
+
+\newcount\chapno
+\newcount\secno \secno=0
+\newcount\subsecno \subsecno=0
+\newcount\subsubsecno \subsubsecno=0
+
+% This counter is funny since it counts through charcodes of letters A, B, ...
+\newcount\appendixno \appendixno = `\@
+% \def\appendixletter{\char\the\appendixno}
+% We do the following for the sake of pdftex, which needs the actual
+% letter in the expansion, not just typeset.
+\def\appendixletter{%
+ \ifnum\appendixno=`A A%
+ \else\ifnum\appendixno=`B B%
+ \else\ifnum\appendixno=`C C%
+ \else\ifnum\appendixno=`D D%
+ \else\ifnum\appendixno=`E E%
+ \else\ifnum\appendixno=`F F%
+ \else\ifnum\appendixno=`G G%
+ \else\ifnum\appendixno=`H H%
+ \else\ifnum\appendixno=`I I%
+ \else\ifnum\appendixno=`J J%
+ \else\ifnum\appendixno=`K K%
+ \else\ifnum\appendixno=`L L%
+ \else\ifnum\appendixno=`M M%
+ \else\ifnum\appendixno=`N N%
+ \else\ifnum\appendixno=`O O%
+ \else\ifnum\appendixno=`P P%
+ \else\ifnum\appendixno=`Q Q%
+ \else\ifnum\appendixno=`R R%
+ \else\ifnum\appendixno=`S S%
+ \else\ifnum\appendixno=`T T%
+ \else\ifnum\appendixno=`U U%
+ \else\ifnum\appendixno=`V V%
+ \else\ifnum\appendixno=`W W%
+ \else\ifnum\appendixno=`X X%
+ \else\ifnum\appendixno=`Y Y%
+ \else\ifnum\appendixno=`Z Z%
+ % The \the is necessary, despite appearances, because \appendixletter is
+ % expanded while writing the .toc file. \char\appendixno is not
+ % expandable, thus it is written literally, thus all appendixes come out
+ % with the same letter (or @) in the toc without it.
+ \else\char\the\appendixno
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
+
+% Each @chapter defines this as the name of the chapter.
+% page headings and footings can use it. @section does likewise.
+\def\thischapter{}
+\def\thissection{}
+
+\newcount\absseclevel % used to calculate proper heading level
+\newcount\secbase\secbase=0 % @raise/lowersections modify this count
+
+% @raisesections: treat @section as chapter, @subsection as section, etc.
+\def\raisesections{\global\advance\secbase by -1}
+\let\up=\raisesections % original BFox name
+
+% @lowersections: treat @chapter as section, @section as subsection, etc.
+\def\lowersections{\global\advance\secbase by 1}
+\let\down=\lowersections % original BFox name
+
+% Choose a numbered-heading macro
+% #1 is heading level if unmodified by @raisesections or @lowersections
+% #2 is text for heading
+\def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
+\ifcase\absseclevel
+ \chapterzzz{#2}
+\or
+ \seczzz{#2}
+\or
+ \numberedsubseczzz{#2}
+\or
+ \numberedsubsubseczzz{#2}
+\else
+ \ifnum \absseclevel<0
+ \chapterzzz{#2}
+ \else
+ \numberedsubsubseczzz{#2}
+ \fi
+\fi
+}
+
+% like \numhead, but chooses appendix heading levels
+\def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
+\ifcase\absseclevel
+ \appendixzzz{#2}
+\or
+ \appendixsectionzzz{#2}
+\or
+ \appendixsubseczzz{#2}
+\or
+ \appendixsubsubseczzz{#2}
+\else
+ \ifnum \absseclevel<0
+ \appendixzzz{#2}
+ \else
+ \appendixsubsubseczzz{#2}
+ \fi
+\fi
+}
+
+% like \numhead, but chooses numberless heading levels
+\def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
+\ifcase\absseclevel
+ \unnumberedzzz{#2}
+\or
+ \unnumberedseczzz{#2}
+\or
+ \unnumberedsubseczzz{#2}
+\or
+ \unnumberedsubsubseczzz{#2}
+\else
+ \ifnum \absseclevel<0
+ \unnumberedzzz{#2}
+ \else
+ \unnumberedsubsubseczzz{#2}
+ \fi
+\fi
+}
+
+% @chapter, @appendix, @unnumbered.
+\def\thischaptername{No Chapter Title}
+\outer\def\chapter{\parsearg\chapteryyy}
+\def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
+\def\chapterzzz #1{%
+\secno=0 \subsecno=0 \subsubsecno=0
+\global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}%
+\chapmacro {#1}{\the\chapno}%
+\gdef\thissection{#1}%
+\gdef\thischaptername{#1}%
+% We don't substitute the actual chapter name into \thischapter
+% because we don't want its macros evaluated now.
+\xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}%
+ {\the\chapno}}}%
+\temp
+\donoderef
+\global\let\section = \numberedsec
+\global\let\subsection = \numberedsubsec
+\global\let\subsubsection = \numberedsubsubsec
+}
+
+\outer\def\appendix{\parsearg\appendixyyy}
+\def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
+\def\appendixzzz #1{%
+\secno=0 \subsecno=0 \subsubsecno=0
+\global\advance \appendixno by 1
+\message{\putwordAppendix\space \appendixletter}%
+\chapmacro {#1}{\putwordAppendix{} \appendixletter}%
+\gdef\thissection{#1}%
+\gdef\thischaptername{#1}%
+\xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}%
+ {\putwordAppendix{} \appendixletter}}}%
+\temp
+\appendixnoderef
+\global\let\section = \appendixsec
+\global\let\subsection = \appendixsubsec
+\global\let\subsubsection = \appendixsubsubsec
+}
+
+% @centerchap is like @unnumbered, but the heading is centered.
+\outer\def\centerchap{\parsearg\centerchapyyy}
+\def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}}
+
+% @top is like @unnumbered.
+\outer\def\top{\parsearg\unnumberedyyy}
+
+\outer\def\unnumbered{\parsearg\unnumberedyyy}
+\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
+\def\unnumberedzzz #1{%
+\secno=0 \subsecno=0 \subsubsecno=0
+%
+% This used to be simply \message{#1}, but TeX fully expands the
+% argument to \message. Therefore, if #1 contained @-commands, TeX
+% expanded them. For example, in `@unnumbered The @cite{Book}', TeX
+% expanded @cite (which turns out to cause errors because \cite is meant
+% to be executed, not expanded).
+%
+% Anyway, we don't want the fully-expanded definition of @cite to appear
+% as a result of the \message, we just want `@cite' itself. We use
+% \the<toks register> to achieve this: TeX expands \the<toks> only once,
+% simply yielding the contents of <toks register>. (We also do this for
+% the toc entries.)
+\toks0 = {#1}\message{(\the\toks0)}%
+%
+\unnumbchapmacro {#1}%
+\gdef\thischapter{#1}\gdef\thissection{#1}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash unnumbchapentry{\the\toks0}}}%
+\temp
+\unnumbnoderef
+\global\let\section = \unnumberedsec
+\global\let\subsection = \unnumberedsubsec
+\global\let\subsubsection = \unnumberedsubsubsec
+}
+
+% Sections.
+\outer\def\numberedsec{\parsearg\secyyy}
+\def\secyyy #1{\numhead1{#1}} % normally calls seczzz
+\def\seczzz #1{%
+\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
+\gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
+ {\the\chapno}{\the\secno}}}%
+\temp
+\donoderef
+\nobreak
+}
+
+\outer\def\appendixsection{\parsearg\appendixsecyyy}
+\outer\def\appendixsec{\parsearg\appendixsecyyy}
+\def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
+\def\appendixsectionzzz #1{%
+\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
+\gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
+ {\appendixletter}{\the\secno}}}%
+\temp
+\appendixnoderef
+\nobreak
+}
+
+\outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
+\def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
+\def\unnumberedseczzz #1{%
+\plainsecheading {#1}\gdef\thissection{#1}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry{\the\toks0}}}%
+\temp
+\unnumbnoderef
+\nobreak
+}
+
+% Subsections.
+\outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
+\def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
+\def\numberedsubseczzz #1{%
+\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
+\subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
+ {\the\chapno}{\the\secno}{\the\subsecno}}}%
+\temp
+\donoderef
+\nobreak
+}
+
+\outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
+\def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
+\def\appendixsubseczzz #1{%
+\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
+\subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
+ {\appendixletter}{\the\secno}{\the\subsecno}}}%
+\temp
+\appendixnoderef
+\nobreak
+}
+
+\outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
+\def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
+\def\unnumberedsubseczzz #1{%
+\plainsubsecheading {#1}\gdef\thissection{#1}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry%
+ {\the\toks0}}}%
+\temp
+\unnumbnoderef
+\nobreak
+}
+
+% Subsubsections.
+\outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
+\def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
+\def\numberedsubsubseczzz #1{%
+\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
+\subsubsecheading {#1}
+ {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
+ {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
+\temp
+\donoderef
+\nobreak
+}
+
+\outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
+\def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
+\def\appendixsubsubseczzz #1{%
+\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
+\subsubsecheading {#1}
+ {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
+ {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
+\temp
+\appendixnoderef
+\nobreak
+}
+
+\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
+\def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
+\def\unnumberedsubsubseczzz #1{%
+\plainsubsubsecheading {#1}\gdef\thissection{#1}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry%
+ {\the\toks0}}}%
+\temp
+\unnumbnoderef
+\nobreak
+}
+
+% These are variants which are not "outer", so they can appear in @ifinfo.
+% Actually, they should now be obsolete; ordinary section commands should work.
+\def\infotop{\parsearg\unnumberedzzz}
+\def\infounnumbered{\parsearg\unnumberedzzz}
+\def\infounnumberedsec{\parsearg\unnumberedseczzz}
+\def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}
+\def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
+
+\def\infoappendix{\parsearg\appendixzzz}
+\def\infoappendixsec{\parsearg\appendixseczzz}
+\def\infoappendixsubsec{\parsearg\appendixsubseczzz}
+\def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz}
+
+\def\infochapter{\parsearg\chapterzzz}
+\def\infosection{\parsearg\sectionzzz}
+\def\infosubsection{\parsearg\subsectionzzz}
+\def\infosubsubsection{\parsearg\subsubsectionzzz}
+
+% These macros control what the section commands do, according
+% to what kind of chapter we are in (ordinary, appendix, or unnumbered).
+% Define them by default for a numbered chapter.
+\global\let\section = \numberedsec
+\global\let\subsection = \numberedsubsec
+\global\let\subsubsection = \numberedsubsubsec
+
+% Define @majorheading, @heading and @subheading
+
+% NOTE on use of \vbox for chapter headings, section headings, and such:
+% 1) We use \vbox rather than the earlier \line to permit
+% overlong headings to fold.
+% 2) \hyphenpenalty is set to 10000 because hyphenation in a
+% heading is obnoxious; this forbids it.
+% 3) Likewise, headings look best if no \parindent is used, and
+% if justification is not attempted. Hence \raggedright.
+
+
+\def\majorheading{\parsearg\majorheadingzzz}
+\def\majorheadingzzz #1{%
+{\advance\chapheadingskip by 10pt \chapbreak }%
+{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt\raggedright
+ \rm #1\hfill}}\bigskip \par\penalty 200}
+
+\def\chapheading{\parsearg\chapheadingzzz}
+\def\chapheadingzzz #1{\chapbreak %
+{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt\raggedright
+ \rm #1\hfill}}\bigskip \par\penalty 200}
+
+% @heading, @subheading, @subsubheading.
+\def\heading{\parsearg\plainsecheading}
+\def\subheading{\parsearg\plainsubsecheading}
+\def\subsubheading{\parsearg\plainsubsubsecheading}
+
+% These macros generate a chapter, section, etc. heading only
+% (including whitespace, linebreaking, etc. around it),
+% given all the information in convenient, parsed form.
+
+%%% Args are the skip and penalty (usually negative)
+\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
+
+\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
+
+%%% Define plain chapter starts, and page on/off switching for it
+% Parameter controlling skip before chapter headings (if needed)
+
+\newskip\chapheadingskip
+
+\def\chapbreak{\dobreak \chapheadingskip {-4000}}
+\def\chappager{\par\vfill\supereject}
+\def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi}
+
+\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
+
+\def\CHAPPAGoff{%
+\global\let\contentsalignmacro = \chappager
+\global\let\pchapsepmacro=\chapbreak
+\global\let\pagealignmacro=\chappager}
+
+\def\CHAPPAGon{%
+\global\let\contentsalignmacro = \chappager
+\global\let\pchapsepmacro=\chappager
+\global\let\pagealignmacro=\chappager
+\global\def\HEADINGSon{\HEADINGSsingle}}
+
+\def\CHAPPAGodd{
+\global\let\contentsalignmacro = \chapoddpage
+\global\let\pchapsepmacro=\chapoddpage
+\global\let\pagealignmacro=\chapoddpage
+\global\def\HEADINGSon{\HEADINGSdouble}}
+
+\CHAPPAGon
+
+\def\CHAPFplain{
+\global\let\chapmacro=\chfplain
+\global\let\unnumbchapmacro=\unnchfplain
+\global\let\centerchapmacro=\centerchfplain}
+
+% Plain chapter opening.
+% #1 is the text, #2 the chapter number or empty if unnumbered.
+\def\chfplain#1#2{%
+ \pchapsepmacro
+ {%
+ \chapfonts \rm
+ \def\chapnum{#2}%
+ \setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}%
+ \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
+ \hangindent = \wd0 \centerparametersmaybe
+ \unhbox0 #1\par}%
+ }%
+ \nobreak\bigskip % no page break after a chapter title
+ \nobreak
+}
+
+% Plain opening for unnumbered.
+\def\unnchfplain#1{\chfplain{#1}{}}
+
+% @centerchap -- centered and unnumbered.
+\let\centerparametersmaybe = \relax
+\def\centerchfplain#1{{%
+ \def\centerparametersmaybe{%
+ \advance\rightskip by 3\rightskip
+ \leftskip = \rightskip
+ \parfillskip = 0pt
+ }%
+ \chfplain{#1}{}%
+}}
+
+\CHAPFplain % The default
+
+\def\unnchfopen #1{%
+\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt\raggedright
+ \rm #1\hfill}}\bigskip \par\nobreak
+}
+
+\def\chfopen #1#2{\chapoddpage {\chapfonts
+\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
+\par\penalty 5000 %
+}
+
+\def\centerchfopen #1{%
+\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt
+ \hfill {\rm #1}\hfill}}\bigskip \par\nobreak
+}
+
+\def\CHAPFopen{
+\global\let\chapmacro=\chfopen
+\global\let\unnumbchapmacro=\unnchfopen
+\global\let\centerchapmacro=\centerchfopen}
+
+
+% Section titles.
+\newskip\secheadingskip
+\def\secheadingbreak{\dobreak \secheadingskip {-1000}}
+\def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}}
+\def\plainsecheading#1{\sectionheading{sec}{}{#1}}
+
+% Subsection titles.
+\newskip \subsecheadingskip
+\def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}}
+\def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}}
+\def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}}
+
+% Subsubsection titles.
+\let\subsubsecheadingskip = \subsecheadingskip
+\let\subsubsecheadingbreak = \subsecheadingbreak
+\def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}}
+\def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}}
+
+
+% Print any size section title.
+%
+% #1 is the section type (sec/subsec/subsubsec), #2 is the section
+% number (maybe empty), #3 the text.
+\def\sectionheading#1#2#3{%
+ {%
+ \expandafter\advance\csname #1headingskip\endcsname by \parskip
+ \csname #1headingbreak\endcsname
+ }%
+ {%
+ % Switch to the right set of fonts.
+ \csname #1fonts\endcsname \rm
+ %
+ % Only insert the separating space if we have a section number.
+ \def\secnum{#2}%
+ \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}%
+ %
+ \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
+ \hangindent = \wd0 % zero if no section number
+ \unhbox0 #3}%
+ }%
+ \ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak
+}
+
+
+\message{toc,}
+% Table of contents.
+\newwrite\tocfile
+
+% Write an entry to the toc file, opening it if necessary.
+% Called from @chapter, etc. We supply {\folio} at the end of the
+% argument, which will end up as the last argument to the \...entry macro.
+%
+% We open the .toc file here instead of at @setfilename or any other
+% given time so that @contents can be put in the document anywhere.
+%
+\newif\iftocfileopened
+\def\writetocentry#1{%
+ \iftocfileopened\else
+ \immediate\openout\tocfile = \jobname.toc
+ \global\tocfileopenedtrue
+ \fi
+ \iflinks \write\tocfile{#1{\folio}}\fi
+}
+
+\newskip\contentsrightmargin \contentsrightmargin=1in
+\newcount\savepageno
+\newcount\lastnegativepageno \lastnegativepageno = -1
+
+% Finish up the main text and prepare to read what we've written
+% to \tocfile.
+%
+\def\startcontents#1{%
+ % If @setchapternewpage on, and @headings double, the contents should
+ % start on an odd page, unlike chapters. Thus, we maintain
+ % \contentsalignmacro in parallel with \pagealignmacro.
+ % From: Torbjorn Granlund <tege@matematik.su.se>
+ \contentsalignmacro
+ \immediate\closeout\tocfile
+ %
+ % Don't need to put `Contents' or `Short Contents' in the headline.
+ % It is abundantly clear what they are.
+ \unnumbchapmacro{#1}\def\thischapter{}%
+ \savepageno = \pageno
+ \begingroup % Set up to handle contents files properly.
+ \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11
+ % We can't do this, because then an actual ^ in a section
+ % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97.
+ %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
+ \raggedbottom % Worry more about breakpoints than the bottom.
+ \advance\hsize by -\contentsrightmargin % Don't use the full line length.
+ %
+ % Roman numerals for page numbers.
+ \ifnum \pageno>0 \pageno = \lastnegativepageno \fi
+}
+
+
+% Normal (long) toc.
+\def\contents{%
+ \startcontents{\putwordTOC}%
+ \openin 1 \jobname.toc
+ \ifeof 1 \else
+ \closein 1
+ \input \jobname.toc
+ \fi
+ \vfill \eject
+ \contentsalignmacro % in case @setchapternewpage odd is in effect
+ \pdfmakeoutlines
+ \endgroup
+ \lastnegativepageno = \pageno
+ \pageno = \savepageno
+}
+
+% And just the chapters.
+\def\summarycontents{%
+ \startcontents{\putwordShortTOC}%
+ %
+ \let\chapentry = \shortchapentry
+ \let\unnumbchapentry = \shortunnumberedentry
+ % We want a true roman here for the page numbers.
+ \secfonts
+ \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl
+ \rm
+ \hyphenpenalty = 10000
+ \advance\baselineskip by 1pt % Open it up a little.
+ \def\secentry ##1##2##3##4{}
+ \def\unnumbsecentry ##1##2{}
+ \def\subsecentry ##1##2##3##4##5{}
+ \def\unnumbsubsecentry ##1##2{}
+ \def\subsubsecentry ##1##2##3##4##5##6{}
+ \def\unnumbsubsubsecentry ##1##2{}
+ \openin 1 \jobname.toc
+ \ifeof 1 \else
+ \closein 1
+ \input \jobname.toc
+ \fi
+ \vfill \eject
+ \contentsalignmacro % in case @setchapternewpage odd is in effect
+ \endgroup
+ \lastnegativepageno = \pageno
+ \pageno = \savepageno
+}
+\let\shortcontents = \summarycontents
+
+\ifpdf
+ \pdfcatalog{/PageMode /UseOutlines}%
+\fi
+
+% These macros generate individual entries in the table of contents.
+% The first argument is the chapter or section name.
+% The last argument is the page number.
+% The arguments in between are the chapter number, section number, ...
+
+% Chapter-level things, for both the long and short contents.
+\def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
+
+% See comments in \dochapentry re vbox and related settings
+\def\shortchapentry#1#2#3{%
+ \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#3\egroup}%
+}
+
+% Typeset the label for a chapter or appendix for the short contents.
+% The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter.
+% We could simplify the code here by writing out an \appendixentry
+% command in the toc file for appendices, instead of using \chapentry
+% for both, but it doesn't seem worth it.
+%
+\newdimen\shortappendixwidth
+%
+\def\shortchaplabel#1{%
+ % Compute width of word "Appendix", may change with language.
+ \setbox0 = \hbox{\shortcontrm \putwordAppendix}%
+ \shortappendixwidth = \wd0
+ %
+ % We typeset #1 in a box of constant width, regardless of the text of
+ % #1, so the chapter titles will come out aligned.
+ \setbox0 = \hbox{#1}%
+ \dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi
+ %
+ % This space should be plenty, since a single number is .5em, and the
+ % widest letter (M) is 1em, at least in the Computer Modern fonts.
+ % (This space doesn't include the extra space that gets added after
+ % the label; that gets put in by \shortchapentry above.)
+ \advance\dimen0 by 1.1em
+ \hbox to \dimen0{#1\hfil}%
+}
+
+\def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
+\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno\bgroup#2\egroup}}
+
+% Sections.
+\def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
+\def\unnumbsecentry#1#2{\dosecentry{#1}{#2}}
+
+% Subsections.
+\def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}}
+\def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}}
+
+% And subsubsections.
+\def\subsubsecentry#1#2#3#4#5#6{%
+ \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}}
+\def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}
+
+% This parameter controls the indentation of the various levels.
+\newdimen\tocindent \tocindent = 3pc
+
+% Now for the actual typesetting. In all these, #1 is the text and #2 is the
+% page number.
+%
+% If the toc has to be broken over pages, we want it to be at chapters
+% if at all possible; hence the \penalty.
+\def\dochapentry#1#2{%
+ \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
+ \begingroup
+ \chapentryfonts
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+ \endgroup
+ \nobreak\vskip .25\baselineskip plus.1\baselineskip
+}
+
+\def\dosecentry#1#2{\begingroup
+ \secentryfonts \leftskip=\tocindent
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+\def\dosubsecentry#1#2{\begingroup
+ \subsecentryfonts \leftskip=2\tocindent
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+\def\dosubsubsecentry#1#2{\begingroup
+ \subsubsecentryfonts \leftskip=3\tocindent
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+% Final typesetting of a toc entry; we use the same \entry macro as for
+% the index entries, but we want to suppress hyphenation here. (We
+% can't do that in the \entry macro, since index entries might consist
+% of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.)
+\def\tocentry#1#2{\begingroup
+ \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks
+ % Do not use \turnoffactive in these arguments. Since the toc is
+ % typeset in cmr, so characters such as _ would come out wrong; we
+ % have to do the usual translation tricks.
+ \entry{#1}{#2}%
+\endgroup}
+
+% Space between chapter (or whatever) number and the title.
+\def\labelspace{\hskip1em \relax}
+
+\def\dopageno#1{{\rm #1}}
+\def\doshortpageno#1{{\rm #1}}
+
+\def\chapentryfonts{\secfonts \rm}
+\def\secentryfonts{\textfonts}
+\let\subsecentryfonts = \textfonts
+\let\subsubsecentryfonts = \textfonts
+
+
+\message{environments,}
+% @foo ... @end foo.
+
+% Since these characters are used in examples, it should be an even number of
+% \tt widths. Each \tt character is 1en, so two makes it 1em.
+% Furthermore, these definitions must come after we define our fonts.
+\newbox\dblarrowbox \newbox\longdblarrowbox
+\newbox\pushcharbox \newbox\bullbox
+\newbox\equivbox \newbox\errorbox
+
+%{\tentt
+%\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil}
+%\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil}
+%\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil}
+%\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil}
+% Adapted from the manmac format (p.420 of TeXbook)
+%\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex
+% depth .1ex\hfil}
+%}
+
+% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
+\def\point{$\star$}
+\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
+\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}}
+\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
+\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}
+
+% Adapted from the TeXbook's \boxit.
+{\tentt \global\dimen0 = 3em}% Width of the box.
+\dimen2 = .55pt % Thickness of rules
+% The text. (`r' is open on the right, `e' somewhat less so on the left.)
+\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}
+
+\global\setbox\errorbox=\hbox to \dimen0{\hfil
+ \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
+ \advance\hsize by -2\dimen2 % Rules.
+ \vbox{
+ \hrule height\dimen2
+ \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
+ \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
+ \kern3pt\vrule width\dimen2}% Space to right.
+ \hrule height\dimen2}
+ \hfil}
+
+% The @error{} command.
+\def\error{\leavevmode\lower.7ex\copy\errorbox}
+
+% @tex ... @end tex escapes into raw Tex temporarily.
+% One exception: @ is still an escape character, so that @end tex works.
+% But \@ or @@ will get a plain tex @ character.
+
+\def\tex{\begingroup
+ \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
+ \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
+ \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
+ \catcode `\%=14
+ \catcode 43=12 % plus
+ \catcode`\"=12
+ \catcode`\==12
+ \catcode`\|=12
+ \catcode`\<=12
+ \catcode`\>=12
+ \escapechar=`\\
+ %
+ \let\b=\ptexb
+ \let\bullet=\ptexbullet
+ \let\c=\ptexc
+ \let\,=\ptexcomma
+ \let\.=\ptexdot
+ \let\dots=\ptexdots
+ \let\equiv=\ptexequiv
+ \let\!=\ptexexclam
+ \let\i=\ptexi
+ \let\{=\ptexlbrace
+ \let\+=\tabalign
+ \let\}=\ptexrbrace
+ \let\*=\ptexstar
+ \let\t=\ptext
+ %
+ \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
+ \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
+ \def\@{@}%
+\let\Etex=\endgroup}
+
+% Define @lisp ... @endlisp.
+% @lisp does a \begingroup so it can rebind things,
+% including the definition of @endlisp (which normally is erroneous).
+
+% Amount to narrow the margins by for @lisp.
+\newskip\lispnarrowing \lispnarrowing=0.4in
+
+% This is the definition that ^^M gets inside @lisp, @example, and other
+% such environments. \null is better than a space, since it doesn't
+% have any width.
+\def\lisppar{\null\endgraf}
+
+% Make each space character in the input produce a normal interword
+% space in the output. Don't allow a line break at this space, as this
+% is used only in environments like @example, where each line of input
+% should produce a line of output anyway.
+%
+{\obeyspaces %
+\gdef\sepspaces{\obeyspaces\let =\tie}}
+
+% Define \obeyedspace to be our active space, whatever it is. This is
+% for use in \parsearg.
+{\sepspaces%
+\global\let\obeyedspace= }
+
+% This space is always present above and below environments.
+\newskip\envskipamount \envskipamount = 0pt
+
+% Make spacing and below environment symmetrical. We use \parskip here
+% to help in doing that, since in @example-like environments \parskip
+% is reset to zero; thus the \afterenvbreak inserts no space -- but the
+% start of the next paragraph will insert \parskip
+%
+\def\aboveenvbreak{{\advance\envskipamount by \parskip
+\endgraf \ifdim\lastskip<\envskipamount
+\removelastskip \penalty-50 \vskip\envskipamount \fi}}
+
+\let\afterenvbreak = \aboveenvbreak
+
+% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins.
+\let\nonarrowing=\relax
+
+% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
+% environment contents.
+\font\circle=lcircle10
+\newdimen\circthick
+\newdimen\cartouter\newdimen\cartinner
+\newskip\normbskip\newskip\normpskip\newskip\normlskip
+\circthick=\fontdimen8\circle
+%
+\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
+\def\ctr{{\hskip 6pt\circle\char'010}}
+\def\cbl{{\circle\char'012\hskip -6pt}}
+\def\cbr{{\hskip 6pt\circle\char'011}}
+\def\carttop{\hbox to \cartouter{\hskip\lskip
+ \ctl\leaders\hrule height\circthick\hfil\ctr
+ \hskip\rskip}}
+\def\cartbot{\hbox to \cartouter{\hskip\lskip
+ \cbl\leaders\hrule height\circthick\hfil\cbr
+ \hskip\rskip}}
+%
+\newskip\lskip\newskip\rskip
+
+\long\def\cartouche{%
+\begingroup
+ \lskip=\leftskip \rskip=\rightskip
+ \leftskip=0pt\rightskip=0pt %we want these *outside*.
+ \cartinner=\hsize \advance\cartinner by-\lskip
+ \advance\cartinner by-\rskip
+ \cartouter=\hsize
+ \advance\cartouter by 18.4pt % allow for 3pt kerns on either
+% side, and for 6pt waste from
+% each corner char, and rule thickness
+ \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
+ % Flag to tell @lisp, etc., not to narrow margin.
+ \let\nonarrowing=\comment
+ \vbox\bgroup
+ \baselineskip=0pt\parskip=0pt\lineskip=0pt
+ \carttop
+ \hbox\bgroup
+ \hskip\lskip
+ \vrule\kern3pt
+ \vbox\bgroup
+ \hsize=\cartinner
+ \kern3pt
+ \begingroup
+ \baselineskip=\normbskip
+ \lineskip=\normlskip
+ \parskip=\normpskip
+ \vskip -\parskip
+\def\Ecartouche{%
+ \endgroup
+ \kern3pt
+ \egroup
+ \kern3pt\vrule
+ \hskip\rskip
+ \egroup
+ \cartbot
+ \egroup
+\endgroup
+}}
+
+
+% This macro is called at the beginning of all the @example variants,
+% inside a group.
+\def\nonfillstart{%
+ \aboveenvbreak
+ \inENV % This group ends at the end of the body
+ \hfuzz = 12pt % Don't be fussy
+ \sepspaces % Make spaces be word-separators rather than space tokens.
+ \singlespace
+ \let\par = \lisppar % don't ignore blank lines
+ \obeylines % each line of input is a line of output
+ \parskip = 0pt
+ \parindent = 0pt
+ \emergencystretch = 0pt % don't try to avoid overfull boxes
+ % @cartouche defines \nonarrowing to inhibit narrowing
+ % at next level down.
+ \ifx\nonarrowing\relax
+ \advance \leftskip by \lispnarrowing
+ \exdentamount=\lispnarrowing
+ \let\exdent=\nofillexdent
+ \let\nonarrowing=\relax
+ \fi
+}
+
+% Define the \E... control sequence only if we are inside the particular
+% environment, so the error checking in \end will work.
+%
+% To end an @example-like environment, we first end the paragraph (via
+% \afterenvbreak's vertical glue), and then the group. That way we keep
+% the zero \parskip that the environments set -- \parskip glue will be
+% inserted at the beginning of the next paragraph in the document, after
+% the environment.
+%
+\def\nonfillfinish{\afterenvbreak\endgroup}
+
+% @lisp: indented, narrowed, typewriter font.
+\def\lisp{\begingroup
+ \nonfillstart
+ \let\Elisp = \nonfillfinish
+ \tt
+ \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
+ \gobble % eat return
+}
+
+% @example: Same as @lisp.
+\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
+
+% @small... is usually equivalent to the non-small (@smallbook
+% redefines). We must call \example (or whatever) last in the
+% definition, since it reads the return following the @example (or
+% whatever) command.
+%
+% This actually allows (for example) @end display inside an
+% @smalldisplay. Too bad, but makeinfo will catch the error anyway.
+%
+\def\smalldisplay{\begingroup\def\Esmalldisplay{\nonfillfinish\endgroup}\display}
+\def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp}
+\def\smallformat{\begingroup\def\Esmallformat{\nonfillfinish\endgroup}\format}
+\def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp}
+
+% Real @smallexample and @smalllisp (when @smallbook): use smaller fonts.
+% Originally contributed by Pavel@xerox.
+\def\smalllispx{\begingroup
+ \def\Esmalllisp{\nonfillfinish\endgroup}%
+ \def\Esmallexample{\nonfillfinish\endgroup}%
+ \smallfonts
+ \lisp
+}
+
+% @display: same as @lisp except keep current font.
+%
+\def\display{\begingroup
+ \nonfillstart
+ \let\Edisplay = \nonfillfinish
+ \gobble
+}
+
+% @smalldisplay (when @smallbook): @display plus smaller fonts.
+%
+\def\smalldisplayx{\begingroup
+ \def\Esmalldisplay{\nonfillfinish\endgroup}%
+ \smallfonts \rm
+ \display
+}
+
+% @format: same as @display except don't narrow margins.
+%
+\def\format{\begingroup
+ \let\nonarrowing = t
+ \nonfillstart
+ \let\Eformat = \nonfillfinish
+ \gobble
+}
+
+% @smallformat (when @smallbook): @format plus smaller fonts.
+%
+\def\smallformatx{\begingroup
+ \def\Esmallformat{\nonfillfinish\endgroup}%
+ \smallfonts \rm
+ \format
+}
+
+% @flushleft (same as @format).
+%
+\def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format}
+
+% @flushright.
+%
+\def\flushright{\begingroup
+ \let\nonarrowing = t
+ \nonfillstart
+ \let\Eflushright = \nonfillfinish
+ \advance\leftskip by 0pt plus 1fill
+ \gobble
+}
+
+
+% @quotation does normal linebreaking (hence we can't use \nonfillstart)
+% and narrows the margins.
+%
+\def\quotation{%
+ \begingroup\inENV %This group ends at the end of the @quotation body
+ {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
+ \singlespace
+ \parindent=0pt
+ % We have retained a nonzero parskip for the environment, since we're
+ % doing normal filling. So to avoid extra space below the environment...
+ \def\Equotation{\parskip = 0pt \nonfillfinish}%
+ %
+ % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
+ \ifx\nonarrowing\relax
+ \advance\leftskip by \lispnarrowing
+ \advance\rightskip by \lispnarrowing
+ \exdentamount = \lispnarrowing
+ \let\nonarrowing = \relax
+ \fi
+}
+
+
+% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
+% If we want to allow any <char> as delimiter,
+% we need the curly braces so that makeinfo sees the @verb command, eg:
+% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
+%
+% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
+%
+% [Knuth] p. 344; only we need to do '@' too
+\def\dospecials{%
+ \do\ \do\\\do\@\do\{\do\}\do\$\do\&%
+ \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~}
+%
+% [Knuth] p. 380
+\def\uncatcodespecials{%
+ \def\do##1{\catcode`##1=12}\dospecials}
+%
+% [Knuth] pp. 380,381,391
+% Disable Spanish ligatures ?` and !` of \tt font
+\begingroup
+ \catcode`\`=\active\gdef`{\relax\lq}
+\endgroup
+%
+% Setup for the @verb command.
+%
+% Eight spaces for a tab
+\begingroup
+ \catcode`\^^I=\active
+ \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
+\endgroup
+%
+\def\setupverb{%
+ \tt % easiest (and conventionally used) font for verbatim
+ \def\par{\leavevmode\endgraf}%
+ \catcode`\`=\active
+ \tabeightspaces
+ % Respect line breaks,
+ % print special symbols as themselves, and
+ % make each space count
+ % must do in this order:
+ \obeylines \uncatcodespecials \sepspaces
+}
+
+% Setup for the @verbatim environment
+%
+% Real tab expansion
+\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
+%
+\def\starttabbox{\setbox0=\hbox\bgroup}
+\begingroup
+ \catcode`\^^I=\active
+ \gdef\tabexpand{%
+ \catcode`\^^I=\active
+ \def^^I{\leavevmode\egroup
+ \dimen0=\wd0 % the width so far, or since the previous tab
+ \divide\dimen0 by\tabw
+ \multiply\dimen0 by\tabw % compute previous multiple of \tabw
+ \advance\dimen0 by\tabw % advance to next multiple of \tabw
+ \wd0=\dimen0 \box0 \starttabbox
+ }%
+ }
+\endgroup
+\def\setupverbatim{%
+ % Easiest (and conventionally used) font for verbatim
+ \tt
+ \def\par{\leavevmode\egroup\box0\endgraf}%
+ \catcode`\`=\active
+ \tabexpand
+ % Respect line breaks,
+ % print special symbols as themselves, and
+ % make each space count
+ % must do in this order:
+ \obeylines \uncatcodespecials \sepspaces
+ \everypar{\starttabbox}%
+}
+
+% Do the @verb magic: verbatim text is quoted by unique
+% delimiter characters. Before first delimiter expect a
+% right brace, after last delimiter expect closing brace:
+%
+% \def\doverb'{'<char>#1<char>'}'{#1}
+%
+% [Knuth] p. 382; only eat outer {}
+\begingroup
+ \catcode`[=1\catcode`]=2\catcode`\{=12\catcode`\}=12
+ \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
+\endgroup
+%
+\def\verb{\begingroup\setupverb\doverb}
+%
+%
+% Do the @verbatim magic: define the macro \doverbatim so that
+% the (first) argument ends when '@end verbatim' is reached, ie:
+%
+% \def\doverbatim#1@end verbatim{#1}
+%
+% For Texinfo it's a lot easier than for LaTeX,
+% because texinfo's \verbatim doesn't stop at '\end{verbatim}':
+% we need not redefine '\', '{' and '}'
+%
+% Inspired by LaTeX's verbatim command set [latex.ltx]
+%% Include LaTeX hack for completeness -- never know
+%% \begingroup
+%% \catcode`|=0 \catcode`[=1
+%% \catcode`]=2\catcode`\{=12\catcode`\}=12\catcode`\ =\active
+%% \catcode`\\=12|gdef|doverbatim#1@end verbatim[
+%% #1|endgroup|def|Everbatim[]|end[verbatim]]
+%% |endgroup
+\begingroup
+ \catcode`\ =\active
+ \gdef\doverbatim#1@end verbatim{#1\end{verbatim}}
+\endgroup
+%
+\def\verbatim{%
+ \def\Everbatim{\nonfillfinish\endgroup}%
+ \begingroup
+ \nonfillstart
+ \advance\leftskip by -\defbodyindent
+ \begingroup\setupverbatim\doverbatim
+}
+
+% @verbatiminclude FILE - insert text of file in verbatim environment.
+%
+% Allow normal characters that we make active in the argument (a file name).
+\def\verbatiminclude{%
+ \begingroup
+ \catcode`\\=12
+ \catcode`~=12
+ \catcode`^=12
+ \catcode`_=12
+ \catcode`|=12
+ \catcode`<=12
+ \catcode`>=12
+ \catcode`+=12
+ \parsearg\doverbatiminclude
+}
+\def\setupverbatiminclude{%
+ \begingroup
+ \nonfillstart
+ \advance\leftskip by -\defbodyindent
+ \begingroup\setupverbatim
+}
+%
+\def\doverbatiminclude#1{%
+ % Restore active chars for included file.
+ \endgroup
+ \begingroup
+ \def\thisfile{#1}%
+ \expandafter\expandafter\setupverbatiminclude\input\thisfile
+ \endgroup\nonfillfinish\endgroup
+}
+
+
+\message{defuns,}
+% @defun etc.
+
+% Allow user to change definition object font (\df) internally
+\def\setdeffont #1 {\csname DEF#1\endcsname}
+
+\newskip\defbodyindent \defbodyindent=.4in
+\newskip\defargsindent \defargsindent=50pt
+\newskip\deftypemargin \deftypemargin=12pt
+\newskip\deflastargmargin \deflastargmargin=18pt
+
+\newcount\parencount
+% define \functionparens, which makes ( and ) and & do special things.
+% \functionparens affects the group it is contained in.
+\def\activeparens{%
+\catcode`\(=\active \catcode`\)=\active \catcode`\&=\active
+\catcode`\[=\active \catcode`\]=\active}
+
+% Make control sequences which act like normal parenthesis chars.
+\let\lparen = ( \let\rparen = )
+
+{\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
+
+% Be sure that we always have a definition for `(', etc. For example,
+% if the fn name has parens in it, \boldbrax will not be in effect yet,
+% so TeX would otherwise complain about undefined control sequence.
+\global\let(=\lparen \global\let)=\rparen
+\global\let[=\lbrack \global\let]=\rbrack
+
+\gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 }
+\gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
+% This is used to turn on special parens
+% but make & act ordinary (given that it's active).
+\gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr}
+
+% Definitions of (, ) and & used in args for functions.
+% This is the definition of ( outside of all parentheses.
+\gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested
+ \global\advance\parencount by 1
+}
+%
+% This is the definition of ( when already inside a level of parens.
+\gdef\opnested{\char`\(\global\advance\parencount by 1 }
+%
+\gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
+ % also in that case restore the outer-level definition of (.
+ \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
+ \global\advance \parencount by -1 }
+% If we encounter &foo, then turn on ()-hacking afterwards
+\gdef\amprm#1 {{\rm\&#1}\let(=\oprm \let)=\clrm\ }
+%
+\gdef\normalparens{\boldbrax\let&=\ampnr}
+} % End of definition inside \activeparens
+%% These parens (in \boldbrax) actually are a little bolder than the
+%% contained text. This is especially needed for [ and ]
+\def\opnr{{\sf\char`\(}\global\advance\parencount by 1 }
+\def\clnr{{\sf\char`\)}\global\advance\parencount by -1 }
+\let\ampnr = \&
+\def\lbrb{{\bf\char`\[}}
+\def\rbrb{{\bf\char`\]}}
+
+% Active &'s sneak into the index arguments, so make sure it's defined.
+{
+ \catcode`& = 13
+ \global\let& = \ampnr
+}
+
+% First, defname, which formats the header line itself.
+% #1 should be the function name.
+% #2 should be the type of definition, such as "Function".
+
+\def\defname #1#2{%
+% Get the values of \leftskip and \rightskip as they were
+% outside the @def...
+\dimen2=\leftskip
+\advance\dimen2 by -\defbodyindent
+\noindent
+\setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
+\dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
+\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations
+\parshape 2 0in \dimen0 \defargsindent \dimen1
+% Now output arg 2 ("Function" or some such)
+% ending at \deftypemargin from the right margin,
+% but stuck inside a box of width 0 so it does not interfere with linebreaking
+{% Adjust \hsize to exclude the ambient margins,
+% so that \rightline will obey them.
+\advance \hsize by -\dimen2
+\rlap{\rightline{{\rm #2}\hskip -1.25pc }}}%
+% Make all lines underfull and no complaints:
+\tolerance=10000 \hbadness=10000
+\advance\leftskip by -\defbodyindent
+\exdentamount=\defbodyindent
+{\df #1}\enskip % Generate function name
+}
+
+% Actually process the body of a definition
+% #1 should be the terminating control sequence, such as \Edefun.
+% #2 should be the "another name" control sequence, such as \defunx.
+% #3 should be the control sequence that actually processes the header,
+% such as \defunheader.
+
+\def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
+\parindent=0in
+\advance\leftskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup %
+\catcode 61=\active % 61 is `='
+\obeylines\activeparens\spacesplit#3}
+
+% #1 is the \E... control sequence to end the definition (which we define).
+% #2 is the \...x control sequence for consecutive fns (which we define).
+% #3 is the control sequence to call to resume processing.
+% #4, delimited by the space, is the class name.
+%
+\def\defmethparsebody#1#2#3#4 {\begingroup\inENV %
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
+\parindent=0in
+\advance\leftskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
+
+% Used for @deftypemethod and @deftypeivar.
+% #1 is the \E... control sequence to end the definition (which we define).
+% #2 is the \...x control sequence for consecutive fns (which we define).
+% #3 is the control sequence to call to resume processing.
+% #4, delimited by a space, is the class name.
+% #5 is the method's return type.
+%
+\def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV
+ \medbreak
+ \def#1{\endgraf\endgroup\medbreak}%
+ \def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}%
+ \parindent=0in
+ \advance\leftskip by \defbodyindent
+ \exdentamount=\defbodyindent
+ \begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}}
+
+% Used for @deftypeop. The change from \deftypemethparsebody is an
+% extra argument at the beginning which is the `category', instead of it
+% being the hardwired string `Method' or `Instance Variable'. We have
+% to account for this both in the \...x definition and in parsing the
+% input at hand. Thus also need a control sequence (passed as #5) for
+% the \E... definition to assign the category name to.
+%
+\def\deftypeopparsebody#1#2#3#4#5 #6 {\begingroup\inENV
+ \medbreak
+ \def#1{\endgraf\endgroup\medbreak}%
+ \def#2##1 ##2 ##3 {%
+ \def#4{##1}%
+ \begingroup\obeylines\activeparens\spacesplit{#3{##2}{##3}}}%
+ \parindent=0in
+ \advance\leftskip by \defbodyindent
+ \exdentamount=\defbodyindent
+ \begingroup\obeylines\activeparens\spacesplit{#3{#5}{#6}}}
+
+\def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2##1 ##2 {\def#4{##1}%
+\begingroup\obeylines\activeparens\spacesplit{#3{##2}}}%
+\parindent=0in
+\advance\leftskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
+
+% These parsing functions are similar to the preceding ones
+% except that they do not make parens into active characters.
+% These are used for "variables" since they have no arguments.
+
+\def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2{\begingroup\obeylines\spacesplit#3}%
+\parindent=0in
+\advance\leftskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup %
+\catcode 61=\active %
+\obeylines\spacesplit#3}
+
+% This is used for \def{tp,vr}parsebody. It could probably be used for
+% some of the others, too, with some judicious conditionals.
+%
+\def\parsebodycommon#1#2#3{%
+ \begingroup\inENV %
+ \medbreak %
+ % Define the end token that this defining construct specifies
+ % so that it will exit this group.
+ \def#1{\endgraf\endgroup\medbreak}%
+ \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
+ \parindent=0in
+ \advance\leftskip by \defbodyindent
+ \exdentamount=\defbodyindent
+ \begingroup\obeylines
+}
+
+\def\defvrparsebody#1#2#3#4 {%
+ \parsebodycommon{#1}{#2}{#3}%
+ \spacesplit{#3{#4}}%
+}
+
+% This loses on `@deftp {Data Type} {struct termios}' -- it thinks the
+% type is just `struct', because we lose the braces in `{struct
+% termios}' when \spacesplit reads its undelimited argument. Sigh.
+% \let\deftpparsebody=\defvrparsebody
+%
+% So, to get around this, we put \empty in with the type name. That
+% way, TeX won't find exactly `{...}' as an undelimited argument, and
+% won't strip off the braces.
+%
+\def\deftpparsebody #1#2#3#4 {%
+ \parsebodycommon{#1}{#2}{#3}%
+ \spacesplit{\parsetpheaderline{#3{#4}}}\empty
+}
+
+% Fine, but then we have to eventually remove the \empty *and* the
+% braces (if any). That's what this does.
+%
+\def\removeemptybraces\empty#1\relax{#1}
+
+% After \spacesplit has done its work, this is called -- #1 is the final
+% thing to call, #2 the type name (which starts with \empty), and #3
+% (which might be empty) the arguments.
+%
+\def\parsetpheaderline#1#2#3{%
+ #1{\removeemptybraces#2\relax}{#3}%
+}%
+
+\def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2##1 ##2 {\def#4{##1}%
+\begingroup\obeylines\spacesplit{#3{##2}}}%
+\parindent=0in
+\advance\leftskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup\obeylines\spacesplit{#3{#5}}}
+
+% Split up #2 at the first space token.
+% call #1 with two arguments:
+% the first is all of #2 before the space token,
+% the second is all of #2 after that space token.
+% If #2 contains no space token, all of it is passed as the first arg
+% and the second is passed as empty.
+
+{\obeylines
+\gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
+\long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
+\ifx\relax #3%
+#1{#2}{}\else #1{#2}{#3#4}\fi}}
+
+% So much for the things common to all kinds of definitions.
+
+% Define @defun.
+
+% First, define the processing that is wanted for arguments of \defun
+% Use this to expand the args and terminate the paragraph they make up
+
+\def\defunargs#1{\functionparens \sl
+% Expand, preventing hyphenation at `-' chars.
+% Note that groups don't affect changes in \hyphenchar.
+% Set the font temporarily and use \font in case \setfont made \tensl a macro.
+{\tensl\hyphenchar\font=0}%
+#1%
+{\tensl\hyphenchar\font=45}%
+\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi%
+\interlinepenalty=10000
+\advance\rightskip by 0pt plus 1fil
+\endgraf\nobreak\vskip -\parskip\nobreak
+}
+
+\def\deftypefunargs #1{%
+% Expand, preventing hyphenation at `-' chars.
+% Note that groups don't affect changes in \hyphenchar.
+% Use \boldbraxnoamp, not \functionparens, so that & is not special.
+\boldbraxnoamp
+\tclose{#1}% avoid \code because of side effects on active chars
+\interlinepenalty=10000
+\advance\rightskip by 0pt plus 1fil
+\endgraf\nobreak\vskip -\parskip\nobreak
+}
+
+% Do complete processing of one @defun or @defunx line already parsed.
+
+% @deffn Command forward-char nchars
+
+\def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
+
+\def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
+\begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @defun == @deffn Function
+
+\def\defun{\defparsebody\Edefun\defunx\defunheader}
+
+\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
+\begingroup\defname {#1}{\putwordDeffunc}%
+\defunargs {#2}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @deftypefun int foobar (int @var{foo}, float @var{bar})
+
+\def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}
+
+% #1 is the data type. #2 is the name and args.
+\def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
+% #1 is the data type, #2 the name, #3 the args.
+\def\deftypefunheaderx #1#2 #3\relax{%
+\doind {fn}{\code{#2}}% Make entry in function index
+\begingroup\defname {\defheaderxcond#1\relax$$$#2}{\putwordDeftypefun}%
+\deftypefunargs {#3}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
+
+\def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
+
+% \defheaderxcond#1\relax$$$
+% puts #1 in @code, followed by a space, but does nothing if #1 is null.
+\def\defheaderxcond#1#2$$${\ifx#1\relax\else\code{#1#2} \fi}
+
+% #1 is the classification. #2 is the data type. #3 is the name and args.
+\def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
+% #1 is the classification, #2 the data type, #3 the name, #4 the args.
+\def\deftypefnheaderx #1#2#3 #4\relax{%
+\doind {fn}{\code{#3}}% Make entry in function index
+\begingroup
+\normalparens % notably, turn off `&' magic, which prevents
+% at least some C++ text from working
+\defname {\defheaderxcond#2\relax$$$#3}{#1}%
+\deftypefunargs {#4}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @defmac == @deffn Macro
+
+\def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
+
+\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
+\begingroup\defname {#1}{\putwordDefmac}%
+\defunargs {#2}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @defspec == @deffn Special Form
+
+\def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
+
+\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
+\begingroup\defname {#1}{\putwordDefspec}%
+\defunargs {#2}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @defop CATEGORY CLASS OPERATION ARG...
+%
+\def\defop #1 {\def\defoptype{#1}%
+\defopparsebody\Edefop\defopx\defopheader\defoptype}
+%
+\def\defopheader#1#2#3{%
+\dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index
+\begingroup\defname {#2}{\defoptype\ \putwordon\ #1}%
+\defunargs {#3}\endgroup %
+}
+
+% @deftypeop CATEGORY CLASS TYPE OPERATION ARG...
+%
+\def\deftypeop #1 {\def\deftypeopcategory{#1}%
+ \deftypeopparsebody\Edeftypeop\deftypeopx\deftypeopheader
+ \deftypeopcategory}
+%
+% #1 is the class name, #2 the data type, #3 the operation name, #4 the args.
+\def\deftypeopheader#1#2#3#4{%
+ \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
+ \begingroup
+ \defname{\defheaderxcond#2\relax$$$#3}
+ {\deftypeopcategory\ \putwordon\ \code{#1}}%
+ \deftypefunargs{#4}%
+ \endgroup
+}
+
+% @deftypemethod CLASS TYPE METHOD ARG...
+%
+\def\deftypemethod{%
+ \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader}
+%
+% #1 is the class name, #2 the data type, #3 the method name, #4 the args.
+\def\deftypemethodheader#1#2#3#4{%
+ \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
+ \begingroup
+ \defname{\defheaderxcond#2\relax$$$#3}{\putwordMethodon\ \code{#1}}%
+ \deftypefunargs{#4}%
+ \endgroup
+}
+
+% @deftypeivar CLASS TYPE VARNAME
+%
+\def\deftypeivar{%
+ \deftypemethparsebody\Edeftypeivar\deftypeivarx\deftypeivarheader}
+%
+% #1 is the class name, #2 the data type, #3 the variable name.
+\def\deftypeivarheader#1#2#3{%
+ \dosubind{vr}{\code{#3}}{\putwordof\ \code{#1}}% entry in variable index
+ \begingroup
+ \defname{\defheaderxcond#2\relax$$$#3}
+ {\putwordInstanceVariableof\ \code{#1}}%
+ \defvarargs{#3}%
+ \endgroup
+}
+
+% @defmethod == @defop Method
+%
+\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
+%
+% #1 is the class name, #2 the method name, #3 the args.
+\def\defmethodheader#1#2#3{%
+ \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% entry in function index
+ \begingroup
+ \defname{#2}{\putwordMethodon\ \code{#1}}%
+ \defunargs{#3}%
+ \endgroup
+}
+
+% @defcv {Class Option} foo-class foo-flag
+
+\def\defcv #1 {\def\defcvtype{#1}%
+\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
+
+\def\defcvarheader #1#2#3{%
+\dosubind {vr}{\code{#2}}{\putwordof\ #1}% Make entry in var index
+\begingroup\defname {#2}{\defcvtype\ \putwordof\ #1}%
+\defvarargs {#3}\endgroup %
+}
+
+% @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME
+%
+\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
+%
+\def\defivarheader#1#2#3{%
+ \dosubind {vr}{\code{#2}}{\putwordof\ #1}% entry in var index
+ \begingroup
+ \defname{#2}{\putwordInstanceVariableof\ #1}%
+ \defvarargs{#3}%
+ \endgroup
+}
+
+% @defvar
+% First, define the processing that is wanted for arguments of @defvar.
+% This is actually simple: just print them in roman.
+% This must expand the args and terminate the paragraph they make up
+\def\defvarargs #1{\normalparens #1%
+\interlinepenalty=10000
+\endgraf\nobreak\vskip -\parskip\nobreak}
+
+% @defvr Counter foo-count
+
+\def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader}
+
+\def\defvrheader #1#2#3{\doind {vr}{\code{#2}}%
+\begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
+
+% @defvar == @defvr Variable
+
+\def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
+
+\def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
+\begingroup\defname {#1}{\putwordDefvar}%
+\defvarargs {#2}\endgroup %
+}
+
+% @defopt == @defvr {User Option}
+
+\def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
+
+\def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
+\begingroup\defname {#1}{\putwordDefopt}%
+\defvarargs {#2}\endgroup %
+}
+
+% @deftypevar int foobar
+
+\def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
+
+% #1 is the data type. #2 is the name, perhaps followed by text that
+% is actually part of the data type, which should not be put into the index.
+\def\deftypevarheader #1#2{%
+\dovarind#2 \relax% Make entry in variables index
+\begingroup\defname {\defheaderxcond#1\relax$$$#2}{\putwordDeftypevar}%
+\interlinepenalty=10000
+\endgraf\nobreak\vskip -\parskip\nobreak
+\endgroup}
+\def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}}
+
+% @deftypevr {Global Flag} int enable
+
+\def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
+
+\def\deftypevrheader #1#2#3{\dovarind#3 \relax%
+\begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1}
+\interlinepenalty=10000
+\endgraf\nobreak\vskip -\parskip\nobreak
+\endgroup}
+
+% Now define @deftp
+% Args are printed in bold, a slight difference from @defvar.
+
+\def\deftpargs #1{\bf \defvarargs{#1}}
+
+% @deftp Class window height width ...
+
+\def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader}
+
+\def\deftpheader #1#2#3{\doind {tp}{\code{#2}}%
+\begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
+
+% These definitions are used if you use @defunx (etc.)
+% anywhere other than immediately after a @defun or @defunx.
+%
+\def\defcvx#1 {\errmessage{@defcvx in invalid context}}
+\def\deffnx#1 {\errmessage{@deffnx in invalid context}}
+\def\defivarx#1 {\errmessage{@defivarx in invalid context}}
+\def\defmacx#1 {\errmessage{@defmacx in invalid context}}
+\def\defmethodx#1 {\errmessage{@defmethodx in invalid context}}
+\def\defoptx #1 {\errmessage{@defoptx in invalid context}}
+\def\defopx#1 {\errmessage{@defopx in invalid context}}
+\def\defspecx#1 {\errmessage{@defspecx in invalid context}}
+\def\deftpx#1 {\errmessage{@deftpx in invalid context}}
+\def\deftypefnx#1 {\errmessage{@deftypefnx in invalid context}}
+\def\deftypefunx#1 {\errmessage{@deftypefunx in invalid context}}
+\def\deftypeivarx#1 {\errmessage{@deftypeivarx in invalid context}}
+\def\deftypemethodx#1 {\errmessage{@deftypemethodx in invalid context}}
+\def\deftypeopx#1 {\errmessage{@deftypeopx in invalid context}}
+\def\deftypevarx#1 {\errmessage{@deftypevarx in invalid context}}
+\def\deftypevrx#1 {\errmessage{@deftypevrx in invalid context}}
+\def\defunx#1 {\errmessage{@defunx in invalid context}}
+\def\defvarx#1 {\errmessage{@defvarx in invalid context}}
+\def\defvrx#1 {\errmessage{@defvrx in invalid context}}
+
+
+\message{macros,}
+% @macro.
+
+% To do this right we need a feature of e-TeX, \scantokens,
+% which we arrange to emulate with a temporary file in ordinary TeX.
+\ifx\eTeXversion\undefined
+ \newwrite\macscribble
+ \def\scanmacro#1{%
+ \begingroup \newlinechar`\^^M
+ % Undo catcode changes of \startcontents and \doprintindex
+ \catcode`\@=0 \catcode`\\=12 \escapechar=`\@
+ % Append \endinput to make sure that TeX does not see the ending newline.
+ \toks0={#1\endinput}%
+ \immediate\openout\macscribble=\jobname.tmp
+ \immediate\write\macscribble{\the\toks0}%
+ \immediate\closeout\macscribble
+ \let\xeatspaces\eatspaces
+ \input \jobname.tmp
+ \endgroup
+}
+\else
+\def\scanmacro#1{%
+\begingroup \newlinechar`\^^M
+% Undo catcode changes of \startcontents and \doprintindex
+\catcode`\@=0 \catcode`\\=12 \escapechar=`\@
+\let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup}
+\fi
+
+\newcount\paramno % Count of parameters
+\newtoks\macname % Macro name
+\newif\ifrecursive % Is it recursive?
+\def\macrolist{} % List of all defined macros in the form
+ % \do\macro1\do\macro2...
+
+% Utility routines.
+% Thisdoes \let #1 = #2, except with \csnames.
+\def\cslet#1#2{%
+\expandafter\expandafter
+\expandafter\let
+\expandafter\expandafter
+\csname#1\endcsname
+\csname#2\endcsname}
+
+% Trim leading and trailing spaces off a string.
+% Concepts from aro-bend problem 15 (see CTAN).
+{\catcode`\@=11
+\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
+\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
+\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
+\def\unbrace#1{#1}
+\unbrace{\gdef\trim@@@ #1 } #2@{#1}
+}
+
+% Trim a single trailing ^^M off a string.
+{\catcode`\^^M=12\catcode`\Q=3%
+\gdef\eatcr #1{\eatcra #1Q^^MQ}%
+\gdef\eatcra#1^^MQ{\eatcrb#1Q}%
+\gdef\eatcrb#1Q#2Q{#1}%
+}
+
+% Macro bodies are absorbed as an argument in a context where
+% all characters are catcode 10, 11 or 12, except \ which is active
+% (as in normal texinfo). It is necessary to change the definition of \.
+
+% It's necessary to have hard CRs when the macro is executed. This is
+% done by making ^^M (\endlinechar) catcode 12 when reading the macro
+% body, and then making it the \newlinechar in \scanmacro.
+
+\def\macrobodyctxt{%
+ \catcode`\~=12
+ \catcode`\^=12
+ \catcode`\_=12
+ \catcode`\|=12
+ \catcode`\<=12
+ \catcode`\>=12
+ \catcode`\+=12
+ \catcode`\{=12
+ \catcode`\}=12
+ \catcode`\@=12
+ \catcode`\^^M=12
+ \usembodybackslash}
+
+\def\macroargctxt{%
+ \catcode`\~=12
+ \catcode`\^=12
+ \catcode`\_=12
+ \catcode`\|=12
+ \catcode`\<=12
+ \catcode`\>=12
+ \catcode`\+=12
+ \catcode`\@=12
+ \catcode`\\=12}
+
+% \mbodybackslash is the definition of \ in @macro bodies.
+% It maps \foo\ => \csname macarg.foo\endcsname => #N
+% where N is the macro parameter number.
+% We define \csname macarg.\endcsname to be \realbackslash, so
+% \\ in macro replacement text gets you a backslash.
+
+{\catcode`@=0 @catcode`@\=@active
+ @gdef@usembodybackslash{@let\=@mbodybackslash}
+ @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
+}
+\expandafter\def\csname macarg.\endcsname{\realbackslash}
+
+\def\macro{\recursivefalse\parsearg\macroxxx}
+\def\rmacro{\recursivetrue\parsearg\macroxxx}
+
+\def\macroxxx#1{%
+ \getargs{#1}% now \macname is the macname and \argl the arglist
+ \ifx\argl\empty % no arguments
+ \paramno=0%
+ \else
+ \expandafter\parsemargdef \argl;%
+ \fi
+ \if1\csname ismacro.\the\macname\endcsname
+ \message{Warning: redefining \the\macname}%
+ \else
+ \expandafter\ifx\csname \the\macname\endcsname \relax
+ \else \errmessage{The name \the\macname\space is reserved}\fi
+ \global\cslet{macsave.\the\macname}{\the\macname}%
+ \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
+ % Add the macroname to \macrolist
+ \toks0 = \expandafter{\macrolist\do}%
+ \xdef\macrolist{\the\toks0
+ \expandafter\noexpand\csname\the\macname\endcsname}%
+ \fi
+ \begingroup \macrobodyctxt
+ \ifrecursive \expandafter\parsermacbody
+ \else \expandafter\parsemacbody
+ \fi}
+
+\def\unmacro{\parsearg\unmacroxxx}
+\def\unmacroxxx#1{%
+ \if1\csname ismacro.#1\endcsname
+ \global\cslet{#1}{macsave.#1}%
+ \global\expandafter\let \csname ismacro.#1\endcsname=0%
+ % Remove the macro name from \macrolist
+ \begingroup
+ \edef\tempa{\expandafter\noexpand\csname#1\endcsname}%
+ \def\do##1{%
+ \def\tempb{##1}%
+ \ifx\tempa\tempb
+ % remove this
+ \else
+ \toks0 = \expandafter{\newmacrolist\do}%
+ \edef\newmacrolist{\the\toks0\expandafter\noexpand\tempa}%
+ \fi}%
+ \def\newmacrolist{}%
+ % Execute macro list to define \newmacrolist
+ \macrolist
+ \global\let\macrolist\newmacrolist
+ \endgroup
+ \else
+ \errmessage{Macro #1 not defined}%
+ \fi
+}
+
+% This makes use of the obscure feature that if the last token of a
+% <parameter list> is #, then the preceding argument is delimited by
+% an opening brace, and that opening brace is not consumed.
+\def\getargs#1{\getargsxxx#1{}}
+\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
+\def\getmacname #1 #2\relax{\macname={#1}}
+\def\getmacargs#1{\def\argl{#1}}
+
+% Parse the optional {params} list. Set up \paramno and \paramlist
+% so \defmacro knows what to do. Define \macarg.blah for each blah
+% in the params list, to be ##N where N is the position in that list.
+% That gets used by \mbodybackslash (above).
+
+% We need to get `macro parameter char #' into several definitions.
+% The technique used is stolen from LaTeX: let \hash be something
+% unexpandable, insert that wherever you need a #, and then redefine
+% it to # just before using the token list produced.
+%
+% The same technique is used to protect \eatspaces till just before
+% the macro is used.
+
+\def\parsemargdef#1;{\paramno=0\def\paramlist{}%
+ \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,}
+\def\parsemargdefxxx#1,{%
+ \if#1;\let\next=\relax
+ \else \let\next=\parsemargdefxxx
+ \advance\paramno by 1%
+ \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
+ {\xeatspaces{\hash\the\paramno}}%
+ \edef\paramlist{\paramlist\hash\the\paramno,}%
+ \fi\next}
+
+% These two commands read recursive and nonrecursive macro bodies.
+% (They're different since rec and nonrec macros end differently.)
+
+\long\def\parsemacbody#1@end macro%
+{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+\long\def\parsermacbody#1@end rmacro%
+{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+
+% This defines the macro itself. There are six cases: recursive and
+% nonrecursive macros of zero, one, and many arguments.
+% Much magic with \expandafter here.
+% \xdef is used so that macro definitions will survive the file
+% they're defined in; @include reads the file inside a group.
+\def\defmacro{%
+ \let\hash=##% convert placeholders to macro parameter chars
+ \ifrecursive
+ \ifcase\paramno
+ % 0
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\scanmacro{\temp}}%
+ \or % 1
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\braceorline
+ \expandafter\noexpand\csname\the\macname xxx\endcsname}%
+ \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
+ \egroup\noexpand\scanmacro{\temp}}%
+ \else % many
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\csname\the\macname xx\endcsname}%
+ \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+ \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+ \expandafter\expandafter
+ \expandafter\xdef
+ \expandafter\expandafter
+ \csname\the\macname xxx\endcsname
+ \paramlist{\egroup\noexpand\scanmacro{\temp}}%
+ \fi
+ \else
+ \ifcase\paramno
+ % 0
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \or % 1
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\braceorline
+ \expandafter\noexpand\csname\the\macname xxx\endcsname}%
+ \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
+ \egroup
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \else % many
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \expandafter\noexpand\csname\the\macname xx\endcsname}%
+ \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+ \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+ \expandafter\expandafter
+ \expandafter\xdef
+ \expandafter\expandafter
+ \csname\the\macname xxx\endcsname
+ \paramlist{%
+ \egroup
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \fi
+ \fi}
+
+\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
+
+% \braceorline decides whether the next nonwhitespace character is a
+% {. If so it reads up to the closing }, if not, it reads the whole
+% line. Whatever was read is then fed to the next control sequence
+% as an argument (by \parsebrace or \parsearg)
+\def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx}
+\def\braceorlinexxx{%
+ \ifx\nchar\bgroup\else
+ \expandafter\parsearg
+ \fi \next}
+
+% We mant to disable all macros during \shipout so that they are not
+% expanded by \write.
+\def\turnoffmacros{\begingroup \def\do##1{\let\noexpand##1=\relax}%
+ \edef\next{\macrolist}\expandafter\endgroup\next}
+
+
+% @alias.
+% We need some trickery to remove the optional spaces around the equal
+% sign. Just make them active and then expand them all to nothing.
+\def\alias{\begingroup\obeyspaces\parsearg\aliasxxx}
+\def\aliasxxx #1{\aliasyyy#1\relax}
+\def\aliasyyy #1=#2\relax{\ignoreactivespaces
+\edef\next{\global\let\expandafter\noexpand\csname#1\endcsname=%
+ \expandafter\noexpand\csname#2\endcsname}%
+\expandafter\endgroup\next}
+
+
+\message{cross references,}
+% @xref etc.
+
+\newwrite\auxfile
+
+\newif\ifhavexrefs % True if xref values are known.
+\newif\ifwarnedxrefs % True if we warned once that they aren't known.
+
+% @inforef is relatively simple.
+\def\inforef #1{\inforefzzz #1,,,,**}
+\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
+ node \samp{\ignorespaces#1{}}}
+
+% @node's job is to define \lastnode.
+\def\node{\ENVcheck\parsearg\nodezzz}
+\def\nodezzz#1{\nodexxx [#1,]}
+\def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
+\let\nwnode=\node
+\let\lastnode=\relax
+
+% The sectioning commands (@chapter, etc.) call these.
+\def\donoderef{%
+ \ifx\lastnode\relax\else
+ \expandafter\expandafter\expandafter\setref{\lastnode}%
+ {Ysectionnumberandtype}%
+ \global\let\lastnode=\relax
+ \fi
+}
+\def\unnumbnoderef{%
+ \ifx\lastnode\relax\else
+ \expandafter\expandafter\expandafter\setref{\lastnode}{Ynothing}%
+ \global\let\lastnode=\relax
+ \fi
+}
+\def\appendixnoderef{%
+ \ifx\lastnode\relax\else
+ \expandafter\expandafter\expandafter\setref{\lastnode}%
+ {Yappendixletterandtype}%
+ \global\let\lastnode=\relax
+ \fi
+}
+
+
+% @anchor{NAME} -- define xref target at arbitrary point.
+%
+\newcount\savesfregister
+\gdef\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
+\gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
+\gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
+
+% \setref{NAME}{SNT} defines a cross-reference point NAME, namely
+% NAME-title, NAME-pg, and NAME-SNT. Called from \foonoderef. We have
+% to set \indexdummies so commands such as @code in a section title
+% aren't expanded. It would be nicer not to expand the titles in the
+% first place, but there's so many layers that that is hard to do.
+%
+\def\setref#1#2{{%
+ \indexdummies
+ \pdfmkdest{#1}%
+ \dosetq{#1-title}{Ytitle}%
+ \dosetq{#1-pg}{Ypagenumber}%
+ \dosetq{#1-snt}{#2}%
+}}
+
+% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
+% the node name, #2 the name of the Info cross-reference, #3 the printed
+% node name, #4 the name of the Info file, #5 the name of the printed
+% manual. All but the node name can be omitted.
+%
+\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
+\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
+\def\ref#1{\xrefX[#1,,,,,,,]}
+\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
+ \unsepspaces
+ \def\printedmanual{\ignorespaces #5}%
+ \def\printednodename{\ignorespaces #3}%
+ \setbox1=\hbox{\printedmanual}%
+ \setbox0=\hbox{\printednodename}%
+ \ifdim \wd0 = 0pt
+ % No printed node name was explicitly given.
+ \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax
+ % Use the node name inside the square brackets.
+ \def\printednodename{\ignorespaces #1}%
+ \else
+ % Use the actual chapter/section title appear inside
+ % the square brackets. Use the real section title if we have it.
+ \ifdim \wd1 > 0pt
+ % It is in another manual, so we don't have it.
+ \def\printednodename{\ignorespaces #1}%
+ \else
+ \ifhavexrefs
+ % We know the real title if we have the xref values.
+ \def\printednodename{\refx{#1-title}{}}%
+ \else
+ % Otherwise just copy the Info node name.
+ \def\printednodename{\ignorespaces #1}%
+ \fi%
+ \fi
+ \fi
+ \fi
+ %
+ % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
+ % insert empty discretionaries after hyphens, which means that it will
+ % not find a line break at a hyphen in a node names. Since some manuals
+ % are best written with fairly long node names, containing hyphens, this
+ % is a loss. Therefore, we give the text of the node name again, so it
+ % is as if TeX is seeing it for the first time.
+ \ifpdf
+ \leavevmode
+ \getfilename{#4}%
+ \ifnum\filenamelength>0
+ \startlink attr{/Border [0 0 0]}%
+ goto file{\the\filename.pdf} name{#1@}%
+ \else
+ \startlink attr{/Border [0 0 0]}%
+ goto name{#1@}%
+ \fi
+ \linkcolor
+ \fi
+ %
+ \ifdim \wd1 > 0pt
+ \putwordsection{} ``\printednodename'' \putwordin{} \cite{\printedmanual}%
+ \else
+ % _ (for example) has to be the character _ for the purposes of the
+ % control sequence corresponding to the node, but it has to expand
+ % into the usual \leavevmode...\vrule stuff for purposes of
+ % printing. So we \turnoffactive for the \refx-snt, back on for the
+ % printing, back off for the \refx-pg.
+ {\normalturnoffactive
+ % Only output a following space if the -snt ref is nonempty; for
+ % @unnumbered and @anchor, it won't be.
+ \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
+ \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
+ }%
+ % [mynode],
+ [\printednodename],\space
+ % page 3
+ \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
+ \fi
+ \endlink
+\endgroup}
+
+% \dosetq is the interface for calls from other macros
+
+% Use \normalturnoffactive so that punctuation chars such as underscore
+% and backslash work in node names. (\turnoffactive doesn't do \.)
+\def\dosetq#1#2{%
+ {\let\folio=0%
+ \normalturnoffactive
+ \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}%
+ \iflinks
+ \next
+ \fi
+ }%
+}
+
+% \internalsetq {foo}{page} expands into
+% CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
+% When the aux file is read, ' is the escape character
+
+\def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}}
+
+% Things to be expanded by \internalsetq
+
+\def\Ypagenumber{\folio}
+
+\def\Ytitle{\thissection}
+
+\def\Ynothing{}
+
+\def\Ysectionnumberandtype{%
+\ifnum\secno=0 \putwordChapter\xreftie\the\chapno %
+\else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno %
+\else \ifnum \subsubsecno=0 %
+\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno %
+\else %
+\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno %
+\fi \fi \fi }
+
+\def\Yappendixletterandtype{%
+\ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}%
+\else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno %
+\else \ifnum \subsubsecno=0 %
+\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno %
+\else %
+\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %
+\fi \fi \fi }
+
+\gdef\xreftie{'tie}
+
+% Use TeX 3.0's \inputlineno to get the line number, for better error
+% messages, but if we're using an old version of TeX, don't do anything.
+%
+\ifx\inputlineno\thisisundefined
+ \let\linenumber = \empty % Non-3.0.
+\else
+ \def\linenumber{\the\inputlineno:\space}
+\fi
+
+% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
+% If its value is nonempty, SUFFIX is output afterward.
+
+\def\refx#1#2{%
+ \expandafter\ifx\csname X#1\endcsname\relax
+ % If not defined, say something at least.
+ \angleleft un\-de\-fined\angleright
+ \iflinks
+ \ifhavexrefs
+ \message{\linenumber Undefined cross reference `#1'.}%
+ \else
+ \ifwarnedxrefs\else
+ \global\warnedxrefstrue
+ \message{Cross reference values unknown; you must run TeX again.}%
+ \fi
+ \fi
+ \fi
+ \else
+ % It's defined, so just use it.
+ \csname X#1\endcsname
+ \fi
+ #2% Output the suffix in any case.
+}
+
+% This is the macro invoked by entries in the aux file.
+%
+\def\xrdef#1{\begingroup
+ % Reenable \ as an escape while reading the second argument.
+ \catcode`\\ = 0
+ \afterassignment\endgroup
+ \expandafter\gdef\csname X#1\endcsname
+}
+
+% Read the last existing aux file, if any. No error if none exists.
+\def\readauxfile{\begingroup
+ \catcode`\^^@=\other
+ \catcode`\^^A=\other
+ \catcode`\^^B=\other
+ \catcode`\^^C=\other
+ \catcode`\^^D=\other
+ \catcode`\^^E=\other
+ \catcode`\^^F=\other
+ \catcode`\^^G=\other
+ \catcode`\^^H=\other
+ \catcode`\^^K=\other
+ \catcode`\^^L=\other
+ \catcode`\^^N=\other
+ \catcode`\^^P=\other
+ \catcode`\^^Q=\other
+ \catcode`\^^R=\other
+ \catcode`\^^S=\other
+ \catcode`\^^T=\other
+ \catcode`\^^U=\other
+ \catcode`\^^V=\other
+ \catcode`\^^W=\other
+ \catcode`\^^X=\other
+ \catcode`\^^Z=\other
+ \catcode`\^^[=\other
+ \catcode`\^^\=\other
+ \catcode`\^^]=\other
+ \catcode`\^^^=\other
+ \catcode`\^^_=\other
+ \catcode`\@=\other
+ \catcode`\^=\other
+ % It was suggested to define this as 7, which would allow ^^e4 etc.
+ % in xref tags, i.e., node names. But since ^^e4 notation isn't
+ % supported in the main text, it doesn't seem desirable. Furthermore,
+ % that is not enough: for node names that actually contain a ^
+ % character, we would end up writing a line like this: 'xrdef {'hat
+ % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
+ % argument, and \hat is not an expandable control sequence. It could
+ % all be worked out, but why? Either we support ^^ or we don't.
+ %
+ % The other change necessary for this was to define \auxhat:
+ % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
+ % and then to call \auxhat in \setq.
+ %
+ \catcode`\~=\other
+ \catcode`\[=\other
+ \catcode`\]=\other
+ \catcode`\"=\other
+ \catcode`\_=\other
+ \catcode`\|=\other
+ \catcode`\<=\other
+ \catcode`\>=\other
+ \catcode`\$=\other
+ \catcode`\#=\other
+ \catcode`\&=\other
+ \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
+ % Make the characters 128-255 be printing characters
+ {%
+ \count 1=128
+ \def\loop{%
+ \catcode\count 1=\other
+ \advance\count 1 by 1
+ \ifnum \count 1<256 \loop \fi
+ }%
+ }%
+ % The aux file uses ' as the escape (for now).
+ % Turn off \ as an escape so we do not lose on
+ % entries which were dumped with control sequences in their names.
+ % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
+ % Reference to such entries still does not work the way one would wish,
+ % but at least they do not bomb out when the aux file is read in.
+ \catcode`\{=1
+ \catcode`\}=2
+ \catcode`\%=\other
+ \catcode`\'=0
+ \catcode`\\=\other
+ %
+ \openin 1 \jobname.aux
+ \ifeof 1 \else
+ \closein 1
+ \input \jobname.aux
+ \global\havexrefstrue
+ \global\warnedobstrue
+ \fi
+ % Open the new aux file. TeX will close it automatically at exit.
+ \openout\auxfile=\jobname.aux
+\endgroup}
+
+
+% Footnotes.
+
+\newcount \footnoteno
+
+% The trailing space in the following definition for supereject is
+% vital for proper filling; pages come out unaligned when you do a
+% pagealignmacro call if that space before the closing brace is
+% removed. (Generally, numeric constants should always be followed by a
+% space to prevent strange expansion errors.)
+\def\supereject{\par\penalty -20000\footnoteno =0 }
+
+% @footnotestyle is meaningful for info output only.
+\let\footnotestyle=\comment
+
+\let\ptexfootnote=\footnote
+
+{\catcode `\@=11
+%
+% Auto-number footnotes. Otherwise like plain.
+\gdef\footnote{%
+ \global\advance\footnoteno by \@ne
+ \edef\thisfootno{$^{\the\footnoteno}$}%
+ %
+ % In case the footnote comes at the end of a sentence, preserve the
+ % extra spacing after we do the footnote number.
+ \let\@sf\empty
+ \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
+ %
+ % Remove inadvertent blank space before typesetting the footnote number.
+ \unskip
+ \thisfootno\@sf
+ \footnotezzz
+}%
+
+% Don't bother with the trickery in plain.tex to not require the
+% footnote text as a parameter. Our footnotes don't need to be so general.
+%
+% Oh yes, they do; otherwise, @ifset and anything else that uses
+% \parseargline fail inside footnotes because the tokens are fixed when
+% the footnote is read. --karl, 16nov96.
+%
+\long\gdef\footnotezzz{\insert\footins\bgroup
+ % We want to typeset this text as a normal paragraph, even if the
+ % footnote reference occurs in (for example) a display environment.
+ % So reset some parameters.
+ \interlinepenalty\interfootnotelinepenalty
+ \splittopskip\ht\strutbox % top baseline for broken footnotes
+ \splitmaxdepth\dp\strutbox
+ \floatingpenalty\@MM
+ \leftskip\z@skip
+ \rightskip\z@skip
+ \spaceskip\z@skip
+ \xspaceskip\z@skip
+ \parindent\defaultparindent
+ %
+ \smallfonts \rm
+ %
+ % Hang the footnote text off the number.
+ \hang
+ \textindent{\thisfootno}%
+ %
+ % Don't crash into the line above the footnote text. Since this
+ % expands into a box, it must come within the paragraph, lest it
+ % provide a place where TeX can split the footnote.
+ \footstrut
+ \futurelet\next\fo@t
+}
+\def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t
+ \else\let\next\f@t\fi \next}
+\def\f@@t{\bgroup\aftergroup\@foot\let\next}
+\def\f@t#1{#1\@foot}
+\def\@foot{\strut\par\egroup}
+
+}%end \catcode `\@=11
+
+% Set the baselineskip to #1, and the lineskip and strut size
+% correspondingly. There is no deep meaning behind these magic numbers
+% used as factors; they just match (closely enough) what Knuth defined.
+%
+\def\lineskipfactor{.08333}
+\def\strutheightpercent{.70833}
+\def\strutdepthpercent {.29167}
+%
+\def\setleading#1{%
+ \normalbaselineskip = #1\relax
+ \normallineskip = \lineskipfactor\normalbaselineskip
+ \normalbaselines
+ \setbox\strutbox =\hbox{%
+ \vrule width0pt height\strutheightpercent\baselineskip
+ depth \strutdepthpercent \baselineskip
+ }%
+}
+
+% @| inserts a changebar to the left of the current line. It should
+% surround any changed text. This approach does *not* work if the
+% change spans more than two lines of output. To handle that, we would
+% have adopt a much more difficult approach (putting marks into the main
+% vertical list for the beginning and end of each change).
+%
+\def\|{%
+ % \vadjust can only be used in horizontal mode.
+ \leavevmode
+ %
+ % Append this vertical mode material after the current line in the output.
+ \vadjust{%
+ % We want to insert a rule with the height and depth of the current
+ % leading; that is exactly what \strutbox is supposed to record.
+ \vskip-\baselineskip
+ %
+ % \vadjust-items are inserted at the left edge of the type. So
+ % the \llap here moves out into the left-hand margin.
+ \llap{%
+ %
+ % For a thicker or thinner bar, change the `1pt'.
+ \vrule height\baselineskip width1pt
+ %
+ % This is the space between the bar and the text.
+ \hskip 12pt
+ }%
+ }%
+}
+
+% For a final copy, take out the rectangles
+% that mark overfull boxes (in case you have decided
+% that the text looks ok even though it passes the margin).
+%
+\def\finalout{\overfullrule=0pt}
+
+% @image. We use the macros from epsf.tex to support this.
+% If epsf.tex is not installed and @image is used, we complain.
+%
+% Check for and read epsf.tex up front. If we read it only at @image
+% time, we might be inside a group, and then its definitions would get
+% undone and the next image would fail.
+\openin 1 = epsf.tex
+\ifeof 1 \else
+ \closein 1
+ % Do not bother showing banner with post-v2.7 epsf.tex (available in
+ % doc/epsf.tex until it shows up on ctan).
+ \def\epsfannounce{\toks0 = }%
+ \input epsf.tex
+\fi
+%
+% We will only complain once about lack of epsf.tex.
+\newif\ifwarnednoepsf
+\newhelp\noepsfhelp{epsf.tex must be installed for images to
+ work. It is also included in the Texinfo distribution, or you can get
+ it from ftp://tug.org/tex/epsf.tex.}
+%
+\def\image#1{%
+ \ifx\epsfbox\undefined
+ \ifwarnednoepsf \else
+ \errhelp = \noepsfhelp
+ \errmessage{epsf.tex not found, images will be ignored}%
+ \global\warnednoepsftrue
+ \fi
+ \else
+ \imagexxx #1,,,\finish
+ \fi
+}
+%
+% Arguments to @image:
+% #1 is (mandatory) image filename; we tack on .eps extension.
+% #2 is (optional) width, #3 is (optional) height.
+% #4 is just the usual extra ignored arg for parsing this stuff.
+\def\imagexxx#1,#2,#3,#4\finish{%
+ \ifpdf
+ \centerline{\dopdfimage{#1}{#2}{#3}}%
+ \else
+ % \epsfbox itself resets \epsf?size at each figure.
+ \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
+ \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
+ \begingroup
+ \catcode`\^^M = 5 % in case we're inside an example
+ % If the image is by itself, center it.
+ \ifvmode
+ \nobreak\bigskip
+ % Usually we'll have text after the image which will insert
+ % \parskip glue, so insert it here too to equalize the space
+ % above and below.
+ \nobreak\vskip\parskip
+ \nobreak
+ \centerline{\epsfbox{#1.eps}}%
+ \bigbreak
+ \else
+ % In the middle of a paragraph, no extra space.
+ \epsfbox{#1.eps}%
+ \fi
+ \endgroup
+ \fi
+}
+
+
+\message{localization,}
+% and i18n.
+
+% @documentlanguage is usually given very early, just after
+% @setfilename. If done too late, it may not override everything
+% properly. Single argument is the language abbreviation.
+% It would be nice if we could set up a hyphenation file here.
+%
+\def\documentlanguage{\parsearg\dodocumentlanguage}
+\def\dodocumentlanguage#1{%
+ \tex % read txi-??.tex file in plain TeX.
+ % Read the file if it exists.
+ \openin 1 txi-#1.tex
+ \ifeof1
+ \errhelp = \nolanghelp
+ \errmessage{Cannot read language file txi-#1.tex}%
+ \let\temp = \relax
+ \else
+ \def\temp{\input txi-#1.tex }%
+ \fi
+ \temp
+ \endgroup
+}
+\newhelp\nolanghelp{The given language definition file cannot be found or
+is empty. Maybe you need to install it? In the current directory
+should work if nowhere else does.}
+
+
+% @documentencoding should change something in TeX eventually, most
+% likely, but for now just recognize it.
+\let\documentencoding = \comment
+
+
+% Page size parameters.
+%
+\newdimen\defaultparindent \defaultparindent = 15pt
+
+\chapheadingskip = 15pt plus 4pt minus 2pt
+\secheadingskip = 12pt plus 3pt minus 2pt
+\subsecheadingskip = 9pt plus 2pt minus 2pt
+
+% Prevent underfull vbox error messages.
+\vbadness = 10000
+
+% Don't be so finicky about underfull hboxes, either.
+\hbadness = 2000
+
+% Following George Bush, just get rid of widows and orphans.
+\widowpenalty=10000
+\clubpenalty=10000
+
+% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
+% using an old version of TeX, don't do anything. We want the amount of
+% stretch added to depend on the line length, hence the dependence on
+% \hsize. We call this whenever the paper size is set.
+%
+\def\setemergencystretch{%
+ \ifx\emergencystretch\thisisundefined
+ % Allow us to assign to \emergencystretch anyway.
+ \def\emergencystretch{\dimen0}%
+ \else
+ \emergencystretch = .15\hsize
+ \fi
+}
+
+% Parameters in order: 1) textheight; 2) textwidth; 3) voffset;
+% 4) hoffset; 5) binding offset; 6) topskip. Then whoever calls us can
+% set \parskip and call \setleading for \baselineskip.
+%
+\def\internalpagesizes#1#2#3#4#5#6{%
+ \voffset = #3\relax
+ \topskip = #6\relax
+ \splittopskip = \topskip
+ %
+ \vsize = #1\relax
+ \advance\vsize by \topskip
+ \outervsize = \vsize
+ \advance\outervsize by 2\topandbottommargin
+ \pageheight = \vsize
+ %
+ \hsize = #2\relax
+ \outerhsize = \hsize
+ \advance\outerhsize by 0.5in
+ \pagewidth = \hsize
+ %
+ \normaloffset = #4\relax
+ \bindingoffset = #5\relax
+ %
+ \parindent = \defaultparindent
+ \setemergencystretch
+}
+
+% @letterpaper (the default).
+\def\letterpaper{{\globaldefs = 1
+ \parskip = 3pt plus 2pt minus 1pt
+ \setleading{13.2pt}%
+ %
+ % If page is nothing but text, make it come out even.
+ \internalpagesizes{46\baselineskip}{6in}{\voffset}{.25in}{\bindingoffset}{36pt}%
+}}
+
+% Use @smallbook to reset parameters for 7x9.5 (or so) format.
+\def\smallbook{{\globaldefs = 1
+ \parskip = 2pt plus 1pt
+ \setleading{12pt}%
+ %
+ \internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}%
+ %
+ \lispnarrowing = 0.3in
+ \tolerance = 700
+ \hfuzz = 1pt
+ \contentsrightmargin = 0pt
+ \deftypemargin = 0pt
+ \defbodyindent = .5cm
+ %
+ \let\smalldisplay = \smalldisplayx
+ \let\smallexample = \smalllispx
+ \let\smallformat = \smallformatx
+ \let\smalllisp = \smalllispx
+}}
+
+% Use @afourpaper to print on European A4 paper.
+\def\afourpaper{{\globaldefs = 1
+ \setleading{12pt}%
+ \parskip = 3pt plus 2pt minus 1pt
+ %
+ \internalpagesizes{53\baselineskip}{160mm}{\voffset}{4mm}{\bindingoffset}{44pt}%
+ %
+ \tolerance = 700
+ \hfuzz = 1pt
+}}
+
+% A specific text layout, 24x15cm overall, intended for A4 paper. Top margin
+% 29mm, hence bottom margin 28mm, nominal side margin 3cm.
+\def\afourlatex{{\globaldefs = 1
+ \setleading{13.6pt}%
+ %
+ \afourpaper
+ \internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}%
+ %
+ \globaldefs = 0
+}}
+
+% Use @afourwide to print on European A4 paper in wide format.
+\def\afourwide{%
+ \afourpaper
+ \internalpagesizes{6.5in}{9.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}%
+ %
+ \globaldefs = 0
+}
+
+% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
+% Perhaps we should allow setting the margins, \topskip, \parskip,
+% and/or leading, also. Or perhaps we should compute them somehow.
+%
+\def\pagesizes{\parsearg\pagesizesxxx}
+\def\pagesizesxxx#1{\pagesizesyyy #1,,\finish}
+\def\pagesizesyyy#1,#2,#3\finish{{%
+ \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
+ \globaldefs = 1
+ %
+ \parskip = 3pt plus 2pt minus 1pt
+ \setleading{13.2pt}%
+ %
+ \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}%
+}}
+
+% Set default to letter.
+%
+\letterpaper
+
+
+\message{and turning on texinfo input format.}
+
+% Define macros to output various characters with catcode for normal text.
+\catcode`\"=\other
+\catcode`\~=\other
+\catcode`\^=\other
+\catcode`\_=\other
+\catcode`\|=\other
+\catcode`\<=\other
+\catcode`\>=\other
+\catcode`\+=\other
+\catcode`\$=\other
+\def\normaldoublequote{"}
+\def\normaltilde{~}
+\def\normalcaret{^}
+\def\normalunderscore{_}
+\def\normalverticalbar{|}
+\def\normalless{<}
+\def\normalgreater{>}
+\def\normalplus{+}
+\def\normaldollar{$}
+
+% This macro is used to make a character print one way in ttfont
+% where it can probably just be output, and another way in other fonts,
+% where something hairier probably needs to be done.
+%
+% #1 is what to print if we are indeed using \tt; #2 is what to print
+% otherwise. Since all the Computer Modern typewriter fonts have zero
+% interword stretch (and shrink), and it is reasonable to expect all
+% typewriter fonts to have this, we can check that font parameter.
+%
+\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
+
+% Same as above, but check for italic font. Actually this also catches
+% non-italic slanted fonts since it is impossible to distinguish them from
+% italic fonts. But since this is only used by $ and it uses \sl anyway
+% this is not a problem.
+\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
+
+% Turn off all special characters except @
+% (and those which the user can use as if they were ordinary).
+% Most of these we simply print from the \tt font, but for some, we can
+% use math or other variants that look better in normal text.
+
+\catcode`\"=\active
+\def\activedoublequote{{\tt\char34}}
+\let"=\activedoublequote
+\catcode`\~=\active
+\def~{{\tt\char126}}
+\chardef\hat=`\^
+\catcode`\^=\active
+\def^{{\tt \hat}}
+
+\catcode`\_=\active
+\def_{\ifusingtt\normalunderscore\_}
+% Subroutine for the previous macro.
+\def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}}
+
+\catcode`\|=\active
+\def|{{\tt\char124}}
+\chardef \less=`\<
+\catcode`\<=\active
+\def<{{\tt \less}}
+\chardef \gtr=`\>
+\catcode`\>=\active
+\def>{{\tt \gtr}}
+\catcode`\+=\active
+\def+{{\tt \char 43}}
+\catcode`\$=\active
+\def${\ifusingit{{\sl\$}}\normaldollar}
+%\catcode 27=\active
+%\def^^[{$\diamondsuit$}
+
+% Set up an active definition for =, but don't enable it most of the time.
+{\catcode`\==\active
+\global\def={{\tt \char 61}}}
+
+\catcode`+=\active
+\catcode`\_=\active
+
+% If a .fmt file is being used, characters that might appear in a file
+% name cannot be active until we have parsed the command line.
+% So turn them off again, and have \everyjob (or @setfilename) turn them on.
+% \otherifyactive is called near the end of this file.
+\def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
+
+\catcode`\@=0
+
+% \rawbackslashxx output one backslash character in current font
+\global\chardef\rawbackslashxx=`\\
+%{\catcode`\\=\other
+%@gdef@rawbackslashxx{\}}
+
+% \rawbackslash redefines \ as input to do \rawbackslashxx.
+{\catcode`\\=\active
+@gdef@rawbackslash{@let\=@rawbackslashxx }}
+
+% \normalbackslash outputs one backslash in fixed width font.
+\def\normalbackslash{{\tt\rawbackslashxx}}
+
+% \catcode 17=0 % Define control-q
+\catcode`\\=\active
+
+% Used sometimes to turn off (effectively) the active characters
+% even after parsing them.
+@def@turnoffactive{@let"=@normaldoublequote
+@let\=@realbackslash
+@let~=@normaltilde
+@let^=@normalcaret
+@let_=@normalunderscore
+@let|=@normalverticalbar
+@let<=@normalless
+@let>=@normalgreater
+@let+=@normalplus
+@let$=@normaldollar}
+
+@def@normalturnoffactive{@let"=@normaldoublequote
+@let\=@normalbackslash
+@let~=@normaltilde
+@let^=@normalcaret
+@let_=@normalunderscore
+@let|=@normalverticalbar
+@let<=@normalless
+@let>=@normalgreater
+@let+=@normalplus
+@let$=@normaldollar}
+
+% Make _ and + \other characters, temporarily.
+% This is canceled by @fixbackslash.
+@otherifyactive
+
+% If a .fmt file is being used, we don't want the `\input texinfo' to show up.
+% That is what \eatinput is for; after that, the `\' should revert to printing
+% a backslash.
+%
+@gdef@eatinput input texinfo{@fixbackslash}
+@global@let\ = @eatinput
+
+% On the other hand, perhaps the file did not have a `\input texinfo'. Then
+% the first `\{ in the file would cause an error. This macro tries to fix
+% that, assuming it is called before the first `\' could plausibly occur.
+% Also back turn on active characters that might appear in the input
+% file name, in case not using a pre-dumped format.
+%
+@gdef@fixbackslash{%
+ @ifx\@eatinput @let\ = @normalbackslash @fi
+ @catcode`+=@active
+ @catcode`@_=@active
+}
+
+% Say @foo, not \foo, in error messages.
+@escapechar = `@@
+
+% These look ok in all fonts, so just make them not special.
+@catcode`@& = @other
+@catcode`@# = @other
+@catcode`@% = @other
+
+@c Set initial fonts.
+@textfonts
+@rm
+
+
+@c Local variables:
+@c eval: (add-hook 'write-file-hooks 'time-stamp)
+@c page-delimiter: "^\\\\message"
+@c time-stamp-start: "def\\\\texinfoversion{"
+@c time-stamp-format: "%:y-%02m-%02d.%02H"
+@c time-stamp-end: "}"
+@c End:
diff --git a/include/Makefile.am b/include/Makefile.am
new file mode 100644
index 0000000..57a52d5
--- /dev/null
+++ b/include/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = parted
diff --git a/include/parted/Makefile.am b/include/parted/Makefile.am
new file mode 100644
index 0000000..976542f
--- /dev/null
+++ b/include/parted/Makefile.am
@@ -0,0 +1,18 @@
+partedincludedir = $(includedir)/parted
+partedinclude_HEADERS = gnu.h \
+ linux.h \
+ constraint.h \
+ debug.h \
+ device.h \
+ disk.h \
+ exception.h \
+ filesys.h \
+ geom.h \
+ natmath.h \
+ timer.h \
+ unit.h \
+ parted.h
+
+noinst_HEADERS = crc32.h \
+ endian.h
+
diff --git a/include/parted/beos.h b/include/parted/beos.h
new file mode 100644
index 0000000..0870829
--- /dev/null
+++ b/include/parted/beos.h
@@ -0,0 +1,37 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef PED_BEOS_H_INCLUDED
+#define PED_BEOS_H_INCLUDED
+
+#include <parted/parted.h>
+#include <parted/device.h>
+
+#define BEOS_SPECIFIC(dev) ((BEOSSpecific*) (dev)->arch_specific)
+
+typedef struct _BEOSSpecific BEOSSpecific;
+
+struct _BEOSSpecific {
+ int fd;
+};
+
+extern PedArchitecture ped_beos_arch;
+
+#endif /* PED_LINUX_H_INCLUDED */
+
diff --git a/include/parted/constraint.h b/include/parted/constraint.h
new file mode 100644
index 0000000..529c8b3
--- /dev/null
+++ b/include/parted/constraint.h
@@ -0,0 +1,97 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef PED_CONSTRAINT_H_INCLUDED
+#define PED_CONSTRAINT_H_INCLUDED
+
+typedef struct _PedConstraint PedConstraint;
+
+#include <parted/device.h>
+#include <parted/natmath.h>
+
+struct _PedConstraint {
+ PedAlignment* start_align;
+ PedAlignment* end_align;
+ PedGeometry* start_range;
+ PedGeometry* end_range;
+ PedSector min_size;
+ PedSector max_size;
+};
+
+extern int
+ped_constraint_init (
+ PedConstraint* constraint,
+ const PedAlignment* start_align,
+ const PedAlignment* end_align,
+ const PedGeometry* start_range,
+ const PedGeometry* end_range,
+ PedSector min_size,
+ PedSector max_size);
+
+extern PedConstraint*
+ped_constraint_new (
+ const PedAlignment* start_align,
+ const PedAlignment* end_align,
+ const PedGeometry* start_range,
+ const PedGeometry* end_range,
+ PedSector min_size,
+ PedSector max_size);
+
+extern PedConstraint*
+ped_constraint_new_from_min_max (
+ const PedGeometry* min,
+ const PedGeometry* max);
+
+extern PedConstraint*
+ped_constraint_new_from_min (const PedGeometry* min);
+
+extern PedConstraint*
+ped_constraint_new_from_max (const PedGeometry* max);
+
+extern PedConstraint*
+ped_constraint_duplicate (const PedConstraint* constraint);
+
+extern void
+ped_constraint_done (PedConstraint* constraint);
+
+extern void
+ped_constraint_destroy (PedConstraint* constraint);
+
+extern PedConstraint*
+ped_constraint_intersect (const PedConstraint* a, const PedConstraint* b);
+
+extern PedGeometry*
+ped_constraint_solve_max (const PedConstraint* constraint);
+
+extern PedGeometry*
+ped_constraint_solve_nearest (
+ const PedConstraint* constraint, const PedGeometry* geom);
+
+extern int
+ped_constraint_is_solution (const PedConstraint* constraint,
+ const PedGeometry* geom);
+
+extern PedConstraint*
+ped_constraint_any (const PedDevice* dev);
+
+extern PedConstraint*
+ped_constraint_exact (const PedGeometry* geom);
+
+#endif /* PED_CONSTRAINT_H_INCLUDED */
+
diff --git a/include/parted/crc32.h b/include/parted/crc32.h
new file mode 100644
index 0000000..271d773
--- /dev/null
+++ b/include/parted/crc32.h
@@ -0,0 +1,35 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 1998-2000 Free Software Foundation, Inc.
+
+ crc32.h
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef _CRC32_H
+#define _CRC32_H
+
+#include <stdint.h>
+
+/*
+ * This computes a 32 bit CRC of the data in the buffer, and returns the CRC.
+ * The polynomial used is 0xedb88320.
+ */
+
+extern uint32_t __efi_crc32 (const void *buf, unsigned long len,
+ uint32_t seed);
+
+#endif /* _CRC32_H */
diff --git a/include/parted/debug.h b/include/parted/debug.h
new file mode 100644
index 0000000..d1fa6ac
--- /dev/null
+++ b/include/parted/debug.h
@@ -0,0 +1,92 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef PED_DEBUG_H_INCLUDED
+#define PED_DEBUG_H_INCLUDED
+
+#include "config.h"
+
+#include <stdarg.h>
+
+#ifdef DEBUG
+
+typedef void (PedDebugHandler) ( const int level, const char* file, int line,
+ const char* function, const char* msg );
+
+extern void ped_debug_set_handler (PedDebugHandler* handler);
+extern void ped_debug ( const int level, const char* file, int line,
+ const char* function, const char* msg, ... );
+
+extern int ped_assert ( int cond, const char* cond_text,
+ const char* file, int line, const char* function );
+
+#if defined(__GNUC__) && !defined(__JSFTRACE__)
+
+#define PED_DEBUG(level, ...) \
+ ped_debug ( level, __FILE__, __LINE__, __PRETTY_FUNCTION__, \
+ __VA_ARGS__ );
+
+#define PED_ASSERT(cond, action) \
+ do { \
+ if (!ped_assert ( cond, \
+ #cond, \
+ __FILE__, \
+ __LINE__, \
+ __PRETTY_FUNCTION__ )) \
+ { \
+ action; \
+ } \
+ } while (0)
+
+#else /* !__GNUC__ */
+
+/* function because variadic macros are C99 */
+static void PED_DEBUG (int level, ...)
+{
+ va_list va_args;
+
+ va_start (va_args, level);
+ ped_debug ( level, "unknown file", 0, "unknown function", va_args );
+ va_end (va_args);
+}
+
+#define PED_ASSERT(cond, action) \
+ do { \
+ if (!ped_assert ( cond, \
+ #cond, \
+ "unknown", \
+ 0, \
+ "unknown" )) \
+ { \
+ action; \
+ } \
+ } while (0)
+
+#endif /* __GNUC__ */
+
+#else /* !DEBUG */
+
+#define PED_ASSERT(cond, action) while (0) {}
+#define PED_DEBUG(level, ...) while (0) {}
+
+
+#endif /* DEBUG */
+
+#endif /* PED_DEBUG_H_INCLUDED */
+
diff --git a/include/parted/device.h b/include/parted/device.h
new file mode 100644
index 0000000..c0ed858
--- /dev/null
+++ b/include/parted/device.h
@@ -0,0 +1,146 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 1998 - 2001, 2005 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+/**
+ * \addtogroup PedDevice
+ * @{
+ */
+
+/** \file device.h */
+
+#ifndef PED_DEVICE_H_INCLUDED
+#define PED_DEVICE_H_INCLUDED
+
+#include <parted/timer.h>
+
+/** We can address 2^63 sectors */
+typedef long long PedSector;
+
+/** \deprecated Removal from API planned */
+typedef enum {
+ PED_DEVICE_UNKNOWN = 0,
+ PED_DEVICE_SCSI = 1,
+ PED_DEVICE_IDE = 2,
+ PED_DEVICE_DAC960 = 3,
+ PED_DEVICE_CPQARRAY = 4,
+ PED_DEVICE_FILE = 5,
+ PED_DEVICE_ATARAID = 6,
+ PED_DEVICE_I2O = 7,
+ PED_DEVICE_UBD = 8,
+ PED_DEVICE_DASD = 9,
+ PED_DEVICE_VIODASD = 10,
+ PED_DEVICE_SX8 = 11
+} PedDeviceType;
+
+typedef struct _PedDevice PedDevice;
+typedef struct _PedDeviceArchOps PedDeviceArchOps;
+typedef struct _PedCHSGeometry PedCHSGeometry;
+
+/**
+ * A cylinder-head-sector "old-style" geometry.
+ *
+ * A device addressed in this way has C*H*S sectors.
+ */
+struct _PedCHSGeometry {
+ int cylinders;
+ int heads;
+ int sectors;
+};
+
+/** A block device - for example, /dev/hda, not /dev/hda3 */
+struct _PedDevice {
+ PedDevice* next;
+
+ char* model; /**< \brief description of hardware
+ (manufacturer, model) */
+ char* path; /**< device /dev entry */
+
+ PedDeviceType type; /**< SCSI, IDE, etc.
+ \deprecated \sa PedDeviceType */
+ long long sector_size; /**< logical sector size */
+ long long phys_sector_size; /**< physical sector size */
+ PedSector length; /**< device length (LBA) */
+
+ int open_count; /**< the number of times this device has
+ been opened with ped_device_open(). */
+ int read_only;
+ int external_mode;
+ int dirty;
+ int boot_dirty;
+
+ PedCHSGeometry hw_geom;
+ PedCHSGeometry bios_geom;
+ short host, did;
+
+ void* arch_specific;
+};
+
+/**
+ * List of functions implementing architecture-specific operations.
+ */
+struct _PedDeviceArchOps {
+ PedDevice* (*_new) (const char* path);
+ void (*destroy) (PedDevice* dev);
+ int (*is_busy) (PedDevice* dev);
+ int (*open) (PedDevice* dev);
+ int (*refresh_open) (PedDevice* dev);
+ int (*close) (PedDevice* dev);
+ int (*refresh_close) (PedDevice* dev);
+ int (*read) (const PedDevice* dev, void* buffer,
+ PedSector start, PedSector count);
+ int (*write) (PedDevice* dev, const void* buffer,
+ PedSector start, PedSector count);
+ int (*sync) (PedDevice* dev);
+ int (*sync_fast) (PedDevice* dev);
+ PedSector (*check) (PedDevice* dev, void* buffer,
+ PedSector start, PedSector count);
+ void (*probe_all) ();
+};
+
+extern void ped_device_probe_all ();
+extern void ped_device_free_all ();
+
+extern PedDevice* ped_device_get (const char* name);
+extern PedDevice* ped_device_get_next (const PedDevice* dev);
+extern int ped_device_is_busy (PedDevice* dev);
+extern int ped_device_open (PedDevice* dev);
+extern int ped_device_close (PedDevice* dev);
+extern void ped_device_destroy (PedDevice* dev);
+
+extern int ped_device_begin_external_access (PedDevice* dev);
+extern int ped_device_end_external_access (PedDevice* dev);
+
+extern int ped_device_read (const PedDevice* dev, void* buffer,
+ PedSector start, PedSector count);
+extern int ped_device_write (PedDevice* dev, const void* buffer,
+ PedSector start, PedSector count);
+extern int ped_device_sync (PedDevice* dev);
+extern int ped_device_sync_fast (PedDevice* dev);
+extern PedSector ped_device_check (PedDevice* dev, void* buffer,
+ PedSector start, PedSector count);
+extern PedConstraint* ped_device_get_constraint (PedDevice* dev);
+
+/* private stuff ;-) */
+
+extern void _ped_device_probe (const char* path);
+
+#endif /* PED_DEVICE_H_INCLUDED */
+
+/** @} */
+
diff --git a/include/parted/disk.h b/include/parted/disk.h
new file mode 100644
index 0000000..286740b
--- /dev/null
+++ b/include/parted/disk.h
@@ -0,0 +1,339 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+/**
+ * \addtogroup PedDisk
+ * @{
+ */
+
+/** \file disk.h */
+
+#ifndef PED_DISK_H_INCLUDED
+#define PED_DISK_H_INCLUDED
+
+typedef struct _PedDisk PedDisk;
+typedef struct _PedPartition PedPartition;
+typedef const struct _PedDiskOps PedDiskOps;
+typedef struct _PedDiskType PedDiskType;
+typedef const struct _PedDiskArchOps PedDiskArchOps;
+
+#include <parted/device.h>
+#include <parted/filesys.h>
+#include <parted/natmath.h>
+#include <parted/geom.h>
+
+/**
+ * Partition types
+ */
+typedef enum {
+ PED_PARTITION_NORMAL = 0x00,
+ PED_PARTITION_LOGICAL = 0x01,
+ PED_PARTITION_EXTENDED = 0x02,
+ PED_PARTITION_FREESPACE = 0x04,
+ PED_PARTITION_METADATA = 0x08,
+ PED_PARTITION_PROTECTED = 0x10
+} PedPartitionType;
+
+/**
+ * Partition flags.
+ */
+typedef enum {
+ PED_PARTITION_BOOT=1,
+ PED_PARTITION_ROOT=2,
+ PED_PARTITION_SWAP=3,
+ PED_PARTITION_HIDDEN=4,
+ PED_PARTITION_RAID=5,
+ PED_PARTITION_LVM=6,
+ PED_PARTITION_LBA=7,
+ PED_PARTITION_HPSERVICE=8,
+ PED_PARTITION_PALO=9,
+ PED_PARTITION_PREP=10,
+ PED_PARTITION_MSFT_RESERVED=11
+} PedPartitionFlag;
+#define PED_PARTITION_FIRST_FLAG PED_PARTITION_BOOT
+#define PED_PARTITION_LAST_FLAG PED_PARTITION_MSFT_RESERVED
+
+typedef enum {
+ PED_DISK_TYPE_EXTENDED=1, /**< supports extended partitions */
+ PED_DISK_TYPE_PARTITION_NAME=2 /**< supports partition names */
+} PedDiskTypeFeature;
+#define PED_DISK_TYPE_FIRST_FEATURE PED_DISK_TYPE_EXTENDED
+#define PED_DISK_TYPE_LAST_FEATURE PED_DISK_TYPE_PARTITION_NAME
+
+/** @} */
+
+/**
+ * \addtogroup PedPartition
+ *
+ * @{
+ */
+
+/** \file disk.h */
+
+/**
+ * PedPartition structure represents a partition.
+ */
+struct _PedPartition {
+ PedPartition* prev;
+ PedPartition* next;
+
+ /**< the partition table of the partition */
+ PedDisk* disk;
+ PedGeometry geom; /**< geometry of the partition */
+
+ /**< the partition number: In Linux, this is the
+ same as the minor number. No assumption
+ should be made about "num" and "type"
+ - different disk labels have different rules. */
+
+ int num;
+ PedPartitionType type; /**< the type of partition: a bit field of
+ PED_PARTITION_LOGICAL, PED_PARTITION_EXTENDED,
+ PED_PARTITION_METADATA
+ and PED_PARTITION_FREESPACE.
+ Both the first two, and the last two are
+ mutually exclusive.
+ An extended partition is a primary
+ partition that may contain logical partitions.
+ There is at most one extended partition on
+ a disk.
+ A logical partition is like a primary
+ partition, except it's inside an extended
+ partition. Internally, pseudo partitions are
+ allocated to represent free space, or disk
+ label meta-data. These have the
+ PED_PARTITION_FREESPACE or
+ PED_PARTITION_METADATA bit set. */
+
+ /**< The type of file system on the partition. NULL if unknown. */
+ const PedFileSystemType* fs_type;
+
+ /**< Only used for an extended partition. The list of logical
+ partitions (and free space and metadata within the extended
+ partition). */
+ PedPartition* part_list;
+
+ void* disk_specific;
+};
+
+/** @} */
+
+/**
+ * \addtogroup PedDisk
+ * @{
+ */
+
+/**
+ * Represents a disk label (partition table).
+ */
+struct _PedDisk {
+ PedDevice* dev; /**< the device where the
+ partition table lies */
+ const PedDiskType* type; /**< type of disk label */
+ const int* block_sizes; /**< block sizes supported
+ by this label */
+ PedPartition* part_list; /**< list of partitions. Access with
+ ped_disk_next_partition() */
+
+ void* disk_specific;
+
+/* office use only ;-) */
+ int needs_clobber; /**< clobber before write? */
+ int update_mode; /**< mode without free/metadata
+ partitions, for easier
+ update */
+};
+
+struct _PedDiskOps {
+ /* disk label operations */
+ int (*probe) (const PedDevice *dev);
+ int (*clobber) (PedDevice* dev);
+ PedDisk* (*alloc) (const PedDevice* dev);
+ PedDisk* (*duplicate) (const PedDisk* disk);
+ void (*free) (PedDisk* disk);
+ int (*read) (PedDisk* disk);
+ int (*write) (PedDisk* disk);
+ /** \todo add label guessing op here */
+
+ /* partition operations */
+ PedPartition* (*partition_new) (
+ const PedDisk* disk,
+ PedPartitionType part_type,
+ const PedFileSystemType* fs_type,
+ PedSector start,
+ PedSector end);
+ PedPartition* (*partition_duplicate) (const PedPartition* part);
+ void (*partition_destroy) (PedPartition* part);
+ int (*partition_set_system) (PedPartition* part,
+ const PedFileSystemType* fs_type);
+ int (*partition_set_flag) (
+ PedPartition* part,
+ PedPartitionFlag flag,
+ int state);
+ int (*partition_get_flag) (
+ const PedPartition* part,
+ PedPartitionFlag flag);
+ int (*partition_is_flag_available) (
+ const PedPartition* part,
+ PedPartitionFlag flag);
+ void (*partition_set_name) (PedPartition* part, const char* name);
+ const char* (*partition_get_name) (const PedPartition* part);
+ int (*partition_align) (PedPartition* part,
+ const PedConstraint* constraint);
+ int (*partition_enumerate) (PedPartition* part);
+
+ /* other */
+ int (*alloc_metadata) (PedDisk* disk);
+ int (*get_max_primary_partition_count) (const PedDisk* disk);
+};
+
+struct _PedDiskType {
+ PedDiskType* next;
+ const char* name; /**< the name of the partition table type.
+ \todo not very intuitive name */
+ PedDiskOps* const ops;
+
+ PedDiskTypeFeature features; /**< bitmap of supported features */
+};
+
+/**
+ * Architecture-specific operations. i.e. communication with kernel (or
+ * whatever) about changes, etc.
+ */
+struct _PedDiskArchOps {
+ char* (*partition_get_path) (const PedPartition* part);
+ int (*partition_is_busy) (const PedPartition* part);
+ int (*disk_commit) (PedDisk* disk);
+};
+
+extern void ped_register_disk_type (PedDiskType* type);
+extern void ped_unregister_disk_type (PedDiskType* type);
+extern PedDiskType* ped_disk_type_get_next (PedDiskType* type);
+extern PedDiskType* ped_disk_type_get (const char* name);
+extern int ped_disk_type_check_feature (const PedDiskType* disk_type,
+ PedDiskTypeFeature feature);
+
+extern PedDiskType* ped_disk_probe (PedDevice* dev);
+extern int ped_disk_clobber (PedDevice* dev);
+extern int ped_disk_clobber_exclude (PedDevice* dev,
+ const PedDiskType* exclude);
+extern PedDisk* ped_disk_new (PedDevice* dev);
+extern PedDisk* ped_disk_new_fresh (PedDevice* dev,
+ const PedDiskType* disk_type);
+extern PedDisk* ped_disk_duplicate (const PedDisk* old_disk);
+extern void ped_disk_destroy (PedDisk* disk);
+extern int ped_disk_commit (PedDisk* disk);
+extern int ped_disk_commit_to_dev (PedDisk* disk);
+extern int ped_disk_commit_to_os (PedDisk* disk);
+extern int ped_disk_check (PedDisk* disk);
+extern void ped_disk_print (PedDisk* disk);
+
+extern int ped_disk_get_primary_partition_count (PedDisk* disk);
+extern int ped_disk_get_last_partition_num (PedDisk* disk);
+extern int ped_disk_get_max_primary_partition_count (const PedDisk* disk);
+
+/** @} */
+
+/**
+ * \addtogroup PedPartition
+ *
+ * @{
+ */
+
+extern PedPartition* ped_partition_new (const PedDisk* disk,
+ PedPartitionType type,
+ const PedFileSystemType* fs_type,
+ PedSector start,
+ PedSector end);
+extern void ped_partition_destroy (PedPartition* part);
+extern int ped_partition_is_active (const PedPartition* part);
+extern int ped_partition_set_flag (PedPartition* part, PedPartitionFlag flag,
+ int state);
+extern int ped_partition_get_flag (const PedPartition* part,
+ PedPartitionFlag flag);
+extern int ped_partition_is_flag_available (const PedPartition* part,
+ PedPartitionFlag flag);
+extern int ped_partition_set_system (PedPartition* part,
+ const PedFileSystemType* fs_type);
+extern int ped_partition_set_name (PedPartition* part, const char* name);
+extern const char* ped_partition_get_name (const PedPartition* part);
+extern int ped_partition_is_busy (const PedPartition* part);
+extern char* ped_partition_get_path (const PedPartition* part);
+
+extern const char* ped_partition_type_get_name (PedPartitionType part_type);
+extern const char* ped_partition_flag_get_name (PedPartitionFlag flag);
+extern PedPartitionFlag ped_partition_flag_get_by_name (const char* name);
+extern PedPartitionFlag ped_partition_flag_next (PedPartitionFlag flag);
+
+/** @} */
+
+/**
+ * \addtogroup PedDisk
+ * @{
+ */
+
+extern int ped_disk_add_partition (PedDisk* disk, PedPartition* part,
+ const PedConstraint* constraint);
+extern int ped_disk_remove_partition (PedDisk* disk, PedPartition* part);
+extern int ped_disk_delete_partition (PedDisk* disk, PedPartition* part);
+extern int ped_disk_delete_all (PedDisk* disk);
+extern int ped_disk_set_partition_geom (PedDisk* disk, PedPartition* part,
+ const PedConstraint* constraint,
+ PedSector start, PedSector end);
+extern int ped_disk_maximize_partition (PedDisk* disk, PedPartition* part,
+ const PedConstraint* constraint);
+extern PedGeometry* ped_disk_get_max_partition_geometry (PedDisk* disk,
+ PedPartition* part, const PedConstraint* constraint);
+extern int ped_disk_minimize_extended_partition (PedDisk* disk);
+
+extern PedPartition* ped_disk_next_partition (const PedDisk* disk,
+ const PedPartition* part);
+extern PedPartition* ped_disk_get_partition (const PedDisk* disk, int num);
+extern PedPartition* ped_disk_get_partition_by_sector (const PedDisk* disk,
+ PedSector sect);
+extern PedPartition* ped_disk_extended_partition (const PedDisk* disk);
+
+/* internal functions */
+extern PedDisk* _ped_disk_alloc (const PedDevice* dev, const PedDiskType* type);
+extern void _ped_disk_free (PedDisk* disk);
+
+
+/** @} */
+
+/**
+ * \addtogroup PedPartition
+ *
+ * @{
+ */
+
+extern PedPartition* _ped_partition_alloc (const PedDisk* disk,
+ PedPartitionType type,
+ const PedFileSystemType* fs_type,
+ PedSector start,
+ PedSector end);
+extern void _ped_partition_free (PedPartition* part);
+
+extern int _ped_partition_attempt_align (
+ PedPartition* part, const PedConstraint* external,
+ PedConstraint* internal);
+
+#endif /* PED_DISK_H_INCLUDED */
+
+/** @} */
+
diff --git a/include/parted/endian.h b/include/parted/endian.h
new file mode 100644
index 0000000..7d1a7ec
--- /dev/null
+++ b/include/parted/endian.h
@@ -0,0 +1,87 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+/* should only be #included by files in libparted */
+
+#ifndef PED_ENDIAN_H_INCLUDED
+#define PED_ENDIAN_H_INCLUDED
+
+#include "config.h"
+#include <stdint.h>
+
+/* returns the n'th least significant byte */
+#define _GET_BYTE(x, n) ( ((x) >> (8 * (n))) & 0xff )
+
+#define _PED_SWAP16(x) ( (_GET_BYTE(x, 0) << 8) \
+ + (_GET_BYTE(x, 1) << 0) )
+
+#define _PED_SWAP32(x) ( (_GET_BYTE(x, 0) << 24) \
+ + (_GET_BYTE(x, 1) << 16) \
+ + (_GET_BYTE(x, 2) << 8) \
+ + (_GET_BYTE(x, 3) << 0) )
+
+#define _PED_SWAP64(x) ( (_GET_BYTE(x, 0) << 56) \
+ + (_GET_BYTE(x, 1) << 48) \
+ + (_GET_BYTE(x, 2) << 40) \
+ + (_GET_BYTE(x, 3) << 32) \
+ + (_GET_BYTE(x, 4) << 24) \
+ + (_GET_BYTE(x, 5) << 16) \
+ + (_GET_BYTE(x, 6) << 8) \
+ + (_GET_BYTE(x, 7) << 0) )
+
+#define PED_SWAP16(x) ((uint16_t) _PED_SWAP16( (uint16_t) (x) ))
+#define PED_SWAP32(x) ((uint32_t) _PED_SWAP32( (uint32_t) (x) ))
+#define PED_SWAP64(x) ((uint64_t) _PED_SWAP64( (uint64_t) (x) ))
+
+#ifdef WORDS_BIGENDIAN
+
+#define PED_CPU_TO_LE16(x) PED_SWAP16(x)
+#define PED_CPU_TO_BE16(x) (x)
+#define PED_CPU_TO_LE32(x) PED_SWAP32(x)
+#define PED_CPU_TO_BE32(x) (x)
+#define PED_CPU_TO_LE64(x) PED_SWAP64(x)
+#define PED_CPU_TO_BE64(x) (x)
+
+#define PED_LE16_TO_CPU(x) PED_SWAP16(x)
+#define PED_BE16_TO_CPU(x) (x)
+#define PED_LE32_TO_CPU(x) PED_SWAP32(x)
+#define PED_BE32_TO_CPU(x) (x)
+#define PED_LE64_TO_CPU(x) PED_SWAP64(x)
+#define PED_BE64_TO_CPU(x) (x)
+
+#else /* !WORDS_BIGENDIAN */
+
+#define PED_CPU_TO_LE16(x) (x)
+#define PED_CPU_TO_BE16(x) PED_SWAP16(x)
+#define PED_CPU_TO_LE32(x) (x)
+#define PED_CPU_TO_BE32(x) PED_SWAP32(x)
+#define PED_CPU_TO_LE64(x) (x)
+#define PED_CPU_TO_BE64(x) PED_SWAP64(x)
+
+#define PED_LE16_TO_CPU(x) (x)
+#define PED_BE16_TO_CPU(x) PED_SWAP16(x)
+#define PED_LE32_TO_CPU(x) (x)
+#define PED_BE32_TO_CPU(x) PED_SWAP32(x)
+#define PED_LE64_TO_CPU(x) (x)
+#define PED_BE64_TO_CPU(x) PED_SWAP64(x)
+
+#endif /* !WORDS_BIGENDIAN */
+
+#endif /* PED_ENDIAN_H_INCLUDED */
+
diff --git a/include/parted/exception.h b/include/parted/exception.h
new file mode 100644
index 0000000..9ecf504
--- /dev/null
+++ b/include/parted/exception.h
@@ -0,0 +1,117 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+/**
+ * \addtogroup PedException
+ * @{
+ */
+
+/** \file exception.h */
+
+#ifndef PED_EXCEPTION_H_INCLUDED
+#define PED_EXCEPTION_H_INCLUDED
+
+typedef struct _PedException PedException;
+
+/**
+ * Exception type
+ */
+enum _PedExceptionType {
+ PED_EXCEPTION_INFORMATION=1,
+ PED_EXCEPTION_WARNING=2,
+ PED_EXCEPTION_ERROR=3,
+ PED_EXCEPTION_FATAL=4,
+ PED_EXCEPTION_BUG=5,
+ PED_EXCEPTION_NO_FEATURE=6,
+};
+typedef enum _PedExceptionType PedExceptionType;
+
+/**
+ * Option for resolving the exception
+ */
+enum _PedExceptionOption {
+ PED_EXCEPTION_UNHANDLED=0,
+ PED_EXCEPTION_FIX=1,
+ PED_EXCEPTION_YES=2,
+ PED_EXCEPTION_NO=4,
+ PED_EXCEPTION_OK=8,
+ PED_EXCEPTION_RETRY=16,
+ PED_EXCEPTION_IGNORE=32,
+ PED_EXCEPTION_CANCEL=64,
+};
+typedef enum _PedExceptionOption PedExceptionOption;
+#define PED_EXCEPTION_OK_CANCEL (PED_EXCEPTION_OK + PED_EXCEPTION_CANCEL)
+#define PED_EXCEPTION_YES_NO (PED_EXCEPTION_YES + PED_EXCEPTION_NO)
+#define PED_EXCEPTION_YES_NO_CANCEL (PED_EXCEPTION_YES_NO \
+ + PED_EXCEPTION_CANCEL)
+#define PED_EXCEPTION_IGNORE_CANCEL (PED_EXCEPTION_IGNORE \
+ + PED_EXCEPTION_CANCEL)
+#define PED_EXCEPTION_RETRY_CANCEL (PED_EXCEPTION_RETRY + PED_EXCEPTION_CANCEL)
+#define PED_EXCEPTION_RETRY_IGNORE_CANCEL (PED_EXCEPTION_RETRY \
+ + PED_EXCEPTION_IGNORE_CANCEL)
+#define PED_EXCEPTION_OPTION_FIRST PED_EXCEPTION_FIX
+#define PED_EXCEPTION_OPTION_LAST PED_EXCEPTION_CANCEL
+
+/**
+ * Structure with information about exception
+ */
+struct _PedException {
+ char* message; /**< text describing what the event was */
+ PedExceptionType type; /**< type of exception */
+ PedExceptionOption options; /**< ORed list of options that
+ the exception handler can
+ return (the ways an exception
+ can be resolved) */
+};
+
+typedef PedExceptionOption (PedExceptionHandler) (PedException* ex);
+
+extern int ped_exception; /* set to true if there's an exception */
+
+extern char* ped_exception_get_type_string (PedExceptionType ex_type);
+extern char* ped_exception_get_option_string (PedExceptionOption ex_opt);
+
+extern void ped_exception_set_handler (PedExceptionHandler* handler);
+extern PedExceptionHandler *ped_exception_get_handler(void);
+
+extern PedExceptionOption ped_exception_default_handler (PedException* ex);
+
+extern PedExceptionOption ped_exception_throw (PedExceptionType ex_type,
+ PedExceptionOption ex_opt,
+ const char* message,
+ ...);
+/* rethrows an exception - i.e. calls the exception handler, (or returns a
+ code to return to pass up higher) */
+extern PedExceptionOption ped_exception_rethrow ();
+
+/* frees an exception, indicating that the exception has been handled.
+ Calling an exception handler counts. */
+extern void ped_exception_catch ();
+
+/* indicate that exceptions should not go to the exception handler, but passed
+ up to the calling function(s) */
+extern void ped_exception_fetch_all ();
+
+/* indicate that exceptions should invoke the exception handler */
+extern void ped_exception_leave_all ();
+
+#endif /* PED_EXCEPTION_H_INCLUDED */
+
+/** @} */
+
diff --git a/include/parted/fdasd.h b/include/parted/fdasd.h
new file mode 100644
index 0000000..ba31c81
--- /dev/null
+++ b/include/parted/fdasd.h
@@ -0,0 +1,229 @@
+/*
+ * File...........: s390-tools/fdasd/fdasd.h
+ * Author(s)......: Volker Sameske <sameske@de.ibm.com>
+ * Horst Hummel <Horst.Hummel@de.ibm.com>
+ * Bugreports.to..: <Linux390@de.ibm.com>
+ * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2001-2002
+ *
+ * History of changes (starts March 2001)
+ * version 1.01 - menu entry 's' to show mapping devnode - DS name
+ * 1.02 - DS names count now from 0001 instead from 0000
+ * 1.03 - volser checks: 'AA AAA' to 'AAAAA '
+ * - removed dependency to kernel headers.
+ * 1.04 - added -p option
+ * 1.05 - new API policy, set it back to 0
+ */
+#ifndef FDASD_H
+#define FDASD_H
+
+/*****************************************************************************
+ * SECTION: Definitions needed for DASD-API (see dasd.h) *
+ *****************************************************************************/
+
+#define DASD_IOCTL_LETTER 'D'
+
+#define DASD_PARTN_BITS 2
+
+#define PARTITION_LINUX_SWAP 0x82
+#define PARTITION_LINUX 0x83
+#define PARTITION_LINUX_EXT 0x85
+#define PARTITION_LINUX_LVM 0x8e
+#define PARTITION_LINUX_RAID 0xfd
+#define PARTITION_LINUX_LVM_OLD 0xfe
+
+#define PART_TYPE_NATIVE "NATIVE"
+#define PART_TYPE_SWAP "SWAP "
+#define PART_TYPE_RAID "RAID "
+#define PART_TYPE_LVM "LVM "
+
+#ifdef DEBUG_DASD
+#define PDEBUG fprintf(stderr, "%s:%d:%s\n", \
+ __FILE__, \
+ __LINE__, \
+ __PRETTY_FUNCTION__);
+#else
+#define PDEBUG
+#endif
+
+/*
+ * struct dasd_information_t
+ * represents any data about the device, which is visible to userspace.
+ * including foramt and featueres.
+ */
+typedef struct dasd_information_t {
+ unsigned int devno; /* S/390 devno */
+ unsigned int real_devno; /* for aliases */
+ unsigned int schid; /* S/390 subchannel identifier */
+ unsigned int cu_type : 16; /* from SenseID */
+ unsigned int cu_model : 8; /* from SenseID */
+ unsigned int dev_type : 16; /* from SenseID */
+ unsigned int dev_model : 8; /* from SenseID */
+ unsigned int open_count;
+ unsigned int req_queue_len;
+ unsigned int chanq_len; /* length of chanq */
+ char type[4]; /* from discipline.name, 'none' for */
+ /* unknown */
+ unsigned int status; /* current device level */
+ unsigned int label_block; /* where to find the VOLSER */
+ unsigned int FBA_layout; /* fixed block size (like AIXVOL) */
+ unsigned int characteristics_size;
+ unsigned int confdata_size;
+ char characteristics[64]; /* from read_device_characteristics */
+ char configuration_data[256]; /* from read_configuration_data */
+} dasd_information_t;
+
+/*
+ * struct format_data_t
+ * represents all data necessary to format a dasd
+ */
+typedef struct format_data_t {
+ int start_unit; /* from track */
+ int stop_unit; /* to track */
+ int blksize; /* sectorsize */
+ int intensity;
+} format_data_t;
+
+/*
+ * values to be used for format_data_t.intensity
+ * 0/8: normal format
+ * 1/9: also write record zero
+ * 3/11: also write home address
+ * 4/12: invalidate track
+ */
+#define DASD_FMT_INT_FMT_R0 1 /* write record zero */
+#define DASD_FMT_INT_FMT_HA 2 /* write home address, also set FMT_R0 ! */
+#define DASD_FMT_INT_INVAL 4 /* invalidate tracks */
+#define DASD_FMT_INT_COMPAT 8 /* use OS/390 compatible disk layout */
+
+
+/* Disable the volume (for Linux) */
+#define BIODASDDISABLE _IO(DASD_IOCTL_LETTER,0)
+/* Enable the volume (for Linux) */
+#define BIODASDENABLE _IO(DASD_IOCTL_LETTER,1)
+
+/* retrieve API version number */
+#define DASDAPIVER _IOR(DASD_IOCTL_LETTER,0,int)
+/* Get information on a dasd device (enhanced) */
+#define BIODASDINFO _IOR(DASD_IOCTL_LETTER,1,dasd_information_t)
+
+
+/*****************************************************************************
+ * SECTION: Further IOCTL Definitions (see fs.h) *
+ *****************************************************************************/
+/* re-read partition table */
+#define BLKRRPART _IO(0x12,95)
+/* get block device sector size */
+#define BLKSSZGET _IO(0x12,104)
+
+/*****************************************************************************
+ * SECTION: Definition from hdreq.h *
+ *****************************************************************************/
+
+struct fdasd_hd_geometry {
+ unsigned char heads;
+ unsigned char sectors;
+ unsigned short cylinders;
+ unsigned long start;
+};
+
+/* get device geometry */
+#define HDIO_GETGEO 0x0301
+
+/*****************************************************************************
+ * SECTION: FDASD internal types *
+ *****************************************************************************/
+
+#define DASD_MIN_API_VERSION 0
+
+#define DEFAULT_FDASD_CONF "/etc/fdasd.conf" /* default config file */
+
+#define PARTN_MASK ((1 << DASD_PARTN_BITS) - 1)
+#define USABLE_PARTITIONS ((1 << DASD_PARTN_BITS) - 1)
+
+#define FDASD_VERSION "1.05"
+#define FDASD_ERROR "fdasd error: "
+#define DEVICE "device"
+#define DISC "disc"
+#define PART "part"
+
+#define ALTERNATE_CYLINDERS_USED 0x10
+
+typedef struct partition_info {
+ u_int8_t used;
+ unsigned long start_trk;
+ unsigned long end_trk;
+ unsigned long len_trk;
+ unsigned long fspace_trk;
+ format1_label_t *f1;
+ struct partition_info *next;
+ struct partition_info *prev;
+ u_int8_t type;
+} partition_info_t;
+
+typedef struct config_data {
+ unsigned long start;
+ unsigned long stop;
+} config_data_t;
+
+typedef struct fdasd_anchor {
+ int vlabel_changed;
+ int vtoc_changed;
+ int devname_specified;
+ int volid_specified;
+ int config_specified;
+ int auto_partition;
+ int print_table;
+ int big_disk;
+ int silent;
+ int verbose;
+ int devno;
+ int option_reuse;
+ int option_recreate;
+ int partno[USABLE_PARTITIONS];
+ u_int16_t dev_type;
+ unsigned int used_partitions;
+ unsigned long label_pos;
+ unsigned int blksize;
+ unsigned long fspace_trk;
+ format4_label_t *f4;
+ format5_label_t *f5;
+ format7_label_t *f7;
+ partition_info_t *first;
+ partition_info_t *last;
+ volume_label_t *vlabel;
+ config_data_t confdata[USABLE_PARTITIONS];
+ struct fdasd_hd_geometry geo;
+} fdasd_anchor_t;
+
+enum offset {lower, upper};
+
+enum fdasd_failure {
+ unable_to_open_disk,
+ unable_to_seek_disk,
+ unable_to_read_disk,
+ read_only_disk,
+ unable_to_ioctl,
+ api_version_mismatch,
+ wrong_disk_type,
+ wrong_disk_format,
+ disk_in_use,
+ config_syntax_error,
+ vlabel_corrupted,
+ dsname_corrupted,
+ malloc_failed,
+ device_verification_failed
+};
+
+void fdasd_cleanup (fdasd_anchor_t *anchor);
+void fdasd_initialize_anchor (fdasd_anchor_t * anc);
+void fdasd_get_geometry (fdasd_anchor_t *anc, int fd);
+void fdasd_check_api_version (fdasd_anchor_t *anc, int fd);
+int fdasd_check_volume (fdasd_anchor_t *anc, int fd);
+int fdasd_write_labels (fdasd_anchor_t *anc, int fd);
+int fdasd_invalid_vtoc_pointer(fdasd_anchor_t *anc);
+void fdasd_recreate_vtoc(fdasd_anchor_t *anc);
+partition_info_t * fdasd_add_partition (fdasd_anchor_t *anc,
+ unsigned int start, unsigned int stop);
+int fdasd_prepare_labels (fdasd_anchor_t *anc, int fd) ;
+
+#endif /* FDASD_H */
diff --git a/include/parted/filesys.h b/include/parted/filesys.h
new file mode 100644
index 0000000..f7bc7cf
--- /dev/null
+++ b/include/parted/filesys.h
@@ -0,0 +1,117 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+/**
+ * \addtogroup PedFileSystem
+ * @{
+ */
+
+/** \file filesys.h */
+
+#ifndef PED_FILESYS_H_INCLUDED
+#define PED_FILESYS_H_INCLUDED
+
+typedef struct _PedFileSystem PedFileSystem;
+typedef struct _PedFileSystemType PedFileSystemType;
+typedef const struct _PedFileSystemOps PedFileSystemOps;
+
+#include <parted/geom.h>
+#include <parted/disk.h>
+#include <parted/exception.h>
+#include <parted/constraint.h>
+#include <parted/timer.h>
+#include <stdio.h>
+
+struct _PedFileSystemOps {
+ PedGeometry* (*probe) (PedGeometry* geom);
+ int (*clobber) (PedGeometry* geom);
+
+ PedFileSystem* (*open) (PedGeometry* geom);
+ PedFileSystem* (*create) (PedGeometry* geom, PedTimer* timer);
+ int (*close) (PedFileSystem* fs);
+ int (*check) (PedFileSystem* fs, PedTimer* timer);
+ PedFileSystem* (*copy) (const PedFileSystem* fs, PedGeometry* geom,
+ PedTimer* timer);
+ int (*resize) (PedFileSystem* fs, PedGeometry* geom, PedTimer* timer);
+
+ PedConstraint* (*get_create_constraint) (const PedDevice* dev);
+ PedConstraint* (*get_resize_constraint) (const PedFileSystem* fs);
+ PedConstraint* (*get_copy_constraint) (const PedFileSystem* fs,
+ const PedDevice* dev);
+};
+
+/**
+ * Structure describing type of file system
+ */
+struct _PedFileSystemType {
+ PedFileSystemType* next;
+ const char* const name; /**< name of the file system type */
+ const int* block_sizes;
+ PedFileSystemOps* const ops;
+};
+
+
+/**
+ * Structure describing file system
+ */
+struct _PedFileSystem {
+ PedFileSystemType* type; /**< the file system type */
+ PedGeometry* geom; /**< where the file system actually is */
+ int checked; /**< 1 if the file system has been checked.
+ 0 otherwise. */
+
+ void* type_specific;
+
+};
+
+extern void ped_file_system_type_register (PedFileSystemType* type);
+extern void ped_file_system_type_unregister (PedFileSystemType* type);
+
+extern PedFileSystemType* ped_file_system_type_get (const char* name);
+extern PedFileSystemType*
+ped_file_system_type_get_next (const PedFileSystemType* fs_type);
+
+extern PedFileSystemType* ped_file_system_probe (PedGeometry* geom);
+extern PedGeometry* ped_file_system_probe_specific (
+ const PedFileSystemType* fs_type,
+ PedGeometry* geom);
+extern int ped_file_system_clobber (PedGeometry* geom);
+
+extern PedFileSystem* ped_file_system_open (PedGeometry* geom);
+extern PedFileSystem* ped_file_system_create (PedGeometry* geom,
+ const PedFileSystemType* type,
+ PedTimer* timer);
+extern int ped_file_system_close (PedFileSystem* fs);
+extern int ped_file_system_check (PedFileSystem* fs, PedTimer* timer);
+extern PedFileSystem* ped_file_system_copy (PedFileSystem* fs,
+ PedGeometry* geom,
+ PedTimer* timer);
+extern int ped_file_system_resize (PedFileSystem* fs, PedGeometry* geom,
+ PedTimer* timer);
+
+extern PedConstraint* ped_file_system_get_create_constraint (
+ const PedFileSystemType* fs_type, const PedDevice* dev);
+extern PedConstraint* ped_file_system_get_resize_constraint (
+ const PedFileSystem* fs);
+extern PedConstraint* ped_file_system_get_copy_constraint (
+ const PedFileSystem* fs, const PedDevice* dev);
+
+#endif /* PED_FILESYS_H_INCLUDED */
+
+/** @} */
diff --git a/include/parted/geom.h b/include/parted/geom.h
new file mode 100644
index 0000000..90dc5b2
--- /dev/null
+++ b/include/parted/geom.h
@@ -0,0 +1,84 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 1998-2001, 2005 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+/**
+ * \addtogroup PedGeometry
+ * @{
+ */
+
+/** \file geom.h */
+
+#ifndef PED_GEOM_H_INCLUDED
+#define PED_GEOM_H_INCLUDED
+
+#include <parted/device.h>
+#include <parted/timer.h>
+
+typedef struct _PedGeometry PedGeometry;
+
+/**
+ * Geometry of the partition
+ */
+struct _PedGeometry {
+ PedDevice* dev;
+ PedSector start;
+ PedSector length;
+ PedSector end;
+};
+
+extern int ped_geometry_init (PedGeometry* geom, const PedDevice* dev,
+ PedSector start, PedSector length);
+extern PedGeometry* ped_geometry_new (const PedDevice* dev, PedSector start,
+ PedSector length);
+extern PedGeometry* ped_geometry_duplicate (const PedGeometry* geom);
+extern PedGeometry* ped_geometry_intersect (const PedGeometry* a,
+ const PedGeometry* b);
+extern void ped_geometry_destroy (PedGeometry* geom);
+extern int ped_geometry_set (PedGeometry* geom, PedSector start,
+ PedSector length);
+extern int ped_geometry_set_start (PedGeometry* geom, PedSector start);
+extern int ped_geometry_set_end (PedGeometry* geom, PedSector end);
+extern int ped_geometry_test_overlap (const PedGeometry* a,
+ const PedGeometry* b);
+extern int ped_geometry_test_inside (const PedGeometry* a,
+ const PedGeometry* b);
+extern int ped_geometry_test_equal (const PedGeometry* a, const PedGeometry* b);
+extern int ped_geometry_test_sector_inside (const PedGeometry* geom,
+ PedSector sect);
+
+extern int ped_geometry_read (const PedGeometry* geom, void* buffer,
+ PedSector offset, PedSector count);
+extern int ped_geometry_write (PedGeometry* geom, const void* buffer,
+ PedSector offset, PedSector count);
+extern PedSector ped_geometry_check (PedGeometry* geom, void* buffer,
+ PedSector buffer_size, PedSector offset,
+ PedSector granularity, PedSector count,
+ PedTimer* timer);
+extern int ped_geometry_sync (PedGeometry* geom);
+extern int ped_geometry_sync_fast (PedGeometry* geom);
+
+/* returns -1 if "sector" is not within dest's space. */
+extern PedSector ped_geometry_map (const PedGeometry* dst,
+ const PedGeometry* src,
+ PedSector sector);
+
+#endif /* PED_GEOM_H_INCLUDED */
+
+/** @} */
+
diff --git a/include/parted/gnu.h b/include/parted/gnu.h
new file mode 100644
index 0000000..1cf412a
--- /dev/null
+++ b/include/parted/gnu.h
@@ -0,0 +1,45 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef PED_GNU_H_INCLUDED
+#define PED_GNU_H_INCLUDED
+
+#include <parted/parted.h>
+
+#include <hurd/store.h>
+
+#define GNU_SPECIFIC(dev) ((GNUSpecific*) (dev)->arch_specific)
+
+typedef struct _GNUSpecific GNUSpecific;
+
+struct _GNUSpecific {
+ struct store* store;
+ int consume;
+};
+
+extern PedArchitecture ped_gnu_arch;
+
+/* Initialize a PedDevice using SOURCE. The SOURCE will NOT be destroyed;
+ the caller created it, it is the caller's responsilbility to free it
+ after it calls ped_device_destory. SOURCE is not registered in Parted's
+ list of devices. */
+PedDevice* ped_device_new_from_store (struct store *source);
+
+#endif /* PED_GNU_H_INCLUDED */
+
diff --git a/include/parted/linux.h b/include/parted/linux.h
new file mode 100644
index 0000000..c725e16
--- /dev/null
+++ b/include/parted/linux.h
@@ -0,0 +1,42 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef PED_LINUX_H_INCLUDED
+#define PED_LINUX_H_INCLUDED
+
+#include <parted/parted.h>
+#include <parted/device.h>
+
+#define LINUX_SPECIFIC(dev) ((LinuxSpecific*) (dev)->arch_specific)
+
+typedef struct _LinuxSpecific LinuxSpecific;
+
+struct _LinuxSpecific {
+ int fd;
+#if defined(__s390__) || defined(__s390x__)
+ unsigned int real_sector_size;
+ /* IBM internal dasd structure (i guess ;), required. */
+ struct fdasd_anchor *anchor;
+#endif
+};
+
+extern PedArchitecture ped_linux_arch;
+
+#endif /* PED_LINUX_H_INCLUDED */
+
diff --git a/include/parted/natmath.h b/include/parted/natmath.h
new file mode 100644
index 0000000..7bf66d7
--- /dev/null
+++ b/include/parted/natmath.h
@@ -0,0 +1,101 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+/**
+ * \addtogroup PedAlignment
+ * @{
+ */
+
+/** \file natmath.h */
+
+#ifndef PED_NATMATH_H_INCLUDED
+#define PED_NATMATH_H_INCLUDED
+
+
+typedef struct _PedAlignment PedAlignment;
+
+#include <parted/disk.h>
+
+#define PED_MIN(a, b) ( ((a)<(b)) ? (a) : (b) )
+#define PED_MAX(a, b) ( ((a)>(b)) ? (a) : (b) )
+
+/* this is weird (I'm still not sure I should be doing this!)
+ *
+ * For the functions: new, destroy, duplicate and merge: the following values
+ * for align are valid:
+ * * align == NULL (!) represents no solution
+ * * align->grain_size == 0 represents a single solution
+ * (align->offset)
+ * * align->grain_size > 0 represents a set of solutions
+ *
+ * These are invalid:
+ * * align->offset < 0 Note: this gets "normalized"
+ * * align->grain_size < 0
+ *
+ * For the align_* operations, there must be a solution. i.e. align != NULL
+ * All solutions must be greater than zero.
+ */
+
+struct _PedAlignment {
+ PedSector offset;
+ PedSector grain_size;
+};
+
+extern PedSector ped_round_up_to (PedSector sector, PedSector grain_size);
+extern PedSector ped_round_down_to (PedSector sector, PedSector grain_size);
+extern PedSector ped_round_to_nearest (PedSector sector, PedSector grain_size);
+extern PedSector ped_greatest_common_divisor (PedSector a, PedSector b);
+
+extern int ped_alignment_init (PedAlignment* align, PedSector offset,
+ PedSector grain_size);
+extern PedAlignment* ped_alignment_new (PedSector offset, PedSector grain_size);
+extern void ped_alignment_destroy (PedAlignment* align);
+extern PedAlignment* ped_alignment_duplicate (const PedAlignment* align);
+extern PedAlignment* ped_alignment_intersect (const PedAlignment* a,
+ const PedAlignment* b);
+
+extern PedSector
+ped_alignment_align_up (const PedAlignment* align, const PedGeometry* geom,
+ PedSector sector);
+extern PedSector
+ped_alignment_align_down (const PedAlignment* align, const PedGeometry* geom,
+ PedSector sector);
+extern PedSector
+ped_alignment_align_nearest (const PedAlignment* align, const PedGeometry* geom,
+ PedSector sector);
+
+extern int
+ped_alignment_is_aligned (const PedAlignment* align, const PedGeometry* geom,
+ PedSector sector);
+
+extern const PedAlignment* ped_alignment_any;
+extern const PedAlignment* ped_alignment_none;
+
+extern inline PedSector
+ped_div_round_up (PedSector numerator, PedSector divisor);
+
+extern inline PedSector
+ped_div_round_to_nearest (PedSector numerator, PedSector divisor);
+
+#endif /* PED_NATMATH_H_INCLUDED */
+
+/**
+ * @}
+ */
+
diff --git a/include/parted/parted.h b/include/parted/parted.h
new file mode 100644
index 0000000..3d11afc
--- /dev/null
+++ b/include/parted/parted.h
@@ -0,0 +1,62 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef PARTED_H_INCLUDED
+#define PARTED_H_INCLUDED
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct _PedArchitecture PedArchitecture;
+
+#include <parted/constraint.h>
+#include <parted/device.h>
+#include <parted/disk.h>
+#include <parted/exception.h>
+#include <parted/filesys.h>
+#include <parted/natmath.h>
+#include <parted/unit.h>
+
+#include <stdlib.h>
+
+struct _PedArchitecture {
+ PedDiskArchOps* disk_ops;
+ PedDeviceArchOps* dev_ops;
+};
+
+extern const PedArchitecture* ped_architecture;
+
+/* the architecture can't be changed if there are any PedDevice's.
+ * i.e. you should only be doing this if it's the FIRST thing you do...
+ */
+extern int ped_set_architecture (const PedArchitecture* arch);
+
+extern const char* ped_get_version ();
+
+extern void* ped_malloc (size_t size);
+extern void* ped_calloc (size_t size);
+extern int ped_realloc (void** ptr, size_t size);
+extern void ped_free (void* ptr);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PARTED_H_INCLUDED */
diff --git a/include/parted/timer.h b/include/parted/timer.h
new file mode 100644
index 0000000..b3cbd10
--- /dev/null
+++ b/include/parted/timer.h
@@ -0,0 +1,66 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+/**
+ * \addtogroup PedTimer
+ * @{
+ */
+
+/** \file timer.h */
+
+#ifndef PED_TIMER_H_INCLUDED
+#define PED_TIMER_H_INCLUDED
+
+#include <time.h>
+
+typedef struct _PedTimer PedTimer;
+
+typedef void PedTimerHandler (PedTimer* timer, void* context);
+
+/*
+ * Structure keeping track of progress and time
+ */
+struct _PedTimer {
+ float frac; /**< fraction of operation done */
+ time_t start; /**< time of start of op */
+ time_t now; /**< time of last update (now!) */
+ time_t predicted_end; /**< expected finish time */
+ const char* state_name; /**< eg: "copying data" */
+ PedTimerHandler* handler; /**< who to notify on updates */
+ void* context; /**< context to pass to handler */
+};
+
+extern PedTimer* ped_timer_new (PedTimerHandler* handler, void* context);
+extern void ped_timer_destroy (PedTimer* timer);
+
+/* a nested timer automatically notifies it's parent. You should only
+ * create one when you are going to use it (not before)
+ */
+extern PedTimer* ped_timer_new_nested (PedTimer* parent, float nest_frac);
+extern void ped_timer_destroy_nested (PedTimer* timer);
+
+extern void ped_timer_touch (PedTimer* timer);
+extern void ped_timer_reset (PedTimer* timer);
+extern void ped_timer_update (PedTimer* timer, float new_frac);
+extern void ped_timer_set_state_name (PedTimer* timer, const char* state_name);
+
+#endif /* PED_TIMER_H_INCLUDED */
+
+
+/** @} */
diff --git a/include/parted/unit.h b/include/parted/unit.h
new file mode 100644
index 0000000..253db7b
--- /dev/null
+++ b/include/parted/unit.h
@@ -0,0 +1,93 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+/**
+ * \addtogroup PedUnit
+ * @{
+ */
+
+/** \file unit.h */
+
+#ifndef PED_UNIT_H_INCLUDED
+#define PED_UNIT_H_INCLUDED
+
+#include <parted/device.h>
+
+#include <stdarg.h>
+#include <stdio.h>
+
+#define PED_SECTOR_SIZE_DEFAULT 512LL
+#define PED_KILOBYTE_SIZE 1000LL
+#define PED_MEGABYTE_SIZE 1000000LL
+#define PED_GIGABYTE_SIZE 1000000000LL
+#define PED_TERABYTE_SIZE 1000000000000LL
+#define PED_KIBIBYTE_SIZE 1024LL
+#define PED_MEBIBYTE_SIZE 1048576LL
+#define PED_GIBIBYTE_SIZE 1073741824LL
+#define PED_TEBIBYTE_SIZE 1099511627776LL
+
+/**
+ * Human-friendly unit for representation of a location within device
+ */
+typedef enum {
+ PED_UNIT_SECTOR,
+ PED_UNIT_BYTE,
+ PED_UNIT_KILOBYTE,
+ PED_UNIT_MEGABYTE,
+ PED_UNIT_GIGABYTE,
+ PED_UNIT_TERABYTE,
+ PED_UNIT_COMPACT,
+ PED_UNIT_CYLINDER,
+ PED_UNIT_CHS,
+ PED_UNIT_PERCENT,
+ PED_UNIT_KIBIBYTE,
+ PED_UNIT_MEBIBYTE,
+ PED_UNIT_GIBIBYTE,
+ PED_UNIT_TEBIBYTE
+} PedUnit;
+
+#define PED_UNIT_FIRST PED_UNIT_SECTOR
+#define PED_UNIT_LAST PED_UNIT_TEBIBYTE
+
+extern long long ped_unit_get_size (PedDevice* dev, PedUnit unit);
+extern const char* ped_unit_get_name (PedUnit unit);
+extern PedUnit ped_unit_get_by_name (const char* unit_name);
+
+extern void ped_unit_set_default (PedUnit unit);
+extern PedUnit ped_unit_get_default ();
+
+extern char* ped_unit_format_byte (PedDevice* dev, PedSector byte);
+extern char* ped_unit_format_custom_byte (PedDevice* dev, PedSector byte,
+ PedUnit unit);
+
+extern char* ped_unit_format (PedDevice* dev, PedSector sector);
+extern char* ped_unit_format_custom (PedDevice* dev, PedSector sector,
+ PedUnit unit);
+
+extern int ped_unit_parse (const char* str, PedDevice* dev, PedSector* sector,
+ PedGeometry** range);
+extern int ped_unit_parse_custom (const char* str, PedDevice* dev,
+ PedUnit unit, PedSector* sector,
+ PedGeometry** range);
+
+#endif /* PED_UNIT_H_INCLUDED */
+
+/** @} */
+
+
diff --git a/include/parted/vtoc.h b/include/parted/vtoc.h
new file mode 100644
index 0000000..9038e96
--- /dev/null
+++ b/include/parted/vtoc.h
@@ -0,0 +1,286 @@
+/*
+ * File...........: s390-tools/dasdview/vtoc.h
+ * Author(s)......: Horst Hummel <horst.hummel@de.ibm.com>
+ * Bugreports.to..: <Linux390@de.ibm.com>
+ *
+ * This is a user-space copy of the kernel vtoc,h.
+ *
+ * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2002
+ *
+ * History of changes (starts March 2002)
+ * 2002-03-12 initial
+ */
+
+#ifndef VTOC_H
+#define VTOC_H
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <ctype.h>
+#include <time.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+
+#define LINE_LENGTH 80
+#define VTOC_START_CC 0x0
+#define VTOC_START_HH 0x1
+#define FIRST_USABLE_CYL 1
+#define FIRST_USABLE_TRK 2
+
+#define DASD_3380_TYPE 13148
+#define DASD_3390_TYPE 13200
+#define DASD_9345_TYPE 37701
+
+#define DASD_3380_VALUE 0xbb60
+#define DASD_3390_VALUE 0xe5a2
+#define DASD_9345_VALUE 0xbc98
+
+#define VOLSER_LENGTH 6
+#define BIG_DISK_SIZE 0x10000
+
+#define VTOC_ERROR "VTOC error:"
+
+typedef struct ttr
+{
+ u_int16_t tt;
+ u_int8_t r;
+} __attribute__ ((packed)) ttr_t;
+
+typedef struct cchhb
+{
+ u_int16_t cc;
+ u_int16_t hh;
+ u_int8_t b;
+} __attribute__ ((packed)) cchhb_t;
+
+typedef struct cchh
+{
+ u_int16_t cc;
+ u_int16_t hh;
+} __attribute__ ((packed)) cchh_t;
+
+typedef struct labeldate
+{
+ u_int8_t year;
+ u_int16_t day;
+} __attribute__ ((packed)) labeldate_t;
+
+typedef struct volume_label
+{
+ char volkey[4]; /* volume key = volume label */
+ char vollbl[4]; /* volume label */
+ char volid[6]; /* volume identifier */
+ u_int8_t security; /* security byte */
+ cchhb_t vtoc; /* VTOC address */
+ char res1[5]; /* reserved */
+ char cisize[4]; /* CI-size for FBA,... */
+ /* ...blanks for CKD */
+ char blkperci[4]; /* no of blocks per CI (FBA), blanks for CKD */
+ char labperci[4]; /* no of labels per CI (FBA), blanks for CKD */
+ char res2[4]; /* reserved */
+ char lvtoc[14]; /* owner code for LVTOC */
+ char res3[29]; /* reserved */
+} __attribute__ ((packed)) volume_label_t;
+
+typedef struct extent
+{
+ u_int8_t typeind; /* extent type indicator */
+ u_int8_t seqno; /* extent sequence number */
+ cchh_t llimit; /* starting point of this extent */
+ cchh_t ulimit; /* ending point of this extent */
+} __attribute__ ((packed)) extent_t;
+
+
+typedef struct dev_const
+{
+ u_int16_t DS4DSCYL; /* number of logical cyls */
+ u_int16_t DS4DSTRK; /* number of tracks in a logical cylinder */
+ u_int16_t DS4DEVTK; /* device track length */
+ u_int8_t DS4DEVI; /* non-last keyed record overhead */
+ u_int8_t DS4DEVL; /* last keyed record overhead */
+ u_int8_t DS4DEVK; /* non-keyed record overhead differential */
+ u_int8_t DS4DEVFG; /* flag byte */
+ u_int16_t DS4DEVTL; /* device tolerance */
+ u_int8_t DS4DEVDT; /* number of DSCB's per track */
+ u_int8_t DS4DEVDB; /* number of directory blocks per track */
+} __attribute__ ((packed)) dev_const_t;
+
+
+typedef struct format1_label
+{
+ char DS1DSNAM[44]; /* data set name */
+ u_int8_t DS1FMTID; /* format identifier */
+ char DS1DSSN[6]; /* data set serial number */
+ u_int16_t DS1VOLSQ; /* volume sequence number */
+ labeldate_t DS1CREDT; /* creation date: ydd */
+ labeldate_t DS1EXPDT; /* expiration date */
+ u_int8_t DS1NOEPV; /* number of extents on volume */
+ u_int8_t DS1NOBDB; /* no. of bytes used in last direction blk */
+ u_int8_t DS1FLAG1; /* flag 1 */
+ char DS1SYSCD[13]; /* system code */
+ labeldate_t DS1REFD; /* date last referenced */
+ u_int8_t DS1SMSFG; /* system managed storage indicators */
+ u_int8_t DS1SCXTF; /* sec. space extension flag byte */
+ u_int16_t DS1SCXTV; /* secondary space extension value */
+ u_int8_t DS1DSRG1; /* data set organisation byte 1 */
+ u_int8_t DS1DSRG2; /* data set organisation byte 2 */
+ u_int8_t DS1RECFM; /* record format */
+ u_int8_t DS1OPTCD; /* option code */
+ u_int16_t DS1BLKL; /* block length */
+ u_int16_t DS1LRECL; /* record length */
+ u_int8_t DS1KEYL; /* key length */
+ u_int16_t DS1RKP; /* relative key position */
+ u_int8_t DS1DSIND; /* data set indicators */
+ u_int8_t DS1SCAL1; /* secondary allocation flag byte */
+ char DS1SCAL3[3]; /* secondary allocation quantity */
+ ttr_t DS1LSTAR; /* last used track and block on track */
+ u_int16_t DS1TRBAL; /* space remaining on last used track */
+ u_int16_t res1; /* reserved */
+ extent_t DS1EXT1; /* first extent description */
+ extent_t DS1EXT2; /* second extent description */
+ extent_t DS1EXT3; /* third extent description */
+ cchhb_t DS1PTRDS; /* possible pointer to f2 or f3 DSCB */
+} __attribute__ ((packed)) format1_label_t;
+
+
+typedef struct format4_label
+{
+ char DS4KEYCD[44]; /* key code for VTOC labels: 44 times 0x04 */
+ u_int8_t DS4IDFMT; /* format identifier */
+ cchhb_t DS4HPCHR; /* highest address of a format 1 DSCB */
+ u_int16_t DS4DSREC; /* number of available DSCB's */
+ cchh_t DS4HCCHH; /* CCHH of next available alternate track */
+ u_int16_t DS4NOATK; /* number of remaining alternate tracks */
+ u_int8_t DS4VTOCI; /* VTOC indicators */
+ u_int8_t DS4NOEXT; /* number of extents in VTOC */
+ u_int8_t DS4SMSFG; /* system managed storage indicators */
+ u_int8_t DS4DEVAC; /* number of alternate cylinders.
+ Subtract from first two bytes of
+ DS4DEVSZ to get number of usable
+ cylinders. can be zero. valid
+ only if DS4DEVAV on. */
+ dev_const_t DS4DEVCT; /* device constants */
+ char DS4AMTIM[8]; /* VSAM time stamp */
+ char DS4AMCAT[3]; /* VSAM catalog indicator */
+ char DS4R2TIM[8]; /* VSAM volume/catalog match time stamp */
+ char res1[5]; /* reserved */
+ char DS4F6PTR[5]; /* pointer to first format 6 DSCB */
+ extent_t DS4VTOCE; /* VTOC extent description */
+ char res2[10]; /* reserved */
+ u_int8_t DS4EFLVL; /* extended free-space management level */
+ cchhb_t DS4EFPTR; /* pointer to extended free-space info */
+ char res3[9]; /* reserved */
+} __attribute__ ((packed)) format4_label_t;
+
+typedef struct ds5ext
+{
+ u_int16_t t; /* RTA of the first track of free extent */
+ u_int16_t fc; /* number of whole cylinders in free ext. */
+ u_int8_t ft; /* number of remaining free tracks */
+} __attribute__ ((packed)) ds5ext_t;
+
+typedef struct format5_label
+{
+ char DS5KEYID[4]; /* key identifier */
+ ds5ext_t DS5AVEXT; /* first available (free-space) extent. */
+ ds5ext_t DS5EXTAV[7]; /* seven available extents */
+ u_int8_t DS5FMTID; /* format identifier */
+ ds5ext_t DS5MAVET[18]; /* eighteen available extents */
+ cchhb_t DS5PTRDS; /* pointer to next format5 DSCB */
+} __attribute__ ((packed)) format5_label_t;
+
+typedef struct ds7ext
+{
+ u_int32_t a; /* starting RTA value */
+ u_int32_t b; /* ending RTA value + 1 */
+} __attribute__ ((packed)) ds7ext_t;
+
+typedef struct format7_label
+{
+ char DS7KEYID[4]; /* key identifier */
+ ds7ext_t DS7EXTNT[5]; /* space for 5 extent descriptions */
+ u_int8_t DS7FMTID; /* format identifier */
+ ds7ext_t DS7ADEXT[11]; /* space for 11 extent descriptions */
+ char res1[2]; /* reserved */
+ cchhb_t DS7PTRDS; /* pointer to next FMT7 DSCB */
+} __attribute__ ((packed)) format7_label_t;
+
+
+char * vtoc_ebcdic_enc (char source[LINE_LENGTH], char target[LINE_LENGTH],
+ int l);
+char * vtoc_ebcdic_dec (char source[LINE_LENGTH], char target[LINE_LENGTH],
+ int l);
+void vtoc_set_extent (extent_t * ext, u_int8_t typeind, u_int8_t seqno,
+ cchh_t * lower, cchh_t * upper);
+void vtoc_set_cchh (cchh_t * addr, u_int16_t cc, u_int16_t hh);
+void vtoc_set_cchhb (cchhb_t * addr, u_int16_t cc, u_int16_t hh, u_int8_t b);
+void vtoc_set_date (labeldate_t * d, u_int8_t year, u_int16_t day);
+
+void vtoc_volume_label_init (volume_label_t *vlabel);
+
+int vtoc_read_volume_label (int fd, unsigned long vlabel_start,
+ volume_label_t * vlabel);
+
+int vtoc_write_volume_label (int fd, unsigned long vlabel_start,
+ volume_label_t *vlabel);
+
+void vtoc_volume_label_set_volser (volume_label_t *vlabel, char *volser);
+
+char *vtoc_volume_label_get_volser (volume_label_t *vlabel, char *volser);
+
+void vtoc_volume_label_set_key (volume_label_t *vlabel, char *key);
+
+void vtoc_volume_label_set_label (volume_label_t *vlabel, char *lbl);
+
+char *vtoc_volume_label_get_label (volume_label_t *vlabel, char *lbl);
+
+void vtoc_read_label (int fd, unsigned long position, format1_label_t *f1,
+ format4_label_t *f4, format5_label_t *f5,
+ format7_label_t *f7);
+
+void vtoc_write_label (int fd, unsigned long position, format1_label_t *f1,
+ format4_label_t *f4, format5_label_t *f5,
+ format7_label_t *f7);
+
+void vtoc_init_format1_label (char *volid, unsigned int blksize,
+ extent_t *part_extent, format1_label_t *f1);
+
+void vtoc_init_format4_label (format4_label_t *f4lbl,
+ unsigned int usable_partitions,
+ unsigned int cylinders,
+ unsigned int tracks,
+ unsigned int blocks,
+ unsigned int blksize,
+ u_int16_t dev_type);
+
+void vtoc_update_format4_label (format4_label_t *f4, cchhb_t *highest_f1,
+ u_int16_t unused_update);
+
+void vtoc_init_format5_label (format5_label_t *f5);
+
+void vtoc_update_format5_label_add (format5_label_t *f5, int verbose, int cyl,
+ int trk, u_int16_t a, u_int16_t b,
+ u_int8_t c);
+
+void vtoc_update_format5_label_del (format5_label_t *f5, int verbose, int cyl,
+ int trk, u_int16_t a, u_int16_t b,
+ u_int8_t c);
+
+void vtoc_init_format7_label (format7_label_t *f7);
+
+void vtoc_update_format7_label_add (format7_label_t *f7, int verbose,
+ u_int32_t a, u_int32_t b);
+
+void vtoc_update_format7_label_del (format7_label_t *f7, int verbose,
+ u_int32_t a, u_int32_t b);
+
+void vtoc_set_freespace(format4_label_t *f4, format5_label_t *f5,
+ format7_label_t *f7, char ch, int verbose,
+ u_int32_t start, u_int32_t stop, int cyl, int trk);
+
+#endif /* VTOC_H */
diff --git a/libparted/ChangeLog b/libparted/ChangeLog
new file mode 100644
index 0000000..5fb99b1
--- /dev/null
+++ b/libparted/ChangeLog
@@ -0,0 +1,160 @@
+2006-09-01 Darren Lavender <dl1@hppine99.gbr.hp.com>
+ * labels/gpt.c (gpt_read, _parse_header): added support for
+ LUN/device resize detection and optional GPT header correction.
+
+ * labels/gpt.c (_generate_header, gpt_write): fixed off-by-one
+ error in GPT header that allowed for overlap between LBAs of
+ LastUsableLBA and PartitionEntryLBA in backup-GPT.
+
+2006-09-01 David Cantrell <dcantrell@redhat.com>
+ * fs/fat/fat.c (fat_probe): prevent SIGFPE when FAT sector size is 0.
+
+ * arch/linux.c: define VIODASD_MAJOR.
+ * arch/linux.c (_device_probe_type): check for PED_DEVICE_VIODASD.
+ * arch/linux.c (linux_new): init PED_DEVICE_VIODASD.
+ * arch/linux.c (_flush_cache, linux_open): open in O_DIRECT mode on
+ non-zSeries.
+ * arch/linux.c (linux_read, linux_write): modify reading and writing
+ to work correctly in O_DIRECT mode.
+
+ * exception.c: add ped_exception_get_handler().
+
+ * libparted.c (init_disk_types): call ped_disk_aix_init().
+ * libparted.c (done_disk_types): call ped_disk_aix_done().
+
+ * labels/dos.c (msdos_probe): if AIX physical volume detected, fail.
+
+ * labels/aix.c: add AIX disk label code from Matt Wilson.
+ * labels/aix.c: fix prototypes for aix_probe() and aix_alloc() so they
+ can be used in PedDiskOps.
+
+ * labels/vtoc.c (vtoc_error): make error buffer large enough for errors.
+
+ * labels/dasd.c: fix prototypes for dasd_probe() and dasd_alloc() so
+ they can be used in PedDiskOps.
+ * labels/dasd.c (dasd_probe): fix typos: dasd_initialize_anchor() ->
+ fdasd_initialize_anchor(), dasd_cleanup() -> fdasd_cleanup().
+ * labels/dasd.c (dasd_read): fix typo: DEBUG -> PDEBUG.
+
+2006-08-31 David Cantrell <dcantrell@redhat.com>
+ * arch/linux.c: add DASD_MAJOR.
+ * arch/linux.c (_device_stat): check for DASD devices.
+ * arch/linux.c (init_dasd): add init_dasd() to gather device info
+ for DASD devices.
+ * arch/linux.c (init_generic): add dev->path to the error message so
+ users know what device had the failure.
+
+ * labels/Makefile.am: add dasd.c, fdasd.c, fdasd.h, vtoc.c, and vtoc.h
+
+ * labels/dasd.c: add DASD label code.
+
+ * labels/fdasd.c: add fdasd code (used by dasd.c).
+
+ * labels/vtoc.c: add VTOC code (wonderful EBCDIC util code).
+
+ * libparted.c (init_disk_types): if on zSeries, call
+ ped_disk_dasd_init().
+
+ * libparted.c (done_disk_types): if on zSeries, call
+ ped_disk_dasd_done().
+
+2006-08-30 David Cantrell <dcantrell@redhat.com>
+ * arch/linux.c: add SX8_MAJOR1 and SX8_MAJOR2.
+ * arch/linux.c (_is_sx8_major): determine if given major number falls
+ in the range of Promise SX8 devices.
+ * arch/linux.c (_device_stat): check for SX8 devices.
+
+2006-05-25 Leslie P. Polzer <polzer@gnu.org>
+ * fs/hfs/hfs.c (hfs_resize, hfsplus_resize): make hgee/hgms assertion
+ only when debugging is turned on.
+
+ * fs/ext2/ext2.c (ext2_open): removed call to ext2_determine_itoffset;
+ also moving it from this file to ext2_resize.c.
+ * fs/ext2/ext2_resize.c (ext2_resize): added call to
+ ext2_determine_itoffset and show a warning if not successful.
+
+ * labels/mac.c (strncasestr): search the whole type string for
+ 'driver', not just the strlen of 'driver'. This fixes the detection of
+ driver partitions on mac disklabels.
+
+ * labels/mac.c (mac_partition_get_flag): added 'set 2 raid on/off'
+ capability for mac labels.
+
+ * labels/mac.c (struct MacRawDisk, struct MacPartitionData): fixed
+ data types of some fields (do not need to be 64 bit wide) and updated
+ meaning of reserved spaces.
+
+ * labels/mac.c (struct MacRawDisk, struct MacDeviceDriver, struct
+ MacDiskData, mac_alloc, _rawpart_has_driver, _rawpart_analyse,
+ mac_read, _pad_raw_part, _generate_raw_part, write_block_zero,
+ mac_write, mac_partition_new): fixes removal of driver partition;
+ this would previously crash MacOS 9.
+
+2006-05-15 Leslie P. Polzer <polzer@gnu.org>
+ * fs/ext2/ext2_block_relocator.c (ext2_block_relocator_mark):
+ turned exception into warning and let it provide additional info.
+
+2006-04-15 Leslie P. Polzer <polzer@gnu.org>
+ * labels/gpt.c (_parse_header): corrected endianness issue (one
+ conversion too much)
+
+2006-04-06 Jonathan duSaint <jon@rockgeeks.net>
+ * unit.c (ped_unit_get_size, parse_unit_suffix): added support for
+ binary units.
+
+2006-04-06 Leslie P. Polzer <polzer@gnu.org>
+ * arch/linux.c (_device_set_sector_size): handle sector size for
+ ioctl and printf correctly as "long long".
+
+ * labels/dvh.c (dvh_probe), labels/bsd.c (bsd_probe), labels/mac.c
+ (mac_probe), labels/pc98.c (pc98_probe), labels/sun.c (sun_probe),
+ labels/dos.c (dos_probe), labels/loop.c (loop_probe): immediately
+ return negative probe when the device's logical sector size is not
+ equal to 512.
+
+2006-03-30 Leslie P. Polzer <polzer@gnu.org>
+ * fs/reiserfs/reiserfs.c: added missing block size initializer.
+
+2006-03-27 Leslie P. Polzer <polzer@gnu.org>
+ * arch/linux.c (linux_probe_all): probe standard devices before
+ /sys/block and /proc/partitions.
+
+ * labels/gpt.c: added Apple GUID support.
+
+2006-03-08 Leslie P. Polzer <polzer@gnu.org>
+ * blkpg.h: moved to arch/.
+
+2006-03-03 Leslie P. Polzer <polzer@gnu.org>
+ * labels/Makefile.am (liblabels_la_SOURCES): added "dvh.h".
+
+ * Makefile.am (libparted_la_SOURCES): fixed @OS@.c location.
+
+ * arch/linux.c (_probe_standard_devices): probe IDE devices before
+ SCSI.
+
+2006-02-25 Leslie P. Polzer <polzer@gnu.org>
+ * labels/gpt.c (_read_header, gpt_read): fixed memory leaks.
+
+2006-02-23 Leslie P. Polzer <polzer@gnu.org>
+ * labels/gpt.c (pth_free): fixed illegal memory deallocation by
+ freeing reserved space before parent.
+
+ * labels/gpt.c (pth_crc32): calculate crc32 from static size.
+
+ * labels/gpt.c (pth_free): free reserved field before freeing parent
+ data structure.
+
+ * labels/gpt.c (pth_crc32): calculate crc32 from static size.
+
+2006-02-20 Leslie P. Polzer <polzer@gnu.org>
+ * device.c: added ped_device_get_constraint.
+
+
+-----------------------------------------------------------------------------
+
+This file is part of GNU Parted
+Copyright (C) 1999 - 2006 Free Software Foundation Inc.
+
+This file may be modified and/or distributed without restriction. This is
+not an invitation to misrepresent the history of GNU Parted.
+
diff --git a/libparted/Makefile.am b/libparted/Makefile.am
new file mode 100644
index 0000000..52d3296
--- /dev/null
+++ b/libparted/Makefile.am
@@ -0,0 +1,40 @@
+# This file is part of GNU Parted
+# Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+#
+# This file may be modified and/or distributed without restriction.
+
+SUBDIRS = labels fs
+
+LIBS = @INTLLIBS@ @LIBS@
+
+partedincludedir = -I$(top_srcdir)/include
+lib_LTLIBRARIES = libparted.la
+libparted_la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
+ -release $(LT_RELEASE)
+
+libparted_la_SOURCES = debug.c \
+ device.c \
+ exception.c \
+ filesys.c \
+ libparted.c \
+ timer.c \
+ unit.c \
+ disk.c \
+ cs/geom.c \
+ cs/constraint.c \
+ cs/natmath.c \
+ arch/blkpg.h \
+ arch/@OS@.c
+
+EXTRA_libparted_la_SOURCES = arch/linux.c \
+ arch/gnu.c \
+ arch/beos.c
+
+libparted_la_LIBADD = @OS_LIBS@ \
+ @DL_LIBS@ \
+ fs/libfs.la \
+ labels/liblabels.la
+
+EXTRA_DIST = mbr.s
+
+INCLUDES = $(partedincludedir) @INTLINCS@
diff --git a/libparted/arch/beos.c b/libparted/arch/beos.c
new file mode 100644
index 0000000..88f5dde
--- /dev/null
+++ b/libparted/arch/beos.c
@@ -0,0 +1,641 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#include "config.h"
+
+#include <parted/parted.h>
+#include <parted/debug.h>
+#include <parted/beos.h>
+
+/* POSIX headers */
+#include <sys/stat.h>
+#include <string.h>
+#include <dirent.h>
+#include <limits.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+
+/* BeOS APIs */
+#include <drivers/Drivers.h>
+
+/* ZETA R1+ APIs */
+#if B_ZETA_VERSION >= B_ZETA_VERSION_1_0_0
+# include <device/ata_info.h>
+#endif
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+static void
+_scan_for_disks(const char* path)
+{
+ char subdir[PATH_MAX];
+ dirent_t* entp;
+ size_t pos;
+ DIR* dirp;
+
+ if ((dirp=opendir(path)) != NULL)
+ {
+ /* Build first part of path */
+ strcpy(subdir, path);
+ strcat(subdir, "/");
+ pos = strlen(subdir);
+
+ /* Check all directory entries.. */
+ while((entp=readdir(dirp)) != NULL)
+ {
+ /* If they start with '.' just skip */
+ if (entp->d_name[0] == '.')
+ continue;
+
+ strcpy(subdir+pos, entp->d_name);
+
+ /* /dev/disk/.../raw are the complete disks
+ we're interested in */
+ if (strcmp(entp->d_name, "raw") == 0)
+ _ped_device_probe(subdir);
+ else /* If not 'raw', it most often will
+ be another subdir */
+ _scan_for_disks(subdir);
+ }
+
+ closedir(dirp);
+ }
+}
+
+static void
+_flush_cache(PedDevice* dev)
+{
+ int fd;
+ if ((fd=open(dev->path, O_RDONLY)) < 0)
+ {
+ ioctl(fd, B_FLUSH_DRIVE_CACHE);
+ close(fd);
+ }
+}
+
+#if B_ZETA_VERSION >= B_ZETA_VERSION_1_0_0
+static int
+_device_init_ata(PedDevice* dev)
+{
+ ata_device_infoblock ide_info;
+ int maxlen, len, idx, fd;
+ char buf[256];
+
+ /* Try and get information about device from ATA(PI) driver */
+ if ((fd=open(dev->path, O_RDONLY)) < 0)
+ goto ata_error;
+
+ if (ioctl(fd, B_ATA_GET_DEVICE_INFO, &ide_info, sizeof(ide_info)) < 0)
+ goto ata_error_close;
+
+ close(fd);
+
+ /* Copy 'logical' dimensions */
+ dev->bios_geom.cylinders = ide_info.cylinders;
+ dev->bios_geom.heads = ide_info.heads;
+ dev->bios_geom.sectors = ide_info.sectors;
+
+ /* Copy used dimensions */
+ dev->hw_geom.cylinders = ide_info.current_cylinders;
+ dev->hw_geom.heads = ide_info.current_heads;
+ dev->hw_geom.sectors = ide_info.current_sectors;
+
+ /* Copy total number of sectors */
+ if (ide_info._48_bit_addresses_supported)
+ dev->length = ide_info.LBA48_total_sectors;
+ else if (ide_info.LBA_supported)
+ dev->length = ide_info.LBA_total_sectors;
+ else
+ dev->length = ide_info.cylinders *
+ ide_info.heads *
+ ide_info.sectors;
+
+ dev->sector_size =
+ dev->phys_sector_size = PED_SECTOR_SIZE_DEFAULT;
+
+ /* Use sensible model */
+ maxlen=sizeof(ide_info.model_number);
+ strncpy(buf, ide_info.model_number, maxlen);
+ buf[maxlen] = '\0';
+
+ for (len=-1, idx=maxlen-1; idx > 0 && len < 0; idx--)
+ if (buf[idx] > 0x20)
+ len = idx;
+
+ buf[(len == -1) ? 0 : len+1] = '\0';
+
+ dev->model = strdup(buf);
+
+ return PED_DEVICE_IDE;
+
+ata_error_close:
+ close(fd);
+
+ata_error:
+ return 0;
+}
+#endif
+
+static int
+_device_init_generic_blkdev(PedDevice* dev)
+{
+ device_geometry bios, os;
+ int got_bios_info = 0;
+ int fd;
+
+ /* Try and get information about device from ATA(PI) driver */
+ if ((fd=open(dev->path, O_RDONLY)) < 0)
+ goto blkdev_error;
+
+ /* B_GET_GEOMETRY is mandatory */
+ if (ioctl(fd, B_GET_GEOMETRY, &os, sizeof(os)) < 0)
+ goto blkdev_error_close;
+
+ /* B_GET_BIOS_GEOMETRY is optional */
+ if (!ioctl(fd, B_GET_BIOS_GEOMETRY, &bios, sizeof(bios)))
+ got_bios_info = 1;
+
+ close(fd);
+
+ dev->hw_geom.cylinders = os.cylinder_count;
+ dev->hw_geom.heads = os.head_count;
+ dev->hw_geom.sectors = os.sectors_per_track;
+
+ dev->sector_size =
+ dev->phys_sector_size = os.bytes_per_sector;
+
+ if (got_bios_info)
+ {
+ dev->bios_geom.cylinders = bios.cylinder_count;
+ dev->bios_geom.heads = bios.head_count;
+ dev->bios_geom.sectors = bios.sectors_per_track;
+ }
+ else
+ dev->bios_geom = dev->hw_geom;
+
+ dev->model = strdup("");
+
+ return PED_DEVICE_IDE;
+
+blkdev_error_close:
+ close(fd);
+
+blkdev_error:
+ return 0;
+}
+
+static int
+_device_init_blkdev(PedDevice* dev)
+{
+ int type;
+
+#if B_ZETA_VERSION >= B_ZETA_VERSION_1_0_0
+ if (!(type=_device_init_ata(dev)))
+#endif
+ type = _device_init_generic_blkdev(dev);
+
+ return type;
+}
+
+static int
+_device_init_file(PedDevice* dev, struct stat* dev_statp)
+{
+ if (!dev_statp->st_size)
+ return 0;
+
+ dev->sector_size =
+ dev->phys_sector_size = PED_SECTOR_SIZE_DEFAULT;
+
+ dev->length = dev_statp->st_size / PED_SECTOR_SIZE_DEFAULT;
+
+ dev->bios_geom.cylinders = dev->length / (4 * 32);
+ dev->bios_geom.heads = 4;
+ dev->bios_geom.sectors = 32;
+ dev->hw_geom = dev->bios_geom;
+
+ dev->model = strdup(_("Disk Image"));
+
+ return PED_DEVICE_FILE;
+}
+
+static int
+_device_init(PedDevice* dev)
+{
+ struct stat dev_stat;
+ int type = 0;
+
+ /* Check if we're a regular file */
+ if (stat(dev->path, &dev_stat) < 0)
+ goto done;
+
+ if (S_ISBLK(dev_stat.st_mode) || S_ISCHR(dev_stat.st_mode))
+ type = _device_init_blkdev(dev);
+ else if (S_ISREG(dev_stat.st_mode))
+ type = _device_init_file(dev,&dev_stat);
+
+done:
+ return type;
+}
+
+
+static PedDevice*
+beos_new (const char* path)
+{
+ struct stat stat_info;
+ PedDevice* dev;
+
+ PED_ASSERT(path != NULL, return NULL);
+
+ dev = (PedDevice*) ped_malloc (sizeof (PedDevice));
+ if (!dev)
+ goto error;
+
+ dev->path = strdup(path);
+ if (!dev->path)
+ goto error_free_dev;
+
+ dev->arch_specific
+ = (BEOSSpecific*) ped_malloc(sizeof(BEOSSpecific));
+ if (dev->arch_specific == NULL)
+ goto error_free_path;
+
+ dev->open_count = 0;
+ dev->read_only = 0;
+ dev->external_mode = 0;
+ dev->dirty = 0;
+ dev->boot_dirty = 0;
+
+ if ((dev->type=_device_init(dev)) <= 0)
+ goto error_free_arch_specific;
+
+ /* All OK! */
+ return dev;
+
+error_free_arch_specific:
+ ped_free (dev->arch_specific);
+
+error_free_path:
+ ped_free (dev->path);
+
+error_free_dev:
+ ped_free (dev);
+
+error:
+ return NULL;
+}
+
+static void
+beos_destroy (PedDevice* dev)
+{
+ ped_free (dev->arch_specific);
+ ped_free (dev->path);
+ ped_free (dev->model);
+ ped_free (dev);
+}
+
+static int
+beos_is_busy (PedDevice* dev)
+{
+ return 1;
+}
+
+static int
+beos_open (PedDevice* dev)
+{
+ BEOSSpecific* arch_specific = BEOS_SPECIFIC(dev);
+
+retry:
+ arch_specific->fd = open(dev->path, O_RDWR);
+ if (arch_specific->fd == -1) {
+ char* rw_error_msg = strerror(errno);
+
+ arch_specific->fd = open (dev->path, O_RDONLY);
+ if (arch_specific->fd == -1) {
+ if (ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_RETRY_CANCEL,
+ _("Error opening %s: %s"),
+ dev->path, strerror (errno))
+ != PED_EXCEPTION_RETRY) {
+ return 0;
+ } else {
+ goto retry;
+ }
+ } else {
+ ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_OK,
+ _("Unable to open %s read-write (%s). %s has "
+ "been opened read-only."),
+ dev->path, rw_error_msg, dev->path);
+ dev->read_only = 1;
+ }
+ } else {
+ dev->read_only = 0;
+ }
+
+ _flush_cache (dev);
+
+ return 1;
+}
+
+static int
+beos_refresh_open (PedDevice* dev)
+{
+ return 1;
+}
+
+static int
+beos_close (PedDevice* dev)
+{
+ BEOSSpecific* arch_specific = BEOS_SPECIFIC(dev);
+
+ if (dev->dirty)
+ _flush_cache (dev);
+
+ close (arch_specific->fd);
+
+ return 1;
+}
+
+static int
+beos_refresh_close (PedDevice* dev)
+{
+ if (dev->dirty)
+ _flush_cache (dev);
+
+ return 1;
+}
+
+static int
+beos_read (const PedDevice* dev, void* buffer, PedSector start, PedSector count)
+{
+ BEOSSpecific* arch_specific = BEOS_SPECIFIC(dev);
+ int status;
+ PedExceptionOption ex_status;
+ size_t read_length = count * dev->sector_size;
+
+ PED_ASSERT(dev->sector_size % 512 == 0, return 0);
+
+ /* First, try to seek */
+ while(1)
+ {
+ if (lseek(arch_specific->fd, start * dev->sector_size, SEEK_SET)
+ == start * dev->sector_size)
+ break;
+
+ ex_status = ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_RETRY_IGNORE_CANCEL,
+ _("%s during seek for read on %s"),
+ strerror (errno), dev->path);
+
+ switch (ex_status)
+ {
+ case PED_EXCEPTION_IGNORE:
+ return 1;
+ case PED_EXCEPTION_RETRY:
+ break /* out of switch */;
+ case PED_EXCEPTION_UNHANDLED:
+ ped_exception_catch ();
+ case PED_EXCEPTION_CANCEL:
+ return 0;
+ }
+ }
+
+ /* If we seeked ok, now is the time to read */
+ while (1)
+ {
+ status = read(arch_specific->fd, buffer, read_length);
+ if (status == count * dev->sector_size)
+ break;
+
+ if (status > 0)
+ {
+ read_length -= status;
+ buffer += status;
+ continue;
+ }
+
+ ex_status = ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_RETRY_IGNORE_CANCEL,
+ _("%s during read on %s"),
+ strerror (errno),
+ dev->path);
+
+ switch (ex_status)
+ {
+ case PED_EXCEPTION_IGNORE:
+ return 1;
+ case PED_EXCEPTION_RETRY:
+ break;
+ case PED_EXCEPTION_UNHANDLED:
+ ped_exception_catch ();
+ case PED_EXCEPTION_CANCEL:
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
+static int
+beos_write (PedDevice* dev, const void* buffer, PedSector start,
+ PedSector count)
+{
+ BEOSSpecific* arch_specific = BEOS_SPECIFIC(dev);
+ int status;
+ PedExceptionOption ex_status;
+ size_t write_length = count * dev->sector_size;
+
+ PED_ASSERT(dev->sector_size % 512 == 0, return 0);
+
+ if (dev->read_only)
+ {
+ if (ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("Can't write to %s, because it is opened read-only."),
+ dev->path)
+ != PED_EXCEPTION_IGNORE)
+ return 0;
+ else
+ return 1;
+ }
+
+ while(1)
+ {
+ if (lseek(arch_specific->fd,start * dev->sector_size,SEEK_SET)
+ == start * dev->sector_size)
+ break;
+
+ ex_status = ped_exception_throw (
+ PED_EXCEPTION_ERROR, PED_EXCEPTION_RETRY_IGNORE_CANCEL,
+ _("%s during seek for write on %s"),
+ strerror (errno), dev->path);
+
+ switch (ex_status)
+ {
+ case PED_EXCEPTION_IGNORE:
+ return 1;
+ case PED_EXCEPTION_RETRY:
+ break;
+ case PED_EXCEPTION_UNHANDLED:
+ ped_exception_catch ();
+ case PED_EXCEPTION_CANCEL:
+ return 0;
+ }
+ }
+
+#ifdef READ_ONLY
+ printf ("ped_device_write (\"%s\", %p, %d, %d)\n",
+ dev->path, buffer, (int) start, (int) count);
+#else
+ dev->dirty = 1;
+ while(1)
+ {
+ status = write (arch_specific->fd, buffer, write_length);
+ if (status == count * dev->sector_size)
+ break;
+
+ if (status > 0)
+ {
+ write_length -= status;
+ buffer += status;
+ continue;
+ }
+
+ ex_status = ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_RETRY_IGNORE_CANCEL,
+ _("%s during write on %s"),
+ strerror (errno), dev->path);
+
+ switch (ex_status)
+ {
+ case PED_EXCEPTION_IGNORE:
+ return 1;
+ case PED_EXCEPTION_RETRY:
+ break;
+ case PED_EXCEPTION_UNHANDLED:
+ ped_exception_catch ();
+ case PED_EXCEPTION_CANCEL:
+ return 0;
+ }
+ }
+#endif /* !READ_ONLY */
+
+ return 1;
+}
+
+static PedSector
+beos_check (PedDevice* dev, void* buffer, PedSector start, PedSector count)
+{
+ BEOSSpecific* arch_specific = BEOS_SPECIFIC(dev);
+ PedSector done = 0;
+ int status;
+
+ PED_ASSERT(dev != NULL, return 0);
+
+ if (lseek(arch_specific->fd, start * dev->sector_size, SEEK_SET)
+ != start * dev->sector_size)
+ return 0;
+
+ for (done = 0; done < count; done += status / dev->sector_size)
+ {
+ status = read (arch_specific->fd, buffer,
+ (size_t) ((count-done) * dev->sector_size));
+ if (status < 0)
+ break;
+ }
+
+ return done;
+}
+
+static int
+beos_sync (PedDevice* dev)
+{
+ return 1;
+}
+
+static int
+beos_sync_fast (PedDevice* dev)
+{
+ return 1;
+}
+
+/* Probe for all available disks */
+static void
+beos_probe_all ()
+{
+ /* For BeOS/ZETA/Haiku, all disks are published under /dev/disk */
+ _scan_for_disks("/dev/disk");
+}
+
+static char*
+beos_partition_get_path (const PedPartition* part)
+{
+ return NULL;
+}
+
+static int
+beos_partition_is_busy (const PedPartition* part)
+{
+ return 0;
+}
+
+static int
+beos_disk_commit (PedDisk* disk)
+{
+ return 0;
+}
+
+static PedDeviceArchOps beos_dev_ops = {
+ _new: beos_new,
+ destroy: beos_destroy,
+ is_busy: beos_is_busy,
+ open: beos_open,
+ refresh_open: beos_refresh_open,
+ close: beos_close,
+ refresh_close: beos_refresh_close,
+ read: beos_read,
+ write: beos_write,
+ check: beos_check,
+ sync: beos_sync,
+ sync_fast: beos_sync_fast,
+ probe_all: beos_probe_all
+};
+
+static PedDiskArchOps beos_disk_ops = {
+ partition_get_path: beos_partition_get_path,
+ partition_is_busy: beos_partition_is_busy,
+ disk_commit: beos_disk_commit
+};
+
+PedArchitecture ped_beos_arch = {
+ dev_ops: &beos_dev_ops,
+ disk_ops: &beos_disk_ops
+};
diff --git a/libparted/arch/blkpg.h b/libparted/arch/blkpg.h
new file mode 100644
index 0000000..2a5e4fb
--- /dev/null
+++ b/libparted/arch/blkpg.h
@@ -0,0 +1,64 @@
+#ifndef _LINUX_BLKPG_H
+#define _LINUX_BLKPG_H
+
+/*
+ * Partition table and disk geometry handling
+ *
+ * A single ioctl with lots of subfunctions:
+ *
+ * Device number stuff:
+ * get_whole_disk() (given the device number of a partition,
+ * find the device number of the encompassing disk)
+ * get_all_partitions() (given the device number of a disk, return the
+ * device numbers of all its known partitions)
+ *
+ * Partition stuff:
+ * add_partition()
+ * delete_partition()
+ * test_partition_in_use() (also for test_disk_in_use)
+ *
+ * Geometry stuff:
+ * get_geometry()
+ * set_geometry()
+ * get_bios_drivedata()
+ *
+ * For today, only the partition stuff - aeb, 990515
+ */
+#include <linux/ioctl.h>
+
+#define BLKPG _IO(0x12,105)
+
+/* The argument structure */
+struct blkpg_ioctl_arg {
+ int op;
+ int flags;
+ int datalen;
+ void *data;
+};
+
+/* The subfunctions (for the op field) */
+#define BLKPG_ADD_PARTITION 1
+#define BLKPG_DEL_PARTITION 2
+
+/* Sizes of name fields. Unused at present. */
+#define BLKPG_DEVNAMELTH 64
+#define BLKPG_VOLNAMELTH 64
+
+/* The data structure for ADD_PARTITION and DEL_PARTITION */
+struct blkpg_partition {
+ long long start; /* starting offset in bytes */
+ long long length; /* length in bytes */
+ int pno; /* partition number */
+ char devname[BLKPG_DEVNAMELTH]; /* partition name, like sda5 or c0d1p2,
+ to be used in kernel messages */
+ char volname[BLKPG_VOLNAMELTH]; /* volume label */
+};
+
+#ifdef __KERNEL__
+
+extern char * partition_name(kdev_t dev);
+extern int blk_ioctl(kdev_t dev, unsigned int cmd, unsigned long arg);
+
+#endif /* __KERNEL__ */
+
+#endif /* _LINUX_BLKPG_H */
diff --git a/libparted/arch/gnu.c b/libparted/arch/gnu.c
new file mode 100644
index 0000000..c83230b
--- /dev/null
+++ b/libparted/arch/gnu.c
@@ -0,0 +1,878 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 1999, 2000, 2001, 2005 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#define _GNU_SOURCE 1
+
+#include "config.h"
+
+#include <parted/parted.h>
+#include <parted/debug.h>
+#include <parted/gnu.h>
+
+#include <string.h>
+#include <errno.h>
+#include <hurd.h>
+#include <hurd/fs.h>
+#include <hurd/store.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+static int
+_device_get_sector_size (PedDevice* dev)
+{
+ GNUSpecific* arch_specific = GNU_SPECIFIC (dev);
+ size_t store_block_size = arch_specific->store->block_size;
+
+ return PED_SECTOR_SIZE_DEFAULT;
+}
+
+static PedSector
+_device_get_length (PedDevice* dev)
+{
+ GNUSpecific* arch_specific = GNU_SPECIFIC (dev);
+ size_t store_blocks = arch_specific->store->blocks;
+ size_t store_block_size = arch_specific->store->block_size;
+
+ return ((long long) store_blocks * store_block_size) / PED_SECTOR_SIZE_DEFAULT;
+}
+
+static int
+_device_probe_geometry (PedDevice* dev)
+{
+ PedSector cyl_size;
+
+ dev->length = _device_get_length (dev);
+ if (!dev->length)
+ return 0;
+
+ dev->sector_size = _device_get_sector_size (dev);
+ if (!dev->sector_size)
+ return 0;
+
+ /* XXX: We have no way to get this! */
+ dev->bios_geom.sectors = 63;
+ dev->bios_geom.heads = 255;
+ cyl_size = dev->bios_geom.sectors * dev->bios_geom.heads;
+ dev->bios_geom.cylinders = dev->length / cyl_size
+ * (dev->sector_size / PED_SECTOR_SIZE_DEFAULT);
+ dev->hw_geom = dev->bios_geom;
+
+ return 1;
+}
+
+static int
+init_file (PedDevice* dev)
+{
+ PedExceptionOption ex_status;
+
+retry_open:
+ if (!ped_device_open (dev)) {
+ ex_status = ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_RETRY_CANCEL,
+ _("Unable to open %s."),
+ dev->path);
+ switch (ex_status) {
+ case PED_EXCEPTION_RETRY:
+ goto retry_open;
+
+ case PED_EXCEPTION_UNHANDLED:
+ ped_exception_catch ();
+ case PED_EXCEPTION_CANCEL:
+ goto error;
+ }
+
+ return 0;
+ }
+
+retry_probe:
+ if (!_device_probe_geometry (dev)) {
+ ex_status = ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_RETRY_CANCEL,
+ _("Unable to probe store."));
+ switch (ex_status) {
+ case PED_EXCEPTION_RETRY:
+ goto retry_probe;
+
+ case PED_EXCEPTION_UNHANDLED:
+ ped_exception_catch ();
+ case PED_EXCEPTION_CANCEL:
+ goto error_close_dev;
+ }
+
+ return 0;
+ }
+
+ dev->model = "";
+
+ ped_device_close (dev);
+ return 1;
+
+error_close_dev:
+ ped_device_close (dev);
+error:
+ return 0;
+}
+
+static void
+_flush_cache (PedDevice* dev)
+{
+ GNUSpecific* arch_specific = GNU_SPECIFIC (dev);
+
+ if (dev->read_only)
+ return;
+
+ /* Wait for a complete sync to finish. */
+ file_sync (arch_specific->store->source, 1, 0);
+}
+
+/* Initialize by allocating memory and filling in a few defaults, a
+ PedDevice structure. */
+static PedDevice*
+_init_device (const char *path)
+{
+ PedDevice *dev;
+ GNUSpecific* arch_specific;
+
+ dev = (PedDevice*) ped_malloc (sizeof (PedDevice));
+ if (!dev)
+ goto error;
+
+ dev->path = strdup (path);
+ if (!dev->path)
+ goto error_free_dev;
+
+ dev->arch_specific
+ = (GNUSpecific*) ped_malloc (sizeof (GNUSpecific));
+ if (!dev->arch_specific)
+ goto error_free_path;
+
+ dev->type = PED_DEVICE_FILE; /* FIXME? */
+ dev->open_count = 0;
+ dev->read_only = 0;
+ dev->external_mode = 0;
+ dev->dirty = 0;
+ dev->boot_dirty = 0;
+
+ return dev;
+
+error_free_arch_specific:
+ ped_free (dev->arch_specific);
+error_free_path:
+ ped_free (dev->path);
+error_free_dev:
+ ped_free (dev);
+error:
+ return NULL;
+}
+
+static int
+_kernel_reread_part_table (PedDevice* dev)
+{
+ /* XXX: We must wait for partfs to be finished. */
+ return 1;
+}
+
+/* Free the memory associated with a PedDevice structure. */
+static void
+_done_device (PedDevice *dev)
+{
+ ped_free (dev->arch_specific);
+ ped_free (dev->path);
+ ped_free (dev);
+}
+
+/* Release all resources that libparted owns in DEV. */
+static void
+gnu_destroy (PedDevice* dev)
+{
+ GNUSpecific* arch_specific = GNU_SPECIFIC (dev);
+
+ if (arch_specific->consume)
+ store_free (arch_specific->store);
+
+ _done_device (dev);
+}
+
+static PedDevice*
+gnu_new (const char* path)
+{
+ PedDevice* dev;
+ GNUSpecific* arch_specific;
+ error_t ro_err, rw_err;
+ int ispath;
+
+ PED_ASSERT (path != NULL, return NULL);
+
+ dev = _init_device (path);
+ if (!dev)
+ return NULL;
+
+ arch_specific = GNU_SPECIFIC (dev);
+ arch_specific->consume = 1;
+
+ retry_open:
+ /* Try read-write. */
+ if (strchr (dev->path, '/') != NULL) {
+ /* We set this to prevent having to use strchr more then once. */
+ ispath = 1;
+
+ rw_err = store_open (dev->path, 0, NULL, &arch_specific->store);
+ } else {
+ rw_err = store_typed_open (dev->path, 0, NULL, &arch_specific->store);
+ }
+
+ /* Try readonly. */
+ if (rw_err) {
+ if (ispath) {
+ ro_err = store_open (dev->path, STORE_READONLY, NULL,
+ &arch_specific->store);
+ } else {
+ ro_err = store_typed_open (dev->path, STORE_READONLY, NULL,
+ &arch_specific->store);
+ }
+
+ if (ro_err) {
+ if (ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_RETRY_CANCEL,
+ _("Error opening %s: %s"),
+ dev->path, strerror (ro_err))
+ != PED_EXCEPTION_RETRY) {
+ return NULL;
+ } else
+ goto retry_open;
+ } else {
+ ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_OK,
+ _("Unable to open %s read-write (%s). %s has "
+ "been opened read-only."),
+ dev->path, strerror (rw_err), dev->path);
+ dev->read_only = 1;
+ }
+ } else {
+ dev->read_only = 0;
+ }
+
+ _flush_cache (dev);
+
+ if (!init_file (dev)) {
+ gnu_destroy(dev);
+ return NULL;
+ }
+
+ return dev;
+}
+
+PedDevice*
+ped_device_new_from_store (struct store *source)
+{
+ PedDevice* dev;
+ GNUSpecific* arch_specific;
+
+ PED_ASSERT (source != NULL, return NULL);
+
+ dev = _init_device (source->name ?: "(unknown)");
+ if (!dev)
+ return NULL;
+
+ arch_specific = GNU_SPECIFIC (dev);
+ arch_specific->store = source;
+ arch_specific->consume = 0;
+
+ dev->read_only = source->flags & (STORE_READONLY|STORE_HARD_READONLY);
+
+ if (!init_file (dev)) {
+ _done_device (dev);
+ return NULL;
+ }
+
+ return dev;
+}
+
+static int
+gnu_is_busy (PedDevice* dev)
+{
+ return 0;
+}
+
+static int
+gnu_open (PedDevice* dev)
+{
+ return 1;
+}
+
+static int
+gnu_refresh_open (PedDevice* dev)
+{
+ return 1;
+}
+
+static int
+gnu_close (PedDevice* dev)
+{
+ GNUSpecific* arch_specific = GNU_SPECIFIC (dev);
+
+ _flush_cache (dev);
+
+ if (dev->dirty && dev->type != PED_DEVICE_FILE) {
+ if (_kernel_reread_part_table (dev))
+ dev->dirty = 0;
+ }
+
+#if 0
+ if (dev->dirty && dev->boot_dirty && dev->type != PED_DEVICE_FILE) {
+ /* ouch! */
+ ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_OK,
+ _("The partition table cannot be re-read. This means "
+ "you need to reboot before mounting any "
+ "modified partitions. You also need to reinstall "
+ "your boot loader before you reboot (which may "
+ "require mounting modified partitions). It is "
+ "impossible do both things! So you'll need to "
+ "boot off a rescue disk, and reinstall your boot "
+ "loader from the rescue disk. Read section 4 of "
+ "the Parted User documentation for more "
+ "information."));
+ return 1;
+ }
+
+ if (dev->dirty && dev->type != PED_DEVICE_FILE) {
+ ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_IGNORE,
+ _("The partition table on %s cannot be re-read "
+ "(%s). This means the Hurd knows nothing about any "
+ "modifications you made. You should reboot your "
+ "computer before doing anything with %s."),
+ dev->path, strerror (errno), dev->path);
+ }
+
+ if (dev->boot_dirty && dev->type != PED_DEVICE_FILE) {
+ ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_OK,
+ _("You should reinstall your boot loader before "
+ "rebooting. Read section 4 of the Parted User "
+ "documentation for more information."));
+ }
+#endif
+
+ return 1;
+}
+
+static int
+gnu_refresh_close (PedDevice* dev)
+{
+ _flush_cache (dev);
+ return 1;
+}
+
+static int
+gnu_read (PedDevice* dev, void* user_buffer,
+ PedSector device_start, PedSector count)
+{
+ GNUSpecific* arch_specific = GNU_SPECIFIC (dev);
+ error_t err;
+ PedExceptionOption ex_status;
+ size_t start;
+ size_t store_start_block;
+ /* In bytes. This can be larger than COUNT when store pages are
+ larger than PED_SECTOR_SIZE_DEFAULT. */
+ size_t store_read_length;
+ char local_buffer[PED_SECTOR_SIZE_DEFAULT];
+ void * store_read_buffer;
+ size_t have_read;
+ size_t read_offset;
+ size_t device_read_length = count * PED_SECTOR_SIZE_DEFAULT;
+
+ start = device_start * PED_SECTOR_SIZE_DEFAULT;
+ if (PED_SECTOR_SIZE_DEFAULT != arch_specific->store->block_size) {
+ store_start_block = start / arch_specific->store->block_size;
+ store_read_length = (device_read_length
+ + arch_specific->store->block_size - 1)
+ / arch_specific->store->block_size;
+ } else {
+ store_start_block = device_start;
+ store_read_length = device_read_length;
+ }
+
+ read_offset = start
+ - store_start_block * arch_specific->store->block_size;
+
+ if (store_read_length % arch_specific->store->block_size != 0)
+ store_read_length = store_read_length
+ + arch_specific->store->block_size
+ - store_read_length % arch_specific->store->block_size;
+
+retry:
+ have_read = 0;
+ while (1) {
+ size_t did_read;
+ size_t offset;
+
+ store_read_buffer = local_buffer;
+ did_read = sizeof (local_buffer);
+
+ err = store_read (arch_specific->store, store_start_block,
+ store_read_length - have_read,
+ &store_read_buffer, &did_read);
+ if (err) {
+ ex_status = ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_RETRY_IGNORE_CANCEL,
+ _("%s during read on %s"),
+ strerror (err),
+ dev->path);
+
+ switch (ex_status) {
+ case PED_EXCEPTION_IGNORE:
+ return 1;
+
+ case PED_EXCEPTION_RETRY:
+ goto retry;
+
+ case PED_EXCEPTION_UNHANDLED:
+ ped_exception_catch ();
+ case PED_EXCEPTION_CANCEL:
+ return 0;
+ }
+ }
+
+ memcpy (user_buffer + have_read - read_offset,
+ store_read_buffer
+ + (have_read >= read_offset
+ ? 0 : read_offset - have_read),
+ have_read + did_read > device_read_length + read_offset
+ ? device_read_length + read_offset - have_read
+ : did_read);
+
+ if (store_read_buffer != local_buffer)
+ vm_deallocate (mach_task_self (),
+ (long) store_read_buffer, did_read);
+
+ have_read += did_read;
+ store_start_block += did_read
+ / arch_specific->store->block_size;
+
+ if (have_read >= device_read_length)
+ break;
+ }
+
+ return 1;
+}
+
+static int
+gnu_write (PedDevice* dev, const void* buffer, PedSector start, PedSector count)
+{
+ GNUSpecific* arch_specific = GNU_SPECIFIC (dev);
+ error_t err;
+ PedExceptionOption ex_status;
+ void * temp;
+ char local_buffer[PED_SECTOR_SIZE_DEFAULT];
+ size_t did_read;
+ size_t did_write;
+
+ /* Map a disk sector to a store sector. */
+ #define PED_TO_STORE(store, sector) (((sector) * PED_SECTOR_SIZE_DEFAULT) \
+ / (store)->block_size)
+
+ if (dev->read_only) {
+ if (ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("Can't write to %s, because it is opened read-only."),
+ dev->path)
+ != PED_EXCEPTION_IGNORE)
+ return 0;
+ else
+ return 1;
+ }
+
+#ifdef READ_ONLY
+ printf ("ped_device_write (\"%s\", %p, %d, %d)\n",
+ dev->path, buffer, (int) start, (int) count);
+#else
+ dev->dirty = 1;
+
+ /* If the first ``device'' block (PedSector) is not aligned on a
+ store block, then we need to fetch the old block, copy in the
+ overlaping area and finally, write the modified data out to the
+ store. */
+ if ((PED_SECTOR_SIZE_DEFAULT * start) % arch_specific->store->block_size
+ != 0) {
+ size_t write_offset;
+ size_t flushing;
+
+doggy_first_block_read:
+ /* We do not bother looping as we are only reading a
+ single block. */
+ temp = local_buffer;
+ did_read = sizeof (local_buffer);
+ err = store_read (arch_specific->store,
+ PED_TO_STORE (arch_specific->store, start),
+ arch_specific->store->block_size, &temp,
+ &did_read);
+ if (! err && did_read != arch_specific->store->block_size)
+ err = EIO;
+
+ if (err) {
+ ex_status = ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_RETRY_IGNORE_CANCEL,
+ _("%s during read on %s"),
+ strerror (err), dev->path);
+
+ switch (ex_status) {
+ case PED_EXCEPTION_IGNORE:
+ break;
+
+ case PED_EXCEPTION_RETRY:
+ goto doggy_first_block_read;
+
+ case PED_EXCEPTION_UNHANDLED:
+ ped_exception_catch ();
+ case PED_EXCEPTION_CANCEL:
+ return 0;
+ }
+ }
+
+ write_offset = (start * PED_SECTOR_SIZE_DEFAULT)
+ % arch_specific->store->block_size;
+ flushing = arch_specific->store->block_size - write_offset;
+ if (flushing > count * PED_SECTOR_SIZE_DEFAULT)
+ flushing = count * PED_SECTOR_SIZE_DEFAULT;
+
+ memcpy (temp + write_offset, buffer, flushing);
+
+doggy_first_block_write:
+ err = store_write (arch_specific->store,
+ PED_TO_STORE (arch_specific->store, start),
+ temp, arch_specific->store->block_size,
+ &did_write);
+ if (! err && did_write != arch_specific->store->block_size)
+ err = EIO;
+
+ if (err) {
+ ex_status = ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_RETRY_IGNORE_CANCEL,
+ _("%s during write on %s"),
+ strerror (err), dev->path);
+
+ switch (ex_status) {
+ case PED_EXCEPTION_IGNORE:
+ break;
+
+ case PED_EXCEPTION_RETRY:
+ goto doggy_first_block_write;
+
+ case PED_EXCEPTION_UNHANDLED:
+ ped_exception_catch ();
+ case PED_EXCEPTION_CANCEL:
+ if (temp != local_buffer)
+ vm_deallocate (
+ mach_task_self (),
+ (long) temp,
+ did_read);
+ return 0;
+ }
+ }
+
+ start += flushing / PED_SECTOR_SIZE_DEFAULT;
+ count -= flushing / PED_SECTOR_SIZE_DEFAULT;
+ buffer += write_offset;
+
+ if (temp != local_buffer)
+ vm_deallocate (mach_task_self (), (long) temp,
+ did_read);
+
+ if (count == 0)
+ return 1;
+ }
+
+ while (count > 0
+ && count >= arch_specific->store->block_size / PED_SECTOR_SIZE_DEFAULT) {
+ err = store_write (arch_specific->store,
+ PED_TO_STORE (arch_specific->store, start),
+ buffer, count * PED_SECTOR_SIZE_DEFAULT,
+ &did_write);
+
+ if (err) {
+ ex_status = ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_RETRY_IGNORE_CANCEL,
+ _("%s during write on %s"),
+ strerror (err), dev->path);
+
+ switch (ex_status) {
+ case PED_EXCEPTION_IGNORE:
+ break;
+
+ case PED_EXCEPTION_RETRY:
+ continue;
+
+ case PED_EXCEPTION_UNHANDLED:
+ ped_exception_catch ();
+ case PED_EXCEPTION_CANCEL:
+ return 0;
+ }
+ }
+
+ start += did_write / PED_SECTOR_SIZE_DEFAULT;
+ count -= did_write / PED_SECTOR_SIZE_DEFAULT;
+ buffer += did_write;
+ }
+
+ if (count == 0)
+ return 1;
+
+ /* We are now left with (strictly) less then a store block to write
+ to disk. Thus, we read the block, overlay the buffer and flush. */
+ PED_ASSERT (count * PED_SECTOR_SIZE
+ < arch_specific->store->block_size, return 0);
+
+doggy_last_block_read:
+ /* We do not bother looping as we are only reading a
+ single block. */
+ temp = local_buffer;
+ did_read = sizeof (local_buffer);
+ err = store_read (arch_specific->store,
+ PED_TO_STORE (arch_specific->store, start),
+ arch_specific->store->block_size, &temp,
+ &did_read);
+ if (! err && did_read != arch_specific->store->block_size)
+ err = EIO;
+
+ if (err) {
+ ex_status = ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_RETRY_IGNORE_CANCEL,
+ _("%s during read on %s"),
+ strerror (err), dev->path);
+
+ switch (ex_status) {
+ case PED_EXCEPTION_IGNORE:
+ break;
+
+ case PED_EXCEPTION_RETRY:
+ goto doggy_last_block_read;
+
+ case PED_EXCEPTION_UNHANDLED:
+ ped_exception_catch ();
+ case PED_EXCEPTION_CANCEL:
+ return 0;
+ }
+ }
+
+ memcpy (temp, buffer, count * PED_SECTOR_SIZE_DEFAULT);
+
+doggy_last_block_write:
+ err = store_write (arch_specific->store,
+ PED_TO_STORE (arch_specific->store, start),
+ temp, arch_specific->store->block_size,
+ &did_write);
+ if (! err && did_write != arch_specific->store->block_size)
+ err = EIO;
+
+ if (err) {
+ ex_status = ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_RETRY_IGNORE_CANCEL,
+ _("%s during write on %s"),
+ strerror (err), dev->path);
+
+ switch (ex_status) {
+ case PED_EXCEPTION_IGNORE:
+ break;
+
+ case PED_EXCEPTION_RETRY:
+ goto doggy_last_block_write;
+
+ case PED_EXCEPTION_UNHANDLED:
+ ped_exception_catch ();
+ case PED_EXCEPTION_CANCEL:
+ if (temp != local_buffer)
+ vm_deallocate (mach_task_self (),
+ (long) temp,
+ did_read);
+ return 0;
+ }
+ }
+
+#endif /* !READ_ONLY */
+ return 1;
+}
+
+/* TODO: returns the number of sectors that are ok.
+ */
+static PedSector
+gnu_check (PedDevice* dev, void* buffer, PedSector start, PedSector count)
+{
+ int status;
+ int done = 0;
+
+ PED_ASSERT (dev != NULL, return 0);
+ PED_ASSERT (!dev->external_mode, return 0);
+ PED_ASSERT (buffer != NULL, return 0);
+
+ return count;
+}
+
+static int
+gnu_sync (PedDevice* dev)
+{
+ GNUSpecific* arch_specific;
+ error_t err;
+ PedExceptionOption ex_status;
+ static char *last_failure = NULL;
+
+ PED_ASSERT (dev != NULL, return 0);
+ PED_ASSERT (!dev->external_mode, return 0);
+
+ arch_specific = GNU_SPECIFIC (dev);
+
+ if (dev->read_only || ! dev->dirty)
+ return 1;
+
+ while (1) {
+ err = file_sync (arch_specific->store->source, 1, 0);
+ if (! err || err == EOPNOTSUPP || err == EPERM
+ || (last_failure && strcmp (last_failure, dev->path) == 0))
+ break;
+
+ ex_status = ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_RETRY_IGNORE_CANCEL,
+ _("%s trying to sync %s to disk"),
+ strerror (errno), dev->path);
+
+ switch (ex_status) {
+ case PED_EXCEPTION_IGNORE:
+ if (last_failure)
+ ped_free (last_failure);
+ last_failure = strdup (dev->path);
+ return 1;
+
+ case PED_EXCEPTION_RETRY:
+ break;
+
+ case PED_EXCEPTION_UNHANDLED:
+ ped_exception_catch ();
+ case PED_EXCEPTION_CANCEL:
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
+static int
+probe_standard_devices ()
+{
+ _ped_device_probe ("/dev/sd0");
+ _ped_device_probe ("/dev/sd1");
+ _ped_device_probe ("/dev/sd2");
+ _ped_device_probe ("/dev/sd3");
+ _ped_device_probe ("/dev/sd4");
+ _ped_device_probe ("/dev/sd5");
+
+ _ped_device_probe ("/dev/hd0");
+ _ped_device_probe ("/dev/hd1");
+ _ped_device_probe ("/dev/hd2");
+ _ped_device_probe ("/dev/hd3");
+ _ped_device_probe ("/dev/hd4");
+ _ped_device_probe ("/dev/hd5");
+ _ped_device_probe ("/dev/hd6");
+ _ped_device_probe ("/dev/hd7");
+
+ return 1;
+}
+
+static void
+gnu_probe_all ()
+{
+ probe_standard_devices ();
+}
+
+static char*
+gnu_partition_get_path (const PedPartition* part)
+{
+ const char* dev_path = part->disk->dev->path;
+ int result_len = strlen (dev_path) + 16;
+ char* result;
+
+ result = (char*) ped_malloc (result_len);
+ if (!result)
+ return NULL;
+ snprintf (result, result_len, "%s%d", dev_path, part->num);
+ return result;
+}
+
+static int
+gnu_partition_is_busy (const PedPartition* part)
+{
+ return 0;
+}
+
+static int
+gnu_disk_commit (PedDisk* disk)
+{
+ return 1;
+}
+
+static PedDeviceArchOps gnu_dev_ops = {
+ _new: gnu_new,
+ destroy: gnu_destroy,
+ is_busy: gnu_is_busy,
+ open: gnu_open,
+ refresh_open: gnu_refresh_open,
+ close: gnu_close,
+ refresh_close: gnu_refresh_close,
+ read: gnu_read,
+ write: gnu_write,
+ check: gnu_check,
+ sync: gnu_sync,
+ sync_fast: gnu_sync,
+ probe_all: gnu_probe_all
+};
+
+static PedDiskArchOps gnu_disk_ops = {
+ partition_get_path: gnu_partition_get_path,
+ partition_is_busy: gnu_partition_is_busy,
+ disk_commit: gnu_disk_commit
+};
+
+PedArchitecture ped_gnu_arch = {
+ dev_ops: &gnu_dev_ops,
+ disk_ops: &gnu_disk_ops
+};
+
diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
new file mode 100644
index 0000000..cf480e2
--- /dev/null
+++ b/libparted/arch/linux.c
@@ -0,0 +1,2105 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 1999 - 2005 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+/* we need this for O_DIRECT on Linux, it's in the glibc headers */
+#define __GNU_SOURCE
+
+#include "config.h"
+
+#include <parted/parted.h>
+#include <parted/debug.h>
+#include <parted/linux.h>
+
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <libgen.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <syscall.h>
+#include <unistd.h>
+#include <dirent.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/utsname.h> /* for uname() */
+#include <scsi/scsi.h>
+
+#include "blkpg.h"
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
+
+#ifndef __NR__llseek
+#define __NR__llseek 140
+#endif
+
+#ifndef SCSI_IOCTL_SEND_COMMAND
+#define SCSI_IOCTL_SEND_COMMAND 1
+#endif
+
+/* from <linux/hdreg.h> */
+#define HDIO_GETGEO 0x0301 /* get device geometry */
+#define HDIO_GET_IDENTITY 0x030d /* get IDE identification info */
+
+#include <parted/vtoc.h>
+#include <parted/fdasd.h>
+
+#if defined(O_DIRECT) && (!defined(__s390__) || !defined(__s390x__))
+#define RD_MODE (O_RDONLY | O_DIRECT)
+#define WR_MODE (O_WRONLY | O_DIRECT)
+#define RW_MODE (O_RDWR | O_DIRECT)
+#else
+#define RD_MODE (O_RDONLY)
+#define WR_MODE (O_WRONLY)
+#define RW_MODE (O_RDWR)
+#endif
+
+struct hd_geometry {
+ unsigned char heads;
+ unsigned char sectors;
+ unsigned short cylinders;
+ unsigned long start;
+};
+
+struct ata7_sectinfo {
+ int valid1:1;
+ int valid2:1;
+ int rsv:26;
+ int multiplier:4;
+};
+
+/* structure returned by HDIO_GET_IDENTITY, as per ANSI ATA2 rev.2f spec */
+struct hd_driveid {
+ unsigned short config; /* lots of obsolete bit flags */
+ unsigned short cyls; /* "physical" cyls */
+ unsigned short reserved2; /* reserved (word 2) */
+ unsigned short heads; /* "physical" heads */
+ unsigned short track_bytes; /* unformatted bytes per track */
+ unsigned short sector_bytes; /* unformatted bytes per sector */
+ unsigned short sectors; /* "physical" sectors per track */
+ unsigned short vendor0; /* vendor unique */
+ unsigned short vendor1; /* vendor unique */
+ unsigned short vendor2; /* vendor unique */
+ unsigned char serial_no[20]; /* 0 = not_specified */
+ unsigned short buf_type;
+ unsigned short buf_size; /* 512 byte increments;
+ 0 = not_specified */
+ unsigned short ecc_bytes; /* for r/w long cmds;
+ 0 = not_specified */
+ unsigned char fw_rev[8]; /* 0 = not_specified */
+ char model[40]; /* 0 = not_specified */
+ unsigned char max_multsect; /* 0=not_implemented */
+ unsigned char vendor3; /* vendor unique */
+ unsigned short dword_io; /* 0=not_implemented; 1=implemented */
+ unsigned char vendor4; /* vendor unique */
+ unsigned char capability; /* bits 0:DMA 1:LBA 2:IORDYsw
+ 3:IORDYsup*/
+ unsigned short reserved50; /* reserved (word 50) */
+ unsigned char vendor5; /* vendor unique */
+ unsigned char tPIO; /* 0=slow, 1=medium, 2=fast */
+ unsigned char vendor6; /* vendor unique */
+ unsigned char tDMA; /* 0=slow, 1=medium, 2=fast */
+ unsigned short field_valid; /* bits 0:cur_ok 1:eide_ok */
+ unsigned short cur_cyls; /* logical cylinders */
+ unsigned short cur_heads; /* logical heads */
+ unsigned short cur_sectors; /* logical sectors per track */
+ unsigned short cur_capacity0; /* logical total sectors on drive */
+ unsigned short cur_capacity1; /* (2 words, misaligned int) */
+ unsigned char multsect; /* current multiple sector count */
+ unsigned char multsect_valid; /* when (bit0==1) multsect is ok */
+ unsigned int lba_capacity; /* total number of sectors */
+ unsigned short dma_1word; /* single-word dma info */
+ unsigned short dma_mword; /* multiple-word dma info */
+ unsigned short eide_pio_modes; /* bits 0:mode3 1:mode4 */
+ unsigned short eide_dma_min; /* min mword dma cycle time (ns) */
+ unsigned short eide_dma_time; /* recommended mword dma cycle
+ time (ns) */
+ unsigned short eide_pio; /* min cycle time (ns), no IORDY */
+ unsigned short eide_pio_iordy; /* min cycle time (ns), with IORDY */
+ unsigned short words69_70[2]; /* reserved words 69-70 */
+ /* HDIO_GET_IDENTITY currently returns only words 0 through 70 */
+ unsigned short words71_74[4]; /* reserved words 71-74 */
+ unsigned short queue_depth; /* */
+ unsigned short words76_79[4]; /* reserved words 76-79 */
+ unsigned short major_rev_num; /* */
+ unsigned short minor_rev_num; /* */
+ unsigned short command_set_1; /* bits 0:Smart 1:Security 2:Removable
+ 3:PM */
+ unsigned short command_set_2; /* bits 14:Smart Enabled 13:0 zero */
+ unsigned short cfsse; /* command set-feature supported
+ extensions */
+ unsigned short cfs_enable_1; /* command set-feature enabled */
+ unsigned short cfs_enable_2; /* command set-feature enabled */
+ unsigned short csf_default; /* command set-feature default */
+ unsigned short dma_ultra; /* */
+ unsigned short word89; /* reserved (word 89) */
+ unsigned short word90; /* reserved (word 90) */
+ unsigned short CurAPMvalues; /* current APM values */
+ unsigned short word92; /* reserved (word 92) */
+ unsigned short hw_config; /* hardware config */
+ unsigned short words94_105[12];/* reserved words 94-105 */
+ struct ata7_sectinfo ata7_sectinfo; /* ATAPI/ATA7 physical and logical
+ sector size */
+ unsigned short words107_116[10];/* reserved words 107-116 */
+ unsigned int logical_sectsize;/* ATAPI/ATA7 logical sector size */
+ unsigned short words119_125[7];/* reserved words 119-125 */
+ unsigned short last_lun; /* reserved (word 126) */
+ unsigned short word127; /* reserved (word 127) */
+ unsigned short dlf; /* device lock function
+ * 15:9 reserved
+ * 8 security level 1:max 0:high
+ * 7:6 reserved
+ * 5 enhanced erase
+ * 4 expire
+ * 3 frozen
+ * 2 locked
+ * 1 en/disabled
+ * 0 capability
+ */
+ unsigned short csfo; /* current set features options
+ * 15:4 reserved
+ * 3 auto reassign
+ * 2 reverting
+ * 1 read-look-ahead
+ * 0 write cache
+ */
+ unsigned short words130_155[26];/* reserved vendor words 130-155 */
+ unsigned short word156;
+ unsigned short words157_159[3]; /* reserved vendor words 157-159 */
+ unsigned short words160_255[95];/* reserved words 160-255 */
+};
+
+/* from <linux/fs.h> */
+#define BLKRRPART _IO(0x12,95) /* re-read partition table */
+#define BLKGETSIZE _IO(0x12,96) /* return device size */
+#define BLKFLSBUF _IO(0x12,97) /* flush buffer cache */
+#define BLKSSZGET _IO(0x12,104) /* get block device sector size */
+#define BLKGETLASTSECT _IO(0x12,108) /* get last sector of block device */
+#define BLKSETLASTSECT _IO(0x12,109) /* set last sector of block device */
+
+/* return device size in bytes (u64 *arg) */
+#define BLKGETSIZE64 _IOR(0x12,114,size_t)
+
+struct blkdev_ioctl_param {
+ unsigned int block;
+ size_t content_length;
+ char * block_contents;
+};
+
+/* from <linux/major.h> */
+#define IDE0_MAJOR 3
+#define IDE1_MAJOR 22
+#define IDE2_MAJOR 33
+#define IDE3_MAJOR 34
+#define IDE4_MAJOR 56
+#define IDE5_MAJOR 57
+#define SCSI_CDROM_MAJOR 11
+#define SCSI_DISK0_MAJOR 8
+#define SCSI_DISK1_MAJOR 65
+#define SCSI_DISK2_MAJOR 66
+#define SCSI_DISK3_MAJOR 67
+#define SCSI_DISK4_MAJOR 68
+#define SCSI_DISK5_MAJOR 69
+#define SCSI_DISK6_MAJOR 70
+#define SCSI_DISK7_MAJOR 71
+#define COMPAQ_SMART2_MAJOR 72
+#define COMPAQ_SMART2_MAJOR1 73
+#define COMPAQ_SMART2_MAJOR2 74
+#define COMPAQ_SMART2_MAJOR3 75
+#define COMPAQ_SMART2_MAJOR4 76
+#define COMPAQ_SMART2_MAJOR5 77
+#define COMPAQ_SMART2_MAJOR6 78
+#define COMPAQ_SMART2_MAJOR7 79
+#define COMPAQ_SMART_MAJOR 104
+#define COMPAQ_SMART_MAJOR1 105
+#define COMPAQ_SMART_MAJOR2 106
+#define COMPAQ_SMART_MAJOR3 107
+#define COMPAQ_SMART_MAJOR4 108
+#define COMPAQ_SMART_MAJOR5 109
+#define COMPAQ_SMART_MAJOR6 110
+#define COMPAQ_SMART_MAJOR7 111
+#define DAC960_MAJOR 48
+#define ATARAID_MAJOR 114
+#define I2O_MAJOR1 80
+#define I2O_MAJOR2 81
+#define I2O_MAJOR3 82
+#define I2O_MAJOR4 83
+#define I2O_MAJOR5 84
+#define I2O_MAJOR6 85
+#define I2O_MAJOR7 86
+#define I2O_MAJOR8 87
+#define UBD_MAJOR 98
+#define DASD_MAJOR 94
+#define VIODASD_MAJOR 112
+#define SX8_MAJOR1 160
+#define SX8_MAJOR2 161
+
+#define SCSI_BLK_MAJOR(M) ( \
+ (M) == SCSI_DISK0_MAJOR \
+ || (M) == SCSI_CDROM_MAJOR \
+ || ((M) >= SCSI_DISK1_MAJOR && (M) <= SCSI_DISK7_MAJOR))
+
+static char* _device_get_part_path (PedDevice* dev, int num);
+static int _partition_is_mounted_by_path (const char* path);
+
+static int
+_is_ide_major (int major)
+{
+ switch (major) {
+ case IDE0_MAJOR:
+ case IDE1_MAJOR:
+ case IDE2_MAJOR:
+ case IDE3_MAJOR:
+ case IDE4_MAJOR:
+ case IDE5_MAJOR:
+ return 1;
+
+ default:
+ return 0;
+ }
+}
+
+static int
+_is_cpqarray_major (int major)
+{
+ return ((COMPAQ_SMART2_MAJOR <= major && major <= COMPAQ_SMART2_MAJOR7)
+ || (COMPAQ_SMART_MAJOR <= major && major <= COMPAQ_SMART_MAJOR7));
+}
+
+static int
+_is_i2o_major (int major)
+{
+ return (I2O_MAJOR1 <= major && major <= I2O_MAJOR8);
+}
+
+static int
+_is_sx8_major (int major)
+{
+ return (SX8_MAJOR1 <= major && major <= SX8_MAJOR2);
+}
+
+static int
+_device_stat (PedDevice* dev, struct stat * dev_stat)
+{
+ PED_ASSERT (dev != NULL, return 0);
+ PED_ASSERT (!dev->external_mode, return 0);
+
+ while (1) {
+ if (!stat (dev->path, dev_stat)) {
+ return 1;
+ } else {
+ if (ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_RETRY_CANCEL,
+ _("Could not stat device %s - %s."),
+ dev->path,
+ strerror (errno))
+ != PED_EXCEPTION_RETRY)
+ return 0;
+ }
+ }
+}
+
+static int
+_device_probe_type (PedDevice* dev)
+{
+ struct stat dev_stat;
+ int dev_major;
+ int dev_minor;
+ PedExceptionOption ex_status;
+
+ if (!_device_stat (dev, &dev_stat))
+ return 0;
+
+ if (!S_ISBLK(dev_stat.st_mode)) {
+ dev->type = PED_DEVICE_FILE;
+ return 1;
+ }
+
+ dev_major = major (dev_stat.st_rdev);
+ dev_minor = minor (dev_stat.st_rdev);
+
+ if (SCSI_BLK_MAJOR (dev_major) && (dev_minor % 0x10 == 0)) {
+ dev->type = PED_DEVICE_SCSI;
+ } else if (_is_ide_major (dev_major) && (dev_minor % 0x40 == 0)) {
+ dev->type = PED_DEVICE_IDE;
+ } else if (dev_major == DAC960_MAJOR && (dev_minor % 0x8 == 0)) {
+ dev->type = PED_DEVICE_DAC960;
+ } else if (dev_major == ATARAID_MAJOR && (dev_minor % 0x10 == 0)) {
+ dev->type = PED_DEVICE_ATARAID;
+ } else if (dev_major == DASD_MAJOR && (dev_minor % 0x4 == 0)) {
+ dev->type = PED_DEVICE_DASD;
+ } else if (dev_major == VIODASD_MAJOR && (dev_minor % 0x8 == 0)) {
+ dev->type = PED_DEVICE_VIODASD;
+ } else if (_is_sx8_major(dev_major) && (dev_minor % 0x20 == 0)) {
+ dev->type = PED_DEVICE_SX8;
+ } else if (_is_i2o_major (dev_major) && (dev_minor % 0x10 == 0)) {
+ dev->type = PED_DEVICE_I2O;
+ } else if (_is_cpqarray_major (dev_major) && (dev_minor % 0x10 == 0)) {
+ dev->type = PED_DEVICE_CPQARRAY;
+ } else if (dev_major == UBD_MAJOR && (dev_minor % 0x10 == 0)) {
+ dev->type = PED_DEVICE_UBD;
+ } else {
+ dev->type = PED_DEVICE_UNKNOWN;
+ }
+
+ return 1;
+}
+
+static int
+_get_linux_version ()
+{
+ static int kver = -1;
+
+ struct utsname uts;
+ int major;
+ int minor;
+ int teeny;
+
+ if (kver != -1)
+ return kver;
+
+ if (uname (&uts))
+ return kver = 0;
+ if (sscanf (uts.release, "%u.%u.%u", &major, &minor, &teeny) != 3)
+ return kver = 0;
+
+ return kver = KERNEL_VERSION (major, minor, teeny);
+}
+
+static int
+_have_devfs ()
+{
+ static int have_devfs = -1;
+ struct stat sb;
+
+ if (have_devfs != -1)
+ return have_devfs;
+
+ /* the presence of /dev/.devfsd implies that DevFS is active */
+ if (stat("/dev/.devfsd", &sb) < 0)
+ return have_devfs = 0;
+
+ return have_devfs = S_ISCHR(sb.st_mode) ? 1 : 0;
+}
+
+static void
+_device_set_sector_size (PedDevice* dev)
+{
+ LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev);
+ int sector_size;
+
+ dev->sector_size = PED_SECTOR_SIZE_DEFAULT;
+ dev->phys_sector_size = PED_SECTOR_SIZE_DEFAULT;
+
+ PED_ASSERT (dev->open_count, return);
+
+ if (_get_linux_version() < KERNEL_VERSION (2,3,0)) {
+ dev->sector_size = PED_SECTOR_SIZE_DEFAULT;
+ return;
+ }
+
+ if (ioctl (arch_specific->fd, BLKSSZGET, &sector_size)) {
+ ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_OK,
+ _("Could not determine sector size for %s: %s.\n"
+ "Using the default sector size (%lld)."),
+ dev->path, strerror (errno), PED_SECTOR_SIZE_DEFAULT);
+ } else {
+ dev->sector_size = (long long)sector_size;
+ }
+
+ /* Return PED_SECTOR_SIZE_DEFAULT for DASDs. */
+ if (dev->type == PED_DEVICE_DASD) {
+ dev->sector_size = PED_SECTOR_SIZE_DEFAULT;
+ }
+
+ if (dev->sector_size != PED_SECTOR_SIZE_DEFAULT) {
+ ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_OK,
+ _("Device %s has a logical sector size of %lld. Not "
+ "all parts of GNU Parted support this at the moment, "
+ "and the working code is HIGHLY EXPERIMENTAL.\n"),
+ dev->path, dev->sector_size);
+ }
+}
+
+static int
+_kernel_has_blkgetsize64(void)
+{
+ int version = _get_linux_version();
+
+ if (version >= KERNEL_VERSION (2,5,4)) return 1;
+ if (version < KERNEL_VERSION (2,5,0) &&
+ version >= KERNEL_VERSION (2,4,18)) return 1;
+ return 0;
+}
+
+/* TODO: do a binary search if BLKGETSIZE doesn't work?! */
+static PedSector
+_device_get_length (PedDevice* dev)
+{
+ unsigned long size;
+ LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev);
+ uint64_t bytes=0;
+
+
+ PED_ASSERT (dev->open_count > 0, return 0);
+ PED_ASSERT (dev->sector_size % 512 == 0, return 0);
+
+ if (_kernel_has_blkgetsize64()) {
+ if (ioctl(arch_specific->fd, BLKGETSIZE64, &bytes) == 0) {
+ return bytes / dev->sector_size;
+ }
+ }
+
+ if (ioctl (arch_specific->fd, BLKGETSIZE, &size)) {
+ ped_exception_throw (
+ PED_EXCEPTION_BUG,
+ PED_EXCEPTION_CANCEL,
+ _("Unable to determine the size of %s (%s)."),
+ dev->path,
+ strerror (errno));
+ return 0;
+ }
+
+ return size;
+}
+
+static int
+_device_probe_geometry (PedDevice* dev)
+{
+ LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev);
+ struct stat dev_stat;
+ struct hd_geometry geometry;
+
+ if (!_device_stat (dev, &dev_stat))
+ return 0;
+ PED_ASSERT (S_ISBLK (dev_stat.st_mode), return 0);
+
+ _device_set_sector_size (dev);
+
+ dev->length = _device_get_length (dev);
+ if (!dev->length)
+ return 0;
+
+ /* The GETGEO ioctl is no longer useful (as of linux 2.6.x). We could
+ * still use it in 2.4.x, but this is contentious. Perhaps we should
+ * move to EDD. */
+ dev->bios_geom.sectors = 63;
+ dev->bios_geom.heads = 255;
+ dev->bios_geom.cylinders
+ = dev->length / (63 * 255);
+
+ /* FIXME: what should we put here? (TODO: discuss on linux-kernel) */
+ if (!ioctl (arch_specific->fd, HDIO_GETGEO, &geometry)
+ && geometry.sectors && geometry.heads) {
+ dev->hw_geom.sectors = geometry.sectors;
+ dev->hw_geom.heads = geometry.heads;
+ dev->hw_geom.cylinders
+ = dev->length / (dev->hw_geom.heads
+ * dev->hw_geom.sectors);
+ } else {
+ dev->hw_geom = dev->bios_geom;
+ }
+
+ return 1;
+}
+
+static char*
+strip_name(char* str)
+{
+ int i;
+ int end = 0;
+
+ for (i = 0; str[i] != 0; i++) {
+ if (!isspace (str[i])
+ || (isspace (str[i]) && !isspace (str[i+1]) && str[i+1])) {
+ str [end] = str[i];
+ end++;
+ }
+ }
+ str[end] = 0;
+ return strdup (str);
+}
+
+static int
+init_ide (PedDevice* dev)
+{
+ LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev);
+ struct stat dev_stat;
+ int dev_major;
+ struct hd_driveid hdi;
+ PedExceptionOption ex_status;
+ char hdi_buf[41];
+ int sector_multiplier = 0;
+
+ if (!_device_stat (dev, &dev_stat))
+ goto error;
+
+ dev_major = major (dev_stat.st_rdev);
+
+ if (!ped_device_open (dev))
+ goto error;
+
+ if (ioctl (arch_specific->fd, HDIO_GET_IDENTITY, &hdi)) {
+ ex_status = ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("Could not get identity of device %s - %s"),
+ dev->path, strerror (errno));
+ switch (ex_status) {
+ case PED_EXCEPTION_CANCEL:
+ goto error_close_dev;
+
+ case PED_EXCEPTION_UNHANDLED:
+ ped_exception_catch ();
+ case PED_EXCEPTION_IGNORE:
+ dev->model = strdup(_("Generic IDE"));
+ }
+ } else {
+ /* hdi.model is not guaranteed to be NULL terminated */
+ memcpy (hdi_buf, hdi.model, 40);
+ hdi_buf[40] = '\0';
+ dev->model = strip_name (hdi_buf);
+
+ if (!hdi.ata7_sectinfo.valid1 && hdi.ata7_sectinfo.valid2)
+ sector_multiplier = hdi.ata7_sectinfo.multiplier;
+ else
+ sector_multiplier = 1;
+
+ if (sector_multiplier != 1) {
+ ex_status = ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("Device %s has multiple (%d) logical sectors "
+ "per physical sector.\n"
+ "GNU Parted supports this EXPERIMENTALLY for "
+ "some special disk label/file system "
+ "combinations, e.g. GPT and ext2/3.\n"
+ "Please consult the web site for up-to-date "
+ "information."),
+ dev->path, sector_multiplier);
+
+ switch (ex_status) {
+ case PED_EXCEPTION_CANCEL:
+ goto error_close_dev;
+
+ case PED_EXCEPTION_UNHANDLED:
+ ped_exception_catch ();
+ case PED_EXCEPTION_IGNORE:
+ ;
+ }
+ }
+
+ /* XXX sector_size has not been set yet! */
+ /* dev->phys_sector_size = dev->sector_size
+ * sector_multiplier;*/
+ dev->phys_sector_size = PED_SECTOR_SIZE_DEFAULT;
+ }
+
+ if (!_device_probe_geometry (dev))
+ goto error_close_dev;
+
+ ped_device_close (dev);
+ return 1;
+
+error_close_dev:
+ ped_device_close (dev);
+error:
+ return 0;
+}
+
+/* This function reads the /sys entry named "file" for device "dev". */
+static char *
+read_device_sysfs_file (PedDevice *dev, const char *file)
+{
+ FILE *f;
+ char name_buf[128];
+ char buf[256];
+
+ snprintf (name_buf, 127, "/sys/block/%s/device/%s",
+ basename (dev->path), file);
+
+ if ((f = fopen (name_buf, "r")) == NULL)
+ return NULL;
+
+ fgets (buf, 255, f);
+ fclose (f);
+ return strip_name (buf);
+}
+
+/* This function sends a query to a SCSI device for vendor and product
+ * information. It uses the deprecated SCSI_IOCTL_SEND_COMMAND to
+ * issue this query.
+ */
+static int
+scsi_query_product_info (PedDevice* dev, char **vendor, char **product)
+{
+ /* The following are defined by the SCSI-2 specification. */
+ typedef struct _scsi_inquiry_cmd
+ {
+ uint8_t op;
+ uint8_t lun; /* bits 5-7 denote the LUN */
+ uint8_t page_code;
+ uint8_t reserved;
+ uint8_t alloc_length;
+ uint8_t control;
+ } __attribute__((packed)) scsi_inquiry_cmd_t;
+
+ typedef struct _scsi_inquiry_data
+ {
+ uint8_t peripheral_info;
+ uint8_t device_info;
+ uint8_t version_info;
+ uint8_t _field1;
+ uint8_t additional_length;
+ uint8_t _reserved1;
+ uint8_t _reserved2;
+ uint8_t _field2;
+ uint8_t vendor_id[8];
+ uint8_t product_id[16];
+ uint8_t product_revision[4];
+ uint8_t vendor_specific[20];
+ uint8_t _reserved3[40];
+ } __attribute__((packed)) scsi_inquiry_data_t;
+
+ struct scsi_arg
+ {
+ unsigned int inlen;
+ unsigned int outlen;
+
+ union arg_data
+ {
+ scsi_inquiry_data_t out;
+ scsi_inquiry_cmd_t in;
+ } data;
+ } arg;
+
+ LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev);
+ char buf[32];
+
+ *vendor = NULL;
+ *product = NULL;
+
+ memset (&arg, 0x00, sizeof(struct scsi_arg));
+ arg.inlen = 0;
+ arg.outlen = sizeof(scsi_inquiry_data_t);
+ arg.data.in.op = INQUIRY;
+ arg.data.in.lun = dev->host << 5;
+ arg.data.in.alloc_length = sizeof(scsi_inquiry_data_t);
+ arg.data.in.page_code = 0;
+ arg.data.in.reserved = 0;
+ arg.data.in.control = 0;
+
+ if (ioctl (arch_specific->fd, SCSI_IOCTL_SEND_COMMAND, &arg) < 0)
+ return 0;
+
+ memcpy (buf, arg.data.out.vendor_id, 8);
+ buf[8] = '\0';
+ *vendor = strip_name (buf);
+
+ memcpy (buf, arg.data.out.product_id, 16);
+ buf[16] = '\0';
+ *product = strip_name (buf);
+
+ return 1;
+}
+
+/* This function provides the vendor and product name for a SCSI device.
+ * It supports both the modern /sys interface and direct queries
+ * via the deprecated ioctl, SCSI_IOCTL_SEND_COMMAND.
+ */
+static int
+scsi_get_product_info (PedDevice* dev, char **vendor, char **product)
+{
+ *vendor = read_device_sysfs_file (dev, "vendor");
+ *product = read_device_sysfs_file (dev, "model");
+ if (*vendor && *product)
+ return 1;
+
+ return scsi_query_product_info (dev, vendor, product);
+}
+
+static int
+init_scsi (PedDevice* dev)
+{
+ struct scsi_idlun
+ {
+ uint32_t dev_id;
+ uint32_t host_unique_id;
+ } idlun;
+
+ LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev);
+ char* vendor;
+ char* product;
+
+ if (!ped_device_open (dev))
+ goto error;
+
+ if (ioctl (arch_specific->fd, SCSI_IOCTL_GET_IDLUN, &idlun) < 0) {
+ dev->host = 0;
+ dev->did = 0;
+ if (ped_exception_throw (
+ PED_EXCEPTION_ERROR, PED_EXCEPTION_IGNORE_CANCEL,
+ _("Error initialising SCSI device %s - %s"),
+ dev->path, strerror (errno))
+ != PED_EXCEPTION_IGNORE)
+ goto error_close_dev;
+ if (!_device_probe_geometry (dev))
+ goto error_close_dev;
+ ped_device_close (dev);
+ return 1;
+ }
+
+ dev->host = idlun.host_unique_id;
+ dev->did = idlun.dev_id;
+
+ dev->model = (char*) ped_malloc (8 + 16 + 2);
+ if (!dev->model)
+ goto error_close_dev;
+
+ if (scsi_get_product_info (dev, &vendor, &product)) {
+ sprintf (dev->model, "%.8s %.16s", vendor, product);
+ ped_free (vendor);
+ ped_free (product);
+ } else {
+ strcpy (dev->model, "Generic SCSI");
+ }
+
+ if (!_device_probe_geometry (dev))
+ goto error_close_dev;
+
+ ped_device_close (dev);
+ return 1;
+
+error_close_dev:
+ ped_device_close (dev);
+error:
+ return 0;
+}
+
+static int
+init_file (PedDevice* dev)
+{
+ struct stat dev_stat;
+
+ if (!_device_stat (dev, &dev_stat))
+ goto error;
+ if (!ped_device_open (dev))
+ goto error;
+
+ if (S_ISBLK(dev_stat.st_mode))
+ dev->length = _device_get_length (dev);
+ else
+ dev->length = dev_stat.st_size / 512;
+ if (dev->length <= 0) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("The device %s has zero length, and can't possibly "
+ "store a file system or partition table. Perhaps "
+ "you selected the wrong device?"),
+ dev->path);
+ goto error_close_dev;
+ }
+
+ ped_device_close (dev);
+
+ dev->bios_geom.cylinders = dev->length / 4 / 32;
+ dev->bios_geom.heads = 4;
+ dev->bios_geom.sectors = 32;
+ dev->hw_geom = dev->bios_geom;
+ dev->sector_size = PED_SECTOR_SIZE_DEFAULT;
+ dev->phys_sector_size = PED_SECTOR_SIZE_DEFAULT;
+ dev->model = strdup ("");
+
+ return 1;
+
+error_close_dev:
+ ped_device_close (dev);
+error:
+ return 0;
+}
+
+static int
+init_dasd (PedDevice* dev, char* model_name)
+{
+ struct stat dev_stat;
+ PedExceptionOption ex_status;
+ dasd_information_t dasd_info;
+ struct hd_geometry geo;
+ int f, blksize = 0;
+ char *errstr = 0;
+
+ if (!_device_stat (dev, &dev_stat))
+ goto error;
+
+ if (!ped_device_open (dev))
+ goto error;
+
+ LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev);
+
+ PED_ASSERT (S_ISBLK (dev_stat.st_mode), return 0);
+
+ _device_set_sector_size (dev);
+ if (!dev->sector_size)
+ goto error_close_dev;
+
+ dev->length = _device_get_length (dev);
+ if (!dev->length)
+ goto error_close_dev;
+
+ if (!ioctl (arch_specific->fd, HDIO_GETGEO, &geo)) {
+ dev->hw_geom.sectors = geo.sectors;
+ dev->hw_geom.heads = geo.heads;
+ dev->hw_geom.cylinders = dev->length
+ / (dev->hw_geom.heads * dev->hw_geom.sectors)
+ / (dev->sector_size / PED_SECTOR_SIZE_DEFAULT);
+ dev->bios_geom = dev->hw_geom;
+ } else {
+ dev->bios_geom.sectors = 12;
+ dev->bios_geom.heads = 15;
+ dev->bios_geom.cylinders = dev->length
+ / (dev->hw_geom.heads * dev->hw_geom.sectors)
+ / (dev->sector_size / PED_SECTOR_SIZE_DEFAULT);
+ dev->hw_geom = dev->bios_geom;
+ }
+
+ dev->model = strdup (model_name);
+
+ ped_device_close (dev);
+ return 1;
+
+except:
+ ped_exception_throw ( PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ errstr );
+
+error_close_dev:
+ ped_device_close (dev);
+error:
+ return 0;
+}
+
+static int
+init_generic (PedDevice* dev, char* model_name)
+{
+ struct stat dev_stat;
+ PedExceptionOption ex_status;
+
+ if (!_device_stat (dev, &dev_stat))
+ goto error;
+
+ if (!ped_device_open (dev))
+ goto error;
+
+ ped_exception_fetch_all ();
+ if (_device_probe_geometry (dev)) {
+ ped_exception_leave_all ();
+ } else {
+ /* hack to allow use of files, for testing */
+ ped_exception_catch ();
+ ped_exception_leave_all ();
+
+ ex_status = ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("Unable to determine geometry of "
+ "file/device %s. You should not use Parted "
+ "unless you REALLY know what you're doing!"),
+ dev->path);
+ switch (ex_status) {
+ case PED_EXCEPTION_CANCEL:
+ goto error_close_dev;
+
+ case PED_EXCEPTION_UNHANDLED:
+ ped_exception_catch ();
+ case PED_EXCEPTION_IGNORE:
+ ; // just workaround for gcc 3.0
+ }
+
+ /* what should we stick in here? */
+ dev->length = dev_stat.st_size / PED_SECTOR_SIZE_DEFAULT;
+ dev->bios_geom.cylinders = dev->length / 4 / 32;
+ dev->bios_geom.heads = 4;
+ dev->bios_geom.sectors = 32;
+ dev->sector_size = PED_SECTOR_SIZE_DEFAULT;
+ dev->phys_sector_size = PED_SECTOR_SIZE_DEFAULT;
+ }
+
+ dev->model = strdup (model_name);
+
+ ped_device_close (dev);
+ return 1;
+
+error_close_dev:
+ ped_device_close (dev);
+error:
+ return 0;
+}
+
+static PedDevice*
+linux_new (const char* path)
+{
+ PedDevice* dev;
+
+ PED_ASSERT (path != NULL, return NULL);
+
+ dev = (PedDevice*) ped_malloc (sizeof (PedDevice));
+ if (!dev)
+ goto error;
+
+ dev->path = strdup (path);
+ if (!dev->path)
+ goto error_free_dev;
+
+ dev->arch_specific
+ = (LinuxSpecific*) ped_malloc (sizeof (LinuxSpecific));
+ if (!dev->arch_specific)
+ goto error_free_path;
+
+ dev->open_count = 0;
+ dev->read_only = 0;
+ dev->external_mode = 0;
+ dev->dirty = 0;
+ dev->boot_dirty = 0;
+
+ if (!_device_probe_type (dev))
+ goto error_free_arch_specific;
+
+ switch (dev->type) {
+ case PED_DEVICE_IDE:
+ if (!init_ide (dev))
+ goto error_free_arch_specific;
+ break;
+
+ case PED_DEVICE_SCSI:
+ if (!init_scsi (dev))
+ goto error_free_arch_specific;
+ break;
+
+ case PED_DEVICE_DAC960:
+ if (!init_generic (dev, _("DAC960 RAID controller")))
+ goto error_free_arch_specific;
+ break;
+
+ case PED_DEVICE_SX8:
+ if (!init_generic (dev, _("Promise SX8 SATA Device")))
+ goto error_free_arch_specific;
+ break;
+
+ case PED_DEVICE_DASD:
+ if (!init_dasd (dev, _("IBM S390 DASD drive")))
+ goto error_free_arch_specific;
+ break;
+
+ case PED_DEVICE_VIODASD:
+ if (!init_generic (dev, _("IBM iSeries Virtual DASD")))
+ goto error_free_arch_specific;
+ break;
+
+ case PED_DEVICE_CPQARRAY:
+ if (!init_generic (dev, _("Compaq Smart Array")))
+ goto error_free_arch_specific;
+ break;
+
+ case PED_DEVICE_ATARAID:
+ if (!init_generic (dev, _("ATARAID Controller")))
+ goto error_free_arch_specific;
+ break;
+
+ case PED_DEVICE_I2O:
+ if (!init_generic (dev, _("I2O Controller")))
+ goto error_free_arch_specific;
+ break;
+
+ case PED_DEVICE_UBD:
+ if (!init_generic (dev, _("User-Mode Linux UBD")))
+ goto error_free_dev;
+ break;
+
+ case PED_DEVICE_FILE:
+ if (!init_file (dev))
+ goto error_free_arch_specific;
+ break;
+
+ case PED_DEVICE_UNKNOWN:
+ if (!init_generic (dev, _("Unknown")))
+ goto error_free_arch_specific;
+ break;
+
+ default:
+ ped_exception_throw (PED_EXCEPTION_NO_FEATURE,
+ PED_EXCEPTION_CANCEL,
+ _("ped_device_new() Unsupported device type"));
+ goto error_free_arch_specific;
+ }
+ return dev;
+
+error_free_arch_specific:
+ ped_free (dev->arch_specific);
+error_free_path:
+ ped_free (dev->path);
+error_free_dev:
+ ped_free (dev);
+error:
+ return NULL;
+}
+
+static void
+linux_destroy (PedDevice* dev)
+{
+ ped_free (dev->arch_specific);
+ ped_free (dev->path);
+ ped_free (dev->model);
+ ped_free (dev);
+}
+
+static int
+linux_is_busy (PedDevice* dev)
+{
+ int i;
+ char* part_name;
+
+ if (_partition_is_mounted_by_path (dev->path))
+ return 1;
+
+ for (i = 0; i < 32; i++) {
+ int status;
+
+ part_name = _device_get_part_path (dev, i);
+ if (!part_name)
+ return 1;
+ status = _partition_is_mounted_by_path (part_name);
+ ped_free (part_name);
+
+ if (status)
+ return 1;
+ }
+
+ return 0;
+}
+
+/* we need to flush the master device, and all the partition devices,
+ * because there is no coherency between the caches.
+ * We should only flush unmounted partition devices, because:
+ * - there is never a need to flush them (we're not doing IO there)
+ * - flushing a device that is mounted causes unnecessary IO, and can
+ * even screw journaling & friends up. Even cause oopsen!
+ */
+static void
+_flush_cache (PedDevice* dev)
+{
+ LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev);
+ int i;
+
+ if (dev->read_only)
+ return;
+ dev->dirty = 0;
+
+ ioctl (arch_specific->fd, BLKFLSBUF);
+
+ for (i = 1; i < 16; i++) {
+ char* name;
+ int fd;
+
+ name = _device_get_part_path (dev, i);
+ if (!name)
+ break;
+ if (!_partition_is_mounted_by_path (name)) {
+ fd = open (name, WR_MODE, 0);
+ if (fd > 0) {
+ ioctl (fd, BLKFLSBUF);
+ close (fd);
+ }
+ }
+ ped_free (name);
+ }
+}
+
+static int
+linux_open (PedDevice* dev)
+{
+ LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev);
+
+retry:
+ arch_specific->fd = open (dev->path, RW_MODE);
+
+ if (arch_specific->fd == -1) {
+ char* rw_error_msg = strerror (errno);
+
+ arch_specific->fd = open (dev->path, RD_MODE);
+
+ if (arch_specific->fd == -1) {
+ if (ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_RETRY_CANCEL,
+ _("Error opening %s: %s"),
+ dev->path, strerror (errno))
+ != PED_EXCEPTION_RETRY) {
+ return 0;
+ } else {
+ goto retry;
+ }
+ } else {
+ ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_OK,
+ _("Unable to open %s read-write (%s). %s has "
+ "been opened read-only."),
+ dev->path, rw_error_msg, dev->path);
+ dev->read_only = 1;
+ }
+ } else {
+ dev->read_only = 0;
+ }
+
+ _flush_cache (dev);
+
+ return 1;
+}
+
+static int
+linux_refresh_open (PedDevice* dev)
+{
+ return 1;
+}
+
+static int
+linux_close (PedDevice* dev)
+{
+ LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev);
+
+ if (dev->dirty)
+ _flush_cache (dev);
+ close (arch_specific->fd);
+ return 1;
+}
+
+static int
+linux_refresh_close (PedDevice* dev)
+{
+ if (dev->dirty)
+ _flush_cache (dev);
+ return 1;
+}
+
+#if SIZEOF_OFF_T < 8
+
+static _syscall5(int,_llseek,
+ unsigned int, fd,
+ unsigned long, offset_high,
+ unsigned long, offset_low,
+ loff_t*, result,
+ unsigned int, origin)
+
+loff_t
+llseek (unsigned int fd, loff_t offset, unsigned int whence)
+{
+ loff_t result;
+ int retval;
+
+ retval = _llseek(fd,
+ ((unsigned long long)offset) >> 32,
+ ((unsigned long long)offset) & 0xffffffff,
+ &result,
+ whence);
+ return (retval==-1 ? (loff_t) retval : result);
+}
+
+#endif /* SIZEOF_OFF_T < 8 */
+
+static int
+_device_seek (const PedDevice* dev, PedSector sector)
+{
+ LinuxSpecific* arch_specific;
+
+ PED_ASSERT (dev->sector_size % 512 == 0, return 0);
+ PED_ASSERT (dev != NULL, return 0);
+ PED_ASSERT (!dev->external_mode, return 0);
+
+ arch_specific = LINUX_SPECIFIC (dev);
+
+#if SIZEOF_OFF_T < 8
+ if (sizeof (off_t) < 8) {
+ loff_t pos = (loff_t)(sector * dev->sector_size);
+ return llseek (arch_specific->fd, pos, SEEK_SET) == pos;
+ } else
+#endif
+ {
+ off_t pos = sector * dev->sector_size;
+ return lseek (arch_specific->fd, pos, SEEK_SET) == pos;
+ }
+}
+
+static int
+_read_lastoddsector (const PedDevice* dev, void* buffer)
+{
+ LinuxSpecific* arch_specific;
+ struct blkdev_ioctl_param ioctl_param;
+
+ PED_ASSERT(dev != NULL, return 0);
+ PED_ASSERT(buffer != NULL, return 0);
+
+ arch_specific = LINUX_SPECIFIC (dev);
+
+retry:
+ ioctl_param.block = 0; /* read the last sector */
+ ioctl_param.content_length = dev->sector_size;
+ ioctl_param.block_contents = buffer;
+
+ if (ioctl(arch_specific->fd, BLKGETLASTSECT, &ioctl_param) == -1) {
+ PedExceptionOption opt;
+ opt = ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_RETRY_IGNORE_CANCEL,
+ _("%s during read on %s"),
+ strerror (errno), dev->path);
+
+ if (opt == PED_EXCEPTION_CANCEL)
+ return 0;
+ if (opt == PED_EXCEPTION_RETRY)
+ goto retry;
+ }
+
+ return 1;
+}
+
+static int
+linux_read (const PedDevice* dev, void* buffer, PedSector start,
+ PedSector count)
+{
+ LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev);
+ int status;
+ PedExceptionOption ex_status;
+ size_t read_length = count * dev->sector_size;
+ void* diobuf;
+
+ PED_ASSERT (dev->sector_size % 512 == 0, return 0);
+
+ if (_get_linux_version() < KERNEL_VERSION (2,6,0)) {
+ /* Kludge. This is necessary to read/write the last
+ block of an odd-sized disk, until Linux 2.5.x kernel fixes.
+ */
+ if (dev->type != PED_DEVICE_FILE && (dev->length & 1)
+ && start + count - 1 == dev->length - 1)
+ return ped_device_read (dev, buffer, start, count - 1)
+ && _read_lastoddsector (
+ dev, buffer + (count-1) * 512);
+ }
+ while (1) {
+ if (_device_seek (dev, start))
+ break;
+
+ ex_status = ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_RETRY_IGNORE_CANCEL,
+ _("%s during seek for read on %s"),
+ strerror (errno), dev->path);
+
+ switch (ex_status) {
+ case PED_EXCEPTION_IGNORE:
+ return 1;
+
+ case PED_EXCEPTION_RETRY:
+ break;
+
+ case PED_EXCEPTION_UNHANDLED:
+ ped_exception_catch ();
+ case PED_EXCEPTION_CANCEL:
+ return 0;
+ }
+ }
+
+
+ if (posix_memalign(&diobuf, PED_SECTOR_SIZE_DEFAULT,
+ count * PED_SECTOR_SIZE_DEFAULT) != 0)
+ return 0;
+
+ while (1) {
+ status = read (arch_specific->fd, diobuf, read_length);
+ if (status > 0)
+ memcpy(buffer, diobuf, status);
+ if (status == count * dev->sector_size) break;
+ if (status > 0) {
+ read_length -= status;
+ buffer += status;
+ continue;
+ }
+
+ ex_status = ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_RETRY_IGNORE_CANCEL,
+ _("%s during read on %s"),
+ strerror (errno),
+ dev->path);
+
+ switch (ex_status) {
+ case PED_EXCEPTION_IGNORE:
+ free(diobuf);
+ return 1;
+
+ case PED_EXCEPTION_RETRY:
+ break;
+
+ case PED_EXCEPTION_UNHANDLED:
+ ped_exception_catch ();
+ case PED_EXCEPTION_CANCEL:
+ free(diobuf);
+ return 0;
+ }
+ }
+ free(diobuf);
+
+ return 1;
+}
+
+static int
+_write_lastoddsector (PedDevice* dev, const void* buffer)
+{
+ LinuxSpecific* arch_specific;
+ struct blkdev_ioctl_param ioctl_param;
+
+ PED_ASSERT(dev != NULL, return 0);
+ PED_ASSERT(buffer != NULL, return 0);
+
+ arch_specific = LINUX_SPECIFIC (dev);
+
+retry:
+ ioctl_param.block = 0; /* write the last sector */
+ ioctl_param.content_length = dev->sector_size;
+ ioctl_param.block_contents = (void*) buffer;
+
+ if (ioctl(arch_specific->fd, BLKSETLASTSECT, &ioctl_param) == -1) {
+ PedExceptionOption opt;
+ opt = ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_RETRY_IGNORE_CANCEL,
+ _("%s during write on %s"),
+ strerror (errno), dev->path);
+
+ if (opt == PED_EXCEPTION_CANCEL)
+ return 0;
+ if (opt == PED_EXCEPTION_RETRY)
+ goto retry;
+ }
+
+ return 1;
+}
+
+static int
+linux_write (PedDevice* dev, const void* buffer, PedSector start,
+ PedSector count)
+{
+ LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev);
+ int status;
+ PedExceptionOption ex_status;
+ size_t write_length = count * dev->sector_size;
+ void* diobuf;
+ void* diobuf_start;
+
+ PED_ASSERT(dev->sector_size % 512 == 0, return 0);
+
+ if (dev->read_only) {
+ if (ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("Can't write to %s, because it is opened read-only."),
+ dev->path)
+ != PED_EXCEPTION_IGNORE)
+ return 0;
+ else
+ return 1;
+ }
+
+ if (_get_linux_version() < KERNEL_VERSION (2,6,0)) {
+ /* Kludge. This is necessary to read/write the last
+ block of an odd-sized disk, until Linux 2.5.x kernel fixes.
+ */
+ if (dev->type != PED_DEVICE_FILE && (dev->length & 1)
+ && start + count - 1 == dev->length - 1)
+ return ped_device_write (dev, buffer, start, count - 1)
+ && _write_lastoddsector (
+ dev, buffer + (count-1) * 512);
+ }
+ while (1) {
+ if (_device_seek (dev, start))
+ break;
+
+ ex_status = ped_exception_throw (
+ PED_EXCEPTION_ERROR, PED_EXCEPTION_RETRY_IGNORE_CANCEL,
+ _("%s during seek for write on %s"),
+ strerror (errno), dev->path);
+
+ switch (ex_status) {
+ case PED_EXCEPTION_IGNORE:
+ return 1;
+
+ case PED_EXCEPTION_RETRY:
+ break;
+
+ case PED_EXCEPTION_UNHANDLED:
+ ped_exception_catch ();
+ case PED_EXCEPTION_CANCEL:
+ return 0;
+ }
+ }
+
+#ifdef READ_ONLY
+ printf ("ped_device_write (\"%s\", %p, %d, %d)\n",
+ dev->path, buffer, (int) start, (int) count);
+#else
+ dev->dirty = 1;
+ if (posix_memalign(&diobuf, PED_SECTOR_SIZE_DEFAULT,
+ count * PED_SECTOR_SIZE_DEFAULT) != 0)
+ return 0;
+ memcpy(diobuf, buffer, count * PED_SECTOR_SIZE_DEFAULT);
+ diobuf_start = diobuf;
+ while (1) {
+ status = write (arch_specific->fd, diobuf, write_length);
+ if (status == count * dev->sector_size) break;
+ if (status > 0) {
+ write_length -= status;
+ diobuf += status;
+ continue;
+ }
+
+ ex_status = ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_RETRY_IGNORE_CANCEL,
+ _("%s during write on %s"),
+ strerror (errno), dev->path);
+
+ switch (ex_status) {
+ case PED_EXCEPTION_IGNORE:
+ free(diobuf_start);
+ return 1;
+
+ case PED_EXCEPTION_RETRY:
+ break;
+
+ case PED_EXCEPTION_UNHANDLED:
+ ped_exception_catch ();
+ case PED_EXCEPTION_CANCEL:
+ free(diobuf_start);
+ return 0;
+ }
+ }
+ free(diobuf_start);
+#endif /* !READ_ONLY */
+ return 1;
+}
+
+/* returns the number of sectors that are ok.
+ */
+static PedSector
+linux_check (PedDevice* dev, void* buffer, PedSector start, PedSector count)
+{
+ LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev);
+ PedSector done = 0;
+ int status;
+ void* diobuf;
+
+ PED_ASSERT(dev != NULL, return 0);
+
+ if (!_device_seek (dev, start))
+ return 0;
+
+ if (posix_memalign(&diobuf, PED_SECTOR_SIZE_DEFAULT,
+ count * PED_SECTOR_SIZE_DEFAULT) != 0)
+ return 0;
+
+ for (done = 0; done < count; done += status / dev->sector_size) {
+ status = read (arch_specific->fd, diobuf,
+ (size_t) ((count-done) * dev->sector_size));
+ if (status > 0)
+ memcpy(buffer, diobuf, status);
+ if (status < 0)
+ break;
+ }
+ free(diobuf);
+
+ return done;
+}
+
+static int
+_do_fsync (PedDevice* dev)
+{
+ LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev);
+ int status;
+ PedExceptionOption ex_status;
+
+ while (1) {
+ status = fsync (arch_specific->fd);
+ if (status >= 0) break;
+
+ ex_status = ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_RETRY_IGNORE_CANCEL,
+ _("%s during write on %s"),
+ strerror (errno), dev->path);
+
+ switch (ex_status) {
+ case PED_EXCEPTION_IGNORE:
+ return 1;
+
+ case PED_EXCEPTION_RETRY:
+ break;
+
+ case PED_EXCEPTION_UNHANDLED:
+ ped_exception_catch ();
+ case PED_EXCEPTION_CANCEL:
+ return 0;
+ }
+ }
+ return 1;
+}
+
+static int
+linux_sync (PedDevice* dev)
+{
+ PED_ASSERT (dev != NULL, return 0);
+ PED_ASSERT (!dev->external_mode, return 0);
+
+ if (dev->read_only)
+ return 1;
+ if (!_do_fsync (dev))
+ return 0;
+ _flush_cache (dev);
+ return 1;
+}
+
+static int
+linux_sync_fast (PedDevice* dev)
+{
+ PED_ASSERT (dev != NULL, return 0);
+ PED_ASSERT (!dev->external_mode, return 0);
+
+ if (dev->read_only)
+ return 1;
+ if (!_do_fsync (dev))
+ return 0;
+ /* no cache flush... */
+ return 1;
+}
+
+static inline int
+_compare_digit_state (char ch, int need_digit)
+{
+ return !!isdigit (ch) == need_digit;
+}
+
+/* matches the regexp "[^0-9]+[0-9]+[^0-9]+[0-9]+$".
+ * Motivation: accept devices looking like /dev/rd/c0d0, but
+ * not looking like /dev/hda1 and /dev/rd/c0d0p1
+ */
+static int
+_match_rd_device (const char* name)
+{
+ const char* pos;
+ int state;
+
+ /* exclude directory names from test */
+ pos = strrchr(name, '/') ?: name;
+
+ /* states:
+ * 0 non-digits
+ * 1 digits
+ * 2 non-digits
+ * 3 digits
+ */
+ for (state = 0; state < 4; state++) {
+ int want_digits = (state % 2 == 1);
+ do {
+ if (!*pos)
+ return 0;
+ if (!_compare_digit_state (*pos, want_digits))
+ return 0;
+ pos++;
+ } while (_compare_digit_state (*pos, want_digits));
+ }
+
+ return *pos == 0;
+}
+
+static int
+_probe_proc_partitions ()
+{
+ FILE* proc_part_file;
+ int major, minor, size;
+ char buf [512];
+ char part_name [256];
+ char dev_name [256];
+
+ proc_part_file = fopen ("/proc/partitions", "r");
+ if (!proc_part_file)
+ return 0;
+
+ fgets (buf, 256, proc_part_file);
+ fgets (buf, 256, proc_part_file);
+
+ while (fgets (buf, 512, proc_part_file)
+ && sscanf (buf, "%d %d %d %255s", &major, &minor, &size,
+ part_name) == 4) {
+ /* Heuristic for telling partitions and devices apart
+ * Probably needs to be improved
+ */
+ if (!_match_rd_device (part_name)
+ && isdigit (part_name [strlen (part_name) - 1]))
+ continue;
+
+ strcpy (dev_name, "/dev/");
+ strcat (dev_name, part_name);
+ _ped_device_probe (dev_name);
+ }
+
+ fclose (proc_part_file);
+ return 1;
+}
+
+struct _entry {
+ const char *name;
+ size_t len;
+};
+
+static int
+_skip_entry (const char *name)
+{
+ struct _entry *i;
+ static struct _entry entries[] = {
+ { ".", sizeof (".") - 1 },
+ { "..", sizeof ("..") - 1 },
+ { "dm-", sizeof ("dm-") - 1 },
+ { "loop", sizeof ("loop") - 1 },
+ { "ram", sizeof ("ram") - 1 },
+ { 0, 0 },
+ };
+
+ for (i = entries; i->name != 0; i++) {
+ if (strncmp (name, i->name, i->len) == 0)
+ return 1;
+ }
+
+ return 0;
+}
+
+static int
+_probe_sys_block ()
+{
+ DIR *blockdir;
+ struct dirent *dirent;
+ char dev_name [256];
+ char *ptr;
+
+ if (!(blockdir = opendir ("/sys/block")))
+ return 0;
+ while ((dirent = readdir (blockdir))) {
+ if (_skip_entry (dirent->d_name))
+ continue;
+
+ if (strlen (dirent->d_name) > sizeof (dev_name) - 6)
+ continue; /* device name too long! */
+
+ strcpy (dev_name, "/dev/");
+ strcat (dev_name, dirent->d_name);
+ /* in /sys/block, '/'s are replaced with '!' or '.' */
+ for (ptr = dev_name; *ptr != '\0'; ptr++) {
+ if (*ptr == '!' || *ptr == '.')
+ *ptr = '/';
+ }
+ _ped_device_probe (dev_name);
+ }
+
+ closedir (blockdir);
+ return 1;
+}
+
+static int
+_probe_standard_devices ()
+{
+ _ped_device_probe ("/dev/hda");
+ _ped_device_probe ("/dev/hdb");
+ _ped_device_probe ("/dev/hdc");
+ _ped_device_probe ("/dev/hdd");
+ _ped_device_probe ("/dev/hde");
+ _ped_device_probe ("/dev/hdf");
+ _ped_device_probe ("/dev/hdg");
+ _ped_device_probe ("/dev/hdh");
+
+ _ped_device_probe ("/dev/sda");
+ _ped_device_probe ("/dev/sdb");
+ _ped_device_probe ("/dev/sdc");
+ _ped_device_probe ("/dev/sdd");
+ _ped_device_probe ("/dev/sde");
+ _ped_device_probe ("/dev/sdf");
+
+ return 1;
+}
+
+static void
+linux_probe_all ()
+{
+ /* we should probe the standard devs too, even with /proc/partitions,
+ * because /proc/partitions might return devfs stuff, and we might not
+ * have devfs available
+ */
+ _probe_standard_devices ();
+
+ /* /sys/block is more reliable and consistent; fall back to using
+ * /proc/partitions if the former is unavailable, however.
+ */
+ if (!_probe_sys_block ())
+ _probe_proc_partitions ();
+}
+
+static char*
+_device_get_part_path (PedDevice* dev, int num)
+{
+ int path_len = strlen (dev->path);
+ int result_len = path_len + 16;
+ char* result;
+
+ result = (char*) ped_malloc (result_len);
+ if (!result)
+ return NULL;
+
+ /* Check for devfs-style /disc => /partN transformation
+ unconditionally; the system might be using udev with devfs rules,
+ and if not the test is harmless. */
+ if (!strcmp (dev->path + path_len - 5, "/disc")) {
+ /* replace /disc with /path%d */
+ strcpy (result, dev->path);
+ snprintf (result + path_len - 5, 16, "/part%d", num);
+ } else if (dev->type == PED_DEVICE_DAC960
+ || dev->type == PED_DEVICE_CPQARRAY
+ || dev->type == PED_DEVICE_ATARAID
+ || isdigit (dev->path[path_len - 1]))
+ snprintf (result, result_len, "%sp%d", dev->path, num);
+ else
+ snprintf (result, result_len, "%s%d", dev->path, num);
+
+ return result;
+}
+
+static char*
+linux_partition_get_path (const PedPartition* part)
+{
+ return _device_get_part_path (part->disk->dev, part->num);
+}
+
+static dev_t
+_partition_get_part_dev (const PedPartition* part)
+{
+ struct stat dev_stat;
+ int dev_major, dev_minor;
+
+ if (!_device_stat (part->disk->dev, &dev_stat))
+ return (dev_t)0;
+ dev_major = major (dev_stat.st_rdev);
+ dev_minor = minor (dev_stat.st_rdev);
+ return (dev_t)makedev (dev_major, dev_minor + part->num);
+}
+
+static int
+_mount_table_search (const char* file_name, dev_t dev)
+{
+ struct stat part_stat;
+ char line[512];
+ char part_name[512];
+ FILE* file;
+ int junk;
+
+ file = fopen (file_name, "r");
+ if (!file)
+ return 0;
+ while (fgets (line, 512, file)) {
+ junk = sscanf (line, "%s", part_name);
+ if (stat (part_name, &part_stat) == 0) {
+ if (part_stat.st_rdev == dev) {
+ fclose (file);
+ return 1;
+ }
+ }
+ }
+ fclose (file);
+ return 0;
+}
+
+static int
+_partition_is_mounted_by_dev (dev_t dev)
+{
+ return _mount_table_search( "/proc/mounts", dev)
+ || _mount_table_search( "/proc/swaps", dev)
+ || _mount_table_search( "/etc/mtab", dev);
+}
+
+static int
+_partition_is_mounted_by_path (const char *path)
+{
+ struct stat part_stat;
+ if (stat (path, &part_stat) != 0)
+ return 0;
+ if (!S_ISBLK(part_stat.st_mode))
+ return 0;
+ return _partition_is_mounted_by_dev (part_stat.st_rdev);
+}
+
+static int
+_partition_is_mounted (const PedPartition *part)
+{
+ dev_t dev;
+ if (!ped_partition_is_active (part))
+ return 0;
+ dev = _partition_get_part_dev (part);
+ return _partition_is_mounted_by_dev (dev);
+}
+
+static int
+linux_partition_is_busy (const PedPartition* part)
+{
+ PedPartition* walk;
+
+ PED_ASSERT (part != NULL, return 0);
+
+ if (_partition_is_mounted (part))
+ return 1;
+ if (part->type == PED_PARTITION_EXTENDED) {
+ for (walk = part->part_list; walk; walk = walk->next) {
+ if (linux_partition_is_busy (walk))
+ return 1;
+ }
+ }
+ return 0;
+}
+
+static int
+_blkpg_part_command (PedDevice* dev, struct blkpg_partition* part, int op)
+{
+ LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev);
+ struct blkpg_ioctl_arg ioctl_arg;
+
+ ioctl_arg.op = op;
+ ioctl_arg.flags = 0;
+ ioctl_arg.datalen = sizeof (struct blkpg_partition);
+ ioctl_arg.data = (void*) part;
+
+ return ioctl (arch_specific->fd, BLKPG, &ioctl_arg) == 0;
+}
+
+static int
+_blkpg_add_partition (PedDisk* disk, PedPartition* part)
+{
+ struct blkpg_partition linux_part;
+ const char* vol_name;
+ char* dev_name;
+
+ PED_ASSERT(disk != NULL, return 0);
+ PED_ASSERT(disk->dev->sector_size % 512 == 0, return 0);
+
+ if (ped_disk_type_check_feature (disk->type,
+ PED_DISK_TYPE_PARTITION_NAME))
+ vol_name = ped_partition_get_name (part);
+ else
+ vol_name = NULL;
+
+ dev_name = _device_get_part_path (disk->dev, part->num);
+ if (!dev_name)
+ return 0;
+
+ memset (&linux_part, 0, sizeof (linux_part));
+ linux_part.start = part->geom.start * disk->dev->sector_size;
+ linux_part.length = part->geom.length * disk->dev->sector_size;
+ linux_part.pno = part->num;
+ strncpy (linux_part.devname, dev_name, BLKPG_DEVNAMELTH);
+ if (vol_name)
+ strncpy (linux_part.volname, vol_name, BLKPG_VOLNAMELTH);
+
+ ped_free (dev_name);
+
+ if (!_blkpg_part_command (disk->dev, &linux_part,
+ BLKPG_ADD_PARTITION)) {
+ return ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("Error informing the kernel about modifications to "
+ "partition %s -- %s. This means Linux won't know "
+ "about any changes you made to %s until you reboot "
+ "-- so you shouldn't mount it or use it in any way "
+ "before rebooting."),
+ linux_part.devname,
+ strerror (errno),
+ linux_part.devname)
+ == PED_EXCEPTION_IGNORE;
+ }
+
+ return 1;
+}
+
+static int
+_blkpg_remove_partition (PedDisk* disk, int n)
+{
+ struct blkpg_partition linux_part;
+
+ memset (&linux_part, 0, sizeof (linux_part));
+ linux_part.pno = n;
+ return _blkpg_part_command (disk->dev, &linux_part,
+ BLKPG_DEL_PARTITION);
+}
+
+static int
+_disk_sync_part_table (PedDisk* disk)
+{
+ int i;
+ int last = PED_MAX (ped_disk_get_last_partition_num (disk), 16);
+ int* rets = ped_malloc(sizeof(int) * last);
+ int* errnums = ped_malloc(sizeof(int) * last);
+ int ret = 1;
+
+ for (i = 1; i <= last; i++) {
+ rets[i - 1] = _blkpg_remove_partition (disk, i);
+ errnums[i - 1] = errno;
+ }
+
+ for (i = 1; i <= last; i++) {
+ PedPartition* part;
+
+ part = ped_disk_get_partition (disk, i);
+ if (part) {
+ /* extended partitions have no business in the kernel!
+ * blkpg doesn't like overlapping partitions. Hmmm,
+ * LILO isn't going to like this.
+ */
+ if (part->type & PED_PARTITION_EXTENDED)
+ continue;
+
+ /* busy... so we won't (can't!) disturb ;) Prolly
+ * doesn't matter anyway, because users shouldn't be
+ * changing mounted partitions anyway...
+ */
+ if (!rets[i - 1] && errnums[i - 1] == EBUSY)
+ continue;
+
+ /* add the (possibly modified or new) partition */
+ if (!_blkpg_add_partition (disk, part))
+ ret = 0;
+ }
+ }
+
+ return ret;
+}
+
+static int
+_kernel_reread_part_table (PedDevice* dev)
+{
+ LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev);
+ int retry_count = 5;
+
+ sync();
+ while (ioctl (arch_specific->fd, BLKRRPART)) {
+ retry_count--;
+ sync();
+ if (!retry_count) {
+ ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_IGNORE,
+ _("The kernel was unable to re-read the partition "
+ "table on %s (%s). This means Linux won't know "
+ "anything about the modifications you made "
+ "until you reboot. You should reboot your computer "
+ "before doing anything with %s."),
+ dev->path, strerror (errno), dev->path);
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
+static int
+_have_blkpg ()
+{
+ static int have_blkpg = -1;
+ int kver;
+
+ if (have_blkpg != -1)
+ return have_blkpg;
+
+ kver = _get_linux_version();
+ return have_blkpg = kver >= KERNEL_VERSION (2,4,0) ? 1 : 0;
+}
+
+static int
+linux_disk_commit (PedDisk* disk)
+{
+ if (disk->dev->type != PED_DEVICE_FILE) {
+ /* The ioctl() command BLKPG_ADD_PARTITION does not notify
+ * the devfs system; consequently, /proc/partitions will not
+ * be up to date, and the proper links in /dev are not
+ * created. Therefore, if using DevFS, we must get the kernel
+ * to re-read and grok the partition table.
+ */
+ /* Work around kernel dasd problem so we really do BLKRRPART */
+ if (disk->dev->type != PED_DEVICE_DASD &&
+ _have_blkpg () && !_have_devfs ()) {
+ if (_disk_sync_part_table (disk))
+ return 1;
+ }
+ return _kernel_reread_part_table (disk->dev);
+ }
+ return 1;
+}
+
+static PedDeviceArchOps linux_dev_ops = {
+ _new: linux_new,
+ destroy: linux_destroy,
+ is_busy: linux_is_busy,
+ open: linux_open,
+ refresh_open: linux_refresh_open,
+ close: linux_close,
+ refresh_close: linux_refresh_close,
+ read: linux_read,
+ write: linux_write,
+ check: linux_check,
+ sync: linux_sync,
+ sync_fast: linux_sync_fast,
+ probe_all: linux_probe_all
+};
+
+PedDiskArchOps linux_disk_ops = {
+ partition_get_path: linux_partition_get_path,
+ partition_is_busy: linux_partition_is_busy,
+ disk_commit: linux_disk_commit
+};
+
+PedArchitecture ped_linux_arch = {
+ dev_ops: &linux_dev_ops,
+ disk_ops: &linux_disk_ops
+};
diff --git a/libparted/cs/constraint.c b/libparted/cs/constraint.c
new file mode 100644
index 0000000..7fa7f24
--- /dev/null
+++ b/libparted/cs/constraint.c
@@ -0,0 +1,530 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+/**
+ * \addtogroup PedConstraint
+ *
+ * \brief Constraint solver interface.
+ *
+ * Constraints are used to communicate restrictions on operations Constraints
+ * are restrictions on the location and alignment of the start and end of a
+ * partition, and the minimum and maximum size.
+ *
+ * Constraints are closed under intersection (for the proof see the source
+ * code). For background information see the Chinese Remainder Theorem.
+ *
+ * This interface consists of construction constraints, finding the intersection
+ * of constraints, and finding solutions to constraints.
+ *
+ * The constraint solver allows you to specify constraints on where a partition
+ * or file system (or any PedGeometry) may be placed/resized/etc. For example,
+ * you might want to make sure that a file system is at least 10 Gb, or that it
+ * starts at the beginning of new cylinder.
+ *
+ * The constraint solver in this file unifies solver in geom.c (which allows you
+ * to specify constraints on ranges) and natmath.c (which allows you to specify
+ * alignment constraints).
+ *
+ * @{
+ */
+
+#include <parted/parted.h>
+#include <parted/debug.h>
+
+/**
+ * Initializes a pre-allocated piece of memory to contain a constraint
+ * with the supplied default values.
+ *
+ * \return \c 0 on failure.
+ */
+int
+ped_constraint_init (
+ PedConstraint* constraint,
+ const PedAlignment* start_align,
+ const PedAlignment* end_align,
+ const PedGeometry* start_range,
+ const PedGeometry* end_range,
+ PedSector min_size,
+ PedSector max_size)
+{
+ PED_ASSERT (constraint != NULL, return 0);
+ PED_ASSERT (start_range != NULL, return 0);
+ PED_ASSERT (end_range != NULL, return 0);
+ PED_ASSERT (min_size > 0, return 0);
+ PED_ASSERT (max_size > 0, return 0);
+
+ constraint->start_align = ped_alignment_duplicate (start_align);
+ constraint->end_align = ped_alignment_duplicate (end_align);
+ constraint->start_range = ped_geometry_duplicate (start_range);
+ constraint->end_range = ped_geometry_duplicate (end_range);
+ constraint->min_size = min_size;
+ constraint->max_size = max_size;
+
+ return 1;
+}
+
+/**
+ * Convenience wrapper for ped_constraint_init().
+ *
+ * Allocates a new piece of memory and initializes the constraint.
+ *
+ * \return \c NULL on failure.
+ */
+PedConstraint*
+ped_constraint_new (
+ const PedAlignment* start_align,
+ const PedAlignment* end_align,
+ const PedGeometry* start_range,
+ const PedGeometry* end_range,
+ PedSector min_size,
+ PedSector max_size)
+{
+ PedConstraint* constraint;
+
+ constraint = (PedConstraint*) ped_malloc (sizeof (PedConstraint));
+ if (!constraint)
+ goto error;
+ if (!ped_constraint_init (constraint, start_align, end_align,
+ start_range, end_range, min_size, max_size))
+ goto error_free_constraint;
+ return constraint;
+
+error_free_constraint:
+ ped_free (constraint);
+error:
+ return NULL;
+}
+
+/**
+ * Return a constraint that requires a region to be entirely contained inside
+ * \p max, and to entirely contain \p min.
+ *
+ * \return \c NULL on failure.
+ */
+PedConstraint*
+ped_constraint_new_from_min_max (
+ const PedGeometry* min,
+ const PedGeometry* max)
+{
+ PedGeometry start_range;
+ PedGeometry end_range;
+
+ PED_ASSERT (min != NULL, return NULL);
+ PED_ASSERT (max != NULL, return NULL);
+ PED_ASSERT (ped_geometry_test_inside (max, min), return NULL);
+
+ ped_geometry_init (&start_range, min->dev, max->start,
+ min->start - max->start + 1);
+ ped_geometry_init (&end_range, min->dev, min->end,
+ max->end - min->end + 1);
+
+ return ped_constraint_new (
+ ped_alignment_any, ped_alignment_any,
+ &start_range, &end_range,
+ min->length, max->length);
+}
+
+/**
+ * Return a constraint that requires a region to entirely contain \p min.
+ *
+ * \return \c NULL on failure.
+ */
+PedConstraint*
+ped_constraint_new_from_min (const PedGeometry* min)
+{
+ PedGeometry full_dev;
+
+ PED_ASSERT (min != NULL, return NULL);
+
+ ped_geometry_init (&full_dev, min->dev, 0, min->dev->length);
+ return ped_constraint_new_from_min_max (min, &full_dev);
+}
+
+/**
+ * Return a constraint that requires a region to be entirely contained inside
+ * \p max.
+ *
+ * \return \c NULL on failure.
+ */
+PedConstraint*
+ped_constraint_new_from_max (const PedGeometry* max)
+{
+ PED_ASSERT (max != NULL, return NULL);
+
+ return ped_constraint_new (
+ ped_alignment_any, ped_alignment_any,
+ max, max, 1, max->length);
+}
+
+/**
+ * Duplicate a constraint.
+ *
+ * \return \c NULL on failure.
+ */
+PedConstraint*
+ped_constraint_duplicate (const PedConstraint* constraint)
+{
+ PED_ASSERT (constraint != NULL, return NULL);
+
+ return ped_constraint_new (
+ constraint->start_align,
+ constraint->end_align,
+ constraint->start_range,
+ constraint->end_range,
+ constraint->min_size,
+ constraint->max_size);
+}
+
+/**
+ * Return a constraint that requires a region to satisfy both \p a and \p b.
+ *
+ * Moreover, any region satisfying \p a and \p b will also satisfy the returned
+ * constraint.
+ *
+ * \return \c NULL if no solution could be found (note that \c NULL is a valid
+ * PedConstraint).
+ */
+PedConstraint*
+ped_constraint_intersect (const PedConstraint* a, const PedConstraint* b)
+{
+ PedAlignment* start_align;
+ PedAlignment* end_align;
+ PedGeometry* start_range;
+ PedGeometry* end_range;
+ PedSector min_size;
+ PedSector max_size;
+ PedConstraint* constraint;
+
+ if (!a || !b)
+ return NULL;
+
+ start_align = ped_alignment_intersect (a->start_align, b->start_align);
+ if (!start_align)
+ goto empty;
+ end_align = ped_alignment_intersect (a->end_align, b->end_align);
+ if (!end_align)
+ goto empty_destroy_start_align;
+ start_range = ped_geometry_intersect (a->start_range, b->start_range);
+ if (!start_range)
+ goto empty_destroy_end_align;
+ end_range = ped_geometry_intersect (a->end_range, b->end_range);
+ if (!end_range)
+ goto empty_destroy_start_range;
+ min_size = PED_MAX (a->min_size, b->min_size);
+ max_size = PED_MIN (a->max_size, b->max_size);
+
+ constraint = ped_constraint_new (
+ start_align, end_align, start_range, end_range,
+ min_size, max_size);
+ if (!constraint)
+ goto empty_destroy_end_range;
+
+ ped_alignment_destroy (start_align);
+ ped_alignment_destroy (end_align);
+ ped_geometry_destroy (start_range);
+ ped_geometry_destroy (end_range);
+ return constraint;
+
+empty_destroy_end_range:
+ ped_geometry_destroy (end_range);
+empty_destroy_start_range:
+ ped_geometry_destroy (start_range);
+empty_destroy_end_align:
+ ped_alignment_destroy (end_align);
+empty_destroy_start_align:
+ ped_alignment_destroy (start_align);
+empty:
+ return NULL;
+}
+
+/**
+ * Release the memory allocated for a PedConstraint constructed with
+ * ped_constraint_init().
+ */
+void
+ped_constraint_done (PedConstraint* constraint)
+{
+ PED_ASSERT (constraint != NULL, return);
+
+ ped_alignment_destroy (constraint->start_align);
+ ped_alignment_destroy (constraint->end_align);
+ ped_geometry_destroy (constraint->start_range);
+ ped_geometry_destroy (constraint->end_range);
+}
+
+/**
+ * Release the memory allocated for a PedConstraint constructed with
+ * ped_constraint_new().
+ */
+void
+ped_constraint_destroy (PedConstraint* constraint)
+{
+ if (constraint) {
+ ped_constraint_done (constraint);
+ ped_free (constraint);
+ }
+}
+
+/*
+ * Return the region within which the start must lie
+ * in order to satisfy a constriant. It takes into account
+ * constraint->start_range, constraint->min_size and constraint->max_size.
+ * All sectors in this range that also satisfy alignment requirements have
+ * an end, such that the (start, end) satisfy the constraint.
+ */
+static PedGeometry*
+_constraint_get_canonical_start_range (const PedConstraint* constraint)
+{
+ PedSector first_end_soln;
+ PedSector last_end_soln;
+ PedSector min_start;
+ PedSector max_start;
+ PedGeometry start_min_max_range;
+ PedGeometry* result;
+
+ if (constraint->min_size > constraint->max_size)
+ return NULL;
+
+ first_end_soln = ped_alignment_align_down (
+ constraint->end_align, constraint->end_range,
+ constraint->end_range->start);
+ last_end_soln = ped_alignment_align_up (
+ constraint->end_align, constraint->end_range,
+ constraint->end_range->end);
+ if (first_end_soln == -1 || last_end_soln == -1
+ || first_end_soln > last_end_soln
+ || last_end_soln < constraint->min_size)
+ return NULL;
+
+ min_start = first_end_soln - constraint->max_size + 1;
+ if (min_start < 0)
+ min_start = 0;
+ max_start = last_end_soln - constraint->min_size + 1;
+ if (max_start < 0)
+ return NULL;
+
+ ped_geometry_init (
+ &start_min_max_range, constraint->start_range->dev,
+ min_start, max_start - min_start + 1);
+
+ return ped_geometry_intersect (&start_min_max_range,
+ constraint->start_range);
+}
+
+/*
+ * Return the nearest start that will have at least one other end that
+ * together satisfy the constraint.
+ */
+static PedSector
+_constraint_get_nearest_start_soln (const PedConstraint* constraint,
+ PedSector start)
+{
+ PedGeometry* start_range;
+ PedSector result;
+
+ start_range = _constraint_get_canonical_start_range (constraint);
+ if (!start_range)
+ return -1;
+ result = ped_alignment_align_nearest (
+ constraint->start_align, start_range, start);
+ ped_geometry_destroy (start_range);
+ return result;
+}
+
+/*
+ * Given a constraint and a start ("half of the solution"), find the
+ * range of all possible ends, such that all (start, end) are solutions
+ * to constraint (subject to additional alignment requirements).
+ */
+static PedGeometry*
+_constraint_get_end_range (const PedConstraint* constraint, PedSector start)
+{
+ PedDevice* dev = constraint->end_range->dev;
+ PedSector first_min_max_end;
+ PedSector last_min_max_end;
+ PedGeometry end_min_max_range;
+
+ if (start + constraint->min_size - 1 > dev->length - 1)
+ return NULL;
+
+ first_min_max_end = start + constraint->min_size - 1;
+ last_min_max_end = start + constraint->max_size - 1;
+ if (last_min_max_end > dev->length - 1)
+ last_min_max_end = dev->length - 1;
+
+ ped_geometry_init (&end_min_max_range, dev,
+ first_min_max_end,
+ last_min_max_end - first_min_max_end + 1);
+
+ return ped_geometry_intersect (&end_min_max_range,
+ constraint->end_range);
+}
+
+/*
+ * Given "constraint" and "start", find the end that is nearest to
+ * "end", such that ("start", the end) together form a solution to
+ * "constraint".
+ */
+static PedSector
+_constraint_get_nearest_end_soln (const PedConstraint* constraint,
+ PedSector start, PedSector end)
+{
+ PedGeometry* end_range;
+ PedSector result;
+
+ end_range = _constraint_get_end_range (constraint, start);
+ if (!end_range)
+ return -1;
+
+ result = ped_alignment_align_nearest (constraint->end_align, end_range,
+ end);
+ ped_geometry_destroy (end_range);
+ return result;
+}
+
+/**
+ * Return the nearest region to \p geom that satisfy a \p constraint.
+ *
+ * Note that "nearest" is somewhat ambiguous. This function makes
+ * no guarantees about how this ambiguity is resovled.
+ *
+ * \return PedGeometry, or NULL when a \p constrain cannot be satisfied
+ */
+PedGeometry*
+ped_constraint_solve_nearest (
+ const PedConstraint* constraint, const PedGeometry* geom)
+{
+ PedSector start;
+ PedSector end;
+ PedGeometry* result;
+
+ if (constraint == NULL)
+ return NULL;
+
+ PED_ASSERT (geom != NULL, return NULL);
+ PED_ASSERT (constraint->start_range->dev == geom->dev, return NULL);
+
+ start = _constraint_get_nearest_start_soln (constraint, geom->start);
+ if (start == -1)
+ return NULL;
+ end = _constraint_get_nearest_end_soln (constraint, start, geom->end);
+ if (end == -1)
+ return NULL;
+
+ result = ped_geometry_new (geom->dev, start, end - start + 1);
+ if (!result)
+ return NULL;
+ PED_ASSERT (ped_constraint_is_solution (constraint, result),
+ return NULL);
+ return result;
+}
+
+/**
+ * Find the largest region that satisfies a constraint.
+ *
+ * There might be more than one solution. This function makes no
+ * guarantees about which solution it will choose in this case.
+ */
+PedGeometry*
+ped_constraint_solve_max (const PedConstraint* constraint)
+{
+ PedDevice* dev;
+ PedGeometry full_dev;
+
+ if (!constraint)
+ return NULL;
+ dev = constraint->start_range->dev;
+ ped_geometry_init (&full_dev, dev, 0, dev->length - 1);
+ return ped_constraint_solve_nearest (constraint, &full_dev);
+}
+
+/**
+ * Check whether \p geom satisfies the given constraint.
+ *
+ * \return \c 1 if it does.
+ **/
+int
+ped_constraint_is_solution (const PedConstraint* constraint,
+ const PedGeometry* geom)
+{
+ PED_ASSERT (constraint != NULL, return 0);
+ PED_ASSERT (geom != NULL, return 0);
+
+ if (!ped_alignment_is_aligned (constraint->start_align, NULL,
+ geom->start))
+ return 0;
+ if (!ped_alignment_is_aligned (constraint->end_align, NULL, geom->end))
+ return 0;
+ if (!ped_geometry_test_sector_inside (constraint->start_range,
+ geom->start))
+ return 0;
+ if (!ped_geometry_test_sector_inside (constraint->end_range, geom->end))
+ return 0;
+ if (geom->length < constraint->min_size)
+ return 0;
+ if (geom->length > constraint->max_size)
+ return 0;
+ return 1;
+}
+
+/**
+ * Return a constraint that any region on the given device will satisfy.
+ */
+PedConstraint*
+ped_constraint_any (const PedDevice* dev)
+{
+ PedGeometry full_dev;
+
+ if (!ped_geometry_init (&full_dev, dev, 0, dev->length))
+ return NULL;
+
+ return ped_constraint_new (
+ ped_alignment_any,
+ ped_alignment_any,
+ &full_dev,
+ &full_dev,
+ 1,
+ dev->length);
+}
+
+/**
+ * Return a constraint that only the given region will satisfy.
+ */
+PedConstraint*
+ped_constraint_exact (const PedGeometry* geom)
+{
+ PedAlignment start_align;
+ PedAlignment end_align;
+ PedGeometry start_sector;
+ PedGeometry end_sector;
+
+ ped_alignment_init (&start_align, geom->start, 0);
+ ped_alignment_init (&end_align, geom->end, 0);
+ ped_geometry_init (&start_sector, geom->dev, geom->start, 1);
+ ped_geometry_init (&end_sector, geom->dev, geom->end, 1);
+
+ return ped_constraint_new (&start_align, &end_align,
+ &start_sector, &end_sector, 1,
+ geom->dev->length);
+}
+
+/**
+ * @}
+ */
+
diff --git a/libparted/cs/geom.c b/libparted/cs/geom.c
new file mode 100644
index 0000000..29c89e7
--- /dev/null
+++ b/libparted/cs/geom.c
@@ -0,0 +1,483 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 1999, 2000, 2005 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+/** \file geom.c */
+
+
+/**
+ * \addtogroup PedGeometry
+ *
+ * \brief PedGeometry represents a continuous region on a device. All addressing
+ * through a PedGeometry object is in terms of the start of the continuous
+ * region.
+ *
+ * The following conditions are always true on a PedGeometry object manipulated
+ * with the GNU Parted API:
+ *
+ * - <tt>start + length - 1 == end</tt>
+ * - <tt>length > 0</tt>
+ * - <tt>start >= 0</tt>
+ * - <tt>end < dev->length</tt>
+ *
+ * @{
+ */
+
+#include "config.h"
+
+#include <parted/parted.h>
+#include <parted/debug.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+/**
+ * Initialize the previously allocated PedGeometry \p geom.
+ */
+int
+ped_geometry_init (PedGeometry* geom, const PedDevice* dev,
+ PedSector start, PedSector length)
+{
+ PED_ASSERT (geom != NULL, return 0);
+ PED_ASSERT (dev != NULL, return 0);
+
+ geom->dev = (PedDevice*) dev;
+ return ped_geometry_set (geom, start, length);
+}
+
+/**
+ * Create a new PedGeometry object on \p disk, starting at \p start with a
+ * size of \p length sectors.
+ *
+ * \return NULL on failure.
+ */
+PedGeometry*
+ped_geometry_new (const PedDevice* dev, PedSector start, PedSector length)
+{
+ PedGeometry* geom;
+
+ PED_ASSERT (dev != NULL, return NULL);
+
+ geom = (PedGeometry*) ped_malloc (sizeof (PedGeometry));
+ if (!geom)
+ goto error;
+ if (!ped_geometry_init (geom, dev, start, length))
+ goto error_free_geom;
+ return geom;
+
+error_free_geom:
+ ped_free (geom);
+error:
+ return NULL;
+}
+
+/**
+ * Duplicate a PedGeometry object.
+ *
+ * This function constructs a PedGeometry object that is an identical but
+ * independent copy of \p geom. Both the input, \p geom, and the output
+ * should be destroyed with ped_geometry_destroy() when they are no
+ * longer needed.
+ *
+ * \return NULL on failure.
+ */
+PedGeometry*
+ped_geometry_duplicate (const PedGeometry* geom)
+{
+ PED_ASSERT (geom != NULL, return NULL);
+ return ped_geometry_new (geom->dev, geom->start, geom->length);
+}
+
+/**
+ * Return a PedGeometry object that refers to the intersection of
+ * \p a and \p b.
+ *
+ * This function constructs a PedGeometry object that describes the
+ * region that is common to both a and b. If there is no such common
+ * region, it returns NULL. (This situation is not treated as an
+ * error by much of GNU Parted.)
+ */
+PedGeometry*
+ped_geometry_intersect (const PedGeometry* a, const PedGeometry* b)
+{
+ PedSector start;
+ PedSector end;
+
+ if (!a || !b || a->dev != b->dev)
+ return NULL;
+
+ start = PED_MAX (a->start, b->start);
+ end = PED_MIN (a->end, b->end);
+ if (start > end)
+ return NULL;
+
+ return ped_geometry_new (a->dev, start, end - start + 1);
+}
+
+/**
+ * Destroy a PedGeometry object.
+ */
+void
+ped_geometry_destroy (PedGeometry* geom)
+{
+ PED_ASSERT (geom != NULL, return);
+
+ ped_free (geom);
+}
+
+/**
+ * Assign a new \p start, \p end (implicitly) and \p length to \p geom.
+ *
+ * \p geom->end is calculated from \p start and \p length.
+ */
+int
+ped_geometry_set (PedGeometry* geom, PedSector start, PedSector length)
+{
+ PED_ASSERT (geom != NULL, return 0);
+ PED_ASSERT (geom->dev != NULL, return 0);
+
+ if (length < 1) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Can't have the end before the start!"));
+ return 0;
+ }
+ if (start < 0 || start + length - 1 >= geom->dev->length) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Can't have a partition outside the disk!"));
+ return 0;
+ }
+
+ geom->start = start;
+ geom->length = length;
+ geom->end = start + length - 1;
+
+ return 1;
+}
+
+/**
+ * Assign a new start to \p geom without changing \p geom->end.
+ *
+ * \p geom->length is updated accordingly.
+ */
+int
+ped_geometry_set_start (PedGeometry* geom, PedSector start)
+{
+ return ped_geometry_set (geom, start, geom->end - start + 1);
+}
+
+/**
+ * Assign a new end to \p geom without changing \p geom->start.
+ *
+ * \p geom->length is updated accordingly.
+ */
+int
+ped_geometry_set_end (PedGeometry* geom, PedSector end)
+{
+ return ped_geometry_set (geom, geom->start, end - geom->start + 1);
+}
+/**
+ * Test if \p a overlaps with \p b.
+ *
+ * That is, they lie on the same physical device, and they share
+ * the same physical region at least partially.
+ *
+ * \return 1 if \p a and \p b overlap.
+ */
+int
+ped_geometry_test_overlap (const PedGeometry* a, const PedGeometry* b)
+{
+ PED_ASSERT (a != NULL, return 0);
+ PED_ASSERT (b != NULL, return 0);
+
+ if (a->dev != b->dev)
+ return 0;
+
+ if (a->start < b->start)
+ return a->end >= b->start;
+ else
+ return b->end >= a->start;
+}
+
+/**
+ * Tests if \p b lies completely within \p a. That is, they lie on the same
+ * physical device, and all of the \p b's region is contained inside
+ * \p a's.
+ *
+ * \return 1 if the region \p b describes is contained entirely inside \p a
+*/
+int
+ped_geometry_test_inside (const PedGeometry* a, const PedGeometry* b)
+{
+ PED_ASSERT (a != NULL, return 0);
+ PED_ASSERT (b != NULL, return 0);
+
+ if (a->dev != b->dev)
+ return 0;
+
+ return b->start >= a->start && b->end <= a->end;
+}
+
+/**
+ * Tests if \a a and \p b refer to the same physical region.
+ *
+ * \return 1 if \p a and \p b describe the same regions
+ *
+ */
+int
+ped_geometry_test_equal (const PedGeometry* a, const PedGeometry* b)
+{
+ PED_ASSERT (a != NULL, return 0);
+ PED_ASSERT (b != NULL, return 0);
+
+ return a->dev == b->dev
+ && a->start == b->start
+ && a->end == b->end;
+}
+
+/**
+ * Tests if \p sector is inside \p geom.
+ *
+ * \return 1 if sector lies within the \p region that \p geom describes
+ */
+int
+ped_geometry_test_sector_inside (const PedGeometry* geom, PedSector sector)
+{
+ PED_ASSERT (geom != NULL, return 0);
+
+ return sector >= geom->start && sector <= geom->end;
+}
+
+/**
+ * Reads data from the region represented by \p geom. \p offset is the
+ * location from within the region, not from the start of the disk.
+ * \p count sectors are read into \p buffer.
+ * This is essentially equivalent to:
+ * \code
+ * ped_device_read (geom->disk->dev, buffer, geom->start + offset, count)
+ * \endcode
+ *
+ * \throws PED_EXCEPTION_ERROR when attempting to read sectors outside of
+ * partition
+ *
+ * \return 0 on failure
+ */
+int
+ped_geometry_read (const PedGeometry* geom, void* buffer, PedSector start,
+ PedSector count)
+{
+ int exception_status;
+ PedSector real_start;
+
+ PED_ASSERT (geom != NULL, return 0);
+ PED_ASSERT (buffer != NULL, return 0);
+ PED_ASSERT (start >= 0, return 0);
+ PED_ASSERT (count >= 0, return 0);
+
+ real_start = geom->start + start;
+
+ if (real_start + count - 1 > geom->end) {
+ exception_status = ped_exception_throw (
+ PED_EXCEPTION_ERROR, PED_EXCEPTION_IGNORE_CANCEL,
+ _("Attempt to read sectors %ld-%ld outside of "
+ "partition on %s."),
+ (long) start, (long) (start + count - 1),
+ geom->dev->path);
+ return exception_status == PED_EXCEPTION_IGNORE;
+ }
+
+ if (!ped_device_read (geom->dev, buffer, real_start, count))
+ return 0;
+ return 1;
+}
+
+/**
+ * Flushes the cache on \p geom.
+ *
+ * This function flushes all write-behind caches that might be holding
+ * writes made by ped_geometry_write() to \p geom. It is slow, because
+ * it guarantees cache coherency among all relevant caches.
+ *
+ * \return 0 on failure
+ */
+int
+ped_geometry_sync (PedGeometry* geom)
+{
+ PED_ASSERT (geom != NULL, return 0);
+ return ped_device_sync (geom->dev);
+}
+
+/**
+ * Flushes the cache on \p geom.
+ *
+ * This function flushes all write-behind caches that might be holding writes
+ * made by ped_geometry_write() to \p geom. It does NOT ensure cache coherency
+ * with other caches that cache data in the region described by \p geom.
+ * If you need cache coherency, use ped_geometry_sync() instead.
+ *
+ * \return 0 on failure
+ */
+int
+ped_geometry_sync_fast (PedGeometry* geom)
+{
+ PED_ASSERT (geom != NULL, return 0);
+ return ped_device_sync_fast (geom->dev);
+}
+
+/**
+ * Writes data into the region represented by \p geom. \p offset is the
+ * location from within the region, not from the start of the disk.
+ * \p count sectors are written.
+ *
+ * \return 0 on failure
+ */
+int
+ped_geometry_write (PedGeometry* geom, const void* buffer, PedSector start,
+ PedSector count)
+{
+ int exception_status;
+ PedSector real_start;
+
+ PED_ASSERT (geom != NULL, return 0);
+ PED_ASSERT (buffer != NULL, return 0);
+ PED_ASSERT (start >= 0, return 0);
+ PED_ASSERT (count >= 0, return 0);
+
+ real_start = geom->start + start;
+
+ if (real_start + count - 1 > geom->end) {
+ exception_status = ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("Attempt to write sectors %ld-%ld outside of "
+ "partition on %s."),
+ (long) start, (long) (start + count - 1),
+ geom->dev->path);
+ return exception_status == PED_EXCEPTION_IGNORE;
+ }
+
+ if (!ped_device_write (geom->dev, buffer, real_start, count))
+ return 0;
+ return 1;
+}
+
+/**
+ * Checks for physical disk errors. \todo use ped_device_check()
+ *
+ * Checks a region for physical defects on \p geom. \p buffer is used
+ * for temporary storage for ped_geometry_check(), and has an undefined
+ * value. \p buffer is \p buffer_size sectors long.
+ * The region checked starts at \p offset sectors inside the
+ * region represented by \p geom, and is \p count sectors long.
+ * \p granularity specificies how sectors should be grouped
+ * together. The first bad sector to be returned will always be in
+ * the form:
+ * <tt>offset + n * granularity</tt>
+ *
+ * \return the first bad sector, or 0 if there were no physical errors
+ */
+PedSector
+ped_geometry_check (PedGeometry* geom, void* buffer, PedSector buffer_size,
+ PedSector offset, PedSector granularity, PedSector count,
+ PedTimer* timer)
+{
+ PedSector group;
+ PedSector i;
+ PedSector read_len;
+
+ PED_ASSERT (geom != NULL, return 0);
+ PED_ASSERT (buffer != NULL, return 0);
+
+ ped_timer_reset (timer);
+ ped_timer_set_state_name (timer, _("checking for bad blocks"));
+
+retry:
+ ped_exception_fetch_all();
+ for (group = offset; group < offset + count; group += buffer_size) {
+ ped_timer_update (timer, 1.0 * (group - offset) / count);
+ read_len = PED_MIN (buffer_size, offset + count - group);
+ if (!ped_geometry_read (geom, buffer, group, read_len))
+ goto found_error;
+ }
+ ped_exception_leave_all();
+ ped_timer_update (timer, 1.0);
+ return 0;
+
+found_error:
+ ped_exception_catch();
+ for (i = group; i + granularity < group + count; i += granularity) {
+ if (!ped_geometry_read (geom, buffer, i, granularity)) {
+ ped_exception_catch();
+ ped_exception_leave_all();
+ return i;
+ }
+ }
+ ped_exception_leave_all();
+ goto retry; /* weird: failure on group read, but not individually */
+}
+
+/**
+ * This function takes a \p sector inside the region described by src, and
+ * returns that sector's address inside dst. This means that
+ *
+ * \code
+ * ped_geometry_read (dst, buf, ped_geometry_map(dst, src, sector), 1)
+ * \endcode
+ *
+ * does the same thing as
+ *
+ * \code
+ * ped_geometry_read (src, buf, sector, 1)
+ * \endcode
+ *
+ * Clearly, this will only work if \p src and \p dst overlap.
+ *
+ * \return -1 if \p sector is not within \p dst's space,
+ * or \p sector's address inside \p dst
+ *
+ */
+PedSector
+ped_geometry_map (const PedGeometry* dst, const PedGeometry* src,
+ PedSector sector)
+{
+ PedSector result;
+
+ PED_ASSERT (dst != NULL, return 0);
+ PED_ASSERT (src != NULL, return 0);
+
+ if (!ped_geometry_test_sector_inside (src, sector))
+ return -1;
+ if (dst->dev != src->dev)
+ return -1;
+
+ result = src->start + sector - dst->start;
+ if (result < 0 || result > dst->length)
+ return -1;
+
+ return result;
+}
+
+/** @} */
+
diff --git a/libparted/cs/natmath.c b/libparted/cs/natmath.c
new file mode 100644
index 0000000..a774d8f
--- /dev/null
+++ b/libparted/cs/natmath.c
@@ -0,0 +1,495 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+/**
+ * \file natmath.c
+ */
+
+/**
+ * \addtogroup PedAlignment
+ *
+ * \brief Alignment constraint model.
+ *
+ * This part of libparted models alignment constraints.
+ *
+ * @{
+ */
+
+#include <stdlib.h>
+#include <parted/parted.h>
+#include <parted/debug.h>
+#include <parted/natmath.h>
+
+/* Arrrghhh! Why doesn't C have tuples? */
+typedef struct {
+ PedSector gcd; /* "converges" to the gcd */
+ PedSector x;
+ PedSector y;
+} EuclidTriple;
+
+static const PedAlignment _any = {
+ offset: 0,
+ grain_size: 1
+};
+
+const PedAlignment* ped_alignment_any = &_any;
+const PedAlignment* ped_alignment_none = NULL;
+
+/* This function returns "a mod b", the way C should have done it!
+ * Mathematicians prefer -3 mod 4 to be 3. Reason: division by N
+ * is all about adding or subtracting N, and we like our remainders
+ * to be between 0 and N - 1.
+ */
+PedSector
+abs_mod (PedSector a, PedSector b)
+{
+ if (a < 0)
+ return a % b + b;
+ else
+ return a % b;
+}
+
+/* Rounds a number down to the closest number that is a multiple of
+ * grain_size.
+ */
+PedSector
+ped_round_down_to (PedSector sector, PedSector grain_size)
+{
+ return sector - abs_mod (sector, grain_size);
+}
+
+inline PedSector
+ped_div_round_up (PedSector numerator, PedSector divisor)
+{
+ return (numerator + divisor - 1) / divisor;
+}
+
+inline PedSector
+ped_div_round_to_nearest (PedSector numerator, PedSector divisor)
+{
+ return (numerator + divisor/2) / divisor;
+}
+
+/* Rounds a number up to the closest number that is a multiple of
+ * grain_size.
+ */
+PedSector
+ped_round_up_to (PedSector sector, PedSector grain_size)
+{
+ if (sector % grain_size)
+ return ped_round_down_to (sector, grain_size) + grain_size;
+ else
+ return sector;
+}
+
+/* Rounds a number to the closest number that is a multiple of grain_size. */
+PedSector
+ped_round_to_nearest (PedSector sector, PedSector grain_size)
+{
+ if (sector % grain_size > grain_size/2)
+ return ped_round_up_to (sector, grain_size);
+ else
+ return ped_round_down_to (sector, grain_size);
+}
+
+/* This function returns the largest number that divides both a and b.
+ * It uses the ancient Euclidean algorithm.
+ */
+PedSector
+ped_greatest_common_divisor (PedSector a, PedSector b)
+{
+ PED_ASSERT (a >= 0, return 0);
+ PED_ASSERT (b >= 0, return 0);
+
+ /* Put the arguments in the "right" format. (Recursive calls made by
+ * this function are always in the right format.)
+ */
+ if (b > a)
+ return ped_greatest_common_divisor (b, a);
+
+ if (b)
+ return ped_greatest_common_divisor (b, a % b);
+ else
+ return a;
+}
+
+/**
+ * Initialize a preallocated piece of memory for an alignment object
+ * (used by PedConstraint).
+ *
+ * The object will represent all sectors \e s for which the equation
+ * <tt>s = offset + X * grain_size</tt> holds.
+ */
+int
+ped_alignment_init (PedAlignment* align, PedSector offset, PedSector grain_size)
+{
+ PED_ASSERT (align != NULL, return 0);
+
+ if (grain_size < 0)
+ return 0;
+
+ if (grain_size)
+ align->offset = abs_mod (offset, grain_size);
+ else
+ align->offset = offset;
+ align->grain_size = grain_size;
+
+ return 1;
+}
+
+/**
+ * Return an alignment object (used by PedConstraint), representing all
+ * PedSector's that are of the form <tt>offset + X * grain_size</tt>.
+ */
+PedAlignment*
+ped_alignment_new (PedSector offset, PedSector grain_size)
+{
+ PedAlignment* align;
+
+ align = (PedAlignment*) ped_malloc (sizeof (PedAlignment));
+ if (!align)
+ goto error;
+
+ if (!ped_alignment_init (align, offset, grain_size))
+ goto error_free_align;
+
+ return align;
+
+error_free_align:
+ ped_free (align);
+error:
+ return NULL;
+}
+
+/**
+ * Free up memory associated with \p align.
+ */
+void
+ped_alignment_destroy (PedAlignment* align)
+{
+ if (align)
+ ped_free (align);
+}
+
+/**
+ * Return a duplicate of \p align.
+ */
+PedAlignment*
+ped_alignment_duplicate (const PedAlignment* align)
+{
+ if (!align)
+ return NULL;
+ return ped_alignment_new (align->offset, align->grain_size);
+}
+
+/* the extended Euclid algorithm.
+ *
+ * input:
+ * a and b, a > b
+ *
+ * output:
+ * gcd, x and y, such that:
+ *
+ * gcd = greatest common divisor of a and b
+ * gcd = x*a + y*b
+ */
+EuclidTriple
+extended_euclid (int a, int b)
+{
+ EuclidTriple result;
+ EuclidTriple tmp;
+
+ if (b == 0) {
+ result.gcd = a;
+ result.x = 1;
+ result.y = 0;
+ return result;
+ }
+
+ tmp = extended_euclid (b, a % b);
+ result.gcd = tmp.gcd;
+ result.x = tmp.y;
+ result.y = tmp.x - (a/b) * tmp.y;
+ return result;
+}
+
+/**
+ * This function computes a PedAlignment object that describes the
+ * intersection of two alignments. That is, a sector satisfies the
+ * new alignment object if and only if it satisfies both of the original
+ * ones. (See ped_alignment_is_aligned() for the meaning of "satisfies")
+ *
+ * Apart from the trivial cases (where one or both of the alignment objects
+ * constraints have no sectors that satisfy them), this is what we're trying to
+ * do:
+ * - two input constraints: \p a and \p b.
+ * - the new grain_size is going to be the lowest common multiple of
+ * \p a->grain_size and \p b->grain_size
+ * - hard part - solve the simultaneous equations, for offset, where offset,
+ * X and Y are variables. (Note: offset can be obtained from either X or Y,
+ * by substituing into either equation)
+ *
+ * \code
+ * offset = \p a->offset + X * \p a->grain_size (1)
+ * offset = \p b->offset + Y * \p b->grain_size (2)
+ * \endcode
+ *
+ * or, abbreviated:
+ *
+ * \code
+ * o = Ao + X*Ag (1)
+ * o = Bo + Y*Bg (2)
+ *
+ * => Ao + X*Ag = Bo + Y*Bg (1) = (2)
+ * X*Ag - Y*Bg = Bo - Ao (3)
+ * \endcode
+ *
+ * As it turns out, there only exists a solution if (Bo - Ao) is a multiple
+ * of the GCD of Ag and Bg. Reason: all linear combinations of Ag and Bg are
+ * multiples of the GCD.
+ *
+ * Proof:
+ *
+ * \code
+ * A * Ag + B * Bg
+ * = A * (\p a * gcd) + B * (\p b * gcd)
+ * = gcd * (A * \p a + B * \p b)
+ * \endcode
+ *
+ * gcd is a factor of the linear combination. QED
+ *
+ * Anyway, \p a * Ag + \p b * Bg = gcd can be solved (for \p a, \p b and gcd)
+ * with Euclid's extended algorithm. Then, we just multiply through by
+ * (Bo - Ao) / gcd to get (3).
+ *
+ * i.e.
+ * \code
+ * A * Ag + B * Bg = gcd
+ * A*(Bo-Ao)/gcd * Ag + B(Bo-Ao)/gcd * Bg = gcd * (Bo-Ao)/gcd
+ * X*Ag - Y*Bg = Bo - Ao (3)
+ *
+ * X = A*(Bo-Ao)/gcd
+ * Y = - B*(Bo-Ao)/gcd
+ * \endcode
+ *
+ * then:
+ * \code
+ * o = Ao + X*Ag (1)
+ * = Ao + A*(Bo-Ao)/gcd*Ag
+ * o = Bo + Y*Bg (2)
+ * = Bo - B*(Bo-Ao)/gcd*Ag
+ * \endcode
+ *
+ * Thanks go to Nathan Hurst (njh@hawthorn.csse.monash.edu.au) for figuring
+ * this algorithm out :-)
+ *
+ * \note Returned \c NULL is a valid PedAlignment object, and can be used
+ for ped_alignment_*() function.
+ *
+ * \return a PedAlignment on success, \c NULL on failure
+ */
+PedAlignment*
+ped_alignment_intersect (const PedAlignment* a, const PedAlignment* b)
+{
+ PedSector new_grain_size;
+ PedSector new_offset;
+ PedSector delta_on_gcd;
+ EuclidTriple gcd_factors;
+
+
+ if (!a || !b)
+ return NULL;
+
+ /*PED_DEBUG (0x10, "intersecting alignments (%d,%d) and (%d,%d)",
+ a->offset, a->grain_size, b->offset, b->grain_size);
+ */
+
+ if (a->grain_size < b->grain_size) {
+ const PedAlignment* tmp;
+ tmp = a; a = b; b = tmp;
+ }
+
+ /* weird/trivial case: where the solution space for "a" or "b" is
+ * either empty or contains exactly one solution
+ */
+ if (a->grain_size == 0 && b->grain_size == 0) {
+ if (a->offset == b->offset)
+ return ped_alignment_duplicate (a);
+ else
+ return NULL;
+ }
+
+ /* general case */
+ gcd_factors = extended_euclid (a->grain_size, b->grain_size);
+
+ delta_on_gcd = (b->offset - a->offset) / gcd_factors.gcd;
+ new_offset = a->offset + gcd_factors.x * delta_on_gcd * a->grain_size;
+ new_grain_size = a->grain_size * b->grain_size / gcd_factors.gcd;
+
+ /* inconsistency => no solution */
+ if (new_offset
+ != b->offset - gcd_factors.y * delta_on_gcd * b->grain_size)
+ return NULL;
+
+ return ped_alignment_new (new_offset, new_grain_size);
+}
+
+/* This function returns the sector closest to "sector" that lies inside
+ * geom and satisfies the alignment constraint.
+ */
+static PedSector
+_closest_inside_geometry (const PedAlignment* align, const PedGeometry* geom,
+ PedSector sector)
+{
+ PED_ASSERT (align != NULL, return -1);
+
+ if (!align->grain_size) {
+ if (ped_alignment_is_aligned (align, geom, sector)
+ && (!geom || ped_geometry_test_sector_inside (geom,
+ sector)))
+ return sector;
+ else
+ return -1;
+ }
+
+ if (sector < geom->start)
+ sector += ped_round_up_to (geom->start - sector,
+ align->grain_size);
+ if (sector > geom->end)
+ sector -= ped_round_up_to (sector - geom->end,
+ align->grain_size);
+
+ if (!ped_geometry_test_sector_inside (geom, sector))
+ return -1;
+ return sector;
+}
+
+/**
+ * This function returns the closest sector to \p sector that lies inside
+ * \p geom that satisfies the given alignment constraint \p align. It prefers
+ * sectors that are beyond \p sector (are not smaller than \p sector),
+ * but does not guarantee that this.
+ *
+ * \return a PedSector on success, \c -1 on failure
+ */
+PedSector
+ped_alignment_align_up (const PedAlignment* align, const PedGeometry* geom,
+ PedSector sector)
+{
+ PedSector result;
+
+ PED_ASSERT (align != NULL, return -1);
+
+ if (!align->grain_size)
+ result = align->offset;
+ else
+ result = ped_round_up_to (sector - align->offset,
+ align->grain_size)
+ + align->offset;
+
+ if (geom)
+ result = _closest_inside_geometry (align, geom, result);
+ return result;
+}
+
+/**
+ * This function returns the closest sector to \p sector that lies inside
+ * \p geom that satisfies the given alignment constraint \p align. It prefers
+ * sectors that are before \p sector (are not larger than \p sector),
+ * but does not guarantee that this.
+ *
+ * \return a PedSector on success, \c -1 on failure
+ */
+PedSector
+ped_alignment_align_down (const PedAlignment* align, const PedGeometry* geom,
+ PedSector sector)
+{
+ PedSector result;
+
+ PED_ASSERT (align != NULL, return -1);
+
+ if (!align->grain_size)
+ result = align->offset;
+ else
+ result = ped_round_down_to (sector - align->offset,
+ align->grain_size)
+ + align->offset;
+
+ if (geom)
+ result = _closest_inside_geometry (align, geom, result);
+ return result;
+}
+
+/* Returns either a or b, depending on which is closest to "sector". */
+static PedSector
+closest (PedSector sector, PedSector a, PedSector b)
+{
+ if (a == -1)
+ return b;
+ if (b == -1)
+ return a;
+
+ if (abs (sector - a) < abs (sector - b))
+ return a;
+ else
+ return b;
+}
+
+/**
+ * This function returns the sector that is closest to \p sector,
+ * satisfies the \p align constraint and lies inside \p geom.
+ *
+ * \return a PedSector on success, \c -1 on failure
+ */
+PedSector
+ped_alignment_align_nearest (const PedAlignment* align, const PedGeometry* geom,
+ PedSector sector)
+{
+ PED_ASSERT (align != NULL, return -1);
+
+ return closest (sector, ped_alignment_align_up (align, geom, sector),
+ ped_alignment_align_down (align, geom, sector));
+}
+
+/**
+ * This function returns 1 if \p sector satisfies the alignment
+ * constraint \p align and lies inside \p geom.
+ *
+ * \return \c 1 on success, \c 0 on failure
+ */
+int
+ped_alignment_is_aligned (const PedAlignment* align, const PedGeometry* geom,
+ PedSector sector)
+{
+ if (!align)
+ return 0;
+
+ if (geom && !ped_geometry_test_sector_inside (geom, sector))
+ return 0;
+
+ if (align->grain_size)
+ return (sector - align->offset) % align->grain_size == 0;
+ else
+ return sector == align->offset;
+}
+
+/**
+ * @}
+ */
+
diff --git a/libparted/debug.c b/libparted/debug.c
new file mode 100644
index 0000000..9bf86a7
--- /dev/null
+++ b/libparted/debug.c
@@ -0,0 +1,100 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2000, 2005 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#include "config.h"
+#include <parted/parted.h>
+#include <parted/debug.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+#ifdef DEBUG
+
+static void default_handler ( const int level, const char* file, int line,
+ const char* function, const char* msg );
+static PedDebugHandler* debug_handler = &default_handler;
+
+
+/**
+ * Default debug handler.
+ * Will print all information to stderr.
+ */
+static void default_handler ( const int level, const char* file, int line,
+ const char* function, const char* msg )
+{
+ fprintf ( stderr, "[%d] %s:%d (%s): %s\n",
+ level, file, line, function, msg );
+}
+
+/**
+ * Send a debug message.
+ * Do not call this directly -- use PED_DEBUG() instead.
+ *
+ * level log level, 0 ~= "print definitely"
+ */
+void ped_debug ( const int level, const char* file, int line,
+ const char* function, const char* msg, ... )
+{
+ va_list arg_list;
+ char* msg_concat = ped_malloc(8192);
+
+ va_start ( arg_list, msg );
+ vsnprintf ( msg_concat, 8192, msg, arg_list );
+ va_end ( arg_list );
+
+ debug_handler ( level, file, line, function, msg_concat );
+
+ ped_free ( msg_concat );
+}
+
+/*
+ * handler debug handler; NULL for default handler
+ */
+void ped_debug_set_handler ( PedDebugHandler* handler )
+{
+ debug_handler = ( handler ? handler : default_handler );
+}
+
+/*
+ * Check an assertion.
+ * Do not call this directly -- use PED_ASSERT() instead.
+ */
+int ped_assert ( int cond, const char* cond_text,
+ const char* file, int line, const char* function )
+{
+ PedExceptionOption opt;
+
+ if ( cond )
+ return 1;
+
+ opt = ped_exception_throw (
+ PED_EXCEPTION_BUG,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("Assertion (%s) at %s:%d in function %s() failed."),
+ cond_text, file, line, function );
+
+ return ( opt == PED_EXCEPTION_IGNORE );
+}
+
+#endif /* DEBUG */
+
diff --git a/libparted/device.c b/libparted/device.c
new file mode 100644
index 0000000..36729e0
--- /dev/null
+++ b/libparted/device.c
@@ -0,0 +1,441 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 1999 - 2001, 2005 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+/** \file device.c */
+
+/**
+ * \addtogroup PedDevice
+ *
+ * \brief Device access.
+ *
+ * When ped_device_probe_all() is called, libparted attempts to detect all
+ * devices. It constructs a list which can be accessed with
+ * ped_device_get_next().
+ *
+ * If you want to use a device that isn't on the list, use
+ * ped_device_get(). Also, there may be OS-specific constructors, for creating
+ * devices from file descriptors, stores, etc. For example,
+ * ped_device_new_from_store().
+ *
+ * @{
+ */
+
+#define _GNU_SOURCE 1
+
+#include "config.h"
+
+#include <parted/parted.h>
+#include <parted/debug.h>
+
+#include <limits.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <errno.h>
+
+static PedDevice* devices; /* legal advice says: initialized to NULL,
+ under section 6.7.8 part 10
+ of ISO/EIC 9899:1999 */
+
+#ifndef HAVE_CANONICALIZE_FILE_NAME
+char *
+canonicalize_file_name (const char *name)
+{
+ char * buf;
+ int size;
+ char * result;
+
+#ifdef PATH_MAX
+ size = PATH_MAX;
+#else
+ /* Bigger is better; realpath has no way todo bounds checking. */
+ size = 4096;
+#endif
+
+ /* Just in case realpath does not NULL terminate the string
+ * or it just fits in SIZE without a NULL terminator. */
+ buf = calloc (size + 1, 1);
+ if (! buf) {
+ errno = ENOMEM;
+ return NULL;
+ }
+
+ result = realpath (name, buf);
+ if (! result)
+ free (buf);
+
+ return result;
+}
+#endif /* !HAVE_CANONICALIZE_FILE_NAME */
+
+static void
+_device_register (PedDevice* dev)
+{
+ PedDevice* walk;
+ for (walk = devices; walk && walk->next; walk = walk->next);
+ if (walk)
+ walk->next = dev;
+ else
+ devices = dev;
+ dev->next = NULL;
+}
+
+static void
+_device_unregister (PedDevice* dev)
+{
+ PedDevice* walk;
+ PedDevice* last = NULL;
+
+ for (walk = devices; walk != NULL; last = walk, walk = walk->next) {
+ if (walk == dev) break;
+ }
+
+ if (last)
+ last->next = dev->next;
+ else
+ devices = dev->next;
+}
+
+/**
+ * Returns the next device that was detected by ped_device_probe_all(), or
+ * calls to ped_device_get_next().
+ * If dev is NULL, returns the first device.
+ *
+ * \return NULL if dev is the last device.
+ */
+PedDevice*
+ped_device_get_next (const PedDevice* dev)
+{
+ if (dev)
+ return dev->next;
+ else
+ return devices;
+}
+
+void
+_ped_device_probe (const char* path)
+{
+ PedDevice* dev;
+
+ PED_ASSERT (path != NULL, return);
+
+ ped_exception_fetch_all ();
+ dev = ped_device_get (path);
+ if (!dev)
+ ped_exception_catch ();
+ ped_exception_leave_all ();
+}
+
+/**
+ * Attempts to detect all devices.
+ */
+void
+ped_device_probe_all ()
+{
+ ped_architecture->dev_ops->probe_all ();
+}
+
+/**
+ * Close/free all devices.
+ * Called by ped_done(), so you do not need to worry about it.
+ */
+void
+ped_device_free_all ()
+{
+ while (devices)
+ ped_device_destroy (devices);
+}
+
+/**
+ * Gets the device "name", where name is usually the block device, e.g.
+ * /dev/sdb. If the device wasn't detected with ped_device_probe_all(),
+ * an attempt will be made to detect it again. If it is found, it will
+ * be added to the list.
+ */
+PedDevice*
+ped_device_get (const char* path)
+{
+ PedDevice* walk;
+ char* normal_path;
+
+ PED_ASSERT (path != NULL, return NULL);
+ normal_path = canonicalize_file_name (path);
+ if (!normal_path)
+ /* Well, maybe it is just that the file does not exist.
+ * Try it anyway. */
+ normal_path = strdup (path);
+ if (!normal_path)
+ return NULL;
+
+ for (walk = devices; walk != NULL; walk = walk->next) {
+ if (!strcmp (walk->path, normal_path)) {
+ ped_free (normal_path);
+ return walk;
+ }
+ }
+
+ walk = ped_architecture->dev_ops->_new (normal_path);
+ ped_free (normal_path);
+ if (!walk)
+ return NULL;
+ _device_register (walk);
+ return walk;
+}
+
+/**
+ * Destroys a device and removes it from the device list, and frees
+ * all resources associated with the device (all resources allocated
+ * when the device was created).
+ */
+void
+ped_device_destroy (PedDevice* dev)
+{
+ _device_unregister (dev);
+
+ while (dev->open_count) {
+ if (!ped_device_close (dev))
+ break;
+ }
+
+ ped_architecture->dev_ops->destroy (dev);
+}
+
+int
+ped_device_is_busy (PedDevice* dev)
+{
+ return ped_architecture->dev_ops->is_busy (dev);
+}
+
+/**
+ * Attempt to open a device to allow use of read, write and sync functions.
+ *
+ * The meaning of "open" is architecture-dependent. Apart from requesting
+ * access to the device from the operating system, it does things like flushing
+ * caches.
+ * \note May allocate resources. Any resources allocated here will
+ * be freed by a final ped_device_close(). (ped_device_open() may be
+ * called multiple times -- it's a ref-count-like mechanism)
+ *
+ * \return zero on failure
+ */
+int
+ped_device_open (PedDevice* dev)
+{
+ int status;
+
+ PED_ASSERT (dev != NULL, return 0);
+ PED_ASSERT (!dev->external_mode, return 0);
+
+ if (dev->open_count)
+ status = ped_architecture->dev_ops->refresh_open (dev);
+ else
+ status = ped_architecture->dev_ops->open (dev);
+ if (status)
+ dev->open_count++;
+ return status;
+}
+
+/**
+ * Close dev.
+ * If this is the final close, then resources allocated by
+ * ped_device_open() are freed.
+ *
+ * \return zero on failure
+ */
+int
+ped_device_close (PedDevice* dev)
+{
+ PED_ASSERT (dev != NULL, return 0);
+ PED_ASSERT (!dev->external_mode, return 0);
+ PED_ASSERT (dev->open_count > 0, return 0);
+
+ if (--dev->open_count)
+ return ped_architecture->dev_ops->refresh_close (dev);
+ else
+ return ped_architecture->dev_ops->close (dev);
+}
+
+/**
+ * Begins external access mode. External access mode allows you to
+ * safely do IO on the device. If a PedDevice is open, then you should
+ * not do any IO on that device, e.g. by calling an external program
+ * like e2fsck, unless you put it in external access mode. You should
+ * not use any libparted commands that do IO to a device, e.g.
+ * ped_file_system_{open|resize|copy}, ped_disk_{read|write}), while
+ * a device is in external access mode.
+ * Also, you should not ped_device_close() a device, while it is
+ * in external access mode.
+ * Note: ped_device_begin_external_access_mode() does things like
+ * tell the kernel to flush its caches.
+ *
+ * Close a device while pretending it is still open.
+ * This is useful for temporarily suspending libparted access to the device
+ * in order for an external program to access it.
+ * (Running external programs while the device is open can cause cache
+ * coherency problems.)
+ *
+ * In particular, this function keeps track of dev->open_count, so that
+ * reference counting isn't screwed up.
+ *
+ * \return zero on failure.
+ */
+int
+ped_device_begin_external_access (PedDevice* dev)
+{
+ PED_ASSERT (dev != NULL, return 0);
+ PED_ASSERT (!dev->external_mode, return 0);
+
+ dev->external_mode = 1;
+ if (dev->open_count)
+ return ped_architecture->dev_ops->close (dev);
+ else
+ return 1;
+}
+
+/**
+ * \brief Complementary function to ped_device_begin_external_access.
+ *
+ * \note does things like tell the kernel to flush the device's cache.
+ *
+ * \return zero on failure.
+ */
+int
+ped_device_end_external_access (PedDevice* dev)
+{
+ PED_ASSERT (dev != NULL, return 0);
+ PED_ASSERT (dev->external_mode, return 0);
+
+ dev->external_mode = 0;
+ if (dev->open_count)
+ return ped_architecture->dev_ops->open (dev);
+ else
+ return 1;
+}
+
+/**
+ * \internal Read count sectors from dev into buffer, beginning with sector
+ * start.
+ *
+ * \return zero on failure.
+ */
+int
+ped_device_read (const PedDevice* dev, void* buffer, PedSector start,
+ PedSector count)
+{
+ PED_ASSERT (dev != NULL, return 0);
+ PED_ASSERT (buffer != NULL, return 0);
+ PED_ASSERT (!dev->external_mode, return 0);
+ PED_ASSERT (dev->open_count > 0, return 0);
+
+ return (ped_architecture->dev_ops->read) (dev, buffer, start, count);
+}
+
+/**
+ * \internal Write count sectors from buffer to dev, starting at sector
+ * start.
+ *
+ * \return zero on failure.
+ *
+ * \sa PedDevice::sector_size
+ * \sa PedDevice::phys_sector_size
+ */
+int
+ped_device_write (PedDevice* dev, const void* buffer, PedSector start,
+ PedSector count)
+{
+ PED_ASSERT (dev != NULL, return 0);
+ PED_ASSERT (buffer != NULL, return 0);
+ PED_ASSERT (!dev->external_mode, return 0);
+ PED_ASSERT (dev->open_count > 0, return 0);
+
+ return (ped_architecture->dev_ops->write) (dev, buffer, start, count);
+}
+
+PedSector
+ped_device_check (PedDevice* dev, void* buffer, PedSector start,
+ PedSector count)
+{
+ PED_ASSERT (dev != NULL, return 0);
+ PED_ASSERT (!dev->external_mode, return 0);
+ PED_ASSERT (dev->open_count > 0, return 0);
+
+ return (ped_architecture->dev_ops->check) (dev, buffer, start, count);
+}
+
+/**
+ * \internal Flushes all write-behind caches that might be holding up
+ * writes.
+ * It is slow because it guarantees cache coherency among all relevant caches.
+ *
+ * \return zero on failure
+ */
+int
+ped_device_sync (PedDevice* dev)
+{
+ PED_ASSERT (dev != NULL, return 0);
+ PED_ASSERT (!dev->external_mode, return 0);
+ PED_ASSERT (dev->open_count > 0, return 0);
+
+ return ped_architecture->dev_ops->sync (dev);
+}
+
+/**
+ * \internal Flushes all write-behind caches that might be holding writes.
+ * \warning Does NOT ensure cache coherency with other caches.
+ * If you need cache coherency, use ped_device_sync() instead.
+ *
+ * \return zero on failure
+ */
+int
+ped_device_sync_fast (PedDevice* dev)
+{
+ PED_ASSERT (dev != NULL, return 0);
+ PED_ASSERT (!dev->external_mode, return 0);
+ PED_ASSERT (dev->open_count > 0, return 0);
+
+ return ped_architecture->dev_ops->sync_fast (dev);
+}
+
+/**
+ * Get a constraint that represents hardware requirements on alignment and
+ * geometry.
+ * This is, for example, important for media that have a physical sector
+ * size that is a multiple of the logical sector size.
+ *
+ * \warning This function is experimental for physical sector sizes not equal to
+ * 2^9.
+ */
+PedConstraint*
+ped_device_get_constraint (PedDevice* dev)
+{
+ int multiplier = dev->phys_sector_size / dev->sector_size;
+
+ PedAlignment* start_align = ped_alignment_new (multiplier, multiplier);
+
+ PedConstraint* c = ped_constraint_new (
+ start_align, ped_alignment_any,
+ ped_geometry_new (dev, 0, dev->length),
+ ped_geometry_new (dev, 0, dev->length),
+ 1, dev->length);
+
+ return c;
+}
+
+/** @} */
+
diff --git a/libparted/disk.c b/libparted/disk.c
new file mode 100644
index 0000000..262c33e
--- /dev/null
+++ b/libparted/disk.c
@@ -0,0 +1,2250 @@
+ /*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005
+ Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+/** \file disk.c */
+
+/**
+ * \addtogroup PedDisk
+ *
+ * \brief Disk label access.
+ *
+ * Most programs will need to use ped_disk_new() or ped_disk_new_fresh() to get
+ * anything done. A PedDisk is always associated with a device and has a
+ * partition table. There are different types of partition tables (or disk
+ * labels). These are represented by the PedDiskType enumeration.
+ *
+ * @{
+ */
+
+#include "config.h"
+
+#include <parted/parted.h>
+#include <parted/debug.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+# define N_(String) (String)
+#else
+# define _(String) (String)
+# define N_(String) (String)
+#endif /* ENABLE_NLS */
+
+#include <string.h>
+
+/* UPDATE MODE functions */
+#ifdef DEBUG
+static int _disk_check_sanity (PedDisk* disk);
+#endif
+static void _disk_push_update_mode (PedDisk* disk);
+static void _disk_pop_update_mode (PedDisk* disk);
+static int _disk_raw_insert_before (PedDisk* disk, PedPartition* loc,
+ PedPartition* part);
+static int _disk_raw_insert_after (PedDisk* disk, PedPartition* loc,
+ PedPartition* part);
+static int _disk_raw_remove (PedDisk* disk, PedPartition* part);
+static int _disk_raw_add (PedDisk* disk, PedPartition* part);
+
+static PedDiskType* disk_types = NULL;
+
+void
+ped_register_disk_type (PedDiskType* type)
+{
+ PED_ASSERT (type != NULL, return);
+ PED_ASSERT (type->ops != NULL, return);
+ PED_ASSERT (type->name != NULL, return);
+
+ ((struct _PedDiskType*) type)->next = disk_types;
+ disk_types = (struct _PedDiskType*) type;
+}
+
+void ped_unregister_disk_type (PedDiskType* type)
+{
+ PedDiskType* walk;
+ PedDiskType* last = NULL;
+
+ PED_ASSERT (type != NULL, return);
+
+ for (walk = disk_types; walk != NULL; last = walk, walk = walk->next) {
+ if (walk == type) break;
+ }
+
+ if (last)
+ ((struct _PedDiskType*) last)->next = type->next;
+ else
+ disk_types = type->next;
+}
+
+/**
+ * Return the next disk type registers, after "type". If "type" is
+ * NULL, returns the first disk type.
+ *
+ * \return Next disk; NULL if "type" is the last registered disk type.
+ */
+PedDiskType*
+ped_disk_type_get_next (PedDiskType* type)
+{
+ if (type)
+ return type->next;
+ else
+ return disk_types;
+}
+
+/**
+ * Return the disk type with a name of "name".
+ *
+ * \return Disk type; NULL if no match.
+ */
+PedDiskType*
+ped_disk_type_get (const char* name)
+{
+ PedDiskType* walk = NULL;
+
+ PED_ASSERT (name != NULL, return NULL);
+
+ while (1) {
+ walk = ped_disk_type_get_next (walk);
+ if (!walk) break;
+ if (strcasecmp (walk->name, name) == 0) break;
+ }
+ return walk;
+}
+
+/**
+ * Return the type of partition table detected on "dev".
+ *
+ * \return Type; NULL if none was detected.
+ */
+PedDiskType*
+ped_disk_probe (PedDevice* dev)
+{
+ PedDiskType* walk = NULL;
+
+ PED_ASSERT (dev != NULL, return NULL);
+
+ if (!ped_device_open (dev))
+ return NULL;
+
+ ped_exception_fetch_all ();
+ while (1) {
+ walk = ped_disk_type_get_next (walk);
+ if (!walk) break;
+ if (walk->ops->probe (dev)) break;
+ }
+ if (ped_exception)
+ ped_exception_catch ();
+ ped_exception_leave_all ();
+
+ ped_device_close (dev);
+ return walk;
+}
+
+/**
+ * Read the partition table off a device (if one is found).
+ *
+ * \warning May modify \p dev->cylinders, \p dev->heads and \p dev->sectors
+ * if the partition table indicates that the existing values
+ * are incorrect.
+ *
+ * \return A new \link _PedDisk PedDisk \endlink object;
+ * NULL on failure (e.g. partition table not detected).
+ */
+PedDisk*
+ped_disk_new (PedDevice* dev)
+{
+ PedDiskType* type;
+ PedDisk* disk;
+
+ PED_ASSERT (dev != NULL, return NULL);
+
+ if (!ped_device_open (dev))
+ goto error;
+
+ type = ped_disk_probe (dev);
+ if (!type) {
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("Unable to open %s - unrecognised disk label."),
+ dev->path);
+ goto error_close_dev;
+ }
+ disk = ped_disk_new_fresh (dev, type);
+ if (!disk)
+ goto error_close_dev;
+ if (!type->ops->read (disk))
+ goto error_destroy_disk;
+ disk->needs_clobber = 0;
+ ped_device_close (dev);
+ return disk;
+
+error_destroy_disk:
+ ped_disk_destroy (disk);
+error_close_dev:
+ ped_device_close (dev);
+error:
+ return NULL;
+}
+
+static int
+_add_duplicate_part (PedDisk* disk, PedPartition* old_part)
+{
+ PedPartition* new_part;
+ PedConstraint* constraint_exact;
+
+ new_part = disk->type->ops->partition_duplicate (old_part);
+ if (!new_part)
+ goto error;
+ new_part->disk = disk;
+
+ constraint_exact = ped_constraint_exact (&new_part->geom);
+ if (!constraint_exact)
+ goto error_destroy_new_part;
+ if (!ped_disk_add_partition (disk, new_part, constraint_exact))
+ goto error_destroy_constraint_exact;
+ ped_constraint_destroy (constraint_exact);
+ return 1;
+
+error_destroy_constraint_exact:
+ ped_constraint_destroy (constraint_exact);
+error_destroy_new_part:
+ ped_partition_destroy (new_part);
+error:
+ return 0;
+}
+
+/**
+ * Clone a \link _PedDisk PedDisk \endlink object.
+ *
+ * \return Deep copy of \p old_disk, NULL on failure.
+ */
+PedDisk*
+ped_disk_duplicate (const PedDisk* old_disk)
+{
+ PedDisk* new_disk;
+ PedPartition* old_part;
+
+ PED_ASSERT (old_disk != NULL, return NULL);
+ PED_ASSERT (!old_disk->update_mode, return NULL);
+ PED_ASSERT (old_disk->type->ops->duplicate != NULL, return NULL);
+ PED_ASSERT (old_disk->type->ops->partition_duplicate != NULL,
+ return NULL);
+
+ new_disk = old_disk->type->ops->duplicate (old_disk);
+ if (!new_disk)
+ goto error;
+
+ _disk_push_update_mode (new_disk);
+ for (old_part = ped_disk_next_partition (old_disk, NULL); old_part;
+ old_part = ped_disk_next_partition (old_disk, old_part)) {
+ if (ped_partition_is_active (old_part)) {
+ if (!_add_duplicate_part (new_disk, old_part))
+ goto error_destroy_new_disk;
+ }
+ }
+ _disk_pop_update_mode (new_disk);
+ return new_disk;
+
+error_destroy_new_disk:
+ ped_disk_destroy (new_disk);
+error:
+ return NULL;
+}
+
+/**
+ * Remove all identifying signatures of a partition table,
+ * except for partition tables of a given type.
+ *
+ * \return 0 on error, 1 otherwise.
+ *
+ * \sa ped_disk_clobber()
+ */
+int
+ped_disk_clobber_exclude (PedDevice* dev, const PedDiskType* exclude)
+{
+ PedDiskType* walk;
+
+ PED_ASSERT (dev != NULL, goto error);
+
+ if (!ped_device_open (dev))
+ goto error;
+
+ for (walk = ped_disk_type_get_next (NULL); walk;
+ walk = ped_disk_type_get_next (walk)) {
+ int probed;
+
+ if (walk == exclude)
+ continue;
+
+ ped_exception_fetch_all ();
+ probed = walk->ops->probe (dev);
+ if (!probed)
+ ped_exception_catch ();
+ ped_exception_leave_all ();
+
+ if (probed && walk->ops->clobber) {
+ if (!walk->ops->clobber (dev))
+ goto error_close_dev;
+ }
+ }
+ ped_device_close (dev);
+ return 1;
+
+error_close_dev:
+ ped_device_close (dev);
+error:
+ return 0;
+}
+
+/**
+ * Remove all identifying signatures of a partition table,
+ *
+ * \return 0 on error, 1 otherwise.
+ *
+ * \sa ped_disk_clobber_exclude()
+ */
+int
+ped_disk_clobber (PedDevice* dev)
+{
+ return ped_disk_clobber_exclude (dev, NULL);
+}
+
+/**
+ * Create a new partition table on \p dev.
+ *
+ * This new partition table is only created in-memory, and nothing is written
+ * to disk until ped_disk_commit_to_dev() is called.
+ *
+ * \return The newly constructed \link _PedDisk PedDisk \endlink,
+ * NULL on failure.
+ */
+PedDisk*
+ped_disk_new_fresh (PedDevice* dev, const PedDiskType* type)
+{
+ PedDisk* disk;
+
+ PED_ASSERT (dev != NULL, return NULL);
+ PED_ASSERT (type != NULL, return NULL);
+ PED_ASSERT (type->ops->alloc != NULL, return NULL);
+
+ disk = type->ops->alloc (dev);
+ if (!disk)
+ goto error;
+ _disk_pop_update_mode (disk);
+ PED_ASSERT (disk->update_mode == 0, goto error_destroy_disk);
+
+ disk->needs_clobber = 1;
+ return disk;
+
+error_destroy_disk:
+ ped_disk_destroy (disk);
+error:
+ return NULL;
+}
+
+PedDisk*
+_ped_disk_alloc (const PedDevice* dev, const PedDiskType* disk_type)
+{
+ PedDisk* disk;
+
+ disk = (PedDisk*) ped_malloc (sizeof (PedDisk));
+ if (!disk)
+ goto error;
+
+ disk->dev = (PedDevice*)dev;
+ disk->type = disk_type;
+ disk->update_mode = 1;
+ disk->part_list = NULL;
+ return disk;
+
+error_free_disk:
+ ped_free (disk);
+error:
+ return NULL;
+}
+
+void
+_ped_disk_free (PedDisk* disk)
+{
+ _disk_push_update_mode (disk);
+ ped_disk_delete_all (disk);
+ ped_free (disk);
+}
+
+/**
+ * Close \p disk.
+ *
+ * What this function does depends on the PedDiskType of \p disk,
+ * but you can generally assume that outstanding writes are flushed
+ * (this mainly means that _ped_disk_free is called).
+ */
+void
+ped_disk_destroy (PedDisk* disk)
+{
+ PED_ASSERT (disk != NULL, return);
+ PED_ASSERT (!disk->update_mode, return);
+
+ disk->type->ops->free (disk);
+}
+
+/**
+ * Tell the operating system kernel about the partition table layout
+ * of \p disk.
+ *
+ * This is rather loosely defined: for example, on old versions of Linux,
+ * it simply calls the BLKRRPART ioctl, which tells the kernel to
+ * reread the partition table. On newer versions (2.4.x), it will
+ * use the new blkpg interface to tell Linux where each partition
+ * starts/ends, etc. In this case, Linux does not need to have support for
+ * a specific type of partition table.
+ *
+ * \return 0 on failure, 1 otherwise.
+ */
+int
+ped_disk_commit_to_os (PedDisk* disk)
+{
+ PED_ASSERT (disk != NULL, return 0);
+
+ if (!ped_device_open (disk->dev))
+ goto error;
+ if (!ped_architecture->disk_ops->disk_commit (disk))
+ goto error_close_dev;
+ ped_device_close (disk->dev);
+ return 1;
+
+error_close_dev:
+ ped_device_close (disk->dev);
+error:
+ return 0;
+}
+
+/**
+ * Write the changes made to the in-memory description
+ * of a partition table to the device.
+ *
+ * \return 0 on failure, 1 otherwise.
+ */
+int
+ped_disk_commit_to_dev (PedDisk* disk)
+{
+ PED_ASSERT (disk != NULL, goto error);
+ PED_ASSERT (!disk->update_mode, goto error);
+
+ if (!disk->type->ops->write) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("This libparted doesn't have write support for "
+ "%s. Perhaps it was compiled read-only."),
+ disk->type->name);
+ goto error;
+ }
+
+ if (!ped_device_open (disk->dev))
+ goto error;
+
+ if (disk->needs_clobber) {
+ if (!ped_disk_clobber_exclude (disk->dev, disk->type))
+ goto error_close_dev;
+ disk->needs_clobber = 0;
+ }
+ if (!disk->type->ops->write (disk))
+ goto error_close_dev;
+ ped_device_close (disk->dev);
+ return 1;
+
+error_close_dev:
+ ped_device_close (disk->dev);
+error:
+ return 0;
+}
+
+/*
+ * This function writes the in-memory changes to a partition table to
+ * disk and informs the operating system of the changes.
+ *
+ * \note Equivalent to calling first ped_disk_commit_to_dev(), then
+ * ped_disk_commit_to_os().
+ *
+ * \return 0 on failure, 1 otherwise.
+ */
+int
+ped_disk_commit (PedDisk* disk)
+{
+ if (!ped_disk_commit_to_dev (disk))
+ return 0;
+ return ped_disk_commit_to_os (disk);
+}
+
+/**
+ * \addtogroup PedPartition
+ *
+ * @{
+ */
+
+/**
+ * Check whether a partition is mounted or busy in some
+ * other way.
+ *
+ * \note An extended partition is busy if any logical partitions are mounted.
+ *
+ * \return \c 1 if busy.
+ */
+int
+ped_partition_is_busy (const PedPartition* part)
+{
+ PED_ASSERT (part != NULL, return 1);
+
+ return ped_architecture->disk_ops->partition_is_busy (part);
+}
+
+/**
+ * Return a path that can be used to address the partition in the
+ * operating system.
+ */
+char*
+ped_partition_get_path (const PedPartition* part)
+{
+ PED_ASSERT (part != NULL, return NULL);
+
+ return ped_architecture->disk_ops->partition_get_path (part);
+}
+
+/** @} */
+
+/**
+ * \addtogroup PedDisk
+ *
+ * @{
+ */
+
+/**
+ * Perform a sanity check on a partition table.
+ *
+ * \note The check performed is generic (i.e. it does not depends on the label
+ * type of the disk.
+ *
+ * \throws PED_EXCEPTION_WARNING if a partition type ID does not match the file
+ * system on it.
+ *
+ * \return 0 if the check fails, 1 otherwise.
+ */
+int
+ped_disk_check (PedDisk* disk)
+{
+ PedPartition* walk;
+
+ PED_ASSERT (disk != NULL, return 0);
+
+ for (walk = disk->part_list; walk;
+ walk = ped_disk_next_partition (disk, walk)) {
+ const PedFileSystemType* fs_type = walk->fs_type;
+ PedGeometry* geom;
+ PedSector length_error;
+ PedSector max_length_error;
+
+ if (!ped_partition_is_active (walk) || !fs_type)
+ continue;
+
+ geom = ped_file_system_probe_specific (fs_type, &walk->geom);
+ if (!geom)
+ continue;
+
+ length_error = abs (walk->geom.length - geom->length);
+ max_length_error = PED_MAX (4096, walk->geom.length / 100);
+ if (!ped_geometry_test_inside (&walk->geom, geom)
+ || length_error > max_length_error) {
+ char* part_size = ped_unit_format (disk->dev, walk->geom.length);
+ char* fs_size = ped_unit_format (disk->dev, geom->length);
+ PedExceptionOption choice;
+
+ choice = ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("Partition %d is %s, but the file system is "
+ "%s."),
+ walk->num, part_size, fs_size);
+
+ ped_free (part_size);
+ ped_free (fs_size);
+
+ if (choice != PED_EXCEPTION_IGNORE)
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
+/**
+ * This function checks if a particular type of partition table supports
+ * a feature.
+ *
+ * \return 1 if \p disk_type supports \p feature, 0 otherwise.
+ */
+int
+ped_disk_type_check_feature (const PedDiskType* disk_type,
+ PedDiskTypeFeature feature)
+{
+ return (disk_type->features & feature) != 0;
+}
+
+/**
+ * Get the number of primary partitions.
+ */
+int
+ped_disk_get_primary_partition_count (PedDisk* disk)
+{
+ PedPartition* walk;
+ int count = 0;
+
+ PED_ASSERT (disk != NULL, return 0);
+
+ for (walk = disk->part_list; walk;
+ walk = ped_disk_next_partition (disk, walk)) {
+ if (ped_partition_is_active (walk)
+ && ! (walk->type & PED_PARTITION_LOGICAL))
+ count++;
+ }
+
+ return count;
+}
+
+/**
+ * Get the highest partition number on \p disk.
+ */
+int
+ped_disk_get_last_partition_num (PedDisk* disk)
+{
+ PedPartition* walk;
+ int highest = -1;
+
+ PED_ASSERT (disk != NULL, return 0);
+
+ for (walk = disk->part_list; walk;
+ walk = ped_disk_next_partition (disk, walk)) {
+ if (walk->num > highest)
+ highest = walk->num;
+ }
+
+ return highest;
+}
+
+/**
+ * Get the maximum number of (primary) partitions the disk label supports.
+ *
+ * For example, MacIntosh partition maps can have different sizes,
+ * and accordingly support a different number of partitions.
+ */
+int
+ped_disk_get_max_primary_partition_count (const PedDisk* disk)
+{
+ PED_ASSERT (disk->type != NULL, return 0);
+ PED_ASSERT (disk->type->ops->get_max_primary_partition_count != NULL,
+ return 0);
+
+ return disk->type->ops->get_max_primary_partition_count (disk);
+}
+
+/**
+ * \internal We turned a really nasty bureaucracy problem into an elegant maths
+ * problem :-) Basically, there are some constraints to a partition's
+ * geometry:
+ *
+ * (1) it must start and end on a "disk" block, determined by the disk label
+ * (not the hardware). (constraint represented by a PedAlignment)
+ *
+ * (2) if we're resizing a partition, we MIGHT need to keep each block aligned.
+ * Eg: if an ext2 file system has 4k blocks, then we can only move the start
+ * by a multiple of 4k. (constraint represented by a PedAlignment)
+ *
+ * (3) we need to keep the start and end within the device's physical
+ * boundaries. (constraint represented by a PedGeometry)
+ *
+ * Satisfying (1) and (2) simultaneously required a bit of fancy maths ;-) See
+ * ped_alignment_intersect()
+ *
+ * The application of these constraints is in disk_*.c's *_partition_align()
+ * function.
+ */
+static int
+_partition_align (PedPartition* part, const PedConstraint* constraint)
+{
+ const PedDiskType* disk_type;
+
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->num != -1, return 0);
+ PED_ASSERT (part->disk != NULL, return 0);
+ disk_type = part->disk->type;
+ PED_ASSERT (disk_type != NULL, return 0);
+ PED_ASSERT (disk_type->ops->partition_align != NULL, return 0);
+ PED_ASSERT (part->disk->update_mode, return 0);
+
+ return disk_type->ops->partition_align (part, constraint);
+}
+
+static int
+_partition_enumerate (PedPartition* part)
+{
+ const PedDiskType* disk_type;
+
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->disk != NULL, return 0);
+ disk_type = part->disk->type;
+ PED_ASSERT (disk_type != NULL, return 0);
+ PED_ASSERT (disk_type->ops->partition_enumerate != NULL, return 0);
+
+ return disk_type->ops->partition_enumerate (part);
+}
+
+/**
+ * Gives all the (active) partitions a number. It should preserve the numbers
+ * and orders as much as possible.
+ */
+static int
+ped_disk_enumerate_partitions (PedDisk* disk)
+{
+ PedPartition* walk;
+ int i;
+ int end;
+
+ PED_ASSERT (disk != NULL, return 0);
+
+/* first "sort" already-numbered partitions. (e.g. if a logical partition
+ * is removed, then all logical partitions that were number higher MUST be
+ * renumbered)
+ */
+ end = ped_disk_get_last_partition_num (disk);
+ for (i=1; i<=end; i++) {
+ walk = ped_disk_get_partition (disk, i);
+ if (walk) {
+ if (!_partition_enumerate (walk))
+ return 0;
+ }
+ }
+
+/* now, number un-numbered partitions */
+ for (walk = disk->part_list; walk;
+ walk = ped_disk_next_partition (disk, walk)) {
+ if (ped_partition_is_active (walk) && walk->num == -1) {
+ if (!_partition_enumerate (walk))
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
+static int
+_disk_remove_metadata (PedDisk* disk)
+{
+ PedPartition* walk = NULL;
+ PedPartition* next;
+
+ PED_ASSERT (disk != NULL, return 0);
+
+ next = ped_disk_next_partition (disk, walk);
+
+ while (next) {
+ walk = next;
+ while (1) {
+ next = ped_disk_next_partition (disk, next);
+ if (!next || next->type & PED_PARTITION_METADATA)
+ break;
+ }
+ if (walk->type & PED_PARTITION_METADATA)
+ ped_disk_delete_partition (disk, walk);
+ }
+ return 1;
+}
+
+static int
+_disk_alloc_metadata (PedDisk* disk)
+{
+ PED_ASSERT (disk != NULL, return 0);
+
+ if (!disk->update_mode)
+ _disk_remove_metadata (disk);
+
+ return disk->type->ops->alloc_metadata (disk);
+}
+
+static int
+_disk_remove_freespace (PedDisk* disk)
+{
+ PedPartition* walk;
+ PedPartition* next;
+
+ walk = ped_disk_next_partition (disk, NULL);
+ for (; walk; walk = next) {
+ next = ped_disk_next_partition (disk, walk);
+
+ if (walk->type & PED_PARTITION_FREESPACE) {
+ _disk_raw_remove (disk, walk);
+ ped_partition_destroy (walk);
+ }
+ }
+
+ return 1;
+}
+
+static int
+_alloc_extended_freespace (PedDisk* disk)
+{
+ PedSector last_end;
+ PedPartition* walk;
+ PedPartition* last;
+ PedPartition* free_space;
+ PedPartition* extended_part;
+
+ extended_part = ped_disk_extended_partition (disk);
+ if (!extended_part)
+ return 1;
+
+ last_end = extended_part->geom.start;
+ last = NULL;
+
+ for (walk = extended_part->part_list; walk; walk = walk->next) {
+ if (walk->geom.start > last_end + 1) {
+ free_space = ped_partition_new (
+ disk,
+ PED_PARTITION_FREESPACE
+ | PED_PARTITION_LOGICAL,
+ NULL,
+ last_end + 1, walk->geom.start - 1);
+ _disk_raw_insert_before (disk, walk, free_space);
+ }
+
+ last = walk;
+ last_end = last->geom.end;
+ }
+
+ if (last_end < extended_part->geom.end) {
+ free_space = ped_partition_new (
+ disk,
+ PED_PARTITION_FREESPACE | PED_PARTITION_LOGICAL,
+ NULL,
+ last_end + 1, extended_part->geom.end);
+
+ if (last)
+ return _disk_raw_insert_after (disk, last, free_space);
+ else
+ extended_part->part_list = free_space;
+ }
+
+ return 1;
+}
+
+static int
+_disk_alloc_freespace (PedDisk* disk)
+{
+ PedSector last_end;
+ PedPartition* walk;
+ PedPartition* last;
+ PedPartition* free_space;
+
+ if (!_disk_remove_freespace (disk))
+ return 0;
+ if (!_alloc_extended_freespace (disk))
+ return 0;
+
+ last = NULL;
+ last_end = -1;
+
+ for (walk = disk->part_list; walk; walk = walk->next) {
+ if (walk->geom.start > last_end + 1) {
+ free_space = ped_partition_new (disk,
+ PED_PARTITION_FREESPACE, NULL,
+ last_end + 1, walk->geom.start - 1);
+ _disk_raw_insert_before (disk, walk, free_space);
+ }
+
+ last = walk;
+ last_end = last->geom.end;
+ }
+
+ if (last_end < disk->dev->length - 1) {
+ free_space = ped_partition_new (disk,
+ PED_PARTITION_FREESPACE, NULL,
+ last_end + 1, disk->dev->length - 1);
+ if (last)
+ return _disk_raw_insert_after (disk, last, free_space);
+ else
+ disk->part_list = free_space;
+ }
+
+ return 1;
+}
+
+/**
+ * Update mode: used when updating the internal representation of the partition
+ * table. In update mode, the metadata and freespace placeholder/virtual
+ * partitions are removed, making it much easier for various manipulation
+ * routines...
+ */
+static void
+_disk_push_update_mode (PedDisk* disk)
+{
+ if (!disk->update_mode) {
+#ifdef DEBUG
+ _disk_check_sanity (disk);
+#endif
+
+ _disk_remove_freespace (disk);
+ disk->update_mode++;
+ _disk_remove_metadata (disk);
+
+#ifdef DEBUG
+ _disk_check_sanity (disk);
+#endif
+ } else {
+ disk->update_mode++;
+ }
+}
+
+static void
+_disk_pop_update_mode (PedDisk* disk)
+{
+ PED_ASSERT (disk->update_mode, return);
+
+ if (disk->update_mode == 1) {
+ /* re-allocate metadata BEFORE leaving update mode, to prevent infinite
+ * recursion (metadata allocation requires update mode)
+ */
+#ifdef DEBUG
+ _disk_check_sanity (disk);
+#endif
+
+ _disk_alloc_metadata (disk);
+ disk->update_mode--;
+ _disk_alloc_freespace (disk);
+
+#ifdef DEBUG
+ _disk_check_sanity (disk);
+#endif
+ } else {
+ disk->update_mode--;
+ }
+}
+
+/** @} */
+
+/**
+ * \addtogroup PedPartition
+ *
+ * \brief Partition access.
+ *
+ * @{
+ */
+
+PedPartition*
+_ped_partition_alloc (const PedDisk* disk, PedPartitionType type,
+ const PedFileSystemType* fs_type,
+ PedSector start, PedSector end)
+{
+ PedPartition* part;
+
+ PED_ASSERT (disk != NULL, return 0);
+
+ part = (PedPartition*) ped_malloc (sizeof (PedPartition));
+ if (!part)
+ goto error;
+
+ part->prev = NULL;
+ part->next = NULL;
+
+ part->disk = (PedDisk*) disk;
+ if (!ped_geometry_init (&part->geom, disk->dev, start, end - start + 1))
+ goto error_free_part;
+
+ part->num = -1;
+ part->type = type;
+ part->part_list = NULL;
+ part->fs_type = fs_type;
+
+ return part;
+
+error_free_part:
+ ped_free (part);
+error:
+ return NULL;
+}
+
+void
+_ped_partition_free (PedPartition* part)
+{
+ ped_free (part);
+}
+
+int
+_ped_partition_attempt_align (PedPartition* part,
+ const PedConstraint* external,
+ PedConstraint* internal)
+{
+ PedConstraint* intersection;
+ PedGeometry* solution;
+
+ intersection = ped_constraint_intersect (external, internal);
+ ped_constraint_destroy (internal);
+ if (!intersection)
+ goto fail;
+
+ solution = ped_constraint_solve_nearest (intersection, &part->geom);
+ if (!solution)
+ goto fail_free_intersection;
+ ped_geometry_set (&part->geom, solution->start, solution->length);
+ ped_geometry_destroy (solution);
+ ped_constraint_destroy (intersection);
+ return 1;
+
+fail_free_intersection:
+ ped_constraint_destroy (intersection);
+fail:
+ return 0;
+}
+
+/**
+ * Create a new \link _PedPartition PedPartition \endlink on \p disk.
+ *
+ * \param type One of \p PED_PARTITION_PRIMARY, \p PED_PARTITION_EXTENDED,
+ * \p PED_PARTITION_LOGICAL.
+ *
+ * \note The constructed partition is not added to <tt>disk</tt>'s
+ * partition table. Use ped_disk_add_partition() to do this.
+ *
+ * \return A new \link _PedPartition PedPartition \endlink object,
+ * NULL on failure.
+ *
+ * \throws PED_EXCEPTION_ERROR if \p type is \p EXTENDED or \p LOGICAL but the
+ * label does not support this concept.
+ */
+PedPartition*
+ped_partition_new (const PedDisk* disk, PedPartitionType type,
+ const PedFileSystemType* fs_type, PedSector start,
+ PedSector end)
+{
+ int supports_extended;
+ PedPartition* part;
+
+ PED_ASSERT (disk != NULL, return NULL);
+ PED_ASSERT (disk->type->ops->partition_new != NULL, return NULL);
+
+ supports_extended = ped_disk_type_check_feature (disk->type,
+ PED_DISK_TYPE_EXTENDED);
+
+ if (!supports_extended
+ && (type == PED_PARTITION_EXTENDED
+ || type == PED_PARTITION_LOGICAL)) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("%s disk labels do not support extended "
+ "partitions."),
+ disk->type->name);
+ goto error;
+ }
+
+ part = disk->type->ops->partition_new (disk, type, fs_type, start, end);
+ if (!part)
+ goto error;
+
+ if (fs_type || part->type == PED_PARTITION_EXTENDED) {
+ if (!ped_partition_set_system (part, fs_type))
+ goto error_destroy_part;
+ }
+ return part;
+
+error_destroy_part:
+ ped_partition_destroy (part);
+error:
+ return NULL;
+}
+
+/**
+ * Destroy a \link _PedPartition PedPartition \endlink object.
+ *
+ * \note Should not be called on a partition that is in a partition table.
+ * Use ped_disk_delete_partition() instead.
+ */
+void
+ped_partition_destroy (PedPartition* part)
+{
+ PED_ASSERT (part != NULL, return);
+ PED_ASSERT (part->disk != NULL, return);
+ PED_ASSERT (part->disk->type->ops->partition_new != NULL, return);
+
+ part->disk->type->ops->partition_destroy (part);
+}
+
+
+/**
+ * Return whether or not the partition is "active".
+ *
+ * A partition is active if \p part->type is neither \p PED_PARTITION_METADATA
+ * nor \p PED_PARTITION_FREE.
+ */
+int
+ped_partition_is_active (const PedPartition* part)
+{
+ PED_ASSERT (part != NULL, return 0);
+
+ return !(part->type & PED_PARTITION_FREESPACE
+ || part->type & PED_PARTITION_METADATA);
+}
+
+/**
+ * Set the state (\c 1 or \c 0) of a flag on a partition.
+ *
+ * Flags are disk label specific, although they have a global
+ * "namespace": the flag PED_PARTITION_BOOT, for example, roughly means
+ * "this" partition is bootable". But this means different things on different
+ * disk labels (and may not be defined on some disk labels). For example,
+ * on MS-DOS disk labels, there can only be one boot partition, and this
+ * refers to the partition that will be booted from on startup. On PC98
+ * disk labels, the user can choose from any bootable partition on startup.
+ *
+ * \note It is an error to call this on an unavailable flag -- use
+ * ped_partition_is_flag_available() to determine which flags are available
+ * for a given disk label.
+ *
+ * \throws PED_EXCEPTION_ERROR if the requested flag is not available for this
+ * label.
+ */
+int
+ped_partition_set_flag (PedPartition* part, PedPartitionFlag flag, int state)
+{
+ PedDiskOps* ops;
+
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->disk != NULL, return 0);
+ PED_ASSERT (ped_partition_is_active (part), return 0);
+
+ ops = part->disk->type->ops;
+ PED_ASSERT (ops->partition_set_flag != NULL, return 0);
+ PED_ASSERT (ops->partition_is_flag_available != NULL, return 0);
+
+ if (!ops->partition_is_flag_available (part, flag)) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ "The flag '%s' is not available for %s disk labels.",
+ ped_partition_flag_get_name (flag),
+ part->disk->type->name);
+ return 0;
+ }
+
+ return ops->partition_set_flag (part, flag, state);
+}
+
+/**
+ * Get the state (\c 1 or \c 0) of a flag on a partition.
+ *
+ * See ped_partition_set_flag() for conditions that must hold.
+ *
+ * \todo Where's the check for flag availability?
+ */
+int
+ped_partition_get_flag (const PedPartition* part, PedPartitionFlag flag)
+{
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->disk != NULL, return 0);
+ PED_ASSERT (part->disk->type->ops->partition_get_flag != NULL,
+ return 0);
+ PED_ASSERT (ped_partition_is_active (part), return 0);
+
+ return part->disk->type->ops->partition_get_flag (part, flag);
+}
+
+/**
+ * Check whether a given flag is available on a partition.
+ *
+ * \return \c 1 if the flag is available.
+ */
+int
+ped_partition_is_flag_available (const PedPartition* part,
+ PedPartitionFlag flag)
+{
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->disk != NULL, return 0);
+ PED_ASSERT (part->disk->type->ops->partition_is_flag_available != NULL,
+ return 0);
+ PED_ASSERT (ped_partition_is_active (part), return 0);
+
+ return part->disk->type->ops->partition_is_flag_available (part, flag);
+}
+
+/**
+ * Sets the system type on the partition to \p fs_type.
+ *
+ * \note The file system may be opened, to get more information about the
+ * file system, e.g. to determine if it's FAT16 or FAT32.
+ *
+ * \return \c 0 on failure.
+ */
+int
+ped_partition_set_system (PedPartition* part, const PedFileSystemType* fs_type)
+{
+ PedFileSystem* fs;
+ const PedDiskType* disk_type;
+
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (ped_partition_is_active (part), return 0);
+ PED_ASSERT (part->disk != NULL, return 0);
+ disk_type = part->disk->type;
+ PED_ASSERT (disk_type != NULL, return 0);
+ PED_ASSERT (disk_type->ops != NULL, return 0);
+ PED_ASSERT (disk_type->ops->partition_set_system != NULL, return 0);
+
+ return disk_type->ops->partition_set_system (part, fs_type);
+}
+
+static int
+_assert_partition_name_feature (const PedDiskType* disk_type)
+{
+ if (!ped_disk_type_check_feature (
+ disk_type, PED_DISK_TYPE_PARTITION_NAME)) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ "%s disk labels do not support partition names.",
+ disk_type->name);
+ return 0;
+ }
+ return 1;
+}
+
+/**
+ * Sets the name of a partition.
+ *
+ * \note This will only work if the disk label supports it.
+ * You can use
+ * \code
+ * ped_disk_type_check_feature (part->disk->type, PED_DISK_TYPE_PARTITION_NAME);
+ * \endcode
+ * to check whether this feature is enabled for a label.
+ *
+ * \note \p name will not be modified by libparted. It can be freed
+ * by the caller immediately after ped_partition_set_name() is called.
+ *
+ * \return \c 1 on success, \c 0 otherwise.
+ */
+int
+ped_partition_set_name (PedPartition* part, const char* name)
+{
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->disk != NULL, return 0);
+ PED_ASSERT (ped_partition_is_active (part), return 0);
+ PED_ASSERT (name != NULL, return 0);
+
+ if (!_assert_partition_name_feature (part->disk->type))
+ return 0;
+
+ PED_ASSERT (part->disk->type->ops->partition_set_name != NULL,
+ return 0);
+ part->disk->type->ops->partition_set_name (part, name);
+ return 1;
+}
+
+/**
+ * Returns the name of a partition \p part. This will only work if the disk
+ * label supports it.
+ *
+ * \note The returned string should not be modified. It should
+ * not be referenced after the partition is destroyed.
+ */
+const char*
+ped_partition_get_name (const PedPartition* part)
+{
+ PED_ASSERT (part != NULL, return NULL);
+ PED_ASSERT (part->disk != NULL, return 0);
+ PED_ASSERT (ped_partition_is_active (part), return 0);
+
+ if (!_assert_partition_name_feature (part->disk->type))
+ return NULL;
+
+ PED_ASSERT (part->disk->type->ops->partition_get_name != NULL,
+ return NULL);
+ return part->disk->type->ops->partition_get_name (part);
+}
+
+/** @} */
+
+/**
+ * \addtogroup PedDisk
+ *
+ * @{
+ */
+
+PedPartition*
+ped_disk_extended_partition (const PedDisk* disk)
+{
+ PedPartition* walk;
+
+ PED_ASSERT (disk != NULL, return 0);
+
+ for (walk = disk->part_list; walk; walk = walk->next) {
+ if (walk->type == PED_PARTITION_EXTENDED)
+ break;
+ }
+ return walk;
+}
+
+/**
+ * Return the next partition after \p part on \p disk. If \p part is \c NULL,
+ * return the first partition. If \p part is the last partition, returns
+ * \c NULL. If \p part is an extended partition, returns the first logical
+ * partition. If this is called repeatedly passing the return value as \p part,
+ * a depth-first traversal is executed.
+ *
+ * \return The next partition, \c NULL if no more partitions left.
+ */
+PedPartition*
+ped_disk_next_partition (const PedDisk* disk, const PedPartition* part)
+{
+ PED_ASSERT (disk != NULL, return 0);
+
+ if (!part)
+ return disk->part_list;
+ if (part->type == PED_PARTITION_EXTENDED)
+ return part->part_list ? part->part_list : part->next;
+ if (part->next)
+ return part->next;
+ if (part->type & PED_PARTITION_LOGICAL)
+ return ped_disk_extended_partition (disk)->next;
+ return NULL;
+}
+
+/** @} */
+
+#ifdef DEBUG
+static int
+_disk_check_sanity (PedDisk* disk)
+{
+ PedPartition* walk;
+
+ PED_ASSERT (disk != NULL, return 0);
+
+ for (walk = disk->part_list; walk; walk = walk->next) {
+ PED_ASSERT (!(walk->type & PED_PARTITION_LOGICAL), return 0);
+ PED_ASSERT (!walk->prev || walk->prev->next == walk, return 0);
+ }
+
+ if (!ped_disk_extended_partition (disk))
+ return 1;
+
+ for (walk = ped_disk_extended_partition (disk)->part_list; walk;
+ walk = walk->next) {
+ PED_ASSERT (walk->type & PED_PARTITION_LOGICAL, return 0);
+ if (walk->prev)
+ PED_ASSERT (walk->prev->next == walk, return 0);
+ }
+ return 1;
+}
+#endif
+
+/**
+ * Returns the partition numbered \p num.
+ *
+ * \return \c NULL if the specified partition does not exist.
+ */
+PedPartition*
+ped_disk_get_partition (const PedDisk* disk, int num)
+{
+ PedPartition* walk;
+
+ PED_ASSERT (disk != NULL, return 0);
+
+ for (walk = disk->part_list; walk;
+ walk = ped_disk_next_partition (disk, walk)) {
+ if (walk->num == num && !(walk->type & PED_PARTITION_FREESPACE))
+ return walk;
+ }
+
+ return NULL;
+}
+
+/**
+ * Returns the partition that contains sect. If sect lies within a logical
+ * partition, then the logical partition is returned (not the extended
+ * partition).
+ */
+PedPartition*
+ped_disk_get_partition_by_sector (const PedDisk* disk, PedSector sect)
+{
+ PedPartition* walk;
+
+ PED_ASSERT (disk != NULL, return 0);
+
+ for (walk = disk->part_list; walk;
+ walk = ped_disk_next_partition (disk, walk)) {
+ if (ped_geometry_test_sector_inside (&walk->geom, sect)
+ && walk->type != PED_PARTITION_EXTENDED)
+ return walk;
+ }
+
+ /* should never get here, unless sect is outside of disk's useable
+ * part, or we're in "update mode", and the free space place-holders
+ * have been removed with _disk_remove_freespace()
+ */
+ return NULL;
+}
+
+/* I'm beginning to agree with Sedgewick :-/ */
+static int
+_disk_raw_insert_before (PedDisk* disk, PedPartition* loc, PedPartition* part)
+{
+ PED_ASSERT (disk != NULL, return 0);
+ PED_ASSERT (loc != NULL, return 0);
+ PED_ASSERT (part != NULL, return 0);
+
+ part->prev = loc->prev;
+ part->next = loc;
+ if (part->prev) {
+ part->prev->next = part;
+ } else {
+ if (loc->type & PED_PARTITION_LOGICAL)
+ ped_disk_extended_partition (disk)->part_list = part;
+ else
+ disk->part_list = part;
+ }
+ loc->prev = part;
+
+ return 1;
+}
+
+static int
+_disk_raw_insert_after (PedDisk* disk, PedPartition* loc, PedPartition* part)
+{
+ PED_ASSERT (disk != NULL, return 0);
+ PED_ASSERT (loc != NULL, return 0);
+ PED_ASSERT (part != NULL, return 0);
+
+ part->prev = loc;
+ part->next = loc->next;
+ if (loc->next)
+ loc->next->prev = part;
+ loc->next = part;
+
+ return 1;
+}
+
+static int
+_disk_raw_remove (PedDisk* disk, PedPartition* part)
+{
+ PED_ASSERT (disk != NULL, return 0);
+ PED_ASSERT (part != NULL, return 0);
+
+ if (part->prev) {
+ part->prev->next = part->next;
+ if (part->next)
+ part->next->prev = part->prev;
+ } else {
+ if (part->type & PED_PARTITION_LOGICAL) {
+ ped_disk_extended_partition (disk)->part_list
+ = part->next;
+ } else {
+ disk->part_list = part->next;
+ }
+ if (part->next)
+ part->next->prev = NULL;
+ }
+
+ return 1;
+}
+
+/*
+ *UPDATE MODE ONLY
+ */
+static int
+_disk_raw_add (PedDisk* disk, PedPartition* part)
+{
+ PedPartition* walk;
+ PedPartition* last;
+ PedPartition* ext_part;
+
+ PED_ASSERT (disk->update_mode, return 0);
+
+ ext_part = ped_disk_extended_partition (disk);
+
+ last = NULL;
+ walk = (part->type & PED_PARTITION_LOGICAL) ?
+ ext_part->part_list : disk->part_list;
+
+ for (; walk; last = walk, walk = walk->next) {
+ if (walk->geom.start > part->geom.end)
+ break;
+ }
+
+ if (walk) {
+ return _disk_raw_insert_before (disk, walk, part);
+ } else {
+ if (last) {
+ return _disk_raw_insert_after (disk, last, part);
+ } else {
+ if (part->type & PED_PARTITION_LOGICAL)
+ ext_part->part_list = part;
+ else
+ disk->part_list = part;
+ }
+ }
+
+ return 1;
+}
+
+static PedConstraint*
+_partition_get_overlap_constraint (PedPartition* part, PedGeometry* geom)
+{
+ PedSector min_start;
+ PedSector max_end;
+ PedPartition* walk;
+ PedGeometry free_space;
+
+ PED_ASSERT (part->disk->update_mode, return NULL);
+ PED_ASSERT (part->geom.dev == geom->dev, return NULL);
+
+ if (part->type & PED_PARTITION_LOGICAL) {
+ PedPartition* ext_part;
+
+ ext_part = ped_disk_extended_partition (part->disk);
+ PED_ASSERT (ext_part != NULL, return NULL);
+
+ min_start = ext_part->geom.start;
+ max_end = ext_part->geom.end;
+ walk = ext_part->part_list;
+ } else {
+ min_start = 0;
+ max_end = part->disk->dev->length - 1;
+ walk = part->disk->part_list;
+ }
+
+ while (walk != NULL
+ && (walk->geom.start < geom->start
+ || min_start >= walk->geom.start)) {
+ if (walk != part)
+ min_start = walk->geom.end + 1;
+ walk = walk->next;
+ }
+
+ if (walk == part)
+ walk = walk->next;
+
+ if (walk)
+ max_end = walk->geom.start - 1;
+
+ if (min_start >= max_end)
+ return NULL;
+
+ ped_geometry_init (&free_space, part->disk->dev,
+ min_start, max_end - min_start + 1);
+ return ped_constraint_new_from_max (&free_space);
+}
+
+/*
+ * Returns \c 0 if the partition, \p part overlaps with any partitions on the
+ * \p disk. The geometry of \p part is taken to be \p geom, NOT \p part->geom
+ * (the idea here is to check if \p geom is valid, before changing \p part).
+ *
+ * This is useful for seeing if a resized partitions new geometry is going to
+ * fit, without the existing geomtry getting in the way.
+ *
+ * Note: overlap with an extended partition is also allowed, provided that
+ * \p geom lies completely inside the extended partition.
+ */
+static int
+_disk_check_part_overlaps (PedDisk* disk, PedPartition* part)
+{
+ PedPartition* walk;
+
+ PED_ASSERT (disk != NULL, return 0);
+ PED_ASSERT (part != NULL, return 0);
+
+ for (walk = ped_disk_next_partition (disk, NULL); walk;
+ walk = ped_disk_next_partition (disk, walk)) {
+ if (walk->type & PED_PARTITION_FREESPACE)
+ continue;
+ if (walk == part)
+ continue;
+ if (part->type & PED_PARTITION_EXTENDED
+ && walk->type & PED_PARTITION_LOGICAL)
+ continue;
+
+ if (ped_geometry_test_overlap (&walk->geom, &part->geom)) {
+ if (walk->type & PED_PARTITION_EXTENDED
+ && part->type & PED_PARTITION_LOGICAL
+ && ped_geometry_test_inside (&walk->geom,
+ &part->geom))
+ continue;
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
+static int
+_partition_check_basic_sanity (PedDisk* disk, PedPartition* part)
+{
+ PedPartition* ext_part = ped_disk_extended_partition (disk);
+
+ PED_ASSERT (part->disk == disk, return 0);
+
+ PED_ASSERT (part->geom.start >= 0, return 0);
+ PED_ASSERT (part->geom.end < disk->dev->length, return 0);
+ PED_ASSERT (part->geom.start <= part->geom.end, return 0);
+
+ if (!ped_disk_type_check_feature (disk->type, PED_DISK_TYPE_EXTENDED)
+ && (part->type == PED_PARTITION_EXTENDED
+ || part->type == PED_PARTITION_LOGICAL)) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("%s disk labels don't support logical or extended "
+ "partitions."),
+ disk->type->name);
+ return 0;
+ }
+
+ if (ped_partition_is_active (part)
+ && ! (part->type & PED_PARTITION_LOGICAL)) {
+ if (ped_disk_get_primary_partition_count (disk) + 1
+ > ped_disk_get_max_primary_partition_count (disk)) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Too many primary partitions."));
+ return 0;
+ }
+ }
+
+ if ((part->type & PED_PARTITION_LOGICAL) && !ext_part) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Can't add a logical partition to %s, because "
+ "there is no extended partition."),
+ disk->dev->path);
+ return 0;
+ }
+
+ return 1;
+}
+
+static int
+_check_extended_partition (PedDisk* disk, PedPartition* part)
+{
+ PedPartition* walk;
+ PedPartition* ext_part;
+
+ PED_ASSERT (disk != NULL, return 0);
+ ext_part = ped_disk_extended_partition (disk);
+ if (!ext_part) ext_part = part;
+ PED_ASSERT (ext_part != NULL, return 0);
+
+ if (part != ext_part) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Can't have more than one extended partition on %s."),
+ disk->dev->path);
+ return 0;
+ }
+
+ for (walk = ext_part->part_list; walk; walk = walk->next) {
+ if (!ped_geometry_test_inside (&ext_part->geom, &walk->geom)) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Can't have logical partitions outside of "
+ "the extended partition."));
+ return 0;
+ }
+ }
+ return 1;
+}
+
+static int
+_check_partition (PedDisk* disk, PedPartition* part)
+{
+ PedPartition* ext_part = ped_disk_extended_partition (disk);
+
+ PED_ASSERT (part->geom.start <= part->geom.end, return 0);
+
+ if (part->type == PED_PARTITION_EXTENDED) {
+ if (!_check_extended_partition (disk, part))
+ return 0;
+ }
+
+ if (part->type & PED_PARTITION_LOGICAL
+ && !ped_geometry_test_inside (&ext_part->geom, &part->geom)) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Can't have a logical partition outside of the "
+ "extended partition on %s."),
+ disk->dev->path);
+ return 0;
+ }
+
+ if (!_disk_check_part_overlaps (disk, part)) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Can't have overlapping partitions."));
+ return 0;
+ }
+
+ if (! (part->type & PED_PARTITION_LOGICAL)
+ && ext_part && ext_part != part
+ && ped_geometry_test_inside (&ext_part->geom, &part->geom)) {
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("Can't have a primary partition inside an extended "
+ "partition."));
+ return 0;
+ }
+
+ return 1;
+}
+
+/**
+ * Adds PedPartition \p part to PedPartition \p disk.
+ *
+ * \warning The partition's geometry may be changed, subject to \p constraint.
+ * You could set \p constraint to <tt>ped_constraint_exact(&part->geom)</tt>,
+ * but many partition table schemes have special requirements on the start
+ * and end of partitions. Therefore, having an overly strict constraint
+ * will probably mean that this function will fail (in which
+ * case \p part will be left unmodified)
+ * \p part is assigned a number (\p part->num) in this process.
+ *
+ * \return \c 0 on failure.
+ */
+int
+ped_disk_add_partition (PedDisk* disk, PedPartition* part,
+ const PedConstraint* constraint)
+{
+ PedConstraint* overlap_constraint = NULL;
+ PedConstraint* constraints = NULL;
+
+ PED_ASSERT (disk != NULL, return 0);
+ PED_ASSERT (part != NULL, return 0);
+
+ if (!_partition_check_basic_sanity (disk, part))
+ return 0;
+
+ _disk_push_update_mode (disk);
+
+ if (ped_partition_is_active (part)) {
+ overlap_constraint
+ = _partition_get_overlap_constraint (part, &part->geom);
+ constraints = ped_constraint_intersect (overlap_constraint,
+ constraint);
+
+ if (!constraints && constraint) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Can't have overlapping partitions."));
+ goto error;
+ }
+
+ if (!_partition_enumerate (part))
+ goto error;
+ if (!_partition_align (part, constraints))
+ goto error;
+ }
+ if (!_check_partition (disk, part))
+ goto error;
+ if (!_disk_raw_add (disk, part))
+ goto error;
+
+ ped_constraint_destroy (overlap_constraint);
+ ped_constraint_destroy (constraints);
+ _disk_pop_update_mode (disk);
+#ifdef DEBUG
+ if (!_disk_check_sanity (disk))
+ return 0;
+#endif
+ return 1;
+
+error:
+ ped_constraint_destroy (overlap_constraint);
+ ped_constraint_destroy (constraints);
+ _disk_pop_update_mode (disk);
+ return 0;
+}
+
+/**
+ * Removes PedPartition \p part from PedDisk \p disk.
+ *
+ * If \p part is an extended partition, it must not contain any logical
+ * partitions. \p part is *NOT* destroyed. The caller must call
+ * ped_partition_destroy(), or use ped_disk_delete_partition() instead.
+ *
+ * \return \c 0 on error.
+ */
+int
+ped_disk_remove_partition (PedDisk* disk, PedPartition* part)
+{
+ PED_ASSERT (disk != NULL, return 0);
+ PED_ASSERT (part != NULL, return 0);
+
+ _disk_push_update_mode (disk);
+ PED_ASSERT (part->part_list == NULL, goto error);
+ _disk_raw_remove (disk, part);
+ _disk_pop_update_mode (disk);
+ ped_disk_enumerate_partitions (disk);
+ return 1;
+
+error:
+ _disk_pop_update_mode (disk);
+ return 0;
+}
+
+static int
+ped_disk_delete_all_logical (PedDisk* disk);
+
+/**
+ * Removes \p part from \p disk, and destroys \p part.
+ *
+ * \return \c 0 on failure.
+ */
+int
+ped_disk_delete_partition (PedDisk* disk, PedPartition* part)
+{
+ PED_ASSERT (disk != NULL, return 0);
+ PED_ASSERT (part != NULL, return 0);
+
+ _disk_push_update_mode (disk);
+ if (part->type == PED_PARTITION_EXTENDED)
+ ped_disk_delete_all_logical (disk);
+ ped_disk_remove_partition (disk, part);
+ ped_partition_destroy (part);
+ _disk_pop_update_mode (disk);
+
+ return 1;
+}
+
+static int
+ped_disk_delete_all_logical (PedDisk* disk)
+{
+ PedPartition* walk;
+ PedPartition* next;
+ PedPartition* ext_part;
+
+ PED_ASSERT (disk != NULL, return 0);
+ ext_part = ped_disk_extended_partition (disk);
+ PED_ASSERT (ext_part != NULL, return 0);
+
+ for (walk = ext_part->part_list; walk; walk = next) {
+ next = walk->next;
+
+ if (!ped_disk_delete_partition (disk, walk))
+ return 0;
+ }
+ return 1;
+}
+
+/**
+ * Removes and destroys all partitions on \p disk.
+ *
+ * \return \c 0 on failure.
+ */
+int
+ped_disk_delete_all (PedDisk* disk)
+{
+ PedPartition* walk;
+ PedPartition* next;
+
+ PED_ASSERT (disk != NULL, return 0);
+
+ _disk_push_update_mode (disk);
+
+ for (walk = disk->part_list; walk; walk = next) {
+ next = walk->next;
+
+ if (!ped_disk_delete_partition (disk, walk))
+ return 0;
+ }
+
+ _disk_pop_update_mode (disk);
+
+ return 1;
+}
+
+/**
+ * Sets the geometry of \p part (i.e. change a partitions location). This can
+ * fail for many reasons, e.g. can't overlap with other partitions. If it
+ * does fail, \p part will remain unchanged. Returns \c 0 on failure. \p part's
+ * geometry may be set to something different from \p start and \p end subject
+ * to \p constraint.
+ *
+ * \warning The constraint warning from ped_disk_add_partition() applies.
+ *
+ * \note this function does not modify the contents of the partition. You need
+ * to call ped_file_system_resize() separately.
+ */
+int
+ped_disk_set_partition_geom (PedDisk* disk, PedPartition* part,
+ const PedConstraint* constraint,
+ PedSector start, PedSector end)
+{
+ PedConstraint* overlap_constraint = NULL;
+ PedConstraint* constraints = NULL;
+ PedGeometry old_geom;
+ PedGeometry new_geom;
+
+ PED_ASSERT (disk != NULL, return 0);
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->disk == disk, return 0);
+
+ old_geom = part->geom;
+ ped_geometry_init (&new_geom, part->geom.dev, start, end - start + 1);
+
+ _disk_push_update_mode (disk);
+
+ overlap_constraint
+ = _partition_get_overlap_constraint (part, &new_geom);
+ constraints = ped_constraint_intersect (overlap_constraint, constraint);
+ if (!constraints && constraint) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Can't have overlapping partitions."));
+ goto error_pop_update_mode;
+ }
+
+ part->geom = new_geom;
+ if (!_partition_align (part, constraints))
+ goto error_pop_update_mode;
+ if (!_check_partition (disk, part))
+ goto error_pop_update_mode;
+
+ /* remove and add, to ensure the ordering gets updated if necessary */
+ _disk_raw_remove (disk, part);
+ _disk_raw_add (disk, part);
+
+ _disk_pop_update_mode (disk);
+
+ ped_constraint_destroy (overlap_constraint);
+ ped_constraint_destroy (constraints);
+ return 1;
+
+error_pop_update_mode:
+ _disk_pop_update_mode (disk);
+error:
+ ped_constraint_destroy (overlap_constraint);
+ ped_constraint_destroy (constraints);
+ part->geom = old_geom;
+ return 0;
+}
+
+/**
+ * Grow PedPartition \p part geometry to the maximum possible subject to
+ * \p constraint. The new geometry will be a superset of the old geometry.
+ *
+ * \return 0 on failure
+ */
+int
+ped_disk_maximize_partition (PedDisk* disk, PedPartition* part,
+ const PedConstraint* constraint)
+{
+ PedGeometry old_geom;
+ PedSector global_min_start;
+ PedSector global_max_end;
+ PedSector new_start;
+ PedSector new_end;
+ PedPartition* ext_part = ped_disk_extended_partition (disk);
+ PedConstraint* constraint_any;
+
+ PED_ASSERT (disk != NULL, return 0);
+ PED_ASSERT (part != NULL, return 0);
+
+ if (part->type & PED_PARTITION_LOGICAL) {
+ PED_ASSERT (ext_part != NULL, return 0);
+ global_min_start = ext_part->geom.start;
+ global_max_end = ext_part->geom.end;
+ } else {
+ global_min_start = 0;
+ global_max_end = disk->dev->length - 1;
+ }
+
+ old_geom = part->geom;
+
+ _disk_push_update_mode (disk);
+
+ if (part->prev)
+ new_start = part->prev->geom.end + 1;
+ else
+ new_start = global_min_start;
+
+ if (part->next)
+ new_end = part->next->geom.start - 1;
+ else
+ new_end = global_max_end;
+
+ if (!ped_disk_set_partition_geom (disk, part, constraint, new_start,
+ new_end))
+ goto error;
+
+ _disk_pop_update_mode (disk);
+ return 1;
+
+error:
+ constraint_any = ped_constraint_any (disk->dev);
+ ped_disk_set_partition_geom (disk, part, constraint_any,
+ old_geom.start, old_geom.end);
+ ped_constraint_destroy (constraint_any);
+ _disk_pop_update_mode (disk);
+ return 0;
+}
+
+/**
+ * Get the maximum geometry \p part can be grown to, subject to
+ * \p constraint.
+ *
+ * \return \c NULL on failure.
+ */
+PedGeometry*
+ped_disk_get_max_partition_geometry (PedDisk* disk, PedPartition* part,
+ const PedConstraint* constraint)
+{
+ PedGeometry old_geom;
+ PedGeometry* max_geom;
+ PedConstraint* constraint_exact;
+
+ PED_ASSERT(disk != NULL, return NULL);
+ PED_ASSERT(part != NULL, return NULL);
+ PED_ASSERT(ped_partition_is_active (part), return NULL);
+
+ old_geom = part->geom;
+ if (!ped_disk_maximize_partition (disk, part, constraint))
+ return NULL;
+ max_geom = ped_geometry_duplicate (&part->geom);
+
+ constraint_exact = ped_constraint_exact (&old_geom);
+ ped_disk_set_partition_geom (disk, part, constraint_exact,
+ old_geom.start, old_geom.end);
+ ped_constraint_destroy (constraint_exact);
+
+ /* this assertion should never fail, because the old
+ * geometry was valid
+ */
+ PED_ASSERT (ped_geometry_test_equal (&part->geom, &old_geom),
+ return NULL);
+
+ return max_geom;
+}
+
+/**
+ * Reduce the size of the extended partition to a minimum while still wrapping
+ * its logical partitions. If there are no logical partitions, remove the
+ * extended partition.
+ *
+ * \return 0 on failure.
+ */
+int
+ped_disk_minimize_extended_partition (PedDisk* disk)
+{
+ PedPartition* first_logical;
+ PedPartition* last_logical;
+ PedPartition* walk;
+ PedPartition* ext_part;
+ PedConstraint* constraint;
+ int status;
+
+ PED_ASSERT (disk != NULL, return 0);
+
+ ext_part = ped_disk_extended_partition (disk);
+ if (!ext_part)
+ return 1;
+
+ _disk_push_update_mode (disk);
+
+ first_logical = ext_part->part_list;
+ if (!first_logical) {
+ _disk_pop_update_mode (disk);
+ return ped_disk_delete_partition (disk, ext_part);
+ }
+
+ for (walk = first_logical; walk->next; walk = walk->next);
+ last_logical = walk;
+
+ constraint = ped_constraint_any (disk->dev);
+ status = ped_disk_set_partition_geom (disk, ext_part, constraint,
+ first_logical->geom.start,
+ last_logical->geom.end);
+ ped_constraint_destroy (constraint);
+
+ _disk_pop_update_mode (disk);
+ return status;
+}
+
+/**
+ * @}
+ */
+
+/**
+ * \addtogroup PedPartition
+ *
+ * @{
+ */
+
+/**
+ * Returns a name that seems mildly appropriate for a partition type \p type.
+ *
+ * Eg, if you pass (PED_PARTITION_LOGICAL & PED_PARTITION_FREESPACE), it
+ * will return "free". This isn't to be taken too seriously - it's just
+ * useful for user interfaces, so you can show the user something ;-)
+ *
+ * \note The returned string will be in English. However,
+ * translations are provided, so the caller can call
+ * dgettext("parted", RESULT) on the result.
+ *
+ */
+const char*
+ped_partition_type_get_name (PedPartitionType type)
+{
+ if (type & PED_PARTITION_METADATA)
+ return N_("metadata");
+ else if (type & PED_PARTITION_FREESPACE)
+ return N_("free");
+ else if (type & PED_PARTITION_EXTENDED)
+ return N_("extended");
+ else if (type & PED_PARTITION_LOGICAL)
+ return N_("logical");
+ else
+ return N_("primary");
+}
+
+
+/**
+ * Returns a name for a \p flag, e.g. PED_PARTITION_BOOT will return "boot".
+ *
+ * \note The returned string will be in English. However,
+ * translations are provided, so the caller can call
+ * dgettext("parted", RESULT) on the result.
+ */
+const char*
+ped_partition_flag_get_name (PedPartitionFlag flag)
+{
+ switch (flag) {
+ case PED_PARTITION_BOOT:
+ return N_("boot");
+ case PED_PARTITION_ROOT:
+ return N_("root");
+ case PED_PARTITION_SWAP:
+ return N_("swap");
+ case PED_PARTITION_HIDDEN:
+ return N_("hidden");
+ case PED_PARTITION_RAID:
+ return N_("raid");
+ case PED_PARTITION_LVM:
+ return N_("lvm");
+ case PED_PARTITION_LBA:
+ return N_("lba");
+ case PED_PARTITION_HPSERVICE:
+ return N_("hp-service");
+ case PED_PARTITION_PALO:
+ return N_("palo");
+ case PED_PARTITION_PREP:
+ return N_("prep");
+ case PED_PARTITION_MSFT_RESERVED:
+ return N_("msftres");
+
+ default:
+ ped_exception_throw (
+ PED_EXCEPTION_BUG,
+ PED_EXCEPTION_CANCEL,
+ _("Unknown partition flag, %d."),
+ flag);
+ return NULL;
+ }
+}
+
+/**
+ * Iterates through all flags.
+ *
+ * ped_partition_flag_next(0) returns the first flag
+ *
+ * \return the next flag, or 0 if there are no more flags
+ */
+PedPartitionFlag
+ped_partition_flag_next (PedPartitionFlag flag)
+{
+ return (flag + 1) % (PED_PARTITION_LAST_FLAG + 1);
+}
+
+/**
+ * Returns the flag associated with \p name.
+ *
+ * \p name can be the English
+ * string, or the translation for the native language.
+ */
+PedPartitionFlag
+ped_partition_flag_get_by_name (const char* name)
+{
+ PedPartitionFlag flag;
+ const char* flag_name;
+
+ for (flag = ped_partition_flag_next (0); flag;
+ flag = ped_partition_flag_next (flag)) {
+ flag_name = ped_partition_flag_get_name (flag);
+ if (strcasecmp (name, flag_name) == 0
+ || strcasecmp (name, _(flag_name)) == 0)
+ return flag;
+ }
+
+ return 0;
+}
+
+void
+ped_partition_print (PedPartition* part)
+{
+ PED_ASSERT (part != NULL, return);
+
+ printf (" %-10s %02d (%d->%d)\n",
+ ped_partition_type_get_name (part->type),
+ part->num,
+ (int) part->geom.start, (int) part->geom.end);
+}
+
+/** @} */
+
+/**
+ * \addtogroup PedDisk
+ *
+ * @{
+ */
+
+/**
+ * Prints a summary of disk's partitions. Useful for debugging.
+ */
+void
+ped_disk_print (PedDisk* disk)
+{
+ PedPartition* part;
+
+ PED_ASSERT (disk != NULL, return);
+
+ for (part = disk->part_list; part;
+ part = ped_disk_next_partition (disk, part))
+ ped_partition_print (part);
+}
+
+/** @} */
+
diff --git a/libparted/exception.c b/libparted/exception.c
new file mode 100644
index 0000000..eb9086e
--- /dev/null
+++ b/libparted/exception.c
@@ -0,0 +1,304 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+/** \file exception.c */
+
+/**
+ * \addtogroup PedException
+ *
+ * \brief Exception handling.
+ *
+ * There are a few types of exceptions: PED_EXCEPTION_INFORMATION,
+ * PED_EXCEPTION_WARNING, PED_EXCEPTION_ERROR, PED_EXCEPTION_FATAL,
+ * PED_EXCEPTION_BUG.
+ *
+ * They are "thrown" when one of the above events occur while executing
+ * a libparted function. For example, if ped_device_open() fails
+ * because the device doesn't exist, an exception will be thrown.
+ * Exceptions contain text describing what the event was. It will give
+ * at least one option for resolving the exception: PED_EXCEPTION_FIX,
+ * PED_EXCEPTION_YES, PED_EXCEPTION_NO, PED_EXCEPTION_OK, PED_EXCEPTION_RETRY,
+ * PED_EXCEPTION_IGNORE, PED_EXCEPTION_CANCEL. After an exception is thrown,
+ * there are two things that can happen:
+ *
+ * -# an exception handler is called, which selects how the exception should be
+ * resolved (usually by asking the user). Also note: an exception handler may
+ * choose to return PED_EXCEPTION_UNHANDLED. In this case, a default action
+ * will be taken by libparted (respectively the code that threw the
+ * exception). In general, a default action will be "safe".
+ * -# the exception is not handled, because the caller of the function wants to
+ * handle everything itself. In this case, PED_EXCEPTION_UNHANDLED is
+ * returned.
+ *
+ * @{
+ */
+
+#include "config.h"
+
+#include <parted/parted.h>
+#include <parted/debug.h>
+
+#define N_(String) String
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h>
+
+int ped_exception = 0;
+
+static PedExceptionOption default_handler (PedException* ex);
+
+static PedExceptionHandler* ex_handler = default_handler;
+static PedException* ex = NULL;
+static int ex_fetch_count = 0;
+
+static char* type_strings [] = {
+ N_("Information"),
+ N_("Warning"),
+ N_("Error"),
+ N_("Fatal"),
+ N_("Bug"),
+ N_("No Implementation")
+};
+
+static char* option_strings [] = {
+ N_("Fix"),
+ N_("Yes"),
+ N_("No"),
+ N_("OK"),
+ N_("Retry"),
+ N_("Ignore"),
+ N_("Cancel")
+};
+
+/**
+ * Return a string describing an exception type.
+ */
+char*
+ped_exception_get_type_string (PedExceptionType ex_type)
+{
+ return type_strings [ex_type - 1];
+}
+
+/* FIXME: move this out to the prospective math.c */
+/* FIXME: this can probably be done more efficiently */
+static int
+ped_log2 (int n)
+{
+ int x;
+
+ PED_ASSERT (n > 0, return -1);
+
+ for (x=0; 1 << x <= n; x++);
+
+ return x - 1;
+}
+
+/**
+ * Return a string describing an exception option.
+ */
+char*
+ped_exception_get_option_string (PedExceptionOption ex_opt)
+{
+ return option_strings [ped_log2 (ex_opt)];
+}
+
+static PedExceptionOption
+default_handler (PedException* ex)
+{
+ if (ex->type == PED_EXCEPTION_BUG)
+ fprintf (stderr,
+ _("A bug has been detected in GNU Parted. "
+ "Refer to the web site of parted "
+ "http://www.gnu.org/software/parted/parted.html "
+ "for more informations of what could be useful "
+ "for bug submitting! "
+ "Please email a bug report to "
+ "bug-parted@gnu.org containing at least the "
+ "version (%s) and the following message: "),
+ VERSION);
+ else
+ fprintf (stderr, "%s: ",
+ ped_exception_get_type_string (ex->type));
+ fprintf (stderr, "%s\n", ex->message);
+
+ switch (ex->options) {
+ case PED_EXCEPTION_OK:
+ case PED_EXCEPTION_CANCEL:
+ case PED_EXCEPTION_IGNORE:
+ return ex->options;
+
+ default:
+ return PED_EXCEPTION_UNHANDLED;
+ }
+}
+
+/**
+ * Set the exception handler.
+ *
+ * The exception handler should return ONE of the options set in ex->options,
+ * indicating the way the event should be resolved.
+ */
+void
+ped_exception_set_handler (PedExceptionHandler* handler)
+{
+ if (handler)
+ ex_handler = handler;
+ else
+ ex_handler = default_handler;
+}
+
+/**
+ * Get the current exception handler.
+ */
+PedExceptionHandler *
+ped_exception_get_handler (void)
+{
+ if (ex_handler)
+ return ex_handler;
+ return default_handler;
+}
+
+/**
+ * Assert that the current exception has been resolved.
+ */
+void
+ped_exception_catch ()
+{
+ if (ped_exception) {
+ ped_exception = 0;
+
+ ped_free (ex->message);
+ ped_free (ex);
+ ex = NULL;
+ }
+}
+
+static PedExceptionOption
+do_throw ()
+{
+ PedExceptionOption ex_opt;
+
+ ped_exception = 1;
+
+ if (ex_fetch_count) {
+ return PED_EXCEPTION_UNHANDLED;
+ } else {
+ ex_opt = ex_handler (ex);
+ ped_exception_catch ();
+ return ex_opt;
+ }
+}
+
+/**
+ * Throw an exception.
+ *
+ * You can also use this in a program using libparted.
+ * "message" is a printf-like format string, so you can do
+ *
+ * \code
+ * ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_RETRY_CANCEL,
+ * "Can't open %s", file_name);
+ * \endcode
+ *
+ * Returns the option selected to resolve the exception. If the exception was
+ * unhandled, PED_EXCEPTION_UNHANDLED is returned.
+ */
+PedExceptionOption
+ped_exception_throw (PedExceptionType ex_type,
+ PedExceptionOption ex_opts, const char* message, ...)
+{
+ va_list arg_list;
+
+ if (ex)
+ ped_exception_catch ();
+
+ ex = (PedException*) malloc (sizeof (PedException));
+ if (!ex)
+ goto no_memory;
+
+ ex->message = (char*) malloc (8192);
+ if (!ex->message)
+ goto no_memory;
+
+ ex->type = ex_type;
+ ex->options = ex_opts;
+
+ va_start (arg_list, message);
+ vsnprintf (ex->message, 8192, message, arg_list);
+ va_end (arg_list);
+
+ return do_throw ();
+
+no_memory:
+ fprintf (stderr, "Out of memory in exception handler!\n");
+
+ va_start (arg_list, message);
+ vfprintf (stderr, message, arg_list);
+ va_end (arg_list);
+
+ return PED_EXCEPTION_UNHANDLED;
+}
+
+/**
+ * Rethrow an unhandled exception.
+ * This means repeating the last ped_exception_throw() statement.
+ */
+PedExceptionOption
+ped_exception_rethrow ()
+{
+ return do_throw ();
+}
+
+/**
+ * Indicates that exceptions should not go to the exception handler, but
+ * passed up to the calling function(s). All calls to
+ * ped_exception_throw() will return PED_EXCEPTION_UNHANDLED.
+ */
+void
+ped_exception_fetch_all ()
+{
+ ex_fetch_count++;
+}
+
+/**
+ * Indicates that the calling function does not want to accept any
+ * responsibility for exceptions any more.
+ *
+ * \note a caller of that function may still want responsibility, so
+ * ped_exception_throw() may not invoke the exception handler.
+ *
+ * \warning every call to this function must have a preceding
+ * ped_exception_fetch_all().
+ */
+void
+ped_exception_leave_all ()
+{
+ PED_ASSERT (ex_fetch_count > 0, return);
+ ex_fetch_count--;
+}
+
+/** @} */
+
diff --git a/libparted/filesys.c b/libparted/filesys.c
new file mode 100644
index 0000000..cf33f96
--- /dev/null
+++ b/libparted/filesys.c
@@ -0,0 +1,786 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+/** \file filesys.c */
+
+/**
+ * \addtogroup PedFileSystem
+ *
+ * \note File systems exist on a PedGeometry - NOT a PedPartition.
+ *
+ * @{
+ */
+
+#include "config.h"
+
+#include <parted/parted.h>
+#include <parted/debug.h>
+#include <string.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+#define BUFFER_SIZE 4096 /* in sectors */
+
+static PedFileSystemType* fs_types = NULL;
+
+void
+ped_file_system_type_register (PedFileSystemType* fs_type)
+{
+ PED_ASSERT (fs_type != NULL, return);
+ PED_ASSERT (fs_type->ops != NULL, return);
+ PED_ASSERT (fs_type->name != NULL, return);
+
+ /* pretend that "next" isn't part of the struct :-) */
+ ((struct _PedFileSystemType*) fs_type)->next = fs_types;
+ fs_types = (struct _PedFileSystemType*) fs_type;
+}
+
+void
+ped_file_system_type_unregister (PedFileSystemType* fs_type)
+{
+ PedFileSystemType* walk;
+ PedFileSystemType* last = NULL;
+
+ PED_ASSERT (fs_type != NULL, return);
+
+ for (walk = fs_types; walk != fs_type; walk = walk->next) {
+ if (!walk) return;
+ last = walk;
+ }
+
+ if (last) {
+ ((struct _PedFileSystemType*) last)->next = fs_type->next;
+ } else {
+ fs_types = fs_types->next;
+ }
+}
+
+/**
+ * Get a PedFileSystemType by its @p name.
+ *
+ * @return @c NULL if none found.
+ */
+PedFileSystemType*
+ped_file_system_type_get (const char* name)
+{
+ PedFileSystemType* walk;
+
+ PED_ASSERT (name != NULL, return NULL);
+
+ for (walk = fs_types; walk != NULL; walk = walk->next) {
+ if (!strcasecmp (walk->name, name))
+ break;
+ }
+ return walk;
+}
+
+/**
+ * Get the next PedFileSystemType after @p fs_type.
+ *
+ * @return @c NULL if @p fs_type is the last item in the list.
+ */
+PedFileSystemType*
+ped_file_system_type_get_next (const PedFileSystemType* fs_type)
+{
+ if (fs_type)
+ return fs_type->next;
+ else
+ return fs_types;
+}
+
+/**
+ * Attempt to find a file system and return the region it occupies.
+ *
+ * @param fs_type The file system type to probe for.
+ * @param geom The region to be searched.
+ *
+ * @return @p NULL if @p fs_type file system wasn't detected
+ */
+PedGeometry*
+ped_file_system_probe_specific (
+ const PedFileSystemType* fs_type, PedGeometry* geom)
+{
+ PedGeometry* result;
+
+ PED_ASSERT (fs_type != NULL, return NULL);
+ PED_ASSERT (fs_type->ops->probe != NULL, return NULL);
+ PED_ASSERT (geom != NULL, return NULL);
+
+ if (!ped_device_open (geom->dev))
+ return 0;
+ result = fs_type->ops->probe (geom);
+ ped_device_close (geom->dev);
+ return result;
+}
+
+static int
+_test_open (PedFileSystemType* fs_type, PedGeometry* geom)
+{
+ PedFileSystem* fs;
+
+ ped_exception_fetch_all ();
+ fs = fs_type->ops->open (geom);
+ if (fs)
+ fs_type->ops->close (fs);
+ else
+ ped_exception_catch ();
+ ped_exception_leave_all ();
+ return fs != NULL;
+}
+
+static PedFileSystemType*
+_probe_with_open (PedGeometry* geom, int detected_count,
+ PedFileSystemType* detected[])
+{
+ int i;
+ PedFileSystemType* open_detected = NULL;
+
+ ped_device_open (geom->dev);
+
+ /* If one and only one file system that Parted is able to open
+ * can be successfully opened on this geometry, return it.
+ * If more than one can be, return NULL.
+ */
+ for (i=0; i<detected_count; i++) {
+ if (!detected[i]->ops->open || !_test_open (detected [i], geom))
+ continue;
+
+ if (open_detected) {
+ ped_device_close (geom->dev);
+ return NULL;
+ } else {
+ open_detected = detected [i];
+ }
+ }
+
+ /* If no file system has been successfully opened, and
+ * if Parted has detected at most one unopenable file system,
+ * return it.
+ */
+ if (!open_detected)
+ for (i=0; i<detected_count; i++) {
+ if (detected[i]->ops->open)
+ continue;
+ if (open_detected) {
+ ped_device_close (geom->dev);
+ return NULL;
+ } else {
+ open_detected = detected [i];
+ }
+ }
+
+ ped_device_close (geom->dev);
+ return open_detected;
+}
+
+static int
+_geometry_error (const PedGeometry* a, const PedGeometry* b)
+{
+ PedSector start_delta = a->start - b->start;
+ PedSector end_delta = a->end - b->end;
+
+ return abs (start_delta) + abs (end_delta);
+}
+
+static PedFileSystemType*
+_best_match (const PedGeometry* geom, PedFileSystemType* detected [],
+ const int detected_error [], int detected_count)
+{
+ int best_match = 0;
+ int i;
+ PedSector min_error;
+
+ min_error = PED_MAX (4096, geom->length / 100);
+
+ for (i = 1; i < detected_count; i++) {
+ if (detected_error [i] < detected_error [best_match])
+ best_match = i;
+ }
+
+ /* make sure the best match is significantly better than all the
+ * other matches
+ */
+ for (i = 0; i < detected_count; i++) {
+ if (i == best_match)
+ continue;
+
+ if (abs (detected_error [best_match] - detected_error [i])
+ < min_error)
+ return NULL;
+ }
+
+ return detected [best_match];
+}
+
+
+/**
+ * Attempt to detect a file system in region \p geom.
+ * This function tries to be clever at dealing with ambiguous
+ * situations, such as when one file system was not completely erased before a
+ * new file system was created on top of it.
+ *
+ * \return a new PedFileSystem on success, \c NULL on failure
+ */
+PedFileSystemType*
+ped_file_system_probe (PedGeometry* geom)
+{
+ PedFileSystemType* detected[32];
+ int detected_error[32];
+ int detected_count = 0;
+ PedFileSystemType* walk = NULL;
+
+ PED_ASSERT (geom != NULL, return NULL);
+
+ if (!ped_device_open (geom->dev))
+ return NULL;
+
+ ped_exception_fetch_all ();
+ while ( (walk = ped_file_system_type_get_next (walk)) ) {
+ PedGeometry* probed;
+
+ probed = ped_file_system_probe_specific (walk, geom);
+ if (probed) {
+ detected [detected_count] = walk;
+ detected_error [detected_count]
+ = _geometry_error (geom, probed);
+ detected_count++;
+ ped_geometry_destroy (probed);
+ } else {
+ ped_exception_catch ();
+ }
+ }
+ ped_exception_leave_all ();
+
+ ped_device_close (geom->dev);
+
+ if (!detected_count)
+ return NULL;
+ walk = _best_match (geom, detected, detected_error, detected_count);
+ if (walk)
+ return walk;
+ return _probe_with_open (geom, detected_count, detected);
+}
+
+/**
+ * This function erases all file system signatures that indicate that a
+ * file system occupies a given region described by \p geom.
+ * After this operation ped_file_system_probe() won't detect any file system.
+ *
+ * \note ped_file_system_create() calls this before creating a new file system.
+ *
+ * \return \c 1 on success, \c 0 on failure
+ */
+int
+ped_file_system_clobber (PedGeometry* geom)
+{
+ PedFileSystemType* fs_type = NULL;
+
+ PED_ASSERT (geom != NULL, return 0);
+
+ if (!ped_device_open (geom->dev))
+ goto error;
+
+ ped_exception_fetch_all ();
+ while ((fs_type = ped_file_system_type_get_next (fs_type))) {
+ PedGeometry* probed;
+
+ if (!fs_type->ops->clobber)
+ continue;
+
+ probed = ped_file_system_probe_specific (fs_type, geom);
+ if (!probed) {
+ ped_exception_catch ();
+ continue;
+ }
+ ped_geometry_destroy (probed);
+
+ if (fs_type->ops->clobber && !fs_type->ops->clobber (geom)) {
+ ped_exception_leave_all ();
+ goto error_close_dev;
+ }
+ }
+ ped_device_close (geom->dev);
+ ped_exception_leave_all ();
+ return 1;
+
+error_close_dev:
+ ped_device_close (geom->dev);
+error:
+ return 0;
+}
+
+/* This function erases all signatures that indicate the presence of
+ * a file system in a particular region, without erasing any data
+ * contained inside the "exclude" region.
+ */
+static int
+ped_file_system_clobber_exclude (PedGeometry* geom,
+ const PedGeometry* exclude)
+{
+ PedGeometry* clobber_geom;
+ int status;
+
+ if (ped_geometry_test_sector_inside (exclude, geom->start))
+ return 1;
+
+ clobber_geom = ped_geometry_duplicate (geom);
+ if (ped_geometry_test_overlap (clobber_geom, exclude))
+ ped_geometry_set_end (clobber_geom, exclude->start - 1);
+
+ status = ped_file_system_clobber (clobber_geom);
+ ped_geometry_destroy (clobber_geom);
+ return status;
+}
+
+/**
+ * This function opens the file system stored on \p geom, if it
+ * can find one.
+ * It is often called in the following manner:
+ * \code
+ * fs = ped_file_system_open (&part.geom)
+ * \endcode
+ *
+ * \throws PED_EXCEPTION_ERROR if file system could not be detected
+ * \throws PED_EXCEPTION_ERROR if the file system is bigger than its volume
+ * \throws PED_EXCEPTION_NO_FEATURE if opening of a file system stored on
+ * \p geom is not implemented
+ *
+ * \return a PedFileSystem on success, \c NULL on failure.
+ */
+PedFileSystem*
+ped_file_system_open (PedGeometry* geom)
+{
+ PedFileSystemType* type;
+ PedFileSystem* fs;
+ PedGeometry* probed_geom;
+
+ PED_ASSERT (geom != NULL, return NULL);
+
+ if (!ped_device_open (geom->dev))
+ goto error;
+
+ type = ped_file_system_probe (geom);
+ if (!type) {
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("Could not detect file system."));
+ goto error_close_dev;
+ }
+
+ probed_geom = ped_file_system_probe_specific (type, geom);
+ if (!probed_geom)
+ goto error_close_dev;
+ if (!ped_geometry_test_inside (geom, probed_geom)) {
+ if (ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("The file system is bigger than its volume!"))
+ != PED_EXCEPTION_IGNORE)
+ goto error_destroy_probed_geom;
+ }
+
+ if (!type->ops->open) {
+ ped_exception_throw (PED_EXCEPTION_NO_FEATURE,
+ PED_EXCEPTION_CANCEL,
+ _("Support for opening %s file systems "
+ "is not implemented yet."),
+ type->name);
+ goto error_destroy_probed_geom;
+ }
+
+ fs = type->ops->open (probed_geom);
+ if (!fs)
+ goto error_destroy_probed_geom;
+ ped_geometry_destroy (probed_geom);
+ return fs;
+
+error_destroy_probed_geom:
+ ped_geometry_destroy (probed_geom);
+error_close_dev:
+ ped_device_close (geom->dev);
+error:
+ return 0;
+}
+
+/**
+ * This function initializes a new file system of type \p type on
+ * a region described by \p geom, writing out appropriate metadata and
+ * signatures. If \p timer is non-NULL, it is used as the progress meter.
+ *
+ * \throws PED_EXCEPTION_NO_FEATURE if creating file system type \p type
+ * is not implemented yet
+ *
+ * \return a PedFileSystem on success, \c NULL on failure
+ */
+PedFileSystem*
+ped_file_system_create (PedGeometry* geom, const PedFileSystemType* type,
+ PedTimer* timer)
+{
+ PedFileSystem* fs;
+
+ PED_ASSERT (geom != NULL, return NULL);
+ PED_ASSERT (type != NULL, return NULL);
+
+ if (!type->ops->create) {
+ ped_exception_throw (PED_EXCEPTION_NO_FEATURE,
+ PED_EXCEPTION_CANCEL,
+ _("Support for creating %s file systems "
+ "is not implemented yet."),
+ type->name);
+ goto error;
+ }
+
+ if (!ped_device_open (geom->dev))
+ goto error;
+
+ if (!ped_file_system_clobber (geom))
+ goto error_close_dev;
+ fs = type->ops->create (geom, timer);
+ if (!fs)
+ goto error_close_dev;
+ return fs;
+
+error_close_dev:
+ ped_device_close (geom->dev);
+error:
+ return 0;
+}
+
+/**
+ * Close file system \p fs.
+ *
+ * \return \c 1 on success, \c 0 on failure
+ */
+int
+ped_file_system_close (PedFileSystem* fs)
+{
+ PedDevice* dev = fs->geom->dev;
+
+ PED_ASSERT (fs != NULL, goto error_close_dev);
+
+ if (!fs->type->ops->close (fs))
+ goto error_close_dev;
+ ped_device_close (dev);
+ return 1;
+
+error_close_dev:
+ ped_device_close (dev);
+error:
+ return 0;
+}
+
+/**
+ * Check \p fs file system for errors.
+ *
+ * \throws PED_EXCEPTION_NO_FEATURE if checking file system \p fs is
+ * not implemented yet
+ *
+ * \return \c 0 on failure (i.e. unfixed errors)
+ */
+int
+ped_file_system_check (PedFileSystem* fs, PedTimer* timer)
+{
+ PED_ASSERT (fs != NULL, return 0);
+
+ if (!fs->type->ops->check) {
+ ped_exception_throw (PED_EXCEPTION_NO_FEATURE,
+ PED_EXCEPTION_CANCEL,
+ _("Support for checking %s file systems "
+ "is not implemented yet."),
+ fs->type->name);
+ return 0;
+ }
+ return fs->type->ops->check (fs, timer);
+}
+
+static int
+_raw_copy (const PedGeometry* src, PedGeometry* dest, PedTimer* timer)
+{
+ char* buf;
+ PedSector pos;
+
+ PED_ASSERT (src != NULL, goto error);
+ PED_ASSERT (dest != NULL, goto error);
+ PED_ASSERT (src->length <= dest->length, goto error);
+
+ buf = ped_malloc (BUFFER_SIZE * 512); /* FIXME */
+ if (!buf)
+ goto error;
+
+ if (!ped_device_open (src->dev))
+ goto error_free_buf;
+ if (!ped_device_open (dest->dev))
+ goto error_close_src;
+
+ for (pos = 0; pos + BUFFER_SIZE < src->length; pos += BUFFER_SIZE) {
+ ped_timer_update (timer, 1.0 * pos / src->length);
+ if (!ped_geometry_read (src, buf, pos, BUFFER_SIZE))
+ goto error_close_dest;
+ if (!ped_geometry_write (dest, buf, pos, BUFFER_SIZE))
+ goto error_close_dest;
+ }
+ if (pos < src->length) {
+ ped_timer_update (timer, 1.0 * pos / src->length);
+ if (!ped_geometry_read (src, buf, pos, src->length - pos))
+ goto error_close_dest;
+ if (!ped_geometry_write (dest, buf, pos, src->length - pos))
+ goto error_close_dest;
+ }
+ ped_timer_update (timer, 1.0);
+
+ ped_device_close (src->dev);
+ ped_device_close (dest->dev);
+ ped_free (buf);
+ return 1;
+
+error_close_dest:
+ ped_device_close (dest->dev);
+error_close_src:
+ ped_device_close (src->dev);
+error_free_buf:
+ ped_free (buf);
+error:
+ return 0;
+}
+
+static PedFileSystem*
+_raw_copy_and_resize (const PedFileSystem* fs, PedGeometry* geom,
+ PedTimer* timer)
+{
+ PedFileSystem* new_fs;
+ PedTimer* sub_timer = NULL;
+
+ ped_timer_reset (timer);
+ ped_timer_set_state_name (timer, _("raw block copying"));
+
+ sub_timer = ped_timer_new_nested (timer, 0.95);
+ if (!_raw_copy (fs->geom, geom, sub_timer))
+ goto error;
+ ped_timer_destroy_nested (sub_timer);
+
+ new_fs = ped_file_system_open (geom);
+ if (!new_fs)
+ goto error;
+
+ ped_timer_set_state_name (timer, _("growing file system"));
+
+ sub_timer = ped_timer_new_nested (timer, 0.05);
+ if (!ped_file_system_resize (new_fs, geom, sub_timer))
+ goto error_close_new_fs;
+ ped_timer_destroy_nested (sub_timer);
+ return new_fs;
+
+error_close_new_fs:
+ ped_file_system_close (new_fs);
+error:
+ ped_timer_destroy_nested (sub_timer);
+ return NULL;
+}
+
+/**
+ * Create a new file system (of the same type) on \p geom, and
+ * copy the contents of \p fs into the new filesystem.
+ * If \p timer is non-NULL, it is used as the progress meter.
+ *
+ * \throws PED_EXCEPTION_ERROR when trying to copy onto an overlapping partition
+ * \throws PED_EXCEPTION_NO_FEATURE if copying of file system \p fs
+ * is not implemented yet
+ *
+ * \return a new PedFileSystem on success, \c NULL on failure
+ */
+PedFileSystem*
+ped_file_system_copy (PedFileSystem* fs, PedGeometry* geom, PedTimer* timer)
+{
+ PedFileSystem* new_fs;
+
+ PED_ASSERT (fs != NULL, return 0);
+ PED_ASSERT (geom != NULL, return 0);
+
+ if (!ped_device_open (geom->dev))
+ goto error;
+
+ if (ped_geometry_test_overlap (fs->geom, geom)) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("Can't copy onto an overlapping partition."));
+ goto error_close_dev;
+ }
+
+ if (!fs->checked && fs->type->ops->check) {
+ if (!ped_file_system_check (fs, timer))
+ goto error_close_dev;
+ }
+
+ if (!ped_file_system_clobber_exclude (geom, fs->geom))
+ goto error_close_dev;
+
+ if (!fs->type->ops->copy) {
+ if (fs->type->ops->resize) {
+ if (fs->geom->length <= geom->length)
+ return _raw_copy_and_resize (
+ fs, (PedGeometry*) geom,
+ timer);
+
+ ped_exception_throw (
+ PED_EXCEPTION_NO_FEATURE,
+ PED_EXCEPTION_CANCEL,
+ _("Direct support for copying file systems is "
+ "not yet implemented for %s. However, "
+ "support for resizing is implemented. "
+ "Therefore, the file system can be copied if "
+ "the new partition is at least as big as the "
+ "old one. So, either shrink the partition "
+ "you are trying to copy, or copy to a bigger "
+ "partition."),
+ fs->type->name);
+ goto error_close_dev;
+ } else {
+ ped_exception_throw (
+ PED_EXCEPTION_NO_FEATURE,
+ PED_EXCEPTION_CANCEL,
+ _("Support for copying %s file systems is not "
+ "implemented yet."),
+ fs->type->name);
+ goto error_close_dev;
+ }
+ }
+ new_fs = fs->type->ops->copy (fs, geom, timer);
+ if (!new_fs)
+ goto error_close_dev;
+ return new_fs;
+
+error_close_dev:
+ ped_device_close (geom->dev);
+error:
+ return NULL;;
+}
+
+/**
+ * Resize \p fs to new geometry \p geom.
+ *
+ * \p geom should satisfy the ped_file_system_get_resize_constraint().
+ * (This isn't asserted, so it's not a bug not to... just it's likely
+ * to fail ;) If \p timer is non-NULL, it is used as the progress meter.
+ *
+ * \throws PED_EXCEPTION_NO_FEATURE if resizing of file system \p fs
+ * is not implemented yet
+ *
+ * \return \c 0 on failure
+ */
+int
+ped_file_system_resize (PedFileSystem* fs, PedGeometry* geom, PedTimer* timer)
+{
+ PED_ASSERT (fs != NULL, return 0);
+ PED_ASSERT (geom != NULL, return 0);
+
+ if (!fs->type->ops->resize) {
+ ped_exception_throw (PED_EXCEPTION_NO_FEATURE,
+ PED_EXCEPTION_CANCEL,
+ _("Support for resizing %s file systems "
+ "is not implemented yet."),
+ fs->type->name);
+ return 0;
+ }
+ if (!fs->checked && fs->type->ops->check) {
+ if (!ped_file_system_check (fs, timer))
+ return 0;
+ }
+ if (!ped_file_system_clobber_exclude (geom, fs->geom))
+ return 0;
+
+ return fs->type->ops->resize (fs, geom, timer);
+}
+
+/**
+ * This function returns a constraint on the region that all file systems
+ * of a particular type \p fs_type created on device \p dev with
+ * ped_file_system_create() must satisfy. For example, FAT16 file systems must
+ * be at least 32 megabytes.
+ *
+ * \return \c NULL on failure
+ */
+PedConstraint*
+ped_file_system_get_create_constraint (const PedFileSystemType* fs_type,
+ const PedDevice* dev)
+{
+ PED_ASSERT (fs_type != NULL, return NULL);
+ PED_ASSERT (dev != NULL, return NULL);
+
+ if (!fs_type->ops->get_create_constraint)
+ return NULL;
+ return fs_type->ops->get_create_constraint (dev);
+}
+/**
+ * Return a constraint, that represents all of the possible ways the
+ * file system \p fs can be resized with ped_file_system_resize().
+ * This takes into account the amount of used space on
+ * the filesystem \p fs and the capabilities of the resize algorithm.
+ * Hints:
+ * -# if constraint->start_align->grain_size == 0, or
+ * constraint->start_geom->length == 1, then the start can not be moved
+ * -# constraint->min_size is the minimum size you can resize the partition
+ * to. You might want to tell the user this ;-).
+ *
+ * \return a PedConstraint on success, \c NULL on failure
+ */
+PedConstraint*
+ped_file_system_get_resize_constraint (const PedFileSystem* fs)
+{
+ PED_ASSERT (fs != NULL, return 0);
+
+ if (!fs->type->ops->get_resize_constraint)
+ return NULL;
+ return fs->type->ops->get_resize_constraint (fs);
+}
+
+/**
+ * Get the constraint on copying \p fs with ped_file_system_copy()
+ * to somewhere on \p dev.
+ *
+ * \return a PedConstraint on success, \c NULL on failure
+ */
+PedConstraint*
+ped_file_system_get_copy_constraint (const PedFileSystem* fs,
+ const PedDevice* dev)
+{
+ PedGeometry full_dev;
+
+ PED_ASSERT (fs != NULL, return NULL);
+ PED_ASSERT (dev != NULL, return NULL);
+
+ if (fs->type->ops->get_copy_constraint)
+ return fs->type->ops->get_copy_constraint (fs, dev);
+
+ if (fs->type->ops->resize) {
+ if (!ped_geometry_init (&full_dev, dev, 0, dev->length - 1))
+ return NULL;
+ return ped_constraint_new (
+ ped_alignment_any, ped_alignment_any,
+ &full_dev, &full_dev,
+ fs->geom->length, dev->length);
+ }
+
+ return NULL;
+}
+
+/** @} */
diff --git a/libparted/fs/Makefile.am b/libparted/fs/Makefile.am
new file mode 100644
index 0000000..8f5d69d
--- /dev/null
+++ b/libparted/fs/Makefile.am
@@ -0,0 +1,33 @@
+# This file is part of GNU Parted
+# Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+#
+# This file may be modified and/or distributed without restriction.
+
+SUBDIRS = amiga ext2 ufs fat ntfs hfs linux_swap xfs jfs reiserfs # bfs
+
+LIBS = @INTLLIBS@ @LIBS@
+
+partedincludedir = -I$(top_srcdir)/include
+noinst_LTLIBRARIES = libfs.la
+libfs_la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
+ -release $(LT_RELEASE)
+
+libfs_la_LIBADD = @UUID_LIBS@ \
+ @OS_LIBS@ \
+ @REISER_LIBS@ \
+ amiga/libamigafs.la \
+ ext2/libext2.la \
+ ufs/libufs.la \
+ fat/libfat.la \
+ ntfs/libntfs.la \
+ hfs/libhfs.la \
+ linux_swap/liblinuxswap.la \
+ xfs/libxfs.la \
+ jfs/libjfs.la \
+ reiserfs/libreiserfs.la
+# bfs/libbfs.la
+
+libfs_la_SOURCES =
+
+INCLUDES = $(partedincludedir) @INTLINCS@
+
diff --git a/libparted/fs/amiga/Makefile.am b/libparted/fs/amiga/Makefile.am
new file mode 100644
index 0000000..9d69be1
--- /dev/null
+++ b/libparted/fs/amiga/Makefile.am
@@ -0,0 +1,14 @@
+partedincludedir = -I$(top_srcdir)/include
+
+noinst_LTLIBRARIES = libamigafs.la
+libamigafs_la_SOURCES = amiga.h \
+ amiga.c \
+ affs.h \
+ affs.c \
+ asfs.h \
+ asfs.c \
+ apfs.h \
+ apfs.c \
+ interface.c
+
+INCLUDES = $(partedincludedir) @INTLINCS@
diff --git a/libparted/fs/amiga/affs.c b/libparted/fs/amiga/affs.c
new file mode 100644
index 0000000..77629e2
--- /dev/null
+++ b/libparted/fs/amiga/affs.c
@@ -0,0 +1,466 @@
+/*
+ affs.c -- parted support for affs file systems
+ Copyright (C) 1998-2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <parted/parted.h>
+#include <parted/debug.h>
+#include <parted/endian.h>
+
+#include "amiga.h"
+#include "affs.h"
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+static int
+_affs_probe_root (uint32_t *block, int blocksize) {
+ int i;
+ uint32_t sum;
+
+ if (PED_BE32_TO_CPU (block[0]) != 2) return 0;
+ if (PED_BE32_TO_CPU (block[128*blocksize-1]) != 1) return 0;
+ for (i = 0, sum = 0; i < 128*blocksize; i++)
+ sum += PED_BE32_TO_CPU (block[i]);
+ if (sum) return 0;
+ return 1;
+}
+
+static PedGeometry*
+_generic_affs_probe (PedGeometry* geom, uint32_t kind)
+{
+ uint32_t *block;
+ int32_t i;
+ PedSector root, len, pos;
+ struct PartitionBlock * part;
+ int blocksize = 1, reserved = 2, prealloc = 0;
+
+ PED_ASSERT (geom != NULL, return NULL);
+ PED_ASSERT (geom->dev != NULL, return NULL);
+
+ /* Finds the blocksize, prealloc and reserved values of the partition block */
+ if (!(part = ped_malloc (PED_SECTOR_SIZE_DEFAULT*blocksize))) {
+ ped_exception_throw(PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("%s : Failed to allocate partition block\n"), __func__);
+ goto error_part;
+ }
+ if (amiga_find_part(geom, part) != NULL) {
+ prealloc = PED_BE32_TO_CPU (part->de_PreAlloc);
+ reserved = PED_BE32_TO_CPU (part->de_Reserved);
+ reserved = reserved == 0 ? 1 : reserved;
+ blocksize = PED_BE32_TO_CPU (part->de_SizeBlock)
+ * PED_BE32_TO_CPU (part->de_SectorPerBlock) / 128;
+ }
+ ped_free (part);
+
+ /* Test boot block */
+ if (!(block = ped_malloc (PED_SECTOR_SIZE_DEFAULT*blocksize))) {
+ ped_exception_throw(PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("%s : Failed to allocate block\n"), __func__);
+ goto error_block;
+ }
+ if (!ped_device_read (geom->dev, block, geom->start, blocksize)) {
+ ped_exception_throw(PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("%s : Couldn't read boot block %llu\n"), __func__, geom->start);
+ goto error;
+ }
+ if (PED_BE32_TO_CPU (block[0]) != kind) {
+ goto error;
+ }
+
+ /* Find and test the root block */
+ len = geom->length / blocksize - reserved;
+ pos = (len - 1) / 2;
+ root = geom->start + (pos + reserved) * blocksize;
+ printf ("Pralloc = %d, Reserved = %d, blocksize = %d, root block at %llu\n",
+ prealloc, reserved, blocksize, root);
+
+ if (!ped_device_read (geom->dev, block, root, blocksize)) {
+ ped_exception_throw(PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("%s : Couldn't read root block %llu\n"), __func__, root);
+ goto error;
+ }
+ if (_affs_probe_root(block, blocksize) == 1) {
+ ped_free (block);
+ return ped_geometry_duplicate (geom);
+ }
+
+error:
+ ped_free (block);
+error_block:
+error_part:
+ return NULL;
+}
+static PedGeometry*
+_affs0_probe (PedGeometry* geom) {
+ return _generic_affs_probe (geom, 0x444f5300);
+}
+static PedGeometry*
+_affs1_probe (PedGeometry* geom) {
+ return _generic_affs_probe (geom, 0x444f5301);
+}
+static PedGeometry*
+_affs2_probe (PedGeometry* geom) {
+ return _generic_affs_probe (geom, 0x444f5302);
+}
+static PedGeometry*
+_affs3_probe (PedGeometry* geom) {
+ return _generic_affs_probe (geom, 0x444f5303);
+}
+static PedGeometry*
+_affs4_probe (PedGeometry* geom) {
+ return _generic_affs_probe (geom, 0x444f5304);
+}
+static PedGeometry*
+_affs5_probe (PedGeometry* geom) {
+ return _generic_affs_probe (geom, 0x444f5305);
+}
+static PedGeometry*
+_affs6_probe (PedGeometry* geom) {
+ return _generic_affs_probe (geom, 0x444f5306);
+}
+static PedGeometry*
+_affs7_probe (PedGeometry* geom) {
+ return _generic_affs_probe (geom, 0x444f5307);
+}
+static PedGeometry*
+_amufs_probe (PedGeometry* geom) {
+ return _generic_affs_probe (geom, 0x6d754653);
+}
+static PedGeometry*
+_amufs0_probe (PedGeometry* geom) {
+ return _generic_affs_probe (geom, 0x6d754600);
+}
+static PedGeometry*
+_amufs1_probe (PedGeometry* geom) {
+ return _generic_affs_probe (geom, 0x6d754601);
+}
+static PedGeometry*
+_amufs2_probe (PedGeometry* geom) {
+ return _generic_affs_probe (geom, 0x6d754602);
+}
+static PedGeometry*
+_amufs3_probe (PedGeometry* geom) {
+ return _generic_affs_probe (geom, 0x6d754603);
+}
+static PedGeometry*
+_amufs4_probe (PedGeometry* geom) {
+ return _generic_affs_probe (geom, 0x6d754604);
+}
+static PedGeometry*
+_amufs5_probe (PedGeometry* geom) {
+ return _generic_affs_probe (geom, 0x6d754605);
+}
+
+static PedFileSystemOps _affs0_ops = {
+ probe: _affs0_probe,
+ clobber: NULL,
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ resize: NULL,
+ copy: NULL,
+ get_create_constraint: NULL,
+ get_copy_constraint: NULL,
+ get_resize_constraint: NULL
+};
+static PedFileSystemOps _affs1_ops = {
+ probe: _affs1_probe,
+ clobber: NULL,
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ resize: NULL,
+ copy: NULL,
+ get_create_constraint: NULL,
+ get_copy_constraint: NULL,
+ get_resize_constraint: NULL
+};
+static PedFileSystemOps _affs2_ops = {
+ probe: _affs2_probe,
+ clobber: NULL,
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ resize: NULL,
+ copy: NULL,
+ get_create_constraint: NULL,
+ get_copy_constraint: NULL,
+ get_resize_constraint: NULL
+};
+static PedFileSystemOps _affs3_ops = {
+ probe: _affs3_probe,
+ clobber: NULL,
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ resize: NULL,
+ copy: NULL,
+ get_create_constraint: NULL,
+ get_copy_constraint: NULL,
+ get_resize_constraint: NULL
+};
+static PedFileSystemOps _affs4_ops = {
+ probe: _affs4_probe,
+ clobber: NULL,
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ resize: NULL,
+ copy: NULL,
+ get_create_constraint: NULL,
+ get_copy_constraint: NULL,
+ get_resize_constraint: NULL
+};
+static PedFileSystemOps _affs5_ops = {
+ probe: _affs5_probe,
+ clobber: NULL,
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ resize: NULL,
+ copy: NULL,
+ get_create_constraint: NULL,
+ get_copy_constraint: NULL,
+ get_resize_constraint: NULL
+};
+static PedFileSystemOps _affs6_ops = {
+ probe: _affs6_probe,
+ clobber: NULL,
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ resize: NULL,
+ copy: NULL,
+ get_create_constraint: NULL,
+ get_copy_constraint: NULL,
+ get_resize_constraint: NULL
+};
+static PedFileSystemOps _affs7_ops = {
+ probe: _affs7_probe,
+ clobber: NULL,
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ resize: NULL,
+ copy: NULL,
+ get_create_constraint: NULL,
+ get_copy_constraint: NULL,
+ get_resize_constraint: NULL
+};
+static PedFileSystemOps _amufs_ops = {
+ probe: _amufs_probe,
+ clobber: NULL,
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ resize: NULL,
+ copy: NULL,
+ get_create_constraint: NULL,
+ get_copy_constraint: NULL,
+ get_resize_constraint: NULL
+};
+static PedFileSystemOps _amufs0_ops = {
+ probe: _amufs0_probe,
+ clobber: NULL,
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ resize: NULL,
+ copy: NULL,
+ get_create_constraint: NULL,
+ get_copy_constraint: NULL,
+ get_resize_constraint: NULL
+};
+static PedFileSystemOps _amufs1_ops = {
+ probe: _amufs1_probe,
+ clobber: NULL,
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ resize: NULL,
+ copy: NULL,
+ get_create_constraint: NULL,
+ get_copy_constraint: NULL,
+ get_resize_constraint: NULL
+};
+static PedFileSystemOps _amufs2_ops = {
+ probe: _amufs2_probe,
+ clobber: NULL,
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ resize: NULL,
+ copy: NULL,
+ get_create_constraint: NULL,
+ get_copy_constraint: NULL,
+ get_resize_constraint: NULL
+};
+static PedFileSystemOps _amufs3_ops = {
+ probe: _amufs3_probe,
+ clobber: NULL,
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ resize: NULL,
+ copy: NULL,
+ get_create_constraint: NULL,
+ get_copy_constraint: NULL,
+ get_resize_constraint: NULL
+};
+static PedFileSystemOps _amufs4_ops = {
+ probe: _amufs4_probe,
+ clobber: NULL,
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ resize: NULL,
+ copy: NULL,
+ get_create_constraint: NULL,
+ get_copy_constraint: NULL,
+ get_resize_constraint: NULL
+};
+static PedFileSystemOps _amufs5_ops = {
+ probe: _amufs5_probe,
+ clobber: NULL,
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ resize: NULL,
+ copy: NULL,
+ get_create_constraint: NULL,
+ get_copy_constraint: NULL,
+ get_resize_constraint: NULL
+};
+
+#define AFFS_BLOCK_SIZES ((int[5]){512, 1024, 2048, 4096, 0})
+#define AMUFS_BLOCK_SIZES ((int[2]){512, 0})
+
+
+PedFileSystemType _affs0_type = {
+ next: NULL,
+ ops: &_affs0_ops,
+ name: "affs0",
+ block_sizes: AFFS_BLOCK_SIZES
+};
+PedFileSystemType _affs1_type = {
+ next: NULL,
+ ops: &_affs1_ops,
+ name: "affs1",
+ block_sizes: AFFS_BLOCK_SIZES
+};
+PedFileSystemType _affs2_type = {
+ next: NULL,
+ ops: &_affs2_ops,
+ name: "affs2",
+ block_sizes: AFFS_BLOCK_SIZES
+};
+PedFileSystemType _affs3_type = {
+ next: NULL,
+ ops: &_affs3_ops,
+ name: "affs3",
+ block_sizes: AFFS_BLOCK_SIZES
+};
+PedFileSystemType _affs4_type = {
+ next: NULL,
+ ops: &_affs4_ops,
+ name: "affs4",
+ block_sizes: AFFS_BLOCK_SIZES
+};
+PedFileSystemType _affs5_type = {
+ next: NULL,
+ ops: &_affs5_ops,
+ name: "affs5",
+ block_sizes: AFFS_BLOCK_SIZES
+};
+PedFileSystemType _affs6_type = {
+ next: NULL,
+ ops: &_affs6_ops,
+ name: "affs6",
+ block_sizes: AFFS_BLOCK_SIZES
+};
+PedFileSystemType _affs7_type = {
+ next: NULL,
+ ops: &_affs7_ops,
+ name: "affs7",
+ block_sizes: AFFS_BLOCK_SIZES
+};
+PedFileSystemType _amufs_type = {
+ next: NULL,
+ ops: &_amufs_ops,
+ name: "amufs",
+ block_sizes: AMUFS_BLOCK_SIZES
+};
+PedFileSystemType _amufs0_type = {
+ next: NULL,
+ ops: &_amufs0_ops,
+ name: "amufs0",
+ block_sizes: AMUFS_BLOCK_SIZES
+};
+PedFileSystemType _amufs1_type = {
+ next: NULL,
+ ops: &_amufs1_ops,
+ name: "amufs1",
+ block_sizes: AMUFS_BLOCK_SIZES
+};
+PedFileSystemType _amufs2_type = {
+ next: NULL,
+ ops: &_amufs2_ops,
+ name: "amufs2",
+ block_sizes: AMUFS_BLOCK_SIZES
+};
+PedFileSystemType _amufs3_type = {
+ next: NULL,
+ ops: &_amufs3_ops,
+ name: "amufs3",
+ block_sizes: AMUFS_BLOCK_SIZES
+};
+PedFileSystemType _amufs4_type = {
+ next: NULL,
+ ops: &_amufs4_ops,
+ name: "amufs4",
+ block_sizes: AMUFS_BLOCK_SIZES
+};
+PedFileSystemType _amufs5_type = {
+ next: NULL,
+ ops: &_amufs5_ops,
+ name: "amufs5",
+ block_sizes: AMUFS_BLOCK_SIZES
+};
diff --git a/libparted/fs/amiga/affs.h b/libparted/fs/amiga/affs.h
new file mode 100644
index 0000000..ac12de6
--- /dev/null
+++ b/libparted/fs/amiga/affs.h
@@ -0,0 +1,20 @@
+
+/*
+ affs.h -- parted suppoer for affs filesystems header files
+ Copyright (C) 1998-2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
diff --git a/libparted/fs/amiga/amiga.c b/libparted/fs/amiga/amiga.c
new file mode 100644
index 0000000..bf6ff6b
--- /dev/null
+++ b/libparted/fs/amiga/amiga.c
@@ -0,0 +1,382 @@
+/*
+ libparted/fs_amiga - amiga file system support.
+ Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+
+ Contributor: Sven Luther <luther@debian.org>
+*/
+
+#include <string.h>
+#include <parted/parted.h>
+#include <parted/debug.h>
+#include <parted/endian.h>
+
+#include "amiga.h"
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+/* String manipulation */
+static void _amiga_set_bstr (const char *cstr, char *bstr, int maxsize) {
+ int size = strlen (cstr);
+ int i;
+
+ if (size >= maxsize) return;
+ bstr[0] = size;
+ for (i = 0; i<size; i++) bstr[i+1] = cstr[i];
+}
+static const char * _amiga_get_bstr (char * bstr) {
+ char * cstr = bstr + 1;
+ int size = bstr[0];
+
+ cstr[size] = '\0';
+ return cstr;
+}
+
+#define IDNAME_RIGIDDISK (uint32_t)0x5244534B /* 'RDSK' */
+#define IDNAME_BADBLOCK (uint32_t)0x42414442 /* 'BADB' */
+#define IDNAME_PARTITION (uint32_t)0x50415254 /* 'PART' */
+#define IDNAME_FILESYSHEADER (uint32_t)0x46534844 /* 'FSHD' */
+#define IDNAME_LOADSEG (uint32_t)0x4C534547 /* 'LSEG' */
+#define IDNAME_BOOT (uint32_t)0x424f4f54 /* 'BOOT' */
+#define IDNAME_FREE (uint32_t)0xffffffff
+
+static const char *
+_amiga_block_id (uint32_t id) {
+ switch (id) {
+ case IDNAME_RIGIDDISK :
+ return "RDSK";
+ case IDNAME_BADBLOCK :
+ return "BADB";
+ case IDNAME_PARTITION :
+ return "PART";
+ case IDNAME_FILESYSHEADER :
+ return "FSHD";
+ case IDNAME_LOADSEG :
+ return "LSEG";
+ case IDNAME_BOOT :
+ return "BOOT";
+ case IDNAME_FREE :
+ return "<free>";
+ default :
+ return "<unknown>";
+ }
+}
+static int
+_amiga_valid_block_id (uint32_t id) {
+ switch (id) {
+ case IDNAME_RIGIDDISK :
+ case IDNAME_BADBLOCK :
+ case IDNAME_PARTITION :
+ case IDNAME_FILESYSHEADER :
+ case IDNAME_LOADSEG :
+ case IDNAME_BOOT :
+ return 1;
+ case IDNAME_FREE :
+ default :
+ return 0;
+ }
+}
+
+struct AmigaIds *
+_amiga_add_id (uint32_t id, struct AmigaIds *ids) {
+ struct AmigaIds *newid;
+
+ if ((newid=ped_malloc(sizeof (struct AmigaIds)))==NULL) {
+ ped_exception_throw(PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("%s : Failed to allocate id list element\n"), __func__);
+ return 0;
+ }
+ newid->ID = id;
+ newid->next = ids;
+ return newid;
+}
+
+void
+_amiga_free_ids (struct AmigaIds *ids) {
+ struct AmigaIds *current, *next;
+
+ for (current = ids; current != NULL; current = next) {
+ next = current->next;
+ ped_free (current);
+ }
+}
+int
+_amiga_id_in_list (uint32_t id, struct AmigaIds *ids) {
+ struct AmigaIds *current;
+
+ for (current = ids; current != NULL; current = current->next) {
+ if (id == current->ID)
+ return 1;
+ }
+ return 0;
+}
+
+#define AMIGA_RDB_NOT_FOUND ((uint32_t)0xffffffff)
+
+struct AmigaBlock {
+ uint32_t amiga_ID; /* Identifier 32 bit word */
+ uint32_t amiga_SummedLongss; /* Size of the structure for checksums */
+ int32_t amiga_ChkSum; /* Checksum of the structure */
+};
+#define AMIGA(pos) ((struct AmigaBlock *)(pos))
+
+struct RigidDiskBlock {
+ uint32_t rdb_ID; /* Identifier 32 bit word : 'RDSK' */
+ uint32_t rdb_SummedLongs; /* Size of the structure for checksums */
+ int32_t rdb_ChkSum; /* Checksum of the structure */
+ uint32_t rdb_HostID; /* SCSI Target ID of host, not really used */
+ uint32_t rdb_BlockBytes; /* Size of disk blocks */
+ uint32_t rdb_Flags; /* RDB Flags */
+ /* block list heads */
+ uint32_t rdb_BadBlockList; /* Bad block list */
+ uint32_t rdb_PartitionList; /* Partition list */
+ uint32_t rdb_FileSysHeaderList; /* File system header list */
+ uint32_t rdb_DriveInit; /* Drive specific init code */
+ uint32_t rdb_BootBlockList; /* Amiga OS 4 Boot Blocks */
+ uint32_t rdb_Reserved1[5]; /* Unused word, need to be set to $ffffffff */
+ /* physical drive characteristics */
+ uint32_t rdb_Cylinders; /* Number of the cylinders of the drive */
+ uint32_t rdb_Sectors; /* Number of sectors of the drive */
+ uint32_t rdb_Heads; /* Number of heads of the drive */
+ uint32_t rdb_Interleave; /* Interleave */
+ uint32_t rdb_Park; /* Head parking cylinder */
+ uint32_t rdb_Reserved2[3]; /* Unused word, need to be set to $ffffffff */
+ uint32_t rdb_WritePreComp; /* Starting cylinder of write precompensation */
+ uint32_t rdb_ReducedWrite; /* Starting cylinder of reduced write current */
+ uint32_t rdb_StepRate; /* Step rate of the drive */
+ uint32_t rdb_Reserved3[5]; /* Unused word, need to be set to $ffffffff */
+ /* logical drive characteristics */
+ uint32_t rdb_RDBBlocksLo; /* low block of range reserved for hardblocks */
+ uint32_t rdb_RDBBlocksHi; /* high block of range for these hardblocks */
+ uint32_t rdb_LoCylinder; /* low cylinder of partitionable disk area */
+ uint32_t rdb_HiCylinder; /* high cylinder of partitionable data area */
+ uint32_t rdb_CylBlocks; /* number of blocks available per cylinder */
+ uint32_t rdb_AutoParkSeconds; /* zero for no auto park */
+ uint32_t rdb_HighRDSKBlock; /* highest block used by RDSK */
+ /* (not including replacement bad blocks) */
+ uint32_t rdb_Reserved4;
+ /* drive identification */
+ char rdb_DiskVendor[8];
+ char rdb_DiskProduct[16];
+ char rdb_DiskRevision[4];
+ char rdb_ControllerVendor[8];
+ char rdb_ControllerProduct[16];
+ char rdb_ControllerRevision[4];
+ uint32_t rdb_Reserved5[10];
+};
+
+#define AMIGA_MAX_PARTITIONS 128
+#define RDB_LOCATION_LIMIT 16
+#define RDSK(pos) ((struct RigidDiskBlock *)(pos))
+
+static int
+_amiga_checksum (struct AmigaBlock *blk) {
+ uint32_t *rdb = (uint32_t *) blk;
+ uint32_t sum;
+ int i, end;
+
+ sum = PED_BE32_TO_CPU (rdb[0]);
+ end = PED_BE32_TO_CPU (rdb[1]);
+
+ if (end > PED_SECTOR_SIZE_DEFAULT) end = PED_SECTOR_SIZE_DEFAULT;
+
+ for (i = 1; i < end; i++) sum += PED_BE32_TO_CPU (rdb[i]);
+
+ return sum;
+}
+
+static void
+_amiga_calculate_checksum (struct AmigaBlock *blk) {
+
+ blk->amiga_ChkSum = PED_CPU_TO_BE32(
+ PED_BE32_TO_CPU(blk->amiga_ChkSum) -
+ _amiga_checksum((struct AmigaBlock *) blk));
+ return;
+}
+
+
+static struct AmigaBlock *
+_amiga_read_block (PedDevice *dev, struct AmigaBlock *blk, PedSector block, struct AmigaIds *ids) {
+ if (!ped_device_read (dev, blk, block, 1)) {
+ switch (ped_exception_throw(PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("%s : Couldn't read block %llu\n"), __func__, block))
+ {
+ case PED_EXCEPTION_CANCEL :
+ case PED_EXCEPTION_UNHANDLED :
+ default :
+ return NULL;
+ }
+ }
+ if (ids && !_amiga_id_in_list(PED_BE32_TO_CPU(blk->amiga_ID), ids))
+ return NULL;
+ if (_amiga_checksum (blk) != 0) {
+ switch (ped_exception_throw(PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_FIX | PED_EXCEPTION_IGNORE | PED_EXCEPTION_CANCEL,
+ _("%s : Bad checksum on block %llu of type %s\n"),
+ __func__, block, _amiga_block_id(PED_BE32_TO_CPU(blk->amiga_ID))))
+ {
+ case PED_EXCEPTION_CANCEL :
+ return NULL;
+ case PED_EXCEPTION_FIX :
+ _amiga_calculate_checksum(AMIGA(blk));
+ if (!ped_device_write (dev, blk, block, 1)) {
+ switch (ped_exception_throw(PED_EXCEPTION_FATAL,
+ PED_EXCEPTION_CANCEL,
+ _("%s : Couldn't write block %d\n"), __func__, block))
+ {
+ case PED_EXCEPTION_CANCEL :
+ case PED_EXCEPTION_UNHANDLED :
+ default :
+ return NULL;
+ }
+ }
+ case PED_EXCEPTION_IGNORE :
+ case PED_EXCEPTION_UNHANDLED :
+ default :
+ return blk;
+ }
+ }
+ return blk;
+}
+
+static uint32_t
+_amiga_find_rdb (PedDevice *dev, struct RigidDiskBlock *rdb) {
+ int i;
+ struct AmigaIds *ids;
+
+ ids = _amiga_add_id (IDNAME_RIGIDDISK, NULL);
+
+ for (i = 0; i<RDB_LOCATION_LIMIT; i++) {
+ if (!_amiga_read_block (dev, AMIGA(rdb), i, ids)) {
+ continue;
+ }
+ if (PED_BE32_TO_CPU (rdb->rdb_ID) == IDNAME_RIGIDDISK) {
+ _amiga_free_ids (ids);
+ return i;
+ }
+ }
+ _amiga_free_ids (ids);
+ return AMIGA_RDB_NOT_FOUND;
+}
+
+static int
+_amiga_loop_check (uint32_t block, uint32_t * blocklist, uint32_t max)
+{
+ uint32_t i;
+
+ for (i = 0; i < max; i++)
+ if (block == blocklist[i]) {
+ /* We are looping, let's stop. */
+ return 1;
+ }
+ blocklist[max] = block;
+ return 0;
+}
+
+/* We have already allocated a rdb, we are now reading it from the disk */
+struct PartitionBlock *
+amiga_find_part (PedGeometry *geom, struct PartitionBlock *part)
+{
+ struct RigidDiskBlock *rdb;
+ uint32_t partblock;
+ uint32_t partlist[AMIGA_MAX_PARTITIONS];
+ int i;
+
+ PED_ASSERT(geom!= NULL, return NULL);
+ PED_ASSERT(geom->dev!= NULL, return NULL);
+
+ if (!(rdb = ped_malloc (PED_SECTOR_SIZE_DEFAULT))) {
+ switch (ped_exception_throw(PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("%s : Failed to allocate disk_specific rdb block\n"), __func__))
+ {
+ case PED_EXCEPTION_CANCEL :
+ case PED_EXCEPTION_UNHANDLED :
+ default :
+ return NULL;
+ }
+ }
+ if (_amiga_find_rdb (geom->dev, rdb) == AMIGA_RDB_NOT_FOUND) {
+ switch (ped_exception_throw(PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("%s : Didn't find rdb block, should never happen\n"), __func__))
+ {
+ case PED_EXCEPTION_CANCEL :
+ case PED_EXCEPTION_UNHANDLED :
+ default :
+ ped_free(rdb);
+ return NULL;
+ }
+ }
+
+ /* We initialize the hardblock free list to detect loops */
+ for (i = 0; i < AMIGA_MAX_PARTITIONS; i++) partlist[i] = IDNAME_FREE;
+
+ for (i = 1, partblock = PED_BE32_TO_CPU(rdb->rdb_PartitionList);
+ i < AMIGA_MAX_PARTITIONS && partblock != IDNAME_FREE;
+ i++, partblock = PED_BE32_TO_CPU(part->pb_Next))
+ {
+ PedSector start, end;
+ PedSector cylblocks;
+
+ /* Let's look for loops in the partition table */
+ if (_amiga_loop_check(partblock, partlist, i)) {
+ ped_free (rdb);
+ return NULL;
+ }
+ /* Let's read a partition block to get its geometry*/
+ if (!ped_device_read (geom->dev, part, (PedSector)partblock, 1)) {
+ switch (ped_exception_throw(PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("%s : Failed to read partition block %llu\n"),
+ __func__, (PedSector)partblock))
+ {
+ case PED_EXCEPTION_CANCEL :
+ case PED_EXCEPTION_UNHANDLED :
+ default :
+ ped_free(rdb);
+ return NULL;
+ }
+ }
+
+ /* Current block is not a Partition Block */
+ if (part->pb_ID != IDNAME_PARTITION) {
+ ped_free (rdb);
+ return NULL;
+ }
+
+ /* Calculate the geometry of the partition */
+ cylblocks = ((PedSector) PED_BE32_TO_CPU (part->de_Surfaces)) *
+ ((PedSector) PED_BE32_TO_CPU (part->de_BlocksPerTrack));
+ start = ((PedSector) PED_BE32_TO_CPU (part->de_LowCyl)) * cylblocks;
+ end = ((((PedSector) PED_BE32_TO_CPU (part->de_HighCyl))+1) * (cylblocks))-1;
+
+ /* And check if it is the one we are searching for */
+ if (start == geom->start && end == geom->end) {
+ ped_free (rdb);
+ return part;
+ }
+ }
+
+ ped_free (rdb);
+ return NULL;
+}
diff --git a/libparted/fs/amiga/amiga.h b/libparted/fs/amiga/amiga.h
new file mode 100644
index 0000000..a7bc1f8
--- /dev/null
+++ b/libparted/fs/amiga/amiga.h
@@ -0,0 +1,71 @@
+/*
+ util.h -- amiga partition table headers.
+ Copyright (C) 1998-2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+struct PartitionBlock {
+ uint32_t pb_ID; /* Identifier 32 bit word : 'PART' */
+ uint32_t pb_SummedLongs; /* Size of the structure for checksums */
+ int32_t pb_ChkSum; /* Checksum of the structure */
+ uint32_t pb_HostID; /* SCSI Target ID of host, not really used */
+ uint32_t pb_Next; /* Block number of the next PartitionBlock */
+ uint32_t pb_Flags; /* Part Flags (NOMOUNT and BOOTABLE) */
+ uint32_t pb_Reserved1[2];
+ uint32_t pb_DevFlags; /* Preferred flags for OpenDevice */
+ uint8_t pb_DriveName[32]; /* Preferred DOS device name: BSTR form */
+ uint32_t pb_Reserved2[15];
+ uint32_t de_TableSize; /* Size of Environment vector */
+ uint32_t de_SizeBlock; /* Size of the blocks in 32 bit words, usually 128 */
+ uint32_t de_SecOrg; /* Not used; must be 0 */
+ uint32_t de_Surfaces; /* Number of heads (surfaces) */
+ uint32_t de_SectorPerBlock; /* Disk sectors per block, used with SizeBlock, usually 1 */
+ uint32_t de_BlocksPerTrack; /* Blocks per track. drive specific */
+ uint32_t de_Reserved; /* DOS reserved blocks at start of partition. */
+ uint32_t de_PreAlloc; /* DOS reserved blocks at end of partition */
+ uint32_t de_Interleave; /* Not used, usually 0 */
+ uint32_t de_LowCyl; /* First cylinder of the partition */
+ uint32_t de_HighCyl; /* Last cylinder of the partition */
+ uint32_t de_NumBuffers; /* Initial # DOS of buffers. */
+ uint32_t de_BufMemType; /* Type of mem to allocate for buffers */
+ uint32_t de_MaxTransfer; /* Max number of bytes to transfer at a time */
+ uint32_t de_Mask; /* Address Mask to block out certain memory */
+ int32_t de_BootPri; /* Boot priority for autoboot */
+ uint32_t de_DosType; /* Dostype of the file system */
+ uint32_t de_Baud; /* Baud rate for serial handler */
+ uint32_t de_Control; /* Control word for handler/filesystem */
+ uint32_t de_BootBlocks; /* Number of blocks containing boot code */
+ uint32_t pb_EReserved[12];
+};
+
+#define PART(pos) ((struct PartitionBlock *)(pos))
+
+#define PBFB_BOOTABLE 0 /* this partition is intended to be bootable */
+#define PBFF_BOOTABLE 1L /* (expected directories and files exist) */
+#define PBFB_NOMOUNT 1 /* do not mount this partition (e.g. manually */
+#define PBFF_NOMOUNT 2L /* mounted, but space reserved here) */
+
+struct PartitionBlock * amiga_find_part (PedGeometry *geom, struct PartitionBlock *part);
+
+struct AmigaIds {
+ uint32_t ID;
+ struct AmigaIds *next;
+};
+
+struct AmigaIds * _amiga_add_id (uint32_t id, struct AmigaIds *ids);
+void _amiga_free_ids (struct AmigaIds *ids);
+int _amiga_id_in_list (uint32_t id, struct AmigaIds *ids);
+
diff --git a/libparted/fs/amiga/apfs.c b/libparted/fs/amiga/apfs.c
new file mode 100644
index 0000000..f92c416
--- /dev/null
+++ b/libparted/fs/amiga/apfs.c
@@ -0,0 +1,154 @@
+/*
+ apfs.c -- parted support for apfs file systems
+ Copyright (C) 1998-2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <parted/parted.h>
+#include <parted/debug.h>
+#include <parted/endian.h>
+
+#include "amiga.h"
+#include "apfs.h"
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+static int
+_apfs_probe_root (uint32_t *block, uint32_t blocksize, uint32_t kind) {
+ if (PED_BE32_TO_CPU (block[0]) != kind) return 0;
+ return 1;
+}
+
+static PedGeometry*
+_generic_apfs_probe (PedGeometry* geom, uint32_t kind)
+{
+ uint32_t *block;
+ int32_t i, sum;
+ PedSector root;
+ struct PartitionBlock * part;
+ uint32_t blocksize = 1, reserved = 2, prealloc = 0;
+
+ PED_ASSERT (geom != NULL, return NULL);
+ PED_ASSERT (geom->dev != NULL, return NULL);
+
+ /* Finds the blocksize, prealloc and reserved values of the partition block */
+ if (!(part = ped_malloc (PED_SECTOR_SIZE_DEFAULT*blocksize))) {
+ ped_exception_throw(PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("%s : Failed to allocate partition block\n"), __func__);
+ goto error_part;
+ }
+ if (amiga_find_part(geom, part) != NULL) {
+ prealloc = PED_BE32_TO_CPU (part->de_PreAlloc);
+ reserved = PED_BE32_TO_CPU (part->de_Reserved);
+ blocksize = PED_BE32_TO_CPU (part->de_SizeBlock)
+ * PED_BE32_TO_CPU (part->de_SectorPerBlock) / 128;
+ }
+ ped_free (part);
+
+ /* Test boot block */
+ if (!(block = ped_malloc (PED_SECTOR_SIZE_DEFAULT*blocksize))) {
+ ped_exception_throw(PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("%s : Failed to allocate block\n"), __func__);
+ goto error_block;
+ }
+ if (!ped_device_read (geom->dev, block, geom->start, blocksize)) {
+ ped_exception_throw(PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("%s : Couldn't read boot block %llu\n"), __func__, geom->start);
+ goto error;
+ }
+ if (PED_BE32_TO_CPU (block[0]) != kind) {
+ goto error;
+ }
+
+ /* Find and test the root block */
+ root = geom->start+reserved*blocksize;
+ if (!ped_device_read (geom->dev, block, root, blocksize)) {
+ ped_exception_throw(PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("%s : Couldn't read root block %llu\n"), __func__, root);
+ goto error;
+ }
+ if (_apfs_probe_root(block, blocksize, kind) == 1) {
+ ped_free(block);
+ return ped_geometry_duplicate (geom);
+ }
+
+error:
+ ped_free (block);
+error_block:
+error_part:
+ return NULL;
+}
+
+static PedGeometry*
+_apfs1_probe (PedGeometry* geom) {
+ return _generic_apfs_probe (geom, 0x50463101);
+}
+
+static PedGeometry*
+_apfs2_probe (PedGeometry* geom) {
+ return _generic_apfs_probe (geom, 0x50463102);
+}
+
+static PedFileSystemOps _apfs1_ops = {
+ probe: _apfs1_probe,
+ clobber: NULL,
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ resize: NULL,
+ copy: NULL,
+ get_create_constraint: NULL,
+ get_copy_constraint: NULL,
+ get_resize_constraint: NULL
+};
+static PedFileSystemOps _apfs2_ops = {
+ probe: _apfs2_probe,
+ clobber: NULL,
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ resize: NULL,
+ copy: NULL,
+ get_create_constraint: NULL,
+ get_copy_constraint: NULL,
+ get_resize_constraint: NULL
+};
+
+#define APFS_BLOCK_SIZES ((int[2]){512, 0})
+
+PedFileSystemType _apfs1_type = {
+ next: NULL,
+ ops: &_apfs1_ops,
+ name: "apfs1",
+ block_sizes: APFS_BLOCK_SIZES
+};
+PedFileSystemType _apfs2_type = {
+ next: NULL,
+ ops: &_apfs2_ops,
+ name: "apfs2",
+ block_sizes: APFS_BLOCK_SIZES
+};
diff --git a/libparted/fs/amiga/apfs.h b/libparted/fs/amiga/apfs.h
new file mode 100644
index 0000000..543a509
--- /dev/null
+++ b/libparted/fs/amiga/apfs.h
@@ -0,0 +1,19 @@
+
+/*
+ apfs.h -- parted support for apfs file systems header files
+ Copyright (C) 1998-2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
diff --git a/libparted/fs/amiga/asfs.c b/libparted/fs/amiga/asfs.c
new file mode 100644
index 0000000..eb87559
--- /dev/null
+++ b/libparted/fs/amiga/asfs.c
@@ -0,0 +1,145 @@
+/*
+ asfs.c -- parted asfs filesystem support
+ Copyright (C) 1998-2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <parted/parted.h>
+#include <parted/debug.h>
+#include <parted/endian.h>
+
+#include "amiga.h"
+#include "asfs.h"
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+static int
+_asfs_probe_root (PedGeometry *geom, uint32_t *block, int blocksize, PedSector root) {
+ int i, sum;
+ PedSector start, end;
+
+ if (PED_BE32_TO_CPU (block[0]) != 0x53465300) return 0;
+ for (i = 0, sum = 1; i < 128*blocksize; i++) sum += PED_BE32_TO_CPU (block[i]);
+ if (sum != 0) return 0;
+ if (PED_BE32_TO_CPU (block[2]) * blocksize + geom->start != root) {
+ return 0;
+ }
+ start = ((((PedSector) PED_BE32_TO_CPU (block[8])) << 32)
+ + (PedSector) PED_BE32_TO_CPU (block[9])) / 512;
+ end = (((((PedSector) PED_BE32_TO_CPU (block[10])) << 32)
+ + (PedSector) PED_BE32_TO_CPU (block[11])) / 512) - 1;
+ if (start != geom->start || end != geom->end) return 0;
+ return 1;
+}
+
+static PedGeometry*
+_asfs_probe (PedGeometry* geom)
+{
+ uint32_t *block;
+ struct PartitionBlock * part;
+ int blocksize = 1, reserved = 1, prealloc = 1;
+ PedSector root, root2;
+ int found = 0;
+
+ PED_ASSERT (geom != NULL, return NULL);
+ PED_ASSERT (geom->dev != NULL, return NULL);
+
+ /* Finds the blocksize, prealloc and reserved values of the partition block */
+ if (!(part = ped_malloc (PED_SECTOR_SIZE_DEFAULT*blocksize))) {
+ ped_exception_throw(PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("%s : Failed to allocate partition block\n"), __func__);
+ goto error_part;
+ }
+ if (amiga_find_part(geom, part) != NULL) {
+ prealloc = PED_BE32_TO_CPU (part->de_PreAlloc) == 0 ?
+ 1 : PED_BE32_TO_CPU (part->de_PreAlloc);
+ reserved = PED_BE32_TO_CPU (part->de_Reserved) == 0 ?
+ 1 : PED_BE32_TO_CPU (part->de_Reserved);
+ blocksize = PED_BE32_TO_CPU (part->de_SizeBlock)
+ * PED_BE32_TO_CPU (part->de_SectorPerBlock) / 128;
+ }
+ ped_free (part);
+
+ /* Test boot block */
+ if (!(block = ped_malloc (PED_SECTOR_SIZE_DEFAULT*blocksize))) {
+ ped_exception_throw(PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("%s : Failed to allocate block\n"), __func__);
+ goto error_block;
+ }
+ root = geom->start;
+ if (!ped_device_read (geom->dev, block, root, blocksize)) {
+ ped_exception_throw(PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("%s : Couldn't read root block %llu\n"), __func__, root);
+ goto error;
+ }
+ if (PED_BE32_TO_CPU (block[0]) != 0x53465300) {
+ goto error;
+ }
+
+ /* Find and test the root blocks */
+ if (_asfs_probe_root(geom, block, blocksize, root)) {
+ found++;
+ }
+ root = geom->end - blocksize - (geom->length % blocksize) + 1;
+ if (!ped_device_read (geom->dev, block, root, 1)) {
+ ped_exception_throw(PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("%s : Couldn't read root block %llu\n"), __func__, root);
+ goto error;
+ }
+ if (_asfs_probe_root(geom, block, blocksize, root)) {
+ found++;
+ }
+ if (found != 0) {
+ ped_free (block);
+ return ped_geometry_duplicate (geom);
+ }
+
+error:
+ ped_free (block);
+error_block:
+error_part:
+ return NULL;
+}
+
+static PedFileSystemOps _asfs_ops = {
+ probe: _asfs_probe,
+ clobber: NULL,
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ resize: NULL,
+ copy: NULL,
+ get_create_constraint: NULL,
+ get_copy_constraint: NULL,
+ get_resize_constraint: NULL
+};
+
+PedFileSystemType _asfs_type = {
+ next: NULL,
+ ops: &_asfs_ops,
+ name: "asfs",
+ block_sizes: ((int[2]){512, 0})
+};
diff --git a/libparted/fs/amiga/asfs.h b/libparted/fs/amiga/asfs.h
new file mode 100644
index 0000000..959fc16
--- /dev/null
+++ b/libparted/fs/amiga/asfs.h
@@ -0,0 +1,19 @@
+
+/*
+ asfs.h -- parted asfs filesystem support header files
+ Copyright (C) 1998-2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
diff --git a/libparted/fs/amiga/interface.c b/libparted/fs/amiga/interface.c
new file mode 100644
index 0000000..a3c57f8
--- /dev/null
+++ b/libparted/fs/amiga/interface.c
@@ -0,0 +1,90 @@
+/*
+ interface.c -- parted support amiga file systems
+ Copyright (C) 1998-2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+
+#include "config.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <parted/parted.h>
+#include <parted/debug.h>
+#include <parted/endian.h>
+
+extern PedFileSystemType _affs0_type;
+extern PedFileSystemType _affs1_type;
+extern PedFileSystemType _affs2_type;
+extern PedFileSystemType _affs3_type;
+extern PedFileSystemType _affs4_type;
+extern PedFileSystemType _affs5_type;
+extern PedFileSystemType _affs6_type;
+extern PedFileSystemType _affs7_type;
+extern PedFileSystemType _amufs_type;
+extern PedFileSystemType _amufs0_type;
+extern PedFileSystemType _amufs1_type;
+extern PedFileSystemType _amufs2_type;
+extern PedFileSystemType _amufs3_type;
+extern PedFileSystemType _amufs4_type;
+extern PedFileSystemType _amufs5_type;
+extern PedFileSystemType _asfs_type;
+extern PedFileSystemType _apfs1_type;
+extern PedFileSystemType _apfs2_type;
+
+void ped_file_system_amiga_init ()
+{
+ ped_file_system_type_register (&_affs0_type);
+ ped_file_system_type_register (&_affs1_type);
+ ped_file_system_type_register (&_affs2_type);
+ ped_file_system_type_register (&_affs3_type);
+ ped_file_system_type_register (&_affs4_type);
+ ped_file_system_type_register (&_affs5_type);
+ ped_file_system_type_register (&_affs6_type);
+ ped_file_system_type_register (&_affs7_type);
+ ped_file_system_type_register (&_amufs_type);
+ ped_file_system_type_register (&_amufs0_type);
+ ped_file_system_type_register (&_amufs1_type);
+ ped_file_system_type_register (&_amufs2_type);
+ ped_file_system_type_register (&_amufs3_type);
+ ped_file_system_type_register (&_amufs4_type);
+ ped_file_system_type_register (&_amufs5_type);
+ ped_file_system_type_register (&_asfs_type);
+ ped_file_system_type_register (&_apfs1_type);
+ ped_file_system_type_register (&_apfs2_type);
+}
+
+void ped_file_system_amiga_done ()
+{
+ ped_file_system_type_unregister (&_affs0_type);
+ ped_file_system_type_unregister (&_affs1_type);
+ ped_file_system_type_unregister (&_affs2_type);
+ ped_file_system_type_unregister (&_affs3_type);
+ ped_file_system_type_unregister (&_affs4_type);
+ ped_file_system_type_unregister (&_affs5_type);
+ ped_file_system_type_unregister (&_affs6_type);
+ ped_file_system_type_unregister (&_affs7_type);
+ ped_file_system_type_unregister (&_amufs_type);
+ ped_file_system_type_unregister (&_amufs0_type);
+ ped_file_system_type_unregister (&_amufs1_type);
+ ped_file_system_type_unregister (&_amufs2_type);
+ ped_file_system_type_unregister (&_amufs3_type);
+ ped_file_system_type_unregister (&_amufs4_type);
+ ped_file_system_type_unregister (&_amufs5_type);
+ ped_file_system_type_unregister (&_asfs_type);
+ ped_file_system_type_unregister (&_apfs1_type);
+ ped_file_system_type_unregister (&_apfs2_type);
+}
diff --git a/libparted/fs/bfs/Makefile.am b/libparted/fs/bfs/Makefile.am
new file mode 100644
index 0000000..8bd73f1
--- /dev/null
+++ b/libparted/fs/bfs/Makefile.am
@@ -0,0 +1,6 @@
+partedincludedir = -I$(top_srcdir)/include
+
+noinst_LTLIBRARIES = libbfs.la
+libbfs_la_SOURCES = bfs.c
+
+INCLUDES = $(partedincludedir) @INTLINCS@
diff --git a/libparted/fs/bfs/bfs.c b/libparted/fs/bfs/bfs.c
new file mode 100644
index 0000000..4a5c5ba
--- /dev/null
+++ b/libparted/fs/bfs/bfs.c
@@ -0,0 +1,276 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#include "config.h"
+
+#include <parted/parted.h>
+#include <parted/endian.h>
+#include <parted/debug.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+#include <unistd.h>
+#include <string.h>
+
+#include "bfs.h"
+
+
+#define BFS_SPECIFIC(fs) ((struct BfsSpecific*) (fs->type_specific))
+#define BFS_SB(fs) (BFS_SPECIFIC(fs)->sb)
+
+
+const char BFS_MAGIC[4] = { 0x1B, 0xAD, 0xFA, 0xCE };
+const long long BFS_SECTOR_SIZE = 512;
+const uint32_t BFS_PED_SANITY = 0xffffffff;
+const long long BFS_PED_MIN_INODES = 16;
+
+static PedGeometry*
+bfs_probe (PedGeometry* geom)
+{
+ uint8_t* buf;
+
+ PED_ASSERT (geom != NULL, return NULL);
+ PED_ASSERT (geom->dev != NULL, return NULL);
+
+ buf = ped_malloc (geom->dev->sector_size);
+
+ if (!ped_geometry_read (geom, buf, 0, 1))
+ return 0;
+
+ //if ( PED_CPU_TO_LE32((uint32_t)buf) == BFS_MAGIC )
+ return ped_geometry_new (geom->dev, geom->start,
+ ped_div_round_up (
+ PED_CPU_TO_LE32((uint32_t)(buf+8)),
+ geom->dev->sector_size));
+ else
+ return NULL;
+}
+
+#ifndef DISCOVER_ONLY
+static int
+bfs_clobber (PedGeometry* geom)
+{
+ uint8_t* buf;
+
+ PED_ASSERT (geom != NULL, return 0);
+ PED_ASSERT (geom->dev != NULL, return 0);
+
+ buf = ped_malloc (geom->dev->sector_size);
+
+ if (!ped_geometry_read (geom, buf, 0, 1))
+ return 0;
+ memset (buf, 0, 512);
+ return ped_geometry_write (geom, buf, 0, 1);
+}
+#endif /* !DISCOVER_ONLY */
+
+
+static PedFileSystem*
+bfs_alloc (const PedGeometry* geom)
+{
+ PedFileSystem* fs;
+
+ fs = (PedFileSystem*) ped_malloc (sizeof (PedFileSystem));
+ if (!fs)
+ goto error;
+
+ fs->type_specific = (struct BfsSpecific*) ped_malloc (
+ sizeof (struct BfsSpecific));
+ if (!fs->type_specific)
+ goto error_free_fs;
+
+ fs->geom = ped_geometry_duplicate (geom);
+ if (!fs->geom)
+ goto error_free_type_specific;
+
+ fs->checked = 0;
+ return fs;
+
+error_free_type_specific:
+ ped_free (fs->type_specific);
+error_free_fs:
+ ped_free (fs);
+error:
+ return NULL;
+}
+
+
+void
+bfs_free (PedFileSystem* fs)
+{
+ ped_geometry_destroy (fs->geom);
+ ped_free (fs->type_specific);
+ ped_free (fs);
+}
+
+
+static PedFileSystem*
+bfs_open (PedGeometry *geom)
+{
+ PedFileSystem* fs = bfs_alloc (geom);
+
+ struct bfs_sb* sb = (struct bfs_sb*) ped_malloc(sizeof(struct bfs_sb));
+ struct BfsSpecific* bfs;
+ uint8_t* buf;
+
+ PED_ASSERT (geom != NULL, return NULL);
+ PED_ASSERT (geom->dev != NULL, return NULL);
+
+ buf = ped_malloc (geom->dev->sector_size);
+
+ if (!fs)
+ return NULL;
+
+ bfs = fs->type_specific;
+
+ if (!ped_geometry_read (geom, buf, 0, 1))
+ return NULL;
+
+ memcpy (sb, buf, BFS_SECTOR_SIZE);
+
+ bfs->sb = sb;
+
+ return fs;
+}
+
+
+#ifndef DISCOVER_ONLY
+static struct bfs_inode* create_root_inode()
+{
+ struct bfs_inode* root = ped_malloc (sizeof(struct bfs_inode));
+
+ root->i = 2UL;
+ /*root->start = FIX;
+ root->end = ;
+ root->eof_off = ;*/
+ root->attr = 2UL;
+ root->mode = 512UL; /* rwxrwxrwx */
+ root->uid = root->gid = 0UL;
+ root->nlinks = 0UL;
+ root->atime = root->ctime = 0UL;
+ memset ((void*)root->reserved, 0, 32*4);
+
+ return root;
+}
+
+
+static uint8_t* _block_alloc (int n)
+{
+ return ped_calloc (n * BFS_SECTOR_SIZE);
+}
+
+
+static void _write_inodes (PedFileSystem* fs)
+{
+}
+
+
+/* write a BFS block - always 512 bytes */
+static int _write_block (PedFileSystem* fs, uint8_t* buf, int n)
+{
+ /* FIXME: support for bs != 2^9 */
+ return ped_geometry_write ( fs->geom, buf, n, 1 );
+}
+
+
+static int _write_sb (PedFileSystem* fs)
+{
+ uint8_t* sb = _block_alloc (1);
+
+ BFS_SB(fs)->magic = BFS_MAGIC;
+ BFS_SB(fs)->sanity = BFS_PED_SANITY;
+ BFS_SB(fs)->start = BFS_SPECIFIC(fs)->data_start;
+ BFS_SB(fs)->size = BFS_SPECIFIC(fs)->size;
+
+ memcpy (sb, BFS_SB(fs), sizeof(struct bfs_sb));
+
+ return _write_block (fs, sb, 1);
+}
+
+
+static PedFileSystem*
+bfs_create (PedGeometry *geom, PedTimer *timer)
+{
+ PedFileSystem* fs = bfs_alloc (geom);
+ int n_inodes = PED_MAX (BFS_PED_MIN_INODES, 16/*some sane value here*/);
+
+ /* TODO: check whether geometry is big enough */
+
+ fs->data_start = 1 + ped_round_up_to (n_inodes * 64, 512);
+ fs->size = geom->dev->sector_size * length;
+
+ ped_timer_set_state_name (timer, "Writing inodes");
+
+
+
+ ped_timer_set_state_name (timer, "Writing super block");
+ _write_sb (fs);
+
+ return 0;
+}
+#endif /* !DISCOVER_ONLY */
+
+
+static PedFileSystemOps bfs_ops = {
+ probe: bfs_probe,
+#ifndef DISCOVER_ONLY
+ clobber: bfs_clobber,
+#else
+ clobber: NULL,
+#endif
+ open: bfs_open,
+#ifndef DISCOVER_ONLY
+ create: bfs_create,
+#else
+ create: NULL
+#endif
+ close: NULL,
+ check: NULL,
+ copy: NULL,
+ resize: NULL,
+ get_create_constraint: NULL,
+ get_resize_constraint: NULL,
+ get_copy_constraint: NULL
+};
+
+static PedFileSystemType bfs_type = {
+ next: NULL,
+ ops: &bfs_ops,
+ name: "bfs",
+ block_sizes: ((int[2]){512, 0})
+};
+
+void
+ped_file_system_bfs_init ()
+{
+ ped_file_system_type_register (&bfs_type);
+}
+
+void
+ped_file_system_bfs_done ()
+{
+ ped_file_system_type_unregister (&bfs_type);
+}
+
+
diff --git a/libparted/fs/bfs/bfs.h b/libparted/fs/bfs/bfs.h
new file mode 100644
index 0000000..07d8a75
--- /dev/null
+++ b/libparted/fs/bfs/bfs.h
@@ -0,0 +1,47 @@
+#ifndef BFS_H
+#define BFS_H
+
+#ifndef blk_t
+ typedef long long blk_t;
+#endif
+
+struct bfs_sb
+{
+ char magic[4];
+ uint32_t start;
+ uint32_t size;
+ uint32_t sanity[4];
+};
+
+struct bfs_inode
+{
+ uint32_t i;
+ uint32_t start;
+ uint32_t end;
+ uint32_t eof_off;
+ uint32_t attr;
+ uint32_t mode;
+ uint32_t uid;
+ uint32_t gid;
+ uint32_t nlinks;
+ uint32_t atime;
+ uint32_t ctime;
+ uint32_t reserved[4];
+};
+
+struct bfs_dirent
+{
+ uint16_t i;
+ uint8_t name[14];
+};
+
+struct BfsSpecific
+{
+ struct bfs_sb *sb;
+ int n_inodes;
+ blk_t data_start;
+ long long size;
+};
+
+#endif
+
diff --git a/libparted/fs/ext2/Makefile.am b/libparted/fs/ext2/Makefile.am
new file mode 100644
index 0000000..f4f202c
--- /dev/null
+++ b/libparted/fs/ext2/Makefile.am
@@ -0,0 +1,19 @@
+partedincludedir = -I$(top_srcdir)/include
+
+noinst_LTLIBRARIES = libext2.la
+libext2_la_SOURCES = ext2.c \
+ ext2.h \
+ ext2_fs.h \
+ ext2_block_relocator.c \
+ ext2_buffer.c \
+ ext2_inode_relocator.c \
+ ext2_meta.c \
+ ext2_mkfs.c \
+ ext2_resize.c \
+ interface.c \
+ parted_io.c \
+ parted_io.h \
+ tune.c \
+ tune.h
+
+INCLUDES = $(partedincludedir) @INTLINCS@
diff --git a/libparted/fs/ext2/ext2.c b/libparted/fs/ext2/ext2.c
new file mode 100644
index 0000000..c7e6592
--- /dev/null
+++ b/libparted/fs/ext2/ext2.c
@@ -0,0 +1,794 @@
+/*
+ ext2.c -- generic ext2 stuff
+ Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+
+#ifndef DISCOVER_ONLY
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <uuid/uuid.h>
+#include "ext2.h"
+
+/* ext2 stuff ****************************************************************/
+
+unsigned char _bitmap[8] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};
+
+int ext2_copy_block(struct ext2_fs *fs, blk_t from, blk_t to)
+{
+ unsigned char* buf = ped_malloc (fs->blocksize);
+
+ if (!ext2_bcache_flush(fs, from)) return 0;
+ if (!ext2_bcache_flush(fs, to)) return 0;
+
+ if (!ext2_read_blocks(fs, buf, from, 1)) return 0;
+ if (!ext2_write_blocks(fs, buf, to, 1)) return 0;
+
+ return 1;
+}
+
+int ext2_get_block_state(struct ext2_fs *fs, blk_t block)
+{
+ struct ext2_buffer_head *bh;
+ int group;
+ int offset;
+ int state;
+
+ block -= EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb);
+ group = block / EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb);
+ offset = block % EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb);
+
+ bh = ext2_bread(fs, EXT2_GROUP_BLOCK_BITMAP(fs->gd[group]));
+ state = bh->data[offset>>3] & _bitmap[offset&7];
+ ext2_brelse(bh, 0);
+
+ return state;
+}
+
+blk_t ext2_find_free_block(struct ext2_fs *fs)
+{
+ int i;
+
+ for (i=0;i<fs->numgroups;i++)
+ if (EXT2_GROUP_FREE_BLOCKS_COUNT(fs->gd[i]))
+ {
+ blk_t j;
+ blk_t offset;
+
+ offset = i * EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb)
+ + EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb);
+ for (j=fs->adminblocks;
+ j<EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb);
+ j++)
+ if (ext2_is_data_block(fs, offset + j) &&
+ !ext2_get_block_state(fs, offset + j))
+ return offset + j;
+
+ ped_exception_throw (PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Inconsistent group descriptors!"));
+ }
+
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("File system full!"));
+ return 0;
+}
+
+ino_t ext2_find_free_inode(struct ext2_fs *fs)
+{
+ int i;
+
+ for (i=0;i<fs->numgroups;i++)
+ if (EXT2_GROUP_FREE_INODES_COUNT(fs->gd[i]))
+ {
+ ino_t j;
+ ino_t offset;
+
+ offset = i * EXT2_SUPER_INODES_PER_GROUP(fs->sb) + 1;
+ for (j=0;j<EXT2_SUPER_INODES_PER_GROUP(fs->sb);j++)
+ if (!ext2_get_inode_state(fs, offset + j))
+ return offset + j;
+
+ ped_exception_throw (PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Inconsistent group descriptors!"));
+ }
+
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("File system full!"));
+ return 0;
+}
+
+int ext2_move_blocks(struct ext2_fs *fs, blk_t src, blk_t num, blk_t dest)
+{
+ unsigned char *buf;
+ blk_t i;
+
+ ped_exception_fetch_all();
+ if ((buf = ped_malloc(num << fs->logsize)) != NULL)
+ {
+ ped_exception_leave_all();
+
+ if (!ext2_bcache_flush_range(fs, src, num)) return 0;
+ if (!ext2_bcache_flush_range(fs, dest, num)) return 0;
+
+ if (!ext2_read_blocks(fs, buf, src, num)) return 0;
+ if (!ext2_write_blocks(fs, buf, dest, num)) return 0;
+
+ ped_free(buf);
+ return 1;
+ }
+ ped_exception_catch();
+ ped_exception_leave_all();
+
+ if (src > dest)
+ {
+ for (i=0;i<num;i++)
+ if (!ext2_copy_block(fs, src+i, dest+i))
+ return 0;
+ }
+ else
+ {
+ for (i=num;i>0;i--)
+ if (!ext2_copy_block(fs, src+i, dest+i))
+ return 0;
+ }
+ return 1;
+}
+
+int ext2_read_blocks(struct ext2_fs *fs, void *ptr, blk_t block, blk_t num)
+{
+ return fs->devhandle->ops->read(fs->devhandle->cookie, ptr, block, num);
+}
+
+int ext2_set_block_state(struct ext2_fs *fs, blk_t block, int state, int updatemetadata)
+{
+ struct ext2_buffer_head *bh;
+ int group;
+ int offset;
+
+ block -= EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb);
+ group = block / EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb);
+ offset = block % EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb);
+
+ bh = ext2_bread(fs, EXT2_GROUP_BLOCK_BITMAP(fs->gd[group]));
+ bh->dirty = 1;
+ if (state)
+ bh->data[offset>>3] |= _bitmap[offset&7];
+ else
+ bh->data[offset>>3] &= ~_bitmap[offset&7];
+ ext2_brelse(bh, 0);
+
+ if (updatemetadata)
+ {
+ int diff;
+
+ diff = state ? -1 : 1;
+
+ fs->gd[group].bg_free_blocks_count = PED_CPU_TO_LE16
+ (EXT2_GROUP_FREE_BLOCKS_COUNT(fs->gd[group]) + diff);
+ fs->sb.s_free_blocks_count = PED_CPU_TO_LE32
+ (EXT2_SUPER_FREE_BLOCKS_COUNT(fs->sb) + diff);
+ fs->metadirty |= EXT2_META_SB | EXT2_META_GD;
+ }
+ return 1;
+}
+
+int ext2_write_blocks(struct ext2_fs *fs, void *ptr, blk_t block, blk_t num)
+{
+ return fs->devhandle->ops->write(fs->devhandle->cookie, ptr, block, num);
+}
+
+int ext2_zero_blocks(struct ext2_fs *fs, blk_t block, blk_t num)
+{
+ unsigned char *buf;
+ blk_t i;
+
+ ped_exception_fetch_all();
+ buf = ped_malloc (num << fs->logsize);
+ if (buf)
+ {
+ ped_exception_leave_all();
+
+ memset(buf, 0, num << fs->logsize);
+ if (!ext2_bcache_flush_range(fs, block, num))
+ goto error_free_buf;
+ if (!ext2_write_blocks(fs, buf, block, num))
+ goto error_free_buf;
+ ped_free(buf);
+ return 1;
+ }
+ ped_exception_catch();
+
+ buf = ped_malloc (fs->blocksize);
+ if (buf)
+ {
+ ped_exception_leave_all();
+
+ memset(buf, 0, fs->blocksize);
+
+ for (i=0;i<num;i++)
+ {
+ if (!ext2_bcache_flush(fs, block+i))
+ goto error_free_buf;
+ if (!ext2_write_blocks(fs, buf, block+i, 1))
+ goto error_free_buf;
+ }
+
+ ped_free(buf);
+ return 1;
+ }
+ ped_exception_catch();
+ ped_exception_leave_all();
+
+ for (i=0;i<num;i++)
+ {
+ struct ext2_buffer_head *bh;
+
+ bh = ext2_bcreate(fs, block+i);
+ if (!bh)
+ goto error;
+ bh->dirty = 1;
+ if (!ext2_brelse(bh, 1))
+ goto error;
+ }
+ return 1;
+
+error_free_buf:
+ ped_free(buf);
+error:
+ return 0;
+}
+
+off_t ext2_get_inode_offset(struct ext2_fs *fs, ino_t inode, blk_t *block)
+{
+ int group;
+ int offset;
+
+ inode--;
+
+ group = inode / EXT2_SUPER_INODES_PER_GROUP(fs->sb);
+ offset = (inode % EXT2_SUPER_INODES_PER_GROUP(fs->sb))
+ * sizeof(struct ext2_inode);
+
+ *block = EXT2_GROUP_INODE_TABLE(fs->gd[group])
+ + (offset >> fs->logsize);
+
+ return offset & (fs->blocksize - 1);
+}
+
+int ext2_get_inode_state(struct ext2_fs *fs, ino_t inode)
+{
+ struct ext2_buffer_head *bh;
+ int group;
+ int offset;
+ int ret;
+
+ inode--;
+ group = inode / EXT2_SUPER_INODES_PER_GROUP(fs->sb);
+ offset = inode % EXT2_SUPER_INODES_PER_GROUP(fs->sb);
+
+ bh = ext2_bread(fs, EXT2_GROUP_INODE_BITMAP(fs->gd[group]));
+ ret = bh->data[offset>>3] & _bitmap[offset&7];
+ ext2_brelse(bh, 0);
+
+ return ret;
+}
+
+int ext2_read_inode(struct ext2_fs *fs, ino_t inode, struct ext2_inode *data)
+{
+ struct ext2_buffer_head *bh;
+ blk_t blk;
+ off_t off;
+
+ off = ext2_get_inode_offset(fs, inode, &blk);
+
+ bh = ext2_bread(fs, blk);
+ if (!bh)
+ return 0;
+
+ memcpy(data, bh->data + off, sizeof(struct ext2_inode));
+ ext2_brelse(bh, 0);
+ return 1;
+}
+
+int ext2_set_inode_state(struct ext2_fs *fs, ino_t inode, int state, int updatemetadata)
+{
+ struct ext2_buffer_head *bh;
+ int group;
+ int offset;
+
+ inode--;
+ group = inode / EXT2_SUPER_INODES_PER_GROUP(fs->sb);
+ offset = inode % EXT2_SUPER_INODES_PER_GROUP(fs->sb);
+
+ bh = ext2_bread(fs, EXT2_GROUP_INODE_BITMAP(fs->gd[group]));
+ if (!bh)
+ return 0;
+ bh->dirty = 1;
+ if (state)
+ bh->data[offset>>3] |= _bitmap[offset&7];
+ else
+ bh->data[offset>>3] &= ~_bitmap[offset&7];
+ ext2_brelse(bh, 0);
+
+ if (updatemetadata)
+ {
+ int diff;
+
+ diff = state ? -1 : 1;
+
+ fs->gd[group].bg_free_inodes_count = PED_CPU_TO_LE16
+ (EXT2_GROUP_FREE_INODES_COUNT(fs->gd[group]) + diff);
+ fs->sb.s_free_inodes_count = PED_CPU_TO_LE32
+ (EXT2_SUPER_FREE_INODES_COUNT(fs->sb) + diff);
+ fs->metadirty = EXT2_META_SB | EXT2_META_GD;
+ }
+ return 1;
+}
+
+static void
+_inode_update_size(struct ext2_fs *fs, struct ext2_inode *inode, int delta)
+{
+ int i512perblock = 1 << (fs->logsize - 9);
+ uint64_t size;
+
+ /* i_blocks is in 512 byte blocks */
+ inode->i_blocks = PED_CPU_TO_LE32(EXT2_INODE_BLOCKS(*inode)
+ + delta * i512perblock);
+ size = EXT2_INODE_SIZE(*inode) + delta * fs->blocksize;
+ inode->i_size = PED_CPU_TO_LE32(size % (1LL << 32));
+ inode->i_size_high = PED_CPU_TO_LE32(size / (1LL << 32));
+ inode->i_mtime = PED_CPU_TO_LE32(time(NULL));
+}
+
+int ext2_do_inode(struct ext2_fs *fs, struct ext2_inode *inode, blk_t block,
+ int action)
+{
+ struct ext2_buffer_head *bh;
+ uint32_t *udata;
+ blk_t count = 0;
+ int i;
+ int u32perblock = fs->blocksize >> 2;
+ int i512perblock = 1 << (fs->logsize - 9);
+
+ if (block == 0 || EXT2_INODE_MODE(*inode) == 0)
+ return -1;
+
+ if (fs->opt_debug)
+ switch (action)
+ {
+ case EXT2_ACTION_ADD:
+ fprintf(stderr,"adding 0x%04x to inode\n",
+ block);
+ break;
+ case EXT2_ACTION_DELETE:
+ fprintf(stderr,"deleting 0x%04x from inode\n",
+ block);
+ break;
+ case EXT2_ACTION_FIND:
+ fprintf(stderr,"finding 0x%04x in inode\n",
+ block);
+ break;
+ }
+
+ /* Direct blocks for first 12 blocks */
+ for (i = 0; i < EXT2_NDIR_BLOCKS; i++)
+ {
+ if (action == EXT2_ACTION_ADD && !EXT2_INODE_BLOCK(*inode, i))
+ {
+ inode->i_block[i] = PED_CPU_TO_LE32(block);
+ _inode_update_size (fs, inode, 1);
+ ext2_set_block_state(fs, block, 1, 1);
+ return i;
+ }
+ if (EXT2_INODE_BLOCK(*inode, i) == block)
+ {
+ if (action == EXT2_ACTION_DELETE)
+ {
+ inode->i_block[i] = 0;
+ _inode_update_size (fs, inode, -1);
+ ext2_set_block_state(fs, block, 0, 1);
+ }
+ return i;
+ }
+ if (EXT2_INODE_BLOCK(*inode, i))
+ count += i512perblock;
+ }
+
+ count += EXT2_INODE_BLOCK(*inode, EXT2_IND_BLOCK) ? i512perblock : 0;
+ count += EXT2_INODE_BLOCK(*inode, EXT2_DIND_BLOCK) ? i512perblock : 0;
+ count += EXT2_INODE_BLOCK(*inode, EXT2_TIND_BLOCK) ? i512perblock : 0;
+
+ if (!EXT2_INODE_BLOCK(*inode, EXT2_IND_BLOCK) ||
+ (count >= EXT2_INODE_BLOCKS(*inode) && action != EXT2_ACTION_ADD))
+ return -1;
+
+ bh = ext2_bread(fs, EXT2_INODE_BLOCK(*inode, EXT2_IND_BLOCK));
+ udata = (uint32_t *)bh->data;
+
+ /* Indirect blocks for next 256/512/1024 blocks (for 1k/2k/4k blocks) */
+ for (i = 0; i < u32perblock; i++) {
+ if (action == EXT2_ACTION_ADD && !udata[i]) {
+ bh->dirty = 1;
+ udata[i] = PED_CPU_TO_LE32(block);
+ _inode_update_size (fs, inode, 1);
+ ext2_set_block_state(fs, block, 1, 1);
+ ext2_brelse(bh, 0);
+ return EXT2_NDIR_BLOCKS + i;
+ }
+ if (PED_LE32_TO_CPU(udata[i]) == block) {
+ if (action == EXT2_ACTION_DELETE) {
+ bh->dirty = 1;
+ udata[i] = 0;
+ _inode_update_size (fs, inode, -1);
+ ext2_set_block_state(fs, block, 0, 1);
+ }
+ ext2_brelse(bh, 0);
+ return EXT2_NDIR_BLOCKS + i;
+ }
+ if (udata[i])
+ {
+ count += i512perblock;
+ if (count >= EXT2_INODE_BLOCKS(*inode) &&
+ action != EXT2_ACTION_ADD)
+ return -1;
+ }
+ }
+
+ ext2_brelse(bh, 0);
+
+ if (!EXT2_INODE_BLOCK(*inode, EXT2_DIND_BLOCK) ||
+ (count >= EXT2_INODE_BLOCKS(*inode) && action != EXT2_ACTION_ADD))
+ return -1;
+ bh = ext2_bread(fs, EXT2_INODE_BLOCK(*inode, EXT2_DIND_BLOCK));
+ udata = (uint32_t *)bh->data;
+
+ /* Double indirect blocks for next 2^16/2^18/2^20 1k/2k/4k blocks */
+ for (i = 0; i < u32perblock; i++) {
+ struct ext2_buffer_head *bh2;
+ uint32_t *udata2;
+ int j;
+
+ if (!udata[i]) {
+ ext2_brelse(bh, 0);
+ return -1;
+ }
+ bh2 = ext2_bread(fs, PED_LE32_TO_CPU(udata[i]));
+ udata2 = (uint32_t *)bh2->data;
+ count += i512perblock;
+
+ for (j = 0; j < u32perblock; j++) {
+ if (action == EXT2_ACTION_ADD && !udata2[j]) {
+ bh2->dirty = 1;
+ udata2[j] = PED_CPU_TO_LE32(block);
+ _inode_update_size (fs, inode, 1);
+ ext2_set_block_state(fs, block, 1, 1);
+ ext2_brelse(bh, 0);
+ ext2_brelse(bh2, 0);
+ return EXT2_NDIR_BLOCKS + i * u32perblock + j;
+ }
+ if (PED_LE32_TO_CPU(udata2[j]) == block) {
+ if (action == EXT2_ACTION_DELETE) {
+ bh2->dirty = 1;
+ udata2[j] = 0;
+ _inode_update_size (fs, inode, -1);
+ ext2_set_block_state(fs, block, 0, 1);
+ }
+ ext2_brelse(bh, 0);
+ ext2_brelse(bh2, 0);
+ return EXT2_NDIR_BLOCKS + i * u32perblock + j;
+ }
+ if (udata2[j])
+ {
+ count += i512perblock;
+ if (count >= EXT2_INODE_BLOCKS(*inode) &&
+ action != EXT2_ACTION_ADD)
+ return -1;
+ }
+ }
+ ext2_brelse(bh2, 0);
+ }
+ ext2_brelse(bh, 0);
+
+ /* FIXME: we should check for triple-indirect blocks here, but it
+ * would be nice to have a better routine to traverse blocks, and
+ * file systems that need triple-indirect blocks for the resize
+ * inode are too big to worry about yet.
+ */
+
+ return -1;
+}
+
+int ext2_write_inode(struct ext2_fs *fs, ino_t inode, const struct ext2_inode *data)
+{
+ struct ext2_buffer_head *bh;
+ blk_t blk;
+ off_t off;
+
+ off = ext2_get_inode_offset(fs, inode, &blk);
+
+ bh = ext2_bread(fs, blk);
+ if (!bh)
+ return 0;
+ bh->dirty = 1;
+ memcpy(bh->data + off, data, sizeof(struct ext2_inode));
+ ext2_brelse(bh, 0);
+
+ return 1;
+}
+
+int ext2_zero_inode(struct ext2_fs *fs, ino_t inode)
+{
+ struct ext2_inode buf;
+
+ memset(&buf, 0, sizeof(struct ext2_inode));
+ return ext2_write_inode(fs, inode, &buf);
+}
+
+
+
+
+
+/* check whether y is root of x
+ * (formula grabbed from linux ext2 kernel source) */
+static int is_root(int x, int y)
+{
+ if (!x)
+ return 1;
+
+ while (1)
+ {
+ if (x == 1)
+ return 1;
+
+ if (x % y)
+ return 0;
+
+ x /= y;
+ }
+}
+
+/* check whether group contains a superblock copy on file systems
+ * where not all groups have one (sparse superblock feature) */
+int ext2_is_group_sparse(struct ext2_fs *fs, int group)
+{
+ if (!fs->sparse)
+ return 1;
+
+ if (is_root(group, 3) || is_root(group, 5) || is_root(group, 7))
+ return 1;
+
+ return 0;
+}
+
+void ext2_close(struct ext2_fs *fs)
+{
+ ext2_commit_metadata(fs, EXT2_META_PRIMARY | EXT2_META_BACKUP);
+ ext2_sync(fs);
+
+ ext2_bcache_deinit(fs);
+
+ fs->devhandle->ops->close(fs->devhandle->cookie);
+
+ ped_free(fs->gd);
+ ped_free(fs);
+}
+
+int ext2_commit_metadata(struct ext2_fs *fs, int copies)
+{
+ int i;
+ int num;
+ int wmeta = fs->metadirty & copies;
+ unsigned char* sb = ped_malloc(fs->blocksize);
+ struct ext2_super_block *sb_for_io;
+ int sb_block;
+
+ /* See if there is even anything to write... */
+ if (wmeta == EXT2_META_CLEAN)
+ return 1;
+
+ fs->sb.s_r_blocks_count = PED_CPU_TO_LE32 (
+ fs->r_frac * (loff_t)EXT2_SUPER_BLOCKS_COUNT(fs->sb)
+ / 100);
+
+ if (!ext2_read_blocks (fs, sb, 0, 1))
+ return 0;
+
+ if (EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb)) {
+ memcpy(sb, &fs->sb, 1024);
+ sb_for_io = (struct ext2_super_block *) sb;
+ } else {
+ memcpy(sb+1024, &fs->sb, 1024);
+ sb_for_io = (struct ext2_super_block *) (sb + 1024);
+ }
+
+ num = copies & EXT2_META_BACKUP ? fs->numgroups : 1;
+
+ for (i = 0, sb_block = EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb); i < num;
+ i++, sb_block += EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb))
+ {
+
+ if (!ext2_is_group_sparse(fs, i))
+ continue;
+
+ if (fs->dynamic_version)
+ sb_for_io->s_block_group_nr = PED_CPU_TO_LE16 (i);
+
+ if ((i == 0 && wmeta & EXT2_META_PRIMARY_SB) ||
+ (i != 0 && wmeta & EXT2_META_SB))
+ {
+ if (!ext2_bcache_flush_range(fs, sb_block, 1))
+ return 0;
+ if (!ext2_write_blocks(fs, sb, sb_block, 1))
+ return 0;
+ }
+ if ((i == 0 && wmeta & EXT2_META_PRIMARY_GD) ||
+ (i != 0 && wmeta & EXT2_META_GD))
+ {
+ if (!ext2_bcache_flush_range(fs, sb_block + 1,
+ fs->gdblocks))
+ return 0;
+ if (!ext2_write_blocks(fs, fs->gd, sb_block + 1,
+ fs->gdblocks))
+ return 0;
+ }
+ }
+
+ sb_for_io->s_block_group_nr = 0;
+
+ /* Clear the flags of the components we just finished writing. */
+ fs->metadirty &= ~copies;
+
+ return 1;
+}
+
+int ext2_sync(struct ext2_fs *fs)
+{
+ if (!ext2_commit_metadata(fs, EXT2_META_PRIMARY)) return 0;
+ if (!ext2_bcache_sync(fs)) return 0;
+ if (!fs->devhandle->ops->sync(fs->devhandle->cookie)) return 0;
+ return 1;
+}
+
+struct ext2_fs *ext2_open(struct ext2_dev_handle *handle, int state)
+{
+ struct ext2_fs *fs;
+
+ if ((fs = (struct ext2_fs *) ped_malloc(sizeof(struct ext2_fs)))
+ == NULL)
+ goto error;
+
+ handle->ops->set_blocksize(handle->cookie, 10);
+
+ if (!handle->ops->read(handle->cookie, &fs->sb, 1, 1)
+ || EXT2_SUPER_MAGIC(fs->sb) != EXT2_SUPER_MAGIC_CONST)
+ {
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("Invalid superblock. Are you sure this is an ext2 "
+ "file system?"));
+ goto error_free_fs;
+ }
+
+
+ fs->opt_debug = 1;
+ fs->opt_safe = 1;
+ fs->opt_verbose = 0;
+
+ if (EXT2_SUPER_STATE(fs->sb) & EXT2_ERROR_FS & ~(state & EXT2_ERROR_FS))
+ {
+ if (ped_exception_throw (
+ PED_EXCEPTION_WARNING, PED_EXCEPTION_IGNORE_CANCEL,
+ _("File system has errors! You should run e2fsck."))
+ == PED_EXCEPTION_CANCEL)
+ goto error_free_fs;
+ }
+
+ if (!((EXT2_SUPER_STATE(fs->sb) | state) & EXT2_VALID_FS)
+ || (EXT2_SUPER_FEATURE_INCOMPAT(fs->sb)
+ & EXT3_FEATURE_INCOMPAT_RECOVER))
+ {
+ if (ped_exception_throw (
+ PED_EXCEPTION_ERROR, PED_EXCEPTION_IGNORE_CANCEL,
+ _("File system was not cleanly unmounted! "
+ "You should run e2fsck. Modifying an unclean "
+ "file system could cause severe corruption."))
+ != PED_EXCEPTION_IGNORE)
+ goto error_free_fs;
+ }
+
+ fs->dynamic_version = EXT2_SUPER_REV_LEVEL (fs->sb) > 0;
+
+ if ((EXT2_SUPER_FEATURE_COMPAT(fs->sb)
+ & ~(EXT3_FEATURE_COMPAT_HAS_JOURNAL |
+ EXT2_FEATURE_COMPAT_HAS_DIR_INDEX)) ||
+ (EXT2_SUPER_FEATURE_INCOMPAT(fs->sb)
+ & ~(EXT2_FEATURE_INCOMPAT_FILETYPE |
+ EXT3_FEATURE_INCOMPAT_RECOVER)) ||
+ (EXT2_SUPER_FEATURE_RO_COMPAT(fs->sb)
+ & ~(EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER |
+ EXT2_FEATURE_RO_COMPAT_LARGE_FILE)))
+ {
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("File system has an incompatible feature enabled."));
+ goto error_free_fs;
+ }
+
+ fs->devhandle = handle;
+ fs->logsize = EXT2_SUPER_LOG_BLOCK_SIZE(fs->sb) + 10;
+ handle->ops->set_blocksize(handle->cookie, fs->logsize);
+
+ if (!ext2_bcache_init(fs))
+ {
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("Error allocating buffer cache."));
+ goto error_free_fs;
+ }
+
+ fs->blocksize = 1 << fs->logsize;
+
+ fs->numgroups = ped_div_round_up (EXT2_SUPER_BLOCKS_COUNT(fs->sb)
+ - EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb),
+ EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb));
+ fs->gdblocks = ped_div_round_up (fs->numgroups
+ * sizeof(struct ext2_group_desc),
+ fs->blocksize);
+ fs->inodeblocks = ped_div_round_up (EXT2_SUPER_INODES_PER_GROUP(fs->sb)
+ * sizeof(struct ext2_inode),
+ fs->blocksize);
+ fs->r_frac = ped_div_round_up (100 * (loff_t)EXT2_SUPER_R_BLOCKS_COUNT(fs->sb),
+ EXT2_SUPER_BLOCKS_COUNT(fs->sb));
+ fs->adminblocks = 3 + fs->gdblocks + fs->inodeblocks;
+
+ fs->sparse = 0;
+ if (EXT2_SUPER_FEATURE_RO_COMPAT(fs->sb)
+ & EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER)
+ fs->sparse = 1;
+
+ fs->has_journal = 0 < (EXT2_SUPER_FEATURE_COMPAT(fs->sb)
+ & EXT3_FEATURE_COMPAT_HAS_JOURNAL);
+ fs->has_internal_journal
+ = fs->has_journal
+ && uuid_is_null(EXT2_SUPER_JOURNAL_UUID(fs->sb))
+ && EXT2_SUPER_JOURNAL_INUM(fs->sb);
+
+ fs->gd = ped_malloc (fs->numgroups * sizeof (struct ext2_group_desc)
+ + fs->blocksize);
+ if (!fs->gd)
+ goto error_deinit_bcache;
+
+ ext2_read_blocks(fs, fs->gd, EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb) + 1,
+ fs->gdblocks);
+
+ fs->metadirty = 0;
+ return fs;
+
+error_free_gd:
+ ped_free(fs->gd);
+error_deinit_bcache:
+ ext2_bcache_deinit(fs);
+error_free_fs:
+ ped_free(fs);
+error:
+ return NULL;
+}
+
+#endif /* !DISCOVER_ONLY */
diff --git a/libparted/fs/ext2/ext2.h b/libparted/fs/ext2/ext2.h
new file mode 100644
index 0000000..5ff152f
--- /dev/null
+++ b/libparted/fs/ext2/ext2.h
@@ -0,0 +1,247 @@
+/*
+ ext2.h -- ext2 header
+ Copyright (C) 1998-2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _EXT2_H
+#define _EXT2_H
+
+#include "config.h"
+
+#include <parted/parted.h>
+#include <parted/debug.h>
+#include <sys/types.h>
+#include "tune.h"
+
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+
+/* Ehrm.... sorry, pedanticists! :-) */
+#ifndef offsetof
+# define offsetof(type, field) ((size_t)(&(((type *)0)->field)))
+#endif
+
+#ifdef __BEOS__
+ typedef off_t loff_t;
+#endif
+
+typedef u_int32_t blk_t;
+
+#ifdef HAVE_LINUX_EXT2_FS_H
+#define _LINUX_TYPES_H
+#define i_version i_generation
+#include <linux/ext2_fs.h>
+#else
+#include "ext2_fs.h"
+#endif
+
+extern unsigned char _bitmap[8];
+
+struct ext2_buffer_cache
+{
+ struct ext2_buffer_head *cache;
+ struct ext2_buffer_head *heads;
+ struct ext2_buffer_head **hash;
+ struct ext2_fs *fs;
+
+ int size;
+ int numalloc;
+ unsigned char *buffermem;
+};
+
+struct ext2_buffer_head
+{
+ struct ext2_buffer_head *next;
+ struct ext2_buffer_head *prev;
+ unsigned char *data;
+ blk_t block;
+
+ int usecount;
+ int dirty;
+
+ struct ext2_buffer_cache *bc;
+ int alloc;
+};
+
+struct ext2_dev_ops
+{
+ int (*close)(void *cookie);
+ blk_t (*get_size)(void *cookie);
+ int (*read)(void *cookie, void *ptr, blk_t block, blk_t num);
+ int (*set_blocksize)(void *cookie, int logsize);
+ int (*sync)(void *cookie);
+ int (*write)(void *cookie, void *ptr, blk_t block, blk_t num);
+};
+
+struct ext2_dev_handle
+{
+ struct ext2_dev_ops *ops;
+ void *cookie;
+};
+
+struct ext2_fs
+{
+ struct ext2_dev_handle *devhandle;
+
+ struct ext2_super_block sb;
+ struct ext2_group_desc *gd;
+ struct ext2_buffer_cache *bc;
+ int metadirty; /* 0:all sb&gd copies clean
+ 1:all sb&gd copies dirty
+ 2:only first sb&gd copy clean */
+
+ int dynamic_version;
+ int sparse; /* sparse superblocks */
+ int has_journal; /* journal */
+ int has_internal_journal;
+
+ int blocksize;
+ int logsize;
+ blk_t adminblocks;
+ blk_t gdblocks;
+ blk_t itoffset;
+ blk_t inodeblocks;
+ int numgroups;
+ int r_frac; /* reserved % of blocks */
+
+ unsigned char *relocator_pool;
+ unsigned char *relocator_pool_end;
+
+ int opt_debug;
+ int opt_safe;
+ int opt_verbose;
+
+ void *journal;
+};
+
+
+#define EXT2_ACTION_ADD 1
+#define EXT2_ACTION_DELETE 2
+#define EXT2_ACTION_FIND 3
+
+#define EXT2_META_CLEAN 0
+#define EXT2_META_PRIMARY_SB 1
+#define EXT2_META_BACKUP_SB 2
+#define EXT2_META_PRIMARY_GD 4
+#define EXT2_META_BACKUP_GD 8
+
+#define EXT2_META_PRIMARY (EXT2_META_PRIMARY_SB | EXT2_META_PRIMARY_GD)
+#define EXT2_META_BACKUP (EXT2_META_BACKUP_SB | EXT2_META_BACKUP_GD)
+#define EXT2_META_SB (EXT2_META_PRIMARY_SB | EXT2_META_BACKUP_SB)
+#define EXT2_META_GD (EXT2_META_PRIMARY_GD | EXT2_META_BACKUP_GD)
+
+/* generic stuff */
+int ext2_copy_block (struct ext2_fs *fs, blk_t from, blk_t to);
+void ext2_close (struct ext2_fs *fs);
+int ext2_commit_metadata (struct ext2_fs *fs, int copies);
+off_t ext2_get_inode_offset (struct ext2_fs *fs, ino_t inode, blk_t *block);
+blk_t ext2_find_free_block (struct ext2_fs *fs);
+ino_t ext2_find_free_inode (struct ext2_fs *fs);
+int ext2_get_inode_state (struct ext2_fs *fs, ino_t inode);
+int ext2_is_group_sparse (struct ext2_fs *fs, int group);
+int ext2_move_blocks (struct ext2_fs *fs, blk_t src, blk_t num, blk_t dest);
+struct ext2_fs *ext2_open (struct ext2_dev_handle *handle, int state);
+int ext2_read_blocks (struct ext2_fs *fs, void *ptr, blk_t block, blk_t numblocks);
+int ext2_read_inode (struct ext2_fs *fs, ino_t inode, struct ext2_inode *inodep);
+int ext2_set_inode_state (struct ext2_fs *fs, ino_t inode, int state, int updatemetadata);
+int ext2_do_inode (struct ext2_fs *fs, struct ext2_inode *inode, blk_t block, int action);
+int ext2_sync (struct ext2_fs *fs);
+int ext2_write_blocks (struct ext2_fs *fs, void *ptr, blk_t block, blk_t numblocks);
+int ext2_write_inode (struct ext2_fs *fs, ino_t inode, const struct ext2_inode *inodep);
+int ext2_zero_blocks (struct ext2_fs *fs, blk_t block, blk_t num);
+int ext2_zero_inode (struct ext2_fs *fs, ino_t inode);
+
+/* block related */
+void ext2_bgbitmap_cache_deinit (struct ext2_fs *fs);
+int ext2_bgbitmap_cache_flush (struct ext2_fs *fs);
+int ext2_bgbitmap_cache_init (struct ext2_fs *fs);
+int ext2_get_block_state (struct ext2_fs *, blk_t block);
+int ext2_set_block_state (struct ext2_fs *, blk_t block, int state, int updatemetadata);
+
+/* block relocator */
+int ext2_block_relocate (struct ext2_fs *fs, blk_t newsize);
+
+/* buffer */
+void ext2_bcache_deinit (struct ext2_fs *fs);
+void ext2_bcache_dump (struct ext2_fs *fs);
+int ext2_bcache_flush (struct ext2_fs *fs, blk_t block);
+int ext2_bcache_flush_range (struct ext2_fs *fs, blk_t first, blk_t last);
+int ext2_bcache_init (struct ext2_fs *fs);
+int ext2_bcache_sync (struct ext2_fs *fs);
+struct ext2_buffer_head *ext2_bcreate (struct ext2_fs *fs, blk_t block);
+struct ext2_buffer_head *ext2_bread (struct ext2_fs *fs, blk_t block);
+int ext2_brelse (struct ext2_buffer_head *bh, int forget);
+
+/* inode relocator */
+int ext2_inode_relocate (struct ext2_fs *fs, int newgroups);
+
+/* journalling */
+void ext2_journal_deinit (struct ext2_fs *fs);
+int ext2_journal_init (struct ext2_fs *fs);
+
+/* metadata mover */
+int ext2_metadata_push (struct ext2_fs *fs, blk_t newsize);
+
+/* fs creation */
+struct ext2_fs *ext2_mkfs (struct ext2_dev_handle *handle, blk_t numblocks, int log_block_size, blk_t blocks_per_group, int inodes_per_group, int sparse_sb, int reserved_block_percentage, PedTimer* timer);
+
+/* resize */
+int ext2_resize_fs (struct ext2_fs *fs, blk_t newsize, PedTimer* timer);
+
+/* unix I/O */
+struct ext2_dev_handle *ext2_make_dev_handle_from_file(char *dev);
+
+
+
+
+static __inline__ int ext2_is_data_block(struct ext2_fs *fs, blk_t block)
+{
+ blk_t blk;
+ int group;
+
+ PED_ASSERT (block >= EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb), return 0);
+ PED_ASSERT (block < EXT2_SUPER_BLOCKS_COUNT(fs->sb), return 0);
+
+ blk = block - EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb);
+
+ group = blk / EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb);
+ blk %= EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb);
+
+ if (ext2_is_group_sparse(fs, group) && blk <= fs->gdblocks)
+ return 0;
+
+ if (block == EXT2_GROUP_BLOCK_BITMAP(fs->gd[group]) ||
+ block == EXT2_GROUP_INODE_BITMAP(fs->gd[group]))
+ return 0;
+
+ if (block >= EXT2_GROUP_INODE_TABLE(fs->gd[group]) &&
+ block < EXT2_GROUP_INODE_TABLE(fs->gd[group]) + fs->inodeblocks)
+ return 0;
+
+ return 1;
+}
+
+#endif
diff --git a/libparted/fs/ext2/ext2_block_relocator.c b/libparted/fs/ext2/ext2_block_relocator.c
new file mode 100644
index 0000000..48c6e8b
--- /dev/null
+++ b/libparted/fs/ext2/ext2_block_relocator.c
@@ -0,0 +1,925 @@
+/*
+ ext2_block_relocator.c -- ext2 block relocator
+ Copyright (C) 1998-2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+
+#ifndef DISCOVER_ONLY
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "ext2.h"
+
+
+/* This struct describes a single block that will be relocated. The
+ * block's original location is "num", and its new location is "dest".
+ * The block is presumebly referred to by some other block in the file
+ * system, which is recorded as "refblock". (Only one reference to
+ * the block is allowed by the block relocator.) "refoffset" describes
+ * the location within the refblock in which the block is referenced.
+ * "isindirect" is 0 for direct, 1 for single-indirect, 2 for
+ * double-indirect, etc.
+ *
+ * The algorithms in the file fill the entries of this struct in this order:
+ * num, refblock/refoffset/isindirectblock, dest.
+ */
+struct ext2_block_entry
+{
+ blk_t num;
+ blk_t dest;
+ blk_t refblock;
+ unsigned refoffset:16;
+ unsigned isindirectblock:16;
+};
+
+/* This struct contains all data structures relevant to the block relocator.
+ * - newallocoffset is the distance between the start of a block group,
+ * and the first data block in the group. This can change when a
+ * filesystem is resized, because the size of the group descriptors is
+ * proportional to the size of the filesystem.
+ *
+ * - allocentries is the size of the "block" array. It is a tuneable
+ * parameter that determines how many blocks can be moved in each
+ * pass.
+ *
+ * - usedentries says how many entries of the "block" array have been
+ * used. That is, how many blocks have been scheduled so far to
+ * be moved.
+ *
+ * - resolvedentries is the number of blocks whose referencing block
+ * has been found and recorded in block[.]->refblock, etc.
+ *
+ * - block is an array that records which blocks need to be moved, and
+ * where they will be moved to, etc. At some point in the algorithm, this
+ * array gets sorted (grep for qsort!) by indirectness.
+ *
+ * - start: each entry in this array corresponds to a level of
+ * indirectness (0-3). Each level has two items: dst and num. "num"
+ * is the number of blocks inside "block" of that level of indirectness.
+ * After doscan() is finished, and the level of indirectness of each
+ * block is known, "block" is sorted (see above). The "dst" pointer
+ * is a pointer inside "block" that indicates the start of the portion
+ * of the array containg blocks of that level of indirectness.
+ */
+struct ext2_block_relocator_state
+{
+ blk_t newallocoffset;
+ blk_t allocentries;
+ blk_t usedentries;
+ blk_t resolvedentries;
+ struct ext2_block_entry *block;
+
+ struct {
+ struct ext2_block_entry *dst;
+ int num;
+ } start[4];
+};
+
+
+
+static int compare_block_entries(const void *x0, const void *x1)
+{
+ const struct ext2_block_entry *b0;
+ const struct ext2_block_entry *b1;
+
+ b0 = (const struct ext2_block_entry *)x0;
+ b1 = (const struct ext2_block_entry *)x1;
+
+ if (b0->num < b1->num)
+ return -1;
+
+ if (b0->num > b1->num)
+ return 1;
+
+ return 0;
+}
+
+static int compare_block_entries_ind(const void *x0, const void *x1)
+{
+ const struct ext2_block_entry *b0;
+ const struct ext2_block_entry *b1;
+
+ b0 = (const struct ext2_block_entry *)x0;
+ b1 = (const struct ext2_block_entry *)x1;
+
+ if (b0->isindirectblock > b1->isindirectblock)
+ return -1;
+
+ if (b0->isindirectblock < b1->isindirectblock)
+ return 1;
+
+ return 0;
+}
+
+static int compare_block_entries_ref(const void *x0, const void *x1)
+{
+ const struct ext2_block_entry *b0;
+ const struct ext2_block_entry *b1;
+
+ b0 = (const struct ext2_block_entry *)x0;
+ b1 = (const struct ext2_block_entry *)x1;
+
+ if (b0->refblock < b1->refblock)
+ return -1;
+
+ if (b0->refblock > b1->refblock)
+ return 1;
+
+ return 0;
+}
+
+struct ext2_block_entry *findit(struct ext2_block_relocator_state *state, blk_t block)
+{
+ int min;
+ int max;
+ struct ext2_block_entry *retv;
+ int t;
+ blk_t tval;
+
+ max = state->usedentries - 1;
+ min = 0;
+ retv = NULL;
+
+ repeat:
+ if (min > max)
+ goto out;
+
+ t = (min + max) >> 1;
+ tval = state->block[t].num;
+
+ if (tval > block)
+ max = t - 1;
+
+ if (tval < block)
+ min = t + 1;
+
+ if (tval != block)
+ goto repeat;
+
+ retv = &state->block[t];
+
+ out:
+ return retv;
+}
+
+/* This function adds records a reference to a block ("blk"), if that
+ * block is scheduled to be moved.
+ */
+static int doblock(struct ext2_fs *fs,
+ struct ext2_block_relocator_state *state,
+ blk_t blk,
+ blk_t refblock,
+ off_t refoffset,
+ int indirect)
+{
+ struct ext2_block_entry *ent;
+
+ if ((ent = findit(state, blk)) == NULL)
+ return 1;
+
+ if (ent->refblock)
+ {
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("Cross-linked blocks found! Better go run e2fsck "
+ "first!"));
+ return 0;
+ }
+
+ ent->refblock = refblock;
+ ent->refoffset = refoffset;
+ ent->isindirectblock = indirect;
+
+ state->resolvedentries++;
+ state->start[indirect].num++;
+
+ return 1;
+}
+
+static int doindblock(struct ext2_fs *fs,
+ struct ext2_block_relocator_state *state,
+ blk_t blk,
+ blk_t refblock,
+ off_t refoffset)
+{
+ struct ext2_buffer_head *bh;
+ int i;
+ uint32_t *uptr;
+
+ if (!doblock(fs, state, blk, refblock, refoffset, 1))
+ return 0;
+
+ bh = ext2_bread(fs, blk);
+ if (!bh)
+ return 0;
+ uptr = (uint32_t *)bh->data;
+
+ for (i=0;i<(fs->blocksize >> 2);i++)
+ if (uptr[i])
+ if (!doblock(fs, state, PED_LE32_TO_CPU(uptr[i]), blk,
+ i<<2, 0))
+ return 0;
+
+ if (!ext2_brelse(bh, 0))
+ return 0;
+
+ return 1;
+}
+
+static int dodindblock(struct ext2_fs *fs,
+ struct ext2_block_relocator_state *state,
+ blk_t blk,
+ blk_t refblock,
+ off_t refoffset)
+{
+ struct ext2_buffer_head *bh;
+ int i;
+ uint32_t *uptr;
+
+ if (!doblock(fs, state, blk, refblock, refoffset, 2))
+ return 0;
+
+ bh = ext2_bread(fs, blk);
+ if (!bh)
+ return 0;
+ uptr = (uint32_t *)bh->data;
+
+ for (i=0;i<(fs->blocksize >> 2);i++)
+ if (uptr[i])
+ if (!doindblock(fs, state, PED_LE32_TO_CPU(uptr[i]),
+ blk, i<<2))
+ return 0;
+
+ if (!ext2_brelse(bh, 0))
+ return 0;
+
+ return 1;
+}
+
+static int dotindblock(struct ext2_fs *fs,
+ struct ext2_block_relocator_state *state,
+ blk_t blk,
+ blk_t refblock,
+ off_t refoffset)
+{
+ struct ext2_buffer_head *bh;
+ int i;
+ uint32_t *uptr;
+
+ if (!doblock(fs, state, blk, refblock, refoffset, 3))
+ return 0;
+
+ bh = ext2_bread(fs, blk);
+ if (!bh)
+ return 0;
+ uptr = (uint32_t *)bh->data;
+
+ for (i=0;i<(fs->blocksize >> 2);i++)
+ if (uptr[i])
+ if (!dodindblock(fs, state, PED_LE32_TO_CPU(uptr[i]),
+ blk, i<<2))
+ return 0;
+
+ if (!ext2_brelse(bh, 0))
+ return 0;
+
+ return 1;
+}
+
+
+/* This function records any block references from an inode to blocks that are
+ * scheduled to be moved.
+ */
+static int doinode(struct ext2_fs *fs, struct ext2_block_relocator_state *state, int inode)
+{
+ struct ext2_inode buf;
+
+ if (!ext2_read_inode(fs, inode, &buf))
+ return 0;
+
+ if (EXT2_INODE_BLOCKS(buf))
+ {
+ blk_t blk;
+ int i;
+ off_t inodeoffset;
+ blk_t inodeblock;
+
+ inodeoffset = ext2_get_inode_offset(fs, inode, &inodeblock);
+
+ /* do Hurd block, if there is one... */
+ if (EXT2_SUPER_CREATOR_OS(fs->sb) == EXT2_OS_HURD
+ && EXT2_INODE_TRANSLATOR(buf)) {
+ if (!doblock(fs,
+ state,
+ EXT2_INODE_TRANSLATOR(buf),
+ inodeblock,
+ inodeoffset + offsetof(struct ext2_inode,
+ osd1.hurd1.h_i_translator),
+ 0))
+ return 0;
+ }
+
+ for (i=0;i<EXT2_NDIR_BLOCKS;i++)
+ if ((blk = EXT2_INODE_BLOCK(buf, i)) != 0)
+ if (!doblock(fs,
+ state,
+ blk,
+ inodeblock,
+ inodeoffset + offsetof(struct ext2_inode, i_block[i]),
+ 0))
+ return 0;
+
+ if ((blk = EXT2_INODE_BLOCK(buf, EXT2_IND_BLOCK)) != 0)
+ if (!doindblock(fs,
+ state,
+ blk,
+ inodeblock,
+ inodeoffset + offsetof(struct ext2_inode, i_block[EXT2_IND_BLOCK])))
+ return 0;
+
+ if ((blk = EXT2_INODE_BLOCK(buf, EXT2_DIND_BLOCK)) != 0)
+ if (!dodindblock(fs,
+ state,
+ blk,
+ inodeblock,
+ inodeoffset + offsetof(struct ext2_inode, i_block[EXT2_DIND_BLOCK])))
+ return 0;
+
+ if ((blk = EXT2_INODE_BLOCK(buf, EXT2_TIND_BLOCK)) != 0)
+ if (!dotindblock(fs,
+ state,
+ blk,
+ inodeblock,
+ inodeoffset + offsetof(struct ext2_inode, i_block[EXT2_TIND_BLOCK])))
+ return 0;
+
+ }
+
+ return 1;
+}
+
+/* This function scans the entire filesystem, to find all references to blocks
+ * that are scheduled to be moved.
+ */
+static int doscan(struct ext2_fs *fs, struct ext2_block_relocator_state *state)
+{
+ int i;
+
+ state->start[0].num = 0;
+ state->start[1].num = 0;
+ state->start[2].num = 0;
+ state->start[3].num = 0;
+
+ for (i=0;i<fs->numgroups;i++)
+ {
+ struct ext2_buffer_head *bh;
+ unsigned int j;
+ int offset;
+
+ if (fs->opt_verbose)
+ {
+ fprintf(stderr, " scanning group %i.... ", i);
+ fflush(stderr);
+ }
+
+ bh = ext2_bread(fs, EXT2_GROUP_INODE_BITMAP(fs->gd[i]));
+ if (!bh)
+ return 0;
+ offset = i * EXT2_SUPER_INODES_PER_GROUP(fs->sb) + 1;
+
+ for (j=0;j<EXT2_SUPER_INODES_PER_GROUP(fs->sb);j++)
+ if (bh->data[j>>3] & _bitmap[j&7])
+ {
+ if (!doinode(fs, state, offset + j))
+ {
+ ext2_brelse(bh, 0);
+ return 0;
+ }
+
+ if (state->resolvedentries == state->usedentries)
+ break;
+ }
+
+ ext2_brelse(bh, 0);
+
+ if (fs->opt_verbose)
+ {
+ fprintf(stderr, "%i/%i blocks resolved\r",
+ state->resolvedentries,
+ state->usedentries);
+ fflush(stderr);
+ }
+
+ if (state->resolvedentries == state->usedentries)
+ break;
+ }
+
+ if (fs->opt_verbose)
+ fprintf(stderr, "\n");
+
+ state->start[3].dst = state->block;
+ state->start[2].dst = state->start[3].dst + state->start[3].num;
+ state->start[1].dst = state->start[2].dst + state->start[2].num;
+ state->start[0].dst = state->start[1].dst + state->start[1].num;
+
+ return 1;
+}
+
+
+
+
+
+static int ext2_block_relocator_copy(struct ext2_fs *fs, struct ext2_block_relocator_state *state)
+{
+ unsigned char *buf;
+
+ ped_exception_fetch_all();
+ buf = (unsigned char *) ped_malloc(MAXCONT << fs->logsize);
+ if (buf)
+ {
+ int num;
+ int numleft;
+ struct ext2_block_entry *ptr;
+
+ ped_exception_leave_all();
+
+ numleft = state->usedentries;
+ ptr = state->block;
+ while (numleft)
+ {
+ num = PED_MIN(numleft, MAXCONT);
+ while (num != 1)
+ {
+ if (ptr[0].num + num-1 == ptr[num-1].num &&
+ ptr[0].dest + num-1 == ptr[num-1].dest)
+ break;
+
+ num >>= 1;
+ }
+
+ if (!ext2_bcache_flush_range(fs, ptr[0].num, num))
+ goto error_free_buf;
+ if (!ext2_bcache_flush_range(fs, ptr[0].dest, num))
+ goto error_free_buf;
+
+ if (!ext2_read_blocks(fs, buf, ptr[0].num, num))
+ goto error_free_buf;
+ if (!ext2_write_blocks(fs, buf, ptr[0].dest, num))
+ goto error_free_buf;
+
+ ptr += num;
+ numleft -= num;
+
+ if (fs->opt_verbose)
+ {
+ fprintf(stderr, "copied %i/%i blocks\r",
+ state->usedentries - numleft,
+ state->usedentries);
+ fflush(stderr);
+ }
+ }
+
+ ped_free(buf);
+
+ if (fs->opt_safe)
+ ext2_sync(fs);
+
+ if (fs->opt_verbose)
+ fprintf(stderr, "\n");
+ }
+ else
+ {
+ blk_t i;
+
+ ped_exception_catch();
+ ped_exception_leave_all();
+
+ for (i=0;i<state->usedentries;i++)
+ {
+ struct ext2_block_entry *block;
+
+ block = &state->block[i];
+ if (!ext2_copy_block(fs, block->num, block->dest))
+ goto error;
+ }
+ }
+
+ return 1;
+
+error_free_buf:
+ ped_free(buf);
+error:
+ return 0;
+}
+
+static int ext2_block_relocator_ref(struct ext2_fs *fs, struct ext2_block_relocator_state *state, struct ext2_block_entry *block)
+{
+ struct ext2_buffer_head *bh;
+ static int numerrors = 0;
+
+ if (!(block->refblock || block->refoffset))
+ {
+ ped_exception_throw (PED_EXCEPTION_BUG, PED_EXCEPTION_CANCEL,
+ _("Block %i has no reference? Weird."),
+ block->num);
+ return 0;
+ }
+
+ bh = ext2_bread(fs, block->refblock);
+ if (!bh)
+ return 0;
+
+ if (fs->opt_debug)
+ {
+ if (PED_LE32_TO_CPU(*((uint32_t *)(bh->data + block->refoffset)))
+ != block->num) {
+ fprintf(stderr,
+ "block %i ref error! (->%i {%i, %i})\n",
+ block->num,
+ block->dest,
+ block->refblock,
+ block->refoffset);
+ ext2_brelse(bh, 0);
+
+ if (numerrors++ < 4)
+ return 1;
+
+ fprintf(stderr, "all is not well!\n");
+ return 0;
+ }
+ }
+
+ *((uint32_t *)(bh->data + block->refoffset))
+ = PED_LE32_TO_CPU(block->dest);
+ bh->dirty = 1;
+ ext2_brelse(bh, 0);
+
+ ext2_set_block_state(fs, block->dest, 1, 1);
+ ext2_set_block_state(fs, block->num, 0, 1);
+
+ if (block->isindirectblock)
+ {
+ struct ext2_block_entry *dst;
+ int i;
+ int num;
+
+ dst = state->start[block->isindirectblock-1].dst;
+ num = state->start[block->isindirectblock-1].num;
+
+ for (i=0;i<num;i++)
+ if (dst[i].refblock == block->num)
+ dst[i].refblock = block->dest;
+ }
+
+ return 1;
+}
+
+/* This function allocates new locations for blocks that are scheduled to move
+ * (inside state->blocks).
+ *
+ * FIXME: doesn't seem to handle sparse block groups. That is, there might be
+ * some free space that could be exploited in resizing that currently isn't...
+ *
+ * FIXME: should throw an exception if it fails to allocate blocks.
+ */
+static int ext2_block_relocator_grab_blocks(struct ext2_fs *fs, struct ext2_block_relocator_state *state)
+{
+ int i;
+ blk_t ptr;
+
+ ptr = 0;
+
+ for (i=0;i<fs->numgroups;i++)
+ if (EXT2_GROUP_FREE_BLOCKS_COUNT(fs->gd[i]))
+ {
+ struct ext2_buffer_head *bh;
+ unsigned int j;
+ int offset;
+
+ bh = ext2_bread(fs, EXT2_GROUP_BLOCK_BITMAP(fs->gd[i]));
+ offset = i * EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb)
+ + EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb);
+
+ for (j=state->newallocoffset;
+ j<EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb);
+ j++)
+ if (!(bh->data[j>>3] & _bitmap[j&7]))
+ {
+ state->block[ptr++].dest = offset + j;
+
+ if (ptr == state->usedentries)
+ {
+ ext2_brelse(bh, 0);
+ return 1;
+ }
+ }
+
+ ext2_brelse(bh, 0);
+ }
+
+ return 0;
+}
+
+static int ext2_block_relocator_flush(struct ext2_fs *fs, struct ext2_block_relocator_state *state)
+{
+ int i;
+
+ if (!state->usedentries)
+ return 1;
+
+ if (fs->opt_verbose)
+ fprintf(stderr, "ext2_block_relocator_flush\n");
+
+ if (fs->opt_debug)
+ {
+ again:
+
+ for (i=0; (unsigned int) i < state->usedentries-1; i++)
+ if (state->block[i].num >= state->block[i+1].num)
+ {
+ fprintf(stderr,
+ "ext2_block_relocator_flush: "
+ "blocks not in order!\n");
+
+ qsort(state->block,
+ state->usedentries,
+ sizeof(struct ext2_block_entry),
+ compare_block_entries);
+ goto again;
+ }
+ }
+
+ if (!doscan(fs, state))
+ return 0;
+
+ if (!ext2_block_relocator_grab_blocks(fs, state))
+ return 0;
+
+ if (!ext2_block_relocator_copy(fs, state))
+ return 0;
+
+ qsort(state->block,
+ state->usedentries,
+ sizeof(struct ext2_block_entry),
+ compare_block_entries_ind);
+
+ for (i=3;i>=0;i--)
+ {
+ struct ext2_block_entry *dst;
+ int j;
+ int num;
+
+ dst = state->start[i].dst;
+ num = state->start[i].num;
+
+ if (!num)
+ continue;
+
+ if (fs->opt_verbose)
+ {
+ /* FIXXXME gross hack */
+ fprintf(stderr, "relocating %s blocks",
+ ((char *[4]){"direct",
+ "singly indirect",
+ "doubly indirect",
+ "triply indirect"})[i]);
+ fflush(stderr);
+ }
+
+ qsort(dst,
+ num,
+ sizeof(struct ext2_block_entry),
+ compare_block_entries_ref);
+
+ for (j=0;j<num;j++)
+ if (!ext2_block_relocator_ref(fs, state, &dst[j]))
+ return 0;
+
+ if (fs->opt_safe) {
+ if (!ext2_sync(fs))
+ return 0;
+ }
+
+ if (fs->opt_verbose)
+ fprintf(stderr, "\n");
+ }
+
+ state->usedentries = 0;
+ state->resolvedentries = 0;
+
+ return 1;
+}
+
+static int ext2_block_relocator_mark(struct ext2_fs *fs, struct ext2_block_relocator_state *state, blk_t block)
+{
+ int i;
+
+ if (fs->opt_debug)
+ {
+ if (!ext2_get_block_state(fs, block) ||
+ !ext2_is_data_block(fs, block))
+ {
+ ped_exception_throw (PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_IGNORE,
+ _("Block %i shouldn't have been marked "
+ "(%d, %d)!"), block,
+ ext2_get_block_state(fs, block),
+ ext2_is_data_block(fs, block));
+ }
+ }
+
+ if (state->usedentries == state->allocentries - 1)
+ if (!ext2_block_relocator_flush(fs, state))
+ return 0;
+
+ i = state->usedentries;
+ state->block[i].num = block;
+ state->block[i].dest = 0;
+ state->block[i].refblock = 0;
+ state->block[i].refoffset = 0;
+
+ state->usedentries++;
+ return 1;
+}
+
+static int ext2_block_relocate_grow(struct ext2_fs *fs, struct ext2_block_relocator_state *state, blk_t newsize)
+{
+ blk_t newgdblocks;
+ blk_t newitoffset;
+ int i;
+
+ newgdblocks = ped_div_round_up (newsize
+ - EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb),
+ EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb));
+ newgdblocks = ped_div_round_up (newgdblocks
+ * sizeof(struct ext2_group_desc),
+ fs->blocksize);
+ if (newgdblocks == fs->gdblocks)
+ return 1;
+
+ newitoffset = newgdblocks + 3;
+ state->newallocoffset = newitoffset + fs->inodeblocks;
+
+ for (i=0;i<fs->numgroups;i++)
+ {
+ struct ext2_buffer_head *bh;
+ blk_t diff;
+ blk_t j;
+ blk_t start;
+ int sparse;
+
+ bh = ext2_bread(fs, EXT2_GROUP_BLOCK_BITMAP(fs->gd[i]));
+ start = (i * EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb))
+ + EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb);
+ sparse = ext2_is_group_sparse(fs, i);
+
+ if (EXT2_GROUP_INODE_TABLE(fs->gd[i]) < start + newitoffset
+ || (sparse && ((EXT2_GROUP_BLOCK_BITMAP(fs->gd[i])
+ < start + newitoffset - 2)
+ || (EXT2_GROUP_INODE_BITMAP(fs->gd[i])
+ < start + newitoffset - 1))))
+ {
+ diff = newitoffset - (EXT2_GROUP_INODE_TABLE(fs->gd[i])
+ - start);
+
+ for (j=0;j<diff;j++)
+ {
+ blk_t k;
+
+ k = EXT2_GROUP_INODE_TABLE(fs->gd[i])
+ + fs->inodeblocks + j;
+ if (bh->data[k>>3] & _bitmap[k&7])
+ if (!ext2_block_relocator_mark(fs,
+ state, start + k))
+ {
+ ext2_brelse(bh, 0);
+ return 0;
+ }
+ }
+ }
+
+ ext2_brelse(bh, 0);
+ }
+
+ if (!ext2_block_relocator_flush(fs, state))
+ return 0;
+
+ return 1;
+}
+
+static int ext2_block_relocate_shrink(struct ext2_fs *fs, struct ext2_block_relocator_state *state, blk_t newsize)
+{
+ int diff;
+ int i;
+
+ diff = ped_div_round_up (newsize - EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb),
+ EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb));
+ diff = ped_div_round_up (diff * sizeof(struct ext2_group_desc),
+ fs->blocksize);
+ diff = fs->gdblocks - diff;
+
+ state->newallocoffset = fs->itoffset + fs->inodeblocks;
+
+ for (i=0;i<fs->numgroups;i++)
+ {
+ struct ext2_buffer_head *bh;
+ blk_t groupsize;
+ blk_t j;
+ blk_t offset;
+ int sparse;
+ blk_t start;
+ int type;
+
+ offset = i * EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb)
+ + EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb);
+ sparse = ext2_is_group_sparse(fs, i);
+
+ if (newsize >= offset + EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb))
+ continue; /* group will survive */
+
+ bh = ext2_bread(fs, EXT2_GROUP_BLOCK_BITMAP(fs->gd[i]));
+
+ if (newsize <= offset)
+ type = 2; /* group is fully chopped off */
+ else
+ type = 1; /* group is partly chopped off */
+
+ if (!sparse && type == 2)
+ {
+ for (j=EXT2_GROUP_INODE_BITMAP(fs->gd[i])+1;
+ j<EXT2_GROUP_INODE_TABLE(fs->gd[i]);
+ j++)
+ {
+ blk_t k;
+
+ k = j - offset;
+ if (bh->data[k>>3] & _bitmap[k&7])
+ if (!ext2_block_relocator_mark(fs, state, j))
+ {
+ ext2_brelse(bh, 0);
+ return 0;
+ }
+ }
+ }
+
+ start = newsize;
+ if (type == 2)
+ start = EXT2_GROUP_INODE_TABLE(fs->gd[i])
+ + fs->inodeblocks;
+
+ start -= offset;
+
+ groupsize = EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb);
+ if (offset + groupsize > EXT2_SUPER_BLOCKS_COUNT(fs->sb))
+ groupsize = EXT2_SUPER_BLOCKS_COUNT(fs->sb) - offset;
+
+ for (j=start;j<groupsize;j++)
+ if (bh->data[j>>3] & _bitmap[j&7])
+ if (!ext2_block_relocator_mark(fs, state,
+ offset + j))
+ {
+ ext2_brelse(bh, 0);
+ return 0;
+ }
+
+ ext2_brelse(bh, 0);
+ }
+
+ return ext2_block_relocator_flush(fs, state);
+}
+
+int ext2_block_relocate(struct ext2_fs *fs, blk_t newsize)
+{
+ struct ext2_block_relocator_state state;
+
+ if (fs->opt_verbose)
+ fprintf(stderr, "relocating blocks....\n");
+
+ state.newallocoffset = 0;
+ state.allocentries = (ext2_relocator_pool_size << 10) /
+ sizeof(struct ext2_block_entry);
+ state.usedentries = 0;
+ state.resolvedentries = 0;
+ state.block = (struct ext2_block_entry *)fs->relocator_pool;
+
+ if (newsize < EXT2_SUPER_BLOCKS_COUNT(fs->sb))
+ return ext2_block_relocate_shrink(fs, &state, newsize);
+
+ return ext2_block_relocate_grow(fs, &state, newsize);
+}
+
+#endif /* !DISCOVER_ONLY */
diff --git a/libparted/fs/ext2/ext2_buffer.c b/libparted/fs/ext2/ext2_buffer.c
new file mode 100644
index 0000000..c0ea14c
--- /dev/null
+++ b/libparted/fs/ext2/ext2_buffer.c
@@ -0,0 +1,447 @@
+/*
+ ext2_buffer.c -- ext2 buffer cache
+ Copyright (C) 1998-2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+
+#ifndef DISCOVER_ONLY
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "ext2.h"
+
+/* pseudo-header */
+
+static __inline__ int ext2_block_hash(blk_t block)
+{
+ unsigned long x;
+
+ x = block ^ (block >> 8) ^ (block >> 16) ^ (block >> 24);
+ return x & ((1 << ext2_hash_bits) - 1);
+}
+
+static struct ext2_buffer_head *ext2_bh_alloc (struct ext2_buffer_cache *, blk_t);
+static void ext2_bh_dealloc (struct ext2_buffer_head *);
+static struct ext2_buffer_head *ext2_bh_find (struct ext2_buffer_cache *, blk_t);
+static int ext2_bh_do_read (struct ext2_buffer_head *);
+static int ext2_bh_do_write(struct ext2_buffer_head *);
+static void ext2_bh_hash (struct ext2_buffer_head *);
+static void ext2_bh_unhash (struct ext2_buffer_head *);
+
+
+
+static int try_to_flush(struct ext2_buffer_cache *bc)
+{
+ int i;
+
+ for (i=0;i<bc->size;i++)
+ {
+ struct ext2_buffer_head *bh;
+
+ bh = &bc->heads[i];
+
+ if (bh->alloc && !bh->usecount && !bh->dirty)
+ {
+ ext2_bh_dealloc(bh);
+ return 1;
+ }
+ }
+
+ for (i=0;i<bc->size;i++)
+ {
+ struct ext2_buffer_head *bh;
+
+ bh = &bc->heads[i];
+
+ if (bh->alloc && !bh->usecount && bh->dirty)
+ {
+ ext2_bh_do_write(bh);
+ ext2_bh_dealloc(bh);
+ return 1;
+ }
+ }
+
+ if (ped_exception_throw (PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("Couldn't flush buffer cache!"))
+ != PED_EXCEPTION_IGNORE)
+ return 0;
+ return 1;
+}
+
+
+
+
+
+static struct ext2_buffer_head *ext2_bh_alloc(struct ext2_buffer_cache *bc, blk_t block)
+{
+ struct ext2_buffer_head *bh;
+ int i;
+
+ bh = NULL;
+
+ tryagain:
+ for (i=0;i<bc->size;i++)
+ {
+ bh = &bc->heads[i];
+
+ if (!bh->alloc)
+ break;
+ }
+
+ if (i == bc->size)
+ {
+ try_to_flush(bc);
+ goto tryagain;
+ }
+
+ bh = &bc->heads[i];
+
+ bh->next = NULL;
+ bh->prev = NULL;
+ bh->block = block;
+ bh->usecount = 0;
+ bh->dirty = 0;
+ bh->alloc = 1;
+ bc->numalloc++;
+
+ ext2_bh_hash(bh);
+
+ return bh;
+}
+
+static void ext2_bh_dealloc(struct ext2_buffer_head *bh)
+{
+ if (bh->dirty)
+ ped_exception_throw (PED_EXCEPTION_BUG, PED_EXCEPTION_IGNORE,
+ "deallocing() a dirty buffer! %i\n", bh->block);
+
+ ext2_bh_unhash(bh);
+ bh->alloc = 0;
+ bh->bc->numalloc--;
+}
+
+static struct ext2_buffer_head *ext2_bh_find(struct ext2_buffer_cache *bc, blk_t block)
+{
+ struct ext2_buffer_head *a;
+ struct ext2_buffer_head *b;
+ int hash;
+
+ hash = ext2_block_hash(block);
+ a = bc->hash[hash];
+
+ if (a != NULL)
+ {
+ b = a;
+ do
+ {
+ if (a->block == block)
+ return a;
+
+ a = a->next;
+ } while (a != b);
+ }
+
+ return NULL;
+}
+
+static int ext2_bh_do_read(struct ext2_buffer_head *bh)
+{
+ return ext2_read_blocks(bh->bc->fs, bh->data, bh->block, 1);
+}
+
+static int ext2_bh_do_write(struct ext2_buffer_head *bh)
+{
+ if (!bh->alloc) {
+ ped_exception_throw (PED_EXCEPTION_BUG, PED_EXCEPTION_CANCEL,
+ "Attempt to write unallocated buffer.");
+ return 0;
+ }
+
+ ext2_write_blocks(bh->bc->fs, bh->data, bh->block, 1);
+ bh->dirty = 0;
+ return 1;
+}
+
+static void ext2_bh_hash(struct ext2_buffer_head *bh)
+{
+ int hash;
+
+ hash = ext2_block_hash(bh->block);
+ if (bh->bc->hash[hash] != NULL)
+ {
+ bh->next = bh->bc->hash[hash];
+ bh->prev = bh->next->prev;
+ bh->next->prev = bh;
+ bh->prev->next = bh;
+ return;
+ }
+
+ bh->bc->hash[hash] = bh;
+ bh->next = bh->prev = bh;
+}
+
+static void ext2_bh_unhash(struct ext2_buffer_head *bh)
+{
+ int hash;
+
+ hash = ext2_block_hash(bh->block);
+
+ bh->prev->next = bh->next;
+ bh->next->prev = bh->prev;
+
+ if (bh->bc->hash[hash] == bh)
+ {
+ if (bh->next != bh)
+ bh->bc->hash[hash] = bh->next;
+ else
+ bh->bc->hash[hash] = NULL;
+ }
+
+ bh->next = NULL;
+ bh->prev = NULL;
+}
+
+
+
+
+
+
+
+static int breadimmhits = 0;
+static int breadindhits = 0;
+static int breadmisses = 0;
+
+void ext2_bcache_deinit(struct ext2_fs *fs)
+{
+ ext2_bcache_sync(fs);
+ ped_free(fs->bc->buffermem);
+ ped_free(fs->bc->hash);
+ ped_free(fs->bc->heads);
+ ped_free(fs->bc);
+
+ if (fs->opt_verbose)
+ fprintf(stderr,
+ "direct hits: %i, indirect hits: %i, misses: %i\n",
+ breadimmhits,
+ breadindhits,
+ breadmisses);
+}
+
+void ext2_bcache_dump(struct ext2_fs *fs)
+{
+ int i;
+
+ fprintf(stderr, "buffer cache dump:\n");
+
+ for (i=0;i<(1<<ext2_hash_bits);i++)
+ if (fs->bc->hash[i] != NULL)
+ {
+ struct ext2_buffer_head *a;
+ struct ext2_buffer_head *b;
+
+ fprintf(stderr, "%i: ", i);
+
+ a = b = fs->bc->hash[i];
+ do
+ {
+ fprintf(stderr, "%i ", a->block);
+ a = a->next;
+ } while (a != b);
+
+ fprintf(stderr, "\n");
+ }
+}
+
+int ext2_bcache_flush(struct ext2_fs *fs, blk_t block)
+{
+ struct ext2_buffer_head *bh;
+
+ if ((bh = ext2_bh_find(fs->bc, block)) == NULL)
+ return 1;
+
+ if (bh->usecount) {
+ ped_exception_throw (PED_EXCEPTION_BUG, PED_EXCEPTION_CANCEL,
+ "Attempt to flush a buffer that's in use! [%i,%i]",
+ bh->block, bh->usecount);
+ return 0;
+ }
+
+ if (bh->dirty) {
+ if (!ext2_bh_do_write(bh))
+ return 0;
+ }
+
+ ext2_bh_dealloc(bh);
+ return 1;
+}
+
+int ext2_bcache_flush_range(struct ext2_fs *fs, blk_t block, blk_t num)
+{
+ blk_t end = block + num;
+
+ for (; block < end; block++) {
+ if (!ext2_bcache_flush(fs, block))
+ return 0;
+ }
+ return 1;
+}
+
+int ext2_bcache_init(struct ext2_fs *fs)
+{
+ struct ext2_buffer_cache *bc;
+ int i;
+ int size;
+
+ size = ext2_buffer_cache_pool_size >> (fs->logsize - 10);
+
+ if ((bc = (struct ext2_buffer_cache *) ped_malloc(sizeof(struct ext2_buffer_cache))) == NULL)
+ return 0;
+
+ if ((bc->heads = (struct ext2_buffer_head *) ped_malloc(size * sizeof(struct ext2_buffer_head))) == NULL)
+ return 0;
+
+ if ((bc->hash = (struct ext2_buffer_head **) ped_malloc(sizeof(struct ext2_buffer_head *) << ext2_hash_bits)) == NULL)
+ {
+ ped_free(bc->heads);
+ ped_free(bc);
+ return 0;
+ }
+
+ if ((bc->buffermem = (unsigned char *) ped_malloc(ext2_buffer_cache_pool_size << 10)) == NULL)
+ {
+ ped_free(bc->hash);
+ ped_free(bc->heads);
+ ped_free(bc);
+ return 0;
+ }
+
+ bc->cache = &bc->heads[0];
+ bc->fs = fs;
+ bc->size = size;
+ bc->numalloc = 0;
+
+ for (i=0;i<size;i++)
+ {
+ bc->heads[i].data = bc->buffermem + (i << fs->logsize);
+ bc->heads[i].bc = bc;
+ bc->heads[i].alloc = 0;
+ }
+
+ for (i=0;i<(1<<ext2_hash_bits);i++)
+ bc->hash[i] = NULL;
+
+ fs->bc = bc;
+
+ return 1;
+}
+
+int ext2_bcache_sync(struct ext2_fs *fs)
+{
+ int i;
+
+ for (i=0;i<fs->bc->size;i++)
+ {
+ struct ext2_buffer_head *bh;
+
+ bh = &fs->bc->heads[i];
+
+ if (bh->alloc && bh->dirty) {
+ if (!ext2_bh_do_write(bh))
+ return 0;
+ }
+ }
+ return 1;
+}
+
+
+
+
+
+
+
+
+struct ext2_buffer_head *ext2_bcreate(struct ext2_fs *fs, blk_t block)
+{
+ struct ext2_buffer_head *bh;
+
+ if ((bh = ext2_bh_find(fs->bc, block)) != NULL)
+ {
+ bh->usecount++;
+ }
+ else
+ {
+ bh = ext2_bh_alloc(fs->bc, block);
+ bh->usecount = 1;
+ }
+
+ memset(bh->data, 0, fs->blocksize);
+ bh->dirty = 1;
+
+ return bh;
+}
+
+struct ext2_buffer_head *ext2_bread(struct ext2_fs *fs, blk_t block)
+{
+ struct ext2_buffer_head *bh;
+
+ if ((bh = fs->bc->cache)->block == block)
+ {
+ breadimmhits++;
+ bh->usecount++;
+ return bh;
+ }
+
+ if ((bh = ext2_bh_find(fs->bc, block)) != NULL)
+ {
+ fs->bc->cache = bh;
+ breadindhits++;
+ bh->usecount++;
+ return bh;
+ }
+
+ breadmisses++;
+
+ bh = ext2_bh_alloc(fs->bc, block);
+ fs->bc->cache = bh;
+ bh->usecount = 1;
+ if (!ext2_bh_do_read(bh)) {
+ ext2_bh_dealloc(bh);
+ return NULL;
+ }
+
+ return bh;
+}
+
+int ext2_brelse(struct ext2_buffer_head *bh, int forget)
+{
+ if (bh->usecount-- == 1 && forget)
+ {
+ if (bh->dirty) {
+ if (!ext2_bh_do_write(bh))
+ return 0;
+ }
+
+ ext2_bh_dealloc(bh);
+ }
+ return 1;
+}
+
+#endif /* !DISCOVER_ONLY */
+
diff --git a/libparted/fs/ext2/ext2_fs.h b/libparted/fs/ext2/ext2_fs.h
new file mode 100644
index 0000000..713cc21
--- /dev/null
+++ b/libparted/fs/ext2/ext2_fs.h
@@ -0,0 +1,323 @@
+/*
+ * linux/include/linux/ext2_fs.h
+ *
+ * Copyright (C) 1992, 1993, 1994, 1995
+ * Remy Card (card@masi.ibp.fr)
+ * Laboratoire MASI - Institut Blaise Pascal
+ * Universite Pierre et Marie Curie (Paris VI)
+ *
+ * from
+ *
+ * linux/include/linux/minix_fs.h
+ *
+ * Copyright (C) 1991, 1992 Linus Torvalds
+ */
+
+/*
+ * EXT2_*_*() convienience macros added by Andrew Clausen <clausen@gnu.org>
+ * Copyright (C) 2000 Free Software Foundation, Inc.
+ */
+
+#ifndef _EXT2_FS_H
+#define _EXT2_FS_H
+
+#include <parted/endian.h>
+#include <stdint.h>
+
+/*
+ * The second extended file system constants/structures
+ */
+
+#define EXT2_SUPER_MAGIC_CONST 0xEF53
+#define EXT2_MIN_BLOCK_SIZE 1024
+#define EXT2_NDIR_BLOCKS 12
+#define EXT2_IND_BLOCK EXT2_NDIR_BLOCKS
+#define EXT2_DIND_BLOCK (EXT2_IND_BLOCK + 1)
+#define EXT2_TIND_BLOCK (EXT2_DIND_BLOCK + 1)
+#define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1)
+#define EXT2_VALID_FS 0x0001
+#define EXT2_ERROR_FS 0x0002
+#define EXT2_RESERVED_INODE_COUNT 11
+
+/*
+ * Codes for operating systems
+ */
+#define EXT2_OS_LINUX 0
+#define EXT2_OS_HURD 1
+#define EXT2_OS_MASIX 2
+#define EXT2_OS_FREEBSD 3
+#define EXT2_OS_LITES 4
+
+/*
+ * Feature set definitions
+ */
+#define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004
+#define EXT2_FEATURE_COMPAT_HAS_DIR_INDEX 0x0020
+
+#define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001
+#define EXT2_FEATURE_RO_COMPAT_LARGE_FILE 0x0002
+
+#define EXT2_FEATURE_INCOMPAT_FILETYPE 0x0002
+#define EXT3_FEATURE_INCOMPAT_RECOVER 0x0004
+
+/*
+ * Special inodes numbers
+ */
+#define EXT2_BAD_INO 1 /* Bad blocks inode */
+#define EXT2_ROOT_INO 2 /* Root inode */
+#define EXT2_ACL_IDX_INO 3 /* ACL inode */
+#define EXT2_ACL_DATA_INO 4 /* ACL inode */
+#define EXT2_BOOT_LOADER_INO 5 /* Boot loader inode */
+#define EXT2_UNDEL_DIR_INO 6 /* Undelete directory inode */
+
+/*
+ * Ext2 directory file types. Only the low 3 bits are used. The
+ * other bits are reserved for now.
+ */
+#define EXT2_FT_UNKNOWN 0
+#define EXT2_FT_REG_FILE 1
+#define EXT2_FT_DIR 2
+#define EXT2_FT_CHRDEV 3
+#define EXT2_FT_BLKDEV 4
+#define EXT2_FT_FIFO 5
+#define EXT2_FT_SOCK 6
+#define EXT2_FT_SYMLINK 7
+
+/*
+ * Behaviour when detecting errors
+ */
+#define EXT2_ERRORS_CONTINUE 1 /* Continue execution */
+#define EXT2_ERRORS_RO 2 /* Remount fs read-only */
+#define EXT2_ERRORS_PANIC 3 /* Panic */
+#define EXT2_ERRORS_DEFAULT EXT2_ERRORS_CONTINUE
+
+struct ext2_dir_entry_2
+{
+ uint32_t inode;
+ uint16_t rec_len;
+ uint8_t name_len;
+ uint8_t file_type;
+ char name[255];
+};
+
+struct ext2_group_desc
+{
+ uint32_t bg_block_bitmap;
+ uint32_t bg_inode_bitmap;
+ uint32_t bg_inode_table;
+ uint16_t bg_free_blocks_count;
+ uint16_t bg_free_inodes_count;
+ uint16_t bg_used_dirs_count;
+ uint16_t bg_pad;
+ uint32_t bg_reserved[3];
+};
+
+struct ext2_inode
+{
+ uint16_t i_mode; /* File mode */
+ uint16_t i_uid; /* Owner Uid */
+ uint32_t i_size; /* Size in bytes */
+ uint32_t i_atime; /* Access time */
+ uint32_t i_ctime; /* Creation time */
+ uint32_t i_mtime; /* Modification time */
+ uint32_t i_dtime; /* Deletion Time */
+ uint16_t i_gid; /* Group Id */
+ uint16_t i_links_count; /* Links count */
+ uint32_t i_blocks; /* Blocks count */
+ uint32_t i_flags; /* File flags */
+ union {
+ struct {
+ uint32_t l_i_reserved1;
+ } linux1;
+ struct {
+ uint32_t h_i_translator;
+ } hurd1;
+ struct {
+ uint32_t m_i_reserved1;
+ } masix1;
+ } osd1; /* OS dependent 1 */
+ uint32_t i_block[EXT2_N_BLOCKS];/* Pointers to blocks */
+ uint32_t i_generation; /* File version (for NFS) */
+ uint32_t i_file_acl; /* File ACL */
+ uint32_t i_dir_acl; /* Directory ACL */
+ uint32_t i_faddr; /* Fragment address */
+ union {
+ struct {
+ uint8_t l_i_frag; /* Fragment number */
+ uint8_t l_i_fsize; /* Fragment size */
+ uint16_t i_pad1;
+ uint32_t l_i_reserved2[2];
+ } linux2;
+ struct {
+ uint8_t h_i_frag; /* Fragment number */
+ uint8_t h_i_fsize; /* Fragment size */
+ uint16_t h_i_mode_high;
+ uint16_t h_i_uid_high;
+ uint16_t h_i_gid_high;
+ uint32_t h_i_author;
+ } hurd2;
+ struct {
+ uint8_t m_i_frag; /* Fragment number */
+ uint8_t m_i_fsize; /* Fragment size */
+ uint16_t m_pad1;
+ uint32_t m_i_reserved2[2];
+ } masix2;
+ } osd2; /* OS dependent 2 */
+};
+
+#define i_size_high i_dir_acl
+
+struct ext2_super_block
+{
+ uint32_t s_inodes_count; /* Inodes count */
+ uint32_t s_blocks_count; /* Blocks count */
+ uint32_t s_r_blocks_count; /* Reserved blocks count */
+ uint32_t s_free_blocks_count; /* Free blocks count */
+ uint32_t s_free_inodes_count; /* Free inodes count */
+ uint32_t s_first_data_block; /* First Data Block */
+ uint32_t s_log_block_size; /* Block size */
+ int32_t s_log_frag_size; /* Fragment size */
+ uint32_t s_blocks_per_group; /* # Blocks per group */
+ uint32_t s_frags_per_group; /* # Fragments per group */
+ uint32_t s_inodes_per_group; /* # Inodes per group */
+ uint32_t s_mtime; /* Mount time */
+ uint32_t s_wtime; /* Write time */
+ uint16_t s_mnt_count; /* Mount count */
+ int16_t s_max_mnt_count; /* Maximal mount count */
+ uint16_t s_magic; /* Magic signature */
+ uint16_t s_state; /* File system state */
+ uint16_t s_errors; /* Behaviour when detecting errors */
+ uint16_t s_minor_rev_level; /* minor revision level */
+ uint32_t s_lastcheck; /* time of last check */
+ uint32_t s_checkinterval; /* max. time between checks */
+ uint32_t s_creator_os; /* OS */
+ uint32_t s_rev_level; /* Revision level */
+ uint16_t s_def_resuid; /* Default uid for reserved blocks */
+ uint16_t s_def_resgid; /* Default gid for reserved blocks */
+ /*
+ * These fields are for EXT2_DYNAMIC_REV superblocks only.
+ *
+ * Note: the difference between the compatible feature set and
+ * the incompatible feature set is that if there is a bit set
+ * in the incompatible feature set that the kernel doesn't
+ * know about, it should refuse to mount the file system.
+ *
+ * e2fsck's requirements are more strict; if it doesn't know
+ * about a feature in either the compatible or incompatible
+ * feature set, it must abort and not try to meddle with
+ * things it doesn't understand...
+ */
+ uint32_t s_first_ino; /* First non-reserved inode */
+ uint16_t s_inode_size; /* size of inode structure */
+ uint16_t s_block_group_nr; /* block group # of this superblock */
+ uint32_t s_feature_compat; /* compatible feature set */
+ uint32_t s_feature_incompat; /* incompatible feature set */
+ uint32_t s_feature_ro_compat; /* readonly-compatible feature set */
+ uint8_t s_uuid[16]; /* 128-bit uuid for volume */
+ char s_volume_name[16]; /* volume name */
+ char s_last_mounted[64]; /* directory where last mounted */
+ uint32_t s_algorithm_usage_bitmap; /* For compression */
+ /*
+ * Performance hints. Directory preallocation should only
+ * happen if the EXT2_COMPAT_PREALLOC flag is on.
+ */
+ uint8_t s_prealloc_blocks; /* Nr of blocks to try to preallocate*/
+ uint8_t s_prealloc_dir_blocks; /* Nr to preallocate for dirs */
+ uint16_t s_padding1;
+ /*
+ * Journaling support valid if EXT2_FEATURE_COMPAT_HAS_JOURNAL set.
+ */
+ uint8_t s_journal_uuid[16]; /* uuid of journal superblock */
+ uint32_t s_journal_inum; /* inode number of journal file */
+ uint32_t s_journal_dev; /* device number of journal file */
+ uint32_t s_last_orphan; /* start of list of inodes to delete */
+
+ uint32_t s_reserved[197]; /* Padding to the end of the block */
+};
+
+#define EXT2_DIRENT_INODE(dir_ent) (PED_LE32_TO_CPU((dir_ent).inode))
+#define EXT2_DIRENT_REC_LEN(dir_ent) (PED_LE16_TO_CPU((dir_ent).rec_len))
+#define EXT2_DIRENT_NAME_LEN(dir_ent) ((dir_ent).name_len)
+#define EXT2_DIRENT_FILE_TYPE(dir_ent) ((dir_ent).file_type)
+
+#define EXT2_GROUP_BLOCK_BITMAP(gd) (PED_LE32_TO_CPU((gd).bg_block_bitmap))
+#define EXT2_GROUP_INODE_BITMAP(gd) (PED_LE32_TO_CPU((gd).bg_inode_bitmap))
+#define EXT2_GROUP_INODE_TABLE(gd) (PED_LE32_TO_CPU((gd).bg_inode_table))
+#define EXT2_GROUP_FREE_BLOCKS_COUNT(gd) \
+ (PED_LE16_TO_CPU((gd).bg_free_blocks_count))
+#define EXT2_GROUP_FREE_INODES_COUNT(gd) \
+ (PED_LE16_TO_CPU((gd).bg_free_inodes_count))
+#define EXT2_GROUP_USED_DIRS_COUNT(gd) \
+ (PED_LE16_TO_CPU((gd).bg_used_dirs_count))
+
+#define EXT2_INODE_MODE(inode) (PED_LE16_TO_CPU((inode).i_mode))
+#define EXT2_INODE_UID(inode) (PED_LE16_TO_CPU((inode).i_uid))
+#define EXT2_INODE_SIZE(inode) \
+ ((uint64_t) PED_LE32_TO_CPU((inode).i_size) \
+ + ((uint64_t) PED_LE32_TO_CPU((inode).i_size_high) << 32))
+#define EXT2_INODE_ATIME(inode) (PED_LE32_TO_CPU((inode).i_atime))
+#define EXT2_INODE_CTIME(inode) (PED_LE32_TO_CPU((inode).i_ctime))
+#define EXT2_INODE_MTIME(inode) (PED_LE32_TO_CPU((inode).i_mtime))
+#define EXT2_INODE_DTIME(inode) (PED_LE32_TO_CPU((inode).i_dtime))
+#define EXT2_INODE_GID(inode) (PED_LE16_TO_CPU((inode).i_gid))
+#define EXT2_INODE_LINKS_COUNT(inode) (PED_LE16_TO_CPU((inode).i_links_count))
+#define EXT2_INODE_BLOCKS(inode) (PED_LE32_TO_CPU((inode).i_blocks))
+#define EXT2_INODE_FLAGS(inode) (PED_LE32_TO_CPU((inode).i_flags))
+#define EXT2_INODE_TRANSLATOR(inode) (PED_LE32_TO_CPU((inode).osd1.hurd1.h_i_translator))
+#define EXT2_INODE_BLOCK(inode, blk) (PED_LE32_TO_CPU((inode).i_block[blk]))
+
+#define EXT2_SUPER_INODES_COUNT(sb) (PED_LE32_TO_CPU((sb).s_inodes_count))
+#define EXT2_SUPER_BLOCKS_COUNT(sb) (PED_LE32_TO_CPU((sb).s_blocks_count))
+#define EXT2_SUPER_R_BLOCKS_COUNT(sb) (PED_LE32_TO_CPU((sb).s_r_blocks_count))
+#define EXT2_SUPER_FREE_BLOCKS_COUNT(sb) \
+ (PED_LE32_TO_CPU((sb).s_free_blocks_count))
+#define EXT2_SUPER_FREE_INODES_COUNT(sb) \
+ (PED_LE32_TO_CPU((sb).s_free_inodes_count))
+#define EXT2_SUPER_FIRST_DATA_BLOCK(sb) \
+ (PED_LE32_TO_CPU((sb).s_first_data_block))
+#define EXT2_SUPER_LOG_BLOCK_SIZE(sb) (PED_LE32_TO_CPU((sb).s_log_block_size))
+#define EXT2_SUPER_LOG_FRAG_SIZE(sb) \
+ ((int32_t) PED_LE32_TO_CPU((sb).s_log_frag_size))
+#define EXT2_SUPER_BLOCKS_PER_GROUP(sb) \
+ (PED_LE32_TO_CPU((sb).s_blocks_per_group))
+#define EXT2_SUPER_FRAGS_PER_GROUP(sb) \
+ (PED_LE32_TO_CPU((sb).s_frags_per_group))
+#define EXT2_SUPER_INODES_PER_GROUP(sb) \
+ (PED_LE32_TO_CPU((sb).s_inodes_per_group))
+#define EXT2_SUPER_MTIME(sb) (PED_LE32_TO_CPU((sb).s_mtime))
+#define EXT2_SUPER_WTIME(sb) (PED_LE32_TO_CPU((sb).s_wtime))
+#define EXT2_SUPER_MNT_COUNT(sb) (PED_LE16_TO_CPU((sb).s_mnt_count))
+#define EXT2_SUPER_MAX_MNT_COUNT(sb) \
+ ((int16_t) PED_LE16_TO_CPU((sb).s_max_mnt_count))
+#define EXT2_SUPER_MAGIC(sb) (PED_LE16_TO_CPU((sb).s_magic))
+#define EXT2_SUPER_STATE(sb) (PED_LE16_TO_CPU((sb).s_state))
+#define EXT2_SUPER_ERRORS(sb) (PED_LE16_TO_CPU((sb).s_errors))
+#define EXT2_SUPER_MINOR_REV_LEVEL(sb) \
+ (PED_LE16_TO_CPU((sb).s_minor_rev_level))
+#define EXT2_SUPER_LASTCHECK(sb) (PED_LE32_TO_CPU((sb).s_lastcheck))
+#define EXT2_SUPER_CHECKINTERVAL(sb) (PED_LE32_TO_CPU((sb).s_checkinterval))
+#define EXT2_SUPER_CREATOR_OS(sb) (PED_LE32_TO_CPU((sb).s_creator_os))
+#define EXT2_SUPER_REV_LEVEL(sb) (PED_LE32_TO_CPU((sb).s_rev_level))
+#define EXT2_SUPER_DEF_RESUID(sb) (PED_LE16_TO_CPU((sb).s_def_resuid))
+#define EXT2_SUPER_DEF_RESGID(sb) (PED_LE16_TO_CPU((sb).s_def_resgid))
+
+#define EXT2_SUPER_FIRST_INO(sb) (PED_LE32_TO_CPU((sb).s_first_ino))
+#define EXT2_SUPER_INODE_SIZE(sb) (PED_LE16_TO_CPU((sb).s_inode_size))
+#define EXT2_SUPER_BLOCK_GROUP_NR(sb) (PED_LE16_TO_CPU((sb).s_block_group_nr))
+#define EXT2_SUPER_FEATURE_COMPAT(sb) (PED_LE32_TO_CPU((sb).s_feature_compat))
+#define EXT2_SUPER_FEATURE_INCOMPAT(sb) \
+ (PED_LE32_TO_CPU((sb).s_feature_incompat))
+#define EXT2_SUPER_FEATURE_RO_COMPAT(sb) \
+ (PED_LE32_TO_CPU((sb).s_feature_ro_compat))
+#define EXT2_SUPER_UUID(sb) ((sb).s_uuid)
+#define EXT2_SUPER_VOLUME_NAME(sb) ((sb).s_volume_name)
+#define EXT2_SUPER_LAST_MOUNTED(sb) ((sb).s_last_mounted)
+#define EXT2_SUPER_ALGORITHM_USAGE_BITMAP(sb) \
+ (PED_LE32_TO_CPU((sb).s_algorithm_usage_bitmap))
+
+#define EXT2_SUPER_JOURNAL_UUID(sb) ((sb).s_journal_uuid)
+#define EXT2_SUPER_JOURNAL_INUM(sb) (PED_LE32_TO_CPU((sb).s_journal_inum))
+#define EXT2_SUPER_JOURNAL_DEV(sb) (PED_LE32_TO_CPU((sb).s_journal_dev))
+#define EXT2_SUPER_LAST_ORPHAN(sb) (PED_LE32_TO_CPU((sb).s_last_orphan))
+
+#endif
diff --git a/libparted/fs/ext2/ext2_inode_relocator.c b/libparted/fs/ext2/ext2_inode_relocator.c
new file mode 100644
index 0000000..82a94bf
--- /dev/null
+++ b/libparted/fs/ext2/ext2_inode_relocator.c
@@ -0,0 +1,600 @@
+/*
+ ext2_inode_relocator.c -- ext2 inode relocator
+ Copyright (C) 1998-2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+
+#ifndef DISCOVER_ONLY
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h> /* for S_ISDIR */
+#include "ext2.h"
+
+
+
+
+
+
+struct ext2_reference
+{
+ blk_t block;
+ off_t offset;
+};
+
+struct ext2_inode_entry
+{
+ ino_t num;
+ ino_t dest;
+ unsigned numreferences:16;
+ unsigned isdir:1;
+ struct ext2_reference *ref;
+};
+
+struct ext2_inode_relocator_state
+{
+ int usedentries;
+ int resolvedentries;
+ struct ext2_inode_entry *inode;
+ struct ext2_reference *last;
+};
+
+
+
+
+
+static struct ext2_inode_entry *findit(struct ext2_inode_relocator_state *state, ino_t inode)
+{
+ int min;
+ int max;
+ struct ext2_inode_entry *retv;
+ int t;
+ blk_t tval;
+
+ max = state->usedentries - 1;
+ min = 0;
+ retv = NULL;
+
+ repeat:
+ if (min > max)
+ goto out;
+
+ t = (min + max) >> 1;
+ tval = state->inode[t].num;
+
+ t--;
+ if (tval > inode)
+ max = t;
+
+ t += 2;
+ if (tval < inode)
+ min = t;
+
+ t--;
+
+ if (tval != inode)
+ goto repeat;
+
+ retv = &state->inode[t];
+
+ out:
+ return retv;
+}
+
+static int addref(struct ext2_fs *fs, struct ext2_inode_relocator_state *state, ino_t inode, blk_t block, off_t offset)
+{
+ struct ext2_inode_entry *ent;
+ int i;
+
+ if ((ent = findit(state, inode)) == NULL)
+ return 1;
+
+ for (i=0;i<ent->numreferences;i++)
+ if (!ent->ref[i].block)
+ break;
+
+ if (i == ent->numreferences)
+ {
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("Found an inode with a incorrect link count. "
+ "Better go run e2fsck first!"));
+ return 0;
+ }
+
+ if (i == ent->numreferences - 1)
+ state->resolvedentries++;
+
+ ent->ref[i].block = block;
+ ent->ref[i].offset = offset;
+
+ return 1;
+}
+
+static int doblock(struct ext2_fs *fs, struct ext2_inode_relocator_state *state, blk_t blockno)
+{
+ struct ext2_buffer_head *bh;
+ off_t offset;
+
+ bh = ext2_bread(fs, blockno);
+ if (!bh)
+ return 0;
+
+ offset = 0;
+ do
+ {
+ struct ext2_dir_entry_2 *ptr;
+
+ ptr = (struct ext2_dir_entry_2 *)(bh->data + offset);
+
+ if (ptr->name_len)
+ if (!addref(fs, state, EXT2_DIRENT_INODE(*ptr), blockno,
+ offset))
+ return 0;
+
+ PED_ASSERT (ptr->rec_len > 0, return 0);
+ offset += EXT2_DIRENT_REC_LEN (*ptr);
+ } while (offset < fs->blocksize);
+
+ ext2_brelse(bh, 0);
+ return 1;
+}
+
+static int doindblock(struct ext2_fs *fs, struct ext2_inode_relocator_state *state, blk_t blockno)
+{
+ struct ext2_buffer_head *bh;
+ blk_t blk;
+ int i;
+
+ bh = ext2_bread(fs, blockno);
+
+ for (i=0;i<(fs->blocksize>>2);i++)
+ if ((blk = PED_LE32_TO_CPU(((uint32_t *)bh->data)[i])) != 0)
+ if (!doblock(fs, state, blk))
+ return 0;
+
+ ext2_brelse(bh, 0);
+ return 1;
+}
+
+static int dodindblock(struct ext2_fs *fs, struct ext2_inode_relocator_state *state, blk_t blockno)
+{
+ struct ext2_buffer_head *bh;
+ blk_t blk;
+ int i;
+
+ bh = ext2_bread(fs, blockno);
+ if (!bh)
+ return 0;
+
+ for (i=0;i<(fs->blocksize>>2);i++)
+ if ((blk = PED_LE32_TO_CPU(((uint32_t *)bh->data)[i])) != 0)
+ if (!doindblock(fs, state, blk))
+ return 0;
+
+ ext2_brelse(bh, 0);
+ return 1;
+}
+
+static int dotindblock(struct ext2_fs *fs, struct ext2_inode_relocator_state *state, blk_t blockno)
+{
+ struct ext2_buffer_head *bh;
+ blk_t blk;
+ int i;
+
+ bh = ext2_bread(fs, blockno);
+ if (!bh)
+ return 0;
+
+ for (i=0;i<(fs->blocksize>>2);i++)
+ if ((blk = PED_LE32_TO_CPU(((uint32_t *)bh->data)[i])) != 0)
+ if (!dodindblock(fs, state, blk))
+ return 0;
+
+ ext2_brelse(bh, 0);
+ return 1;
+}
+
+static int doinode(struct ext2_fs *fs, struct ext2_inode_relocator_state *state, ino_t inode)
+{
+ struct ext2_inode buf;
+ int i;
+
+ if (!ext2_read_inode(fs, inode, &buf))
+ return 0;
+ if (S_ISDIR(EXT2_INODE_MODE(buf)))
+ {
+ blk_t blk;
+
+ for (i=0;i<EXT2_NDIR_BLOCKS;i++)
+ if ((blk = EXT2_INODE_BLOCK(buf, i)) != 0)
+ if (!doblock(fs, state, blk))
+ return 0;
+
+ if ((blk = EXT2_INODE_BLOCK(buf, EXT2_IND_BLOCK)) != 0)
+ if (!doindblock(fs, state, blk))
+ return 0;
+
+ if ((blk = EXT2_INODE_BLOCK(buf, EXT2_DIND_BLOCK)) != 0)
+ if (!dodindblock(fs, state, blk))
+ return 0;
+
+ if ((blk = EXT2_INODE_BLOCK(buf, EXT2_TIND_BLOCK)) != 0)
+ if (!dotindblock(fs, state, blk))
+ return 0;
+ }
+
+ return 1;
+}
+
+static int doscangroup(struct ext2_fs *fs, struct ext2_inode_relocator_state *state, int group)
+{
+ struct ext2_buffer_head *bh;
+ unsigned int i;
+ int offset;
+
+ if (fs->opt_verbose)
+ fprintf(stderr, " scanning group %i.... ", group);
+
+ bh = ext2_bread(fs, EXT2_GROUP_INODE_BITMAP(fs->gd[group]));
+ offset = group * EXT2_SUPER_INODES_PER_GROUP(fs->sb) + 1;
+
+ for (i=0;i<EXT2_SUPER_INODES_PER_GROUP(fs->sb);i++)
+ if (bh->data[i>>3] & _bitmap[i&7])
+ {
+ if (!doinode(fs, state, offset + i))
+ {
+ ext2_brelse(bh, 0);
+ return 0;
+ }
+
+ if (state->resolvedentries == state->usedentries)
+ break;
+ }
+
+ ext2_brelse(bh, 0);
+
+ if (fs->opt_verbose)
+ fprintf(stderr,
+ "%i/%i inodes resolved\r",
+ state->resolvedentries,
+ state->usedentries);
+
+ return 1;
+}
+
+/* basically: this builds a dependency graph of the inodes in the entire file
+ * system. inodes are only referenced by the directory tree (or the magic
+ * ones implicitly, like the bad blocks inode), so we just walk the directory
+ * tree adding references.
+ */
+static int doscan(struct ext2_fs *fs, struct ext2_inode_relocator_state *state)
+{
+ int i;
+
+ /* while the journal will usually be inode 8 (and therefore will never
+ * need to be moved), we don't have any guarantee (grrr). So, we
+ * need to be prepared to move it... (and update the reference in the
+ * super block)
+ */
+ if (fs->has_internal_journal)
+ addref(fs, state, EXT2_SUPER_JOURNAL_INUM(fs->sb),
+ 1, offsetof(struct ext2_super_block, s_journal_inum));
+
+ if (!doscangroup(fs, state, 0))
+ return 0;
+
+ if (state->resolvedentries != state->usedentries)
+ for (i=fs->numgroups-1;i>0;i--)
+ {
+ if (!doscangroup(fs, state, i))
+ return 0;
+
+ if (state->resolvedentries == state->usedentries)
+ break;
+ }
+
+ if (fs->opt_verbose)
+ fprintf(stderr, "\n");
+
+ return 1;
+}
+
+
+
+
+
+
+
+static int ext2_inode_relocator_copy(struct ext2_fs *fs, struct ext2_inode_relocator_state *state)
+{
+ int i;
+
+ for (i=0;i<state->usedentries;i++)
+ {
+ struct ext2_inode buf;
+ struct ext2_inode_entry *entry;
+
+ entry = &state->inode[i];
+
+ if (fs->opt_debug)
+ if (!ext2_get_inode_state(fs, entry->num) ||
+ ext2_get_inode_state(fs, entry->dest))
+ fprintf(stderr, "inodebitmaperror\n");
+
+ if (!ext2_read_inode(fs, entry->num, &buf))
+ return 0;
+ if (!ext2_write_inode(fs, entry->dest, &buf))
+ return 0;
+
+ entry->isdir = S_ISDIR(EXT2_INODE_MODE(buf))?1:0;
+ }
+
+ if (fs->opt_safe)
+ if (!ext2_sync(fs))
+ return 0;
+ return 1;
+}
+
+static int ext2_inode_relocator_finish(struct ext2_fs *fs, struct ext2_inode_relocator_state *state)
+{
+ int i;
+
+ for (i=0;i<state->usedentries;i++)
+ {
+ struct ext2_inode_entry *entry;
+
+ entry = &state->inode[i];
+ ext2_set_inode_state(fs, entry->dest, 1, 1);
+ ext2_set_inode_state(fs, entry->num, 0, 1);
+ ext2_zero_inode(fs, entry->num);
+ }
+
+ if (fs->opt_safe)
+ if (!ext2_sync(fs))
+ return 0;
+ return 1;
+}
+
+static int ext2_inode_relocator_ref(struct ext2_fs *fs, struct ext2_inode_relocator_state *state)
+{
+ int i;
+ static int numerrors = 0;
+
+ for (i=0;i<state->usedentries;i++)
+ {
+ struct ext2_inode_entry *entry;
+ int j;
+ uint32_t t;
+
+ entry = &state->inode[i];
+ t = entry->dest;
+
+ for (j=0;j<entry->numreferences;j++)
+ {
+ struct ext2_buffer_head *bh;
+
+ bh = ext2_bread(fs, entry->ref[j].block);
+ if (!bh)
+ return 0;
+
+ if (fs->opt_debug)
+ {
+ if (PED_LE32_TO_CPU((*((uint32_t *)(bh->data + entry->ref[j].offset)))) != entry->num)
+ {
+ fprintf(stderr,
+ "inode %li ref error! (->%li, [%i]={%i, %i})\n",
+ (long) entry->num,
+ (long) entry->dest,
+ j,
+ entry->ref[j].block,
+ (int) entry->ref[j].offset);
+ ext2_brelse(bh, 0);
+
+ if (numerrors++ < 4)
+ continue;
+
+ fprintf(stderr, "all is not well!\n");
+ return 0;
+ }
+ }
+
+ *((uint32_t *)(bh->data + entry->ref[j].offset))
+ = PED_CPU_TO_LE32(t);
+ bh->dirty = 1;
+
+ ext2_brelse(bh, 0);
+ }
+
+ if (entry->isdir)
+ {
+ int oldgroup;
+ int newgroup;
+
+ oldgroup = (entry->num - 1)
+ / EXT2_SUPER_INODES_PER_GROUP(fs->sb);
+ newgroup = (entry->dest - 1)
+ / EXT2_SUPER_INODES_PER_GROUP(fs->sb);
+
+ fs->gd[oldgroup].bg_used_dirs_count = PED_CPU_TO_LE16 (
+ EXT2_GROUP_USED_DIRS_COUNT(fs->gd[oldgroup])
+ - 1);
+ fs->gd[newgroup].bg_used_dirs_count = PED_CPU_TO_LE16 (
+ EXT2_GROUP_USED_DIRS_COUNT(fs->gd[newgroup])
+ + 1);
+
+ fs->metadirty = EXT2_META_GD;
+ }
+ }
+
+ if (fs->opt_safe)
+ if (!ext2_sync(fs))
+ return 0;
+
+ return 1;
+}
+
+static int ext2_inode_relocator_grab_inodes(struct ext2_fs *fs, struct ext2_inode_relocator_state *state)
+{
+ int i;
+ int ptr;
+
+ ptr = 0;
+
+ for (i=0;i<fs->numgroups;i++)
+ if (EXT2_GROUP_FREE_INODES_COUNT(fs->gd[i]))
+ {
+ struct ext2_buffer_head *bh;
+ unsigned int j;
+ int offset;
+
+ bh = ext2_bread(fs, EXT2_GROUP_INODE_BITMAP(fs->gd[i]));
+ if (!bh)
+ return 0;
+ offset = i * EXT2_SUPER_INODES_PER_GROUP(fs->sb) + 1;
+
+ j = i ? 0 : 13;
+ for (;j<EXT2_SUPER_INODES_PER_GROUP(fs->sb);j++)
+ if (!(bh->data[j>>3] & _bitmap[j&7]))
+ {
+ state->inode[ptr++].dest = offset + j;
+
+ if (ptr == state->usedentries)
+ {
+ ext2_brelse(bh, 0);
+ return 1;
+ }
+ }
+
+ ext2_brelse(bh, 0);
+ }
+
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("Not enough free inodes!"));
+ return 0;
+}
+
+static int ext2_inode_relocator_flush(struct ext2_fs *fs, struct ext2_inode_relocator_state *state)
+{
+ if (!state->usedentries)
+ return 1;
+
+ if (!doscan(fs, state))
+ return 0;
+
+ if (!ext2_inode_relocator_grab_inodes(fs, state))
+ return 0;
+
+ if (!ext2_inode_relocator_copy(fs, state))
+ return 0;
+
+ if (!ext2_inode_relocator_ref(fs, state))
+ return 0;
+
+ if (!ext2_inode_relocator_finish(fs, state))
+ return 0;
+
+ state->usedentries = 0;
+ state->resolvedentries = 0;
+ state->last = (struct ext2_reference *)fs->relocator_pool_end;
+
+ if (fs->opt_safe)
+ if (!ext2_sync(fs))
+ return 0;
+
+ return 1;
+}
+
+static int ext2_inode_relocator_mark(struct ext2_fs *fs, struct ext2_inode_relocator_state *state, ino_t inode)
+{
+ struct ext2_inode buf;
+ struct ext2_inode_entry *ent;
+ int i;
+
+ if (!ext2_read_inode(fs, inode, &buf))
+ return 0;
+
+ {
+ register void *adv;
+ register void *rec;
+
+ adv = state->inode + state->usedentries + 1;
+ rec = state->last - EXT2_INODE_LINKS_COUNT(buf);
+
+ if (adv >= rec)
+ ext2_inode_relocator_flush(fs, state);
+ }
+
+ state->last -= EXT2_INODE_LINKS_COUNT(buf);
+
+ ent = &state->inode[state->usedentries];
+ ent->num = inode;
+ ent->dest = 0;
+ ent->numreferences = EXT2_INODE_LINKS_COUNT(buf);
+ ent->ref = state->last;
+
+ for (i=0;i<ent->numreferences;i++)
+ {
+ ent->ref[i].block = 0;
+ ent->ref[i].offset = 0;
+ }
+
+ state->usedentries++;
+
+ return 1;
+}
+
+
+int ext2_inode_relocate(struct ext2_fs *fs, int newgroups)
+{
+ int i;
+ struct ext2_inode_relocator_state state;
+
+ if (fs->opt_verbose)
+ fprintf(stderr, "ext2_inode_relocate\n");
+
+ state.usedentries = 0;
+ state.resolvedentries = 0;
+ state.inode = (struct ext2_inode_entry *)fs->relocator_pool;
+ state.last = (struct ext2_reference *)fs->relocator_pool_end;
+
+ for (i=newgroups;i<fs->numgroups;i++)
+ {
+ struct ext2_buffer_head *bh;
+ unsigned int j;
+ int offset;
+
+ bh = ext2_bread(fs, EXT2_GROUP_INODE_BITMAP(fs->gd[i]));
+ if (!bh)
+ return 0;
+ offset = i * EXT2_SUPER_INODES_PER_GROUP(fs->sb) + 1;
+
+ for (j=0;j<EXT2_SUPER_INODES_PER_GROUP(fs->sb);j++)
+ if (bh->data[j>>3] & _bitmap[j&7])
+ ext2_inode_relocator_mark(fs, &state,
+ offset + j);
+
+ ext2_brelse(bh, 0);
+ }
+
+ if (!ext2_inode_relocator_flush(fs, &state))
+ return 0;
+
+ return 1;
+}
+#endif /* !DISCOVER_ONLY */
+
diff --git a/libparted/fs/ext2/ext2_meta.c b/libparted/fs/ext2/ext2_meta.c
new file mode 100644
index 0000000..b2109ce
--- /dev/null
+++ b/libparted/fs/ext2/ext2_meta.c
@@ -0,0 +1,146 @@
+/*
+ ext2_meta.c -- ext2 metadata mover
+ Copyright (C) 1998-2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+
+#ifndef DISCOVER_ONLY
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "ext2.h"
+
+int ext2_metadata_push(struct ext2_fs *fs, blk_t newsize)
+{
+ int i;
+ int newgdblocks;
+ blk_t newitoffset;
+
+ newgdblocks = ped_div_round_up (newsize
+ - EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb),
+ EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb));
+ newgdblocks = ped_div_round_up (newgdblocks
+ * sizeof(struct ext2_group_desc),
+ fs->blocksize);
+ newitoffset = newgdblocks + 3;
+
+ if (newitoffset <= fs->itoffset)
+ return 1;
+
+ for (i=0;i<fs->numgroups;i++)
+ {
+ blk_t diff;
+ blk_t j;
+ blk_t fromblock;
+ blk_t start;
+
+ start = (i * EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb))
+ + EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb);
+
+ if (EXT2_GROUP_INODE_TABLE(fs->gd[i]) >= start + newitoffset
+ && EXT2_GROUP_BLOCK_BITMAP(fs->gd[i]) >= start + newitoffset - 2
+ && EXT2_GROUP_INODE_BITMAP(fs->gd[i]) >= start + newitoffset - 1)
+ continue;
+
+ diff = newitoffset - (EXT2_GROUP_INODE_TABLE(fs->gd[i]) - start);
+
+ /* inode table */
+ fromblock = EXT2_GROUP_INODE_TABLE(fs->gd[i]) + fs->inodeblocks;
+
+ if (fs->opt_debug)
+ {
+ for (j=0;j<diff;j++)
+ if (ext2_get_block_state(fs, fromblock+j))
+ {
+ fprintf(stderr,
+ "error: block relocator "
+ "should have relocated "
+ "%i\n",
+ fromblock);
+
+ return 0;
+ }
+ }
+
+ for (j=0;j<diff;j++)
+ if (!ext2_set_block_state(fs, fromblock+j, 1, 0))
+ return 0;
+
+ if (!ext2_move_blocks(fs,
+ EXT2_GROUP_INODE_TABLE(fs->gd[i]),
+ fs->inodeblocks,
+ EXT2_GROUP_INODE_TABLE(fs->gd[i]) + diff))
+ return 0;
+ fs->gd[i].bg_inode_table = PED_CPU_TO_LE32 (
+ EXT2_GROUP_INODE_TABLE(fs->gd[i]) + diff);
+ fs->metadirty |= EXT2_META_GD;
+
+ if (fs->opt_safe)
+ if (!ext2_sync(fs))
+ return 0;
+
+ /* block bitmap and inode bitmap */
+ fromblock = EXT2_GROUP_INODE_TABLE(fs->gd[i]);
+ if (ext2_is_group_sparse(fs, i))
+ {
+ if (!ext2_copy_block(fs,
+ EXT2_GROUP_INODE_BITMAP(fs->gd[i]),
+ EXT2_GROUP_INODE_BITMAP(fs->gd[i]) + diff))
+ return 0;
+ fs->gd[i].bg_inode_bitmap = PED_CPU_TO_LE32 (
+ EXT2_GROUP_INODE_BITMAP(fs->gd[i]) + diff);
+ fs->metadirty |= EXT2_META_GD;
+
+ if (fs->opt_safe)
+ if (!ext2_sync(fs))
+ return 0;
+
+ if (!ext2_copy_block(fs,
+ EXT2_GROUP_BLOCK_BITMAP(fs->gd[i]),
+ EXT2_GROUP_BLOCK_BITMAP(fs->gd[i])+diff))
+ return 0;
+ fs->gd[i].bg_block_bitmap = PED_CPU_TO_LE32 (
+ EXT2_GROUP_BLOCK_BITMAP(fs->gd[i]) + diff);
+ fs->metadirty |= EXT2_META_GD;
+
+ if (fs->opt_safe)
+ if (!ext2_sync(fs))
+ return 0;
+
+ fromblock = EXT2_GROUP_BLOCK_BITMAP(fs->gd[i]);
+ }
+
+ ext2_zero_blocks(fs, fromblock-diff, diff);
+ for (j=0;j<diff;j++)
+ if (!ext2_set_block_state(fs, fromblock+j-diff, 0, 0))
+ return 0;
+
+ if (fs->opt_verbose)
+ fprintf(stderr,
+ "ext2_metadata_push: group %i/%i\r",
+ i+1, fs->numgroups);
+ }
+
+ fs->itoffset = newitoffset;
+
+ if (fs->opt_verbose)
+ fprintf(stderr, "\n");
+
+ return 1;
+}
+#endif /* !DISCOVER_ONLY */
diff --git a/libparted/fs/ext2/ext2_mkfs.c b/libparted/fs/ext2/ext2_mkfs.c
new file mode 100644
index 0000000..a37e63c
--- /dev/null
+++ b/libparted/fs/ext2/ext2_mkfs.c
@@ -0,0 +1,601 @@
+/*
+ ext2_mkfs.c -- ext2 fs creator
+ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+
+#ifndef DISCOVER_ONLY
+
+#define USE_EXT2_IS_DATA_BLOCK
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <time.h>
+#include <unistd.h>
+#include <uuid/uuid.h>
+#include "ext2.h"
+
+/* formula grabbed from linux ext2 kernel source
+ *
+ * returns 1 iff:
+ * x == y^N, N is some natural number
+ * OR x == 0
+ */
+static __inline__ int is_root(int x, int y)
+{
+ if (!x) return 1;
+
+ while (1)
+ {
+ if (x == 1) return 1;
+
+ if (x % y) return 0;
+
+ x /= y;
+ }
+}
+
+static __inline__ int is_group_sparse(int sparsesbfs, int group)
+{
+ if (!sparsesbfs)
+ return 1;
+
+ if (is_root(group, 3) || is_root(group, 5) || is_root(group, 7))
+ return 1;
+
+ return 0;
+}
+
+/* has implicit parameter 'sb' !! */
+#define is_sparse(group) is_group_sparse(EXT2_SUPER_FEATURE_RO_COMPAT(*sb) \
+ & EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER, (group))
+
+static int ext2_mkfs_write_main(struct ext2_dev_handle *handle,
+ struct ext2_super_block *sb,
+ struct ext2_group_desc *gd)
+{
+ int freeit;
+ int i;
+ int numgroups;
+ int gdblocks;
+ unsigned char *sbbuf;
+ struct ext2_super_block *sb_for_io;
+
+ freeit = 0;
+ sbbuf = (unsigned char *)sb;
+ sb_for_io = sb;
+ if (EXT2_SUPER_LOG_BLOCK_SIZE(*sb))
+ {
+ sbbuf = ped_malloc(1024 << EXT2_SUPER_LOG_BLOCK_SIZE(*sb));
+ if (!(handle->ops->read)(handle->cookie, sbbuf, 0, 1))
+ return 0;
+ memcpy (sbbuf+1024, sb, 1024);
+ freeit = 1;
+ sb_for_io = (struct ext2_super_block*) (sbbuf + 1024);
+ }
+
+ numgroups = ped_div_round_up (EXT2_SUPER_BLOCKS_COUNT(*sb)
+ - EXT2_SUPER_FIRST_DATA_BLOCK(*sb),
+ EXT2_SUPER_BLOCKS_PER_GROUP(*sb));
+ gdblocks = ped_div_round_up (numgroups * sizeof(struct ext2_group_desc),
+ 1024 << EXT2_SUPER_LOG_BLOCK_SIZE(*sb));
+
+ for (i=0;i<numgroups;i++)
+ {
+ if (is_sparse(i))
+ {
+ int offset;
+
+ offset = EXT2_SUPER_FIRST_DATA_BLOCK(*sb)
+ + i * EXT2_SUPER_BLOCKS_PER_GROUP(*sb);
+
+ sb_for_io->s_block_group_nr = PED_CPU_TO_LE16 (i);
+
+ if (!handle->ops->write(handle->cookie, sbbuf,
+ offset, 1))
+ return 0;
+ if (!handle->ops->write(handle->cookie, gd, offset+1,
+ gdblocks))
+ return 0;
+ }
+ }
+
+ sb_for_io->s_block_group_nr = 0;
+
+ if (freeit)
+ ped_free(sbbuf);
+ return 1;
+}
+
+static int ext2_mkfs_write_meta(struct ext2_dev_handle *handle,
+ struct ext2_super_block *sb,
+ struct ext2_group_desc *gd,
+ PedTimer* timer)
+{
+ int blocksize;
+ int gdtsize;
+ int i;
+ int itsize;
+ int numgroups;
+ unsigned char *bb;
+ unsigned char *ib;
+ unsigned char *zero;
+
+ blocksize = 1 << (EXT2_SUPER_LOG_BLOCK_SIZE(*sb) + 13);
+
+ numgroups = ped_div_round_up (EXT2_SUPER_BLOCKS_COUNT(*sb)
+ - EXT2_SUPER_FIRST_DATA_BLOCK(*sb),
+ EXT2_SUPER_BLOCKS_PER_GROUP(*sb));
+ itsize = ped_div_round_up (sizeof(struct ext2_inode)
+ * EXT2_SUPER_INODES_PER_GROUP(*sb),
+ (1024 << EXT2_SUPER_LOG_BLOCK_SIZE(*sb)));
+ gdtsize = ped_div_round_up (sizeof(struct ext2_group_desc) * numgroups,
+ (1024 << EXT2_SUPER_LOG_BLOCK_SIZE(*sb)));
+
+ bb = ped_malloc(1024 << EXT2_SUPER_LOG_BLOCK_SIZE(*sb));
+ if (!bb) goto error;
+ ib = ped_malloc(1024 << EXT2_SUPER_LOG_BLOCK_SIZE(*sb));
+ if (!ib) goto error_free_bb;
+ zero = ped_malloc((1024 << EXT2_SUPER_LOG_BLOCK_SIZE(*sb)) * itsize);
+ if (!zero) goto error_free_zero;
+
+ memset(zero, 0, (1024 << EXT2_SUPER_LOG_BLOCK_SIZE(*sb)) * itsize);
+
+ ped_timer_reset (timer);
+ ped_timer_set_state_name (timer, _("writing per-group metadata"));
+
+ for (i=0;i<numgroups;i++)
+ {
+ int admin;
+ blk_t bbblock;
+ int groupsize;
+ int groupoffset;
+ blk_t ibblock;
+ int j;
+
+ ped_timer_update (timer, 1.0 * i / numgroups);
+
+ groupoffset = i*EXT2_SUPER_BLOCKS_PER_GROUP(*sb)
+ + EXT2_SUPER_FIRST_DATA_BLOCK(*sb);
+ groupsize = PED_MIN(EXT2_SUPER_BLOCKS_COUNT(*sb) - groupoffset,
+ EXT2_SUPER_BLOCKS_PER_GROUP(*sb));
+
+ admin = itsize + 2;
+ bbblock = groupoffset;
+ ibblock = groupoffset + 1;
+ if (is_sparse(i))
+ {
+ admin += gdtsize + 1;
+ bbblock = groupoffset + gdtsize + 1;
+ ibblock = groupoffset + gdtsize + 2;
+ }
+
+ {
+ memset(bb, 0, 1024 << EXT2_SUPER_LOG_BLOCK_SIZE(*sb));
+ if (is_sparse(i))
+ for (j=0;j<gdtsize+1;j++)
+ bb[j>>3] |= _bitmap[j&7];
+
+ j = bbblock - groupoffset;
+ bb[j>>3] |= _bitmap[j&7];
+
+ j = ibblock - groupoffset;
+ bb[j>>3] |= _bitmap[j&7];
+
+ for (j=0;j<itsize;j++)
+ {
+ int k = j + gdtsize + 3;
+
+ bb[k>>3] |= _bitmap[k&7];
+ }
+
+ for (j=groupsize;j<blocksize;j++)
+ bb[j>>3] |= _bitmap[j&7];
+
+ if (!handle->ops->write(handle->cookie, bb, bbblock, 1))
+ goto error_free_zero;
+ }
+
+ {
+ memset(ib, 0, 1024 << EXT2_SUPER_LOG_BLOCK_SIZE(*sb));
+
+ for (j=EXT2_SUPER_INODES_PER_GROUP(*sb);j<blocksize;j++)
+ bb[j>>3] |= _bitmap[j&7];
+
+ if (!handle->ops->write(handle->cookie, ib, ibblock, 1))
+ goto error_free_zero;
+ }
+
+ if (!handle->ops->write(handle->cookie, zero,
+ groupoffset + gdtsize + 3, itsize))
+ goto error_free_zero;
+
+ gd[i].bg_block_bitmap = PED_CPU_TO_LE32(bbblock);
+ gd[i].bg_inode_bitmap = PED_CPU_TO_LE32(ibblock);
+ gd[i].bg_inode_table = PED_CPU_TO_LE32(groupoffset + gdtsize
+ + 3);
+ gd[i].bg_free_blocks_count = PED_CPU_TO_LE16(groupsize - admin);
+ gd[i].bg_free_inodes_count = PED_CPU_TO_LE16(
+ EXT2_SUPER_INODES_PER_GROUP(*sb));
+ gd[i].bg_used_dirs_count = 0;
+ gd[i].bg_used_dirs_count = 0;
+ gd[i].bg_pad = 0;
+ gd[i].bg_reserved[0] = 0;
+ gd[i].bg_reserved[1] = 0;
+ gd[i].bg_reserved[2] = 0;
+
+ sb->s_free_blocks_count = PED_CPU_TO_LE32 (
+ EXT2_SUPER_FREE_BLOCKS_COUNT(*sb)
+ + EXT2_GROUP_FREE_BLOCKS_COUNT(gd[i]));
+ }
+
+ ped_timer_update (timer, 1.0);
+
+ ped_free(zero);
+ ped_free(ib);
+ ped_free(bb);
+ return 1;
+
+error_free_zero:
+ ped_free(zero);
+error_free_ib:
+ ped_free(ib);
+error_free_bb:
+ ped_free(bb);
+error:
+ return 0;
+}
+
+/* returns the offset into the buffer of the start of the next dir entry */
+static int _set_dirent(void* buf, int offset, int block_size, int is_last,
+ uint32_t inode, char* name, int file_type)
+{
+ struct ext2_dir_entry_2 *dirent = (void*) (((char*)buf) + offset);
+ int name_len = strlen(name);
+ int rec_len;
+
+ if (is_last)
+ rec_len = block_size - offset;
+ else
+ rec_len = ped_round_up_to(name_len + 1 + 8, 4);
+
+ memset (dirent, 0, rec_len);
+
+ dirent->inode = PED_CPU_TO_LE32(inode);
+ dirent->name_len = name_len;
+ dirent->rec_len = PED_CPU_TO_LE16(rec_len);
+ dirent->file_type = file_type;
+ strcpy(dirent->name, name);
+
+ return offset + rec_len;
+}
+
+static int ext2_mkfs_create_lost_and_found_inode(struct ext2_fs *fs)
+{
+ struct ext2_buffer_head *bh;
+ blk_t blocks[12];
+ uint32_t* data = ped_malloc ((fs->blocksize / 4) * sizeof(uint32_t));
+ int i;
+ struct ext2_inode inode;
+ int offset;
+
+ for (i=0;i<12;i++)
+ {
+ if (!(blocks[i] = ext2_find_free_block(fs)))
+ return 0;
+
+ if (!ext2_set_block_state(fs, blocks[i], 1, 1))
+ return 0;
+ }
+
+ /* create the directory entries, preallocating lots of blocks */
+ /* first block contains . and .. */
+ bh = ext2_bcreate(fs, blocks[0]);
+ if (!bh)
+ return 0;
+ memset(bh->data, 0, fs->blocksize);
+ offset = _set_dirent(bh->data, 0, fs->blocksize, 0,
+ 11, ".", EXT2_FT_DIR);
+ offset = _set_dirent(bh->data, offset, fs->blocksize, 1,
+ EXT2_ROOT_INO, "..", EXT2_FT_DIR);
+ bh->dirty = 1;
+ ext2_brelse(bh, 1);
+
+ /* subsequent blocks are empty */
+ memset(data, 0, fs->blocksize);
+ data[0] = 0;
+ data[1] = PED_CPU_TO_LE32(fs->blocksize);
+ for (i=1;i<12;i++)
+ {
+ bh = ext2_bcreate(fs, blocks[i]);
+ memcpy(bh->data, data, fs->blocksize);
+ bh->dirty = 1;
+ ext2_brelse(bh, 1);
+ }
+
+ /* create inode */
+ memset(&inode, 0, sizeof(struct ext2_inode));
+ inode.i_mode = PED_CPU_TO_LE16(S_IFDIR | 0755);
+ inode.i_uid = 0;
+ inode.i_size = PED_CPU_TO_LE32(12 * fs->blocksize);
+ inode.i_atime = PED_CPU_TO_LE32(time(NULL));
+ inode.i_ctime = PED_CPU_TO_LE32(time(NULL));
+ inode.i_mtime = PED_CPU_TO_LE32(time(NULL));
+ inode.i_dtime = 0;
+ inode.i_gid = 0;
+ inode.i_links_count = PED_CPU_TO_LE16(2);
+ inode.i_blocks = PED_CPU_TO_LE32((12 * fs->blocksize) >> 9);
+ inode.i_flags = 0;
+ for (i=0;i<12;i++)
+ inode.i_block[i] = PED_CPU_TO_LE32(blocks[i]);
+
+ if (!ext2_write_inode(fs, 11, &inode))
+ return 0;
+ fs->gd[0].bg_used_dirs_count = PED_CPU_TO_LE16(
+ EXT2_GROUP_USED_DIRS_COUNT(fs->gd[0]) + 1);
+ fs->metadirty |= EXT2_META_GD;
+
+ return 1;
+}
+
+static int ext2_mkfs_create_root_inode(struct ext2_fs *fs)
+{
+ struct ext2_buffer_head *bh;
+ blk_t block;
+ struct ext2_inode inode;
+ int offset;
+
+ if (!(block = ext2_find_free_block(fs)))
+ return 0;
+ if (!ext2_set_block_state(fs, block, 1, 1))
+ return 0;
+
+ /* create directory entries */
+ bh = ext2_bcreate(fs, block);
+ memset(bh->data, 0, fs->blocksize);
+ offset = _set_dirent(bh->data, 0, fs->blocksize, 0,
+ EXT2_ROOT_INO, ".", EXT2_FT_DIR);
+ offset = _set_dirent(bh->data, offset, fs->blocksize, 0,
+ EXT2_ROOT_INO, "..", EXT2_FT_DIR);
+ offset = _set_dirent(bh->data, offset, fs->blocksize, 1,
+ 11, "lost+found", EXT2_FT_DIR);
+ bh->dirty = 1;
+ if (!ext2_brelse(bh, 1))
+ return 0;
+
+ /* create inode */
+ memset(&inode, 0, sizeof(struct ext2_inode));
+ inode.i_mode = PED_CPU_TO_LE16(S_IFDIR | 0755);
+ inode.i_uid = 0;
+ inode.i_size = PED_CPU_TO_LE32(fs->blocksize);
+ inode.i_atime = PED_CPU_TO_LE32(time(NULL));
+ inode.i_ctime = PED_CPU_TO_LE32(time(NULL));
+ inode.i_mtime = PED_CPU_TO_LE32(time(NULL));
+ inode.i_dtime = 0;
+ inode.i_gid = 0;
+ inode.i_links_count = PED_CPU_TO_LE16(3);
+ inode.i_blocks = PED_CPU_TO_LE32(fs->blocksize >> 9);
+ inode.i_flags = 0;
+ inode.i_block[0] = PED_CPU_TO_LE32(block);
+
+ if (!ext2_write_inode(fs, 2, &inode))
+ return 0;
+ fs->gd[0].bg_used_dirs_count = PED_CPU_TO_LE16 (
+ EXT2_GROUP_USED_DIRS_COUNT(fs->gd[0]) + 1);
+ fs->metadirty |= EXT2_META_GD;
+
+ return 1;
+}
+
+static int ext2_reserve_inodes(struct ext2_fs *fs)
+{
+ int i;
+
+ for (i=1;i<12;i++)
+ if (!ext2_set_inode_state(fs, i, 1, 1))
+ return 0;
+ return 1;
+}
+
+static int ext2_mkfs_init_sb (struct ext2_super_block *sb, blk_t numblocks,
+ int numgroups, int first_block,
+ int log_block_size, blk_t blocks_per_group,
+ int inodes_per_group, int sparse_sb,
+ int reserved_block_percentage)
+{
+ /* catch a bug in gcc 2.95.2 */
+ PED_ASSERT(numgroups != 0, return 0);
+
+ memset(sb, 0, 1024);
+
+ sb->s_inodes_count = PED_CPU_TO_LE32(numgroups * inodes_per_group);
+ sb->s_blocks_count = PED_CPU_TO_LE32(numblocks);
+ sb->s_r_blocks_count = PED_CPU_TO_LE32(((uint64_t)numblocks
+ * reserved_block_percentage) / 100);
+
+ /* hack: this get's inc'd as we go through each group in
+ * ext2_mkfs_write_meta()
+ */
+ sb->s_free_blocks_count = 0;
+ sb->s_free_inodes_count = PED_CPU_TO_LE32 (numgroups
+ * inodes_per_group);
+ sb->s_first_data_block = PED_CPU_TO_LE32(first_block);
+ sb->s_log_block_size = PED_CPU_TO_LE32(log_block_size - 10);
+ sb->s_log_frag_size = sb->s_log_block_size;
+ sb->s_blocks_per_group = PED_CPU_TO_LE32(blocks_per_group);
+ sb->s_frags_per_group = PED_CPU_TO_LE32(blocks_per_group);
+ sb->s_inodes_per_group = PED_CPU_TO_LE32(inodes_per_group);
+ sb->s_mtime = 0;
+ sb->s_wtime = 0;
+ sb->s_mnt_count = 0;
+ sb->s_max_mnt_count = PED_CPU_TO_LE16(30);
+ sb->s_magic = PED_CPU_TO_LE16(0xEF53);
+ sb->s_state = PED_CPU_TO_LE16(EXT2_VALID_FS);
+ sb->s_errors = PED_CPU_TO_LE16(EXT2_ERRORS_DEFAULT);
+ sb->s_minor_rev_level = 0;
+ sb->s_lastcheck = 0;
+ sb->s_checkinterval = 0;
+ sb->s_creator_os = 0;
+ sb->s_rev_level = PED_CPU_TO_LE32(1);
+ sb->s_def_resuid = 0;
+ sb->s_def_resgid = 0;
+ sb->s_first_ino = PED_CPU_TO_LE32(11);
+ sb->s_inode_size = PED_CPU_TO_LE16(128);
+ sb->s_block_group_nr = 0;
+ sb->s_feature_compat = 0;
+ sb->s_feature_incompat = 0;
+ sb->s_feature_ro_compat = 0;
+ if (sparse_sb)
+ sb->s_feature_ro_compat
+ |= PED_CPU_TO_LE32(EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER);
+
+/* FIXME: let the user decide? _set_dirent() assumes FILETYPE */
+ sb->s_feature_incompat
+ |= PED_CPU_TO_LE32(EXT2_FEATURE_INCOMPAT_FILETYPE);
+
+ uuid_generate(sb->s_uuid);
+ memset(sb->s_volume_name, 0, 16);
+ memset(sb->s_last_mounted, 0, 64);
+ sb->s_algorithm_usage_bitmap = 0;
+ sb->s_prealloc_blocks = 0;
+ sb->s_prealloc_dir_blocks = 0;
+ sb->s_padding1 = 0;
+
+ return 1;
+}
+
+struct ext2_fs *ext2_mkfs(struct ext2_dev_handle *handle,
+ blk_t numblocks,
+ int log_block_size,
+ blk_t blocks_per_group,
+ int inodes_per_group,
+ int sparse_sb,
+ int reserved_block_percentage,
+ PedTimer* timer)
+{
+ struct ext2_fs *fs;
+ struct ext2_super_block sb;
+ struct ext2_group_desc *gd;
+ int numgroups;
+ int first_block;
+ int non_sparse_admin;
+ int sparse_admin;
+ int last_group_blocks;
+ int last_group_admin;
+
+ /* if the FS is > 512Mb, use 4k blocks, otherwise 1k blocks */
+ if (log_block_size == 0) {
+ handle->ops->set_blocksize(handle->cookie, 12);
+ if (handle->ops->get_size(handle->cookie) > (512 * 1024))
+ log_block_size = 12;
+ else
+ log_block_size = 10;
+ }
+
+ /* FIXME: block size must be > MAX(logicalbs, physicalbs)
+ * to avoid modify-on-write.
+ * -- Leslie
+ */
+
+
+ handle->ops->set_blocksize(handle->cookie, log_block_size);
+
+ if (numblocks == 0)
+ numblocks = handle->ops->get_size(handle->cookie);
+
+ if (blocks_per_group == (unsigned int) 0)
+ blocks_per_group = 8 << log_block_size;
+
+ first_block = (log_block_size == 10) ? 1 : 0;
+
+ numgroups = ped_div_round_up (numblocks
+ - first_block, blocks_per_group);
+
+ if (inodes_per_group == 0)
+ inodes_per_group = ped_round_up_to (
+ numblocks / numgroups / 2,
+ (1 << log_block_size) / sizeof(struct ext2_inode));
+
+ if (sparse_sb == -1)
+ sparse_sb = 1;
+
+ /* FIXME: 5% not appropriate for modern drive sizes */
+ if (reserved_block_percentage == -1)
+ reserved_block_percentage = 5;
+
+ last_group_blocks = (numblocks - first_block) % blocks_per_group;
+ if (!last_group_blocks) last_group_blocks = blocks_per_group;
+ non_sparse_admin = 2
+ + inodes_per_group * sizeof(struct ext2_inode)
+ / (1 << log_block_size);
+ sparse_admin = non_sparse_admin
+ + ped_div_round_up (numgroups
+ * sizeof(struct ext2_group_desc),
+ 1 << log_block_size);
+ last_group_admin = is_group_sparse(sparse_sb, numgroups - 1)
+ ? sparse_admin : non_sparse_admin;
+ if (last_group_admin >= last_group_blocks) {
+ numgroups--;
+ numblocks -= last_group_blocks;
+ }
+ if (!numgroups
+ || (numgroups == 1
+ && (last_group_blocks - last_group_admin < 8
+ || inodes_per_group < 16))) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("File system too small for ext2."));
+ goto error;
+ }
+
+ gd = ped_malloc(numgroups * sizeof(struct ext2_group_desc)
+ + (1 << log_block_size));
+ if (!gd)
+ goto error;
+
+ if (!ext2_mkfs_init_sb(&sb, numblocks, numgroups, first_block,
+ log_block_size, blocks_per_group,
+ inodes_per_group, sparse_sb,
+ reserved_block_percentage))
+ goto error_free_gd;
+ if (!ext2_mkfs_write_meta(handle, &sb, gd, timer))
+ goto error_free_gd;
+ if (!ext2_mkfs_write_main(handle, &sb, gd))
+ goto error_free_gd;
+
+ fs = ext2_open(handle, 0);
+ if (!fs) goto error_close_fs;
+ if (!ext2_reserve_inodes(fs)) goto error_close_fs;
+ if (!ext2_mkfs_create_root_inode(fs)) goto error_close_fs;
+ if (!ext2_mkfs_create_lost_and_found_inode(fs))
+ goto error_close_fs;
+ if (!ext2_sync(fs)) goto error_close_fs;
+ ped_free(gd);
+ return fs;
+
+error_close_fs:
+ ext2_close(fs);
+error_free_gd:
+ ped_free (gd);
+error:
+ return NULL;
+}
+#endif /* !DISCOVER_ONLY */
diff --git a/libparted/fs/ext2/ext2_resize.c b/libparted/fs/ext2/ext2_resize.c
new file mode 100644
index 0000000..54899f7
--- /dev/null
+++ b/libparted/fs/ext2/ext2_resize.c
@@ -0,0 +1,734 @@
+/*
+ ext2_resize.c -- ext2 resizer
+ Copyright (C) 1998-2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+
+#ifndef DISCOVER_ONLY
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "ext2.h"
+
+static int ext2_add_group(struct ext2_fs *fs, blk_t groupsize)
+{
+ blk_t admin;
+ int group;
+ blk_t groupstart;
+ blk_t newgdblocks;
+ int sparse;
+
+ if (fs->opt_verbose)
+ fprintf(stderr, "ext2_add_group\n");
+
+ if (!ped_realloc ((void*) &fs->gd,
+ (fs->numgroups+1) * sizeof(struct ext2_group_desc)
+ + fs->blocksize))
+ return 0;
+
+ if (fs->opt_debug)
+ {
+ if (EXT2_SUPER_BLOCKS_COUNT(fs->sb) !=
+ EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb)
+ + fs->numgroups * EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb))
+ {
+ fprintf(stderr,
+ "ext2_add_group: last (existing) group "
+ "isn't complete!\n");
+
+ return 0;
+ }
+ }
+
+ group = fs->numgroups;
+ sparse = ext2_is_group_sparse(fs, group);
+ groupstart = EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb)
+ + group * EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb);
+
+ admin = fs->adminblocks;
+ if (!sparse)
+ admin -= fs->gdblocks + 1;
+
+ if (fs->opt_debug)
+ {
+ if (groupsize < fs->adminblocks ||
+ groupsize > EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb))
+ {
+ fprintf(stderr,
+ "ext2_add_group: groups of %i blocks are "
+ "impossible!\n", groupsize);
+
+ return 0;
+ }
+ }
+
+ newgdblocks = ped_div_round_up((fs->numgroups + 1)
+ * sizeof(struct ext2_group_desc),
+ fs->blocksize);
+ if (newgdblocks != fs->gdblocks)
+ {
+ int i;
+
+ for (i=0;i<fs->numgroups;i++)
+ if (ext2_is_group_sparse(fs, i))
+ {
+ blk_t start;
+
+ start = EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb)
+ + i * EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb);
+ ext2_set_block_state(fs,
+ start + fs->gdblocks + 1, 1, 1);
+ }
+
+ fs->gdblocks++;
+ fs->adminblocks++;
+ if (sparse)
+ admin++;
+ }
+
+ fs->numgroups++;
+
+ fs->sb.s_inodes_count = PED_CPU_TO_LE32(
+ EXT2_SUPER_INODES_COUNT(fs->sb)
+ + EXT2_SUPER_INODES_PER_GROUP(fs->sb));
+ fs->sb.s_blocks_count = PED_CPU_TO_LE32(
+ EXT2_SUPER_BLOCKS_COUNT(fs->sb) + groupsize);
+ fs->sb.s_free_blocks_count = PED_CPU_TO_LE32(
+ EXT2_SUPER_FREE_BLOCKS_COUNT(fs->sb) + groupsize - admin);
+ fs->sb.s_free_inodes_count = PED_CPU_TO_LE32(
+ EXT2_SUPER_FREE_INODES_COUNT(fs->sb)
+ + EXT2_SUPER_INODES_PER_GROUP(fs->sb));
+ fs->metadirty |= EXT2_META_SB;
+
+ {
+ blk_t off;
+ blk_t sparseoff;
+
+ off = groupstart;
+ sparseoff = off + fs->itoffset - 2;
+
+ if (sparse)
+ {
+ fs->gd[group].bg_block_bitmap
+ = PED_CPU_TO_LE32(sparseoff);
+ fs->gd[group].bg_inode_bitmap
+ = PED_CPU_TO_LE32(sparseoff + 1);
+ }
+ else
+ {
+ fs->gd[group].bg_block_bitmap
+ = PED_CPU_TO_LE32(off);
+ fs->gd[group].bg_inode_bitmap
+ = PED_CPU_TO_LE32(off + 1);
+ }
+
+ /* Hey, I don't know _why_ either */
+ fs->gd[group].bg_inode_table = PED_CPU_TO_LE32(sparseoff + 2);
+ }
+
+ fs->gd[group].bg_free_blocks_count = PED_CPU_TO_LE16(groupsize - admin);
+ fs->gd[group].bg_free_inodes_count = PED_CPU_TO_LE16(
+ EXT2_SUPER_INODES_PER_GROUP(fs->sb));
+ fs->gd[group].bg_used_dirs_count = 0;
+ fs->metadirty |= EXT2_META_SB | EXT2_META_GD;
+
+ {
+ struct ext2_buffer_head *bh;
+ blk_t i;
+
+ bh = ext2_bcreate(fs, EXT2_GROUP_BLOCK_BITMAP(fs->gd[group]));
+ if (!bh)
+ return 0;
+
+ if (sparse)
+ {
+ bh->data[0] |= _bitmap[0];
+ for (i=1;i<=fs->gdblocks;i++)
+ bh->data[i>>3] |= _bitmap[i&7];
+ }
+
+ i = EXT2_GROUP_BLOCK_BITMAP(fs->gd[group]) - groupstart;
+ bh->data[i>>3] |= _bitmap[i&7];
+
+ i = EXT2_GROUP_INODE_BITMAP(fs->gd[group]) - groupstart;
+ bh->data[i>>3] |= _bitmap[i&7];
+
+ for (i=0;i<fs->inodeblocks;i++)
+ {
+ blk_t j;
+
+ j = EXT2_GROUP_INODE_TABLE(fs->gd[group])
+ - groupstart + i;
+ bh->data[j>>3] |= _bitmap[j&7];
+ }
+
+ for (i=groupsize;i<EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb);i++)
+ bh->data[i>>3] |= _bitmap[i&7];
+
+ ext2_brelse(bh, 0); /* this is a block bitmap */
+ }
+
+ if (!ext2_zero_blocks(fs, EXT2_GROUP_INODE_BITMAP(fs->gd[group]), 1))
+ return 0;
+ if (!ext2_zero_blocks(fs, EXT2_GROUP_INODE_TABLE(fs->gd[group]),
+ fs->inodeblocks))
+ return 0;
+
+ if (fs->opt_safe)
+ if (!ext2_sync(fs))
+ return 0;
+
+ return 1;
+}
+
+static int ext2_del_group(struct ext2_fs *fs)
+{
+ blk_t admin;
+ int group;
+ blk_t groupsize;
+ blk_t newgdblocks;
+ int sparse;
+
+ if (fs->opt_verbose)
+ fprintf(stderr, "ext2_del_group\n");
+
+ group = fs->numgroups - 1;
+ sparse = ext2_is_group_sparse(fs, group);
+
+ admin = fs->adminblocks;
+ if (!sparse)
+ admin -= fs->gdblocks + 1;
+
+ groupsize = EXT2_SUPER_BLOCKS_COUNT(fs->sb)
+ - EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb)
+ - group * EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb);
+
+ if (EXT2_SUPER_FREE_BLOCKS_COUNT(fs->sb) < groupsize - admin)
+ {
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("File system is too full to remove a group!"));
+
+ return 0;
+ }
+
+ if (EXT2_SUPER_FREE_INODES_COUNT(fs->sb)
+ < EXT2_SUPER_INODES_PER_GROUP(fs->sb))
+ {
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("File system has too many allocated inodes to "
+ "remove a group!"));
+ return 0;
+ }
+
+ if (fs->opt_debug)
+ {
+ if (EXT2_GROUP_FREE_INODES_COUNT(fs->gd[group]) !=
+ EXT2_SUPER_INODES_PER_GROUP(fs->sb))
+ {
+ fprintf(stderr,
+ "ext2_del_group: this should not "
+ "happen anymore!\n");
+
+ return 0;
+ }
+ }
+
+ newgdblocks = ped_div_round_up((fs->numgroups - 1) *
+ sizeof(struct ext2_group_desc), fs->blocksize);
+
+ if (newgdblocks != fs->gdblocks)
+ {
+ int i;
+
+ for (i=0;i<fs->numgroups;i++)
+ if (ext2_is_group_sparse(fs, i))
+ {
+ blk_t start;
+
+ start = EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb) +
+ i * EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb);
+ ext2_set_block_state(fs,
+ start + fs->gdblocks,
+ 0, 1);
+ }
+
+ fs->gdblocks--;
+ fs->adminblocks--;
+ if (sparse)
+ admin--;
+ }
+
+ if (fs->opt_debug)
+ {
+ if (EXT2_GROUP_FREE_BLOCKS_COUNT(fs->gd[group])
+ != groupsize - admin)
+ {
+ blk_t i;
+ blk_t num;
+ blk_t offset;
+
+ offset = EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb) +
+ group * EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb);
+ num = EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb);
+
+ for (i=0;i<num;i++)
+ if (ext2_is_data_block(fs, offset+i) &&
+ ext2_get_block_state(fs, offset+i))
+ {
+ fprintf(stderr,
+ "error: block relocator "
+ "should have relocated "
+ "%i\n",
+ offset+i);
+
+ return 0;
+ }
+ }
+ }
+
+ fs->numgroups--;
+
+ fs->sb.s_inodes_count = PED_CPU_TO_LE32(
+ EXT2_SUPER_INODES_COUNT(fs->sb)
+ - EXT2_SUPER_INODES_PER_GROUP(fs->sb));
+ fs->sb.s_blocks_count = PED_CPU_TO_LE32(
+ EXT2_SUPER_BLOCKS_COUNT(fs->sb) - groupsize);
+ fs->sb.s_free_blocks_count = PED_CPU_TO_LE32(
+ EXT2_SUPER_FREE_BLOCKS_COUNT(fs->sb) - (groupsize - admin));
+ fs->sb.s_free_inodes_count = PED_CPU_TO_LE32(
+ EXT2_SUPER_FREE_INODES_COUNT(fs->sb)
+ - EXT2_SUPER_INODES_PER_GROUP(fs->sb));
+ fs->metadirty |= EXT2_META_SB;
+
+ if (fs->opt_safe)
+ ext2_sync(fs);
+
+ ped_realloc ((void*) &fs->gd,
+ fs->numgroups * sizeof(struct ext2_group_desc)
+ + fs->blocksize);
+
+ return 1;
+}
+
+static int ext2_grow_group(struct ext2_fs *fs, blk_t newsize)
+{
+ int group;
+ blk_t groupoff;
+ blk_t gblocks;
+ blk_t i;
+
+ if (fs->opt_verbose)
+ fprintf(stderr, "ext2_grow_group\n");
+
+ group = fs->numgroups - 1;
+ groupoff = group * EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb)
+ + EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb);
+ gblocks = EXT2_SUPER_BLOCKS_COUNT(fs->sb) - groupoff;
+
+ if (fs->opt_debug)
+ {
+ if (newsize < gblocks)
+ {
+ fprintf(stderr,
+ "ext2_grow_group: called to shrink group!\n");
+
+ return 0;
+ }
+
+ if (gblocks == newsize)
+ {
+ fprintf(stderr, "ext2_grow_group: nothing to do!\n");
+ return 0;
+ }
+ }
+
+ for (i=gblocks;i<newsize;i++)
+ ext2_set_block_state(fs, groupoff + i, 0, 1);
+
+ fs->sb.s_blocks_count = PED_CPU_TO_LE32(
+ EXT2_SUPER_BLOCKS_COUNT(fs->sb) + newsize - gblocks);
+ fs->metadirty |= EXT2_META_SB;
+
+ if (fs->opt_safe)
+ ext2_sync(fs);
+
+ return 1;
+}
+
+static int ext2_shrink_group(struct ext2_fs *fs, blk_t newsize)
+{
+ blk_t admin;
+ int group;
+ blk_t groupoff;
+ blk_t gblocks;
+ blk_t i;
+
+ if (fs->opt_verbose)
+ fprintf(stderr, "ext2_shrink_group\n");
+
+ group = fs->numgroups - 1;
+
+ admin = fs->adminblocks;
+ if (!ext2_is_group_sparse(fs, group))
+ admin -= fs->gdblocks + 1;
+
+ groupoff = group * EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb)
+ + EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb);
+ gblocks = EXT2_SUPER_BLOCKS_COUNT(fs->sb) - groupoff;
+
+ if (fs->opt_debug)
+ {
+ if (newsize < admin)
+ {
+ fprintf(stderr,
+ "ext2_shrink_group: cant shrink a group "
+ "to %i blocks\n", newsize);
+
+ return 0;
+ }
+
+ if (newsize > gblocks)
+ {
+ fprintf(stderr,
+ "ext2_shrink_group: called to grow group!\n");
+
+ return 0;
+ }
+
+ if (gblocks == newsize)
+ {
+ fprintf(stderr,
+ "ext2_shrink_group: nothing to do!\n");
+
+ return 0;
+ }
+ }
+
+ for (i=newsize;i<gblocks;i++)
+ {
+ if (fs->opt_debug && ext2_get_block_state(fs, groupoff + i))
+ {
+ fprintf(stderr,
+ "error: block relocator should have relocated "
+ "%i\n",
+ groupoff + i);
+
+ return 0;
+ }
+
+ ext2_set_block_state(fs, groupoff + i, 1, 0);
+ }
+
+ i = gblocks - newsize;
+ fs->sb.s_blocks_count = PED_CPU_TO_LE32(
+ EXT2_SUPER_BLOCKS_COUNT(fs->sb) - i);
+ fs->sb.s_free_blocks_count = PED_CPU_TO_LE32(
+ EXT2_SUPER_FREE_BLOCKS_COUNT(fs->sb) - i);
+ fs->gd[group].bg_free_blocks_count = PED_CPU_TO_LE16(
+ EXT2_GROUP_FREE_BLOCKS_COUNT(fs->gd[group]) - i);
+
+ fs->metadirty |= EXT2_META_SB | EXT2_META_GD;
+
+ if (fs->opt_safe)
+ ext2_sync(fs);
+
+ return 1;
+}
+
+
+
+
+
+
+static int ext2_grow_fs(struct ext2_fs *fs, blk_t newsize, PedTimer* timer)
+{
+ blk_t diff;
+ blk_t sizelast;
+ blk_t origsize = EXT2_SUPER_BLOCKS_COUNT(fs->sb);
+
+ if (fs->opt_verbose)
+ fprintf(stderr, "ext2_grow_fs\n");
+
+ if (!ext2_block_relocate(fs, newsize))
+ return 0;
+
+ if (!ext2_metadata_push(fs, newsize))
+ return 0;
+
+ diff = newsize - EXT2_SUPER_BLOCKS_COUNT(fs->sb);
+ sizelast = EXT2_SUPER_BLOCKS_COUNT(fs->sb)
+ - EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb)
+ - (fs->numgroups-1) * EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb);
+
+ if (sizelast != EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb))
+ {
+ blk_t growto;
+
+ growto = sizelast + diff;
+ if (growto > EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb))
+ growto = EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb);
+
+ if (!ext2_grow_group(fs, growto))
+ return 0;
+
+ diff -= growto - sizelast;
+ }
+
+ ped_timer_reset (timer);
+ ped_timer_set_state_name (timer, _("adding groups"));
+
+ while (diff)
+ {
+ ped_timer_update (timer,
+ 1.0 - 1.0 * diff / (newsize - origsize));
+
+ sizelast = PED_MIN(diff, EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb));
+ if (!ext2_add_group(fs, sizelast))
+ return 0;
+
+ diff -= sizelast;
+ }
+
+ ped_timer_update (timer, 1.0);
+
+ return 1;
+}
+
+static int ext2_shrink_fs(struct ext2_fs *fs, blk_t newsize,
+ PedTimer* timer)
+{
+ blk_t origsize = EXT2_SUPER_BLOCKS_COUNT (fs->sb);
+ blk_t diff;
+ int newgroups;
+ blk_t sizelast;
+
+ if (fs->opt_verbose)
+ fprintf(stderr, "ext2_shrink_fs\n");
+
+ newgroups = ped_div_round_up (newsize
+ - EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb),
+ EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb));
+ if (EXT2_SUPER_BLOCKS_COUNT(fs->sb)
+ - EXT2_SUPER_FREE_BLOCKS_COUNT(fs->sb) > newsize)
+ {
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("Your file system is too full to resize it to %i "
+ "blocks. Sorry."), newsize);
+ return 0;
+ }
+
+ if (EXT2_SUPER_INODES_COUNT(fs->sb)
+ - EXT2_SUPER_FREE_INODES_COUNT(fs->sb)
+ > newgroups * EXT2_SUPER_INODES_PER_GROUP(fs->sb))
+ {
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("Your file system has too many occupied inodes to "
+ "resize it to %i blocks. Sorry."), newsize);
+ return 0;
+ }
+
+ if (!ext2_inode_relocate(fs, newgroups))
+ return 0;
+
+ if (!ext2_block_relocate(fs, newsize))
+ return 0;
+
+ diff = EXT2_SUPER_BLOCKS_COUNT(fs->sb) - newsize;
+
+ ped_timer_reset (timer);
+ ped_timer_set_state_name (timer, _("shrinking"));
+
+ while (diff > 0)
+ {
+ ped_timer_update (timer,
+ 1.0 - 1.0 * diff / (origsize - newsize));
+
+ sizelast = EXT2_SUPER_BLOCKS_COUNT(fs->sb)
+ - EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb) -
+ (fs->numgroups - 1)
+ * EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb);
+
+ if (diff < sizelast)
+ {
+ if (!ext2_shrink_group(fs, sizelast - diff))
+ return 0;
+
+ diff = 0;
+ }
+ else
+ {
+ if (!ext2_del_group(fs))
+ return 0;
+
+ diff -= sizelast;
+ }
+ }
+
+ ped_timer_update (timer, 1.0);
+
+ return 1;
+}
+
+int ext2_determine_itoffset(struct ext2_fs *fs)
+{
+ int i;
+
+ fs->itoffset = EXT2_GROUP_INODE_TABLE(fs->gd[0])
+ - EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb);
+
+ /*PED_DEBUG (0x20, "itoffset is %d", fs->itoffset);
+
+ PED_DEBUG (0x20, "walking %d groups", fs->numgroups);*/
+
+ for (i=0;i<fs->numgroups;i++)
+ {
+ blk_t start;
+ blk_t bb;
+ blk_t ib;
+ blk_t it;
+
+ start = EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb)
+ + (i * EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb));
+ it = start + fs->itoffset;
+
+ /*PED_DEBUG (0x21, "start = %d, it = %d", start, it);*/
+
+ if (ext2_is_group_sparse(fs, i))
+ {
+ /*PED_DEBUG (0x21, "%d has a superblock copy", i);*/
+ bb = it - 2;
+ ib = it - 1;
+ }
+ else
+ {
+ /*PED_DEBUG (0x21, "%d doesn't have a superblock copy",
+ i);*/
+ bb = start;
+ ib = start + 1;
+ }
+
+ if (EXT2_GROUP_BLOCK_BITMAP(fs->gd[i]) != bb ||
+ EXT2_GROUP_INODE_BITMAP(fs->gd[i]) != ib ||
+ EXT2_GROUP_INODE_TABLE(fs->gd[i]) != it)
+ {
+ /* ped_exception_throw (PED_EXCEPTION_NO_FEATURE,
+ PED_EXCEPTION_CANCEL,
+ _("This ext2 file system has a rather strange layout! "
+ "Parted can't resize this (yet)."));*/
+
+ /* PED_DEBUG (0x21, "calculated block bitmap to be %d, "
+ "but fs says %d.", bb,
+ EXT2_GROUP_BLOCK_BITMAP(fs->gd[i]));
+ PED_DEBUG (0x21, "calculated inode bitmap to be %d, "
+ "but fs says %d.", ib,
+ EXT2_GROUP_INODE_BITMAP(fs->gd[i]));
+ PED_DEBUG (0x21, "calculated inode table to be %d, "
+ "but fs says %d.", it,
+ EXT2_GROUP_INODE_TABLE(fs->gd[i]));*/
+
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
+int ext2_resize_fs(struct ext2_fs *fs, blk_t newsize, PedTimer* timer)
+{
+ blk_t residue;
+ int status;
+
+ if (EXT2_SUPER_STATE(fs->sb) & EXT2_ERROR_FS)
+ {
+ ped_exception_throw (
+ PED_EXCEPTION_WARNING, PED_EXCEPTION_CANCEL,
+ _("File system has errors! You should run e2fsck."));
+ return 0;
+ }
+
+ if (!(EXT2_SUPER_STATE(fs->sb) & EXT2_VALID_FS))
+ {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("File system was not cleanly unmounted! "
+ "You should run e2fsck."));
+ return 0;
+ }
+
+ if (EXT2_SUPER_FEATURE_COMPAT(fs->sb)
+ & EXT2_FEATURE_COMPAT_HAS_DIR_INDEX) {
+ if (ped_exception_throw (
+ PED_EXCEPTION_WARNING, PED_EXCEPTION_IGNORE_CANCEL,
+ _("The file system has the 'dir_index' feature "
+ "enabled. Parted can only resize the file system "
+ "if it disables this feature. You can enable it "
+ "later by running 'tune2fs -O dir_index DEVICE' "
+ "and then 'e2fsck -fD DEVICE'."))
+ != PED_EXCEPTION_IGNORE)
+ return 0;
+ fs->sb.s_feature_compat
+ = PED_CPU_TO_LE32(EXT2_SUPER_FEATURE_COMPAT(fs->sb)
+ & ~EXT2_FEATURE_COMPAT_HAS_DIR_INDEX);
+ fs->metadirty |= EXT2_META_SB;
+ }
+
+ if (!ext2_determine_itoffset(fs) && ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_OK_CANCEL,
+ _("A resize operation on this file system will "
+ "use EXPERIMENTAL code\n"
+ "that MAY CORRUPT it (although it hasn't done"
+ "so yet\n"
+ "in the past).\n"
+ "You should at least backup your data and "
+ "run 'e2fsck -f' afterwards."))
+ == PED_EXCEPTION_CANCEL)
+ {
+ return 0;
+ }
+
+ if (fs->opt_verbose)
+ fprintf(stderr, "ext2_resize_fs\n");
+
+ residue = (newsize - EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb))
+ % EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb);
+ if (residue && residue <= fs->adminblocks)
+ newsize -= residue;
+
+ if (newsize == EXT2_SUPER_BLOCKS_COUNT(fs->sb))
+ return 1;
+
+ fs->relocator_pool
+ = (unsigned char *)ped_malloc(ext2_relocator_pool_size << 10);
+ if (!fs->relocator_pool)
+ return 0;
+ fs->relocator_pool_end
+ = fs->relocator_pool + (ext2_relocator_pool_size << 10);
+
+ if (newsize < EXT2_SUPER_BLOCKS_COUNT(fs->sb))
+ status = ext2_shrink_fs(fs, newsize, timer);
+ else
+ status = ext2_grow_fs(fs, newsize, timer);
+
+ ped_free(fs->relocator_pool);
+ fs->relocator_pool = NULL;
+ fs->relocator_pool_end = NULL;
+
+ return status;
+}
+#endif /* !DISCOVER_ONLY */
diff --git a/libparted/fs/ext2/interface.c b/libparted/fs/ext2/interface.c
new file mode 100644
index 0000000..7b48f4c
--- /dev/null
+++ b/libparted/fs/ext2/interface.c
@@ -0,0 +1,355 @@
+/*
+ interface.c -- parted binding glue to libext2resize
+ Copyright (C) 1998-2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+/* VERSION: libext2resize 1.1.6 (by Lennert)
+ * merged 1.1.11 changes (by Andrew)
+ */
+
+#include "config.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <parted/parted.h>
+#include "ext2.h"
+#include "parted_io.h"
+
+static PedFileSystemType _ext2_type;
+static PedFileSystemType _ext3_type;
+
+struct ext2_dev_handle* ext2_make_dev_handle_from_parted_geometry(PedGeometry* geom);
+
+static PedGeometry*
+_ext2_generic_probe (PedGeometry* geom, int expect_ext3)
+{
+ struct ext2_super_block sb;
+
+ if (!ped_geometry_read(geom, &sb, 2, 2))
+ return NULL;
+
+ if (EXT2_SUPER_MAGIC(sb) == EXT2_SUPER_MAGIC_CONST) {
+ PedSector block_size = 1 << (EXT2_SUPER_LOG_BLOCK_SIZE(sb) + 1);
+ PedSector block_count = EXT2_SUPER_BLOCKS_COUNT(sb);
+ PedSector group_blocks = EXT2_SUPER_BLOCKS_PER_GROUP(sb);
+ PedSector group_nr = EXT2_SUPER_BLOCK_GROUP_NR(sb);
+ PedSector first_data_block = EXT2_SUPER_FIRST_DATA_BLOCK(sb);
+ int version = EXT2_SUPER_REV_LEVEL(sb);
+ int is_ext3 = (EXT2_SUPER_FEATURE_COMPAT(sb)
+ & EXT3_FEATURE_COMPAT_HAS_JOURNAL) != 0;
+
+ if (expect_ext3 != is_ext3)
+ return NULL;
+
+ if (version > 0 && group_nr > 0) {
+ PedSector start;
+ PedGeometry probe_geom;
+
+ start = geom->start
+ - group_blocks * group_nr
+ - first_data_block;
+
+ if (start < 0)
+ return NULL;
+ ped_geometry_init (&probe_geom, geom->dev,
+ start, block_count * block_size);
+ return _ext2_generic_probe (&probe_geom, expect_ext3);
+ } else {
+ return ped_geometry_new (geom->dev, geom->start,
+ block_count * block_size);
+ }
+ }
+ return NULL;
+}
+
+static PedGeometry*
+_ext2_probe (PedGeometry* geom)
+{
+ return _ext2_generic_probe (geom, 0);
+}
+
+static PedGeometry*
+_ext3_probe (PedGeometry* geom)
+{
+ return _ext2_generic_probe (geom, 1);
+}
+
+#ifndef DISCOVER_ONLY
+static int
+_ext2_clobber (PedGeometry* geom)
+{
+ struct ext2_super_block sb;
+
+ if (!ped_geometry_read(geom, &sb, 2, 2))
+ return 0;
+ if (EXT2_SUPER_MAGIC(sb) != EXT2_SUPER_MAGIC_CONST)
+ return 1;
+
+ sb.s_magic = 0;
+ return ped_geometry_write(geom, &sb, 2, 2);
+}
+
+static PedFileSystem*
+_ext2_open (PedGeometry* geom)
+{
+ PedFileSystem* fs;
+ struct ext2_fs* fs_info;
+ struct ext2_dev_handle* handle;
+
+ fs = (PedFileSystem*) ped_malloc (sizeof (PedFileSystem));
+ if (!fs) goto error;
+
+ fs->type = &_ext2_type;
+ fs->geom = ped_geometry_duplicate (geom);
+ fs->checked = 1;
+
+ handle = ext2_make_dev_handle_from_parted_geometry(fs->geom);
+ if (!handle) goto error_free_fs;
+
+ fs_info = (struct ext2_fs*) ext2_open(handle, 0);
+ if (!fs_info) goto error_free_handle;
+
+ fs->type_specific = (void*) fs_info;
+ fs_info->opt_verbose = 0;
+
+ return fs;
+
+error_free_handle:
+ ext2_destroy_dev_handle(handle);
+error_free_fs:
+ ped_free(fs);
+error:
+ return NULL;
+}
+
+static PedFileSystem*
+_ext2_create (PedGeometry* geom, PedTimer* timer)
+{
+ PedFileSystem* fs;
+ struct ext2_fs* fs_info;
+ struct ext2_dev_handle* handle;
+
+ fs = (PedFileSystem*) ped_malloc (sizeof (PedFileSystem));
+ if (!fs) goto error;
+
+ fs->type = &_ext2_type;
+ fs->geom = ped_geometry_duplicate (geom);
+
+ handle = ext2_make_dev_handle_from_parted_geometry(fs->geom);
+ if (!handle) goto error_free_fs;
+
+ fs_info = ext2_mkfs (handle, 0, 0, 0, 0, -1, -1, timer);
+ if (!fs_info) goto error_free_handle;
+
+ fs->type_specific = (void*) fs_info;
+ fs_info->opt_verbose = 0;
+
+ return fs;
+
+error_free_handle:
+ ext2_destroy_dev_handle(handle);
+error_free_fs:
+ ped_free(fs);
+error:
+ return NULL;
+}
+
+static int
+_ext2_close (PedFileSystem *fs)
+{
+ struct ext2_dev_handle* handle;
+
+ handle = ((struct ext2_fs*)fs->type_specific)->devhandle;
+ ext2_close(fs->type_specific);
+ ext2_destroy_dev_handle(handle);
+
+ ped_free(fs);
+ return 1;
+}
+
+static int
+_ext2_check (PedFileSystem *fs, PedTimer* timer)
+{
+ ped_exception_throw (PED_EXCEPTION_INFORMATION, PED_EXCEPTION_OK,
+ _("The ext2 file system passed a basic check. For a more "
+ "comprehensive check, use the e2fsck program."));
+ return 1;
+}
+
+static int
+_ext2_resize (PedFileSystem* fs, PedGeometry* geom, PedTimer* timer)
+{
+ struct ext2_fs* f;
+ PedSector old_length = fs->geom->length;
+
+ PED_ASSERT (fs->geom->dev == geom->dev, return 0);
+
+ if (fs->geom->start != geom->start)
+ {
+ ped_exception_throw (PED_EXCEPTION_NO_FEATURE,
+ PED_EXCEPTION_CANCEL,
+ _("Sorry, can't move the start of ext2 partitions yet!"));
+ return 0;
+ }
+
+ geom->dev->boot_dirty = 1;
+
+ f = (struct ext2_fs *) fs->type_specific;
+
+/* ensure that the geometry contains the new and old geometry */
+ if (old_length > geom->length) {
+ if (!ext2_resize_fs(f, geom->length >> (f->logsize - 9),
+ timer))
+ goto error;
+
+ fs->geom->length = geom->length;
+ fs->geom->end = fs->geom->start + geom->length - 1;
+ } else {
+ fs->geom->length = geom->length;
+ fs->geom->end = fs->geom->start + geom->length - 1;
+
+ if (!ext2_resize_fs(f, geom->length >> (f->logsize - 9),
+ timer))
+ goto error;
+ }
+ return 1;
+
+error:
+ return 0;
+}
+
+static PedConstraint*
+_ext2_get_create_constraint (const PedDevice* dev)
+{
+ PedGeometry full_dev;
+
+ if (!ped_geometry_init (&full_dev, dev, 0, dev->length - 1))
+ return NULL;
+
+ return ped_constraint_new (
+ ped_alignment_any, ped_alignment_any,
+ &full_dev, &full_dev,
+ 64, dev->length);
+}
+
+static PedConstraint*
+_ext2_get_resize_constraint (const PedFileSystem* fs)
+{
+ struct ext2_fs* f = (struct ext2_fs *) fs->type_specific;
+ PedDevice* dev = fs->geom->dev;
+ PedAlignment start_align;
+ PedGeometry start_sector;
+ PedGeometry full_dev;
+ PedSector min_size;
+
+ if (!ped_alignment_init (&start_align, fs->geom->start, 0))
+ return NULL;
+ if (!ped_geometry_init (&full_dev, dev, 0, dev->length - 1))
+ return NULL;
+ if (!ped_geometry_init (&start_sector, dev, fs->geom->start, 1))
+ return NULL;
+ min_size = (EXT2_SUPER_BLOCKS_COUNT(f->sb)
+ - EXT2_SUPER_FREE_BLOCKS_COUNT(f->sb))
+ * (f->blocksize / dev->sector_size);
+
+ return ped_constraint_new (&start_align, ped_alignment_any,
+ &start_sector, &full_dev, min_size,
+ dev->length);
+}
+#endif /* !DISCOVER_ONLY */
+
+static PedFileSystemOps _ext2_ops = {
+ probe: _ext2_probe,
+#ifndef DISCOVER_ONLY
+ clobber: _ext2_clobber,
+ open: _ext2_open,
+ create: _ext2_create,
+ close: _ext2_close,
+ check: _ext2_check,
+ resize: _ext2_resize,
+ copy: NULL,
+ get_create_constraint: _ext2_get_create_constraint,
+ get_copy_constraint: NULL,
+ get_resize_constraint: _ext2_get_resize_constraint
+#else /* !DISCOVER_ONLY */
+ clobber: NULL,
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ resize: NULL,
+ copy: NULL,
+ get_create_constraint: NULL,
+ get_copy_constraint: NULL,
+ get_resize_constraint: NULL
+#endif /* !DISCOVER_ONLY */
+};
+
+static PedFileSystemOps _ext3_ops = {
+ probe: _ext3_probe,
+#ifndef DISCOVER_ONLY
+ clobber: _ext2_clobber,
+ open: _ext2_open,
+ create: NULL,
+ close: _ext2_close,
+ check: _ext2_check,
+ resize: _ext2_resize,
+ copy: NULL,
+ get_create_constraint: _ext2_get_create_constraint,
+ get_copy_constraint: NULL,
+ get_resize_constraint: _ext2_get_resize_constraint
+#else /* !DISCOVER_ONLY */
+ clobber: NULL,
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ resize: NULL,
+ copy: NULL,
+ get_create_constraint: NULL,
+ get_copy_constraint: NULL,
+ get_resize_constraint: NULL
+#endif /* !DISCOVER_ONLY */
+};
+
+#define EXT23_BLOCK_SIZES ((int[6]){512, 1024, 2048, 4096, 8192, 0})
+
+static PedFileSystemType _ext2_type = {
+ next: NULL,
+ ops: &_ext2_ops,
+ name: "ext2",
+ block_sizes: EXT23_BLOCK_SIZES
+};
+
+static PedFileSystemType _ext3_type = {
+ next: NULL,
+ ops: &_ext3_ops,
+ name: "ext3",
+ block_sizes: EXT23_BLOCK_SIZES
+};
+
+void ped_file_system_ext2_init ()
+{
+ ped_file_system_type_register (&_ext2_type);
+ ped_file_system_type_register (&_ext3_type);
+}
+
+void ped_file_system_ext2_done ()
+{
+ ped_file_system_type_unregister (&_ext2_type);
+ ped_file_system_type_unregister (&_ext3_type);
+}
diff --git a/libparted/fs/ext2/parted_io.c b/libparted/fs/ext2/parted_io.c
new file mode 100644
index 0000000..f23ad45
--- /dev/null
+++ b/libparted/fs/ext2/parted_io.c
@@ -0,0 +1,136 @@
+/*
+ parted_io.c -- parted I/O code interface for libext2resize
+ Copyright (C) 1998-2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+
+#ifndef DISCOVER_ONLY
+
+#include <parted/parted.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "ext2.h"
+
+/* pseudo-header.... */
+
+loff_t llseek(unsigned int fd, loff_t offset, unsigned int whence);
+
+struct my_cookie
+{
+ int logsize;
+ PedGeometry* geom;
+};
+
+/* ...then this must be pseudo-code :-) */
+
+static int do_close (void *cookie);
+static int do_sync (void *cookie);
+static blk_t do_get_size (void *cookie);
+static int do_read (void *cookie, void *ptr, blk_t block, blk_t numblocks);
+static int do_set_blocksize(void *cookie, int logsize);
+static int do_write (void *cookie, void *ptr, blk_t block, blk_t numblocks);
+
+struct ext2_dev_ops ops =
+{
+ close: do_close,
+ get_size: do_get_size,
+ read: do_read,
+ set_blocksize: do_set_blocksize,
+ sync: do_sync,
+ write: do_write
+};
+
+
+
+static int do_close(void *cookie)
+{
+ struct my_cookie *monster = cookie;
+
+ return ped_geometry_sync(monster->geom);
+}
+
+static int do_sync(void *cookie)
+{
+ struct my_cookie *monster = cookie;
+
+ return ped_geometry_sync(monster->geom);
+}
+
+static blk_t do_get_size(void *cookie)
+{
+ struct my_cookie *monster = cookie;
+
+ return monster->geom->length >> (monster->logsize - 9);
+}
+
+static int do_read(void *cookie, void *ptr, blk_t block, blk_t num)
+{
+ struct my_cookie *monster = cookie;
+
+ return ped_geometry_read(monster->geom, ptr, block << (monster->logsize - 9), num << (monster->logsize - 9));
+}
+
+static int do_set_blocksize(void *cookie, int logsize)
+{
+ struct my_cookie *monster = cookie;
+
+ monster->logsize = logsize;
+ return 1;
+}
+
+static int do_write(void *cookie, void *ptr, blk_t block, blk_t num)
+{
+ struct my_cookie *monster = cookie;
+
+ return ped_geometry_write(monster->geom, ptr,
+ block << (monster->logsize - 9),
+ num << (monster->logsize - 9));
+}
+
+
+struct ext2_dev_handle *ext2_make_dev_handle_from_parted_geometry(PedGeometry* geom)
+{
+ struct ext2_dev_handle *dh;
+ struct my_cookie *monster;
+
+ if ((dh = ped_malloc(sizeof(struct ext2_dev_handle))) == NULL)
+ goto error;
+
+ if ((monster = ped_malloc(sizeof(struct my_cookie))) == NULL)
+ goto error_free_dh;
+
+ dh->ops = &ops;
+ dh->cookie = monster;
+ monster->logsize = 9;
+ monster->geom = geom;
+
+ return dh;
+
+error_free_dh:
+ ped_free(dh);
+error:
+ return NULL;
+}
+
+void ext2_destroy_dev_handle(struct ext2_dev_handle *handle)
+{
+ ped_geometry_destroy(((struct my_cookie *)handle->cookie)->geom);
+ ped_free(handle->cookie);
+ ped_free(handle);
+}
+#endif /* !DISCOVER_ONLY */
diff --git a/libparted/fs/ext2/parted_io.h b/libparted/fs/ext2/parted_io.h
new file mode 100644
index 0000000..f796138
--- /dev/null
+++ b/libparted/fs/ext2/parted_io.h
@@ -0,0 +1,28 @@
+/*
+ parted_io.h
+ Copyright (C) 1998-2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _PARTED_IO_H
+#define _PARTED_IO_H
+
+#include "ext2.h"
+
+void ext2_destroy_dev_handle(struct ext2_dev_handle *handle);
+
+#endif
+
diff --git a/libparted/fs/ext2/tune.c b/libparted/fs/ext2/tune.c
new file mode 100644
index 0000000..980bd3c
--- /dev/null
+++ b/libparted/fs/ext2/tune.c
@@ -0,0 +1,40 @@
+/*
+ tune.c -- tuneable stuff
+ Copyright (C) 1998-2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+
+#ifndef DISCOVER_ONLY
+
+/*
+ * maybe i'll make this all command-line configurable one day
+ */
+
+/* The size of the buffer cache in kilobytes. Note that this is only
+ the actual buffer memory. On top of this amount additional memory
+ will be allocated for buffer cache bookkeeping. */
+int ext2_buffer_cache_pool_size = 512;
+
+/* The size of the buffer cache hash table (log2 of # of buckets). */
+int ext2_hash_bits = 8;
+
+/* The block/inode relocator pool size in kilobytes. Make this as big
+ as you can. The smaller this is, the more disk I/O is required for
+ doing relocations. */
+int ext2_relocator_pool_size = 4096;
+#endif /* !DISCOVER_ONLY */
diff --git a/libparted/fs/ext2/tune.h b/libparted/fs/ext2/tune.h
new file mode 100644
index 0000000..f6adece
--- /dev/null
+++ b/libparted/fs/ext2/tune.h
@@ -0,0 +1,30 @@
+/*
+ tune.h -- ext2 tunables header
+ Copyright (C) 1998-2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _TUNE_H
+#define _TUNE_H
+
+#define MAXCONT 256
+
+extern int ext2_buffer_cache_pool_size;
+extern int ext2_hash_bits;
+extern int ext2_max_groups;
+extern int ext2_relocator_pool_size;
+
+#endif
diff --git a/libparted/fs/fat/Makefile.am b/libparted/fs/fat/Makefile.am
new file mode 100644
index 0000000..a90cf7a
--- /dev/null
+++ b/libparted/fs/fat/Makefile.am
@@ -0,0 +1,25 @@
+partedincludedir = -I$(top_srcdir)/include
+
+noinst_LTLIBRARIES = libfat.la
+libfat_la_SOURCES = bootsector.c \
+ bootsector.h \
+ calc.c \
+ calc.h \
+ clstdup.c \
+ clstdup.h \
+ context.c \
+ context.h \
+ count.c \
+ count.h \
+ fat.c \
+ fat.h \
+ fatio.c \
+ fatio.h \
+ table.c \
+ table.h \
+ traverse.c \
+ traverse.h \
+ resize.c
+
+INCLUDES = $(partedincludedir) @INTLINCS@
+
diff --git a/libparted/fs/fat/bootsector.c b/libparted/fs/fat/bootsector.c
new file mode 100644
index 0000000..10426cd
--- /dev/null
+++ b/libparted/fs/fat/bootsector.c
@@ -0,0 +1,449 @@
+/*
+ libparted
+ Copyright (C) 1998, 1999, 2000, 2002, 2004 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#include "fat.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+
+/* Reads in the boot sector (superblock), and does a minimum of sanity
+ * checking. The goals are:
+ * - to detect fat file systems, even if they are damaged [i.e. not
+ * return an error / throw an exception]
+ * - to fail detection if there's not enough information for
+ * fat_boot_sector_probe_type() to work (or possibly crash on a divide-by-zero)
+ */
+int
+fat_boot_sector_read (FatBootSector* bs, const PedGeometry *geom)
+{
+ PED_ASSERT (bs != NULL, return 0);
+ PED_ASSERT (geom != NULL, return 0);
+
+ if (!ped_geometry_read (geom, bs, 0, 1))
+ return 0;
+
+ if (PED_LE16_TO_CPU (bs->boot_sign) != 0xAA55) {
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("File system has an invalid signature for a FAT "
+ "file system."));
+ return 0;
+ }
+
+ if (!bs->system_id[0]) {
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("File system has an invalid signature for a FAT "
+ "file system."));
+ return 0;
+ }
+
+ if (!bs->sector_size || PED_LE16_TO_CPU (bs->sector_size) % 512) {
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("File system has an invalid sector size for a FAT "
+ "file system."));
+ return 0;
+ }
+
+ if (!bs->cluster_size) {
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("File system has an invalid cluster size for a FAT "
+ "file system."));
+ return 0;
+ }
+
+ if (!bs->reserved) {
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("File system has an invalid number of reserved "
+ "sectors for a FAT file system."));
+ return 0;
+ }
+
+ if (bs->fats < 1 || bs->fats > 4) {
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("File system has an invalid number of FATs."));
+ return 0;
+ }
+
+ return 1;
+}
+
+/*
+ Don't trust the FAT12, FAT16 or FAT32 label string.
+ */
+FatType
+fat_boot_sector_probe_type (const FatBootSector* bs, const PedGeometry* geom)
+{
+ PedSector logical_sector_size;
+ PedSector first_cluster_sector;
+ FatCluster cluster_count;
+
+ if (!PED_LE16_TO_CPU (bs->dir_entries))
+ return FAT_TYPE_FAT32;
+
+ logical_sector_size = PED_LE16_TO_CPU (bs->sector_size) / 512;
+
+ first_cluster_sector
+ = PED_LE16_TO_CPU (bs->reserved) * logical_sector_size
+ + 2 * PED_LE16_TO_CPU (bs->fat_length) * logical_sector_size
+ + PED_LE16_TO_CPU (bs->dir_entries)
+ / (512 / sizeof (FatDirEntry));
+ cluster_count = (geom->length - first_cluster_sector)
+ / bs->cluster_size / logical_sector_size;
+ if (cluster_count > MAX_FAT12_CLUSTERS)
+ return FAT_TYPE_FAT16;
+ else
+ return FAT_TYPE_FAT12;
+}
+
+/* Analyses the boot sector, and sticks appropriate numbers in
+ fs->type_specific.
+
+ Note: you need to subtract (2 * cluster_sectors) off cluster offset,
+ because the first cluster is number 2. (0 and 1 are not real clusters,
+ and referencing them is a bug)
+ */
+int
+fat_boot_sector_analyse (FatBootSector* bs, PedFileSystem* fs)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ PedExceptionOption ex_status;
+ int fat_entry_size;
+
+ PED_ASSERT (bs != NULL, return 0);
+
+ if (PED_LE16_TO_CPU (bs->sector_size) != 512) {
+ if (ped_exception_throw (
+ PED_EXCEPTION_BUG,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("This file system has a logical sector size of %d. "
+ "GNU Parted is known not to work properly with sector "
+ "sizes other than 512 bytes."),
+ (int) PED_LE16_TO_CPU (bs->sector_size))
+ != PED_EXCEPTION_IGNORE)
+ return 0;
+ }
+
+ fs_info->logical_sector_size = PED_LE16_TO_CPU (bs->sector_size) / 512;
+
+ fs_info->sectors_per_track = PED_LE16_TO_CPU (bs->secs_track);
+ fs_info->heads = PED_LE16_TO_CPU (bs->heads);
+ if (fs_info->sectors_per_track < 1 || fs_info->sectors_per_track > 63
+ || fs_info->heads < 1 || fs_info->heads > 255) {
+ PedCHSGeometry* bios_geom = &fs->geom->dev->bios_geom;
+ int cyl_count = 0;
+
+ if (fs_info->heads > 0 && fs_info->sectors_per_track > 0)
+ cyl_count = fs->geom->dev->length / fs_info->heads
+ / fs_info->sectors_per_track;
+
+ switch (ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_FIX + PED_EXCEPTION_IGNORE
+ + PED_EXCEPTION_CANCEL,
+ _("The file system's CHS geometry is (%d, %d, %d), "
+ "which is invalid. The partition table's CHS "
+ "geometry is (%d, %d, %d). If you select Ignore, "
+ "the file system's CHS geometry will be left "
+ "unchanged. If you select Fix, the file system's "
+ "CHS geometry will be set to match the partition "
+ "table's CHS geometry."),
+ cyl_count, fs_info->heads, fs_info->sectors_per_track,
+ bios_geom->cylinders, bios_geom->heads,
+ bios_geom->sectors)) {
+
+ case PED_EXCEPTION_FIX:
+ fs_info->sectors_per_track = bios_geom->sectors;
+ fs_info->heads = bios_geom->heads;
+ bs->secs_track
+ = PED_CPU_TO_LE16 (fs_info->sectors_per_track);
+ bs->heads = PED_CPU_TO_LE16 (fs_info->heads);
+ if (!fat_boot_sector_write (bs, fs))
+ return 0;
+ break;
+
+ case PED_EXCEPTION_CANCEL:
+ return 0;
+
+ case PED_EXCEPTION_IGNORE:
+ break;
+ }
+ }
+
+ if (bs->sectors)
+ fs_info->sector_count = PED_LE16_TO_CPU (bs->sectors)
+ * fs_info->logical_sector_size;
+ else
+ fs_info->sector_count = PED_LE32_TO_CPU (bs->sector_count)
+ * fs_info->logical_sector_size;
+
+ fs_info->fat_table_count = bs->fats;
+ fs_info->root_dir_entry_count = PED_LE16_TO_CPU (bs->dir_entries);
+ fs_info->fat_offset = PED_LE16_TO_CPU (bs->reserved)
+ * fs_info->logical_sector_size;
+ fs_info->cluster_sectors = bs->cluster_size
+ * fs_info->logical_sector_size;
+ fs_info->cluster_size = fs_info->cluster_sectors * 512;
+
+ if (fs_info->logical_sector_size == 0) {
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("FAT boot sector says logical sector size is 0. "
+ "This is weird. "));
+ return 0;
+ }
+ if (fs_info->fat_table_count == 0) {
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("FAT boot sector says there are no FAT tables. This "
+ "is weird. "));
+ return 0;
+ }
+ if (fs_info->cluster_sectors == 0) {
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("FAT boot sector says clusters are 0 sectors. This "
+ "is weird. "));
+ return 0;
+ }
+
+ fs_info->fat_type = fat_boot_sector_probe_type (bs, fs->geom);
+ if (fs_info->fat_type == FAT_TYPE_FAT12) {
+ ped_exception_throw (
+ PED_EXCEPTION_NO_FEATURE,
+ PED_EXCEPTION_CANCEL,
+ _("File system is FAT12, which is unsupported."));
+ return 0;
+ }
+ if (fs_info->fat_type == FAT_TYPE_FAT16) {
+ fs_info->fat_sectors = PED_LE16_TO_CPU (bs->fat_length)
+ * fs_info->logical_sector_size;
+ fs_info->serial_number
+ = PED_LE32_TO_CPU (bs->u.fat16.serial_number);
+ fs_info->root_cluster = 0;
+ fs_info->root_dir_offset
+ = fs_info->fat_offset
+ + fs_info->fat_sectors * fs_info->fat_table_count;
+ fs_info->root_dir_sector_count
+ = fs_info->root_dir_entry_count * sizeof (FatDirEntry)
+ / (512 * fs_info->logical_sector_size);
+ fs_info->cluster_offset
+ = fs_info->root_dir_offset
+ + fs_info->root_dir_sector_count;
+ }
+ if (fs_info->fat_type == FAT_TYPE_FAT32) {
+ fs_info->fat_sectors = PED_LE32_TO_CPU (bs->u.fat32.fat_length)
+ * fs_info->logical_sector_size;
+ fs_info->serial_number
+ = PED_LE32_TO_CPU (bs->u.fat32.serial_number);
+ fs_info->info_sector_offset
+ = PED_LE16_TO_CPU (fs_info->boot_sector.u.fat32.info_sector)
+ * fs_info->logical_sector_size;
+ fs_info->boot_sector_backup_offset
+ = PED_LE16_TO_CPU (fs_info->boot_sector.u.fat32.backup_sector)
+ * fs_info->logical_sector_size;
+ fs_info->root_cluster
+ = PED_LE32_TO_CPU (bs->u.fat32.root_dir_cluster);
+ fs_info->root_dir_offset = 0;
+ fs_info->root_dir_sector_count = 0;
+ fs_info->cluster_offset
+ = fs_info->fat_offset
+ + fs_info->fat_sectors * fs_info->fat_table_count;
+ }
+
+ fs_info->cluster_count
+ = (fs_info->sector_count - fs_info->cluster_offset)
+ / fs_info->cluster_sectors;
+
+ fat_entry_size = fat_table_entry_size (fs_info->fat_type);
+ if (fs_info->cluster_count + 2
+ > fs_info->fat_sectors * 512 / fat_entry_size)
+ fs_info->cluster_count
+ = fs_info->fat_sectors * 512 / fat_entry_size - 2;
+
+ fs_info->dir_entries_per_cluster
+ = fs_info->cluster_size / sizeof (FatDirEntry);
+ return 1;
+}
+
+#ifndef DISCOVER_ONLY
+int
+fat_boot_sector_set_boot_code (FatBootSector* bs)
+{
+ PED_ASSERT (bs != NULL, return 0);
+
+ memset (bs, 0, 512);
+ memcpy (bs->boot_jump, FAT_BOOT_JUMP, 3);
+ memcpy (bs->u.fat32.boot_code, FAT_BOOT_CODE, FAT_BOOT_CODE_LENGTH);
+ return 1;
+}
+
+int
+fat_boot_sector_generate (FatBootSector* bs, const PedFileSystem* fs)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+
+ PED_ASSERT (bs != NULL, return 0);
+
+ memcpy (bs->system_id, "MSWIN4.1", 8);
+ bs->sector_size = PED_CPU_TO_LE16 (fs_info->logical_sector_size * 512);
+ bs->cluster_size = fs_info->cluster_sectors
+ / fs_info->logical_sector_size;
+ bs->reserved = PED_CPU_TO_LE16 (fs_info->fat_offset
+ / fs_info->logical_sector_size);
+ bs->fats = fs_info->fat_table_count;
+
+ bs->dir_entries = (fs_info->fat_type == FAT_TYPE_FAT16)
+ ? PED_CPU_TO_LE16 (fs_info->root_dir_entry_count)
+ : 0;
+
+ if (fs_info->sector_count / fs_info->logical_sector_size > 0xffff
+ || fs_info->fat_type == FAT_TYPE_FAT32) {
+ bs->sectors = 0;
+ bs->sector_count = PED_CPU_TO_LE32 (fs_info->sector_count
+ / fs_info->logical_sector_size);
+ } else {
+ bs->sectors = PED_CPU_TO_LE16 (fs_info->sector_count
+ / fs_info->logical_sector_size);
+ bs->sector_count = 0;
+ }
+
+ bs->media = 0xf8;
+
+ bs->secs_track = PED_CPU_TO_LE16 (fs_info->sectors_per_track);
+ bs->heads = PED_CPU_TO_LE16 (fs_info->heads);
+ bs->hidden = PED_CPU_TO_LE32 (fs->geom->start);
+
+ if (fs_info->fat_type == FAT_TYPE_FAT32) {
+ bs->fat_length = 0;
+ bs->u.fat32.fat_length = PED_CPU_TO_LE32 (fs_info->fat_sectors
+ / fs_info->logical_sector_size);
+ bs->u.fat32.flags = 0; /* FIXME: what the hell are these? */
+ bs->u.fat32.version = 0; /* must be 0, for Win98 bootstrap */
+ bs->u.fat32.root_dir_cluster
+ = PED_CPU_TO_LE32 (fs_info->root_cluster);
+ bs->u.fat32.info_sector
+ = PED_CPU_TO_LE16 (fs_info->info_sector_offset
+ / fs_info->logical_sector_size);
+ bs->u.fat32.backup_sector
+ = PED_CPU_TO_LE16 (fs_info->boot_sector_backup_offset
+ / fs_info->logical_sector_size);
+
+ bs->u.fat32.drive_num = 0x80; /* _ALWAYS_ 0x80. silly DOS */
+
+ memset (bs->u.fat32.empty_1, 0, 12);
+
+ bs->u.fat32.ext_signature = 0x29;
+ bs->u.fat32.serial_number
+ = PED_CPU_TO_LE32 (fs_info->serial_number);
+ memcpy (bs->u.fat32.volume_name, "NO NAME ", 11);
+ memcpy (bs->u.fat32.fat_name, "FAT32 ", 8);
+ } else {
+ bs->fat_length
+ = PED_CPU_TO_LE16 (fs_info->fat_sectors
+ / fs_info->logical_sector_size);
+
+ bs->u.fat16.drive_num = 0x80; /* _ALWAYS_ 0x80. silly DOS */
+
+ bs->u.fat16.ext_signature = 0x29;
+ bs->u.fat16.serial_number
+ = PED_CPU_TO_LE32 (fs_info->serial_number);
+ memcpy (bs->u.fat16.volume_name, "NO NAME ", 11);
+ memcpy (bs->u.fat16.fat_name, "FAT16 ", 8);
+ }
+
+ bs->boot_sign = PED_CPU_TO_LE16 (0xaa55);
+
+ return 1;
+}
+
+int
+fat_boot_sector_write (const FatBootSector* bs, PedFileSystem* fs)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+
+ PED_ASSERT (bs != NULL, return 0);
+
+ if (!ped_geometry_write (fs->geom, bs, 0, 1))
+ return 0;
+ if (fs_info->fat_type == FAT_TYPE_FAT32) {
+ if (!ped_geometry_write (fs->geom, bs,
+ fs_info->boot_sector_backup_offset, 1))
+ return 0;
+ }
+ return ped_geometry_sync (fs->geom);
+}
+
+int
+fat_info_sector_read (FatInfoSector* is, const PedFileSystem* fs)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ int status;
+
+ PED_ASSERT (is != NULL, return 0);
+
+ if (!ped_geometry_read (fs->geom, is, fs_info->info_sector_offset, 1))
+ return 0;
+
+ if (PED_LE32_TO_CPU (is->signature_2) != FAT32_INFO_MAGIC2) {
+ status = ped_exception_throw (PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("The information sector has the wrong "
+ "signature (%x). Select cancel for now, "
+ "and send in a bug report. If you're "
+ "desperate, it's probably safe to ignore."),
+ PED_LE32_TO_CPU (is->signature_2));
+ if (status == PED_EXCEPTION_CANCEL) return 0;
+ }
+ return 1;
+}
+
+int
+fat_info_sector_generate (FatInfoSector* is, const PedFileSystem* fs)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+
+ PED_ASSERT (is != NULL, return 0);
+
+ fat_table_count_stats (fs_info->fat);
+
+ memset (is, 0, 512);
+
+ is->signature_1 = PED_CPU_TO_LE32 (FAT32_INFO_MAGIC1);
+ is->signature_2 = PED_CPU_TO_LE32 (FAT32_INFO_MAGIC2);
+ is->free_clusters = PED_CPU_TO_LE32 (fs_info->fat->free_cluster_count);
+ is->next_cluster = PED_CPU_TO_LE32 (fs_info->fat->last_alloc);
+ is->signature_3 = PED_CPU_TO_LE16 (FAT32_INFO_MAGIC3);
+
+ return 1;
+}
+
+int
+fat_info_sector_write (const FatInfoSector* is, PedFileSystem *fs)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+
+ PED_ASSERT (is != NULL, return 0);
+
+ if (!ped_geometry_write (fs->geom, is, fs_info->info_sector_offset, 1))
+ return 0;
+ return ped_geometry_sync (fs->geom);
+}
+#endif /* !DISCOVER_ONLY */
+
diff --git a/libparted/fs/fat/bootsector.h b/libparted/fs/fat/bootsector.h
new file mode 100644
index 0000000..95f1c10
--- /dev/null
+++ b/libparted/fs/fat/bootsector.h
@@ -0,0 +1,138 @@
+/*
+ libparted
+ Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef PED_FAT_BOOTSECTOR_H
+#define PED_FAT_BOOTSECTOR_H
+
+typedef struct _FatBootSector FatBootSector;
+typedef struct _FatInfoSector FatInfoSector;
+
+#include "fat.h"
+
+#define FAT32_INFO_MAGIC1 0x41615252
+#define FAT32_INFO_MAGIC2 0x61417272
+#define FAT32_INFO_MAGIC3 0xaa55
+
+/* stolen from mkdosfs, by Dave Hudson */
+
+#define FAT_BOOT_MESSAGE \
+"This partition does not have an operating system loader installed on it.\n\r"\
+"Press a key to reboot..."
+
+#define FAT_BOOT_JUMP "\xeb\x58\x90" /* jmp +5a */
+
+#define FAT_BOOT_CODE "\x0e" /* push cs */ \
+ "\x1f" /* pop ds */ \
+ "\xbe\x74\x7e" /* mov si, offset message */ \
+ /* write_msg_loop: */ \
+ "\xac" /* lodsb */ \
+ "\x22\xc0" /* and al, al */ \
+ "\x74\x06" /* jz done (+8) */ \
+ "\xb4\x0e" /* mov ah, 0x0e */ \
+ "\xcd\x10" /* int 0x10 */ \
+ "\xeb\xf5" /* jmp write_msg_loop */ \
+ /* done: */ \
+ "\xb4\x00" /* mov ah, 0x00 */ \
+ "\xcd\x16" /* int 0x16 */ \
+ "\xb4\x00" /* mov ah, 0x00 */ \
+ "\xcd\x19" /* int 0x19 */ \
+ "\xeb\xfe" /* jmp +0 - in case int 0x19 */ \
+ /* doesn't work */ \
+ /* message: */ \
+ FAT_BOOT_MESSAGE
+
+#define FAT_BOOT_CODE_LENGTH 128
+
+struct _FatBootSector {
+ uint8_t boot_jump[3]; /* 00: Boot strap short or near jump */
+ uint8_t system_id[8]; /* 03: system name */
+ uint16_t sector_size; /* 0b: bytes per logical sector */
+ uint8_t cluster_size; /* 0d: sectors/cluster */
+ uint16_t reserved; /* 0e: reserved sectors */
+ uint8_t fats; /* 10: number of FATs */
+ uint16_t dir_entries; /* 11: number of root directory entries */
+ uint16_t sectors; /* 13: if 0, total_sect supersedes */
+ uint8_t media; /* 15: media code */
+ uint16_t fat_length; /* 16: sectors/FAT for FAT12/16 */
+ uint16_t secs_track; /* 18: sectors per track */
+ uint16_t heads; /* 1a: number of heads */
+ uint32_t hidden; /* 1c: hidden sectors (partition start) */
+ uint32_t sector_count; /* 20: no. of sectors (if sectors == 0) */
+
+union {
+/* FAT16 fields */
+struct {
+ uint8_t drive_num; /* 24: */
+ uint8_t empty_1; /* 25: */
+ uint8_t ext_signature; /* 26: always 0x29 */
+ uint32_t serial_number; /* 27: */
+ uint8_t volume_name [11]; /* 2b: */
+ uint8_t fat_name [8]; /* 36: */
+
+ uint8_t boot_code[448]; /* 3f: Boot code (or message) */
+} __attribute__ ((packed)) fat16;
+
+/* FAT32 fields */
+struct {
+ uint32_t fat_length; /* 24: size of FAT in sectors */
+ uint16_t flags; /* 28: bit8: fat mirroring, low4: active fat */
+ uint16_t version; /* 2a: minor * 256 + major */
+ uint32_t root_dir_cluster; /* 2c: */
+ uint16_t info_sector; /* 30: */
+ uint16_t backup_sector; /* 32: */
+
+ uint8_t empty_1 [12]; /* 34: */
+
+ uint16_t drive_num; /* 40: */
+ uint8_t ext_signature; /* 42: always 0x29 */
+ uint32_t serial_number; /* 43: */
+ uint8_t volume_name [11]; /* 47: */
+ uint8_t fat_name [8]; /* 52: */
+
+ uint8_t boot_code[420]; /* 5a: Boot code (or message) */
+} __attribute ((packed)) fat32;
+} __attribute ((packed)) u;
+
+ uint16_t boot_sign; /* 1fe: always 0xAA55 */
+} __attribute__ ((packed));
+
+struct _FatInfoSector {
+ uint32_t signature_1; /* should be 0x41615252 */
+ uint8_t unused [480];
+ uint32_t signature_2; /* should be 0x61417272 */
+ uint32_t free_clusters;
+ uint32_t next_cluster; /* most recently allocated cluster */
+ uint8_t unused2 [0xe];
+ uint16_t signature_3; /* should be 0xaa55 */
+} __attribute__ ((packed));
+
+int fat_boot_sector_read (FatBootSector* bs, const PedGeometry* geom);
+FatType fat_boot_sector_probe_type (const FatBootSector* bs,
+ const PedGeometry* geom);
+int fat_boot_sector_analyse (FatBootSector* bs, PedFileSystem* fs);
+int fat_boot_sector_set_boot_code (FatBootSector* bs);
+int fat_boot_sector_generate (FatBootSector* bs, const PedFileSystem* fs);
+int fat_boot_sector_write (const FatBootSector* bs, PedFileSystem* fs);
+
+int fat_info_sector_read (FatInfoSector* is, const PedFileSystem* fs);
+int fat_info_sector_generate (FatInfoSector* is, const PedFileSystem* fs);
+int fat_info_sector_write (const FatInfoSector* is, PedFileSystem* fs);
+
+#endif /* PED_FAT_BOOTSECTOR_H */
+
diff --git a/libparted/fs/fat/calc.c b/libparted/fs/fat/calc.c
new file mode 100644
index 0000000..d09959f
--- /dev/null
+++ b/libparted/fs/fat/calc.c
@@ -0,0 +1,437 @@
+/*
+ libparted
+ Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#include "fat.h"
+
+#ifndef DISCOVER_ONLY
+
+/* returns the minimum size of clusters for a given file system type */
+PedSector
+fat_min_cluster_size (FatType fat_type) {
+ switch (fat_type) {
+ case FAT_TYPE_FAT12: return 1;
+ case FAT_TYPE_FAT16: return 1024/512;
+ case FAT_TYPE_FAT32: return 4096/512;
+ }
+ return 0;
+}
+
+static PedSector
+_smallest_power2_over (PedSector ceiling)
+{
+ PedSector result = 1;
+
+ while (result < ceiling)
+ result *= 2;
+
+ return result;
+}
+
+/* returns the minimum size of clusters for a given file system type */
+PedSector
+fat_recommend_min_cluster_size (FatType fat_type, PedSector size) {
+ switch (fat_type) {
+ case FAT_TYPE_FAT12: return 1;
+ case FAT_TYPE_FAT16: return fat_min_cluster_size(fat_type);
+ case FAT_TYPE_FAT32:
+ return PED_MAX(_smallest_power2_over(size
+ / MAX_FAT32_CLUSTERS),
+ fat_min_cluster_size (fat_type));
+ }
+ return 0;
+}
+
+/* returns the maxmimum size of clusters for a given file system type */
+PedSector
+fat_max_cluster_size (FatType fat_type) {
+ switch (fat_type) {
+ case FAT_TYPE_FAT12: return 1; /* dunno... who cares? */
+ case FAT_TYPE_FAT16: return 32768/512;
+ case FAT_TYPE_FAT32: return 65536/512;
+ }
+ return 0;
+}
+
+/* returns the minimum number of clusters for a given file system type */
+FatCluster
+fat_min_cluster_count (FatType fat_type) {
+ switch (fat_type) {
+ case FAT_TYPE_FAT12:
+ case FAT_TYPE_FAT16:
+ return fat_max_cluster_count (fat_type) / 2;
+
+ case FAT_TYPE_FAT32: return 0xfff0;
+ }
+ return 0;
+}
+
+/* returns the maximum number of clusters for a given file system type */
+FatCluster
+fat_max_cluster_count (FatType fat_type) {
+ switch (fat_type) {
+ case FAT_TYPE_FAT12: return 0xff0;
+ case FAT_TYPE_FAT16: return 0xfff0;
+ case FAT_TYPE_FAT32: return 0x0ffffff0;
+ }
+ return 0;
+}
+
+/* what is this supposed to be? What drugs are M$ on? (Can I have some? :-) */
+PedSector
+fat_min_reserved_sector_count (FatType fat_type)
+{
+ return (fat_type == FAT_TYPE_FAT32) ? 32 : 1;
+}
+
+int
+fat_check_resize_geometry (const PedFileSystem* fs,
+ const PedGeometry* geom,
+ PedSector new_cluster_sectors,
+ FatCluster new_cluster_count)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ PedSector free_space;
+ PedSector min_free_space;
+ PedSector total_space;
+ PedSector new_total_space;
+ PedSector dir_space;
+
+ PED_ASSERT (geom != NULL, return 0);
+
+ dir_space = fs_info->total_dir_clusters * fs_info->cluster_sectors;
+ free_space = fs_info->fat->free_cluster_count
+ * fs_info->cluster_sectors;
+ total_space = fs_info->fat->cluster_count * fs_info->cluster_sectors;
+ new_total_space = new_cluster_count * new_cluster_sectors;
+ min_free_space = total_space - new_total_space + dir_space;
+
+ PED_ASSERT (new_cluster_count
+ <= fat_max_cluster_count (FAT_TYPE_FAT32),
+ return 0);
+
+ if (free_space < min_free_space) {
+ char* needed = ped_unit_format (geom->dev, min_free_space);
+ char* have = ped_unit_format (geom->dev, free_space);
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("You need %s of free disk space to shrink this "
+ "partition to this size. Currently, only %s is "
+ "free."),
+ needed, have);
+ ped_free (needed);
+ ped_free (have);
+ return 0;
+ }
+
+ return 1;
+}
+
+
+/******************************************************************************/
+
+/* DO NOT EDIT THIS ALGORITHM!
+ * As far as I can tell, this is the same algorithm used by Microsoft to
+ * calculate the size of the file allocaion tables, and the number of clusters.
+ * I have not verified this by dissassembling Microsoft code - I came to this
+ * conclusion by empirical analysis (i.e. trial and error - this was HORRIBLE).
+ *
+ * If you think this code makes no sense, then you are right. I will restrain
+ * the urge to inflict serious bodily harm on Microsoft people.
+ */
+
+static int
+entries_per_sector (FatType fat_type)
+{
+ switch (fat_type) {
+ case FAT_TYPE_FAT12:
+ return 512 * 3 / 2;
+ case FAT_TYPE_FAT16:
+ return 512 / 2;
+ case FAT_TYPE_FAT32:
+ return 512 / 4;
+ }
+ return 0;
+}
+
+static int
+calc_sizes (PedSector size, PedSector align, FatType fat_type,
+ PedSector root_dir_sectors, PedSector cluster_sectors,
+ FatCluster* out_cluster_count, PedSector* out_fat_size)
+{
+ PedSector data_fat_space; /* space available to clusters + FAT */
+ PedSector fat_space; /* space taken by each FAT */
+ PedSector cluster_space; /* space taken by clusters */
+ FatCluster cluster_count;
+ int i;
+
+ PED_ASSERT (out_cluster_count != NULL, return 0);
+ PED_ASSERT (out_fat_size != NULL, return 0);
+
+ data_fat_space = size - fat_min_reserved_sector_count (fat_type)
+ - align;
+ if (fat_type == FAT_TYPE_FAT16)
+ data_fat_space -= root_dir_sectors;
+
+ fat_space = 0;
+ for (i = 0; i < 2; i++) {
+ if (fat_type == FAT_TYPE_FAT32)
+ cluster_space = data_fat_space - fat_space;
+ else
+ cluster_space = data_fat_space - 2 * fat_space;
+
+ cluster_count = cluster_space / cluster_sectors;
+ fat_space = ped_div_round_up (cluster_count + 2,
+ entries_per_sector (fat_type));
+ }
+
+ cluster_space = data_fat_space - 2 * fat_space;
+ cluster_count = cluster_space / cluster_sectors;
+
+ /* looks like this should be part of the loop condition?
+ * Need to build the Big Table TM again to check
+ */
+ if (fat_space < ped_div_round_up (cluster_count + 2,
+ entries_per_sector (fat_type))) {
+ fat_space = ped_div_round_up (cluster_count + 2,
+ entries_per_sector (fat_type));
+ }
+
+ if (cluster_count > fat_max_cluster_count (fat_type)
+ || cluster_count < fat_min_cluster_count (fat_type))
+ return 0;
+
+ *out_cluster_count = cluster_count;
+ *out_fat_size = fat_space;
+
+ return 1;
+}
+
+/****************************************************************************/
+
+int
+fat_calc_sizes (PedSector size, PedSector align, FatType fat_type,
+ PedSector root_dir_sectors,
+ PedSector* out_cluster_sectors, FatCluster* out_cluster_count,
+ PedSector* out_fat_size)
+{
+ PedSector cluster_sectors;
+
+ PED_ASSERT (out_cluster_sectors != NULL, return 0);
+ PED_ASSERT (out_cluster_count != NULL, return 0);
+ PED_ASSERT (out_fat_size != NULL, return 0);
+
+ for (cluster_sectors = fat_recommend_min_cluster_size (fat_type, size);
+ cluster_sectors <= fat_max_cluster_size (fat_type);
+ cluster_sectors *= 2) {
+ if (calc_sizes (size, align, fat_type, root_dir_sectors,
+ cluster_sectors,
+ out_cluster_count, out_fat_size)) {
+ *out_cluster_sectors = cluster_sectors;
+ return 1;
+ }
+ }
+
+ for (cluster_sectors = fat_recommend_min_cluster_size (fat_type, size);
+ cluster_sectors >= fat_min_cluster_size (fat_type);
+ cluster_sectors /= 2) {
+ if (calc_sizes (size, align, fat_type, root_dir_sectors,
+ cluster_sectors,
+ out_cluster_count, out_fat_size)) {
+ *out_cluster_sectors = cluster_sectors;
+ return 1;
+ }
+ }
+
+ /* only make the cluster size really small (<4k) if a bigger one is
+ * isn't possible. Windows never makes FS's like this, but it
+ * seems to work... (do more tests!)
+ */
+ for (cluster_sectors = 4; cluster_sectors > 0; cluster_sectors /= 2) {
+ if (calc_sizes (size, align, fat_type, root_dir_sectors,
+ cluster_sectors,
+ out_cluster_count, out_fat_size)) {
+ *out_cluster_sectors = cluster_sectors;
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+/* Same as fat_calc_sizes, except it only attempts to match a particular
+ * cluster size. This is useful, because the FAT resizer can only shrink the
+ * cluster size.
+ */
+int
+fat_calc_resize_sizes (
+ const PedGeometry* geom,
+ PedSector align,
+ FatType fat_type,
+ PedSector root_dir_sectors,
+ PedSector cluster_sectors,
+ PedSector* out_cluster_sectors,
+ FatCluster* out_cluster_count,
+ PedSector* out_fat_size)
+{
+ PedSector min_cluster_sectors;
+
+ PED_ASSERT (geom != NULL, return 0);
+ PED_ASSERT (out_cluster_sectors != NULL, return 0);
+ PED_ASSERT (out_cluster_count != NULL, return 0);
+ PED_ASSERT (out_fat_size != NULL, return 0);
+
+/* libparted can only reduce the cluster size at this point */
+ for (*out_cluster_sectors = cluster_sectors;
+ *out_cluster_sectors >= fat_min_cluster_size (fat_type);
+ *out_cluster_sectors /= 2) {
+ if (calc_sizes (geom->length, align, fat_type, root_dir_sectors,
+ *out_cluster_sectors,
+ out_cluster_count, out_fat_size))
+ return 1;
+ }
+ return 0;
+}
+
+/* Calculates the number of sectors needed to be added to cluster_offset,
+ to make the cluster on the new file system match up with the ones
+ on the old file system.
+ However, some space is reserved by fat_calc_resize_sizes() and
+ friends, to allow room for this space. If too much of this space is left
+ over, everyone will complain, so we have to be greedy, and use it all up...
+ */
+PedSector
+fat_calc_align_sectors (const PedFileSystem* new_fs,
+ const PedFileSystem* old_fs)
+{
+ FatSpecific* old_fs_info = FAT_SPECIFIC (old_fs);
+ FatSpecific* new_fs_info = FAT_SPECIFIC (new_fs);
+ PedSector raw_old_meta_data_end;
+ PedSector new_meta_data_size;
+ PedSector min_new_meta_data_end;
+ PedSector new_data_size;
+ PedSector new_clusters_size;
+ PedSector align;
+
+ new_meta_data_size
+ = fat_min_reserved_sector_count (new_fs_info->fat_type)
+ + new_fs_info->fat_sectors * 2;
+
+ if (new_fs_info->fat_type == FAT_TYPE_FAT16)
+ new_meta_data_size += new_fs_info->root_dir_sector_count;
+
+ raw_old_meta_data_end = old_fs->geom->start
+ + old_fs_info->cluster_offset;
+
+ min_new_meta_data_end = new_fs->geom->start + new_meta_data_size;
+
+ if (raw_old_meta_data_end > min_new_meta_data_end)
+ align = (raw_old_meta_data_end - min_new_meta_data_end)
+ % new_fs_info->cluster_sectors;
+ else
+ align = (new_fs_info->cluster_sectors
+ - ( (min_new_meta_data_end - raw_old_meta_data_end)
+ % new_fs_info->cluster_sectors ))
+ % new_fs_info->cluster_sectors;
+
+ new_data_size = new_fs->geom->length - new_meta_data_size;
+ new_clusters_size = new_fs_info->cluster_count
+ * new_fs_info->cluster_sectors;
+
+ while (new_clusters_size + align + new_fs_info->cluster_sectors
+ <= new_data_size)
+ align += new_fs_info->cluster_sectors;
+
+ return align;
+}
+
+int
+fat_is_sector_in_clusters (const PedFileSystem* fs, PedSector sector)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+
+ return sector >= fs_info->cluster_offset
+ && sector < fs_info->cluster_offset
+ + fs_info->cluster_sectors * fs_info->cluster_count;
+}
+
+FatFragment
+fat_cluster_to_frag (const PedFileSystem* fs, FatCluster cluster)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+
+ PED_ASSERT (cluster >= 2 && cluster < fs_info->cluster_count + 2,
+ return 0);
+
+ return (cluster - 2) * fs_info->cluster_frags;
+}
+
+FatCluster
+fat_frag_to_cluster (const PedFileSystem* fs, FatFragment frag)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+
+ PED_ASSERT (frag >= 0 && frag < fs_info->frag_count, return 0);
+
+ return frag / fs_info->cluster_frags + 2;
+}
+
+PedSector
+fat_frag_to_sector (const PedFileSystem* fs, FatFragment frag)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+
+ PED_ASSERT (frag >= 0 && frag < fs_info->frag_count, return 0);
+
+ return frag * fs_info->frag_sectors + fs_info->cluster_offset;
+}
+
+FatFragment
+fat_sector_to_frag (const PedFileSystem* fs, PedSector sector)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+
+ PED_ASSERT (sector >= fs_info->cluster_offset, return 0);
+
+ return (sector - fs_info->cluster_offset) / fs_info->frag_sectors;
+}
+
+PedSector
+fat_cluster_to_sector (const PedFileSystem* fs, FatCluster cluster)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+
+ PED_ASSERT (cluster >= 2 && cluster < fs_info->cluster_count + 2,
+ return 0);
+
+ return (cluster - 2) * fs_info->cluster_sectors
+ + fs_info->cluster_offset;
+}
+
+FatCluster
+fat_sector_to_cluster (const PedFileSystem* fs, PedSector sector)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+
+ PED_ASSERT (sector >= fs_info->cluster_offset, return 0);
+
+ return (sector - fs_info->cluster_offset) / fs_info->cluster_sectors
+ + 2;
+}
+#endif /* !DISCOVER_ONLY */
diff --git a/libparted/fs/fat/calc.h b/libparted/fs/fat/calc.h
new file mode 100644
index 0000000..cd126e5
--- /dev/null
+++ b/libparted/fs/fat/calc.h
@@ -0,0 +1,78 @@
+/*
+ libparted
+ Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef PED_FAT_CALC_H
+#define PED_FAT_CALC_H
+
+extern PedSector fat_min_cluster_size (FatType fat_type);
+extern PedSector fat_max_cluster_size (FatType fat_type);
+extern FatCluster fat_min_cluster_count (FatType fat_type);
+extern FatCluster fat_max_cluster_count (FatType fat_type);
+
+extern PedSector fat_min_reserved_sector_count (FatType fat_type);
+
+extern int fat_check_resize_geometry (const PedFileSystem* fs,
+ const PedGeometry* geom,
+ PedSector new_cluster_sectors,
+ FatCluster new_cluster_count);
+
+extern int fat_calc_sizes (PedSector size,
+ PedSector align,
+ FatType fat_type,
+ PedSector root_dir_sectors,
+ PedSector* out_cluster_sectors,
+ FatCluster* out_cluster_count,
+ PedSector* out_fat_size);
+
+extern int fat_calc_resize_sizes (const PedGeometry* geom,
+ PedSector align,
+ FatType fat_type,
+ PedSector root_dir_sectors,
+ PedSector cluster_sectors,
+ PedSector* out_cluster_sectors,
+ FatCluster* out_cluster_count,
+ PedSector* out_fat_size);
+
+extern PedSector
+fat_calc_align_sectors (const PedFileSystem* new_fs,
+ const PedFileSystem* old_fs);
+
+extern int
+fat_is_sector_in_clusters (const PedFileSystem* fs, PedSector sector);
+
+extern FatFragment
+fat_cluster_to_frag (const PedFileSystem* fs, FatCluster cluster);
+
+extern FatCluster
+fat_frag_to_cluster (const PedFileSystem* fs, FatFragment frag);
+
+extern PedSector
+fat_frag_to_sector (const PedFileSystem* fs, FatFragment frag);
+
+extern FatFragment
+fat_sector_to_frag (const PedFileSystem* fs, PedSector sector);
+
+extern PedSector
+fat_cluster_to_sector (const PedFileSystem* fs, FatCluster cluster);
+
+extern FatCluster
+fat_sector_to_cluster (const PedFileSystem* fs, PedSector sector);
+
+#endif /* PED_FAT_CALC_H */
+
diff --git a/libparted/fs/fat/clstdup.c b/libparted/fs/fat/clstdup.c
new file mode 100644
index 0000000..b9b0534
--- /dev/null
+++ b/libparted/fs/fat/clstdup.c
@@ -0,0 +1,425 @@
+/*
+ libparted
+ Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#include <string.h>
+
+#include "fat.h"
+
+#ifndef DISCOVER_ONLY
+
+static int
+needs_duplicating (const FatOpContext* ctx, FatFragment frag)
+{
+ FatSpecific* old_fs_info = FAT_SPECIFIC (ctx->old_fs);
+ FatCluster cluster = fat_frag_to_cluster (ctx->old_fs, frag);
+ FatClusterFlag flag;
+
+ PED_ASSERT (cluster >= 2 && cluster < old_fs_info->cluster_count + 2,
+ return 0);
+
+ flag = fat_get_fragment_flag (ctx->old_fs, frag);
+ switch (flag) {
+ case FAT_FLAG_FREE:
+ return 0;
+
+ case FAT_FLAG_DIRECTORY:
+ return 1;
+
+ case FAT_FLAG_FILE:
+ return fat_op_context_map_static_fragment (ctx, frag) == -1;
+
+ case FAT_FLAG_BAD:
+ return 0;
+ }
+
+ return 0;
+}
+
+static int
+search_next_fragment (FatOpContext* ctx)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (ctx->old_fs);
+
+ for (; ctx->buffer_offset < fs_info->frag_count; ctx->buffer_offset++) {
+ if (needs_duplicating (ctx, ctx->buffer_offset))
+ return 1;
+ }
+ return 0; /* all done! */
+}
+
+static int
+read_marked_fragments (FatOpContext* ctx, FatFragment length)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (ctx->old_fs);
+ int status;
+ FatFragment i;
+
+ ped_exception_fetch_all ();
+ status = fat_read_fragments (ctx->old_fs, fs_info->buffer,
+ ctx->buffer_offset, length);
+ ped_exception_leave_all ();
+ if (status)
+ return 1;
+
+ ped_exception_catch ();
+
+/* something bad happened, so read fragments one by one. (The error may
+ have occurred on an unused fragment: who cares) */
+ for (i = 0; i < length; i++) {
+ if (ctx->buffer_map [i]) {
+ if (!fat_read_fragment (ctx->old_fs,
+ fs_info->buffer + i * fs_info->frag_size,
+ ctx->buffer_offset + i))
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
+static int
+fetch_fragments (FatOpContext* ctx)
+{
+ FatSpecific* old_fs_info = FAT_SPECIFIC (ctx->old_fs);
+ FatFragment fetch_length = 0;
+ FatFragment frag;
+
+ for (frag = 0; frag < ctx->buffer_frags; frag++)
+ ctx->buffer_map [frag] = -1;
+
+ for (frag = 0;
+ frag < ctx->buffer_frags
+ && ctx->buffer_offset + frag < old_fs_info->frag_count;
+ frag++) {
+ if (needs_duplicating (ctx, ctx->buffer_offset + frag)) {
+ ctx->buffer_map [frag] = 1;
+ fetch_length = frag + 1;
+ }
+ }
+
+ if (!read_marked_fragments (ctx, fetch_length))
+ return 0;
+
+ return 1;
+}
+
+/*****************************************************************************
+ * here starts the write code. All assumes that ctx->buffer_map [first] and
+ * ctx->buffer_map [last] are occupied by fragments that need to be duplicated.
+ *****************************************************************************/
+
+/* finds the first fragment that is not going to get overwritten (that needs to
+ get read in) */
+static FatFragment
+get_first_underlay (const FatOpContext* ctx, int first, int last)
+{
+ int old;
+ FatFragment new;
+
+ PED_ASSERT (first <= last, return 0);
+
+ new = ctx->buffer_map [first];
+ for (old = first + 1; old <= last; old++) {
+ if (ctx->buffer_map [old] == -1)
+ continue;
+ new++;
+ if (ctx->buffer_map [old] != new)
+ return new;
+ }
+ return -1;
+}
+
+/* finds the last fragment that is not going to get overwritten (that needs to
+ get read in) */
+static FatFragment
+get_last_underlay (const FatOpContext* ctx, int first, int last)
+{
+ int old;
+ FatFragment new;
+
+ PED_ASSERT (first <= last, return 0);
+
+ new = ctx->buffer_map [last];
+ for (old = last - 1; old >= first; old--) {
+ if (ctx->buffer_map [old] == -1)
+ continue;
+ new--;
+ if (ctx->buffer_map [old] != new)
+ return new;
+ }
+ return -1;
+}
+
+/* "underlay" refers to the "static" fragments, that remain unchanged.
+ * when writing large chunks at a time, we don't want to clobber these,
+ * so we read them in, and write them back again. MUCH quicker that way.
+ */
+static int
+quick_group_write_read_underlay (FatOpContext* ctx, int first, int last)
+{
+ FatSpecific* new_fs_info = FAT_SPECIFIC (ctx->new_fs);
+ FatFragment first_underlay;
+ FatFragment last_underlay;
+ FatFragment underlay_length;
+
+ PED_ASSERT (first <= last, return 0);
+
+ first_underlay = get_first_underlay (ctx, first, last);
+ if (first_underlay == -1)
+ return 1;
+ last_underlay = get_last_underlay (ctx, first, last);
+
+ PED_ASSERT (first_underlay <= last_underlay, return 0);
+
+ underlay_length = last_underlay - first_underlay + 1;
+ if (!fat_read_fragments (ctx->new_fs,
+ new_fs_info->buffer
+ + (first_underlay - ctx->buffer_map [first])
+ * new_fs_info->frag_size,
+ first_underlay,
+ underlay_length))
+ return 0;
+ return 1;
+}
+
+/* quick_group_write() makes no attempt to recover from errors - just
+ * does things fast. If there is an error, slow_group_write() is
+ * called.
+ * Note: we do syncing writes, to make sure there isn't any
+ * error writing out. It's rather difficult recovering from errors
+ * further on.
+ */
+static int
+quick_group_write (FatOpContext* ctx, int first, int last)
+{
+ FatSpecific* old_fs_info = FAT_SPECIFIC (ctx->old_fs);
+ FatSpecific* new_fs_info = FAT_SPECIFIC (ctx->new_fs);
+ int active_length;
+ int i;
+ int offset;
+
+ PED_ASSERT (first <= last, return 0);
+
+ ped_exception_fetch_all ();
+ if (!quick_group_write_read_underlay (ctx, first, last))
+ goto error;
+
+ for (i = first; i <= last; i++) {
+ if (ctx->buffer_map [i] == -1)
+ continue;
+
+ offset = ctx->buffer_map [i] - ctx->buffer_map [first];
+ memcpy (new_fs_info->buffer + offset * new_fs_info->frag_size,
+ old_fs_info->buffer + i * new_fs_info->frag_size,
+ new_fs_info->frag_size);
+ }
+
+ active_length = ctx->buffer_map [last] - ctx->buffer_map [first] + 1;
+ if (!fat_write_sync_fragments (ctx->new_fs, new_fs_info->buffer,
+ ctx->buffer_map [first], active_length))
+ goto error;
+
+ ped_exception_leave_all ();
+ return 1;
+
+error:
+ ped_exception_catch ();
+ ped_exception_leave_all ();
+ return 0;
+}
+
+/* Writes fragments out, one at a time, avoiding errors on redundant writes
+ * on damaged parts of the disk we already know about. If there's an error
+ * on one of the required fragments, it gets marked as bad, and a replacement
+ * is found.
+ */
+static int
+slow_group_write (FatOpContext* ctx, int first, int last)
+{
+ FatSpecific* old_fs_info = FAT_SPECIFIC (ctx->old_fs);
+ FatSpecific* new_fs_info = FAT_SPECIFIC (ctx->new_fs);
+ int i;
+
+ PED_ASSERT (first <= last, return 0);
+
+ for (i = first; i <= last; i++) {
+ if (ctx->buffer_map [i] == -1)
+ continue;
+
+ while (!fat_write_sync_fragment (ctx->new_fs,
+ old_fs_info->buffer + i * old_fs_info->frag_size,
+ ctx->buffer_map [i])) {
+ fat_table_set_bad (new_fs_info->fat,
+ ctx->buffer_map [i]);
+ ctx->buffer_map [i] = fat_table_alloc_cluster
+ (new_fs_info->fat);
+ if (ctx->buffer_map [i] == 0)
+ return 0;
+ }
+ }
+ return 1;
+}
+
+static int
+update_remap (FatOpContext* ctx, int first, int last)
+{
+ int i;
+
+ PED_ASSERT (first <= last, return 0);
+
+ for (i = first; i <= last; i++) {
+ if (ctx->buffer_map [i] == -1)
+ continue;
+ ctx->remap [ctx->buffer_offset + i] = ctx->buffer_map [i];
+ }
+
+ return 1;
+}
+
+static int
+group_write (FatOpContext* ctx, int first, int last)
+{
+ PED_ASSERT (first <= last, return 0);
+
+ if (!quick_group_write (ctx, first, last)) {
+ if (!slow_group_write (ctx, first, last))
+ return 0;
+ }
+ if (!update_remap (ctx, first, last))
+ return 0;
+ return 1;
+}
+
+/* assumes fragment size and new_fs's cluster size are equal */
+static int
+write_fragments (FatOpContext* ctx)
+{
+ FatSpecific* old_fs_info = FAT_SPECIFIC (ctx->old_fs);
+ FatSpecific* new_fs_info = FAT_SPECIFIC (ctx->new_fs);
+ int group_start;
+ int group_end = -1; /* shut gcc up! */
+ FatFragment mapped_length;
+ FatFragment i;
+ FatCluster new_cluster;
+
+ PED_ASSERT (ctx->buffer_offset < old_fs_info->frag_count, return 0);
+
+ group_start = -1;
+ for (i = 0; i < ctx->buffer_frags; i++) {
+ if (ctx->buffer_map [i] == -1)
+ continue;
+
+ ctx->frags_duped++;
+
+ new_cluster = fat_table_alloc_cluster (new_fs_info->fat);
+ if (!new_cluster)
+ return 0;
+ fat_table_set_eof (new_fs_info->fat, new_cluster);
+ ctx->buffer_map [i] = fat_cluster_to_frag (ctx->new_fs,
+ new_cluster);
+
+ if (group_start == -1)
+ group_start = group_end = i;
+
+ PED_ASSERT (ctx->buffer_map [i]
+ >= ctx->buffer_map [group_start],
+ return 0);
+
+ mapped_length = ctx->buffer_map [i]
+ - ctx->buffer_map [group_start] + 1;
+ if (mapped_length <= ctx->buffer_frags) {
+ group_end = i;
+ } else {
+ /* ran out of room in the buffer, so write this group,
+ * and start a new one...
+ */
+ if (!group_write (ctx, group_start, group_end))
+ return 0;
+ group_start = group_end = i;
+ }
+ }
+
+ PED_ASSERT (group_start != -1, return 0);
+
+ if (!group_write (ctx, group_start, group_end))
+ return 0;
+ return 1;
+}
+
+/* default all fragments to unmoved
+ */
+static void
+init_remap (FatOpContext* ctx)
+{
+ FatSpecific* old_fs_info = FAT_SPECIFIC (ctx->old_fs);
+ FatFragment i;
+
+ for (i = 0; i < old_fs_info->frag_count; i++)
+ ctx->remap[i] = fat_op_context_map_static_fragment (ctx, i);
+}
+
+static FatFragment
+count_frags_to_dup (FatOpContext* ctx)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (ctx->old_fs);
+ FatFragment i;
+ FatFragment total;
+
+ total = 0;
+
+ for (i = 0; i < fs_info->frag_count; i++) {
+ if (needs_duplicating (ctx, i))
+ total++;
+ }
+
+ return total;
+}
+
+/* duplicates unreachable file clusters, and all directory clusters
+ */
+int
+fat_duplicate_clusters (FatOpContext* ctx, PedTimer* timer)
+{
+ FatSpecific* old_fs_info = FAT_SPECIFIC (ctx->old_fs);
+ FatFragment total_frags_to_dup;
+
+ init_remap (ctx);
+ total_frags_to_dup = count_frags_to_dup (ctx);
+
+ ped_timer_reset (timer);
+ ped_timer_set_state_name (timer, "moving data");
+
+ ctx->buffer_offset = 0;
+ ctx->frags_duped = 0;
+ while (search_next_fragment (ctx)) {
+ ped_timer_update (
+ timer, 1.0 * ctx->frags_duped / total_frags_to_dup);
+
+ if (!fetch_fragments (ctx))
+ return 0;
+ if (!write_fragments (ctx))
+ return 0;
+ ctx->buffer_offset += ctx->buffer_frags;
+ }
+
+ ped_timer_update (timer, 1.0);
+ return 1;
+}
+
+#endif /* !DISCOVER_ONLY */
diff --git a/libparted/fs/fat/clstdup.h b/libparted/fs/fat/clstdup.h
new file mode 100644
index 0000000..e99a2d3
--- /dev/null
+++ b/libparted/fs/fat/clstdup.h
@@ -0,0 +1,29 @@
+/*
+ libparted
+ Copyright (C) 1999 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef PED_FAT_CLSTDUP_H_INCLUDED
+#define PED_FAT_CLSTDUP_H_INCLUDED
+
+#include "context.h"
+
+/* the big important one :-) */
+extern int fat_duplicate_clusters (FatOpContext* ctx, PedTimer* timer);
+
+#endif /* PED_FAT_CLSTDUP_H_INCLUDED */
+
diff --git a/libparted/fs/fat/context.c b/libparted/fs/fat/context.c
new file mode 100644
index 0000000..9cb3366
--- /dev/null
+++ b/libparted/fs/fat/context.c
@@ -0,0 +1,260 @@
+/*
+ libparted
+ Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#include <string.h>
+
+#include "fat.h"
+
+#ifndef DISCOVER_ONLY
+
+/* Note: this deals with file system start and end sectors, even if the physical
+ * devices are different (eg for fat_copy()) Perhaps this is a hack, but it
+ * works ;-)
+ */
+static int
+calc_deltas (FatOpContext* ctx)
+{
+ PedFileSystem* old_fs = ctx->old_fs;
+ PedFileSystem* new_fs = ctx->new_fs;
+ FatSpecific* old_fs_info = FAT_SPECIFIC (old_fs);
+ FatSpecific* new_fs_info = FAT_SPECIFIC (new_fs);
+ PedSector old_cluster_ofs;
+ PedSector new_cluster_ofs;
+ PedSector sector_delta;
+
+ old_cluster_ofs = old_fs->geom->start + old_fs_info->cluster_offset;
+ new_cluster_ofs = new_fs->geom->start + new_fs_info->cluster_offset;
+
+ if (new_cluster_ofs > old_cluster_ofs) {
+ ctx->start_move_dir = FAT_DIR_FORWARD;
+ sector_delta = new_cluster_ofs - old_cluster_ofs;
+ } else {
+ ctx->start_move_dir = FAT_DIR_BACKWARD;
+ sector_delta = old_cluster_ofs - new_cluster_ofs;
+ }
+
+ if (sector_delta % new_fs_info->cluster_sectors) {
+ ped_exception_throw (
+ PED_EXCEPTION_BUG, PED_EXCEPTION_CANCEL,
+ _("Cluster start delta = %d, which is not a multiple "
+ "of the cluster size %d."),
+ (int) sector_delta,
+ (int) new_fs_info->cluster_sectors);
+ return 0;
+ }
+
+ ctx->start_move_delta = sector_delta / ctx->frag_sectors;
+
+#ifdef PED_VERBOSE
+ printf ("Start move delta is: %d %s.\n",
+ (int) ctx->start_move_delta,
+ (ctx->start_move_dir == FAT_DIR_FORWARD)?
+ "forwards" : "backwards");
+#endif
+
+ return 1;
+}
+
+FatOpContext*
+fat_op_context_new (PedFileSystem* new_fs, PedFileSystem* old_fs)
+{
+ FatSpecific* old_fs_info = FAT_SPECIFIC (old_fs);
+ FatSpecific* new_fs_info = FAT_SPECIFIC (new_fs);
+ FatOpContext* ctx;
+
+ ctx = (FatOpContext*) ped_malloc (sizeof (FatOpContext));
+ if (!ctx)
+ goto error;
+
+ ctx->frag_sectors = PED_MIN (old_fs_info->cluster_sectors,
+ new_fs_info->cluster_sectors);
+ if (!fat_set_frag_sectors (new_fs, ctx->frag_sectors))
+ goto error;
+ if (!fat_set_frag_sectors (old_fs, ctx->frag_sectors))
+ goto error;
+
+ ctx->buffer_frags = old_fs_info->buffer_sectors / ctx->frag_sectors;
+ ctx->buffer_map = (FatFragment*) ped_malloc (sizeof (FatFragment)
+ * ctx->buffer_frags);
+ if (!ctx->buffer_map)
+ goto error_free_ctx;
+
+ ctx->remap = (FatFragment*) ped_malloc (sizeof (FatFragment)
+ * old_fs_info->frag_count);
+ if (!ctx->remap)
+ goto error_free_buffer_map;
+
+ ctx->new_fs = new_fs;
+ ctx->old_fs = old_fs;
+ if (!calc_deltas (ctx))
+ goto error_free_buffer_map;
+
+ return ctx;
+
+error_free_buffer_map:
+ ped_free (ctx->buffer_map);
+error_free_ctx:
+ ped_free (ctx);
+error:
+ return NULL;
+}
+
+void
+fat_op_context_destroy (FatOpContext* ctx)
+{
+ ped_free (ctx->buffer_map);
+ ped_free (ctx->remap);
+ ped_free (ctx);
+}
+
+FatFragment
+fat_op_context_map_static_fragment (const FatOpContext* ctx, FatFragment frag)
+{
+ FatSpecific* new_fs_info = FAT_SPECIFIC (ctx->new_fs);
+ FatFragment result;
+
+ if (ctx->new_fs->geom->dev != ctx->old_fs->geom->dev)
+ return -1;
+
+ if (ctx->start_move_dir == FAT_DIR_FORWARD) {
+ if (frag < ctx->start_move_delta)
+ return -1;
+ result = frag - ctx->start_move_delta;
+ } else {
+ result = frag + ctx->start_move_delta;
+ }
+
+ if (result >= new_fs_info->frag_count)
+ return -1;
+
+ return result;
+}
+
+FatCluster
+fat_op_context_map_static_cluster (const FatOpContext* ctx, FatCluster clst)
+{
+ FatFragment mapped_frag;
+
+ mapped_frag = fat_op_context_map_static_fragment (ctx,
+ fat_cluster_to_frag (ctx->old_fs, clst));
+ if (mapped_frag != -1)
+ return fat_frag_to_cluster (ctx->new_fs, mapped_frag);
+ else
+ return 0;
+}
+
+FatFragment
+fat_op_context_map_fragment (const FatOpContext* ctx, FatFragment frag)
+{
+ return ctx->remap [frag];
+}
+
+FatCluster
+fat_op_context_map_cluster (const FatOpContext* ctx, FatCluster clst)
+{
+ FatFragment mapped_frag;
+
+ mapped_frag = fat_op_context_map_fragment (ctx,
+ fat_cluster_to_frag (ctx->old_fs, clst));
+ if (mapped_frag != -1)
+ return fat_frag_to_cluster (ctx->new_fs, mapped_frag);
+ else
+ return 0;
+}
+
+/* This function sets the initial fat for the new resized file system.
+ This is in *NO WAY* a proper FAT table - all it does is:
+ a) mark bad clusters as bad.
+ b) mark used clusters (that is, clusters from the original FS that are
+ reachable from the resized one). Marks as EOF (i.e. used, end of
+ file chain).
+ c) mark original file system metadata as EOF (i.e. used), to prevent
+ it from being clobbered. This will leave the original file system
+ intact, until the partition table is modified, if the start of
+ the partition is moved.
+
+ The FATs are rebuilt *properly* after cluster relocation. This here is
+ only to mark clusters as used, so when cluster relocation occurs, clusters
+ aren't relocated on top of ones marked in a, b or c.
+*/
+int
+fat_op_context_create_initial_fat (FatOpContext* ctx)
+{
+ FatSpecific* old_fs_info = FAT_SPECIFIC (ctx->old_fs);
+ FatSpecific* new_fs_info = FAT_SPECIFIC (ctx->new_fs);
+ FatCluster clst;
+ FatCluster new_clst;
+ PedSector sect;
+ PedSector new_sect;
+ FatFragment frag;
+ FatFragment new_frag;
+ FatClusterFlag frag_flag;
+
+ new_fs_info->fat = fat_table_new (
+ new_fs_info->fat_type,
+ new_fs_info->fat_sectors * 512
+ / fat_table_entry_size (new_fs_info->fat_type));
+ if (!new_fs_info->fat)
+ return 0;
+
+ if (!fat_table_set_cluster_count (new_fs_info->fat,
+ new_fs_info->cluster_count))
+ return 0;
+
+/* mark bad and used clusters */
+ for (frag = 0; frag < old_fs_info->frag_count; frag++) {
+ frag_flag = fat_get_fragment_flag (ctx->old_fs, frag);
+ if (frag_flag == FAT_FLAG_FREE)
+ continue;
+
+ new_frag = fat_op_context_map_static_fragment (ctx, frag);
+ if (new_frag == -1)
+ continue;
+
+ new_clst = fat_frag_to_cluster (ctx->new_fs, new_frag);
+ PED_ASSERT (new_clst != 0, return 0);
+
+ if (frag_flag == FAT_FLAG_BAD) {
+ if (!fat_table_set_bad (new_fs_info->fat, new_clst))
+ return 0;
+ } else {
+ if (!fat_table_set_eof (new_fs_info->fat, new_clst))
+ return 0;
+ }
+ }
+
+/* mark metadata regions that map to clusters on the new FS */
+ for (sect = 0; sect < old_fs_info->cluster_offset; sect++) {
+ new_sect = ped_geometry_map (ctx->new_fs->geom,
+ ctx->old_fs->geom, sect);
+ if (new_sect == -1
+ || !fat_is_sector_in_clusters (ctx->new_fs, new_sect))
+ continue;
+
+ clst = fat_sector_to_cluster (ctx->new_fs, new_sect);
+ PED_ASSERT (clst != 0, return 0);
+
+ if (!fat_table_set_eof (new_fs_info->fat, clst))
+ return 0;
+ }
+
+ return 1;
+}
+
+#endif /* !DISCOVER_ONLY */
diff --git a/libparted/fs/fat/context.h b/libparted/fs/fat/context.h
new file mode 100644
index 0000000..f552bcb
--- /dev/null
+++ b/libparted/fs/fat/context.h
@@ -0,0 +1,70 @@
+/*
+ libparted
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef PED_FAT_CONTEXT_H_INCLUDED
+#define PED_FAT_CONTEXT_H_INCLUDED
+
+#include "count.h"
+
+enum _FatDirection {
+ FAT_DIR_FORWARD,
+ FAT_DIR_BACKWARD
+};
+typedef enum _FatDirection FatDirection;
+
+struct _FatOpContext {
+ PedFileSystem* old_fs;
+ PedFileSystem* new_fs;
+
+ PedSector frag_sectors; /* should equal old_fs and
+ new_fs's frag_sectors */
+
+ FatDirection start_move_dir;
+ FatFragment start_move_delta;
+
+ FatFragment buffer_offset;
+ FatFragment buffer_frags;
+ FatFragment* buffer_map;
+
+ FatFragment frags_duped;
+
+ FatFragment* remap;
+
+ FatCluster new_root_dir [32];
+};
+typedef struct _FatOpContext FatOpContext;
+
+extern FatOpContext* fat_op_context_new (PedFileSystem* new_fs,
+ PedFileSystem* old_fs);
+
+extern void fat_op_context_destroy (FatOpContext* ctx);
+
+extern FatFragment fat_op_context_map_static_fragment (const FatOpContext* ctx,
+ FatFragment frag);
+extern FatCluster fat_op_context_map_static_cluster (const FatOpContext* ctx,
+ FatCluster clst);
+
+extern FatFragment fat_op_context_map_fragment (const FatOpContext* ctx,
+ FatFragment frag);
+extern FatCluster fat_op_context_map_cluster (const FatOpContext* ctx,
+ FatCluster clst);
+
+extern int fat_op_context_create_initial_fat (FatOpContext* ctx);
+
+#endif /* PED_FAT_CONTEXT_H_INCLUDED */
diff --git a/libparted/fs/fat/count.c b/libparted/fs/fat/count.c
new file mode 100644
index 0000000..747f3ef
--- /dev/null
+++ b/libparted/fs/fat/count.c
@@ -0,0 +1,410 @@
+/*
+ libparted
+ Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+
+ I can also be contacted at:
+
+ Andrew Clausen
+ 18 Shaw St
+ Ashwood, 3147
+ Victoria, Australia
+
+*/
+
+#include "fat.h"
+#include "traverse.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifndef DISCOVER_ONLY
+
+#if 0
+/* extremely ugly hack: stick everything that obviously isn't an unmovable file
+ * in here. Note: DAT is a bit dubious. Unfortunately, it's used by the
+ * registry, so it'll be all over the place :-(
+ */
+static char* movable_extensions[] = {
+ "",
+ "1ST",
+ "AVI",
+ "BAK", "BAT", "BMP",
+ "CFG", "COM", "CSS",
+ "DAT", "DLL", "DOC", "DRV",
+ "EXE",
+ "FAQ", "FLT", "FON",
+ "GID", "GIF",
+ "HLP", "HTT", "HTM",
+ "ICO", "INI",
+ "JPG",
+ "LNK", "LOG",
+ "KBD",
+ "ME", "MID", "MSG",
+ "OCX", "OLD",
+ "PIF", "PNG", "PRV",
+ "RTF",
+ "SCR", "SYS",
+ "TMP", "TTF", "TXT",
+ "URL",
+ "WAV",
+ "VBX", "VOC", "VXD",
+ NULL
+};
+
+static char*
+get_extension (char* file_name)
+{
+ char* ext;
+
+ ext = strrchr (file_name, '.');
+ if (!ext)
+ return "";
+ if (strchr (ext, '\\'))
+ return "";
+ return ext + 1;
+}
+
+static int
+is_movable_system_file (char* file_name)
+{
+ char* ext = get_extension (file_name);
+ int i;
+
+ for (i = 0; movable_extensions [i]; i++) {
+ if (strcasecmp (ext, movable_extensions [i]) == 0)
+ return 1;
+ }
+
+ return 0;
+}
+#endif /* 0 */
+
+/*
+ prints out the sequence of clusters for a given file chain, beginning
+ at start_cluster.
+*/
+static void
+print_chain (PedFileSystem* fs, FatCluster start)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ FatCluster clst;
+ int this_row;
+
+ this_row = 0;
+ for (clst = start; !fat_table_is_eof (fs_info->fat, clst);
+ clst = fat_table_get (fs_info->fat, clst)) {
+ printf (" %d", (int) clst);
+ if (++this_row == 7) {
+ printf ("\n");
+ this_row = 0;
+ }
+ }
+ printf ("\n");
+}
+
+static PedSector
+remainder_round_up (PedSector a, PedSector b)
+{
+ PedSector result;
+
+ result = a % b;
+ if (!result)
+ result = b;
+ return result;
+}
+
+/*
+ traverse the FAT for a file/directory, marking each entry's flag
+ to "flag".
+*/
+static int
+flag_traverse_fat (PedFileSystem* fs, const char* chain_name, FatCluster start,
+ FatClusterFlag flag, PedSector size)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ FatCluster clst;
+ FatCluster prev_clst;
+ int last_cluster_usage;
+ FatCluster chain_length = 0;
+
+ if (fat_table_is_eof (fs_info->fat, start)) {
+ if (ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("Bad directory entry for %s: first cluster is the "
+ "end of file marker."),
+ chain_name)
+ != PED_EXCEPTION_IGNORE)
+ return 0;
+ }
+
+ for (prev_clst = clst = start; !fat_table_is_eof (fs_info->fat, clst);
+ prev_clst = clst, clst = fat_table_get (fs_info->fat, clst)) {
+ chain_length++;
+ if (!clst) {
+ ped_exception_throw (PED_EXCEPTION_FATAL,
+ PED_EXCEPTION_CANCEL,
+ _("Bad FAT: unterminated chain for %s. You "
+ "should run dosfsck or scandisk."),
+ chain_name);
+ return 0;
+ }
+
+ if (clst >= fs_info->fat->cluster_count + 2) {
+ ped_exception_throw (PED_EXCEPTION_FATAL,
+ PED_EXCEPTION_CANCEL,
+ _("Bad FAT: cluster %d outside file system "
+ "in chain for %s. You should run dosfsck "
+ "or scandisk."),
+ (int) clst, chain_name);
+ return 0;
+ }
+
+ if (fs_info->cluster_info [clst].flag != FAT_FLAG_FREE ) {
+ ped_exception_throw (PED_EXCEPTION_FATAL,
+ PED_EXCEPTION_CANCEL,
+ _("Bad FAT: cluster %d is cross-linked for "
+ "%s. You should run dosfsck or scandisk."),
+ (int) clst, chain_name);
+ return 0;
+ }
+
+ if (flag == FAT_FLAG_DIRECTORY)
+ fs_info->total_dir_clusters++;
+
+ fs_info->cluster_info [clst].flag = flag;
+ fs_info->cluster_info [clst].units_used = 0; /* 0 == 64 */
+ }
+
+ if (size
+ && chain_length
+ != ped_div_round_up (size, fs_info->cluster_sectors)) {
+ if (ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("%s is %dk, but it has %d clusters (%dk)."),
+ chain_name,
+ (int) size / 2,
+ (int) chain_length,
+ (int) chain_length * fs_info->cluster_sectors / 2)
+ != PED_EXCEPTION_IGNORE)
+ return 0;
+ }
+
+ last_cluster_usage
+ = ped_div_round_up (64 * remainder_round_up (size,
+ fs_info->cluster_sectors),
+ fs_info->cluster_sectors);
+
+ fs_info->cluster_info [prev_clst].units_used = last_cluster_usage;
+
+ return 1;
+}
+
+/*
+ recursively traverses a directory, flagging all clusters in the process.
+ It frees the traverse_info structure before returning.
+*/
+static int
+flag_traverse_dir (FatTraverseInfo* trav_info) {
+ PedFileSystem* fs = trav_info->fs;
+ FatDirEntry* this_entry;
+ FatTraverseInfo* subdir_trav_info;
+ char file_name [512];
+ char* file_name_start;
+ FatCluster first_cluster;
+ PedSector size;
+ PedExceptionOption ex_status;
+
+ PED_ASSERT (trav_info != NULL, return 0);
+
+ strcpy (file_name, trav_info->dir_name);
+ file_name_start = file_name + strlen (file_name);
+
+ while ( (this_entry = fat_traverse_next_dir_entry (trav_info)) ) {
+ if (fat_dir_entry_is_null_term (this_entry))
+ break;
+ if (!fat_dir_entry_has_first_cluster (this_entry, fs))
+ continue;
+ if (this_entry->name [0] == '.')
+ continue; /* skip . and .. entries */
+
+ fat_dir_entry_get_name (this_entry, file_name_start);
+ first_cluster = fat_dir_entry_get_first_cluster(this_entry, fs);
+ size = ped_div_round_up (fat_dir_entry_get_length (this_entry),
+ 512);
+
+#ifdef PED_VERBOSE
+ printf ("%s: ", file_name);
+ print_chain (fs, first_cluster);
+#endif
+
+#if 0
+ if (fat_dir_entry_is_system_file (this_entry)
+ && !is_movable_system_file (file_name)) {
+ ex_status = ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("The file %s is marked as a system file. "
+ "This means moving it could cause some "
+ "programs to stop working."),
+ file_name);
+
+ switch (ex_status) {
+ case PED_EXCEPTION_CANCEL:
+ return 0;
+
+ case PED_EXCEPTION_UNHANDLED:
+ ped_exception_catch ();
+ case PED_EXCEPTION_IGNORE:
+ }
+ }
+#endif /* 0 */
+
+ if (fat_dir_entry_is_directory (this_entry)) {
+ if (!flag_traverse_fat (fs, file_name, first_cluster,
+ FAT_FLAG_DIRECTORY, size))
+ return 0;
+
+ subdir_trav_info = fat_traverse_directory (trav_info,
+ this_entry);
+ if (!subdir_trav_info)
+ return 0;
+ if (!flag_traverse_dir (subdir_trav_info))
+ return 0;
+ } else if (fat_dir_entry_is_file (this_entry)) {
+ if (!flag_traverse_fat (fs, file_name, first_cluster,
+ FAT_FLAG_FILE, size))
+ return 0;
+ }
+ }
+
+ fat_traverse_complete (trav_info);
+ return 1;
+}
+
+static void
+_mark_bad_clusters (PedFileSystem* fs)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ FatCluster cluster;
+ FatFragment frag;
+
+ for (cluster = 2; cluster < fs_info->cluster_count + 2; cluster++) {
+ if (fat_table_is_bad (fs_info->fat, cluster))
+ fs_info->cluster_info [cluster].flag = FAT_FLAG_BAD;
+ }
+}
+
+/*
+ fills in cluster_info. Each FAT entry (= cluster) is flagged as either
+ FAT_FLAG_FREE, FAT_FLAG_FILE or FAT_FLAG_DIRECTORY.
+
+ Also, the fraction of each cluster (x/64) is recorded
+*/
+int
+fat_collect_cluster_info (PedFileSystem* fs) {
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ FatTraverseInfo* trav_info;
+
+ /* set all clusters to unused as a default */
+ memset (fs_info->cluster_info, 0, fs_info->fat->cluster_count + 2);
+ fs_info->total_dir_clusters = 0;
+
+ if (fs_info->fat_type == FAT_TYPE_FAT32) {
+ trav_info = fat_traverse_begin (fs, fs_info->root_cluster,
+ "\\");
+ if (!flag_traverse_dir (trav_info))
+ return 0;
+ if (!flag_traverse_fat (fs, "\\", fs_info->root_cluster,
+ FAT_FLAG_DIRECTORY, 0))
+ return 0;
+ } else {
+ trav_info = fat_traverse_begin (fs, FAT_ROOT, "\\");
+ if (!flag_traverse_dir (trav_info))
+ return 0;
+ }
+
+ _mark_bad_clusters (fs);
+ return 1;
+}
+
+FatClusterFlag
+fat_get_cluster_flag (PedFileSystem* fs, FatCluster cluster)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+
+ return fs_info->cluster_info [cluster].flag;
+}
+
+PedSector
+fat_get_cluster_usage (PedFileSystem* fs, FatCluster cluster)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ int fraction;
+
+ if (fs_info->cluster_info [cluster].flag == FAT_FLAG_FREE)
+ return 0;
+
+ fraction = fs_info->cluster_info [cluster].units_used;
+ if (fraction == 0)
+ fraction = 64;
+
+ return fraction * fs_info->cluster_sectors / 64;
+}
+
+FatClusterFlag
+fat_get_fragment_flag (PedFileSystem* fs, FatFragment frag)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ FatCluster cluster = fat_frag_to_cluster (fs, frag);
+ FatFragment offset = frag % fs_info->cluster_frags;
+ FatFragment last_frag_used;
+ FatClusterFlag flag;
+
+ PED_ASSERT (cluster >= 2 && cluster < fs_info->cluster_count + 2,
+ return 0);
+
+ flag = fat_get_cluster_flag (fs, cluster);
+ if (flag != FAT_FLAG_FILE && flag != FAT_FLAG_DIRECTORY)
+ return flag;
+ last_frag_used = (fat_get_cluster_usage (fs, cluster) - 1)
+ / fs_info->frag_sectors;
+ if (offset > last_frag_used)
+ return FAT_FLAG_FREE;
+ else
+ return flag;
+}
+
+int
+fat_is_fragment_active (PedFileSystem* fs, FatFragment frag)
+{
+ switch (fat_get_fragment_flag (fs, frag)) {
+ case FAT_FLAG_FREE:
+ case FAT_FLAG_BAD:
+ return 0;
+
+ case FAT_FLAG_FILE:
+ case FAT_FLAG_DIRECTORY:
+ return 1;
+ }
+ return 0;
+}
+
+#endif /* !DISCOVER_ONLY */
+
diff --git a/libparted/fs/fat/count.h b/libparted/fs/fat/count.h
new file mode 100644
index 0000000..38b2c56
--- /dev/null
+++ b/libparted/fs/fat/count.h
@@ -0,0 +1,52 @@
+/*
+ libparted
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+
+ I can also be contacted at:
+
+ Andrew Clausen
+ 18 Shaw St
+ Ashwood, 3147
+ Victoria, Australia
+*/
+
+#ifndef COUNT_H_INCLUDED
+#define COUNT_H_INCLUDED
+
+enum _FatClusterFlag {
+ FAT_FLAG_FREE=0,
+ FAT_FLAG_FILE=1,
+ FAT_FLAG_DIRECTORY=2,
+ FAT_FLAG_BAD=3
+};
+typedef enum _FatClusterFlag FatClusterFlag;
+
+struct _FatClusterInfo {
+ unsigned int units_used:6; /* 1 unit = cluster_size / 64 */
+ FatClusterFlag flag:2;
+} __attribute__ ((packed)) fat16;
+typedef struct _FatClusterInfo FatClusterInfo;
+
+extern int fat_collect_cluster_info (PedFileSystem *fs);
+extern FatClusterFlag fat_get_cluster_flag (PedFileSystem* fs,
+ FatCluster cluster);
+extern PedSector fat_get_cluster_usage (PedFileSystem* fs, FatCluster cluster);
+extern FatClusterFlag fat_get_fragment_flag (PedFileSystem* fs,
+ FatFragment frag);
+extern int fat_is_fragment_active (PedFileSystem* fs, FatFragment frag);
+
+#endif /* COUNT_H_INCLUDED */
diff --git a/libparted/fs/fat/fat.c b/libparted/fs/fat/fat.c
new file mode 100644
index 0000000..ee06f1a
--- /dev/null
+++ b/libparted/fs/fat/fat.c
@@ -0,0 +1,888 @@
+/*
+ libparted
+ Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#include <string.h>
+#include <uuid/uuid.h>
+
+#include "fat.h"
+#include "calc.h"
+
+PedFileSystem*
+fat_alloc (const PedGeometry* geom)
+{
+ PedFileSystem* fs;
+
+ fs = (PedFileSystem*) ped_malloc (sizeof (PedFileSystem));
+ if (!fs)
+ goto error;
+
+ fs->type_specific = (FatSpecific*) ped_malloc (sizeof (FatSpecific));
+ if (!fs->type_specific)
+ goto error_free_fs;
+
+ fs->geom = ped_geometry_duplicate (geom);
+ if (!fs->geom)
+ goto error_free_type_specific;
+
+ fs->checked = 0;
+ return fs;
+
+error_free_type_specific:
+ ped_free (fs->type_specific);
+error_free_fs:
+ ped_free (fs);
+error:
+ return NULL;
+}
+
+/* Requires the boot sector to be analysed */
+int
+fat_alloc_buffers (PedFileSystem* fs)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+
+ fs_info->buffer_sectors = BUFFER_SIZE;
+ fs_info->buffer = ped_malloc (fs_info->buffer_sectors * 512);
+ if (!fs_info->buffer)
+ goto error;
+
+ fs_info->cluster_info = ped_malloc (fs_info->cluster_count + 2);
+ if (!fs_info->cluster_info)
+ goto error_free_buffer;
+
+ return 1;
+
+error_free_buffer:
+ ped_free (fs_info->buffer);
+error:
+ return 0;
+};
+
+void
+fat_free_buffers (PedFileSystem* fs)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+
+ ped_free (fs_info->cluster_info);
+ ped_free (fs_info->buffer);
+}
+
+void
+fat_free (PedFileSystem* fs)
+{
+ ped_geometry_destroy (fs->geom);
+ ped_free (fs->type_specific);
+ ped_free (fs);
+}
+
+int
+fat_set_frag_sectors (PedFileSystem* fs, PedSector frag_sectors)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+
+ PED_ASSERT (fs_info->cluster_sectors % frag_sectors == 0
+ && frag_sectors <= fs_info->cluster_sectors,
+ return 0);
+
+ fs_info->frag_size = frag_sectors * 512;
+ fs_info->frag_sectors = frag_sectors;
+ fs_info->buffer_frags = fs_info->buffer_sectors / frag_sectors;
+ fs_info->cluster_frags = fs_info->cluster_sectors / frag_sectors;
+ fs_info->frag_count = fs_info->cluster_count * fs_info->cluster_frags;
+
+ return 1;
+}
+
+PedGeometry*
+fat_probe (PedGeometry* geom, FatType* fat_type)
+{
+ PedFileSystem* fs;
+ FatSpecific* fs_info;
+ PedGeometry* result;
+
+ fs = fat_alloc (geom);
+ if (!fs)
+ goto error;
+ fs_info = (FatSpecific*) fs->type_specific;
+
+ if (!fat_boot_sector_read (&fs_info->boot_sector, geom))
+ goto error_free_fs;
+ if (!fat_boot_sector_analyse (&fs_info->boot_sector, fs))
+ goto error_free_fs;
+
+ *fat_type = fs_info->fat_type;
+ result = ped_geometry_new (geom->dev, geom->start,
+ fs_info->sector_count);
+
+ fat_free (fs);
+ return result;
+
+error_free_fs:
+ fat_free (fs);
+error:
+ return NULL;
+}
+
+PedGeometry*
+fat_probe_fat16 (PedGeometry* geom)
+{
+ FatType fat_type;
+ PedGeometry* probed_geom = fat_probe (geom, &fat_type);
+
+ if (probed_geom) {
+ if (fat_type == FAT_TYPE_FAT16)
+ return probed_geom;
+ ped_geometry_destroy (probed_geom);
+ }
+ return NULL;
+}
+
+PedGeometry*
+fat_probe_fat32 (PedGeometry* geom)
+{
+ FatType fat_type;
+ PedGeometry* probed_geom = fat_probe (geom, &fat_type);
+
+ if (probed_geom) {
+ if (fat_type == FAT_TYPE_FAT32)
+ return probed_geom;
+ ped_geometry_destroy (probed_geom);
+ }
+ return NULL;
+}
+
+#ifndef DISCOVER_ONLY
+int
+fat_clobber (PedGeometry* geom)
+{
+ FatBootSector boot_sector;
+
+ if (!fat_boot_sector_read (&boot_sector, geom))
+ return 1;
+
+ boot_sector.system_id[0] = 0;
+ boot_sector.boot_sign = 0;
+ if (boot_sector.u.fat16.fat_name[0] == 'F')
+ boot_sector.u.fat16.fat_name[0] = 0;
+ if (boot_sector.u.fat32.fat_name[0] == 'F')
+ boot_sector.u.fat32.fat_name[0] = 0;
+
+ return ped_geometry_write (geom, &boot_sector, 0, 1);
+}
+
+static int
+_init_fats (PedFileSystem* fs)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ int i;
+ FatCluster table_size;
+
+ table_size = fs_info->fat_sectors * 512
+ / fat_table_entry_size (fs_info->fat_type);
+ fs_info->fat = fat_table_new (fs_info->fat_type, table_size);
+ if (!fs_info->fat)
+ goto error;
+
+ if (!fat_table_read (fs_info->fat, fs, 0))
+ goto error_free_fat;
+
+ return 1;
+
+error_free_fat:
+ fat_table_destroy (fs_info->fat);
+error:
+ return 0;
+}
+
+PedFileSystem*
+fat_open (PedGeometry* geom)
+{
+ PedFileSystem* fs;
+ FatSpecific* fs_info;
+
+ fs = fat_alloc (geom);
+ if (!fs)
+ goto error;
+ fs_info = (FatSpecific*) fs->type_specific;
+
+ if (!fat_boot_sector_read (&fs_info->boot_sector, geom))
+ goto error_free_fs;
+ if (!fat_boot_sector_analyse (&fs_info->boot_sector, fs))
+ goto error_free_fs;
+ fs->type = (fs_info->fat_type == FAT_TYPE_FAT16)
+ ? &fat16_type
+ : &fat32_type;
+ if (fs_info->fat_type == FAT_TYPE_FAT32) {
+ if (!fat_info_sector_read (&fs_info->info_sector, fs))
+ goto error_free_fs;
+ }
+
+ if (!_init_fats (fs))
+ goto error_free_fs;
+ if (!fat_alloc_buffers (fs))
+ goto error_free_fat_table;
+ if (!fat_collect_cluster_info (fs))
+ goto error_free_buffers;
+
+ return fs;
+
+error_free_buffers:
+ fat_free_buffers (fs);
+error_free_fat_table:
+ fat_table_destroy (fs_info->fat);
+error_free_fs:
+ fat_free (fs);
+error:
+ return NULL;
+}
+
+static int
+fat_root_dir_clear (PedFileSystem* fs)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ memset (fs_info->buffer, 0, 512 * fs_info->root_dir_sector_count);
+ return ped_geometry_write (fs->geom, fs_info->buffer,
+ fs_info->root_dir_offset,
+ fs_info->root_dir_sector_count);
+}
+
+/* hack: use the ext2 uuid library to generate a reasonably random (hopefully
+ * with /dev/random) number. Unfortunately, we can only use 4 bytes of it
+ */
+static uint32_t
+_gen_new_serial_number ()
+{
+ uuid_t uuid;
+
+ uuid_generate (uuid);
+ return * (uint32_t*) &uuid [0];
+}
+
+PedFileSystem*
+fat_create (PedGeometry* geom, FatType fat_type, PedTimer* timer)
+{
+ PedFileSystem* fs;
+ FatSpecific* fs_info;
+ FatCluster table_size;
+
+ fs = fat_alloc (geom);
+ if (!fs)
+ goto error;
+ fs_info = (FatSpecific*) fs->type_specific;
+
+ fs_info->logical_sector_size = 1;
+ fs_info->sectors_per_track = geom->dev->bios_geom.sectors;
+ fs_info->heads = geom->dev->bios_geom.heads;
+ fs_info->sector_count = fs->geom->length;
+ fs_info->fat_table_count = 2;
+/* some initial values, to be changed later */
+ fs_info->root_dir_sector_count = FAT_ROOT_DIR_ENTRY_COUNT
+ / (512 / sizeof (FatDirEntry));
+ fs_info->root_dir_entry_count = FAT_ROOT_DIR_ENTRY_COUNT;
+
+ fs_info->fat_type = fat_type;
+ if (!fat_calc_sizes (fs->geom->length, 0,
+ fs_info->fat_type,
+ fs_info->root_dir_sector_count,
+ &fs_info->cluster_sectors,
+ &fs_info->cluster_count,
+ &fs_info->fat_sectors)) {
+ ped_exception_throw (PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Partition too big/small for a %s file system."),
+ (fat_type == FAT_TYPE_FAT16)
+ ? fat16_type.name
+ : fat32_type.name);
+ goto error_free_fs;
+ }
+
+ fs_info->cluster_size = fs_info->cluster_sectors * 512;
+
+ fs_info->fat_offset = fat_min_reserved_sector_count (fs_info->fat_type);
+ fs_info->dir_entries_per_cluster
+ = fs_info->cluster_size / sizeof (FatDirEntry);
+
+ if (fs_info->fat_type == FAT_TYPE_FAT16) {
+ /* FAT16 */
+ fs->type = &fat16_type;
+
+ if (fs_info->cluster_count
+ > fat_max_cluster_count (fs_info->fat_type)) {
+ fs_info->cluster_count
+ = fat_max_cluster_count (fs_info->fat_type);
+ }
+
+ fs_info->root_dir_sector_count
+ = FAT_ROOT_DIR_ENTRY_COUNT
+ / (512 / sizeof (FatDirEntry));
+ fs_info->root_dir_entry_count = FAT_ROOT_DIR_ENTRY_COUNT;
+ fs_info->root_dir_offset
+ = fs_info->fat_offset
+ + fs_info->fat_sectors * fs_info->fat_table_count;
+ fs_info->cluster_offset
+ = fs_info->root_dir_offset
+ + fs_info->root_dir_sector_count;
+ } else {
+ /* FAT32 */
+ fs->type = &fat32_type;
+
+ fs_info->info_sector_offset = 1;
+ fs_info->boot_sector_backup_offset = 6;
+
+ fs_info->root_dir_sector_count = 0;
+ fs_info->root_dir_entry_count = 0;
+ fs_info->root_dir_offset = 0;
+
+ fs_info->cluster_offset
+ = fs_info->fat_offset
+ + fs_info->fat_sectors * fs_info->fat_table_count;
+ }
+
+ table_size = fs_info->fat_sectors * 512
+ / fat_table_entry_size (fs_info->fat_type);
+ fs_info->fat = fat_table_new (fs_info->fat_type, table_size);
+ if (!fs_info->fat)
+ goto error_free_fs;
+ fat_table_set_cluster_count (fs_info->fat, fs_info->cluster_count);
+ if (!fat_alloc_buffers (fs))
+ goto error_free_fat_table;
+
+ if (fs_info->fat_type == FAT_TYPE_FAT32) {
+ fs_info->root_cluster
+ = fat_table_alloc_cluster (fs_info->fat);
+ fat_table_set_eof (fs_info->fat, fs_info->root_cluster);
+ memset (fs_info->buffer, 0, fs_info->cluster_size);
+ if (!fat_write_cluster (fs, fs_info->buffer,
+ fs_info->root_cluster))
+ return 0;
+ }
+
+ fs_info->serial_number = _gen_new_serial_number ();
+
+ if (!fat_boot_sector_set_boot_code (&fs_info->boot_sector))
+ goto error_free_buffers;
+ if (!fat_boot_sector_generate (&fs_info->boot_sector, fs))
+ goto error_free_buffers;
+ if (!fat_boot_sector_write (&fs_info->boot_sector, fs))
+ goto error_free_buffers;
+ if (fs_info->fat_type == FAT_TYPE_FAT32) {
+ if (!fat_info_sector_generate (&fs_info->info_sector, fs))
+ goto error_free_buffers;
+ if (!fat_info_sector_write (&fs_info->info_sector, fs))
+ goto error_free_buffers;
+ }
+
+ if (!fat_table_write_all (fs_info->fat, fs))
+ goto error_free_buffers;
+
+ if (fs_info->fat_type == FAT_TYPE_FAT16) {
+ if (!fat_root_dir_clear (fs))
+ goto error_free_buffers;
+ }
+
+ return fs;
+
+error_free_buffers:
+ fat_free_buffers (fs);
+error_free_fat_table:
+ fat_table_destroy (fs_info->fat);
+error_free_fs:
+ fat_free (fs);
+error:
+ return NULL;
+}
+
+PedFileSystem*
+fat_create_fat16 (PedGeometry* geom, PedTimer* timer)
+{
+ return fat_create (geom, FAT_TYPE_FAT16, timer);
+}
+
+PedFileSystem*
+fat_create_fat32 (PedGeometry* geom, PedTimer* timer)
+{
+ return fat_create (geom, FAT_TYPE_FAT32, timer);
+}
+
+int
+fat_close (PedFileSystem* fs)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+
+ fat_free_buffers (fs);
+ fat_table_destroy (fs_info->fat);
+ fat_free (fs);
+ return 1;
+}
+
+/* Hack: just resize the file system outside of its boundaries! */
+PedFileSystem*
+fat_copy (const PedFileSystem* fs, PedGeometry* geom, PedTimer* timer)
+{
+ PedFileSystem* new_fs;
+
+ new_fs = ped_file_system_open (fs->geom);
+ if (!new_fs)
+ goto error;
+ if (!ped_file_system_resize (new_fs, geom, timer))
+ goto error_close_new_fs;
+ return new_fs;
+
+error_close_new_fs:
+ ped_file_system_close (new_fs);
+error:
+ return 0;
+}
+
+static int
+_compare_fats (PedFileSystem* fs)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ FatTable* table_copy;
+ FatCluster table_size;
+ int i;
+
+ table_size = fs_info->fat_sectors * 512
+ / fat_table_entry_size (fs_info->fat_type);
+
+ table_copy = fat_table_new (fs_info->fat_type, table_size);
+ if (!table_copy)
+ goto error;
+
+ for (i = 1; i < fs_info->fat_table_count; i++) {
+ if (!fat_table_read (table_copy, fs, i))
+ goto error_free_table_copy;
+ if (!fat_table_compare (fs_info->fat, table_copy)) {
+ if (ped_exception_throw (PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("The FATs don't match. If you don't know "
+ "what this means, then select cancel, run "
+ "scandisk on the file system, and then come "
+ "back."))
+ != PED_EXCEPTION_IGNORE)
+ goto error_free_table_copy;
+ }
+ }
+
+ fat_table_destroy (table_copy);
+ return 1;
+
+error_free_table_copy:
+ fat_table_destroy (table_copy);
+error:
+ return 0;
+}
+
+int
+fat_check (PedFileSystem* fs, PedTimer* timer)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ PedSector cluster_sectors;
+ FatCluster cluster_count;
+ PedSector fat_sectors;
+ PedSector align_sectors;
+ FatCluster info_free_clusters;
+
+ align_sectors = fs_info->fat_offset
+ - fat_min_reserved_sector_count (fs_info->fat_type);
+
+ if (!fat_calc_sizes (fs->geom->length,
+ align_sectors,
+ fs_info->fat_type,
+ fs_info->root_dir_sector_count,
+ &cluster_sectors,
+ &cluster_count,
+ &fat_sectors)) {
+ if (ped_exception_throw (PED_EXCEPTION_BUG,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("There are no possible configurations for this FAT "
+ "type."))
+ != PED_EXCEPTION_IGNORE)
+ goto error;
+ }
+
+ if (fs_info->fat_type == FAT_TYPE_FAT16) {
+ if (cluster_sectors != fs_info->cluster_sectors
+ || cluster_count != fs_info->cluster_count
+ || fat_sectors != fs_info->fat_sectors) {
+ if (ped_exception_throw (PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("File system doesn't have expected sizes for "
+ "Windows to like it. "
+ "Cluster size is %dk (%dk expected); "
+ "number of clusters is %d (%d expected); "
+ "size of FATs is %d sectors (%d expected)."),
+ (int) fs_info->cluster_sectors / 2,
+ (int) cluster_sectors / 2,
+ (int) fs_info->cluster_count,
+ (int) cluster_count,
+ (int) fs_info->fat_sectors,
+ (int) fat_sectors)
+ != PED_EXCEPTION_IGNORE)
+ goto error;
+ }
+ }
+
+ if (fs_info->fat_type == FAT_TYPE_FAT32) {
+ info_free_clusters
+ = PED_LE32_TO_CPU (fs_info->info_sector.free_clusters);
+ if (info_free_clusters != (FatCluster) -1
+ && info_free_clusters != fs_info->fat->free_cluster_count) {
+ if (ped_exception_throw (PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("File system is reporting the free space as "
+ "%d clusters, not %d clusters."),
+ info_free_clusters,
+ fs_info->fat->free_cluster_count)
+ != PED_EXCEPTION_IGNORE)
+ goto error;
+ }
+ }
+
+ if (!_compare_fats (fs))
+ goto error;
+
+ fs->checked = 1;
+ return 1; /* existence of fs implies consistency ;-) */
+
+error:
+ return 0;
+}
+
+/* Calculates how much space there will be in clusters in:
+ * old_fs intersect the-new-fs
+ */
+static PedSector
+_calc_resize_data_size (
+ const PedFileSystem* old_fs,
+ PedSector new_cluster_sectors,
+ FatCluster new_cluster_count,
+ PedSector new_fat_size)
+{
+ FatSpecific* old_fs_info = FAT_SPECIFIC (old_fs);
+ PedSector fat_size_delta;
+
+ fat_size_delta = old_fs_info->fat_sectors - new_fat_size;
+ return new_cluster_sectors * new_cluster_count - fat_size_delta * 2;
+}
+
+static int
+_test_resize_size (const PedFileSystem* fs,
+ PedSector length, PedSector min_data_size)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ PedGeometry geom;
+ PedSector _cluster_sectors;
+ FatCluster _cluster_count;
+ PedSector _fat_size;
+
+ ped_geometry_init (&geom, fs->geom->dev, fs->geom->start, length);
+
+ if (fat_calc_resize_sizes (
+ &geom,
+ fs_info->cluster_sectors,
+ FAT_TYPE_FAT16,
+ fs_info->root_dir_sector_count,
+ fs_info->cluster_sectors,
+ &_cluster_sectors,
+ &_cluster_count,
+ &_fat_size)
+ && _calc_resize_data_size (fs, _cluster_sectors, _cluster_count,
+ _fat_size)
+ >= min_data_size)
+ return 1;
+
+ if (fat_calc_resize_sizes (
+ &geom,
+ fs_info->cluster_sectors,
+ FAT_TYPE_FAT32,
+ 0,
+ fs_info->cluster_sectors,
+ &_cluster_sectors,
+ &_cluster_count,
+ &_fat_size)
+ && _calc_resize_data_size (fs, _cluster_sectors, _cluster_count,
+ _fat_size)
+ >= min_data_size)
+ return 1;
+
+ return 0;
+}
+
+/* does a binary search (!) for the mininum size. Too hard to compute directly
+ * (see calc_sizes() for why!)
+ */
+static PedSector
+_get_min_resize_size (const PedFileSystem* fs, PedSector min_data_size)
+{
+ PedSector min_length = 0;
+ PedSector max_length = fs->geom->length;
+ PedSector length;
+
+ while (min_length < max_length - 1) {
+ length = (min_length + max_length) / 2;
+ if (_test_resize_size (fs, length, min_data_size))
+ max_length = length;
+ else
+ min_length = length;
+ }
+
+/* adds a bit of leeway (64 sectors), for resolving extra issues, like root
+ * directory allocation, that aren't covered here.
+ */
+ return max_length + 64;
+}
+
+PedConstraint*
+fat_get_copy_constraint (const PedFileSystem* fs, const PedDevice* dev)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ PedGeometry full_dev;
+ PedSector min_cluster_count;
+ FatCluster used_clusters;
+ PedSector min_data_size;
+
+ if (!ped_geometry_init (&full_dev, dev, 0, dev->length - 1))
+ return NULL;
+
+ used_clusters = fs_info->fat->cluster_count
+ - fs_info->fat->free_cluster_count;
+ min_cluster_count = used_clusters + fs_info->total_dir_clusters;
+ min_data_size = min_cluster_count * fs_info->cluster_sectors;
+
+ return ped_constraint_new (ped_alignment_any, ped_alignment_any,
+ &full_dev, &full_dev,
+ _get_min_resize_size (fs, min_data_size),
+ dev->length);
+}
+
+PedConstraint*
+fat_get_resize_constraint (const PedFileSystem* fs)
+{
+ return fat_get_copy_constraint (fs, fs->geom->dev);
+}
+
+/* FIXME: fat_calc_sizes() needs to say "too big" or "too small", or
+ * something. This is a really difficult (maths) problem to do
+ * nicely...
+ * So, this algorithm works if dev->length / 2 is a valid fat_type
+ * size. (Which is how I got the magic numbers below)
+ */
+#if 0
+/* returns: -1 too small, 0 ok, 1 too big */
+static int
+_test_create_size (PedSector length, FatType fat_type,
+ PedSector cluster_sectors, PedSector cluster_count)
+{
+ PedSector rootdir_sectors;
+ PedSector _cluster_sectors;
+ FatCluster _cluster_count;
+ PedSector _fat_size;
+
+ rootdir_sectors = (fat_type == FAT_TYPE_FAT16) ? 16 : 0;
+
+ if (!fat_calc_sizes (length, 0, fat_type, rootdir_sectors,
+ &_cluster_sectors, &_cluster_count, &_fat_size))
+ return -1; // XXX: doesn't work... can't see a better way!
+
+ if (_cluster_sectors < cluster_sectors)
+ return -1;
+ if (_cluster_sectors > cluster_sectors)
+ return 1;
+
+ if (_cluster_count < cluster_count)
+ return -1;
+ if (_cluster_count > cluster_count)
+ return 1;
+
+ return 0;
+}
+
+static PedSector
+_get_create_size (PedSector upper_bound, FatType fat_type,
+ PedSector cluster_sectors, FatCluster cluster_count)
+{
+ PedSector min_length = 0;
+ PedSector max_length = upper_bound;
+ PedSector length;
+
+ while (1) {
+ length = (min_length + max_length) / 2;
+ switch (_test_create_size (length, fat_type, cluster_sectors,
+ cluster_count)) {
+ case -1: min_length = length; break;
+ case 0: return length;
+ case 1: max_length = length; break;
+ }
+ /* hack... won't always be able to get max cluster count
+ * with max cluster size, etc. */
+ if (max_length - min_length == 1)
+ return min_length;
+ }
+
+ return 0; /* shut gcc up */
+}
+#endif
+
+PedConstraint*
+fat_get_create_constraint_fat16 (const PedDevice* dev)
+{
+ PedGeometry full_dev;
+ PedSector min_size;
+ PedSector max_size;
+
+ if (!ped_geometry_init (&full_dev, dev, 0, dev->length - 1))
+ return NULL;
+
+#if 0
+ min_size = _get_create_size (dev->length, FAT_TYPE_FAT16,
+ fat_min_cluster_size (FAT_TYPE_FAT16),
+ fat_min_cluster_count (FAT_TYPE_FAT16));
+ max_size = _get_create_size (dev->length, FAT_TYPE_FAT16,
+ fat_max_cluster_size (FAT_TYPE_FAT16),
+ fat_max_cluster_count (FAT_TYPE_FAT16));
+ if (!min_size)
+ return NULL;
+#else
+ min_size = 65794;
+ max_size = 2097153;
+#endif
+
+ return ped_constraint_new (
+ ped_alignment_any, ped_alignment_any,
+ &full_dev, &full_dev,
+ min_size, max_size);
+}
+
+PedConstraint*
+fat_get_create_constraint_fat32 (const PedDevice* dev)
+{
+ PedGeometry full_dev;
+ PedSector min_size;
+
+ if (!ped_geometry_init (&full_dev, dev, 0, dev->length - 1))
+ return NULL;
+
+#if 0
+ min_size = _get_create_size (dev->length, FAT_TYPE_FAT32,
+ fat_min_cluster_size (FAT_TYPE_FAT32),
+ fat_min_cluster_count (FAT_TYPE_FAT32));
+ if (!min_size)
+ return NULL;
+#else
+ min_size = 525224;
+#endif
+
+ return ped_constraint_new (
+ ped_alignment_any, ped_alignment_any,
+ &full_dev, &full_dev,
+ min_size, dev->length);
+}
+#endif /* !DISCOVER_ONLY */
+
+static PedFileSystemOps fat16_ops = {
+ probe: fat_probe_fat16,
+#ifndef DISCOVER_ONLY
+ clobber: fat_clobber,
+ open: fat_open,
+ create: fat_create_fat16,
+ close: fat_close,
+ check: fat_check,
+ resize: fat_resize,
+ copy: fat_copy,
+ get_create_constraint: fat_get_create_constraint_fat16,
+ get_resize_constraint: fat_get_resize_constraint,
+ get_copy_constraint: fat_get_copy_constraint,
+#else /* !DISCOVER_ONLY */
+ clobber: NULL,
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ resize: NULL,
+ copy: NULL,
+ get_create_constraint: NULL,
+ get_resize_constraint: NULL,
+ get_copy_constraint: NULL,
+#endif /* !DISCOVER_ONLY */
+};
+
+static PedFileSystemOps fat32_ops = {
+ probe: fat_probe_fat32,
+#ifndef DISCOVER_ONLY
+ clobber: fat_clobber,
+ open: fat_open,
+ create: fat_create_fat32,
+ close: fat_close,
+ check: fat_check,
+ resize: fat_resize,
+ copy: fat_copy,
+ get_create_constraint: fat_get_create_constraint_fat32,
+ get_resize_constraint: fat_get_resize_constraint,
+ get_copy_constraint: fat_get_copy_constraint,
+#else /* !DISCOVER_ONLY */
+ clobber: NULL,
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ resize: NULL,
+ copy: NULL,
+ get_create_constraint: NULL,
+ get_resize_constraint: NULL,
+ get_copy_constraint: NULL,
+#endif /* !DISCOVER_ONLY */
+};
+
+#define FAT_BLOCK_SIZES ((int[2]){512, 0})
+
+PedFileSystemType fat16_type = {
+ next: NULL,
+ ops: &fat16_ops,
+ name: "fat16",
+ block_sizes: FAT_BLOCK_SIZES
+};
+
+PedFileSystemType fat32_type = {
+ next: NULL,
+ ops: &fat32_ops,
+ name: "fat32",
+ block_sizes: FAT_BLOCK_SIZES
+};
+
+void
+ped_file_system_fat_init ()
+{
+ if (sizeof (FatBootSector) != 512) {
+ ped_exception_throw (PED_EXCEPTION_BUG, PED_EXCEPTION_CANCEL,
+ _("GNU Parted was miscompiled: the FAT boot sector "
+ "should be 512 bytes. FAT support will be disabled."));
+ } else {
+ ped_file_system_type_register (&fat16_type);
+ ped_file_system_type_register (&fat32_type);
+ }
+}
+
+void
+ped_file_system_fat_done ()
+{
+ ped_file_system_type_unregister (&fat16_type);
+ ped_file_system_type_unregister (&fat32_type);
+}
+
diff --git a/libparted/fs/fat/fat.h b/libparted/fs/fat/fat.h
new file mode 100644
index 0000000..c571e90
--- /dev/null
+++ b/libparted/fs/fat/fat.h
@@ -0,0 +1,161 @@
+/*
+ libparted
+ Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef FAT_H_INCLUDED
+#define FAT_H_INCLUDED
+
+#include "config.h"
+
+#include <parted/parted.h>
+#include <parted/endian.h>
+#include <parted/debug.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#define BUFFER_SIZE 1024 /* buffer size in sectors (512 bytes) */
+
+typedef uint32_t FatCluster;
+typedef int32_t FatFragment;
+
+enum _FatType {
+ FAT_TYPE_FAT12,
+ FAT_TYPE_FAT16,
+ FAT_TYPE_FAT32
+};
+typedef enum _FatType FatType;
+
+typedef struct _FatSpecific FatSpecific;
+typedef struct _FatDirEntry FatDirEntry;
+
+/* FIXME: YUCKY */
+#include "table.h"
+#include "bootsector.h"
+#include "context.h"
+#include "fatio.h"
+#include "traverse.h"
+#include "calc.h"
+#include "count.h"
+#include "clstdup.h"
+
+struct _FatDirEntry {
+ char name[8];
+ uint8_t extension[3];
+ uint8_t attributes;
+ uint8_t is_upper_case_name;
+ uint8_t creation_time_low; /* milliseconds */
+ uint16_t creation_time_high;
+ uint16_t creation_date;
+ uint16_t access_date;
+ uint16_t first_cluster_high; /* for FAT32 */
+ uint16_t time;
+ uint16_t date;
+ uint16_t first_cluster;
+ uint32_t length;
+} __attribute__ ((packed));
+
+struct _FatSpecific {
+ FatBootSector boot_sector; /* structure of boot sector */
+ FatInfoSector info_sector; /* fat32-only information sector */
+
+ int logical_sector_size; /* illogical sector size :-) */
+ PedSector sector_count;
+
+ int sectors_per_track; /* BIOS CHS stuff (S) */
+ int heads; /* BIOS CHS stuff (H) */
+
+ int cluster_size;
+ PedSector cluster_sectors;
+ FatCluster cluster_count;
+ int dir_entries_per_cluster;
+
+ FatType fat_type;
+ int fat_table_count;
+ PedSector fat_sectors;
+
+ uint32_t serial_number;
+
+ PedSector info_sector_offset; /* FAT32 only */
+ PedSector fat_offset;
+ PedSector root_dir_offset; /* non-FAT32 */
+ PedSector cluster_offset;
+ PedSector boot_sector_backup_offset;
+
+ FatCluster root_cluster; /* FAT32 only */
+ int root_dir_entry_count; /* non-FAT32 */
+ PedSector root_dir_sector_count; /* non-FAT32 */
+ FatCluster total_dir_clusters;
+
+ FatTable* fat;
+ FatClusterInfo* cluster_info;
+
+ PedSector buffer_sectors;
+ char* buffer;
+
+ int frag_size;
+ PedSector frag_sectors;
+ FatFragment frag_count;
+ FatFragment buffer_frags;
+ FatFragment cluster_frags;
+};
+
+#define FAT_SPECIFIC(fs) ((FatSpecific*) fs->type_specific)
+
+#define FAT_ROOT 0
+
+#define DELETED_FLAG 0xe5
+
+#define READONLY_ATTR 0x01
+#define HIDDEN_ATTR 0x02
+#define SYSTEM_ATTR 0x04
+#define VOLUME_LABEL_ATTR 0x08
+#define VFAT_ATTR 0x0f
+#define DIRECTORY_ATTR 0x10
+#define ARCH_ATTR 0x20
+
+#define MAX_FAT12_CLUSTERS 4086
+#define MAX_FAT16_CLUSTERS 65526
+#define MAX_FAT32_CLUSTERS 2000000
+
+#define FAT_ROOT_DIR_ENTRY_COUNT 512
+
+extern PedFileSystemType fat16_type;
+extern PedFileSystemType fat32_type;
+
+extern void fat_print (const PedFileSystem* fs);
+
+extern PedFileSystem* fat_alloc (const PedGeometry* geom);
+extern void fat_free (PedFileSystem* fs);
+extern int fat_alloc_buffers (PedFileSystem* fs);
+extern void fat_free_buffers (PedFileSystem* fs);
+
+extern int fat_resize (PedFileSystem* fs, PedGeometry* geom, PedTimer* timer);
+
+extern int fat_set_frag_sectors (PedFileSystem* fs, PedSector frag_sectors);
+
+#endif /* FAT_H_INCLUDED */
diff --git a/libparted/fs/fat/fatio.c b/libparted/fs/fat/fatio.c
new file mode 100644
index 0000000..e88f85d
--- /dev/null
+++ b/libparted/fs/fat/fatio.c
@@ -0,0 +1,151 @@
+/*
+ libparted
+ Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#include "fat.h"
+#include "fatio.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <ctype.h>
+
+#ifndef DISCOVER_ONLY
+
+int
+fat_read_fragments (PedFileSystem* fs, char* buf, FatFragment frag,
+ FatFragment count)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ PedSector sector = fat_frag_to_sector (fs, frag);
+ PedSector sector_count = count * fs_info->frag_sectors;
+
+ PED_ASSERT (frag >= 0 && frag < fs_info->frag_count, return 0);
+
+ return ped_geometry_read (fs->geom, buf, sector, sector_count);
+}
+
+int
+fat_read_fragment (PedFileSystem* fs, char* buf, FatFragment frag)
+{
+ return fat_read_fragments (fs, buf, frag, 1);
+}
+
+int
+fat_write_fragments (PedFileSystem* fs, char* buf, FatFragment frag,
+ FatFragment count)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ PedSector sector = fat_frag_to_sector (fs, frag);
+ PedSector sector_count = count * fs_info->frag_sectors;
+
+ PED_ASSERT (frag >= 0 && frag < fs_info->frag_count, return 0);
+
+ return ped_geometry_write (fs->geom, buf, sector, sector_count);
+}
+
+int
+fat_write_fragment (PedFileSystem* fs, char* buf, FatFragment frag)
+{
+ return fat_write_fragments (fs, buf, frag, 1);
+}
+
+int
+fat_write_sync_fragments (PedFileSystem* fs, char* buf, FatFragment frag,
+ FatFragment count)
+{
+ if (!fat_write_fragments (fs, buf, frag, count))
+ return 0;
+ if (!ped_geometry_sync (fs->geom))
+ return 0;
+ return 1;
+}
+
+int
+fat_write_sync_fragment (PedFileSystem* fs, char* buf, FatFragment frag)
+{
+ return fat_write_sync_fragments (fs, buf, frag, 1);
+}
+
+int
+fat_read_clusters (PedFileSystem* fs, char *buf, FatCluster cluster,
+ FatCluster count)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ PedSector sector = fat_cluster_to_sector (fs, cluster);
+ PedSector sector_count = count * fs_info->cluster_sectors;
+
+ PED_ASSERT (cluster >= 2
+ && cluster + count - 1 < fs_info->cluster_count + 2,
+ return 0);
+
+ return ped_geometry_read (fs->geom, buf, sector, sector_count);
+}
+
+int
+fat_read_cluster (PedFileSystem* fs, char *buf, FatCluster cluster)
+{
+ return fat_read_clusters (fs, buf, cluster, 1);
+}
+
+int
+fat_write_clusters (PedFileSystem* fs, char *buf, FatCluster cluster,
+ FatCluster count)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ PedSector sector = fat_cluster_to_sector (fs, cluster);
+ PedSector sector_count = count * fs_info->cluster_sectors;
+
+ PED_ASSERT (cluster >= 2
+ && cluster + count - 1 < fs_info->cluster_count + 2,
+ return 0);
+
+ return ped_geometry_write (fs->geom, buf, sector, sector_count);
+}
+
+int
+fat_write_cluster (PedFileSystem* fs, char *buf, FatCluster cluster)
+{
+ return fat_write_clusters (fs, buf, cluster, 1);
+}
+
+int
+fat_write_sync_clusters (PedFileSystem* fs, char *buf, FatCluster cluster,
+ FatCluster count)
+{
+ if (!fat_write_clusters (fs, buf, cluster, count))
+ return 0;
+ if (!ped_geometry_sync (fs->geom))
+ return 0;
+ return 1;
+}
+
+int
+fat_write_sync_cluster (PedFileSystem* fs, char *buf, FatCluster cluster)
+{
+ if (!fat_write_cluster (fs, buf, cluster))
+ return 0;
+ if (!ped_geometry_sync (fs->geom))
+ return 0;
+ return 1;
+}
+
+#endif /* !DISCOVER_ONLY */
diff --git a/libparted/fs/fat/fatio.h b/libparted/fs/fat/fatio.h
new file mode 100644
index 0000000..a37158a
--- /dev/null
+++ b/libparted/fs/fat/fatio.h
@@ -0,0 +1,49 @@
+/*
+ libparted
+ Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef FATIO_H_INCLUDED
+#define FATIO_H_INCLUDED
+
+#include "fat.h"
+
+extern int fat_read_fragments (PedFileSystem* fs, char* buf, FatFragment frag,
+ FatFragment count);
+extern int fat_write_fragments (PedFileSystem* fs, char* buf, FatFragment frag,
+ FatFragment count);
+extern int fat_write_sync_fragments (PedFileSystem* fs, char* buf,
+ FatFragment frag, FatFragment count);
+
+extern int fat_read_fragment (PedFileSystem* fs, char* buf, FatFragment frag);
+extern int fat_write_fragment (PedFileSystem* fs, char* buf, FatFragment frag);
+extern int fat_write_sync_fragment (PedFileSystem* fs, char* buf,
+ FatFragment frag);
+
+extern int fat_read_clusters (PedFileSystem* fs, char* buf, FatCluster cluster,
+ FatCluster count);
+extern int fat_write_clusters (PedFileSystem* fs, char* buf, FatCluster cluster,
+ FatCluster count);
+extern int fat_write_sync_clusters (PedFileSystem* fs, char* buf,
+ FatCluster cluster, FatCluster count);
+
+extern int fat_read_cluster (PedFileSystem* fs, char *buf, FatCluster cluster);
+extern int fat_write_cluster (PedFileSystem* fs, char *buf, FatCluster cluster);
+extern int fat_write_sync_cluster (PedFileSystem* fs, char *buf,
+ FatCluster cluster);
+
+#endif /* FATIO_H_INCLUDED */
diff --git a/libparted/fs/fat/resize.c b/libparted/fs/fat/resize.c
new file mode 100644
index 0000000..681aa48
--- /dev/null
+++ b/libparted/fs/fat/resize.c
@@ -0,0 +1,870 @@
+/*
+ libparted
+ Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#include "fat.h"
+#include "traverse.h"
+#include "count.h"
+#include "fatio.h"
+#include "calc.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <ctype.h>
+#include <stdarg.h>
+#include <string.h>
+
+#ifndef DISCOVER_ONLY
+
+/* Recursively builds (i.e. makes consistent) the duplicated directory tree
+ * (leaving the original directory tree in tact)
+ */
+static int
+fat_construct_directory (FatOpContext* ctx, FatTraverseInfo* trav_info)
+{
+ FatTraverseInfo* sub_dir_info;
+ FatDirEntry* dir_entry;
+ FatCluster old_first_cluster;
+
+ while ( (dir_entry = fat_traverse_next_dir_entry (trav_info)) ) {
+ if (fat_dir_entry_is_null_term (dir_entry))
+ break;
+ if (!fat_dir_entry_has_first_cluster (dir_entry, ctx->old_fs))
+ continue;
+
+ fat_traverse_mark_dirty (trav_info);
+
+ old_first_cluster = fat_dir_entry_get_first_cluster (dir_entry,
+ ctx->old_fs);
+ fat_dir_entry_set_first_cluster (dir_entry, ctx->new_fs,
+ fat_op_context_map_cluster (ctx, old_first_cluster));
+
+ if (fat_dir_entry_is_directory (dir_entry)
+ && dir_entry->name [0] != '.') {
+ sub_dir_info
+ = fat_traverse_directory (trav_info, dir_entry);
+ if (!sub_dir_info)
+ return 0;
+ if (!fat_construct_directory (ctx, sub_dir_info))
+ return 0;
+ }
+ }
+ /* remove "stale" entries at the end */
+ while ((dir_entry = fat_traverse_next_dir_entry (trav_info))) {
+ memset (dir_entry, 0, sizeof (FatDirEntry));
+ fat_traverse_mark_dirty (trav_info);
+ }
+ fat_traverse_complete (trav_info);
+ return 1;
+}
+
+static int
+duplicate_legacy_root_dir (FatOpContext* ctx)
+{
+ FatSpecific* old_fs_info = FAT_SPECIFIC (ctx->old_fs);
+ FatSpecific* new_fs_info = FAT_SPECIFIC (ctx->new_fs);
+
+ PED_ASSERT (old_fs_info->root_dir_sector_count
+ == new_fs_info->root_dir_sector_count, return 0);
+
+ if (!ped_geometry_read (ctx->old_fs->geom, old_fs_info->buffer,
+ old_fs_info->root_dir_offset,
+ old_fs_info->root_dir_sector_count))
+ return 0;
+
+ if (!ped_geometry_write (ctx->new_fs->geom, old_fs_info->buffer,
+ new_fs_info->root_dir_offset,
+ new_fs_info->root_dir_sector_count))
+ return 0;
+
+ return 1;
+}
+
+/*
+ Constructs the new directory tree for legacy (FAT16) file systems.
+*/
+static int
+fat_construct_legacy_root (FatOpContext* ctx)
+{
+ FatTraverseInfo* trav_info;
+
+ if (!duplicate_legacy_root_dir (ctx))
+ return 0;
+ trav_info = fat_traverse_begin (ctx->new_fs, FAT_ROOT, "\\");
+ return fat_construct_directory (ctx, trav_info);
+}
+
+/*
+ Constructs the new directory tree for new (FAT32) file systems.
+*/
+static int
+fat_construct_root (FatOpContext* ctx)
+{
+ FatSpecific* new_fs_info = FAT_SPECIFIC (ctx->new_fs);
+ FatTraverseInfo* trav_info;
+
+ trav_info = fat_traverse_begin (ctx->new_fs, new_fs_info->root_cluster,
+ "\\");
+ fat_construct_directory (ctx, trav_info);
+ return 1;
+}
+
+/* Converts the root directory between FAT16 and FAT32. NOTE: this code
+ * can also do no conversion. I'm leaving fat_construct_directory(), because
+ * it's really pretty :-) It also leaves a higher chance of deleted file
+ * recovery, because it doesn't remove redundant entries. (We do this here,
+ * because brain-damaged FAT16 has an arbitary limit on root directory entries,
+ * so we save room)
+ */
+static int
+fat_convert_directory (FatOpContext* ctx, FatTraverseInfo* old_trav,
+ FatTraverseInfo* new_trav)
+{
+ FatTraverseInfo* sub_old_dir_trav;
+ FatTraverseInfo* sub_new_dir_trav;
+ FatDirEntry* new_dir_entry;
+ FatDirEntry* old_dir_entry;
+ FatCluster old_first_cluster;
+
+ while ( (old_dir_entry = fat_traverse_next_dir_entry (old_trav)) ) {
+ if (fat_dir_entry_is_null_term (old_dir_entry))
+ break;
+ if (!fat_dir_entry_is_active (old_dir_entry))
+ continue;
+
+ new_dir_entry = fat_traverse_next_dir_entry (new_trav);
+ if (!new_dir_entry) {
+ return ped_exception_throw (PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("There's not enough room in the root "
+ "directory for all of the files. Either "
+ "cancel, or ignore to lose the files."))
+ == PED_EXCEPTION_IGNORE;
+ }
+
+ *new_dir_entry = *old_dir_entry;
+ fat_traverse_mark_dirty (new_trav);
+
+ if (!fat_dir_entry_has_first_cluster (old_dir_entry,
+ ctx->old_fs))
+ continue;
+
+ old_first_cluster = fat_dir_entry_get_first_cluster (
+ old_dir_entry, ctx->old_fs);
+ fat_dir_entry_set_first_cluster (new_dir_entry, ctx->new_fs,
+ fat_op_context_map_cluster (ctx, old_first_cluster));
+
+ if (fat_dir_entry_is_directory (old_dir_entry)
+ && old_dir_entry->name [0] != '.') {
+ sub_old_dir_trav
+ = fat_traverse_directory (old_trav, old_dir_entry);
+ sub_new_dir_trav
+ = fat_traverse_directory (new_trav, new_dir_entry);
+ if (!sub_old_dir_trav || !sub_new_dir_trav)
+ return 0;
+
+ if (!fat_convert_directory (ctx, sub_old_dir_trav,
+ sub_new_dir_trav))
+ return 0;
+ }
+ }
+
+ /* remove "stale" entries at the end, just in case there is some
+ * overlap
+ */
+ while ((new_dir_entry = fat_traverse_next_dir_entry (new_trav))) {
+ memset (new_dir_entry, 0, sizeof (FatDirEntry));
+ fat_traverse_mark_dirty (new_trav);
+ }
+
+ fat_traverse_complete (old_trav);
+ fat_traverse_complete (new_trav);
+ return 1;
+}
+
+static void
+clear_cluster (PedFileSystem* fs, FatCluster cluster)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+
+ memset (fs_info->buffer, 0, fs_info->cluster_size);
+ fat_write_cluster (fs, fs_info->buffer, cluster);
+}
+
+/* This MUST be called BEFORE the fat_construct_new_fat(), because cluster
+ * allocation depend on the old FAT. The reason is, old clusters may
+ * still be needed during the resize, (particularly clusters in the directory
+ * tree) even if they will be discarded later.
+ */
+static int
+alloc_root_dir (FatOpContext* ctx)
+{
+ FatSpecific* old_fs_info = FAT_SPECIFIC (ctx->old_fs);
+ FatSpecific* new_fs_info = FAT_SPECIFIC (ctx->new_fs);
+ FatCluster i;
+ FatCluster cluster;
+ FatCluster cluster_count;
+
+ PED_ASSERT (new_fs_info->fat_type == FAT_TYPE_FAT32, return 0);
+
+ cluster_count = ped_div_round_up (
+ PED_MAX (16, old_fs_info->root_dir_sector_count),
+ new_fs_info->cluster_sectors);
+
+ for (i = 0; i < cluster_count; i++) {
+ cluster = fat_table_alloc_check_cluster (new_fs_info->fat,
+ ctx->new_fs);
+ if (!cluster)
+ return 0;
+ ctx->new_root_dir [i] = cluster;
+ clear_cluster (ctx->new_fs, cluster);
+ }
+ ctx->new_root_dir [i] = 0;
+ new_fs_info->root_cluster = ctx->new_root_dir [0];
+ return 1;
+}
+
+/* when converting FAT32 -> FAT16
+ * fat_duplicate clusters() duplicated the root directory unnecessarily.
+ * Let's free it.
+ *
+ * This must be called AFTER fat_construct_new_fat(). (otherwise, our
+ * changes just get overwritten)
+ */
+static int
+free_root_dir (FatOpContext* ctx)
+{
+ FatSpecific* old_fs_info = FAT_SPECIFIC (ctx->old_fs);
+ FatSpecific* new_fs_info = FAT_SPECIFIC (ctx->new_fs);
+ FatCluster old_cluster;
+ FatFragment i;
+
+ PED_ASSERT (old_fs_info->fat_type == FAT_TYPE_FAT32, return 0);
+ PED_ASSERT (new_fs_info->fat_type == FAT_TYPE_FAT16, return 0);
+
+ for (old_cluster = old_fs_info->root_cluster;
+ !fat_table_is_eof (old_fs_info->fat, old_cluster);
+ old_cluster = fat_table_get (old_fs_info->fat, old_cluster)) {
+ FatFragment old_frag;
+ old_frag = fat_cluster_to_frag (ctx->old_fs, old_cluster);
+ for (i = 0; i < new_fs_info->cluster_frags; i++) {
+ FatFragment new_frag;
+ FatCluster new_clst;
+ new_frag = fat_op_context_map_fragment (ctx,
+ old_frag + i);
+ new_clst = fat_frag_to_cluster (ctx->old_fs, new_frag);
+ if (!fat_table_set_avail (new_fs_info->fat, new_clst))
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
+static int
+fat_clear_root_dir (PedFileSystem* fs)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ int i;
+
+ PED_ASSERT (fs_info->fat_type == FAT_TYPE_FAT16, return 0);
+ PED_ASSERT (fs_info->root_dir_sector_count, return 0);
+
+ memset (fs_info->buffer, 0, 512);
+
+ for (i = 0; i < fs_info->root_dir_sector_count; i++) {
+ if (!ped_geometry_write (fs->geom, fs_info->buffer,
+ fs_info->root_dir_offset + i, 1)) {
+ if (ped_exception_throw (PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("Error writing to the root directory."))
+ == PED_EXCEPTION_CANCEL)
+ return 0;
+ }
+ }
+ return 1;
+}
+
+static int
+fat_construct_converted_tree (FatOpContext* ctx)
+{
+ FatSpecific* old_fs_info = FAT_SPECIFIC (ctx->old_fs);
+ FatSpecific* new_fs_info = FAT_SPECIFIC (ctx->new_fs);
+ FatTraverseInfo* old_trav_info;
+ FatTraverseInfo* new_trav_info;
+
+ if (new_fs_info->fat_type == FAT_TYPE_FAT32) {
+ new_trav_info = fat_traverse_begin (ctx->new_fs,
+ new_fs_info->root_cluster, "\\");
+ old_trav_info = fat_traverse_begin (ctx->old_fs, FAT_ROOT,
+ "\\");
+ } else {
+ fat_clear_root_dir (ctx->new_fs);
+ new_trav_info = fat_traverse_begin (ctx->new_fs, FAT_ROOT,
+ "\\");
+ old_trav_info = fat_traverse_begin (ctx->old_fs,
+ old_fs_info->root_cluster, "\\");
+ }
+ if (!new_trav_info || !old_trav_info)
+ return 0;
+ if (!fat_convert_directory (ctx, old_trav_info, new_trav_info))
+ return 0;
+ return 1;
+}
+
+/*
+ Constructs the new directory tree to match the new file locations.
+*/
+static int
+fat_construct_dir_tree (FatOpContext* ctx)
+{
+ FatSpecific* new_fs_info = FAT_SPECIFIC (ctx->new_fs);
+ FatSpecific* old_fs_info = FAT_SPECIFIC (ctx->old_fs);
+
+ if (new_fs_info->fat_type == old_fs_info->fat_type) {
+ switch (old_fs_info->fat_type) {
+ case FAT_TYPE_FAT16:
+ return fat_construct_legacy_root (ctx);
+
+ case FAT_TYPE_FAT32:
+ return fat_construct_root (ctx);
+ }
+ } else {
+ return fat_construct_converted_tree (ctx);
+ }
+
+ return 0;
+}
+
+static FatFragment
+_get_next_old_frag (FatOpContext* ctx, FatFragment frag)
+{
+ FatSpecific* old_fs_info = FAT_SPECIFIC (ctx->old_fs);
+ FatCluster cluster;
+ FatCluster next_cluster;
+
+ if ((frag + 1) % old_fs_info->cluster_frags != 0) {
+ if (fat_is_fragment_active (ctx->old_fs, frag + 1))
+ return frag + 1;
+ else
+ return -1;
+ } else {
+ cluster = fat_frag_to_cluster (ctx->old_fs, frag);
+ next_cluster = fat_table_get (old_fs_info->fat, cluster);
+
+ if (fat_table_is_eof (old_fs_info->fat, next_cluster))
+ return -1;
+ else
+ return fat_cluster_to_frag (ctx->old_fs, next_cluster);
+ }
+}
+
+/*
+ Constructs the new fat for the resized file system.
+*/
+static int
+fat_construct_new_fat (FatOpContext* ctx)
+{
+ FatSpecific* old_fs_info = FAT_SPECIFIC (ctx->old_fs);
+ FatSpecific* new_fs_info = FAT_SPECIFIC (ctx->new_fs);
+ FatFragment old_frag;
+ FatCluster new_cluster;
+ FatFragment new_frag;
+ FatFragment old_next_frag;
+ FatFragment new_next_frag;
+ FatCluster new_next_cluster;
+ FatClusterFlag flag;
+ int i;
+
+ fat_table_clear (new_fs_info->fat);
+ if (!fat_table_set_cluster_count (new_fs_info->fat,
+ new_fs_info->cluster_count))
+ return 0;
+
+ for (old_frag = 0; old_frag < old_fs_info->frag_count; old_frag++) {
+ flag = fat_get_fragment_flag (ctx->old_fs, old_frag);
+ if (flag == FAT_FLAG_FREE)
+ continue;
+ if (flag == FAT_FLAG_BAD) {
+ new_frag = fat_op_context_map_static_fragment (
+ ctx, old_frag);
+ if (new_frag == -1)
+ continue;
+ new_cluster = fat_frag_to_cluster (ctx->new_fs,
+ new_frag);
+ fat_table_set_bad (new_fs_info->fat, new_cluster);
+ continue;
+ }
+
+ new_frag = fat_op_context_map_fragment (ctx, old_frag);
+ new_cluster = fat_frag_to_cluster (ctx->new_fs, new_frag);
+
+ old_next_frag = _get_next_old_frag (ctx, old_frag);
+ if (old_next_frag == -1) {
+ fat_table_set_eof (new_fs_info->fat, new_cluster);
+ continue;
+ }
+
+ new_next_frag = fat_op_context_map_fragment (ctx,
+ old_next_frag);
+ PED_ASSERT (new_next_frag != -1, return 0);
+
+ new_next_cluster = fat_frag_to_cluster (ctx->new_fs,
+ new_next_frag);
+ PED_ASSERT (new_next_cluster != new_cluster, return 0);
+
+ fat_table_set (new_fs_info->fat, new_cluster, new_next_cluster);
+ }
+
+#if 0
+#ifdef PED_VERBOSE
+ for (old_cluster=2; old_cluster < old_fs_info->cluster_count+2;
+ old_cluster++) {
+ if (fat_table_is_available (old_fs_info->fat, old_cluster))
+ continue;
+
+ printf ("%d->%d\t(next: %d->%d)\n",
+ old_cluster,
+ ctx->remap [old_cluster],
+ fat_table_get (old_fs_info->fat, old_cluster),
+ fat_table_get (new_fs_info->fat,
+ ctx->remap [old_cluster]));
+ }
+#endif /* PED_VERBOSE */
+#endif
+
+ if (old_fs_info->fat_type == FAT_TYPE_FAT32
+ && new_fs_info->fat_type == FAT_TYPE_FAT32) {
+ new_fs_info->root_cluster
+ = fat_op_context_map_cluster (ctx,
+ old_fs_info->root_cluster);
+ }
+
+ if (old_fs_info->fat_type == FAT_TYPE_FAT16
+ && new_fs_info->fat_type == FAT_TYPE_FAT32) {
+ for (i=0; ctx->new_root_dir[i+1]; i++) {
+ fat_table_set (new_fs_info->fat,
+ ctx->new_root_dir[i],
+ ctx->new_root_dir[i+1]);
+ }
+ fat_table_set_eof (new_fs_info->fat, ctx->new_root_dir[i]);
+ }
+
+ return 1;
+}
+
+static int
+ask_type (PedFileSystem* fs, int fat16_ok, int fat32_ok, FatType* out_fat_type)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ PedExceptionOption status;
+ char* fat16_msg;
+ char* fat32_msg;
+
+ if (fs_info->fat_type == FAT_TYPE_FAT16)
+ fat16_msg = _("If you leave your file system as FAT16, "
+ "then you will have no problems.");
+ else
+ fat16_msg = _("If you convert to FAT16, and MS Windows "
+ "is installed on this partition, then "
+ "you must re-install the MS Windows boot "
+ "loader. If you want to do this, you "
+ "should consult the Parted manual (or "
+ "your distribution's manual).");
+
+ if (fs_info->fat_type == FAT_TYPE_FAT32)
+ fat32_msg = _("If you leave your file system as FAT32, "
+ "then you will not introduce any new "
+ "problems.");
+ else
+ fat32_msg = _("If you convert to FAT32, and MS Windows "
+ "is installed on this partition, then "
+ "you must re-install the MS Windows boot "
+ "loader. If you want to do this, you "
+ "should consult the Parted manual (or "
+ "your distribution's manual). Also, "
+ "converting to FAT32 will make the file "
+ "system unreadable by MS DOS, MS Windows "
+ "95a, and MS Windows NT.");
+
+ if (fat16_ok && fat32_ok) {
+ status = ped_exception_throw (
+ PED_EXCEPTION_INFORMATION,
+ PED_EXCEPTION_YES_NO_CANCEL,
+ _("%s %s %s"),
+ _("Would you like to use FAT32?"),
+ fat16_msg,
+ fat32_msg);
+
+ switch (status) {
+ case PED_EXCEPTION_YES:
+ *out_fat_type = FAT_TYPE_FAT32;
+ return 1;
+
+ case PED_EXCEPTION_NO:
+ *out_fat_type = FAT_TYPE_FAT16;
+ return 1;
+
+ case PED_EXCEPTION_UNHANDLED:
+ *out_fat_type = fs_info->fat_type;
+ return 1;
+
+ case PED_EXCEPTION_CANCEL:
+ return 0;
+ }
+ }
+
+ if (fat16_ok) {
+ if (fs_info->fat_type != FAT_TYPE_FAT16) {
+ status = ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_OK_CANCEL,
+ _("%s %s"),
+ _("The file system can only be resized to this "
+ "size by converting to FAT16."),
+ fat16_msg);
+ if (status == PED_EXCEPTION_CANCEL)
+ return 0;
+ }
+ *out_fat_type = FAT_TYPE_FAT16;
+ return 1;
+ }
+
+ if (fat32_ok) {
+ if (fs_info->fat_type != FAT_TYPE_FAT32) {
+ status = ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_OK_CANCEL,
+ _("%s %s"),
+ _("The file system can only be resized to this "
+ "size by converting to FAT32."),
+ fat32_msg);
+ if (status == PED_EXCEPTION_CANCEL)
+ return 0;
+ }
+ *out_fat_type = FAT_TYPE_FAT32;
+ return 1;
+ }
+
+ ped_exception_throw (
+ PED_EXCEPTION_NO_FEATURE,
+ PED_EXCEPTION_CANCEL,
+ _("GNU Parted cannot resize this partition to this size. "
+ "We're working on it!"));
+
+ return 0;
+}
+
+/* For resize operations: determine if the file system must be FAT16 or FAT32,
+ * or either. If the new file system must be FAT32, then query for
+ * confirmation. If either file system can be used, query for which one.
+ */
+static int
+get_fat_type (PedFileSystem* fs, const PedGeometry* new_geom,
+ FatType* out_fat_type)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ PedExceptionOption status;
+ PedSector fat16_cluster_sectors;
+ PedSector fat32_cluster_sectors;
+ FatCluster dummy_cluster_count;
+ PedSector dummy_fat_sectors;
+ int fat16_ok;
+ int fat32_ok;
+
+ fat16_ok = fat_calc_resize_sizes (
+ new_geom,
+ fs_info->cluster_sectors,
+ FAT_TYPE_FAT16,
+ fs_info->root_dir_sector_count,
+ fs_info->cluster_sectors,
+ &fat16_cluster_sectors,
+ &dummy_cluster_count,
+ &dummy_fat_sectors);
+
+ fat32_ok = fat_calc_resize_sizes (
+ new_geom,
+ fs_info->cluster_sectors,
+ FAT_TYPE_FAT32,
+ fs_info->root_dir_sector_count,
+ fs_info->cluster_sectors,
+ &fat32_cluster_sectors,
+ &dummy_cluster_count,
+ &dummy_fat_sectors);
+
+ return ask_type (fs, fat16_ok, fat32_ok, out_fat_type);
+}
+
+/* Creates the PedFileSystem struct for the new resized file system, and
+ sticks it in a FatOpContext. At the end of the process, the original
+ (ctx->old_fs) is destroyed, and replaced with the new one (ctx->new_fs).
+ */
+static FatOpContext*
+create_resize_context (PedFileSystem* fs, const PedGeometry* new_geom)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ FatSpecific* new_fs_info;
+ PedFileSystem* new_fs;
+ PedSector new_cluster_sectors;
+ FatCluster new_cluster_count;
+ PedSector new_fat_sectors;
+ FatType new_fat_type;
+ PedSector root_dir_sector_count;
+ FatOpContext* context;
+
+ /* hypothetical number of root dir sectors, if we end up using
+ * FAT16
+ */
+ if (fs_info->root_dir_sector_count)
+ root_dir_sector_count = fs_info->root_dir_sector_count;
+ else
+ root_dir_sector_count = FAT_ROOT_DIR_ENTRY_COUNT
+ * sizeof (FatDirEntry) / 512;
+
+ if (!get_fat_type (fs, new_geom, &new_fat_type))
+ return 0;
+
+ fat_calc_resize_sizes (new_geom, fs_info->cluster_sectors, new_fat_type,
+ root_dir_sector_count, fs_info->cluster_sectors,
+ &new_cluster_sectors, &new_cluster_count, &new_fat_sectors);
+
+ if (!fat_check_resize_geometry (fs, new_geom, new_cluster_sectors,
+ new_cluster_count))
+ goto error;
+
+ new_fs = fat_alloc (new_geom);
+ if (!new_fs)
+ goto error;
+
+ new_fs_info = FAT_SPECIFIC (new_fs);
+ if (!new_fs_info)
+ goto error_free_new_fs;
+
+/* preserve boot code, etc. */
+ memcpy (&new_fs_info->boot_sector, &fs_info->boot_sector,
+ sizeof (FatBootSector));
+ memcpy (&new_fs_info->info_sector, &fs_info->info_sector,
+ sizeof (FatInfoSector));
+
+ new_fs_info->logical_sector_size = fs_info->logical_sector_size;
+ new_fs_info->sector_count = new_geom->length;
+
+ new_fs_info->sectors_per_track = fs_info->sectors_per_track;
+ new_fs_info->heads = fs_info->heads;
+
+ new_fs_info->cluster_size = new_cluster_sectors * 512;
+ new_fs_info->cluster_sectors = new_cluster_sectors;
+ new_fs_info->cluster_count = new_cluster_count;
+ new_fs_info->dir_entries_per_cluster = fs_info->dir_entries_per_cluster;
+
+ new_fs_info->fat_type = new_fat_type;
+ new_fs_info->fat_table_count = 2;
+ new_fs_info->fat_sectors = new_fat_sectors;
+
+ /* what about copying? */
+ new_fs_info->serial_number = fs_info->serial_number;
+
+ if (new_fs_info->fat_type == FAT_TYPE_FAT32) {
+ new_fs_info->info_sector_offset = 1;
+ new_fs_info->boot_sector_backup_offset = 6;
+
+ new_fs_info->root_dir_offset = 0;
+ new_fs_info->root_dir_entry_count = 0;
+ new_fs_info->root_dir_sector_count = 0;
+
+ /* we add calc_align_sectors to push the cluster_offset
+ forward, to keep the clusters aligned between the new
+ and old file systems
+ */
+ new_fs_info->fat_offset
+ = fat_min_reserved_sector_count (FAT_TYPE_FAT32)
+ + fat_calc_align_sectors (new_fs, fs);
+
+ new_fs_info->cluster_offset
+ = new_fs_info->fat_offset
+ + 2 * new_fs_info->fat_sectors;
+ } else {
+ new_fs_info->root_dir_sector_count = root_dir_sector_count;
+ new_fs_info->root_dir_entry_count
+ = root_dir_sector_count * 512 / sizeof (FatDirEntry);
+
+ new_fs_info->fat_offset
+ = fat_min_reserved_sector_count (FAT_TYPE_FAT16)
+ + fat_calc_align_sectors (new_fs, fs);
+
+ new_fs_info->root_dir_offset = new_fs_info->fat_offset
+ + 2 * new_fs_info->fat_sectors;
+
+ new_fs_info->cluster_offset = new_fs_info->root_dir_offset
+ + new_fs_info->root_dir_sector_count;
+ }
+
+ new_fs_info->total_dir_clusters = fs_info->total_dir_clusters;
+
+ context = fat_op_context_new (new_fs, fs);
+ if (!context)
+ goto error_free_new_fs_info;
+
+ if (!fat_op_context_create_initial_fat (context))
+ goto error_free_context;
+
+ if (!fat_alloc_buffers (new_fs))
+ goto error_free_fat;
+
+ return context;
+
+error_free_fat:
+ fat_table_destroy (new_fs_info->fat);
+error_free_context:
+ ped_free (context);
+error_free_new_fs_info:
+ ped_free (new_fs_info);
+error_free_new_fs:
+ ped_free (new_fs);
+error:
+ return NULL;
+}
+
+static int
+resize_context_assimilate (FatOpContext* ctx)
+{
+ FatSpecific* old_fs_info = FAT_SPECIFIC (ctx->old_fs);
+ FatSpecific* new_fs_info = FAT_SPECIFIC (ctx->new_fs);
+
+ fat_free_buffers (ctx->old_fs);
+ fat_table_destroy (old_fs_info->fat);
+ ped_free (old_fs_info);
+ ped_geometry_destroy (ctx->old_fs->geom);
+
+ ctx->old_fs->type_specific = ctx->new_fs->type_specific;
+ ctx->old_fs->geom = ctx->new_fs->geom;
+ ctx->old_fs->type = (new_fs_info->fat_type == FAT_TYPE_FAT16)
+ ? &fat16_type
+ : &fat32_type;
+
+ ped_free (ctx->new_fs);
+
+ fat_op_context_destroy (ctx);
+
+ return 1;
+}
+
+static int
+resize_context_abort (FatOpContext* ctx)
+{
+ FatSpecific* new_fs_info = FAT_SPECIFIC (ctx->new_fs);
+
+ fat_free_buffers (ctx->new_fs);
+ fat_table_destroy (new_fs_info->fat);
+ ped_free (new_fs_info);
+ ped_geometry_destroy (ctx->new_fs->geom);
+ ped_free (ctx->new_fs);
+
+ fat_op_context_destroy (ctx);
+
+ return 1;
+}
+
+/* copies the "hidden" sectors, between the boot sector and the FAT. Required,
+ * for the Windows 98 FAT32 boot loader
+ */
+int
+_copy_hidden_sectors (FatOpContext* ctx)
+{
+ FatSpecific* old_fs_info = FAT_SPECIFIC (ctx->old_fs);
+ FatSpecific* new_fs_info = FAT_SPECIFIC (ctx->new_fs);
+ PedSector first = 1;
+ PedSector last;
+ PedSector count;
+
+ /* nothing to copy for FAT16 */
+ if (old_fs_info->fat_type == FAT_TYPE_FAT16
+ || new_fs_info->fat_type == FAT_TYPE_FAT16)
+ return 1;
+
+ last = PED_MIN (old_fs_info->fat_offset, new_fs_info->fat_offset) - 1;
+ count = last - first + 1;
+
+ PED_ASSERT (count < BUFFER_SIZE, return 0);
+
+ if (!ped_geometry_read (ctx->old_fs->geom, old_fs_info->buffer,
+ first, count))
+ return 0;
+ if (!ped_geometry_write (ctx->new_fs->geom, old_fs_info->buffer,
+ first, count))
+ return 0;
+ return 1;
+}
+
+int
+fat_resize (PedFileSystem* fs, PedGeometry* geom, PedTimer* timer)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ FatSpecific* new_fs_info;
+ FatOpContext* ctx;
+ PedFileSystem* new_fs;
+
+ ctx = create_resize_context (fs, geom);
+ if (!ctx)
+ goto error;
+ new_fs = ctx->new_fs;
+ new_fs_info = FAT_SPECIFIC (new_fs);
+
+ if (!fat_duplicate_clusters (ctx, timer))
+ goto error_abort_ctx;
+ if (fs_info->fat_type == FAT_TYPE_FAT16
+ && new_fs_info->fat_type == FAT_TYPE_FAT32) {
+ if (!alloc_root_dir (ctx))
+ goto error_abort_ctx;
+ }
+ if (!fat_construct_new_fat (ctx))
+ goto error_abort_ctx;
+ if (fs_info->fat_type == FAT_TYPE_FAT32
+ && new_fs_info->fat_type == FAT_TYPE_FAT16) {
+ if (!free_root_dir (ctx))
+ goto error_abort_ctx;
+ }
+ if (!fat_construct_dir_tree (ctx))
+ goto error_abort_ctx;
+ if (!fat_table_write_all (new_fs_info->fat, new_fs))
+ goto error_abort_ctx;
+
+ _copy_hidden_sectors (ctx);
+ fat_boot_sector_generate (&new_fs_info->boot_sector, new_fs);
+ fat_boot_sector_write (&new_fs_info->boot_sector, new_fs);
+ if (new_fs_info->fat_type == FAT_TYPE_FAT32) {
+ fat_info_sector_generate (&new_fs_info->info_sector, new_fs);
+ fat_info_sector_write (&new_fs_info->info_sector, new_fs);
+ }
+
+ if (!resize_context_assimilate (ctx))
+ goto error;
+
+ return 1;
+
+error_abort_ctx:
+ resize_context_abort (ctx);
+error:
+ return 0;
+}
+
+#endif /* !DISCOVER_ONLY */
diff --git a/libparted/fs/fat/table.c b/libparted/fs/fat/table.c
new file mode 100644
index 0000000..920e269
--- /dev/null
+++ b/libparted/fs/fat/table.c
@@ -0,0 +1,466 @@
+/*
+ libparted
+ Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#include <string.h>
+
+#include <parted/endian.h>
+#include "fat.h"
+
+#ifndef DISCOVER_ONLY
+
+FatTable*
+fat_table_new (FatType fat_type, FatCluster size)
+{
+ FatTable* ft;
+ int entry_size = fat_table_entry_size (fat_type);
+
+ ft = (FatTable*) ped_malloc (sizeof (FatTable));
+ if (!ft) return NULL;
+
+ ft->cluster_count = ft->free_cluster_count = size - 2;
+
+/* ensure there's some free room on the end, to finish off the sector */
+ ft->size = ped_div_round_up (size * entry_size, 512) * 512 / entry_size;
+ ft->fat_type = fat_type;
+ ft->raw_size = ft->size * entry_size;
+
+ ft->table = ped_malloc (ft->raw_size);
+ if (!ft->table) {
+ ped_free (ft);
+ return NULL;
+ }
+
+ fat_table_clear (ft);
+ return ft;
+}
+
+void
+fat_table_destroy (FatTable* ft)
+{
+ ped_free (ft->table);
+ ped_free (ft);
+}
+
+FatTable*
+fat_table_duplicate (const FatTable* ft)
+{
+ FatTable* dup;
+
+ dup = fat_table_new (ft->fat_type, ft->size);
+ if (!dup) return NULL;
+
+ dup->cluster_count = ft->cluster_count;
+ dup->free_cluster_count = ft->free_cluster_count;
+ dup->bad_cluster_count = ft->bad_cluster_count;
+ dup->last_alloc = ft->last_alloc;
+
+ memcpy (dup->table, ft->table, ft->raw_size);
+
+ return dup;
+}
+
+void
+fat_table_clear (FatTable* ft)
+{
+ memset (ft->table, 0, ft->raw_size);
+
+ fat_table_set (ft, 0, 0x0ffffff8);
+ fat_table_set (ft, 1, 0x0fffffff);
+
+ ft->free_cluster_count = ft->cluster_count;
+ ft->bad_cluster_count = 0;
+ ft->last_alloc = 1;
+}
+
+int
+fat_table_set_cluster_count (FatTable* ft, FatCluster new_cluster_count)
+{
+ PED_ASSERT (new_cluster_count + 2 <= ft->size, return 0);
+
+ ft->cluster_count = new_cluster_count;
+ return fat_table_count_stats (ft);
+}
+
+int
+fat_table_count_stats (FatTable* ft)
+{
+ FatCluster i;
+
+ PED_ASSERT (ft->cluster_count + 2 <= ft->size, return 0);
+
+ ft->free_cluster_count = 0;
+ ft->bad_cluster_count = 0;
+
+ for (i=2; i < ft->cluster_count + 2; i++) {
+ if (fat_table_is_available (ft, i))
+ ft->free_cluster_count++;
+ if (fat_table_is_bad (ft, i))
+ ft->bad_cluster_count++;
+ }
+ return 1;
+}
+
+int
+fat_table_read (FatTable* ft, const PedFileSystem* fs, int table_num)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+
+ PED_ASSERT (ft->raw_size >= fs_info->fat_sectors * 512, return 0);
+
+ memset (ft->table, 0, ft->raw_size);
+
+ if (!ped_geometry_read (fs->geom, (void *) ft->table,
+ fs_info->fat_offset
+ + table_num * fs_info->fat_sectors,
+ fs_info->fat_sectors))
+ return 0;
+
+ if ( *((unsigned char*) ft->table) != fs_info->boot_sector.media) {
+ if (ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("FAT %d media %x doesn't match the boot sector's "
+ "media %x. You should probably run scandisk."),
+ (int) table_num + 1,
+ (int) *((unsigned char*) ft->table),
+ (int) fs_info->boot_sector.media)
+ != PED_EXCEPTION_IGNORE)
+ return 0;
+ }
+
+ ft->cluster_count = fs_info->cluster_count;
+
+ fat_table_count_stats (ft);
+
+ return 1;
+}
+
+int
+fat_table_write (const FatTable* ft, PedFileSystem* fs, int table_num)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+
+ PED_ASSERT (ft->raw_size >= fs_info->fat_sectors * 512, return 0);
+
+ if (!ped_geometry_write (fs->geom, (void *) ft->table,
+ fs_info->fat_offset
+ + table_num * fs_info->fat_sectors,
+ fs_info->fat_sectors))
+ return 0;
+ if (!ped_geometry_sync (fs->geom))
+ return 0;
+
+ return 1;
+}
+
+int
+fat_table_write_all (const FatTable* ft, PedFileSystem* fs)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ int i;
+
+ for (i = 0; i < fs_info->fat_table_count; i++) {
+ if (!fat_table_write (ft, fs, i))
+ return 0;
+ }
+
+ return 1;
+}
+
+int
+fat_table_compare (const FatTable* a, const FatTable* b)
+{
+ FatCluster i;
+
+ if (a->cluster_count != b->cluster_count)
+ return 0;
+
+ for (i = 0; i < a->cluster_count + 2; i++) {
+ if (fat_table_get (a, i) != fat_table_get (b, i))
+ return 0;
+ }
+
+ return 1;
+}
+
+static int
+_test_code_available (const FatTable* ft, FatCluster code)
+{
+ return code == 0;
+}
+
+static int
+_test_code_bad (const FatTable* ft, FatCluster code)
+{
+ switch (ft->fat_type) {
+ case FAT_TYPE_FAT16:
+ if (code == 0xfff7) return 1;
+ break;
+
+ case FAT_TYPE_FAT32:
+ if (code == 0x0ffffff7) return 1;
+ break;
+ }
+ return 0;
+}
+
+static int
+_test_code_active (const FatTable* ft, FatCluster code)
+{
+ return code && !_test_code_bad (ft, code);
+}
+
+static int
+_test_code_eof (const FatTable* ft, FatCluster code)
+{
+ switch (ft->fat_type) {
+ case FAT_TYPE_FAT16:
+ if (code >= 0xfff7) return 1;
+ break;
+
+ case FAT_TYPE_FAT32:
+ if (code >= 0x0ffffff7) return 1;
+ break;
+ }
+ return 0;
+}
+
+void
+_update_stats (FatTable* ft, FatCluster cluster, FatCluster value)
+{
+ if (_test_code_available (ft, value)
+ && !fat_table_is_available (ft, cluster)) {
+ ft->free_cluster_count++;
+ if (fat_table_is_bad (ft, cluster))
+ ft->bad_cluster_count--;
+ }
+
+ if (!_test_code_available (ft, value)
+ && fat_table_is_available (ft, cluster)) {
+ ft->free_cluster_count--;
+ if (_test_code_bad (ft, cluster))
+ ft->bad_cluster_count--;
+ }
+}
+
+int
+fat_table_set (FatTable* ft, FatCluster cluster, FatCluster value)
+{
+ if (cluster >= ft->cluster_count + 2) {
+ ped_exception_throw (PED_EXCEPTION_BUG,
+ PED_EXCEPTION_CANCEL,
+ _("fat_table_set: cluster %ld outside "
+ "file system"),
+ (long) cluster);
+ return 0;
+ }
+
+ _update_stats (ft, cluster, value);
+
+ switch (ft->fat_type) {
+ case FAT_TYPE_FAT16:
+ ((unsigned short *) ft->table) [cluster]
+ = PED_CPU_TO_LE16 (value);
+ break;
+
+ case FAT_TYPE_FAT32:
+ ((unsigned int *) ft->table) [cluster]
+ = PED_CPU_TO_LE32 (value);
+ break;
+ }
+ return 1;
+}
+
+FatCluster
+fat_table_get (const FatTable* ft, FatCluster cluster)
+{
+ if (cluster >= ft->cluster_count + 2) {
+ ped_exception_throw (PED_EXCEPTION_BUG,
+ PED_EXCEPTION_CANCEL,
+ _("fat_table_get: cluster %ld outside "
+ "file system"),
+ (long) cluster);
+ exit (1); /* FIXME */
+ }
+
+ switch (ft->fat_type) {
+ case FAT_TYPE_FAT16:
+ return PED_LE16_TO_CPU
+ (((unsigned short *) ft->table) [cluster]);
+
+ case FAT_TYPE_FAT32:
+ return PED_LE32_TO_CPU
+ (((unsigned int *) ft->table) [cluster]);
+ }
+
+ return 0;
+}
+
+FatCluster
+fat_table_alloc_cluster (FatTable* ft)
+{
+ FatCluster i;
+ FatCluster cluster;
+
+/* hack: assumes the first two FAT entries are marked as used (which they
+ * always should be)
+ */
+ for (i=1; i < ft->cluster_count + 1; i++) {
+ cluster = (i + ft->last_alloc) % ft->cluster_count;
+ if (fat_table_is_available (ft, cluster)) {
+ ft->last_alloc = cluster;
+ return cluster;
+ }
+ }
+
+ ped_exception_throw (PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("fat_table_alloc_cluster: no free clusters"));
+ return 0;
+}
+
+FatCluster
+fat_table_alloc_check_cluster (FatTable* ft, PedFileSystem* fs)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ FatCluster result;
+
+ while (1) {
+ result = fat_table_alloc_cluster (ft);
+ if (!result)
+ return 0;
+ if (fat_read_cluster (fs, fs_info->buffer, result))
+ return result;
+ fat_table_set_bad (ft, result);
+ }
+}
+
+/*
+ returns true if <cluster> is marked as bad
+*/
+int
+fat_table_is_bad (const FatTable* ft, FatCluster cluster)
+{
+ return _test_code_bad (ft, fat_table_get (ft, cluster));
+}
+
+/*
+ returns true if <cluster> represents an EOF marker
+*/
+int
+fat_table_is_eof (const FatTable* ft, FatCluster cluster)
+{
+ return _test_code_eof (ft, cluster);
+}
+
+/*
+ returns true if <cluster> is available.
+*/
+int
+fat_table_is_available (const FatTable* ft, FatCluster cluster)
+{
+ return _test_code_available (ft, fat_table_get (ft, cluster));
+}
+
+/*
+ returns true if <cluster> is empty. Note that this includes bad clusters.
+*/
+int
+fat_table_is_empty (const FatTable* ft, FatCluster cluster)
+{
+ return fat_table_is_available (ft, cluster)
+ || fat_table_is_bad (ft, cluster);
+}
+
+/*
+ returns true if <cluster> is being used for something constructive.
+*/
+int
+fat_table_is_active (const FatTable* ft, FatCluster cluster)
+{
+ return !fat_table_is_bad (ft, cluster)
+ && !fat_table_is_available (ft, cluster);
+}
+
+/*
+ marks <cluster> as the last cluster in the chain
+*/
+int
+fat_table_set_eof (FatTable* ft, FatCluster cluster)
+{
+
+ switch (ft->fat_type) {
+ case FAT_TYPE_FAT16:
+ return fat_table_set (ft, cluster, 0xfff8);
+
+ case FAT_TYPE_FAT32:
+ return fat_table_set (ft, cluster, 0x0fffffff);
+ }
+
+ return 0;
+}
+
+/*
+ Marks a clusters as unusable, due to physical disk damage.
+*/
+int
+fat_table_set_bad (FatTable* ft, FatCluster cluster)
+{
+ if (!fat_table_is_bad (ft, cluster))
+ ft->bad_cluster_count++;
+
+ switch (ft->fat_type) {
+ case FAT_TYPE_FAT16:
+ return fat_table_set (ft, cluster, 0xfff7);
+
+ case FAT_TYPE_FAT32:
+ return fat_table_set (ft, cluster, 0x0ffffff7);
+ }
+
+ return 0;
+}
+
+/*
+ marks <cluster> as unused/free/available
+*/
+int
+fat_table_set_avail (FatTable* ft, FatCluster cluster)
+{
+ return fat_table_set (ft, cluster, 0);
+}
+
+#endif /* !DISCOVER_ONLY */
+
+int
+fat_table_entry_size (FatType fat_type)
+{
+ switch (fat_type) {
+ case FAT_TYPE_FAT12:
+ return 2; /* FIXME: how? */
+
+ case FAT_TYPE_FAT16:
+ return 2;
+
+ case FAT_TYPE_FAT32:
+ return 4;
+ }
+
+ return 0;
+}
+
diff --git a/libparted/fs/fat/table.h b/libparted/fs/fat/table.h
new file mode 100644
index 0000000..9d2501b
--- /dev/null
+++ b/libparted/fs/fat/table.h
@@ -0,0 +1,75 @@
+/*
+ libparted
+ Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef PED_FAT_TABLE_H_INCLUDED
+#define PED_FAT_TABLE_H_INCLUDED
+
+typedef struct _FatTable FatTable;
+
+#include "fat.h"
+
+struct _FatTable {
+ void* table;
+ FatCluster size;
+ int raw_size;
+
+ FatType fat_type;
+ FatCluster cluster_count;
+ FatCluster free_cluster_count;
+ FatCluster bad_cluster_count;
+
+ FatCluster last_alloc;
+};
+
+extern FatTable* fat_table_new (FatType fat_type, FatCluster size);
+extern FatTable* fat_table_duplicate (const FatTable* ft);
+extern void fat_table_destroy (FatTable* ft);
+extern void fat_table_clear (FatTable* ft);
+extern int fat_table_set_cluster_count (FatTable* ft,
+ FatCluster new_cluster_count);
+
+extern int fat_table_read (FatTable* ft, const PedFileSystem* fs,
+ int table_num);
+extern int fat_table_write (const FatTable* ft, PedFileSystem* fs,
+ int table_num);
+extern int fat_table_write_all (const FatTable* ft, PedFileSystem* fs);
+extern int fat_table_compare (const FatTable* a, const FatTable* b);
+extern int fat_table_count_stats (FatTable* ft);
+
+extern FatCluster fat_table_get (const FatTable* ft, FatCluster cluster);
+extern int fat_table_set (FatTable* ft, FatCluster cluster, FatCluster value);
+
+extern FatCluster fat_table_alloc_cluster (FatTable* ft);
+extern FatCluster fat_table_alloc_check_cluster (FatTable* ft,
+ PedFileSystem* fs);
+
+extern int fat_table_is_bad (const FatTable* ft, FatCluster cluster);
+extern int fat_table_is_eof (const FatTable* ft, FatCluster cluster);
+extern int fat_table_is_empty (const FatTable* ft, FatCluster cluster);
+extern int fat_table_is_available (const FatTable* ft, FatCluster cluster);
+extern int fat_table_is_active (const FatTable* ft, FatCluster cluster);
+
+extern int fat_table_set_eof (FatTable* ft, FatCluster cluster);
+extern int fat_table_set_avail (FatTable* ft, FatCluster cluster);
+extern int fat_table_set_bad (FatTable* ft, FatCluster cluster);
+
+extern int fat_table_entry_size (FatType fat_type);
+
+#endif /* PED_FAT_TABLE_H_INCLUDED */
+
diff --git a/libparted/fs/fat/traverse.c b/libparted/fs/fat/traverse.c
new file mode 100644
index 0000000..8c3e530
--- /dev/null
+++ b/libparted/fs/fat/traverse.c
@@ -0,0 +1,369 @@
+/*
+ libparted
+ Copyright (C) 1998, 1999, 2000, 2005 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+
+ I can also be contacted at:
+
+ Andrew Clausen
+ 18 Shaw St
+ Ashwood, 3147
+ Victoria, Australia
+
+*/
+
+#include "fat.h"
+#include "traverse.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifndef DISCOVER_ONLY
+
+#define NO_CLUSTER -1
+
+static char tmp_buffer [4096];
+
+int
+fat_traverse_entries_per_buffer (FatTraverseInfo* trav_info)
+{
+ return trav_info->buffer_size / sizeof (FatDirEntry);
+}
+
+/* returns 1 if there are no more directory entries in the directory being
+ * traversed, 0 otherwise.
+ */
+static int
+is_last_buffer (FatTraverseInfo* trav_info) {
+ FatSpecific* fs_info = FAT_SPECIFIC (trav_info->fs);
+
+ if (trav_info->is_legacy_root_dir)
+ return 1;
+ else
+ return fat_table_is_eof (fs_info->fat, trav_info->next_buffer);
+}
+
+static int
+write_root_dir (FatTraverseInfo* trav_info)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (trav_info->fs);
+
+ if (!ped_geometry_write (trav_info->fs->geom, trav_info->dir_entries,
+ fs_info->root_dir_offset,
+ fs_info->root_dir_sector_count))
+ return 0;
+ if (!ped_geometry_sync (trav_info->fs->geom))
+ return 0;
+ trav_info->dirty = 0;
+ return 1;
+}
+
+static int
+write_dir_cluster (FatTraverseInfo* trav_info)
+{
+ if (!fat_write_sync_cluster (trav_info->fs,
+ (void*) trav_info->dir_entries,
+ trav_info->this_buffer))
+ return 0;
+ trav_info->dirty = 0;
+ return 1;
+}
+
+static int
+write_dir_buffer (FatTraverseInfo* trav_info)
+{
+ if (trav_info->is_legacy_root_dir)
+ return write_root_dir (trav_info);
+ else
+ return write_dir_cluster (trav_info);
+}
+
+static int
+read_next_dir_buffer (FatTraverseInfo* trav_info)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (trav_info->fs);
+
+ PED_ASSERT (!trav_info->is_legacy_root_dir, return 0);
+
+ trav_info->this_buffer = trav_info->next_buffer;
+
+ if (trav_info->this_buffer < 2
+ || trav_info->this_buffer >= fs_info->cluster_count + 2) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ "Cluster %ld in directory %s is outside file system!",
+ (long) trav_info->this_buffer,
+ trav_info->dir_name);
+ return 0;
+ }
+
+ trav_info->next_buffer
+ = fat_table_get (fs_info->fat, trav_info->this_buffer);
+
+ return fat_read_cluster (trav_info->fs, (void *) trav_info->dir_entries,
+ trav_info->this_buffer);
+}
+
+/* FIXME: put into fat_dir_entry_* operations */
+void
+fat_traverse_mark_dirty (FatTraverseInfo* trav_info)
+{
+ trav_info->dirty = 1;
+}
+
+FatTraverseInfo*
+fat_traverse_begin (PedFileSystem* fs, FatCluster start_cluster,
+ char* dir_name)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ FatTraverseInfo* trav_info;
+
+ trav_info = (FatTraverseInfo*) ped_malloc (sizeof (FatTraverseInfo));
+ if (!trav_info)
+ goto error;
+
+ trav_info->dir_name = strdup (dir_name);
+ if (!trav_info->dir_name)
+ goto error_free_trav_info;
+
+ trav_info->fs = fs;
+ trav_info->is_legacy_root_dir
+ = (fs_info->fat_type == FAT_TYPE_FAT16) && (start_cluster == 0);
+ trav_info->dirty = 0;
+ trav_info->eof = 0;
+ trav_info->current_entry = -1;
+
+ if (trav_info->is_legacy_root_dir) {
+ trav_info->buffer_size = 512 * fs_info->root_dir_sector_count;
+ } else {
+ trav_info->next_buffer = start_cluster;
+ trav_info->buffer_size = fs_info->cluster_size;
+ }
+
+ trav_info->dir_entries
+ = (FatDirEntry*) ped_malloc (trav_info->buffer_size);
+ if (!trav_info->dir_entries)
+ goto error_free_dir_name;
+
+ if (trav_info->is_legacy_root_dir) {
+ if (!ped_geometry_read (fs->geom, trav_info->dir_entries,
+ fs_info->root_dir_offset,
+ fs_info->root_dir_sector_count))
+ goto error_free_dir_entries;
+ } else {
+ if (!read_next_dir_buffer (trav_info))
+ goto error_free_dir_entries;
+ }
+
+ return trav_info;
+
+error_free_dir_entries:
+ ped_free (trav_info->dir_entries);
+error_free_dir_name:
+ ped_free (trav_info->dir_name);
+error_free_trav_info:
+ ped_free (trav_info);
+error:
+ return NULL;
+}
+
+int
+fat_traverse_complete (FatTraverseInfo* trav_info)
+{
+ if (trav_info->dirty) {
+ if (!write_dir_buffer (trav_info))
+ return 0;
+ }
+ ped_free (trav_info->dir_entries);
+ ped_free (trav_info->dir_name);
+ ped_free (trav_info);
+ return 1;
+}
+
+FatTraverseInfo*
+fat_traverse_directory (FatTraverseInfo *trav_info, FatDirEntry* parent)
+{
+ strcpy (tmp_buffer, trav_info->dir_name);
+ fat_dir_entry_get_name (parent,
+ tmp_buffer + strlen (trav_info->dir_name));
+ strcat (tmp_buffer, "\\");
+
+ return fat_traverse_begin (trav_info->fs,
+ fat_dir_entry_get_first_cluster (parent, trav_info->fs),
+ tmp_buffer);
+}
+
+FatDirEntry*
+fat_traverse_next_dir_entry (FatTraverseInfo *trav_info)
+{
+ if (trav_info->eof)
+ return NULL;
+
+ trav_info->current_entry++;
+ if (trav_info->current_entry
+ >= fat_traverse_entries_per_buffer (trav_info)) {
+ if (trav_info->dirty) {
+ if (!write_dir_buffer (trav_info))
+ return NULL;
+ }
+
+ trav_info->current_entry = 0;
+ if (is_last_buffer (trav_info)) {
+ trav_info->eof = 1;
+ return NULL;
+ }
+ if (!read_next_dir_buffer (trav_info))
+ return NULL;
+ }
+ return trav_info->dir_entries + trav_info->current_entry;
+}
+
+FatCluster
+fat_dir_entry_get_first_cluster (FatDirEntry* dir_entry, PedFileSystem *fs)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+
+ switch (fs_info->fat_type) {
+ case FAT_TYPE_FAT12:
+ case FAT_TYPE_FAT16:
+ return PED_LE16_TO_CPU (dir_entry->first_cluster);
+
+ case FAT_TYPE_FAT32:
+ return PED_LE16_TO_CPU (dir_entry->first_cluster_high)
+ * 65536L
+ + PED_LE16_TO_CPU (dir_entry->first_cluster);
+ }
+
+ return 0;
+}
+
+void
+fat_dir_entry_set_first_cluster (FatDirEntry* dir_entry, PedFileSystem* fs,
+ FatCluster cluster)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+
+ switch (fs_info->fat_type) {
+ case FAT_TYPE_FAT16:
+ dir_entry->first_cluster = PED_CPU_TO_LE16 (cluster);
+ break;
+
+ case FAT_TYPE_FAT32:
+ dir_entry->first_cluster
+ = PED_CPU_TO_LE16 (cluster & 0xffff);
+ dir_entry->first_cluster_high
+ = PED_CPU_TO_LE16 (cluster / 0x10000);
+ break;
+ }
+}
+
+uint32_t
+fat_dir_entry_get_length (FatDirEntry* dir_entry)
+{
+ return PED_LE32_TO_CPU (dir_entry->length);
+}
+
+int
+fat_dir_entry_is_null_term (const FatDirEntry* dir_entry)
+{
+ FatDirEntry null_entry;
+
+ memset (&null_entry, 0, sizeof (null_entry));
+ return memcmp (&null_entry, dir_entry, sizeof (null_entry)) == 0;
+}
+
+int
+fat_dir_entry_is_active (FatDirEntry* dir_entry)
+{
+ if ((unsigned char) dir_entry->name[0] == DELETED_FLAG) return 0;
+ if ((unsigned char) dir_entry->name[0] == 0) return 0;
+ if ((unsigned char) dir_entry->name[0] == 0xF6) return 0;
+ return 1;
+}
+
+int
+fat_dir_entry_is_file (FatDirEntry* dir_entry) {
+ if (dir_entry->attributes == VFAT_ATTR) return 0;
+ if (dir_entry->attributes & VOLUME_LABEL_ATTR) return 0;
+ if (!fat_dir_entry_is_active (dir_entry)) return 0;
+ if ((dir_entry->attributes & DIRECTORY_ATTR) == DIRECTORY_ATTR) return 0;
+ return 1;
+}
+
+int
+fat_dir_entry_is_system_file (FatDirEntry* dir_entry)
+{
+ if (!fat_dir_entry_is_file (dir_entry)) return 0;
+ return (dir_entry->attributes & SYSTEM_ATTR)
+ || (dir_entry->attributes & HIDDEN_ATTR);
+}
+
+int
+fat_dir_entry_is_directory (FatDirEntry* dir_entry)
+{
+ if (dir_entry->attributes == VFAT_ATTR) return 0;
+ if (dir_entry->attributes & VOLUME_LABEL_ATTR) return 0;
+ if (!fat_dir_entry_is_active (dir_entry)) return 0;
+ return (dir_entry->attributes & DIRECTORY_ATTR) == DIRECTORY_ATTR;
+}
+
+int
+fat_dir_entry_has_first_cluster (FatDirEntry* dir_entry, PedFileSystem* fs)
+{
+ FatSpecific* fs_info = FAT_SPECIFIC (fs);
+ FatCluster first_cluster;
+
+ if (!fat_dir_entry_is_file (dir_entry)
+ && !fat_dir_entry_is_directory (dir_entry))
+ return 0;
+
+ first_cluster = fat_dir_entry_get_first_cluster (dir_entry, fs);
+ if (first_cluster == 0
+ || fat_table_is_eof (fs_info->fat, first_cluster))
+ return 0;
+
+ return 1;
+}
+
+/*
+ decrypts silly DOS names to FILENAME.EXT
+*/
+void
+fat_dir_entry_get_name (FatDirEntry*dir_entry, char *result) {
+ int i;
+ char *src;
+
+ src = dir_entry->name;
+
+ for (i=0; i<8; i++) {
+ if (src[i] == ' ' || src[i] == 0) break;
+ *result++ = src[i];
+ }
+
+ if (src[8] != ' ' && src[8] != 0) {
+ *result++ = '.';
+ for (i=8; i<11; i++) {
+ if (src[i] == ' ' || src[i] == 0) break;
+ *result++ = src[i];
+ }
+ }
+
+ *result = 0;
+}
+
+#endif /* !DISCOVER_ONLY */
diff --git a/libparted/fs/fat/traverse.h b/libparted/fs/fat/traverse.h
new file mode 100644
index 0000000..b88302c
--- /dev/null
+++ b/libparted/fs/fat/traverse.h
@@ -0,0 +1,81 @@
+/*
+ libparted
+ Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+
+ I can also be contacted at:
+
+ Andrew Clausen
+ 18 Shaw St
+ Ashwood, 3147
+ Victoria, Australia
+*/
+
+#ifndef TRAVERSE_H_INCLUDED
+#define TRAVERSE_H_INCLUDED
+
+#include "fatio.h"
+
+typedef struct _FatTraverseInfo FatTraverseInfo;
+
+struct _FatTraverseInfo {
+ PedFileSystem* fs;
+ char* dir_name;
+
+ int is_legacy_root_dir;
+ int dirty;
+ int eof;
+
+ FatDirEntry* dir_entries;
+ int current_entry;
+ FatCluster this_buffer, next_buffer;
+ int buffer_size;
+};
+
+extern int fat_traverse_entries_per_buffer (FatTraverseInfo* trav_info);
+
+/* starts traversal at an arbitary cluster. if start_cluster==0, then uses
+ root directory */
+extern FatTraverseInfo* fat_traverse_begin (PedFileSystem* fs,
+ FatCluster start_cluster, char* dir_name);
+
+extern int fat_traverse_complete (FatTraverseInfo* trav_info);
+
+extern FatTraverseInfo* fat_traverse_directory (FatTraverseInfo* trav_info,
+ FatDirEntry* parent);
+
+extern void fat_traverse_mark_dirty (FatTraverseInfo* trav_info);
+
+extern FatDirEntry* fat_traverse_next_dir_entry (FatTraverseInfo* trav_info);
+
+extern FatCluster fat_dir_entry_get_first_cluster (FatDirEntry* dir_entry,
+ PedFileSystem* fs);
+
+extern void fat_dir_entry_set_first_cluster (FatDirEntry* dir_entry,
+ PedFileSystem* fs, FatCluster cluster);
+
+extern uint32_t fat_dir_entry_get_length (FatDirEntry* dir_entry);
+
+extern int fat_dir_entry_is_null_term (const FatDirEntry* dir_entry);
+extern int fat_dir_entry_is_file (FatDirEntry* dir_entry);
+extern int fat_dir_entry_is_system_file (FatDirEntry* dir_entry);
+extern int fat_dir_entry_is_directory (FatDirEntry* dir_entry);
+extern void fat_dir_entry_get_name (FatDirEntry* dir_entry, char* result);
+extern int fat_dir_entry_is_active (FatDirEntry* dir_entry);
+extern int fat_dir_entry_has_first_cluster (FatDirEntry* dir_entry,
+ PedFileSystem* fs);
+
+#endif /* TRAVERSE_H_INCLUDED */
diff --git a/libparted/fs/hfs/DOC b/libparted/fs/hfs/DOC
new file mode 100644
index 0000000..d39b10b
--- /dev/null
+++ b/libparted/fs/hfs/DOC
@@ -0,0 +1,92 @@
+WARNING : Both HFS and HFS+ implementations of Linux 2.4 are buggy, at
+least when used before or after this implementation. Some workarounds
+are used in this implementation, but there can still be incompatibilities.
+Try Linux 2.6 if you want to play with HFS(+) resizing (though some bugs
+might also be there in 2.6, there is of course no warranty)
+
+---
+
+ Technical doc about Apple HFS and HFS+ file systems is available at :
+ * For HFS, section "Data Organization on Volumes",
+ "Chapter 2 - File Manager"
+ of the book "Inside Macintosh: Files"
+ http://developer.apple.com/documentation/mac/Files/Files-99.html
+ * For HFS+, "Technical Note TN1150", "HFS Plus Volume Format"
+ http://developer.apple.com/technotes/tn/tn1150.html
+
+ Some useful HFS precisions concerning alignement, bit ordering, and
+ order of fields for extent key comparaisons are only in the HFS+ TN
+
+ These Apple Creator Codes are reserved for us :
+ Shnk traP GP16 GnuP PH+x Xpnd Resz GP17 GP18 GP19 GP20
+
+---
+
+* Cache design *
+
+Versions before HFS Patch 15 were very slow when data relocation was needed,
+because every extent to relocate involved scanning the whole file system,
+looking for a reference to its physical position on the volume (this was a
+dummy algorithm, I know :)
+
+HFS Patch 16 introduced a cache that allows to efficiently retrieve the place
+of the reference in the file system given the physical position of an extent.
+The cache is designed for : - efficiency
+ - scaling
+ - simplicity
+ - avoiding memory allocation while resizing
+
+This cache involves quite big worst case memory consumption, but without it
+the time needed to complete the operation in the worst case would be huge
+anyway (maybe several years...) so this isn't really an issue. The cache size
+is nearly proportional to the number of files you have, or if you have very few
+files, to the size of your volume, so worst cases situations occure when you
+fill a drive with millions of < 4 ko files :p For this very special usage you
+will just need a very special amount of RAM (on typical systems about
+(FS size) / 256 )... On a more "normal" volume it's about
+(# of files) * 20 bytes. With very few files it's about (FS Size) / 1024 / 256.
+
+At the beginning of the resize process, the cache is filed by scanning the FS.
+The position of each extent is cut into 2 parts : high order is used as
+an index into a table of pointer to a linked list which contains :
+- the next ptr (sizeof struct *)
+- the extent start (4 bytes)
+- the extent size (4 bytes)
+- number of BTree block or 0 if in prim (4 bytes)
+- offset of the extent start reference
+ from the block beginning (2 bytes)
+- sectors by BTree block, or
+ 1 for VH/MDB (1 byte)
+- FS special file / primary structure
+ where the extent reference is stored (1 byte)
+ (3 bits for the extent index, 5 for
+ the actual ref)
+
+ 0 : dont exists --- reserved
+ 1 : mdb / vh : catalog ---
+ 2 : mdb / vh : extent ---
+ 3 : vh : attributes X+-
+ 4 : vh : allocation X+-
+ 5 : vh : startup X+-
+ 6 : catalog ---
+ 7 : attributes X+-
+ 8 : extent (nothing to update) ---
+ 9 : extent (update catalog) ---
+ 10 : extent (update extent !?!) --- should not exist
+ 11 : extent (update attributes) X+-
+ 12 : extent (update allocation) X+-
+ 13 : extent (update startup) X+- reserved
+ 14 : vh : journal info block X+J
+ 15 : jib: journal X+J
+ 16 - 31 : ---
+
+mdb : Master Directory Block
+vh : Volume Header
+X+ : HFSX or HFS+ only
+J : Journaled only
+
+Large amount of memory is allocated at once (first enough memory to fit
+every files if there isn't any fragmentation +6.25%, then this value / 4,
+if this wasn't enough). On a typical FS, the first allocation should be enough.
+
+---
diff --git a/libparted/fs/hfs/HISTORY b/libparted/fs/hfs/HISTORY
new file mode 100644
index 0000000..e4c4b52
--- /dev/null
+++ b/libparted/fs/hfs/HISTORY
@@ -0,0 +1,115 @@
+## modifications dd-mm-yyyy
+---------------------- PATCH FOR PARTED 1.6.5 ----------------------------
+ 1 initial revision 07-04-2003
+ 2 one pass resizing, removal of debug info 08-04-2003
+ 3 safe abort if resize failed, code cleanups, timer, 10-04-2003
+ source file split, won't resize if not unmounted,
+ only relocate data if needed, minimize disk operations
+ 4 memory leaks removal, code cleanups, resize hfs+ code, 17-04-2003
+ more checks, minor hfs resize bugfix, probe code
+ returns real geometry
+ 5 hfs+ resize bugfixes : 19-04-2003
+ * fragmented fs could be corrupted
+ * VH wasn't written on error during alloc map writing
+ * attributes file could be corrupted
+ 6 Use PedSector to be able to use 2To+ HD 23-04-2003
+ Minor probe bugfix, Cleanups, HFS+ Timer tuning,
+ 7 80 columns indentation 23-04-2003
+ 8 Bugfix free blocks calculation in wrapper
+ (makes Mac OS boot !) 28-04-2003
+---------------------- PATCH FOR PARTED 1.6.6 ----------------------------
+ 9 Don't destroy the file being worked on in case of
+ interruption of Parted 28-10-2003
+---------------------- PATCH FOR PARTED 1.6.10 ---------------------------
+10 Regression tests, URL correction, In effect_move_extent :
+ corrected memory leak & corrected a bug in precondition checks
+ Added error messages, Check ped_alloc results
+ Use macro for test / set / clear in the allocation bitmap
+ Light probe correction, Check return value of get_empty_end
+ Moved dynamic memory allocation out of effect_move_extent
+ Check HFS+ version, Set implementation creator code
+ Check journal absence, Corrected a bug in HFS+ block number
+ calculation 24-04-2004
+--------------------- PATCH FOR PARTED 1.6.11 ----------------------------
+11-Some pointer dereference moved after non nul assertion
+ -Error messages for HFS(+) file IO
+ -Memory leak correction in hfs(plus)_read_bad_blocks
+ -Mark out of volume blocks as used
+ (improve compatibility with broken HFS+ Linux
+ implementation)
+ WARNING : this fix is not 100% tn1150 compatible :
+ "The allocation file may be larger than the minimum
+ number of bits required for the given volume size.
+ Any unused bits in the bitmap must be set to _zero_."
+ Anyway neither is the Linux implementation, nor was my
+ previous implementations
+ Maybe I should ask Apple to change the specifications
+ -HISTORY, DOC and TODO files 29-04-2004
+12 Corrected a bug in hfsplus_volume_resize : size of alloc
+ bitmap could be miscalculated 29-04-2004
+--------------------- PATCH FOR PARTED 1.6.12 ----------------------------
+13-Finally partial rewrite of *_search_move_*
+ Easier to maintain and prepare for extent search and
+ relocation algorithm changes for better ones.
+ -"An extent has not been relocated!" message now only when
+ relocation requested
+ -Slightly better and simpler relocation algorithm
+ -Update of Makefile.in and Makefile.am in fs_hfs
+ -Sign correction for some 8bits HFS integers
+ -Added the option --enable-hfs-extract-fs in 'configure'
+ -Added every ped_geometry_sync where needed
+ -Bugfix : "A root node does not need to exist
+ (if the tree is empty)."
+ - now handled correctly in btree_search
+ -Bugfix : failure wasn't detected in some cases
+ during 2 pass relocation (*_search_move_*)
+ -Bugfix : The extent key comparaison was done in a wrong order
+ and a pad field was used during the comparaison
+ -Bugfix : in hfs_file_find_sector and hfsplus_file_find_sector
+ the absolute position of a file sector could be
+ miscalculated in case of fragmentation, resulting
+ in potential data corruption, or various errors
+ -Bugfix : The end of the HFS bitmap compatibility block was
+ miscalculated ( (1<<16)/8 instead of (1<<16) )
+ in hfs_resize
+ 07-09-2004
+--------------------- PATCH FOR PARTED 1.6.14 ----------------------------
+14 Port of Patch 13 for Parted 1.6.14 (update timestamps)
+ 08-09-2004
+--------------------- PATCH FOR PARTED 1.6.15 ----------------------------
+15-hfsplus_open : added a warning message if the "attributes"
+ special file exists
+ -hfsplus_open : added a test to check if the "allocation"
+ special file has been correctly opened
+ -optimisation of hfs+ block access : don't recalculate
+ the address of each sector, and avoid checking the cache if
+ obviously not useful
+ ( hfsplus_file_read && hfsplus_file_write
+ && hfsplus_file_find_extent && hfs_file_find_sector)
+ -cut the "hfs.c" file in several parts
+ -Bugfix: in hfsplus_do_move_primary, hfs_effect_move_extent
+ was called instead of hfsplus_effect_move_extent !!!
+ This could not produce data corruption, because of a welcome
+ ASSERT in *_effect_move_extent that would detect the bug :)
+ -Bugfix: in hfs_effect_move_extent, do
+ PED_ASSERT(*ptr_to_fblock <= *ptr_fblock, return -1);
+ instead of
+ PED_ASSERT(*ptr_to_fblock < *ptr_fblock, return -1);
+ and added that assertion to hfsplus_effect_move_extent
+ -Bugfix: bugs introduced in rewrite of hfsplus_file_read
+ && hfsplus_file_write : last sector was incorrectly detected
+ as out of file.
+ -Cache the extent references (speed improvement ?)
+ 23-09-2004
+16-Bugfix: in hfsplus_do_move (reloc_plus.c), case CR_BTREE_EXT_ATTR
+ incorrectly updated the cached part of priv_data->catalog_file
+ instead of priv_data->attributes_file
+ -Bugfix: in hfs_read_bad_blocks && hfsplus_read_bad_blocks,
+ now generate an error if file_ID or type mismatch after the
+ first pass
+ Also check return value of ped_malloc
+ -Bugfix: in hfsplus_btree_search, check return value of ped_malloc
+ 29-09-2004
+---------------- INTEGRATION IN PARTED 1.6.22 (cvs) ----------------------
+Futur changes will be described in ../../ChangeLog
+ 02-02-2005
diff --git a/libparted/fs/hfs/Makefile.am b/libparted/fs/hfs/Makefile.am
new file mode 100644
index 0000000..f70513a
--- /dev/null
+++ b/libparted/fs/hfs/Makefile.am
@@ -0,0 +1,15 @@
+partedincludedir = -I$(top_srcdir)/include
+
+noinst_LTLIBRARIES = libhfs.la
+libhfs_la_SOURCES = hfs.c hfs.h \
+ probe.c probe.h \
+ cache.c cache.h \
+ advfs.c advfs.h \
+ file.c file.h \
+ reloc.c reloc.h \
+ advfs_plus.c advfs_plus.h \
+ file_plus.c file_plus.h \
+ reloc_plus.c reloc_plus.h \
+ journal.c journal.h
+
+INCLUDES = $(partedincludedir) @INTLINCS@
diff --git a/libparted/fs/hfs/TODO b/libparted/fs/hfs/TODO
new file mode 100644
index 0000000..13bca9c
--- /dev/null
+++ b/libparted/fs/hfs/TODO
@@ -0,0 +1,27 @@
+--- TODO ---
+
+ * Continue to write regressions tests and try on 2.6 kernel -- (high)
+ * Fix timer progression calculation, according to the new
+ caching code -- (high)
+ * write doc, website, ... -- (high)
+ * Check block allocation in linux 2.4 and remove
+ compatibility code if possible -- (high)
+
+ * In hfs(plus)_btree_search , use a static variable to detect
+ illegal recursion and abort in that case. (find the right
+ number of recursion before reporting bug) -- easy -- (medium)
+ * Finish the HFS Extractor -- (medium)
+ (add mdb & vh extraction, and maybe journal)
+
+ * Write code to allow enlarging and moving HFS[+x] -- (low)
+ * Use a bitmap to internaly store the bad blocks -- (low)
+ * Less bitmap saves ? -- (low)
+ * Continue to change the relocation algorithm
+ for a better one :) -- (low)
+
+--- NOT todo ---
+
+ * debug HFS(+) Linux implementation (block allocation for HFS+,
+ hard and sym links for HFS+, filename length for HFS, ...) -- (dont)
+ /// Linux 2.6 contains HFS(+) implementations with less bugs
+ /// Linux 2.4 should not be used anymore to access HFS(+)
diff --git a/libparted/fs/hfs/advfs.c b/libparted/fs/hfs/advfs.c
new file mode 100644
index 0000000..b19fe5e
--- /dev/null
+++ b/libparted/fs/hfs/advfs.c
@@ -0,0 +1,331 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef DISCOVER_ONLY
+
+#include "config.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <parted/parted.h>
+#include <parted/endian.h>
+#include <parted/debug.h>
+#include <stdint.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+#include "hfs.h"
+#include "file.h"
+
+#include "advfs.h"
+
+/* - if a < b, 0 if a == b, + if a > b */
+/* Comparaison is done in the following order : */
+/* CNID, then fork type, then start block */
+/* Note that HFS implementation in linux has a bug */
+/* in this function */
+static int
+hfs_extent_key_cmp(HfsPrivateGenericKey* a, HfsPrivateGenericKey* b)
+{
+ HfsExtentKey* key1 = (HfsExtentKey*) a;
+ HfsExtentKey* key2 = (HfsExtentKey*) b;
+
+ /* do NOT use a substraction, because */
+ /* 0xFFFFFFFF - 1 = 0xFFFFFFFE so this */
+ /* would return -2, despite the fact */
+ /* 0xFFFFFFFF > 1 !!! (this is the 2.4 bug) */
+ if (key1->file_ID != key2->file_ID)
+ return PED_BE32_TO_CPU(key1->file_ID) <
+ PED_BE32_TO_CPU(key2->file_ID) ?
+ -1 : +1;
+
+ if (key1->type != key2->type)
+ return (int)(key1->type - key2->type);
+
+ if (key1->start == key2->start)
+ return 0;
+ /* the whole thing wont work with 16 bits ints */
+ /* anyway */
+ return (int)( PED_BE16_TO_CPU(key1->start) -
+ PED_BE16_TO_CPU(key2->start) );
+}
+
+/* do a B-Tree lookup */
+/* read the first record immediatly inferior or egal to the given key */
+/* return 0 on error */
+/* record_out _must_ be large enough to receive record_size bytes */
+/* WARNING : the compare function called only handle Extents BTree */
+/* so modify this function if you want to do lookup in */
+/* other BTrees has well */
+int
+hfs_btree_search (HfsPrivateFile* b_tree_file, HfsPrivateGenericKey* key,
+ void *record_out, unsigned int record_size,
+ HfsCPrivateLeafRec* record_ref)
+{
+ uint8_t node[PED_SECTOR_SIZE_DEFAULT];
+ HfsHeaderRecord* header;
+ HfsNodeDescriptor* desc = (HfsNodeDescriptor*) node;
+ HfsPrivateGenericKey* record_key = NULL;
+ unsigned int node_number, record_number;
+ int i;
+
+ /* Read the header node */
+ if (!hfs_file_read_sector(b_tree_file, node, 0))
+ return 0;
+ header = ((HfsHeaderRecord*) (node + PED_BE16_TO_CPU(*((uint16_t *)
+ (node+(PED_SECTOR_SIZE_DEFAULT-2))))));
+
+ /* Get the node number of the root */
+ node_number = PED_BE32_TO_CPU(header->root_node);
+ if (!node_number)
+ return 0;
+
+ /* Read the root node */
+ if (!hfs_file_read_sector(b_tree_file, node, node_number))
+ return 0;
+
+ /* Follow the white rabbit */
+ while (1) {
+ record_number = PED_BE16_TO_CPU (desc->rec_nb);
+ for (i = record_number; i; i--) {
+ record_key = (HfsPrivateGenericKey*)
+ (node + PED_BE16_TO_CPU(*((uint16_t *)
+ (node+(PED_SECTOR_SIZE_DEFAULT - 2*i)))));
+ /* check for obvious error in FS */
+ if (((uint8_t*)record_key - node < HFS_FIRST_REC)
+ || ((uint8_t*)record_key - node
+ >= PED_SECTOR_SIZE_DEFAULT
+ - 2 * (signed)(record_number+1))) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("The file system contains errors."));
+ return 0;
+ }
+ if (hfs_extent_key_cmp(record_key, key) <= 0)
+ break;
+ }
+ if (!i) return 0;
+ if (desc->type == HFS_IDX_NODE) {
+ unsigned int skip;
+
+ skip = (1 + record_key->key_length + 1) & ~1;
+ node_number = PED_BE32_TO_CPU (*((uint32_t *)
+ (((uint8_t *) record_key) + skip)));
+ if (!hfs_file_read_sector(b_tree_file, node,
+ node_number))
+ return 0;
+ } else
+ break;
+ }
+
+ /* copy the result if needed */
+ if (record_size)
+ memcpy (record_out, record_key, record_size);
+
+ /* send record reference if needed */
+ if (record_ref) {
+ record_ref->node_size = 1; /* in sectors */
+ record_ref->node_number = node_number;
+ record_ref->record_pos = (uint8_t*)record_key - node;
+ record_ref->record_number = i;
+ }
+
+ /* success */
+ return 1;
+}
+
+/* free the bad blocks linked list */
+void
+hfs_free_bad_blocks_list(HfsPrivateLinkExtent* first)
+{
+ HfsPrivateLinkExtent* next;
+
+ while (first) {
+ next = first->next;
+ ped_free (first);
+ first = next;
+ }
+}
+
+/* This function reads bad blocks extents in the extents file
+ and store it in f.s. specific data of fs */
+int
+hfs_read_bad_blocks (const PedFileSystem *fs)
+{
+ HfsPrivateFSData* priv_data = (HfsPrivateFSData*)
+ fs->type_specific;
+
+ if (priv_data->bad_blocks_loaded)
+ return 1;
+
+ {
+ uint8_t record[sizeof (HfsExtentKey)
+ + sizeof (HfsExtDataRec)];
+ HfsExtentKey search;
+ HfsExtentKey* ret_key = (HfsExtentKey*) record;
+ HfsExtDescriptor* ret_cache = (HfsExtDescriptor*)
+ (record + sizeof (HfsExtentKey));
+ unsigned int block, last_start, first_pass = 1;
+
+ search.key_length = sizeof (HfsExtentKey) - 1;
+ search.type = HFS_DATA_FORK;
+ search.file_ID = PED_CPU_TO_BE32 (HFS_BAD_BLOCK_ID);
+
+ last_start = -1; block = 0;
+ while (1) {
+ int i;
+
+ search.start = PED_CPU_TO_BE16 (block);
+ if (!hfs_btree_search (priv_data->extent_file,
+ (HfsPrivateGenericKey*) &search,
+ record, sizeof (record), NULL)
+ || ret_key->file_ID != search.file_ID
+ || ret_key->type != search.type) {
+ if (first_pass)
+ break;
+ else
+ goto errbb;
+ }
+ if (PED_BE16_TO_CPU (ret_key->start) == last_start)
+ break;
+
+ last_start = PED_BE16_TO_CPU (ret_key->start);
+ for (i = 0; i < HFS_EXT_NB; i++) {
+ if (ret_cache[i].block_count) {
+ HfsPrivateLinkExtent* new_xt =
+ (HfsPrivateLinkExtent*) ped_malloc (
+ sizeof (HfsPrivateLinkExtent));
+ if (!new_xt)
+ goto errbb;
+ new_xt->next = priv_data->bad_blocks_xtent_list;
+ memcpy(&(new_xt->extent), ret_cache+i,
+ sizeof (HfsExtDescriptor));
+ priv_data->bad_blocks_xtent_list = new_xt;
+ priv_data->bad_blocks_xtent_nb++;
+ block += PED_BE16_TO_CPU (
+ ret_cache[i].block_count);
+ }
+ }
+ first_pass = 0;
+ }
+
+ priv_data->bad_blocks_loaded = 1;
+ return 1;}
+
+errbb: hfs_free_bad_blocks_list(priv_data->bad_blocks_xtent_list);
+ priv_data->bad_blocks_xtent_list=NULL;
+ priv_data->bad_blocks_xtent_nb=0;
+ return 0;
+}
+
+/* This function check if fblock is a bad block */
+int
+hfs_is_bad_block (const PedFileSystem *fs, unsigned int fblock)
+{
+ HfsPrivateFSData* priv_data = (HfsPrivateFSData*)
+ fs->type_specific;
+ HfsPrivateLinkExtent* walk;
+
+ for (walk = priv_data->bad_blocks_xtent_list; walk; walk = walk->next) {
+ /* Won't compile without the strange cast ! gcc bug ? */
+ /* or maybe C subtilties... */
+ if ((fblock >= PED_BE16_TO_CPU (walk->extent.start_block)) &&
+ (fblock < (unsigned int) (PED_BE16_TO_CPU (
+ walk->extent.start_block)
+ + PED_BE16_TO_CPU (
+ walk->extent.block_count))))
+ return 1;
+ }
+
+ return 0;
+}
+
+/* This function returns the first sector of the last free block of an
+ HFS volume we can get after a hfs_pack_free_space_from_block call */
+/* On error this function returns 0 */
+PedSector
+hfs_get_empty_end (const PedFileSystem *fs)
+{
+ HfsPrivateFSData* priv_data = (HfsPrivateFSData*)
+ fs->type_specific;
+ HfsMasterDirectoryBlock* mdb = priv_data->mdb;
+ HfsPrivateLinkExtent* link;
+ unsigned int block, last_bad, end_free_blocks;
+
+ /* find the next block to the last bad block of the volume */
+ if (!hfs_read_bad_blocks (fs))
+ return 0;
+
+ last_bad = 0;
+ for (link = priv_data->bad_blocks_xtent_list; link; link = link->next) {
+ if ((unsigned int) PED_BE16_TO_CPU (link->extent.start_block)
+ + PED_BE16_TO_CPU (link->extent.block_count) > last_bad)
+ last_bad = PED_BE16_TO_CPU (link->extent.start_block)
+ + PED_BE16_TO_CPU (link->extent.block_count);
+ }
+
+ /* Count the free blocks from last_bad to the end of the volume */
+ end_free_blocks = 0;
+ for (block = last_bad;
+ block < PED_BE16_TO_CPU (mdb->total_blocks);
+ block++) {
+ if (!TST_BLOC_OCCUPATION(priv_data->alloc_map,block))
+ end_free_blocks++;
+ }
+
+ /* Calculate the block that will by the first free at the
+ end of the volume */
+ block = PED_BE16_TO_CPU (mdb->total_blocks) - end_free_blocks;
+
+ return (PedSector) PED_BE16_TO_CPU (mdb->start_block)
+ + (PedSector) block * (PED_BE32_TO_CPU (mdb->block_size)
+ / PED_SECTOR_SIZE_DEFAULT);
+}
+
+/* return the block which should be used to pack data to have at
+ least free fblock blocks at the end of the volume */
+unsigned int
+hfs_find_start_pack (const PedFileSystem *fs, unsigned int fblock)
+{
+ HfsPrivateFSData* priv_data = (HfsPrivateFSData*)
+ fs->type_specific;
+ unsigned int block;
+
+ for (block = PED_BE16_TO_CPU (priv_data->mdb->total_blocks) - 1;
+ block && fblock;
+ block--) {
+ if (!TST_BLOC_OCCUPATION(priv_data->alloc_map,block))
+ fblock--;
+ }
+
+ while (block && !TST_BLOC_OCCUPATION(priv_data->alloc_map,block))
+ block--;
+ if (TST_BLOC_OCCUPATION(priv_data->alloc_map,block))
+ block++;
+
+ return block;
+}
+
+#endif /* !DISCOVER_ONLY */
diff --git a/libparted/fs/hfs/advfs.h b/libparted/fs/hfs/advfs.h
new file mode 100644
index 0000000..8e23fb6
--- /dev/null
+++ b/libparted/fs/hfs/advfs.h
@@ -0,0 +1,49 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2004 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef _ADVFS_H
+#define _ADVFS_H
+
+#include <parted/parted.h>
+#include <parted/endian.h>
+#include <parted/debug.h>
+
+#include "hfs.h"
+
+int
+hfs_btree_search (HfsPrivateFile* b_tree_file, HfsPrivateGenericKey* key,
+ void *record_out, unsigned int record_size,
+ HfsCPrivateLeafRec* record_ref);
+
+void
+hfs_free_bad_blocks_list(HfsPrivateLinkExtent* first);
+
+int
+hfs_read_bad_blocks (const PedFileSystem *fs);
+
+int
+hfs_is_bad_block (const PedFileSystem *fs, unsigned int fblock);
+
+PedSector
+hfs_get_empty_end (const PedFileSystem *fs);
+
+unsigned int
+hfs_find_start_pack (const PedFileSystem *fs, unsigned int fblock);
+
+#endif /* _ADVFS_H */
diff --git a/libparted/fs/hfs/advfs_plus.c b/libparted/fs/hfs/advfs_plus.c
new file mode 100644
index 0000000..c260995
--- /dev/null
+++ b/libparted/fs/hfs/advfs_plus.c
@@ -0,0 +1,387 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef DISCOVER_ONLY
+
+#include "config.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <parted/parted.h>
+#include <parted/endian.h>
+#include <parted/debug.h>
+#include <stdint.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+#include "hfs.h"
+#include "advfs.h"
+#include "file_plus.h"
+
+#include "advfs_plus.h"
+
+/* - if a < b, 0 if a == b, + if a > b */
+/* Comparaison is done in the following order : */
+/* CNID, then fork type, then start block */
+static int
+hfsplus_extent_key_cmp(HfsPPrivateGenericKey* a, HfsPPrivateGenericKey* b)
+{
+ HfsPExtentKey* key1 = (HfsPExtentKey*) a;
+ HfsPExtentKey* key2 = (HfsPExtentKey*) b;
+
+ if (key1->file_ID != key2->file_ID)
+ return PED_BE32_TO_CPU(key1->file_ID) <
+ PED_BE32_TO_CPU(key2->file_ID) ?
+ -1 : +1;
+
+ if (key1->type != key2->type)
+ return (int)(key1->type - key2->type);
+
+ if (key1->start == key2->start)
+ return 0;
+ return PED_BE32_TO_CPU(key1->start) <
+ PED_BE32_TO_CPU(key2->start) ?
+ -1 : +1;
+}
+
+/* do a B-Tree lookup */
+/* read the first record immediatly inferior or egal to the given key */
+/* return 0 on error */
+/* record_out _must_ be large enough to receive the whole record (key + data) */
+/* WARNING : the search function called only handle Extents BTree */
+/* so modify this function if you want to do lookup in */
+/* other BTrees has well */
+int
+hfsplus_btree_search (HfsPPrivateFile* b_tree_file, HfsPPrivateGenericKey* key,
+ void *record_out, unsigned int record_size,
+ HfsCPrivateLeafRec* record_ref)
+{
+ uint8_t node_1[PED_SECTOR_SIZE_DEFAULT];
+ uint8_t* node;
+ HfsPHeaderRecord* header;
+ HfsPNodeDescriptor* desc = (HfsPNodeDescriptor*) node_1;
+ HfsPPrivateGenericKey* record_key = NULL;
+ unsigned int node_number, record_number, size, bsize;
+ int i;
+
+ /* Read the header node */
+ if (!hfsplus_file_read_sector(b_tree_file, node_1, 0))
+ return 0;
+ header = (HfsPHeaderRecord*) (node_1 + HFS_FIRST_REC);
+
+ /* Get the node number of the root */
+ node_number = PED_BE32_TO_CPU (header->root_node);
+ if (!node_number)
+ return 0;
+
+ /* Get the size of a node in sectors and allocate buffer */
+ size = (bsize = PED_BE16_TO_CPU (header->node_size)) / PED_SECTOR_SIZE_DEFAULT;
+ node = (uint8_t*) ped_malloc (bsize);
+ if (!node)
+ return 0;
+ desc = (HfsPNodeDescriptor*) node;
+
+ /* Read the root node */
+ if (!hfsplus_file_read (b_tree_file, node,
+ (PedSector) node_number * size, size))
+ return 0;
+
+ /* Follow the white rabbit */
+ while (1) {
+ record_number = PED_BE16_TO_CPU (desc->rec_nb);
+ for (i = record_number; i; i--) {
+ record_key = (HfsPPrivateGenericKey*)
+ (node + PED_BE16_TO_CPU(*((uint16_t *)
+ (node+(bsize - 2*i)))));
+ /* check for obvious error in FS */
+ if (((uint8_t*)record_key - node < HFS_FIRST_REC)
+ || ((uint8_t*)record_key - node
+ >= (signed)bsize
+ - 2 * (signed)(record_number+1))) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("The file system contains errors."));
+ ped_free (node);
+ return 0;
+ }
+ if (hfsplus_extent_key_cmp(record_key, key) <= 0)
+ break;
+ }
+ if (!i) { ped_free (node); return 0; }
+ if (desc->type == HFS_IDX_NODE) {
+ unsigned int skip;
+
+ skip = ( 2 + PED_BE16_TO_CPU (record_key->key_length)
+ + 1 ) & ~1;
+ node_number = PED_BE32_TO_CPU (*((uint32_t *)
+ (((uint8_t *) record_key) + skip)));
+ if (!hfsplus_file_read(b_tree_file, node,
+ (PedSector) node_number * size,
+ size)) {
+ ped_free (node);
+ return 0;
+ }
+ } else
+ break;
+ }
+
+ /* copy the result if needed */
+ if (record_size)
+ memcpy (record_out, record_key, record_size);
+
+ /* send record reference if needed */
+ if (record_ref) {
+ record_ref->node_size = size; /* in sectors */
+ record_ref->node_number = node_number;
+ record_ref->record_pos = (uint8_t*)record_key - node;
+ record_ref->record_number = i;
+ }
+
+ /* success */
+ ped_free (node);
+ return 1;
+}
+
+/* free the bad blocks linked list */
+void
+hfsplus_free_bad_blocks_list(HfsPPrivateLinkExtent* first)
+{
+ HfsPPrivateLinkExtent* next;
+
+ while (first) {
+ next = first->next;
+ ped_free (first);
+ first = next;
+ }
+}
+
+/* This function reads bad blocks extents in the extents file
+ and store it in f.s. specific data of fs */
+int
+hfsplus_read_bad_blocks (const PedFileSystem *fs)
+{
+ HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*)
+ fs->type_specific;
+
+ if (priv_data->bad_blocks_loaded)
+ return 1;
+
+ {
+ uint8_t record[sizeof (HfsPExtentKey)
+ + sizeof (HfsPExtDataRec)];
+ HfsPExtentKey search;
+ HfsPExtentKey* ret_key = (HfsPExtentKey*) record;
+ HfsPExtDescriptor* ret_cache = (HfsPExtDescriptor*)
+ (record + sizeof (HfsPExtentKey));
+ int block, first_pass = 1;
+ unsigned int last_start;
+
+ search.key_length = sizeof (HfsExtentKey) - 2;
+ search.type = HFS_DATA_FORK;
+ search.pad = 0;
+ search.file_ID = PED_CPU_TO_BE32 (HFS_BAD_BLOCK_ID);
+
+ last_start = -1; block = 0;
+ while (1) {
+ int i;
+
+ search.start = PED_CPU_TO_BE32 (block);
+ if (!hfsplus_btree_search (priv_data->extents_file,
+ (HfsPPrivateGenericKey*) &search,
+ record, sizeof (record), NULL)
+ || ret_key->file_ID != search.file_ID
+ || ret_key->type != search.type) {
+ if (first_pass)
+ break;
+ else
+ goto errbbp;
+ }
+ if (PED_BE32_TO_CPU (ret_key->start) == last_start)
+ break;
+
+ last_start = PED_BE32_TO_CPU (ret_key->start);
+ for (i = 0; i < HFSP_EXT_NB; i++) {
+ if (ret_cache[i].block_count) {
+ HfsPPrivateLinkExtent* new_xt =
+ (HfsPPrivateLinkExtent*) ped_malloc (
+ sizeof (HfsPPrivateLinkExtent));
+ if (!new_xt)
+ goto errbbp;
+ new_xt->next = priv_data->bad_blocks_xtent_list;
+ memcpy (&(new_xt->extent), ret_cache+i,
+ sizeof (HfsPExtDescriptor));
+ priv_data->bad_blocks_xtent_list = new_xt;
+ priv_data->bad_blocks_xtent_nb++;
+ block += PED_BE32_TO_CPU (
+ ret_cache[i].block_count);
+ }
+ }
+ first_pass = 0;
+ }
+
+ priv_data->bad_blocks_loaded = 1;
+ return 1;}
+
+errbbp: hfsplus_free_bad_blocks_list(priv_data->bad_blocks_xtent_list);
+ priv_data->bad_blocks_xtent_list=NULL;
+ priv_data->bad_blocks_xtent_nb=0;
+ return 0;
+}
+
+/* This function check if fblock is a bad block */
+int
+hfsplus_is_bad_block (const PedFileSystem *fs, unsigned int fblock)
+{
+ HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*)
+ fs->type_specific;
+ HfsPPrivateLinkExtent* walk;
+
+ for (walk = priv_data->bad_blocks_xtent_list; walk; walk = walk->next) {
+ /* Won't compile without the strange cast ! gcc bug ? */
+ /* or maybe C subtilties... */
+ if ((fblock >= PED_BE32_TO_CPU (walk->extent.start_block)) &&
+ (fblock < (unsigned int)(PED_BE32_TO_CPU (
+ walk->extent.start_block)
+ + PED_BE32_TO_CPU (walk->extent.block_count))))
+ return 1;
+ }
+
+ return 0;
+}
+
+/* This function returns the first sector of the last free block of
+ an HFS+ volume we can get after a hfsplus_pack_free_space_from_block call */
+PedSector
+hfsplus_get_empty_end (const PedFileSystem *fs)
+{
+ HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*)
+ fs->type_specific;
+ HfsPVolumeHeader* vh = priv_data->vh;
+ HfsPPrivateLinkExtent* link;
+ unsigned int block, last_bad, end_free_blocks;
+
+ /* find the next block to the last bad block of the volume */
+ if (!hfsplus_read_bad_blocks (fs)) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Bad blocks could not be read."));
+ return 0;
+ }
+
+ last_bad = 0;
+ for (link = priv_data->bad_blocks_xtent_list; link; link = link->next) {
+ if ((unsigned int) PED_BE32_TO_CPU (link->extent.start_block)
+ + PED_BE32_TO_CPU (link->extent.block_count) > last_bad)
+ last_bad = PED_BE32_TO_CPU (link->extent.start_block)
+ + PED_BE32_TO_CPU (link->extent.block_count);
+ }
+
+ /* Count the free blocks from last_bad to the end of the volume */
+ end_free_blocks = 0;
+ for (block = last_bad;
+ block < PED_BE32_TO_CPU (vh->total_blocks);
+ block++) {
+ if (!TST_BLOC_OCCUPATION(priv_data->alloc_map,block))
+ end_free_blocks++;
+ }
+
+ /* Calculate the block that will by the first free at
+ the end of the volume */
+ block = PED_BE32_TO_CPU (vh->total_blocks) - end_free_blocks;
+
+ return (PedSector) block * ( PED_BE32_TO_CPU (vh->block_size)
+ / PED_SECTOR_SIZE_DEFAULT );
+}
+
+/* On error, returns 0 */
+PedSector
+hfsplus_get_min_size (const PedFileSystem *fs)
+{
+ HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*)
+ fs->type_specific;
+ PedSector min_size;
+
+ /* don't need to add anything because every sector
+ can be part of allocation blocks in HFS+, and
+ the last block _must_ be reserved */
+ min_size = hfsplus_get_empty_end(fs);
+ if (!min_size) return 0;
+
+ if (priv_data->wrapper) {
+ HfsPrivateFSData* hfs_priv_data = (HfsPrivateFSData*)
+ priv_data->wrapper->type_specific;
+ unsigned int hfs_sect_block;
+ PedSector hgee;
+ hfs_sect_block =
+ PED_BE32_TO_CPU (hfs_priv_data->mdb->block_size)
+ / PED_SECTOR_SIZE_DEFAULT;
+ /*
+ * if hfs+ is embedded in an hfs wrapper then the new size is :
+ * the new size of the hfs+ volume rounded up to the size
+ * of hfs blocks
+ * + the minimum size of the hfs wrapper without any hfs+
+ * modification
+ * - the current size of the hfs+ volume in the hfs wrapper
+ */
+ hgee = hfs_get_empty_end(priv_data->wrapper);
+ if (!hgee) return 0;
+ min_size = ((min_size + hfs_sect_block - 1) / hfs_sect_block)
+ * hfs_sect_block
+ + hgee + 2
+ - (PedSector) PED_BE16_TO_CPU ( hfs_priv_data->mdb
+ ->old_new.embedded
+ .location.block_count )
+ * hfs_sect_block;
+ }
+
+ return min_size;
+}
+
+/* return the block which should be used to pack data to have
+ at least free fblock blocks at the end of the volume */
+unsigned int
+hfsplus_find_start_pack (const PedFileSystem *fs, unsigned int fblock)
+{
+ HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*)
+ fs->type_specific;
+ unsigned int block;
+
+ for (block = PED_BE32_TO_CPU (priv_data->vh->total_blocks) - 1;
+ block && fblock;
+ block--) {
+ if (!TST_BLOC_OCCUPATION(priv_data->alloc_map,block))
+ fblock--;
+ }
+
+ while (block && !TST_BLOC_OCCUPATION(priv_data->alloc_map,block))
+ block--;
+ if (TST_BLOC_OCCUPATION(priv_data->alloc_map,block))
+ block++;
+
+ return block;
+}
+
+#endif /* !DISCOVER_ONLY */
diff --git a/libparted/fs/hfs/advfs_plus.h b/libparted/fs/hfs/advfs_plus.h
new file mode 100644
index 0000000..3d5ece4
--- /dev/null
+++ b/libparted/fs/hfs/advfs_plus.h
@@ -0,0 +1,52 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2004 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef _ADVFS_PLUS_H
+#define _ADVFS_PLUS_H
+
+#include <parted/parted.h>
+#include <parted/endian.h>
+#include <parted/debug.h>
+
+#include "hfs.h"
+
+int
+hfsplus_btree_search (HfsPPrivateFile* b_tree_file, HfsPPrivateGenericKey* key,
+ void *record_out, unsigned int record_size,
+ HfsCPrivateLeafRec* record_ref);
+
+void
+hfsplus_free_bad_blocks_list(HfsPPrivateLinkExtent* first);
+
+int
+hfsplus_read_bad_blocks (const PedFileSystem *fs);
+
+int
+hfsplus_is_bad_block (const PedFileSystem *fs, unsigned int fblock);
+
+PedSector
+hfsplus_get_empty_end (const PedFileSystem *fs);
+
+PedSector
+hfsplus_get_min_size (const PedFileSystem *fs);
+
+unsigned int
+hfsplus_find_start_pack (const PedFileSystem *fs, unsigned int fblock);
+
+#endif /* _ADVFS_PLUS_H */
diff --git a/libparted/fs/hfs/cache.c b/libparted/fs/hfs/cache.c
new file mode 100644
index 0000000..e3825d1
--- /dev/null
+++ b/libparted/fs/hfs/cache.c
@@ -0,0 +1,241 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef DISCOVER_ONLY
+
+#include "config.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <parted/parted.h>
+#include <parted/endian.h>
+#include <parted/debug.h>
+#include <stdint.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+#include "hfs.h"
+
+#include "cache.h"
+
+static HfsCPrivateCacheTable*
+hfsc_new_cachetable(unsigned int size)
+{
+ HfsCPrivateCacheTable* ret;
+
+ ret = (HfsCPrivateCacheTable*) ped_malloc(sizeof(*ret));
+ if (!ret) return NULL;
+
+ ret->next_cache = NULL;
+ ret->table_size = size;
+ ret->table_first_free = 0;
+
+ ret->table = ped_malloc(sizeof(*ret->table)*size);
+ if (!ret->table) { ped_free(ret); return NULL; }
+ memset(ret->table, 0, sizeof(*ret->table)*size);
+
+ return ret;
+}
+
+HfsCPrivateCache*
+hfsc_new_cache(unsigned int block_number, unsigned int file_number)
+{
+ unsigned int cachetable_size, i;
+ HfsCPrivateCache* ret;
+
+ ret = (HfsCPrivateCache*) ped_malloc(sizeof(*ret));
+ if (!ret) return NULL;
+ ret->block_number = block_number;
+ /* following code avoid integer overflow */
+ ret->linked_ref_size = block_number > block_number + ((1<<CR_SHIFT)-1) ?
+ ( block_number >> CR_SHIFT ) + 1 :
+ ( block_number + ((1<<CR_SHIFT)-1) ) >> CR_SHIFT
+ ;
+
+ ret->linked_ref = (HfsCPrivateExtent**)
+ ped_malloc( sizeof(*ret->linked_ref)
+ * ret->linked_ref_size );
+ if (!ret->linked_ref) { ped_free(ret); return NULL; }
+
+ cachetable_size = file_number + file_number / CR_OVER_DIV + CR_ADD_CST;
+ if (cachetable_size < file_number) cachetable_size = (unsigned) -1;
+ ret->first_cachetable_size = cachetable_size;
+ ret->table_list = hfsc_new_cachetable(cachetable_size);
+ if (!ret->table_list) {
+ ped_free(ret->linked_ref);
+ ped_free(ret);
+ return NULL;
+ }
+ ret->last_table = ret->table_list;
+
+ for (i = 0; i < ret->linked_ref_size; ++i)
+ ret->linked_ref[i] = NULL;
+
+ ret->needed_alloc_size = 0;
+
+ return ret;
+}
+
+static void
+hfsc_delete_cachetable(HfsCPrivateCacheTable* list)
+{
+ HfsCPrivateCacheTable* next;
+
+ while (list) {
+ ped_free (list->table);
+ next = list->next_cache;
+ ped_free (list);
+ list = next;
+ }
+}
+
+void
+hfsc_delete_cache(HfsCPrivateCache* cache)
+{
+ hfsc_delete_cachetable(cache->table_list);
+ ped_free(cache->linked_ref);
+ ped_free(cache);
+}
+
+HfsCPrivateExtent*
+hfsc_cache_add_extent(HfsCPrivateCache* cache, uint32_t start, uint32_t length,
+ uint32_t block, uint16_t offset, uint8_t sbb,
+ uint8_t where, uint8_t index)
+{
+ HfsCPrivateExtent* ext;
+ unsigned int idx = start >> CR_SHIFT;
+
+ PED_ASSERT(idx < cache->linked_ref_size, return NULL);
+
+ for (ext = cache->linked_ref[idx];
+ ext && start != ext->ext_start;
+ ext = ext->next);
+
+ if (ext) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Trying to register an extent starting at block "
+ "0x%X, but another one already exists at this "
+ "position. You should check the file system!"),
+ start);
+ return NULL;
+ }
+
+ if ( cache->last_table->table_first_free
+ == cache->last_table->table_size ) {
+ cache->last_table->next_cache =
+ hfsc_new_cachetable( ( cache->first_cachetable_size
+ / CR_NEW_ALLOC_DIV )
+ + CR_ADD_CST );
+ if (!cache->last_table->next_cache)
+ return NULL;
+ cache->last_table = cache->last_table->next_cache;
+ }
+
+ ext = cache->last_table->table+(cache->last_table->table_first_free++);
+
+ ext->ext_start = start;
+ ext->ext_length = length;
+ ext->ref_block = block;
+ ext->ref_offset = offset;
+ ext->sect_by_block = sbb;
+ ext->where = where;
+ ext->ref_index = index;
+
+ ext->next = cache->linked_ref[idx];
+ cache->linked_ref[idx] = ext;
+
+ cache->needed_alloc_size = cache->needed_alloc_size >
+ (unsigned) PED_SECTOR_SIZE_DEFAULT * sbb ?
+ cache->needed_alloc_size :
+ (unsigned) PED_SECTOR_SIZE_DEFAULT * sbb;
+
+ return ext;
+}
+
+HfsCPrivateExtent*
+hfsc_cache_search_extent(HfsCPrivateCache* cache, uint32_t start)
+{
+ HfsCPrivateExtent* ret;
+ unsigned int idx = start >> CR_SHIFT;
+
+ PED_ASSERT(idx < cache->linked_ref_size, return NULL);
+
+ for (ret = cache->linked_ref[idx];
+ ret && start != ret->ext_start;
+ ret = ret->next);
+
+ return ret;
+}
+
+/* Can't fail if extent begining at old_start exists */
+/* Returns 0 if no such extent, or on error */
+HfsCPrivateExtent*
+hfsc_cache_move_extent(HfsCPrivateCache* cache, uint32_t old_start,
+ uint32_t new_start)
+{
+ HfsCPrivateExtent** ppext;
+ HfsCPrivateExtent* pext;
+
+ unsigned int idx1 = old_start >> CR_SHIFT;
+ unsigned int idx2 = new_start >> CR_SHIFT;
+
+ PED_ASSERT(idx1 < cache->linked_ref_size, return NULL);
+ PED_ASSERT(idx2 < cache->linked_ref_size, return NULL);
+
+ for (pext = cache->linked_ref[idx2];
+ pext && new_start != pext->ext_start;
+ pext = pext->next);
+
+ if (pext) {
+ ped_exception_throw (
+ PED_EXCEPTION_BUG,
+ PED_EXCEPTION_CANCEL,
+ _("Trying to move an extent from block Ox%X to block "
+ "Ox%X, but another one already exists at this "
+ "position. This should not happen!"),
+ old_start, new_start);
+ return NULL;
+ }
+
+ for (ppext = &(cache->linked_ref[idx1]);
+ (*ppext) && old_start != (*ppext)->ext_start;
+ ppext = &((*ppext)->next));
+
+ if (!(*ppext)) return NULL;
+
+ /* removing the extent from the cache */
+ pext = *ppext;
+ (*ppext) = pext->next;
+
+ /* change ext_start and insert the extent again */
+ pext->ext_start = new_start;
+ pext->next = cache->linked_ref[idx2];
+ cache->linked_ref[idx2] = pext;
+
+ return pext;
+}
+
+#endif /* DISCOVER_ONLY */
diff --git a/libparted/fs/hfs/cache.h b/libparted/fs/hfs/cache.h
new file mode 100644
index 0000000..9e49ef8
--- /dev/null
+++ b/libparted/fs/hfs/cache.h
@@ -0,0 +1,118 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef _CACHE_H
+#define _CACHE_H
+
+#include <parted/parted.h>
+#include <parted/endian.h>
+#include <parted/debug.h>
+
+#include "hfs.h"
+
+/* CR => CACHE REF */
+#define CR_NULL 0 /* reserved */
+#define CR_PRIM_CAT 1
+#define CR_PRIM_EXT 2
+#define CR_PRIM_ATTR 3
+#define CR_PRIM_ALLOC 4
+#define CR_PRIM_START 5
+#define CR_BTREE_CAT 6
+#define CR_BTREE_ATTR 7
+#define CR_BTREE_EXT_0 8
+#define CR_BTREE_EXT_CAT 9
+#define CR_BTREE_EXT_EXT 10 /* should not happen ! */
+#define CR_BTREE_EXT_ATTR 11
+#define CR_BTREE_EXT_ALLOC 12
+#define CR_BTREE_EXT_START 13 /* unneeded in current code */
+#define CR_BTREE_CAT_JIB 14 /* journal info block */
+#define CR_BTREE_CAT_JL 15 /* journal */
+/* 16 -> 31 || high order bit */ /* reserved */
+
+/* tuning */
+#define CR_SHIFT 8 /* number of bits to shift start_block by */
+ /* to get the index of the linked list */
+#define CR_OVER_DIV 16 /* alloc a table for (1+1/CR_OVER_DIV) *
+ file_number + CR_ADD_CST */
+#define CR_ADD_CST 16
+#define CR_NEW_ALLOC_DIV 4 /* divide the size of the first alloc table
+ by this value to allocate next tables */
+
+/* See DOC for an explaination of this structure */
+/* Access read only from outside cache.c */
+struct _HfsCPrivateExtent {
+ struct _HfsCPrivateExtent* next;
+ uint32_t ext_start;
+ uint32_t ext_length;
+ uint32_t ref_block;
+ uint16_t ref_offset;
+ uint8_t sect_by_block;
+ unsigned where : 5;
+ unsigned ref_index : 3; /* 0 -> 7 */
+};
+typedef struct _HfsCPrivateExtent HfsCPrivateExtent;
+
+/* Internaly used by cache.c for custom memory managment only */
+struct _HfsCPrivateCacheTable {
+ struct _HfsCPrivateCacheTable* next_cache;
+ HfsCPrivateExtent* table;
+ unsigned int table_size;
+ unsigned int table_first_free;
+ /* first_elemt ? */
+};
+typedef struct _HfsCPrivateCacheTable HfsCPrivateCacheTable;
+
+/* Internaly used by cache.c for custom memory managment
+ and cache handling only */
+struct _HfsCPrivateCache {
+ HfsCPrivateCacheTable* table_list;
+ HfsCPrivateCacheTable* last_table;
+ HfsCPrivateExtent** linked_ref;
+ unsigned int linked_ref_size;
+ unsigned int block_number;
+ unsigned int first_cachetable_size;
+ unsigned int needed_alloc_size;
+};
+typedef struct _HfsCPrivateCache HfsCPrivateCache;
+
+HfsCPrivateCache*
+hfsc_new_cache(unsigned int block_number, unsigned int file_number);
+
+void
+hfsc_delete_cache(HfsCPrivateCache* cache);
+
+HfsCPrivateExtent*
+hfsc_cache_add_extent(HfsCPrivateCache* cache, uint32_t start, uint32_t length,
+ uint32_t block, uint16_t offset, uint8_t sbb,
+ uint8_t where, uint8_t index);
+
+HfsCPrivateExtent*
+hfsc_cache_search_extent(HfsCPrivateCache* cache, uint32_t start);
+
+HfsCPrivateExtent*
+hfsc_cache_move_extent(HfsCPrivateCache* cache, uint32_t old_start,
+ uint32_t new_start);
+
+static __inline__ unsigned int
+hfsc_cache_needed_buffer(HfsCPrivateCache* cache)
+{
+ return cache->needed_alloc_size;
+}
+
+#endif /* _CACHE_H */
diff --git a/libparted/fs/hfs/file.c b/libparted/fs/hfs/file.c
new file mode 100644
index 0000000..fe3616e
--- /dev/null
+++ b/libparted/fs/hfs/file.c
@@ -0,0 +1,231 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef DISCOVER_ONLY
+
+#include "config.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <parted/parted.h>
+#include <parted/endian.h>
+#include <parted/debug.h>
+#include <stdint.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+#include "hfs.h"
+#include "advfs.h"
+
+#include "file.h"
+
+/* Open the data fork of a file with its first three extents and its CNID */
+HfsPrivateFile*
+hfs_file_open (PedFileSystem *fs, uint32_t CNID,
+ HfsExtDataRec ext_desc, PedSector sect_nb)
+{
+ HfsPrivateFile* file;
+
+ file = (HfsPrivateFile*) ped_malloc (sizeof (HfsPrivateFile));
+ if (!file) return NULL;
+
+ file->fs = fs;
+ file->sect_nb = sect_nb;
+ file->CNID = CNID;
+ memcpy(file->first, ext_desc, sizeof (HfsExtDataRec));
+ file->start_cache = 0;
+
+ return file;
+}
+
+/* Close an HFS file */
+void
+hfs_file_close (HfsPrivateFile* file)
+{
+ ped_free (file);
+}
+
+/* warning : only works on data forks */
+static int
+hfs_get_extent_containing (HfsPrivateFile* file, unsigned int block,
+ HfsExtDataRec cache, uint16_t* ptr_start_cache)
+{
+ uint8_t record[sizeof (HfsExtentKey)
+ + sizeof (HfsExtDataRec)];
+ HfsExtentKey search;
+ HfsExtentKey* ret_key = (HfsExtentKey*) record;
+ HfsExtDescriptor* ret_cache = (HfsExtDescriptor*)
+ (record + sizeof (HfsExtentKey));
+ HfsPrivateFSData* priv_data = (HfsPrivateFSData*)
+ file->fs->type_specific;
+
+ search.key_length = sizeof (HfsExtentKey) - 1;
+ search.type = HFS_DATA_FORK;
+ search.file_ID = file->CNID;
+ search.start = PED_CPU_TO_BE16 (block);
+
+ if (!hfs_btree_search (priv_data->extent_file,
+ (HfsPrivateGenericKey*) &search,
+ record, sizeof (record), NULL))
+ return 0;
+
+ if (ret_key->file_ID != search.file_ID || ret_key->type != search.type)
+ return 0;
+
+ memcpy (cache, ret_cache, sizeof(HfsExtDataRec));
+ *ptr_start_cache = PED_BE16_TO_CPU (ret_key->start);
+
+ return 1;
+}
+
+/* find and return the nth sector of a file */
+/* return 0 on error */
+static PedSector
+hfs_file_find_sector (HfsPrivateFile* file, PedSector sector)
+{
+ HfsPrivateFSData* priv_data = (HfsPrivateFSData*)
+ file->fs->type_specific;
+ unsigned int sect_by_block = PED_BE32_TO_CPU (
+ priv_data->mdb->block_size)
+ / PED_SECTOR_SIZE_DEFAULT;
+ unsigned int i, s, vol_block;
+ unsigned int block = sector / sect_by_block;
+ unsigned int offset = sector % sect_by_block;
+
+ /* in the three first extent */
+ for (s = 0, i = 0; i < HFS_EXT_NB; i++) {
+ if ((block >= s) && ( block < s + PED_BE16_TO_CPU (
+ file->first[i].block_count))) {
+ vol_block = (block - s) + PED_BE16_TO_CPU (
+ file->first[i].start_block);
+ goto sector_found;
+ }
+ s += PED_BE16_TO_CPU (file->first[i].block_count);
+ }
+
+ /* in the three cached extent */
+ if (file->start_cache && block >= file->start_cache)
+ for (s = file->start_cache, i = 0; i < HFS_EXT_NB; i++) {
+ if ((block >= s) && (block < s + PED_BE16_TO_CPU (
+ file->cache[i].block_count))) {
+ vol_block = (block - s) + PED_BE16_TO_CPU (
+ file->cache[i].start_block);
+ goto sector_found;
+ }
+ s += PED_BE16_TO_CPU (file->cache[i].block_count);
+ }
+
+ /* update cache */
+ if (!hfs_get_extent_containing (file, block, file->cache,
+ &(file->start_cache))) {
+ ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_CANCEL,
+ _("Could not update the extent cache for HFS file with "
+ "CNID %X."),
+ PED_BE32_TO_CPU(file->CNID));
+ return 0;
+ }
+
+ /* in the three cached extent */
+ PED_ASSERT(file->start_cache && block >= file->start_cache, return 0);
+ for (s = file->start_cache, i = 0; i < HFS_EXT_NB; i++) {
+ if ((block >= s) && (block < s + PED_BE16_TO_CPU (
+ file->cache[i].block_count))) {
+ vol_block = (block - s) + PED_BE16_TO_CPU (
+ file->cache[i].start_block);
+ goto sector_found;
+ }
+ s += PED_BE16_TO_CPU (file->cache[i].block_count);
+ }
+
+ return 0;
+
+ sector_found:
+ return (PedSector) PED_BE16_TO_CPU (priv_data->mdb->start_block)
+ + (PedSector) vol_block * sect_by_block
+ + offset;
+}
+
+/* Read the nth sector of a file */
+/* return 0 on error */
+int
+hfs_file_read_sector (HfsPrivateFile* file, void *buf, PedSector sector)
+{
+ PedSector abs_sector;
+
+ if (sector >= file->sect_nb) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Trying to read HFS file with CNID %X behind EOF."),
+ PED_BE32_TO_CPU(file->CNID));
+ return 0;
+ }
+
+ abs_sector = hfs_file_find_sector (file, sector);
+ if (!abs_sector) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Could not find sector %lli of HFS file with "
+ "CNID %X."),
+ sector, PED_BE32_TO_CPU(file->CNID));
+ return 0;
+ }
+
+ return ped_geometry_read (file->fs->geom, buf, abs_sector, 1);
+}
+
+/* Write the nth sector of a file */
+/* return 0 on error */
+int
+hfs_file_write_sector (HfsPrivateFile* file, void *buf, PedSector sector)
+{
+ PedSector abs_sector;
+
+ if (sector >= file->sect_nb) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Trying to write HFS file with CNID %X behind EOF."),
+ PED_BE32_TO_CPU(file->CNID));
+ return 0;
+ }
+
+ abs_sector = hfs_file_find_sector (file, sector);
+ if (!abs_sector) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Could not find sector %lli of HFS file with "
+ "CNID %X."),
+ sector, PED_BE32_TO_CPU(file->CNID));
+ return 0;
+ }
+
+ return ped_geometry_write (file->fs->geom, buf, abs_sector, 1);
+}
+
+#endif /* !DISCOVER_ONLY */
diff --git a/libparted/fs/hfs/file.h b/libparted/fs/hfs/file.h
new file mode 100644
index 0000000..7fcd21c
--- /dev/null
+++ b/libparted/fs/hfs/file.h
@@ -0,0 +1,42 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2004 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef _FILE_H
+#define _FILE_H
+
+#include <parted/parted.h>
+#include <parted/endian.h>
+#include <parted/debug.h>
+
+#include "hfs.h"
+
+HfsPrivateFile*
+hfs_file_open (PedFileSystem *fs, uint32_t CNID,
+ HfsExtDataRec ext_desc, PedSector sect_nb);
+
+void
+hfs_file_close (HfsPrivateFile* file);
+
+int
+hfs_file_read_sector (HfsPrivateFile* file, void *buf, PedSector sector);
+
+int
+hfs_file_write_sector (HfsPrivateFile* file, void *buf, PedSector sector);
+
+#endif /* _FILE_H */
diff --git a/libparted/fs/hfs/file_plus.c b/libparted/fs/hfs/file_plus.c
new file mode 100644
index 0000000..8b8fbfb
--- /dev/null
+++ b/libparted/fs/hfs/file_plus.c
@@ -0,0 +1,274 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef DISCOVER_ONLY
+
+#include "config.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <parted/parted.h>
+#include <parted/endian.h>
+#include <parted/debug.h>
+#include <stdint.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+#include "hfs.h"
+#include "advfs_plus.h"
+
+#include "file_plus.h"
+
+/* Open the data fork of a file with its first eight extents and its CNID */
+/* CNID and ext_desc must be in disc order, sect_nb in CPU order */
+/* return null on failure */
+HfsPPrivateFile*
+hfsplus_file_open (PedFileSystem *fs, HfsPNodeID CNID,
+ HfsPExtDataRec ext_desc, PedSector sect_nb)
+{
+ HfsPPrivateFile* file;
+
+ file = (HfsPPrivateFile*) ped_malloc (sizeof (HfsPPrivateFile));
+ if (!file) return NULL;
+
+ file->fs = fs;
+ file->sect_nb = sect_nb;
+ file->CNID = CNID;
+ memcpy(file->first, ext_desc, sizeof (HfsPExtDataRec));
+ file->start_cache = 0;
+
+ return file;
+}
+
+/* Close an HFS+ file */
+void
+hfsplus_file_close (HfsPPrivateFile* file)
+{
+ ped_free (file);
+}
+
+/* warning : only works on data forks */
+static int
+hfsplus_get_extent_containing (HfsPPrivateFile* file, unsigned int block,
+ HfsPExtDataRec cache, uint32_t* ptr_start_cache)
+{
+ uint8_t record[sizeof (HfsPExtentKey)
+ + sizeof (HfsPExtDataRec)];
+ HfsPExtentKey search;
+ HfsPExtentKey* ret_key = (HfsPExtentKey*) record;
+ HfsPExtDescriptor* ret_cache = (HfsPExtDescriptor*)
+ (record + sizeof (HfsPExtentKey));
+ HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*)
+ file->fs->type_specific;
+
+ search.key_length = PED_CPU_TO_BE16 (sizeof (HfsPExtentKey) - 2);
+ search.type = HFS_DATA_FORK;
+ search.pad = 0;
+ search.file_ID = file->CNID;
+ search.start = PED_CPU_TO_BE32 (block);
+
+ if (!hfsplus_btree_search (priv_data->extents_file,
+ (HfsPPrivateGenericKey*) &search,
+ record, sizeof (record), NULL))
+ return 0;
+
+ if (ret_key->file_ID != search.file_ID || ret_key->type != search.type)
+ return 0;
+
+ memcpy (cache, ret_cache, sizeof(HfsPExtDataRec));
+ *ptr_start_cache = PED_BE32_TO_CPU (ret_key->start);
+
+ return 1;
+}
+
+/* find a sub extent contained in the desired area */
+/* and with the same starting point */
+/* return 0 in sector_count on error, or the physical area */
+/* on the volume corresponding to the logical area in the file */
+static HfsPPrivateExtent
+hfsplus_file_find_extent (HfsPPrivateFile* file, PedSector sector,
+ unsigned int nb)
+{
+ HfsPPrivateExtent ret = {0,0};
+ HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*)
+ file->fs->type_specific;
+ unsigned int sect_by_block = PED_BE32_TO_CPU (
+ priv_data->vh->block_size)
+ / PED_SECTOR_SIZE_DEFAULT;
+ unsigned int i, s, vol_block, size;
+ PedSector sect_size;
+ unsigned int block = sector / sect_by_block;
+ unsigned int offset = sector % sect_by_block;
+
+ /* in the 8 first extent */
+ for (s = 0, i = 0; i < HFSP_EXT_NB; i++) {
+ if ((block >= s) && (block < s + PED_BE32_TO_CPU (
+ file->first[i].block_count))) {
+ vol_block = (block - s)
+ + PED_BE32_TO_CPU (file->first[i]
+ .start_block);
+ size = PED_BE32_TO_CPU (file->first[i].block_count)
+ + s - block;
+ goto plus_sector_found;
+ }
+ s += PED_BE32_TO_CPU (file->first[i].block_count);
+ }
+
+ /* in the 8 cached extent */
+ if (file->start_cache && block >= file->start_cache)
+ for (s = file->start_cache, i = 0; i < HFSP_EXT_NB; i++) {
+ if ((block >= s) && (block < s + PED_BE32_TO_CPU (
+ file->cache[i].block_count))) {
+ vol_block = (block - s)
+ + PED_BE32_TO_CPU (file->cache[i]
+ .start_block);
+ size = PED_BE32_TO_CPU (file->cache[i].block_count)
+ + s - block;
+ goto plus_sector_found;
+ }
+ s += PED_BE32_TO_CPU (file->cache[i].block_count);
+ }
+
+ /* update cache */
+ if (!hfsplus_get_extent_containing (file, block, file->cache,
+ &(file->start_cache))) {
+ ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_CANCEL,
+ _("Could not update the extent cache for HFS+ file "
+ "with CNID %X."),
+ PED_BE32_TO_CPU(file->CNID));
+ return ret; /* ret == {0,0} */
+ }
+
+ /* ret == {0,0} */
+ PED_ASSERT(file->start_cache && block >= file->start_cache, return ret);
+
+ for (s = file->start_cache, i = 0; i < HFSP_EXT_NB; i++) {
+ if ((block >= s) && (block < s + PED_BE32_TO_CPU (
+ file->cache[i].block_count))) {
+ vol_block = (block - s)
+ + PED_BE32_TO_CPU (file->cache[i]
+ .start_block);
+ size = PED_BE32_TO_CPU (file->cache[i].block_count)
+ + s - block;
+ goto plus_sector_found;
+ }
+ s += PED_BE32_TO_CPU (file->cache[i].block_count);
+ }
+
+ return ret;
+
+plus_sector_found:
+ sect_size = (PedSector) size * sect_by_block - offset;
+ ret.start_sector = vol_block * sect_by_block + offset;
+ ret.sector_count = (sect_size < nb) ? sect_size : nb;
+ return ret;
+}
+
+int
+hfsplus_file_read(HfsPPrivateFile* file, void *buf, PedSector sector,
+ unsigned int nb)
+{
+ HfsPPrivateExtent phy_area;
+ HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*)
+ file->fs->type_specific;
+
+ if (sector+nb < sector /* detect overflow */
+ || sector+nb > file->sect_nb) /* out of file */ {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Trying to read HFS+ file with CNID %X behind EOF."),
+ PED_BE32_TO_CPU(file->CNID));
+ return 0;
+ }
+
+ while (nb) {
+ phy_area = hfsplus_file_find_extent(file, sector, nb);
+ if (phy_area.sector_count == 0) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Could not find sector %lli of HFS+ file "
+ "with CNID %X."),
+ sector, PED_BE32_TO_CPU(file->CNID));
+ return 0;
+ }
+ if (!ped_geometry_read(priv_data->plus_geom, buf,
+ phy_area.start_sector,
+ phy_area.sector_count))
+ return 0;
+
+ nb -= phy_area.sector_count; /* < nb anyway ... */
+ sector += phy_area.sector_count;
+ buf += phy_area.sector_count * PED_SECTOR_SIZE_DEFAULT;
+ }
+
+ return 1;
+}
+
+int
+hfsplus_file_write(HfsPPrivateFile* file, void *buf, PedSector sector,
+ unsigned int nb)
+{
+ HfsPPrivateExtent phy_area;
+ HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*)
+ file->fs->type_specific;
+
+ if (sector+nb < sector /* detect overflow */
+ || sector+nb > file->sect_nb) /* out of file */ {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Trying to write HFS+ file with CNID %X behind EOF."),
+ PED_BE32_TO_CPU(file->CNID));
+ return 0;
+ }
+
+ while (nb) {
+ phy_area = hfsplus_file_find_extent(file, sector, nb);
+ if (phy_area.sector_count == 0) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Could not find sector %lli of HFS+ file "
+ "with CNID %X."),
+ sector, PED_BE32_TO_CPU(file->CNID));
+ return 0;
+ }
+ if (!ped_geometry_write(priv_data->plus_geom, buf,
+ phy_area.start_sector,
+ phy_area.sector_count))
+ return 0;
+
+ nb -= phy_area.sector_count; /* < nb anyway ... */
+ sector += phy_area.sector_count;
+ buf += phy_area.sector_count * PED_SECTOR_SIZE_DEFAULT;
+ }
+
+ return 1;
+}
+
+#endif /* !DISCOVER_ONLY */
diff --git a/libparted/fs/hfs/file_plus.h b/libparted/fs/hfs/file_plus.h
new file mode 100644
index 0000000..5f48554
--- /dev/null
+++ b/libparted/fs/hfs/file_plus.h
@@ -0,0 +1,61 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2004 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef _FILE_PLUS_H
+#define _FILE_PLUS_H
+
+#include <parted/parted.h>
+#include <parted/endian.h>
+#include <parted/debug.h>
+
+#include "hfs.h"
+
+HfsPPrivateFile*
+hfsplus_file_open (PedFileSystem *fs, HfsPNodeID CNID,
+ HfsPExtDataRec ext_desc, PedSector sect_nb);
+
+void
+hfsplus_file_close (HfsPPrivateFile* file);
+
+int
+hfsplus_file_read(HfsPPrivateFile* file, void *buf,
+ PedSector sector, unsigned int nb);
+
+int
+hfsplus_file_write(HfsPPrivateFile* file, void *buf,
+ PedSector sector, unsigned int nb);
+
+/* Read the nth sector of a file */
+/* return 0 on error */
+static __inline__ int
+hfsplus_file_read_sector (HfsPPrivateFile* file, void *buf, PedSector sector)
+{
+ return hfsplus_file_read(file, buf, sector, 1);
+}
+
+/* Write the nth sector of a file */
+/* return 0 on error */
+static __inline__ int
+hfsplus_file_write_sector (HfsPPrivateFile* file, void *buf, PedSector sector)
+{
+ return hfsplus_file_write(file, buf, sector, 1);
+}
+
+
+#endif /* _FILE_PLUS_H */
diff --git a/libparted/fs/hfs/hfs.c b/libparted/fs/hfs/hfs.c
new file mode 100644
index 0000000..ee09342
--- /dev/null
+++ b/libparted/fs/hfs/hfs.c
@@ -0,0 +1,1355 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+/*
+ Author : Guillaume Knispel <k_guillaume@libertysurf.fr>
+ Report bug to <bug-parted@gnu.org>
+*/
+
+#include "config.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <parted/parted.h>
+#include <parted/endian.h>
+#include <parted/debug.h>
+#include <stdint.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+#include "hfs.h"
+#include "probe.h"
+
+uint8_t* hfs_block = NULL;
+uint8_t* hfsp_block = NULL;
+unsigned hfs_block_count;
+unsigned hfsp_block_count;
+
+#define HFS_BLOCK_SIZES ((int[2]){512, 0})
+#define HFSP_BLOCK_SIZES ((int[2]){512, 0})
+#define HFSX_BLOCK_SIZES ((int[2]){512, 0})
+
+#ifndef DISCOVER_ONLY
+#include "file.h"
+#include "reloc.h"
+#include "advfs.h"
+
+
+/* ----- HFS ----- */
+
+/* This is a very unundoable operation */
+/* Maybe I shouldn't touch the alternate MDB ? */
+/* Anyway clobber is call before other fs creation */
+/* So this is a non-issue */
+static int
+hfs_clobber (PedGeometry* geom)
+{
+ uint8_t buf[PED_SECTOR_SIZE_DEFAULT];
+
+ memset (buf, 0, PED_SECTOR_SIZE_DEFAULT);
+
+ /* destroy boot blocks, mdb, alternate mdb ... */
+ return (!!ped_geometry_write (geom, buf, 0, 1)) &
+ (!!ped_geometry_write (geom, buf, 1, 1)) &
+ (!!ped_geometry_write (geom, buf, 2, 1)) &
+ (!!ped_geometry_write (geom, buf, geom->length - 2, 1)) &
+ (!!ped_geometry_write (geom, buf, geom->length - 1, 1)) &
+ (!!ped_geometry_sync (geom));
+}
+
+static PedFileSystem*
+hfs_open (PedGeometry* geom)
+{
+ uint8_t buf[PED_SECTOR_SIZE_DEFAULT];
+ PedFileSystem* fs;
+ HfsMasterDirectoryBlock* mdb;
+ HfsPrivateFSData* priv_data;
+
+ if (!hfsc_can_use_geom (geom))
+ return NULL;
+
+ /* Read MDB */
+ if (!ped_geometry_read (geom, buf, 2, 1))
+ return NULL;
+
+ /* Allocate memory */
+ fs = (PedFileSystem*) ped_malloc (sizeof (PedFileSystem));
+ if (!fs) goto ho;
+ mdb = (HfsMasterDirectoryBlock*)
+ ped_malloc (sizeof (HfsMasterDirectoryBlock));
+ if (!mdb) goto ho_fs;
+ priv_data = (HfsPrivateFSData*)
+ ped_malloc (sizeof (HfsPrivateFSData));
+ if (!priv_data) goto ho_mdb;
+
+ memcpy (mdb, buf, sizeof (HfsMasterDirectoryBlock));
+
+ /* init structures */
+ priv_data->mdb = mdb;
+ priv_data->bad_blocks_loaded = 0;
+ priv_data->bad_blocks_xtent_nb = 0;
+ priv_data->bad_blocks_xtent_list = NULL;
+ priv_data->extent_file =
+ hfs_file_open (fs, PED_CPU_TO_BE32 (HFS_XTENT_ID),
+ mdb->extents_file_rec,
+ PED_CPU_TO_BE32 (mdb->extents_file_size)
+ / PED_SECTOR_SIZE_DEFAULT);
+ if (!priv_data->extent_file) goto ho_pd;
+ priv_data->catalog_file =
+ hfs_file_open (fs, PED_CPU_TO_BE32 (HFS_CATALOG_ID),
+ mdb->catalog_file_rec,
+ PED_CPU_TO_BE32 (mdb->catalog_file_size)
+ / PED_SECTOR_SIZE_DEFAULT);
+ if (!priv_data->catalog_file) goto ho_ce;
+ /* Read allocation blocks */
+ if (!ped_geometry_read(geom, priv_data->alloc_map,
+ PED_BE16_TO_CPU (mdb->volume_bitmap_block),
+ ( PED_BE16_TO_CPU (mdb->total_blocks)
+ + PED_SECTOR_SIZE_DEFAULT * 8 - 1 )
+ / (PED_SECTOR_SIZE_DEFAULT * 8) ) )
+ goto ho_cf;
+
+ fs->type = &hfs_type;
+ fs->geom = ped_geometry_duplicate (geom);
+ if (!fs->geom) goto ho_cf;
+ fs->type_specific = (void*) priv_data;
+ fs->checked = ( PED_BE16_TO_CPU (mdb->volume_attributes)
+ >> HFS_UNMOUNTED ) & 1;
+
+ return fs;
+
+/*--- clean error handling ---*/
+ho_cf: hfs_file_close(priv_data->catalog_file);
+ho_ce: hfs_file_close(priv_data->extent_file);
+ho_pd: ped_free(priv_data);
+ho_mdb: ped_free(mdb);
+ho_fs: ped_free(fs);
+ho: return NULL;
+}
+
+static int
+hfs_close (PedFileSystem *fs)
+{
+ HfsPrivateFSData* priv_data = (HfsPrivateFSData*) fs->type_specific;
+
+ hfs_file_close (priv_data->extent_file);
+ hfs_file_close (priv_data->catalog_file);
+ if (priv_data->bad_blocks_loaded)
+ hfs_free_bad_blocks_list (priv_data->bad_blocks_xtent_list);
+ ped_free (priv_data->mdb);
+ ped_free (priv_data);
+ ped_geometry_destroy (fs->geom);
+ ped_free (fs);
+
+ return 1;
+}
+
+static PedConstraint*
+hfs_get_resize_constraint (const PedFileSystem *fs)
+{
+ PedDevice* dev = fs->geom->dev;
+ PedAlignment start_align;
+ PedGeometry start_sector;
+ PedGeometry full_dev;
+ PedSector min_size;
+
+ if (!ped_alignment_init (&start_align, fs->geom->start, 0))
+ return NULL;
+ if (!ped_geometry_init (&start_sector, dev, fs->geom->start, 1))
+ return NULL;
+ if (!ped_geometry_init (&full_dev, dev, 0, dev->length - 1))
+ return NULL;
+ /* 2 = last two sectors (alternate MDB and unused sector) */
+ min_size = hfs_get_empty_end(fs) + 2;
+ if (min_size == 2) return NULL;
+
+ return ped_constraint_new (&start_align, ped_alignment_any,
+ &start_sector, &full_dev, min_size,
+ fs->geom->length);
+}
+
+static int
+hfs_resize (PedFileSystem* fs, PedGeometry* geom, PedTimer* timer)
+{
+ uint8_t buf[PED_SECTOR_SIZE_DEFAULT];
+ unsigned int nblock, nfree;
+ unsigned int block, to_free;
+ HfsPrivateFSData* priv_data;
+ HfsMasterDirectoryBlock* mdb;
+ int resize = 1;
+ unsigned int hfs_sect_block;
+ PedSector hgee;
+
+ /* check preconditions */
+ PED_ASSERT (fs != NULL, return 0);
+ PED_ASSERT (fs->geom != NULL, return 0);
+ PED_ASSERT (geom != NULL, return 0);
+#ifdef DEBUG
+ PED_ASSERT ((hgee = hfs_get_empty_end(fs)) != 0, return 0);
+#else
+ if ((hgee = hfs_get_empty_end(fs)) == 0)
+ return 0;
+#endif
+
+ PED_ASSERT ((hgee = hfs_get_empty_end(fs)) != 0, return 0);
+
+ if (ped_geometry_test_equal(fs->geom, geom))
+ return 1;
+
+ priv_data = (HfsPrivateFSData*) fs->type_specific;
+ mdb = priv_data->mdb;
+ hfs_sect_block = PED_BE32_TO_CPU (mdb->block_size)
+ / PED_SECTOR_SIZE_DEFAULT;
+
+ if (fs->geom->start != geom->start
+ || geom->length > fs->geom->length
+ || geom->length < hgee + 2) {
+ ped_exception_throw (
+ PED_EXCEPTION_NO_FEATURE,
+ PED_EXCEPTION_CANCEL,
+ _("Sorry, HFS cannot be resized that way yet."));
+ return 0;
+ }
+
+ /* Flush caches */
+ if (!ped_geometry_sync(fs->geom))
+ return 0;
+
+ /* Clear the unmounted bit */
+ mdb->volume_attributes &= PED_CPU_TO_BE16 (~( 1 << HFS_UNMOUNTED ));
+ if (!ped_geometry_read (fs->geom, buf, 2, 1))
+ return 0;
+ memcpy (buf, mdb, sizeof (HfsMasterDirectoryBlock));
+ if ( !ped_geometry_write (fs->geom, buf, 2, 1)
+ || !ped_geometry_sync (fs->geom))
+ return 0;
+
+ ped_timer_reset (timer);
+ ped_timer_set_state_name(timer, _("shrinking"));
+ ped_timer_update(timer, 0.0);
+ /* relocate data */
+ to_free = ( fs->geom->length - geom->length
+ + hfs_sect_block - 1 )
+ / hfs_sect_block ;
+ block = hfs_find_start_pack (fs, to_free);
+ if (!hfs_pack_free_space_from_block (fs, block, timer, to_free)) {
+ resize = 0;
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Data relocation has failed."));
+ goto write_MDB;
+ }
+
+ /* Calculate new block number and other MDB field */
+ nblock = ( geom->length - (PED_BE16_TO_CPU (mdb->start_block) + 2) )
+ / hfs_sect_block;
+ nfree = PED_BE16_TO_CPU (mdb->free_blocks)
+ - ( PED_BE16_TO_CPU (mdb->total_blocks) - nblock );
+
+ /* Check that all block after future end are really free */
+ for (block = nblock;
+ block < PED_BE16_TO_CPU (mdb->total_blocks);
+ block++) {
+ if (TST_BLOC_OCCUPATION(priv_data->alloc_map,block)) {
+ resize = 0;
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Data relocation left some data in the end "
+ "of the volume."));
+ goto write_MDB;
+ }
+ }
+
+ /* Mark out of volume blocks as used
+ (broken implementations compatibility) */
+ for ( block = nblock; block < (1 << 16); ++block)
+ SET_BLOC_OCCUPATION(priv_data->alloc_map,block);
+
+ /* save the allocation map
+ I do not write until start of allocation blocks
+ but only until pre-resize end of bitmap blocks
+ because the specifications do _not_ assert that everything
+ until allocation blocks is boot, mdb and alloc */
+ ped_geometry_write(fs->geom, priv_data->alloc_map,
+ PED_BE16_TO_CPU (priv_data->mdb->volume_bitmap_block),
+ ( PED_BE16_TO_CPU (priv_data->mdb->total_blocks)
+ + PED_SECTOR_SIZE_DEFAULT * 8 - 1)
+ / (PED_SECTOR_SIZE_DEFAULT * 8));
+
+ /* Update geometry */
+ if (resize) {
+ /* update in fs structure */
+ if (PED_BE16_TO_CPU (mdb->next_allocation) >= nblock)
+ mdb->next_allocation = PED_CPU_TO_BE16 (0);
+ mdb->total_blocks = PED_CPU_TO_BE16 (nblock);
+ mdb->free_blocks = PED_CPU_TO_BE16 (nfree);
+ /* update parted structure */
+ fs->geom->length = geom->length;
+ fs->geom->end = fs->geom->start + geom->length - 1;
+ }
+
+ /* Set the unmounted bit */
+ mdb->volume_attributes |= PED_CPU_TO_BE16 ( 1 << HFS_UNMOUNTED );
+
+ /* Effective write */
+ write_MDB:
+ ped_timer_set_state_name(timer,_("writing HFS Master Directory Block"));
+
+ if (!hfs_update_mdb(fs)) {
+ ped_geometry_sync(geom);
+ return 0;
+ }
+
+ if (!ped_geometry_sync(geom))
+ return 0;
+
+ ped_timer_update(timer, 1.0);
+
+ return (resize);
+}
+
+/* ----- HFS+ ----- */
+
+#include "file_plus.h"
+#include "advfs_plus.h"
+#include "reloc_plus.h"
+#include "journal.h"
+
+static int
+hfsplus_clobber (PedGeometry* geom)
+{
+ unsigned int i = 1;
+ uint8_t buf[PED_SECTOR_SIZE_DEFAULT];
+ HfsMasterDirectoryBlock *mdb;
+
+ mdb = (HfsMasterDirectoryBlock *) buf;
+
+ if (!ped_geometry_read (geom, buf, 2, 1))
+ return 0;
+
+ if (PED_BE16_TO_CPU (mdb->signature) == HFS_SIGNATURE) {
+ /* embedded hfs+ */
+ PedGeometry *embedded;
+
+ i = PED_BE32_TO_CPU(mdb->block_size) / PED_SECTOR_SIZE_DEFAULT;
+ embedded = ped_geometry_new (
+ geom->dev,
+ (PedSector) geom->start
+ + PED_BE16_TO_CPU (mdb->start_block)
+ + (PedSector) PED_BE16_TO_CPU (
+ mdb->old_new.embedded.location.start_block ) * i,
+ (PedSector) PED_BE16_TO_CPU (
+ mdb->old_new.embedded.location.block_count ) * i );
+ if (!embedded) i = 0;
+ else {
+ i = hfs_clobber (embedded);
+ ped_geometry_destroy (embedded);
+ }
+ }
+
+ /* non-embedded or envelop destroy as hfs */
+ return ( hfs_clobber (geom) && i );
+}
+
+static int
+hfsplus_close (PedFileSystem *fs)
+{
+ HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*)
+ fs->type_specific;
+
+ if (priv_data->bad_blocks_loaded)
+ hfsplus_free_bad_blocks_list(priv_data->bad_blocks_xtent_list);
+ ped_free(priv_data->alloc_map);
+ ped_free(priv_data->dirty_alloc_map);
+ hfsplus_file_close (priv_data->allocation_file);
+ hfsplus_file_close (priv_data->attributes_file);
+ hfsplus_file_close (priv_data->catalog_file);
+ hfsplus_file_close (priv_data->extents_file);
+ if (priv_data->free_geom) ped_geometry_destroy (priv_data->plus_geom);
+ if (priv_data->wrapper) hfs_close(priv_data->wrapper);
+ ped_geometry_destroy (fs->geom);
+ ped_free(priv_data->vh);
+ ped_free(priv_data);
+ ped_free(fs);
+
+ return 1;
+}
+
+static PedFileSystem*
+hfsplus_open (PedGeometry* geom)
+{
+ uint8_t buf[PED_SECTOR_SIZE_DEFAULT];
+ PedFileSystem* fs;
+ HfsPVolumeHeader* vh;
+ HfsPPrivateFSData* priv_data;
+ PedGeometry* wrapper_geom;
+ unsigned int map_sectors;
+
+ if (!hfsc_can_use_geom (geom))
+ return NULL;
+
+ fs = (PedFileSystem*) ped_malloc (sizeof (PedFileSystem));
+ if (!fs) goto hpo;
+ vh = (HfsPVolumeHeader*) ped_malloc (sizeof (HfsPVolumeHeader));
+ if (!vh) goto hpo_fs;
+ priv_data = (HfsPPrivateFSData*)ped_malloc (sizeof (HfsPPrivateFSData));
+ if (!priv_data) goto hpo_vh;
+
+ fs->geom = ped_geometry_duplicate (geom);
+ if (!fs->geom) goto hpo_pd;
+ fs->type_specific = (void*) priv_data;
+
+ if ((wrapper_geom = hfs_and_wrapper_probe (geom))) {
+ HfsPrivateFSData* hfs_priv_data;
+ PedSector abs_sect, length;
+ unsigned int bs;
+
+ ped_geometry_destroy (wrapper_geom);
+ priv_data->wrapper = hfs_open(geom);
+ if (!priv_data->wrapper) goto hpo_gm;
+ hfs_priv_data = (HfsPrivateFSData*)
+ priv_data->wrapper->type_specific;
+ bs = PED_BE32_TO_CPU (hfs_priv_data->mdb->block_size)
+ / PED_SECTOR_SIZE_DEFAULT;
+ abs_sect = (PedSector) geom->start
+ + (PedSector) PED_BE16_TO_CPU (
+ hfs_priv_data->mdb->start_block)
+ + (PedSector) PED_BE16_TO_CPU (
+ hfs_priv_data->mdb->old_new
+ .embedded.location.start_block )
+ * bs;
+ length = (PedSector) PED_BE16_TO_CPU (
+ hfs_priv_data->mdb->old_new
+ .embedded.location.block_count)
+ * bs;
+ priv_data->plus_geom = ped_geometry_new (geom->dev, abs_sect,
+ length);
+ if (!priv_data->plus_geom) goto hpo_wr;
+ priv_data->free_geom = 1;
+ } else {
+ priv_data->wrapper = NULL;
+ priv_data->plus_geom = fs->geom;
+ priv_data->free_geom = 0;
+ }
+
+ if (!ped_geometry_read (priv_data->plus_geom, buf, 2, 1)) goto hpo_pg;
+ memcpy (vh, buf, sizeof (HfsPVolumeHeader));
+ priv_data->vh = vh;
+
+ if (vh->signature != PED_CPU_TO_BE16(HFSP_SIGNATURE)
+ && vh->signature != PED_CPU_TO_BE16(HFSX_SIGNATURE)) {
+ ped_exception_throw (
+ PED_EXCEPTION_BUG,
+ PED_EXCEPTION_CANCEL,
+ _("No valid HFS[+X] signature has been found while "
+ "opening."));
+ goto hpo_pg;
+ }
+
+ if (vh->signature == PED_CPU_TO_BE16(HFSP_SIGNATURE)
+ && vh->version != PED_CPU_TO_BE16(HFSP_VERSION)) {
+ if (ped_exception_throw (
+ PED_EXCEPTION_NO_FEATURE,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("Version %d of HFS+ isn't supported."),
+ PED_BE16_TO_CPU(vh->version))
+ != PED_EXCEPTION_IGNORE)
+ goto hpo_pg;
+ }
+
+ if (vh->signature == PED_CPU_TO_BE16(HFSX_SIGNATURE)
+ && vh->version != PED_CPU_TO_BE16(HFSX_VERSION)) {
+ if (ped_exception_throw (
+ PED_EXCEPTION_NO_FEATURE,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("Version %d of HFSX isn't supported."),
+ PED_BE16_TO_CPU(vh->version))
+ != PED_EXCEPTION_IGNORE)
+ goto hpo_pg;
+ }
+
+ priv_data->jib_start_block = 0;
+ priv_data->jl_start_block = 0;
+ if (vh->attributes & PED_CPU_TO_BE32(1<<HFSP_JOURNALED)) {
+ if (!hfsj_replay_journal(fs))
+ goto hpo_pg;
+ }
+
+ priv_data->bad_blocks_loaded = 0;
+ priv_data->bad_blocks_xtent_nb = 0;
+ priv_data->bad_blocks_xtent_list = NULL;
+ priv_data->extents_file =
+ hfsplus_file_open (fs, PED_CPU_TO_BE32 (HFS_XTENT_ID),
+ vh->extents_file.extents,
+ PED_BE64_TO_CPU (
+ vh->extents_file.logical_size )
+ / PED_SECTOR_SIZE_DEFAULT);
+ if (!priv_data->extents_file) goto hpo_pg;
+ priv_data->catalog_file =
+ hfsplus_file_open (fs, PED_CPU_TO_BE32 (HFS_CATALOG_ID),
+ vh->catalog_file.extents,
+ PED_BE64_TO_CPU (
+ vh->catalog_file.logical_size )
+ / PED_SECTOR_SIZE_DEFAULT);
+ if (!priv_data->catalog_file) goto hpo_ce;
+ priv_data->attributes_file =
+ hfsplus_file_open (fs, PED_CPU_TO_BE32 (HFSP_ATTRIB_ID),
+ vh->attributes_file.extents,
+ PED_BE64_TO_CPU (
+ vh->attributes_file.logical_size)
+ / PED_SECTOR_SIZE_DEFAULT);
+ if (!priv_data->attributes_file) goto hpo_cc;
+
+ map_sectors = ( PED_BE32_TO_CPU (vh->total_blocks)
+ + PED_SECTOR_SIZE_DEFAULT * 8 - 1 )
+ / (PED_SECTOR_SIZE_DEFAULT * 8);
+ priv_data->dirty_alloc_map = (uint8_t*)
+ ped_malloc ((map_sectors + 7) / 8);
+ if (!priv_data->dirty_alloc_map) goto hpo_cl;
+ memset(priv_data->dirty_alloc_map, 0, (map_sectors + 7) / 8);
+ priv_data->alloc_map = (uint8_t*)
+ ped_malloc (map_sectors * PED_SECTOR_SIZE_DEFAULT);
+ if (!priv_data->alloc_map) goto hpo_dm;
+
+ priv_data->allocation_file =
+ hfsplus_file_open (fs, PED_CPU_TO_BE32 (HFSP_ALLOC_ID),
+ vh->allocation_file.extents,
+ PED_BE64_TO_CPU (
+ vh->allocation_file.logical_size)
+ / PED_SECTOR_SIZE_DEFAULT);
+ if (!priv_data->allocation_file) goto hpo_am;
+ if (!hfsplus_file_read (priv_data->allocation_file,
+ priv_data->alloc_map, 0, map_sectors)) {
+ hfsplus_close(fs);
+ return NULL;
+ }
+
+ fs->type = &hfsplus_type;
+ fs->checked = ((PED_BE32_TO_CPU (vh->attributes) >> HFS_UNMOUNTED) & 1)
+ && !((PED_BE32_TO_CPU (vh->attributes) >> HFSP_INCONSISTENT) & 1);
+
+ return fs;
+
+/*--- clean error handling ---*/
+hpo_am: ped_free(priv_data->alloc_map);
+hpo_dm: ped_free(priv_data->dirty_alloc_map);
+hpo_cl: hfsplus_file_close (priv_data->attributes_file);
+hpo_cc: hfsplus_file_close (priv_data->catalog_file);
+hpo_ce: hfsplus_file_close (priv_data->extents_file);
+hpo_pg: if (priv_data->free_geom) ped_geometry_destroy (priv_data->plus_geom);
+hpo_wr: if (priv_data->wrapper) hfs_close(priv_data->wrapper);
+hpo_gm: ped_geometry_destroy (fs->geom);
+hpo_pd: ped_free(priv_data);
+hpo_vh: ped_free(vh);
+hpo_fs: ped_free(fs);
+hpo: return NULL;
+}
+
+static PedConstraint*
+hfsplus_get_resize_constraint (const PedFileSystem *fs)
+{
+ HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*)
+ fs->type_specific;
+ PedDevice* dev = fs->geom->dev;
+ PedAlignment start_align;
+ PedGeometry start_sector;
+ PedGeometry full_dev;
+ PedSector min_size;
+
+ if (!ped_alignment_init (&start_align, fs->geom->start, 0))
+ return NULL;
+ if (!ped_geometry_init (&start_sector, dev, fs->geom->start, 1))
+ return NULL;
+ if (!ped_geometry_init (&full_dev, dev, 0, dev->length - 1))
+ return NULL;
+
+ min_size = hfsplus_get_min_size (fs);
+ if (!min_size) return NULL;
+
+ return ped_constraint_new (&start_align, ped_alignment_any,
+ &start_sector, &full_dev, min_size,
+ fs->geom->length);
+}
+
+static int
+hfsplus_volume_resize (PedFileSystem* fs, PedGeometry* geom, PedTimer* timer)
+{
+ uint8_t buf[PED_SECTOR_SIZE_DEFAULT];
+ unsigned int nblock, nfree, mblock;
+ unsigned int block, to_free, old_blocks;
+ HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*)
+ fs->type_specific;
+ HfsPVolumeHeader* vh = priv_data->vh;
+ int resize = 1;
+ unsigned int hfsp_sect_block =
+ ( PED_BE32_TO_CPU (vh->block_size)
+ / PED_SECTOR_SIZE_DEFAULT );
+ unsigned int map_sectors;
+
+ old_blocks = PED_BE32_TO_CPU (vh->total_blocks);
+
+ /* Flush caches */
+ if (!ped_geometry_sync(priv_data->plus_geom))
+ return 0;
+
+ /* Clear the unmounted bit */
+ /* and set the implementation code (Apple Creator Code) */
+ vh->attributes &= PED_CPU_TO_BE32 (~( 1 << HFS_UNMOUNTED ));
+ vh->last_mounted_version = PED_CPU_TO_BE32(HFSP_IMPL_Shnk);
+ if (!ped_geometry_read (priv_data->plus_geom, buf, 2, 1))
+ return 0;
+ memcpy (buf, vh, sizeof (HfsPVolumeHeader));
+ if ( !ped_geometry_write (priv_data->plus_geom, buf, 2, 1)
+ || !ped_geometry_sync (priv_data->plus_geom))
+ return 0;
+
+ ped_timer_reset (timer);
+ ped_timer_set_state_name(timer, _("shrinking"));
+ ped_timer_update(timer, 0.0);
+ /* relocate data */
+ to_free = ( priv_data->plus_geom->length
+ - geom->length + hfsp_sect_block
+ - 1 ) / hfsp_sect_block;
+ block = hfsplus_find_start_pack (fs, to_free);
+ if (!hfsplus_pack_free_space_from_block (fs, block, timer, to_free)) {
+ resize = 0;
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Data relocation has failed."));
+ goto write_VH;
+ }
+
+ /* Calculate new block number and other VH field */
+ /* nblock must be rounded _down_ */
+ nblock = geom->length / hfsp_sect_block;
+ nfree = PED_BE32_TO_CPU (vh->free_blocks)
+ - (old_blocks - nblock);
+ /* free block readjustement is only needed when incorrect nblock
+ was used by my previous implementation, so detect the case */
+ if (priv_data->plus_geom->length < old_blocks
+ * ( PED_BE32_TO_CPU (vh->block_size)
+ / PED_SECTOR_SIZE_DEFAULT) ) {
+ if (priv_data->plus_geom->length % hfsp_sect_block == 1)
+ nfree++;
+ }
+
+ /* Check that all block after future end are really free */
+ mblock = ( priv_data->plus_geom->length - 2 )
+ / hfsp_sect_block;
+ if (mblock > old_blocks - 1)
+ mblock = old_blocks - 1;
+ for ( block = nblock;
+ block < mblock;
+ block++ ) {
+ if (TST_BLOC_OCCUPATION(priv_data->alloc_map,block)) {
+ resize = 0;
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Data relocation left some data at the end "
+ "of the volume."));
+ goto write_VH;
+ }
+ }
+
+ /* Mark out of volume blocks as used */
+ map_sectors = ( ( old_blocks + PED_SECTOR_SIZE_DEFAULT * 8 - 1 )
+ / (PED_SECTOR_SIZE_DEFAULT * 8) )
+ * (PED_SECTOR_SIZE_DEFAULT * 8);
+ for ( block = nblock; block < map_sectors; ++block)
+ SET_BLOC_OCCUPATION(priv_data->alloc_map, block);
+
+ /* Update geometry */
+ if (resize) {
+ /* update in fs structure */
+ if (PED_BE32_TO_CPU (vh->next_allocation) >= nblock)
+ vh->next_allocation = PED_CPU_TO_BE32 (0);
+ vh->total_blocks = PED_CPU_TO_BE32 (nblock);
+ vh->free_blocks = PED_CPU_TO_BE32 (nfree);
+ /* update parted structure */
+ priv_data->plus_geom->length = geom->length;
+ priv_data->plus_geom->end = priv_data->plus_geom->start
+ + geom->length - 1;
+ }
+
+ /* Effective write */
+ write_VH:
+ /* lasts two sectors are allocated by the alternate VH
+ and a reserved sector, and last block is always reserved */
+ block = (priv_data->plus_geom->length - 1) / hfsp_sect_block;
+ if (block < PED_BE32_TO_CPU (vh->total_blocks))
+ SET_BLOC_OCCUPATION(priv_data->alloc_map, block);
+ block = (priv_data->plus_geom->length - 2) / hfsp_sect_block;
+ if (block < PED_BE32_TO_CPU (vh->total_blocks))
+ SET_BLOC_OCCUPATION(priv_data->alloc_map, block);
+ SET_BLOC_OCCUPATION(priv_data->alloc_map,
+ PED_BE32_TO_CPU (vh->total_blocks) - 1);
+
+ /* Write the _old_ area to set out of volume blocks as used */
+ map_sectors = ( old_blocks + PED_SECTOR_SIZE_DEFAULT * 8 - 1 )
+ / (PED_SECTOR_SIZE_DEFAULT * 8);
+ if (!hfsplus_file_write (priv_data->allocation_file,
+ priv_data->alloc_map, 0, map_sectors)) {
+ resize = 0;
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Error while writing the allocation file."));
+ } else {
+ /* Write remaining part of allocation bitmap */
+ /* This is necessary to handle pre patch-11 and third party */
+ /* implementations */
+ memset(buf, 0xFF, PED_SECTOR_SIZE_DEFAULT);
+ for (block = map_sectors;
+ block < priv_data->allocation_file->sect_nb;
+ ++block) {
+ if (!hfsplus_file_write_sector (
+ priv_data->allocation_file,
+ buf, block)) {
+ ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_IGNORE,
+ _("Error while writing the "
+ "compatibility part of the "
+ "allocation file."));
+ break;
+ }
+ }
+ }
+ ped_geometry_sync (priv_data->plus_geom);
+
+ if (resize) {
+ /* Set the unmounted bit and clear the inconsistent bit */
+ vh->attributes |= PED_CPU_TO_BE32 ( 1 << HFS_UNMOUNTED );
+ vh->attributes &= ~ PED_CPU_TO_BE32 ( 1 << HFSP_INCONSISTENT );
+ }
+
+ ped_timer_set_state_name(timer, _("writing HFS+ Volume Header"));
+ if (!hfsplus_update_vh(fs)) {
+ ped_geometry_sync(priv_data->plus_geom);
+ return 0;
+ }
+
+ if (!ped_geometry_sync(priv_data->plus_geom))
+ return 0;
+
+ ped_timer_update(timer, 1.0);
+
+ return (resize);
+}
+
+/* Update the HFS wrapper mdb and bad blocks file to reflect
+ the new geometry of the embedded HFS+ volume */
+static int
+hfsplus_wrapper_update (PedFileSystem* fs)
+{
+ uint8_t node[PED_SECTOR_SIZE_DEFAULT];
+ HfsCPrivateLeafRec ref;
+ HfsExtentKey key;
+ HfsNodeDescriptor* node_desc = (HfsNodeDescriptor*) node;
+ HfsExtentKey* ret_key;
+ HfsExtDescriptor* ret_data;
+ unsigned int i, j;
+ HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*)
+ fs->type_specific;
+ HfsPrivateFSData* hfs_priv_data = (HfsPrivateFSData*)
+ priv_data->wrapper->type_specific;
+ unsigned int hfs_sect_block =
+ PED_BE32_TO_CPU (hfs_priv_data->mdb->block_size)
+ / PED_SECTOR_SIZE_DEFAULT ;
+ PedSector hfsplus_sect = (PedSector)
+ PED_BE32_TO_CPU (priv_data->vh->total_blocks)
+ * ( PED_BE32_TO_CPU (priv_data->vh->block_size)
+ / PED_SECTOR_SIZE_DEFAULT );
+ unsigned int hfs_blocks_embedded =
+ (hfsplus_sect + hfs_sect_block - 1)
+ / hfs_sect_block;
+ unsigned int hfs_blocks_embedded_old;
+
+ /* update HFS wrapper MDB */
+ hfs_blocks_embedded_old = PED_BE16_TO_CPU (
+ hfs_priv_data->mdb->old_new
+ .embedded.location.block_count );
+ hfs_priv_data->mdb->old_new.embedded.location.block_count =
+ PED_CPU_TO_BE16 (hfs_blocks_embedded);
+ /* maybe macOS will boot with this */
+ /* update : yes it does \o/ :) */
+ hfs_priv_data->mdb->free_blocks =
+ PED_CPU_TO_BE16 ( PED_BE16_TO_CPU (hfs_priv_data->mdb->free_blocks)
+ + hfs_blocks_embedded_old
+ - hfs_blocks_embedded );
+
+ if (!hfs_update_mdb(priv_data->wrapper))
+ return 0;
+
+ /* force reload bad block list */
+ if (hfs_priv_data->bad_blocks_loaded) {
+ hfs_free_bad_blocks_list (hfs_priv_data->bad_blocks_xtent_list);
+ hfs_priv_data->bad_blocks_xtent_list = NULL;
+ hfs_priv_data->bad_blocks_xtent_nb = 0;
+ hfs_priv_data->bad_blocks_loaded = 0;
+ }
+
+ /* clean HFS wrapper allocation map */
+ for (i = PED_BE16_TO_CPU (
+ hfs_priv_data->mdb->old_new.embedded
+ .location.start_block )
+ + hfs_blocks_embedded;
+ i < PED_BE16_TO_CPU (
+ hfs_priv_data->mdb->old_new.embedded
+ .location.start_block )
+ + hfs_blocks_embedded_old;
+ i++ ) {
+ CLR_BLOC_OCCUPATION(hfs_priv_data->alloc_map, i);
+ }
+ /* and save it */
+ if (!ped_geometry_write (fs->geom, hfs_priv_data->alloc_map,
+ PED_BE16_TO_CPU (
+ hfs_priv_data->mdb->volume_bitmap_block ),
+ ( PED_BE16_TO_CPU (
+ hfs_priv_data->mdb->total_blocks )
+ + PED_SECTOR_SIZE_DEFAULT * 8 - 1 )
+ / (PED_SECTOR_SIZE_DEFAULT * 8)))
+ return 0;
+ if (!ped_geometry_sync (fs->geom))
+ return 0;
+
+ /* search and update the bad blocks file */
+ key.key_length = sizeof(key) - 1;
+ key.type = HFS_DATA_FORK;
+ key.file_ID = PED_CPU_TO_BE32 (HFS_BAD_BLOCK_ID);
+ key.start = 0;
+ if (!hfs_btree_search (hfs_priv_data->extent_file,
+ (HfsPrivateGenericKey*) &key, NULL, 0, &ref)) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("An error occurred while looking for the mandatory "
+ "bad blocks file."));
+ return 0;
+ }
+ if (!hfs_file_read_sector (hfs_priv_data->extent_file, node,
+ ref.node_number))
+ return 0;
+ ret_key = (HfsExtentKey*) (node + ref.record_pos);
+ ret_data = (HfsExtDescriptor*) ( node + ref.record_pos
+ + sizeof (HfsExtentKey) );
+
+ while (ret_key->type == key.type && ret_key->file_ID == key.file_ID) {
+ for (i = 0; i < HFS_EXT_NB; i++) {
+ if ( ret_data[i].start_block
+ == hfs_priv_data->mdb->old_new
+ .embedded.location.start_block) {
+ ret_data[i].block_count =
+ hfs_priv_data->mdb->old_new
+ .embedded.location.block_count;
+ /* found ! : update */
+ if (!hfs_file_write_sector (
+ hfs_priv_data->extent_file,
+ node, ref.node_number)
+ || !ped_geometry_sync(fs->geom))
+ return 0;
+ return 1;
+ }
+ }
+
+ if (ref.record_number < PED_BE16_TO_CPU (node_desc->rec_nb)) {
+ ref.record_number++;
+ } else {
+ ref.node_number = PED_BE32_TO_CPU (node_desc->next);
+ if (!ref.node_number
+ || !hfs_file_read_sector(hfs_priv_data->extent_file,
+ node, ref.node_number))
+ goto bb_not_found;
+ ref.record_number = 1;
+ }
+
+ ref.record_pos =
+ PED_BE16_TO_CPU (*((uint16_t *)
+ (node + (PED_SECTOR_SIZE_DEFAULT
+ - 2*ref.record_number))));
+ ret_key = (HfsExtentKey*) (node + ref.record_pos);
+ ret_data = (HfsExtDescriptor*) ( node + ref.record_pos
+ + sizeof (HfsExtentKey) );
+ }
+
+bb_not_found:
+ /* not found : not a valid hfs+ wrapper : failure */
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("It seems there is an error in the HFS wrapper: the bad "
+ "blocks file doesn't contain the embedded HFS+ volume."));
+ return 0;
+}
+
+static int
+hfsplus_resize (PedFileSystem* fs, PedGeometry* geom, PedTimer* timer)
+{
+ HfsPPrivateFSData* priv_data;
+ PedTimer* timer_plus;
+ PedGeometry* embedded_geom;
+ PedSector hgms;
+
+ /* check preconditions */
+ PED_ASSERT (fs != NULL, return 0);
+ PED_ASSERT (fs->geom != NULL, return 0);
+ PED_ASSERT (geom != NULL, return 0);
+ PED_ASSERT (fs->geom->dev == geom->dev, return 0);
+#ifdef DEBUG
+ PED_ASSERT ((hgms = hfsplus_get_min_size (fs)) != 0, return 0);
+#else
+ if ((hgms = hfsplus_get_min_size (fs)) == 0)
+ return 0;
+#endif
+
+ if (ped_geometry_test_equal(fs->geom, geom))
+ return 1;
+
+ priv_data = (HfsPPrivateFSData*) fs->type_specific;
+
+ if (fs->geom->start != geom->start
+ || geom->length > fs->geom->length
+ || geom->length < hgms) {
+ ped_exception_throw (
+ PED_EXCEPTION_NO_FEATURE,
+ PED_EXCEPTION_CANCEL,
+ _("Sorry, HFS+ cannot be resized that way yet."));
+ return 0;
+ }
+
+ if (priv_data->wrapper) {
+ PedSector red, hgee;
+ HfsPrivateFSData* hfs_priv_data = (HfsPrivateFSData*)
+ priv_data->wrapper->type_specific;
+ unsigned int hfs_sect_block =
+ PED_BE32_TO_CPU (hfs_priv_data->mdb->block_size)
+ / PED_SECTOR_SIZE_DEFAULT;
+
+ /* There is a wrapper so we must calculate the new geometry
+ of the embedded HFS+ volume */
+ red = ( (fs->geom->length - geom->length + hfs_sect_block - 1)
+ / hfs_sect_block ) * hfs_sect_block;
+ /* Can't we shrink the hfs+ volume by the desired size ? */
+ hgee = hfsplus_get_empty_end (fs);
+ if (!hgee) return 0;
+ if (red > priv_data->plus_geom->length - hgee) {
+ /* No, shrink hfs+ by the greatest possible value */
+ hgee = ((hgee + hfs_sect_block - 1) / hfs_sect_block)
+ * hfs_sect_block;
+ red = priv_data->plus_geom->length - hgee;
+ }
+ embedded_geom = ped_geometry_new (geom->dev,
+ priv_data->plus_geom->start,
+ priv_data->plus_geom->length
+ - red);
+
+ /* There is a wrapper so the resize process is a two stages
+ process (embedded resizing then wrapper resizing) :
+ we create a sub timer */
+ ped_timer_reset (timer);
+ ped_timer_set_state_name (timer,
+ _("shrinking embedded HFS+ volume"));
+ ped_timer_update(timer, 0.0);
+ timer_plus = ped_timer_new_nested (timer, 0.98);
+ } else {
+ /* No wrapper : the desired geometry is the desired
+ HFS+ volume geometry */
+ embedded_geom = geom;
+ timer_plus = timer;
+ }
+
+ /* Resize the HFS+ volume */
+ if (!hfsplus_volume_resize (fs, embedded_geom, timer_plus)) {
+ if (timer_plus != timer) ped_timer_destroy_nested (timer_plus);
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Resizing the HFS+ volume has failed."));
+ return 0;
+ }
+
+ if (priv_data->wrapper) {
+ ped_geometry_destroy (embedded_geom);
+ ped_timer_destroy_nested (timer_plus);
+ ped_timer_set_state_name(timer, _("shrinking HFS wrapper"));
+ timer_plus = ped_timer_new_nested (timer, 0.02);
+ /* There's a wrapper : second stage = resizing it */
+ if (!hfsplus_wrapper_update (fs)
+ || !hfs_resize (priv_data->wrapper, geom, timer_plus)) {
+ ped_timer_destroy_nested (timer_plus);
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Updating the HFS wrapper has failed."));
+ return 0;
+ }
+ ped_timer_destroy_nested (timer_plus);
+ }
+ ped_timer_update(timer, 1.0);
+
+ return 1;
+}
+
+#ifdef HFS_EXTRACT_FS
+/* The following is for debugging purpose only, NOT for packaging */
+
+#include <stdio.h>
+
+uint8_t* extract_buffer = NULL;
+
+static int
+hfs_extract_file(const char* filename, HfsPrivateFile* hfs_file)
+{
+ FILE* fout;
+ PedSector sect;
+
+ fout = fopen(filename, "w");
+ if (!fout) return 0;
+
+ for (sect = 0; sect < hfs_file->sect_nb; ++sect) {
+ if (!hfs_file_read_sector(hfs_file, extract_buffer, sect))
+ goto err_close;
+ if (!fwrite(extract_buffer, PED_SECTOR_SIZE_DEFAULT, 1, fout))
+ goto err_close;
+ }
+
+ fclose(fout);
+ return 1;
+err_close:
+ fclose(fout);
+ return 0;
+}
+
+static int
+hfs_extract_bitmap(const char* filename, PedFileSystem* fs)
+{
+ HfsPrivateFSData* priv_data = (HfsPrivateFSData*)
+ fs->type_specific;
+ HfsMasterDirectoryBlock* mdb = priv_data->mdb;
+ unsigned int count;
+ FILE* fout;
+ PedSector sect;
+
+ fout = fopen(filename, "w");
+ if (!fout) return 0;
+
+ for (sect = PED_BE16_TO_CPU(mdb->volume_bitmap_block);
+ sect < PED_BE16_TO_CPU(mdb->start_block);
+ sect += count) {
+ uint16_t st_block = PED_BE16_TO_CPU(mdb->start_block);
+ count = (st_block-sect) < BLOCK_MAX_BUFF ?
+ (st_block-sect) : BLOCK_MAX_BUFF;
+ if (!ped_geometry_read(fs->geom, extract_buffer, sect, count))
+ goto err_close;
+ if (!fwrite (extract_buffer, count * PED_SECTOR_SIZE_DEFAULT,
+ 1, fout))
+ goto err_close;
+ }
+
+ fclose(fout);
+ return 1;
+err_close:
+ fclose(fout);
+ return 0;
+}
+
+static int
+hfs_extract_mdb (const char* filename, PedFileSystem* fs)
+{
+ FILE* fout;
+
+ fout = fopen(filename, "w");
+ if (!fout) return 0;
+
+ if (!ped_geometry_read(fs->geom, extract_buffer, 2, 1))
+ goto err_close;
+ if (!fwrite(extract_buffer, PED_SECTOR_SIZE_DEFAULT, 1, fout))
+ goto err_close;
+
+ fclose(fout);
+ return 1;
+err_close:
+ fclose(fout);
+ return 0;
+}
+
+static int
+hfs_extract (PedFileSystem* fs, PedTimer* timer)
+{
+ HfsPrivateFSData* priv_data = (HfsPrivateFSData*)
+ fs->type_specific;
+
+ ped_exception_throw (
+ PED_EXCEPTION_INFORMATION,
+ PED_EXCEPTION_OK,
+ _("This is not a real %s check. This is going to extract "
+ "special low level files for debugging purposes."),
+ "HFS");
+
+ extract_buffer = ped_malloc(BLOCK_MAX_BUFF * PED_SECTOR_SIZE_DEFAULT);
+ if (!extract_buffer) return 0;
+
+ hfs_extract_mdb(HFS_MDB_FILENAME, fs);
+ hfs_extract_file(HFS_CATALOG_FILENAME, priv_data->catalog_file);
+ hfs_extract_file(HFS_EXTENTS_FILENAME, priv_data->extent_file);
+ hfs_extract_bitmap(HFS_BITMAP_FILENAME, fs);
+
+ ped_free(extract_buffer); extract_buffer = NULL;
+ return 0; /* nothing has been fixed by us ! */
+}
+
+static int
+hfsplus_extract_file(const char* filename, HfsPPrivateFile* hfsp_file)
+{
+ FILE* fout;
+ unsigned int cp_sect;
+ PedSector rem_sect;
+
+ fout = fopen(filename, "w");
+ if (!fout) return 0;
+
+ for (rem_sect = hfsp_file->sect_nb; rem_sect; rem_sect -= cp_sect) {
+ cp_sect = rem_sect < BLOCK_MAX_BUFF ? rem_sect : BLOCK_MAX_BUFF;
+ if (!hfsplus_file_read(hfsp_file, extract_buffer,
+ hfsp_file->sect_nb - rem_sect, cp_sect))
+ goto err_close;
+ if (!fwrite (extract_buffer, cp_sect * PED_SECTOR_SIZE_DEFAULT,
+ 1, fout))
+ goto err_close;
+ }
+
+ fclose(fout);
+ return 1;
+err_close:
+ fclose(fout);
+ return 0;
+}
+
+static int
+hfsplus_extract_vh (const char* filename, PedFileSystem* fs)
+{
+ HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*)
+ fs->type_specific;
+ FILE* fout;
+ PedGeometry* geom = priv_data->plus_geom;
+
+
+ fout = fopen(filename, "w");
+ if (!fout) return 0;
+
+ if (!ped_geometry_read(geom, extract_buffer, 2, 1))
+ goto err_close;
+ if (!fwrite(extract_buffer, PED_SECTOR_SIZE_DEFAULT, 1, fout))
+ goto err_close;
+
+ fclose(fout);
+ return 1;
+err_close:
+ fclose(fout);
+ return 0;
+}
+
+/* TODO : use the timer to report what is happening */
+/* TODO : use exceptions to report errors */
+static int
+hfsplus_extract (PedFileSystem* fs, PedTimer* timer)
+{
+ HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*)
+ fs->type_specific;
+ HfsPVolumeHeader* vh = priv_data->vh;
+ HfsPPrivateFile* startup_file;
+
+ if (priv_data->wrapper) {
+ /* TODO : create nested timer */
+ hfs_extract (priv_data->wrapper, timer);
+ }
+
+ ped_exception_throw (
+ PED_EXCEPTION_INFORMATION,
+ PED_EXCEPTION_OK,
+ _("This is not a real %s check. This is going to extract "
+ "special low level files for debugging purposes."),
+ "HFS+");
+
+ extract_buffer = ped_malloc(BLOCK_MAX_BUFF * PED_SECTOR_SIZE_DEFAULT);
+ if (!extract_buffer) return 0;
+
+ hfsplus_extract_vh(HFSP_VH_FILENAME, fs);
+ hfsplus_extract_file(HFSP_CATALOG_FILENAME, priv_data->catalog_file);
+ hfsplus_extract_file(HFSP_EXTENTS_FILENAME, priv_data->extents_file);
+ hfsplus_extract_file(HFSP_ATTRIB_FILENAME, priv_data->attributes_file);
+ hfsplus_extract_file(HFSP_BITMAP_FILENAME, priv_data->allocation_file);
+
+ startup_file = hfsplus_file_open(fs, PED_CPU_TO_BE32(HFSP_STARTUP_ID),
+ vh->startup_file.extents,
+ PED_BE64_TO_CPU (
+ vh->startup_file.logical_size)
+ / PED_SECTOR_SIZE_DEFAULT);
+ if (startup_file) {
+ hfsplus_extract_file(HFSP_STARTUP_FILENAME, startup_file);
+ hfsplus_file_close(startup_file); startup_file = NULL;
+ }
+
+ ped_free(extract_buffer); extract_buffer = NULL;
+ return 0; /* nothing has been fixed by us ! */
+}
+#endif /* HFS_EXTRACT_FS */
+
+#endif /* !DISCOVER_ONLY */
+
+static PedFileSystemOps hfs_ops = {
+ probe: hfs_probe,
+#ifndef DISCOVER_ONLY
+ clobber: hfs_clobber,
+ open: hfs_open,
+ create: NULL,
+ close: hfs_close,
+#ifndef HFS_EXTRACT_FS
+ check: NULL,
+#else
+ check: hfs_extract,
+#endif
+ copy: NULL,
+ resize: hfs_resize,
+ get_create_constraint: NULL,
+ get_resize_constraint: hfs_get_resize_constraint,
+ get_copy_constraint: NULL,
+#else /* DISCOVER_ONLY */
+ clobber: NULL,
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ copy: NULL,
+ resize: NULL,
+ get_create_constraint: NULL,
+ get_resize_constraint: NULL,
+ get_copy_constraint: NULL,
+#endif /* DISCOVER_ONLY */
+};
+
+static PedFileSystemOps hfsplus_ops = {
+ probe: hfsplus_probe,
+#ifndef DISCOVER_ONLY
+ clobber: hfsplus_clobber,
+ open: hfsplus_open,
+ create: NULL,
+ close: hfsplus_close,
+#ifndef HFS_EXTRACT_FS
+ check: NULL,
+#else
+ check: hfsplus_extract,
+#endif
+ copy: NULL,
+ resize: hfsplus_resize,
+ get_create_constraint: NULL,
+ get_resize_constraint: hfsplus_get_resize_constraint,
+ get_copy_constraint: NULL,
+#else /* DISCOVER_ONLY */
+ clobber: NULL,
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ copy: NULL,
+ resize: NULL,
+ get_create_constraint: NULL,
+ get_resize_constraint: NULL,
+ get_copy_constraint: NULL,
+#endif /* DISCOVER_ONLY */
+};
+
+static PedFileSystemOps hfsx_ops = {
+ probe: hfsx_probe,
+#ifndef DISCOVER_ONLY
+ clobber: hfs_clobber, /* NOT hfsplus_clobber !
+ HFSX can't be embedded */
+ open: hfsplus_open,
+ create: NULL,
+ close: hfsplus_close,
+#ifndef HFS_EXTRACT_FS
+ check: NULL,
+#else
+ check: hfsplus_extract,
+#endif
+ copy: NULL,
+ resize: hfsplus_resize,
+ get_create_constraint: NULL,
+ get_resize_constraint: hfsplus_get_resize_constraint,
+ get_copy_constraint: NULL,
+#else /* DISCOVER_ONLY */
+ clobber: NULL,
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ copy: NULL,
+ resize: NULL,
+ get_create_constraint: NULL,
+ get_resize_constraint: NULL,
+ get_copy_constraint: NULL,
+#endif /* DISCOVER_ONLY */
+};
+
+
+static PedFileSystemType hfs_type = {
+ next: NULL,
+ ops: &hfs_ops,
+ name: "hfs",
+ block_sizes: HFS_BLOCK_SIZES
+};
+
+static PedFileSystemType hfsplus_type = {
+ next: NULL,
+ ops: &hfsplus_ops,
+ name: "hfs+",
+ block_sizes: HFSP_BLOCK_SIZES
+};
+
+static PedFileSystemType hfsx_type = {
+ next: NULL,
+ ops: &hfsx_ops,
+ name: "hfsx",
+ block_sizes: HFSX_BLOCK_SIZES
+};
+
+void
+ped_file_system_hfs_init ()
+{
+ ped_file_system_type_register (&hfs_type);
+ ped_file_system_type_register (&hfsplus_type);
+ ped_file_system_type_register (&hfsx_type);
+}
+
+void
+ped_file_system_hfs_done ()
+{
+ ped_file_system_type_unregister (&hfs_type);
+ ped_file_system_type_unregister (&hfsplus_type);
+ ped_file_system_type_unregister (&hfsx_type);
+}
diff --git a/libparted/fs/hfs/hfs.h b/libparted/fs/hfs/hfs.h
new file mode 100644
index 0000000..490c8f2
--- /dev/null
+++ b/libparted/fs/hfs/hfs.h
@@ -0,0 +1,651 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef _HFS_H
+#define _HFS_H
+
+/* WARNING : bn is used 2 times in theses macro */
+/* so _never_ use side effect operators when using them */
+#define TST_BLOC_OCCUPATION(tab,bn) \
+ (((tab)[(bn)/8]) & (1<<(7-((bn)&7))))
+#define SET_BLOC_OCCUPATION(tab,bn) \
+ (((tab)[(bn)/8]) |= (1<<(7-((bn)&7))))
+#define CLR_BLOC_OCCUPATION(tab,bn) \
+ (((tab)[(bn)/8]) &= ~(1<<(7-((bn)&7))))
+
+/* Maximum number of blocks for the copy buffers */
+#define BLOCK_MAX_BUFF 256
+/* Maximum size of the copy buffers, in bytes */
+#define BYTES_MAX_BUFF 8388608
+
+/* Apple Creator Codes follow */
+#define HFSP_IMPL_Shnk 0x53686e6b /* in use */
+#define HFSP_IMPL_Xpnd 0x58706e64 /* reserved */
+#define HFSP_IMPL_Resz 0x5265737a /* reserved */
+#define HFSP_IMPL_PHpx 0x50482b78 /* reserved */
+#define HFSP_IMPL_traP 0x74726150 /* reserved */
+#define HFSP_IMPL_GnuP 0x476e7550 /* reserved */
+
+#define HFS_SIGNATURE 0x4244 /* 'BD' */
+#define HFSP_SIGNATURE 0x482B /* 'H+' */
+#define HFSX_SIGNATURE 0x4858 /* 'HX' */
+
+#define HFSP_VERSION 4
+#define HFSX_VERSION 5
+
+#define HFS_HARD_LOCK 7
+#define HFS_UNMOUNTED 8
+#define HFS_BAD_SPARED 9
+#define HFS_SOFT_LOCK 15
+#define HFSP_NO_CACHE 10
+#define HFSP_INCONSISTENT 11
+#define HFSP_REUSE_CNID 12
+#define HFSP_JOURNALED 13
+
+#define HFS_IDX_NODE 0x00
+#define HFS_HDR_NODE 0x01
+#define HFS_MAP_NODE 0x02
+#define HFS_LEAF_NODE 0xFF
+
+#define HFS_FIRST_REC 0x0E
+#define HFS_NSD_HD_REC 0x78
+#define HFS_MAP_REC 0xF8
+
+#define HFS_DATA_FORK 0x00
+#define HFS_RES_FORK 0xFF
+
+#define HFS_CAT_DIR 0x01
+#define HFS_CAT_FILE 0x02
+#define HFS_CAT_DIR_TH 0x03
+#define HFS_CAT_FILE_TH 0x04
+
+#define HFSP_ATTR_INLINE 0x10
+#define HFSP_ATTR_FORK 0x20
+#define HFSP_ATTR_EXTENTS 0x30
+
+#define HFS_ROOT_PAR_ID 0x01
+#define HFS_ROOT_DIR_ID 0x02
+#define HFS_XTENT_ID 0x03
+#define HFS_CATALOG_ID 0x04
+#define HFS_BAD_BLOCK_ID 0x05
+#define HFSP_ALLOC_ID 0x06
+#define HFSP_STARTUP_ID 0x07
+#define HFSP_ATTRIB_ID 0x08
+#define HFSP_BOGUS_ID 0x0F
+#define HFSP_FIRST_AV_ID 0x10
+
+#define HFSJ_JOURN_IN_FS 0x00
+#define HFSJ_JOURN_OTHER_DEV 0x01
+#define HFSJ_JOURN_NEED_INIT 0x02
+
+#define HFSJ_HEADER_MAGIC 0x4a4e4c78
+#define HFSJ_ENDIAN_MAGIC 0x12345678
+
+#define HFSX_CASE_FOLDING 0xCF /* case insensitive HFSX */
+#define HFSX_BINARY_COMPARE 0xBC /* case sensitive HFSX */
+
+#define HFS_EXT_NB 3
+#define HFSP_EXT_NB 8
+
+/* Define the filenames used by the FS extractor */
+#ifdef HFS_EXTRACT_FS
+
+#define HFS_MDB_FILENAME "mdb.hfs"
+#define HFS_CATALOG_FILENAME "catalog.hfs"
+#define HFS_EXTENTS_FILENAME "extents.hfs"
+#define HFS_BITMAP_FILENAME "bitmap.hfs"
+
+#define HFSP_VH_FILENAME "vh.hfsplus"
+#define HFSP_CATALOG_FILENAME "catalog.hfsplus"
+#define HFSP_EXTENTS_FILENAME "extents.hfsplus"
+#define HFSP_BITMAP_FILENAME "bitmap.hfsplus"
+#define HFSP_ATTRIB_FILENAME "attributes.hfsplus"
+#define HFSP_STARTUP_FILENAME "startup.hfsplus"
+
+#endif /* HFS_EXTRACT_FS */
+
+static PedFileSystemType hfs_type;
+static PedFileSystemType hfsplus_type;
+
+
+
+/* ----------------------------------- */
+/* -- HFS DATA STRUCTURES -- */
+/* ----------------------------------- */
+
+/* Extent descriptor */
+struct __attribute__ ((packed)) _HfsExtDescriptor {
+ uint16_t start_block;
+ uint16_t block_count;
+};
+typedef struct _HfsExtDescriptor HfsExtDescriptor;
+typedef HfsExtDescriptor HfsExtDataRec[HFS_EXT_NB];
+
+/* Volume header */
+struct __attribute__ ((packed)) _HfsMasterDirectoryBlock {
+ uint16_t signature;
+ uint32_t create_date;
+ uint32_t modify_date;
+ uint16_t volume_attributes;
+ uint16_t files_in_root;
+ uint16_t volume_bitmap_block; /* in sectors */
+ uint16_t next_allocation;
+ uint16_t total_blocks;
+ uint32_t block_size; /* in bytes */
+ uint32_t def_clump_size; /* in bytes */
+ uint16_t start_block; /* in sectors */
+ uint32_t next_free_node;
+ uint16_t free_blocks;
+ uint8_t name_length;
+ char name[27];
+ uint32_t backup_date;
+ uint16_t backup_number;
+ uint32_t write_count;
+ uint32_t extents_clump;
+ uint32_t catalog_clump;
+ uint16_t dirs_in_root;
+ uint32_t file_count;
+ uint32_t dir_count;
+ uint32_t finder_info[8];
+ union __attribute__ ((packed)) {
+ struct __attribute__ ((packed)) {
+ uint16_t volume_cache_size; /* in blocks */
+ uint16_t bitmap_cache_size; /* in blocks */
+ uint16_t common_cache_size; /* in blocks */
+ } legacy;
+ struct __attribute__ ((packed)) {
+ uint16_t signature;
+ HfsExtDescriptor location;
+ } embedded;
+ } old_new;
+ uint32_t extents_file_size; /* in bytes, block size multiple */
+ HfsExtDataRec extents_file_rec;
+ uint32_t catalog_file_size; /* in bytes, block size multiple */
+ HfsExtDataRec catalog_file_rec;
+};
+typedef struct _HfsMasterDirectoryBlock HfsMasterDirectoryBlock;
+
+/* B*-Tree Node Descriptor */
+struct __attribute__ ((packed)) _HfsNodeDescriptor {
+ uint32_t next;
+ uint32_t previous;
+ int8_t type;
+ uint8_t height;
+ uint16_t rec_nb;
+ uint16_t reserved;
+};
+typedef struct _HfsNodeDescriptor HfsNodeDescriptor;
+
+/* Header record of a whole B*-Tree */
+struct __attribute__ ((packed)) _HfsHeaderRecord {
+ uint16_t depth;
+ uint32_t root_node;
+ uint32_t leaf_records;
+ uint32_t first_leaf_node;
+ uint32_t last_leaf_node;
+ uint16_t node_size;
+ uint16_t max_key_len;
+ uint32_t total_nodes;
+ uint32_t free_nodes;
+ int8_t reserved[76];
+};
+typedef struct _HfsHeaderRecord HfsHeaderRecord;
+
+/* Catalog key for B*-Tree lookup in the catalog file */
+struct __attribute__ ((packed)) _HfsCatalogKey {
+ uint8_t key_length; /* length of the key without key_length */
+ uint8_t reserved;
+ uint32_t parent_ID;
+ uint8_t name_length;
+ char name[31]; /* in fact physicaly 1 upto 31 */
+};
+typedef struct _HfsCatalogKey HfsCatalogKey;
+
+/* Extents overflow key for B*-Tree lookup */
+struct __attribute__ ((packed)) _HfsExtentKey {
+ uint8_t key_length; /* length of the key without key_length */
+ uint8_t type; /* data or ressource fork */
+ uint32_t file_ID;
+ uint16_t start;
+};
+typedef struct _HfsExtentKey HfsExtentKey;
+
+/* Catalog subdata case directory */
+struct __attribute__ ((packed)) _HfsDir {
+ uint16_t flags;
+ uint16_t valence; /* number of files in this directory */
+ uint32_t dir_ID;
+ uint32_t create_date;
+ uint32_t modify_date;
+ uint32_t backup_date;
+ int8_t DInfo[16]; /* used by Finder, handle as reserved */
+ int8_t DXInfo[16]; /* used by Finder, handle as reserved */
+ uint32_t reserved[4];
+};
+typedef struct _HfsDir HfsDir;
+
+/* Catalog subdata case file */
+struct __attribute__ ((packed)) _HfsFile {
+ int8_t flags;
+ int8_t type; /* should be 0 */
+ int8_t FInfo[16]; /* used by Finder, handle as reserved */
+ uint32_t file_ID;
+ uint16_t data_start_block;
+ uint32_t data_sz_byte;
+ uint32_t data_sz_block;
+ uint16_t res_start_block;
+ uint32_t res_sz_byte;
+ uint32_t res_sz_block;
+ uint32_t create_date;
+ uint32_t modify_date;
+ uint32_t backup_date;
+ int8_t FXInfo[16]; /* used by Finder, handle as reserved */
+ uint16_t clump_size;
+ HfsExtDataRec extents_data;
+ HfsExtDataRec extents_res;
+ uint32_t reserved;
+};
+typedef struct _HfsFile HfsFile;
+
+/* Catalog subdata case directory thread */
+struct __attribute__ ((packed)) _HfsDirTh {
+ uint32_t reserved[2];
+ uint32_t parent_ID;
+ int8_t name_length;
+ char name[31];
+};
+typedef struct _HfsDirTh HfsDirTh;
+
+/* Catalog subdata case file thread */
+typedef struct _HfsDirTh HfsFileTh; /* same as directory thread */
+
+/* Catalog data */
+struct __attribute__ ((packed)) _HfsCatalog {
+ int8_t type;
+ int8_t reserved;
+ union {
+ HfsDir dir;
+ HfsFile file;
+ HfsDirTh dir_th;
+ HfsFileTh file_th;
+ } sel;
+};
+typedef struct _HfsCatalog HfsCatalog;
+
+
+
+/* ------------------------------------ */
+/* -- HFS+ DATA STRUCTURES -- */
+/* ------------------------------------ */
+
+/* documented since 2004 in tn1150 */
+struct __attribute__ ((packed)) _HfsPPerms {
+ uint32_t owner_ID;
+ uint32_t group_ID;
+ uint32_t permissions;
+ uint32_t special_devices;
+};
+typedef struct _HfsPPerms HfsPPerms;
+
+/* HFS+ extent descriptor*/
+struct __attribute__ ((packed)) _HfsPExtDescriptor {
+ uint32_t start_block;
+ uint32_t block_count;
+};
+typedef struct _HfsPExtDescriptor HfsPExtDescriptor;
+typedef HfsPExtDescriptor HfsPExtDataRec[HFSP_EXT_NB];
+
+/* HFS+ fork data structure */
+struct __attribute__ ((packed)) _HfsPForkData {
+ uint64_t logical_size;
+ uint32_t clump_size;
+ uint32_t total_blocks;
+ HfsPExtDataRec extents;
+};
+typedef struct _HfsPForkData HfsPForkData;
+
+/* HFS+ catalog node ID */
+typedef uint32_t HfsPNodeID;
+
+/* HFS+ file names */
+typedef uint16_t unichar;
+struct __attribute__ ((packed)) _HfsPUniStr255 {
+ uint16_t length;
+ unichar unicode[255]; /* 1 upto 255 */
+};
+typedef struct _HfsPUniStr255 HfsPUniStr255;
+
+/* HFS+ volume header */
+struct __attribute__ ((packed)) _HfsPVolumeHeader {
+ uint16_t signature;
+ uint16_t version;
+ uint32_t attributes;
+ uint32_t last_mounted_version;
+ uint32_t journal_info_block;
+
+ uint32_t create_date;
+ uint32_t modify_date;
+ uint32_t backup_date;
+ uint32_t checked_date;
+
+ uint32_t file_count;
+ uint32_t dir_count;
+
+ uint32_t block_size;
+ uint32_t total_blocks;
+ uint32_t free_blocks;
+
+ uint32_t next_allocation;
+ uint32_t res_clump_size;
+ uint32_t data_clump_size;
+ HfsPNodeID next_catalog_ID;
+
+ uint32_t write_count;
+ uint64_t encodings_bitmap;
+
+ uint8_t finder_info[32];
+
+ HfsPForkData allocation_file;
+ HfsPForkData extents_file;
+ HfsPForkData catalog_file;
+ HfsPForkData attributes_file;
+ HfsPForkData startup_file;
+};
+typedef struct _HfsPVolumeHeader HfsPVolumeHeader;
+
+/* HFS+ B-Tree Node Descriptor */ /* same as HFS btree */
+struct __attribute__ ((packed)) _HfsPNodeDescriptor {
+ uint32_t next;
+ uint32_t previous;
+ int8_t type;
+ uint8_t height;
+ uint16_t rec_nb;
+ uint16_t reserved;
+};
+typedef struct _HfsPNodeDescriptor HfsPNodeDescriptor;
+
+/* Header record of a whole HFS+ B-Tree */
+struct __attribute__ ((packed)) _HfsPHeaderRecord {
+ uint16_t depth;
+ uint32_t root_node;
+ uint32_t leaf_records;
+ uint32_t first_leaf_node;
+ uint32_t last_leaf_node;
+ uint16_t node_size;
+ uint16_t max_key_len;
+ uint32_t total_nodes;
+ uint32_t free_nodes; /* same as hfs btree until here */
+ uint16_t reserved1;
+
+ uint32_t clump_size;
+ uint8_t btree_type; /* must be 0 for HFS+ B-Tree */
+ uint8_t key_compare_type; /* hfsx => 0xCF = case folding */
+ /* 0xBC = binary compare */
+ /* otherwise, reserved */
+ uint32_t attributes;
+ uint32_t reserved3[16];
+};
+typedef struct _HfsPHeaderRecord HfsPHeaderRecord;
+
+/* Catalog key for B-Tree lookup in the HFS+ catalog file */
+struct __attribute__ ((packed)) _HfsPCatalogKey {
+ uint16_t key_length;
+ HfsPNodeID parent_ID;
+ HfsPUniStr255 node_name;
+};
+typedef struct _HfsPCatalogKey HfsPCatalogKey;
+
+/* HFS+ catalog subdata case dir */
+struct __attribute__ ((packed)) _HfsPDir {
+ uint16_t flags;
+ uint32_t valence;
+ HfsPNodeID dir_ID;
+ uint32_t create_date;
+ uint32_t modify_date;
+ uint32_t attrib_mod_date;
+ uint32_t access_date;
+ uint32_t backup_date;
+ HfsPPerms permissions;
+ int8_t DInfo[16]; /* used by Finder, handle as reserved */
+ int8_t DXInfo[16]; /* used by Finder, handle as reserved */
+ uint32_t text_encoding;
+ uint32_t reserved;
+};
+typedef struct _HfsPDir HfsPDir;
+
+/* HFS+ catalog subdata case file */
+struct __attribute__ ((packed)) _HfsPFile {
+ uint16_t flags;
+ uint32_t reserved1;
+ HfsPNodeID file_ID;
+ uint32_t create_date;
+ uint32_t modify_date;
+ uint32_t attrib_mod_date;
+ uint32_t access_date;
+ uint32_t backup_date;
+ HfsPPerms permissions;
+ int8_t FInfo[16]; /* used by Finder, handle as reserved */
+ int8_t FXInfo[16]; /* used by Finder, handle as reserved */
+ uint32_t text_encoding;
+ uint32_t reserved2;
+
+ HfsPForkData data_fork;
+ HfsPForkData res_fork;
+};
+typedef struct _HfsPFile HfsPFile;
+
+/* HFS+ catalog subdata case thread */
+struct __attribute__ ((packed)) _HfsPThread {
+ int16_t reserved;
+ HfsPNodeID parent_ID;
+ HfsPUniStr255 node_name;
+};
+typedef struct _HfsPThread HfsPDirTh;
+typedef struct _HfsPThread HfsPFileTh;
+
+/* HFS+ Catalog leaf data */
+struct __attribute__ ((packed)) _HfsPCatalog {
+ int16_t type;
+ union {
+ HfsPDir dir;
+ HfsPFile file;
+ HfsPDirTh dir_th;
+ HfsPFileTh file_th;
+ } sel;
+};
+typedef struct _HfsPCatalog HfsPCatalog;
+
+/* HFS+ extents file key */
+struct __attribute__ ((packed)) _HfsPExtentKey {
+ uint16_t key_length;
+ uint8_t type;
+ uint8_t pad;
+ HfsPNodeID file_ID;
+ uint32_t start;
+};
+typedef struct _HfsPExtentKey HfsPExtentKey;
+
+/* extent file data is HfsPExtDataRec */
+
+/* Fork data attribute file */
+struct __attribute__ ((packed)) _HfsPForkDataAttr {
+ uint32_t record_type;
+ uint32_t reserved;
+ union __attribute__ ((packed)) {
+ HfsPForkData fork;
+ HfsPExtDataRec extents;
+ } fork_res;
+};
+typedef struct _HfsPForkDataAttr HfsPForkDataAttr;
+
+
+/* ----------- Journal data structures ----------- */
+
+/* Info block : stored in a block # defined in the VH */
+struct __attribute__ ((packed)) _HfsJJournalInfoBlock {
+ uint32_t flags;
+ uint32_t device_signature[8];
+ uint64_t offset;
+ uint64_t size;
+ uint32_t reserved[32];
+};
+typedef struct _HfsJJournalInfoBlock HfsJJournalInfoBlock;
+
+struct __attribute__ ((packed)) _HfsJJournalHeader {
+ uint32_t magic;
+ uint32_t endian;
+ uint64_t start;
+ uint64_t end;
+ uint64_t size;
+ uint32_t blhdr_size;
+ uint32_t checksum;
+ uint32_t jhdr_size;
+};
+typedef struct _HfsJJournalHeader HfsJJournalHeader;
+
+struct __attribute__ ((packed)) _HfsJBlockInfo {
+ uint64_t bnum; /* sector number */
+ uint32_t bsize; /* size in bytes */
+ uint32_t next;
+};
+typedef struct _HfsJBlockInfo HfsJBlockInfo;
+
+struct __attribute__ ((packed)) _HfsJBlockListHeader {
+ uint16_t max_blocks; /* reserved */
+ uint16_t num_blocks;
+ uint32_t bytes_used;
+ uint32_t checksum;
+ uint32_t pad;
+ HfsJBlockInfo binfo[1];
+};
+typedef struct _HfsJBlockListHeader HfsJBlockListHeader;
+
+
+
+/* ---------------------------------------- */
+/* -- INTERNAL DATA STRUCTURES -- */
+/* ---------------------------------------- */
+
+/* Data of an opened HFS file */
+struct _HfsPrivateFile {
+ PedSector sect_nb;
+ PedFileSystem* fs;
+ uint32_t CNID; /* disk order (BE) */
+ HfsExtDataRec first; /* disk order (BE) */
+ HfsExtDataRec cache; /* disk order (BE) */
+ uint16_t start_cache; /* CPU order */
+};
+typedef struct _HfsPrivateFile HfsPrivateFile;
+
+/* To store bad block list */
+struct _HfsPrivateLinkExtent {
+ HfsExtDescriptor extent;
+ struct _HfsPrivateLinkExtent* next;
+};
+typedef struct _HfsPrivateLinkExtent HfsPrivateLinkExtent;
+
+/* HFS Filesystem specific data */
+struct _HfsPrivateFSData {
+ uint8_t alloc_map[(1<<16) / 8];
+ HfsMasterDirectoryBlock* mdb;
+ HfsPrivateFile* extent_file;
+ HfsPrivateFile* catalog_file;
+ HfsPrivateLinkExtent* bad_blocks_xtent_list;
+ unsigned int bad_blocks_xtent_nb;
+ char bad_blocks_loaded;
+};
+typedef struct _HfsPrivateFSData HfsPrivateFSData;
+
+/* Generic btree key */
+struct __attribute__ ((packed)) _HfsPrivateGenericKey {
+ uint8_t key_length;
+ uint8_t key_content[1]; /* we use 1 as a minimum size */
+};
+typedef struct _HfsPrivateGenericKey HfsPrivateGenericKey;
+
+/* ----- HFS+ ----- */
+
+/* Data of an opened HFS file */
+struct _HfsPPrivateFile {
+ PedSector sect_nb;
+ PedFileSystem* fs;
+ HfsPNodeID CNID; /* disk order (BE) */
+ HfsPExtDataRec first; /* disk order (BE) */
+ HfsPExtDataRec cache; /* disk order (BE) */
+ uint32_t start_cache; /* CPU order */
+};
+typedef struct _HfsPPrivateFile HfsPPrivateFile;
+
+struct _HfsPPrivateExtent {
+ PedSector start_sector;
+ PedSector sector_count;
+};
+typedef struct _HfsPPrivateExtent HfsPPrivateExtent;
+
+/* To store bad block list */
+struct _HfsPPrivateLinkExtent {
+ HfsPExtDescriptor extent;
+ struct _HfsPPrivateLinkExtent* next;
+};
+typedef struct _HfsPPrivateLinkExtent HfsPPrivateLinkExtent;
+
+/* HFS+ file system specific data */
+struct _HfsPPrivateFSData {
+ PedFileSystem* wrapper; /* NULL if hfs+ is not embedded */
+ PedGeometry* plus_geom; /* Geometry of HFS+ _volume_ */
+ uint8_t* alloc_map;
+ uint8_t* dirty_alloc_map;
+ HfsPVolumeHeader* vh;
+ HfsPPrivateFile* extents_file;
+ HfsPPrivateFile* catalog_file;
+ HfsPPrivateFile* attributes_file;
+ HfsPPrivateFile* allocation_file;
+ HfsPPrivateLinkExtent* bad_blocks_xtent_list;
+ uint32_t jib_start_block;
+ uint32_t jl_start_block;
+ unsigned int bad_blocks_xtent_nb;
+ char bad_blocks_loaded;
+ char free_geom; /* 1 = plus_geom must be freed */
+};
+typedef struct _HfsPPrivateFSData HfsPPrivateFSData;
+
+/* Generic + btree key */
+struct __attribute__ ((packed)) _HfsPPrivateGenericKey {
+ uint16_t key_length;
+ uint8_t key_content[1]; /* we use 1 as a minimum size */
+};
+typedef struct _HfsPPrivateGenericKey HfsPPrivateGenericKey;
+
+/* ---- common ---- */
+
+/* node and lead record reference for a BTree search */
+struct _HfsCPrivateLeafRec {
+ unsigned int node_size; /* in sectors */
+ unsigned int node_number;
+ unsigned int record_pos;
+ unsigned int record_number;
+};
+typedef struct _HfsCPrivateLeafRec HfsCPrivateLeafRec;
+
+extern uint8_t* hfs_block;
+extern uint8_t* hfsp_block;
+extern unsigned hfs_block_count;
+extern unsigned hfsp_block_count;
+
+#endif /* _HFS_H */
diff --git a/libparted/fs/hfs/journal.c b/libparted/fs/hfs/journal.c
new file mode 100644
index 0000000..883f306
--- /dev/null
+++ b/libparted/fs/hfs/journal.c
@@ -0,0 +1,388 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef DISCOVER_ONLY
+
+#include "config.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <parted/parted.h>
+#include <parted/endian.h>
+#include <parted/debug.h>
+#include <stdint.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+#include "hfs.h"
+#include "reloc_plus.h"
+
+#include "journal.h"
+
+static int hfsj_vh_replayed = 0;
+
+static uint32_t
+hfsj_calc_checksum(uint8_t *ptr, int len)
+{
+ int i;
+ uint32_t cksum=0;
+
+ for (i=0; i < len; i++, ptr++) {
+ cksum = (cksum << 8) ^ (cksum + *ptr);
+ }
+
+ return (~cksum);
+}
+
+int
+hfsj_update_jib(PedFileSystem* fs, uint32_t block)
+{
+ HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*)
+ fs->type_specific;
+
+ priv_data->vh->journal_info_block = PED_CPU_TO_BE32(block);
+
+ if (!hfsplus_update_vh (fs))
+ return 0;
+
+ priv_data->jib_start_block = block;
+ return 1;
+}
+
+int
+hfsj_update_jl(PedFileSystem* fs, uint32_t block)
+{
+ uint8_t buf[PED_SECTOR_SIZE_DEFAULT];
+ PedSector sector;
+ uint64_t offset;
+ HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*)
+ fs->type_specific;
+ HfsJJournalInfoBlock* jib;
+ int binsect;
+
+ binsect = PED_BE32_TO_CPU(priv_data->vh->block_size) / PED_SECTOR_SIZE_DEFAULT;
+ sector = (PedSector) priv_data->jib_start_block * binsect;
+ if (!ped_geometry_read(priv_data->plus_geom, buf, sector, 1))
+ return 0;
+ jib = (HfsJJournalInfoBlock*) buf;
+
+ offset = (uint64_t)block * PED_SECTOR_SIZE_DEFAULT * binsect;
+ jib->offset = PED_CPU_TO_BE64(offset);
+
+ if (!ped_geometry_write(priv_data->plus_geom, buf, sector, 1)
+ || !ped_geometry_sync(priv_data->plus_geom))
+ return 0;
+
+ priv_data->jl_start_block = block;
+ return 1;
+}
+
+/* Return the sector in the journal that is after the area read */
+/* or 0 on error */
+static PedSector
+hfsj_journal_read(PedGeometry* geom, HfsJJournalHeader* jh,
+ PedSector journ_sect, PedSector journ_length,
+ PedSector read_sect, unsigned int nb_sect,
+ void* buf)
+{
+ int r;
+
+ while (nb_sect--) {
+ r = ped_geometry_read(geom, buf, journ_sect + read_sect, 1);
+ if (!r) return 0;
+
+ buf = ((uint8_t*)buf) + PED_SECTOR_SIZE_DEFAULT;
+ read_sect++;
+ if (read_sect == journ_length)
+ read_sect = 1; /* skip journal header
+ which is asserted to be
+ 1 sector long */
+ }
+
+ return read_sect;
+}
+
+static int
+hfsj_replay_transaction(PedFileSystem* fs, HfsJJournalHeader* jh,
+ PedSector jsector, PedSector jlength)
+{
+ PedSector start, sector;
+ HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*)
+ fs->type_specific;
+ HfsJBlockListHeader* blhdr;
+ uint8_t* block;
+ unsigned int blhdr_nbsect;
+ int i, r;
+ uint32_t cksum, size;
+
+ blhdr_nbsect = PED_BE32_TO_CPU(jh->blhdr_size) / PED_SECTOR_SIZE_DEFAULT;
+ blhdr = (HfsJBlockListHeader*)
+ ped_malloc (blhdr_nbsect * PED_SECTOR_SIZE_DEFAULT);
+ if (!blhdr) return 0;
+
+ start = PED_BE64_TO_CPU(jh->start) / PED_SECTOR_SIZE_DEFAULT;
+ do {
+ start = hfsj_journal_read(priv_data->plus_geom, jh, jsector,
+ jlength, start, blhdr_nbsect, blhdr);
+ if (!start) goto err_replay;
+
+ cksum = PED_BE32_TO_CPU(blhdr->checksum);
+ blhdr->checksum = 0;
+ if (cksum!=hfsj_calc_checksum((uint8_t*)blhdr, sizeof(*blhdr))){
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Bad block list header checksum."));
+ goto err_replay;
+ }
+ blhdr->checksum = PED_CPU_TO_BE32(cksum);
+
+ for (i=1; i < PED_BE16_TO_CPU(blhdr->num_blocks); ++i) {
+ size = PED_BE32_TO_CPU(blhdr->binfo[i].bsize);
+ sector = PED_BE64_TO_CPU(blhdr->binfo[i].bnum);
+ if (!size) continue;
+ if (size % PED_SECTOR_SIZE_DEFAULT) {
+ ped_exception_throw(
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Invalid size of a transaction "
+ "block while replaying the journal "
+ "(%i bytes)."),
+ size);
+ goto err_replay;
+ }
+ block = (uint8_t*) ped_malloc(size);
+ if (!block) goto err_replay;
+ start = hfsj_journal_read(priv_data->plus_geom, jh,
+ jsector, jlength, start,
+ size / PED_SECTOR_SIZE_DEFAULT,
+ block);
+ if (!start) {
+ ped_free (block);
+ goto err_replay;
+ }
+ /* the sector stored in the journal seems to be
+ relative to the begin of the block device which
+ contains the hfs+ journaled volume */
+ if (sector != ~0LL)
+ r = ped_geometry_write (fs->geom, block, sector,
+ size / PED_SECTOR_SIZE_DEFAULT);
+ else
+ r = 1;
+ ped_free (block);
+ /* check if wrapper mdb or vh with no wrapper has
+ changed */
+ if ( (sector != ~0LL)
+ && (2 >= sector)
+ && (2 < sector + size / PED_SECTOR_SIZE_DEFAULT) )
+ hfsj_vh_replayed = 1;
+ /* check if vh of embedded hfs+ has changed */
+ if ( (sector != ~0LL)
+ && (priv_data->plus_geom != fs->geom)
+ && (sector
+ + fs->geom->start
+ - priv_data->plus_geom->start <= 2)
+ && (sector
+ + size / PED_SECTOR_SIZE_DEFAULT
+ + fs->geom->start
+ - priv_data->plus_geom->start > 2) )
+ hfsj_vh_replayed = 1;
+ if (!r) goto err_replay;
+ }
+ } while (blhdr->binfo[0].next);
+
+ jh->start = PED_CPU_TO_BE64(start * PED_SECTOR_SIZE_DEFAULT);
+
+ ped_free (blhdr);
+ return (ped_geometry_sync (fs->geom));
+
+err_replay:
+ ped_free (blhdr);
+ return 0;
+}
+
+/* 0 => Failure, don't continue to open ! */
+/* 1 => Success, the journal has been completly replayed, or don't need to */
+int
+hfsj_replay_journal(PedFileSystem* fs)
+{
+ uint8_t buf[PED_SECTOR_SIZE_DEFAULT];
+ PedSector sector, length;
+ HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*)
+ fs->type_specific;
+ HfsJJournalInfoBlock* jib;
+ HfsJJournalHeader* jh;
+ int binsect;
+ uint32_t cksum;
+
+ binsect = PED_BE32_TO_CPU(priv_data->vh->block_size) / PED_SECTOR_SIZE_DEFAULT;
+ priv_data->jib_start_block =
+ PED_BE32_TO_CPU(priv_data->vh->journal_info_block);
+ sector = (PedSector) priv_data->jib_start_block * binsect;
+ if (!ped_geometry_read(priv_data->plus_geom, buf, sector, 1))
+ return 0;
+ jib = (HfsJJournalInfoBlock*) buf;
+
+ if ( (jib->flags & PED_CPU_TO_BE32(1 << HFSJ_JOURN_IN_FS))
+ && !(jib->flags & PED_CPU_TO_BE32(1 << HFSJ_JOURN_OTHER_DEV)) ) {
+ priv_data->jl_start_block = PED_BE64_TO_CPU(jib->offset)
+ / ( PED_SECTOR_SIZE_DEFAULT * binsect );
+ }
+
+ if (jib->flags & PED_CPU_TO_BE32(1 << HFSJ_JOURN_NEED_INIT))
+ return 1;
+
+ if ( !(jib->flags & PED_CPU_TO_BE32(1 << HFSJ_JOURN_IN_FS))
+ || (jib->flags & PED_CPU_TO_BE32(1 << HFSJ_JOURN_OTHER_DEV)) ) {
+ ped_exception_throw (
+ PED_EXCEPTION_NO_FEATURE,
+ PED_EXCEPTION_CANCEL,
+ _("Journal stored outside of the volume are "
+ "not supported. Try to desactivate the "
+ "journal and run Parted again."));
+ return 0;
+ }
+
+ if ( (PED_BE64_TO_CPU(jib->offset) % PED_SECTOR_SIZE_DEFAULT)
+ || (PED_BE64_TO_CPU(jib->size) % PED_SECTOR_SIZE_DEFAULT) ) {
+ ped_exception_throw (
+ PED_EXCEPTION_NO_FEATURE,
+ PED_EXCEPTION_CANCEL,
+ _("Journal offset or size is not multiple of "
+ "the sector size."));
+ return 0;
+ }
+
+ sector = PED_BE64_TO_CPU(jib->offset) / PED_SECTOR_SIZE_DEFAULT;
+ length = PED_BE64_TO_CPU(jib->size) / PED_SECTOR_SIZE_DEFAULT;
+
+ jib = NULL;
+ if (!ped_geometry_read(priv_data->plus_geom, buf, sector, 1))
+ return 0;
+ jh = (HfsJJournalHeader*) buf;
+
+ if ( (jh->magic != PED_BE32_TO_CPU(HFSJ_HEADER_MAGIC))
+ || (jh->endian != PED_BE32_TO_CPU(HFSJ_ENDIAN_MAGIC)) ) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Incorrect magic values in the journal header."));
+ return 0;
+ }
+
+ if ( (PED_BE64_TO_CPU(jh->size)%PED_SECTOR_SIZE_DEFAULT)
+ || (PED_BE64_TO_CPU(jh->size)/PED_SECTOR_SIZE_DEFAULT
+ != (uint64_t)length) ) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Journal size mismatch between journal info block "
+ "and journal header."));
+ return 0;
+ }
+
+ if ( (PED_BE64_TO_CPU(jh->start) % PED_SECTOR_SIZE_DEFAULT)
+ || (PED_BE64_TO_CPU(jh->end) % PED_SECTOR_SIZE_DEFAULT)
+ || (PED_BE32_TO_CPU(jh->blhdr_size) % PED_SECTOR_SIZE_DEFAULT)
+ || (PED_BE32_TO_CPU(jh->jhdr_size) % PED_SECTOR_SIZE_DEFAULT) ) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Some header fields are not multiple of the sector "
+ "size."));
+ return 0;
+ }
+
+ if (PED_BE32_TO_CPU(jh->jhdr_size) != PED_SECTOR_SIZE_DEFAULT) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("The sector size stored in the journal is not 512 "
+ "bytes. Parted only supports 512 bytes length "
+ "sectors."));
+ return 0;
+ }
+
+ cksum = PED_BE32_TO_CPU(jh->checksum);
+ jh->checksum = 0;
+ if (cksum != hfsj_calc_checksum((uint8_t*)jh, sizeof(*jh))) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Bad journal checksum."));
+ return 0;
+ }
+ jh->checksum = PED_CPU_TO_BE32(cksum);
+
+ /* The 2 following test are in the XNU Darwin source code */
+ /* so I assume they're needed */
+ if (jh->start == jh->size)
+ jh->start = PED_CPU_TO_BE64(PED_SECTOR_SIZE_DEFAULT);
+ if (jh->end == jh->size)
+ jh->start = PED_CPU_TO_BE64(PED_SECTOR_SIZE_DEFAULT);
+
+ if (jh->start == jh->end)
+ return 1;
+
+ if (ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_FIX | PED_EXCEPTION_CANCEL,
+ _("The journal is not empty. Parted must replay the "
+ "transactions before opening the file system. This will "
+ "modify the file system."))
+ != PED_EXCEPTION_FIX)
+ return 0;
+
+ while (jh->start != jh->end) {
+ /* Replay one complete transaction */
+ if (!hfsj_replay_transaction(fs, jh, sector, length))
+ return 0;
+
+ /* Recalculate cksum of the journal header */
+ jh->checksum = 0; /* need to be 0 while calculating the cksum */
+ cksum = hfsj_calc_checksum((uint8_t*)jh, sizeof(*jh));
+ jh->checksum = PED_CPU_TO_BE32(cksum);
+
+ /* Update the Journal Header */
+ if (!ped_geometry_write(priv_data->plus_geom, buf, sector, 1)
+ || !ped_geometry_sync(priv_data->plus_geom))
+ return 0;
+ }
+
+ if (hfsj_vh_replayed) {
+ /* probe could have reported incorrect info ! */
+ /* is there a way to ask parted to quit ? */
+ ped_exception_throw(
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_OK,
+ _("The volume header or the master directory block has "
+ "changed while replaying the journal. You should "
+ "restart Parted."));
+ return 0;
+ }
+
+ return 1;
+}
+
+#endif /* DISCOVER_ONLY */
diff --git a/libparted/fs/hfs/journal.h b/libparted/fs/hfs/journal.h
new file mode 100644
index 0000000..c0e2ead
--- /dev/null
+++ b/libparted/fs/hfs/journal.h
@@ -0,0 +1,38 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2004 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef _JOURNAL_H
+#define _JOURNAL_H
+
+#include <parted/parted.h>
+#include <parted/endian.h>
+#include <parted/debug.h>
+
+#include "hfs.h"
+
+int
+hfsj_replay_journal(PedFileSystem* fs);
+
+int
+hfsj_update_jib(PedFileSystem* fs, uint32_t block);
+
+int
+hfsj_update_jl(PedFileSystem* fs, uint32_t block);
+
+#endif /* _JOURNAL_H */
diff --git a/libparted/fs/hfs/probe.c b/libparted/fs/hfs/probe.c
new file mode 100644
index 0000000..3fd9ef7
--- /dev/null
+++ b/libparted/fs/hfs/probe.c
@@ -0,0 +1,232 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#include "config.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <parted/parted.h>
+#include <parted/endian.h>
+#include <parted/debug.h>
+#include <stdint.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+#include "hfs.h"
+
+#include "probe.h"
+
+int
+hfsc_can_use_geom (PedGeometry* geom)
+{
+ PedDevice* dev;
+
+ PED_ASSERT (geom != NULL, return 0);
+ PED_ASSERT ((dev = geom->dev) != NULL, return 0);
+
+ if (dev->sector_size != PED_SECTOR_SIZE_DEFAULT) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Parted can't use HFS file systems on disks "
+ "with a sector size not equal to %d bytes."),
+ (int)PED_SECTOR_SIZE_DEFAULT );
+ return 0;
+ }
+
+ return 1;
+}
+
+/* Probe an HFS volume, detecting it even if
+it is in fact a wrapper to an HFS+ volume */
+/* Used by hfsplus_probe and hfs_probe */
+PedGeometry*
+hfs_and_wrapper_probe (PedGeometry* geom)
+{
+ uint8_t buf[PED_SECTOR_SIZE_DEFAULT];
+ HfsMasterDirectoryBlock *mdb;
+ PedGeometry* geom_ret;
+ PedSector search, max;
+
+ PED_ASSERT (geom != NULL, return NULL);
+ PED_ASSERT (hfsc_can_use_geom (geom), return NULL);
+
+ mdb = (HfsMasterDirectoryBlock *) buf;
+
+ /* is 5 an intelligent value ? */
+ if ((geom->length < 5)
+ || (!ped_geometry_read (geom, buf, 2, 1))
+ || (mdb->signature != PED_CPU_TO_BE16 (HFS_SIGNATURE)) )
+ return NULL;
+
+ search = ((PedSector) PED_BE16_TO_CPU (mdb->start_block)
+ + ((PedSector) PED_BE16_TO_CPU (mdb->total_blocks)
+ * (PED_BE32_TO_CPU (mdb->block_size) / PED_SECTOR_SIZE_DEFAULT )));
+ max = search + (PED_BE32_TO_CPU (mdb->block_size) / PED_SECTOR_SIZE_DEFAULT);
+ if (!(geom_ret = ped_geometry_new (geom->dev, geom->start, search + 2)))
+ return NULL;
+
+ for (; search < max; search++) {
+ if (!ped_geometry_set (geom_ret, geom_ret->start, search + 2)
+ || !ped_geometry_read (geom_ret, buf, search, 1))
+ break;
+ if (mdb->signature == PED_CPU_TO_BE16 (HFS_SIGNATURE))
+ return geom_ret;
+ }
+
+ ped_geometry_destroy (geom_ret);
+ return NULL;
+}
+
+PedGeometry*
+hfsplus_probe (PedGeometry* geom)
+{
+ PedGeometry* geom_ret;
+ uint8_t buf[PED_SECTOR_SIZE_DEFAULT];
+
+ PED_ASSERT (geom != NULL, return NULL);
+
+ if (!hfsc_can_use_geom (geom))
+ return NULL;
+
+ if ((geom_ret = hfs_and_wrapper_probe(geom))) {
+ /* HFS+ is embedded in an HFS volume ? */
+ HfsMasterDirectoryBlock *mdb;
+ mdb = (HfsMasterDirectoryBlock *) buf;
+
+ if (!ped_geometry_read (geom, buf, 2, 1)
+ || (mdb->old_new.embedded.signature
+ != PED_CPU_TO_BE16 (HFSP_SIGNATURE))) {
+ ped_geometry_destroy (geom_ret);
+ return NULL;
+ } else
+ return geom_ret;
+ } else {
+ /* This is a standalone HFS+ volume ? */
+ PedSector search, max;
+ HfsPVolumeHeader *vh;
+ vh = (HfsPVolumeHeader *) buf;
+
+ if ((geom->length < 5)
+ || !ped_geometry_read (geom, buf, 2, 1)
+ || (vh->signature != PED_CPU_TO_BE16 (HFSP_SIGNATURE)))
+ return NULL;
+
+ /* Correct range is indeed [ blocks*sz-2;(blocs+1)*sz-2 ( */
+ /* But previous versions of my implementation used to */
+ /* assume range is [(blocks-1)*sz-1;(blocks*sz) ( */
+ /* (blocks-1)*sz-1 has to be scanned last, because */
+ /* it can belong to a regular file */
+ max = ((PedSector) PED_BE32_TO_CPU (vh->total_blocks) + 1)
+ * ( PED_BE32_TO_CPU (vh->block_size) / PED_SECTOR_SIZE_DEFAULT )
+ - 2;
+ search = max - 2 * ( PED_BE32_TO_CPU (vh->block_size)
+ / PED_SECTOR_SIZE_DEFAULT ) + 2;
+ if (!(geom_ret = ped_geometry_new (geom->dev, geom->start,
+ search + 2)))
+ return NULL;
+
+ for (; search < max; search++) {
+ if (!ped_geometry_set (geom_ret, geom_ret->start,
+ search + 2)
+ || !ped_geometry_read (geom_ret, buf, search, 1))
+ break;
+ if (vh->signature == PED_CPU_TO_BE16 (HFSP_SIGNATURE))
+ return geom_ret;
+ }
+ search = ((PedSector) PED_BE32_TO_CPU (vh->total_blocks) - 1)
+ * ( PED_BE32_TO_CPU (vh->block_size) / PED_SECTOR_SIZE_DEFAULT )
+ - 1;
+ if (!ped_geometry_set (geom_ret, geom_ret->start,
+ search + 2)
+ || !ped_geometry_read (geom_ret, buf, search, 1)
+ || vh->signature != PED_CPU_TO_BE16 (HFSP_SIGNATURE)) {
+ ped_geometry_destroy (geom_ret);
+ return NULL;
+ } else
+ return geom_ret;
+ }
+}
+
+PedGeometry*
+hfs_probe (PedGeometry* geom)
+{
+ PedGeometry* geom_base;
+ PedGeometry* geom_plus = NULL;
+
+ PED_ASSERT (geom != NULL, return NULL);
+
+ if (!hfsc_can_use_geom (geom))
+ return NULL;
+
+ if ((geom_base = hfs_and_wrapper_probe(geom))
+ && (!(geom_plus = hfsplus_probe(geom_base))))
+ return geom_base;
+ else {
+ if (geom_base) ped_geometry_destroy (geom_base);
+ if (geom_plus) ped_geometry_destroy (geom_plus);
+ return NULL;
+ }
+}
+
+PedGeometry*
+hfsx_probe (PedGeometry* geom)
+{
+ PedGeometry* geom_ret;
+ uint8_t buf[PED_SECTOR_SIZE_DEFAULT];
+ PedSector search, max;
+ HfsPVolumeHeader *vh = (HfsPVolumeHeader *) buf;
+
+ PED_ASSERT (geom != NULL, return NULL);
+
+ if (!hfsc_can_use_geom (geom))
+ return NULL;
+
+ if ((geom->length < 5)
+ || !ped_geometry_read (geom, buf, 2, 1)
+ || (vh->signature != PED_CPU_TO_BE16 (HFSX_SIGNATURE)))
+ return NULL;
+
+ /* unlike the hfs+ code, which should be kept compatible
+ with my old previous implementations, we only care here
+ about legal alternate VH positions, like TN1150 describes them */
+ max = ((PedSector) PED_BE32_TO_CPU (vh->total_blocks) + 1)
+ * ( PED_BE32_TO_CPU (vh->block_size) / PED_SECTOR_SIZE_DEFAULT )
+ - 2;
+ search = max - ( PED_BE32_TO_CPU (vh->block_size) / PED_SECTOR_SIZE_DEFAULT );
+ if (!(geom_ret = ped_geometry_new (geom->dev, geom->start,
+ search + 2)))
+ return NULL;
+ for (; search < max; search++) {
+ if (!ped_geometry_set (geom_ret, geom_ret->start,
+ search + 2)
+ || !ped_geometry_read (geom_ret, buf, search, 1))
+ break;
+ if (vh->signature == PED_CPU_TO_BE16 (HFSX_SIGNATURE))
+ return geom_ret;
+ }
+
+ ped_geometry_destroy (geom_ret);
+ return NULL;
+}
diff --git a/libparted/fs/hfs/probe.h b/libparted/fs/hfs/probe.h
new file mode 100644
index 0000000..3001006
--- /dev/null
+++ b/libparted/fs/hfs/probe.h
@@ -0,0 +1,44 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef _PROBE_H
+#define _PROBE_H
+
+#include <parted/parted.h>
+#include <parted/endian.h>
+#include <parted/debug.h>
+
+#include "hfs.h"
+
+int
+hfsc_can_use_geom (PedGeometry* geom);
+
+PedGeometry*
+hfs_and_wrapper_probe (PedGeometry* geom);
+
+PedGeometry*
+hfsplus_probe (PedGeometry* geom);
+
+PedGeometry*
+hfs_probe (PedGeometry* geom);
+
+PedGeometry*
+hfsx_probe (PedGeometry* geom);
+
+#endif /* _PROBE_H */
diff --git a/libparted/fs/hfs/reloc.c b/libparted/fs/hfs/reloc.c
new file mode 100644
index 0000000..29c2f32
--- /dev/null
+++ b/libparted/fs/hfs/reloc.c
@@ -0,0 +1,673 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef DISCOVER_ONLY
+
+#include "config.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <parted/parted.h>
+#include <parted/endian.h>
+#include <parted/debug.h>
+#include <stdint.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+#include "hfs.h"
+#include "file.h"
+#include "advfs.h"
+#include "cache.h"
+
+#include "reloc.h"
+
+/* This function moves data of size blocks starting
+ at block *ptr_fblock to block *ptr_to_fblock */
+/* return new start or -1 on failure */
+static int
+hfs_effect_move_extent (PedFileSystem *fs, unsigned int *ptr_fblock,
+ unsigned int *ptr_to_fblock, unsigned int size)
+{
+ HfsPrivateFSData* priv_data = (HfsPrivateFSData*)
+ fs->type_specific;
+ unsigned int i, ok = 0;
+ unsigned int next_to_fblock;
+ unsigned int start, stop;
+
+ PED_ASSERT (hfs_block != NULL, return -1);
+ PED_ASSERT (*ptr_to_fblock <= *ptr_fblock, return -1);
+ /* quiet gcc */
+ next_to_fblock = start = stop = 0;
+
+/*
+ Try to fit the extent AT or _BEFORE_ the wanted place,
+ or then in the gap between dest and source.
+ If failed try to fit the extent after source, for 2 pass relocation
+ The extent is always copied in a non overlapping way
+*/
+
+ /* Backward search */
+ /* 1 pass relocation AT or BEFORE *ptr_to_fblock */
+ if (*ptr_to_fblock != *ptr_fblock) {
+ start = stop = *ptr_fblock < *ptr_to_fblock+size ?
+ *ptr_fblock : *ptr_to_fblock+size;
+ while (start && stop-start != size) {
+ --start;
+ if (TST_BLOC_OCCUPATION(priv_data->alloc_map,start))
+ stop = start;
+ }
+ ok = (stop-start == size);
+ }
+
+ /* Forward search */
+ /* 1 pass relocation in the gap merged with 2 pass reloc after source */
+ if (!ok && *ptr_to_fblock != *ptr_fblock) {
+ start = stop = *ptr_to_fblock+1;
+ while (stop < PED_BE16_TO_CPU(priv_data->mdb->total_blocks)
+ && stop-start != size) {
+ if (TST_BLOC_OCCUPATION(priv_data->alloc_map,stop))
+ start = stop + 1;
+ ++stop;
+ }
+ ok = (stop-start == size);
+ }
+
+ /* new non overlapping room has been found ? */
+ if (ok) {
+ /* enough room */
+ unsigned int j;
+ unsigned int start_block =
+ PED_BE16_TO_CPU (priv_data->mdb->start_block );
+ unsigned int block_sz =
+ (PED_BE32_TO_CPU (priv_data->mdb->block_size)
+ / PED_SECTOR_SIZE_DEFAULT);
+
+ if (stop > *ptr_to_fblock && stop <= *ptr_fblock)
+ /* Fit in the gap */
+ next_to_fblock = stop;
+ else
+ /* Before or after the gap */
+ next_to_fblock = *ptr_to_fblock;
+
+ /* move blocks */
+ for (i = 0; i < size; /*i+=j*/) {
+ PedSector abs_sector;
+ unsigned int ai;
+
+ j = size - i; j = (j < hfs_block_count) ?
+ j : hfs_block_count ;
+
+ abs_sector = start_block
+ + (PedSector) (*ptr_fblock + i) * block_sz;
+ if (!ped_geometry_read (fs->geom, hfs_block, abs_sector,
+ block_sz * j))
+ return -1;
+
+ abs_sector = start_block
+ + (PedSector) (start + i) * block_sz;
+ if (!ped_geometry_write (fs->geom,hfs_block,abs_sector,
+ block_sz * j))
+ return -1;
+
+ for (ai = i+j; i < ai; i++) {
+ /* free source block */
+ CLR_BLOC_OCCUPATION(priv_data->alloc_map,
+ *ptr_fblock + i);
+
+ /* set dest block */
+ SET_BLOC_OCCUPATION(priv_data->alloc_map,
+ start + i);
+ }
+ }
+ if (!ped_geometry_sync_fast (fs->geom))
+ return -1;
+
+ *ptr_fblock += size;
+ *ptr_to_fblock = next_to_fblock;
+ } else {
+ if (*ptr_fblock != *ptr_to_fblock)
+ /* not enough room, but try to continue */
+ ped_exception_throw (PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_IGNORE,
+ _("An extent has not been relocated."));
+ start = *ptr_fblock;
+ *ptr_fblock = *ptr_to_fblock = start + size;
+ }
+
+ return start;
+}
+
+/* Update MDB */
+/* Return 0 if an error occurred */
+/* Return 1 if everything ok */
+int
+hfs_update_mdb (PedFileSystem *fs)
+{
+ HfsPrivateFSData* priv_data = (HfsPrivateFSData*)
+ fs->type_specific;
+ uint8_t node[PED_SECTOR_SIZE_DEFAULT];
+
+ if (!ped_geometry_read (fs->geom, node, 2, 1))
+ return 0;
+ memcpy (node, priv_data->mdb, sizeof (HfsMasterDirectoryBlock));
+ if ( !ped_geometry_write (fs->geom, node, 2, 1)
+ || !ped_geometry_write (fs->geom, node, fs->geom->length - 2, 1)
+ || !ped_geometry_sync_fast (fs->geom))
+ return 0;
+ return 1;
+}
+
+/* Generic relocator */
+/* replace previous hfs_do_move_* */
+static int
+hfs_do_move (PedFileSystem* fs, unsigned int *ptr_src,
+ unsigned int *ptr_dest, HfsCPrivateCache* cache,
+ HfsCPrivateExtent* ref)
+{
+ uint8_t node[PED_SECTOR_SIZE_DEFAULT];
+ HfsPrivateFSData* priv_data = (HfsPrivateFSData*)
+ fs->type_specific;
+ HfsPrivateFile* file;
+ HfsExtDescriptor* extent;
+ HfsCPrivateExtent* move;
+ int new_start;
+
+ new_start = hfs_effect_move_extent (fs, ptr_src, ptr_dest,
+ ref->ext_length);
+ if (new_start == -1) return -1;
+
+ if (ref->ext_start != (unsigned) new_start) {
+ /* Load, modify & save */
+ switch (ref->where) {
+ /******** MDB *********/
+ case CR_PRIM_CAT :
+ priv_data->catalog_file
+ ->first[ref->ref_index].start_block =
+ PED_CPU_TO_BE16(new_start);
+ goto CR_PRIM;
+ case CR_PRIM_EXT :
+ priv_data->extent_file
+ ->first[ref->ref_index].start_block =
+ PED_CPU_TO_BE16(new_start);
+ CR_PRIM :
+ extent = ( HfsExtDescriptor* )
+ ( (uint8_t*)priv_data->mdb + ref->ref_offset );
+ extent[ref->ref_index].start_block =
+ PED_CPU_TO_BE16(new_start);
+ if (!hfs_update_mdb(fs)) return -1;
+ break;
+
+ /********* BTREE *******/
+ case CR_BTREE_EXT_CAT :
+ if (priv_data->catalog_file
+ ->cache[ref->ref_index].start_block
+ == PED_CPU_TO_BE16(ref->ext_start))
+ priv_data->catalog_file
+ ->cache[ref->ref_index].start_block =
+ PED_CPU_TO_BE16(new_start);
+ case CR_BTREE_EXT_0 :
+ file = priv_data->extent_file;
+ goto CR_BTREE;
+ case CR_BTREE_CAT :
+ file = priv_data->catalog_file;
+ CR_BTREE:
+ PED_ASSERT(ref->sect_by_block == 1
+ && ref->ref_offset < PED_SECTOR_SIZE_DEFAULT,
+ return -1);
+ if (!hfs_file_read_sector(file, node, ref->ref_block))
+ return -1;
+ extent = ( HfsExtDescriptor* ) (node + ref->ref_offset);
+ extent[ref->ref_index].start_block =
+ PED_CPU_TO_BE16(new_start);
+ if (!hfs_file_write_sector(file, node, ref->ref_block)
+ || !ped_geometry_sync_fast (fs->geom))
+ return -1;
+ break;
+
+ /********** BUG ********/
+ default :
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("A reference to an extent comes from a place "
+ "it should not. You should check the file "
+ "system!"));
+ return -1;
+ break;
+ }
+
+ /* Update the cache */
+ move = hfsc_cache_move_extent(cache, ref->ext_start, new_start);
+ if (!move) return -1; /* "cleanly" fail */
+ PED_ASSERT(move == ref, return -1); /* generate a bug */
+ }
+
+ return new_start;
+}
+
+/* 0 error, 1 ok */
+static int
+hfs_save_allocation(PedFileSystem* fs)
+{
+ HfsPrivateFSData* priv_data = (HfsPrivateFSData*)
+ fs->type_specific;
+ unsigned int map_sectors;
+
+ map_sectors = ( PED_BE16_TO_CPU (priv_data->mdb->total_blocks)
+ + PED_SECTOR_SIZE_DEFAULT * 8 - 1 )
+ / (PED_SECTOR_SIZE_DEFAULT * 8);
+ return ( ped_geometry_write (fs->geom, priv_data->alloc_map,
+ PED_BE16_TO_CPU (priv_data->mdb->volume_bitmap_block),
+ map_sectors) );
+}
+
+/* This function moves an extent starting at block fblock to block to_fblock
+ if there's enough room */
+/* Return 1 if everything was fine */
+/* Return -1 if an error occurred */
+/* Return 0 if no extent was found */
+/* Generic search thanks to the file system cache */
+static int
+hfs_move_extent_starting_at (PedFileSystem *fs, unsigned int *ptr_fblock,
+ unsigned int *ptr_to_fblock,
+ HfsCPrivateCache* cache)
+{
+ HfsCPrivateExtent* ref;
+ unsigned int old_start, new_start;
+
+ /* Reference search powered by the cache... */
+ /* This is the optimisation secret :) */
+ ref = hfsc_cache_search_extent(cache, *ptr_fblock);
+ if (!ref) return 0; /* not found */
+
+ old_start = *ptr_fblock;
+ new_start = hfs_do_move(fs, ptr_fblock, ptr_to_fblock, cache, ref);
+ if (new_start == (unsigned int) -1) return -1;
+ if (new_start > old_start) { /* detect 2 pass reloc */
+ new_start = hfs_do_move(fs,&new_start,ptr_to_fblock,cache,ref);
+ if (new_start == (unsigned int) -1 || new_start > old_start)
+ return -1;
+ }
+
+ /* allocation bitmap save is not atomic with data relocation */
+ /* so we only do it a few times, and without syncing */
+ /* The unmounted bit protect us anyway */
+ hfs_save_allocation(fs);
+ return 1;
+}
+
+static int
+hfs_cache_from_mdb(HfsCPrivateCache* cache, PedFileSystem* fs,
+ PedTimer* timer)
+{
+ HfsPrivateFSData* priv_data = (HfsPrivateFSData*)
+ fs->type_specific;
+ HfsExtDescriptor* extent;
+ unsigned int j;
+
+ extent = priv_data->mdb->extents_file_rec;
+ for (j = 0; j < HFS_EXT_NB; ++j) {
+ if (!extent[j].block_count) break;
+ if (!hfsc_cache_add_extent(
+ cache,
+ PED_BE16_TO_CPU(extent[j].start_block),
+ PED_BE16_TO_CPU(extent[j].block_count),
+ 0, /* unused for mdb */
+ ((uint8_t*)extent) - ((uint8_t*)priv_data->mdb),
+ 1, /* load/save only 1 sector */
+ CR_PRIM_EXT,
+ j )
+ )
+ return 0;
+ }
+
+ extent = priv_data->mdb->catalog_file_rec;
+ for (j = 0; j < HFS_EXT_NB; ++j) {
+ if (!extent[j].block_count) break;
+ if (!hfsc_cache_add_extent(
+ cache,
+ PED_BE16_TO_CPU(extent[j].start_block),
+ PED_BE16_TO_CPU(extent[j].block_count),
+ 0,
+ ((uint8_t*)extent) - ((uint8_t*)priv_data->mdb),
+ 1,
+ CR_PRIM_CAT,
+ j )
+ )
+ return 0;
+ }
+
+ return 1;
+}
+
+static int
+hfs_cache_from_catalog(HfsCPrivateCache* cache, PedFileSystem* fs,
+ PedTimer* timer)
+{
+ HfsPrivateFSData* priv_data = (HfsPrivateFSData*)
+ fs->type_specific;
+ uint8_t node[PED_SECTOR_SIZE_DEFAULT];
+ HfsHeaderRecord* header;
+ HfsNodeDescriptor* desc = (HfsNodeDescriptor*) node;
+ HfsCatalogKey* catalog_key;
+ HfsCatalog* catalog_data;
+ HfsExtDescriptor* extent;
+ unsigned int leaf_node, record_number;
+ unsigned int i, j;
+
+ if (!priv_data->catalog_file->sect_nb) {
+ ped_exception_throw (
+ PED_EXCEPTION_INFORMATION,
+ PED_EXCEPTION_OK,
+ _("This HFS volume has no catalog file. "
+ "This is very unusual!"));
+ return 1;
+ }
+
+ if (!hfs_file_read_sector (priv_data->catalog_file, node, 0))
+ return 0;
+ header = (HfsHeaderRecord*)(node + PED_BE16_TO_CPU(*((uint16_t*)
+ (node+(PED_SECTOR_SIZE_DEFAULT-2)))));
+
+ for (leaf_node = PED_BE32_TO_CPU (header->first_leaf_node);
+ leaf_node;
+ leaf_node = PED_BE32_TO_CPU (desc->next)) {
+ if (!hfs_file_read_sector (priv_data->catalog_file,
+ node, leaf_node))
+ return 0;
+ record_number = PED_BE16_TO_CPU (desc->rec_nb);
+ for (i = 1; i <= record_number; ++i) {
+ /* undocumented alignement */
+ unsigned int skip;
+ catalog_key = (HfsCatalogKey*) (node + PED_BE16_TO_CPU(
+ *((uint16_t*)(node+(PED_SECTOR_SIZE_DEFAULT - 2*i)))));
+ skip = (1 + catalog_key->key_length + 1) & ~1;
+ catalog_data = (HfsCatalog*)( ((uint8_t*)catalog_key)
+ + skip );
+ /* check for obvious error in FS */
+ if (((uint8_t*)catalog_key - node < HFS_FIRST_REC)
+ || ((uint8_t*)catalog_data - node
+ >= PED_SECTOR_SIZE_DEFAULT
+ - 2 * (signed)(record_number+1))) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("The file system contains errors."));
+ return 0;
+ }
+
+ if (catalog_data->type != HFS_CAT_FILE) continue;
+
+ extent = catalog_data->sel.file.extents_data;
+ for (j = 0; j < HFS_EXT_NB; ++j) {
+ if (!extent[j].block_count) break;
+ if (!hfsc_cache_add_extent(
+ cache,
+ PED_BE16_TO_CPU(extent[j].start_block),
+ PED_BE16_TO_CPU(extent[j].block_count),
+ leaf_node,
+ (uint8_t*)extent - node,
+ 1, /* hfs => btree block = 512 b */
+ CR_BTREE_CAT,
+ j )
+ )
+ return 0;
+ }
+
+ extent = catalog_data->sel.file.extents_res;
+ for (j = 0; j < HFS_EXT_NB; ++j) {
+ if (!extent[j].block_count) break;
+ if (!hfsc_cache_add_extent(
+ cache,
+ PED_BE16_TO_CPU(extent[j].start_block),
+ PED_BE16_TO_CPU(extent[j].block_count),
+ leaf_node,
+ (uint8_t*)extent - node,
+ 1, /* hfs => btree block = 512 b */
+ CR_BTREE_CAT,
+ j )
+ )
+ return 0;
+ }
+ }
+ }
+
+ return 1;
+}
+
+static int
+hfs_cache_from_extent(HfsCPrivateCache* cache, PedFileSystem* fs,
+ PedTimer* timer)
+{
+ HfsPrivateFSData* priv_data = (HfsPrivateFSData*)
+ fs->type_specific;
+ uint8_t node[PED_SECTOR_SIZE_DEFAULT];
+ HfsHeaderRecord* header;
+ HfsNodeDescriptor* desc = (HfsNodeDescriptor*) node;
+ HfsExtentKey* extent_key;
+ HfsExtDescriptor* extent;
+ unsigned int leaf_node, record_number;
+ unsigned int i, j;
+
+ if (!priv_data->extent_file->sect_nb) {
+ ped_exception_throw (
+ PED_EXCEPTION_INFORMATION,
+ PED_EXCEPTION_OK,
+ _("This HFS volume has no extents overflow "
+ "file. This is quite unusual!"));
+ return 1;
+ }
+
+ if (!hfs_file_read_sector (priv_data->extent_file, node, 0))
+ return 0;
+ header = ((HfsHeaderRecord*) (node + PED_BE16_TO_CPU(*((uint16_t *)
+ (node+(PED_SECTOR_SIZE_DEFAULT-2))))));
+
+ for (leaf_node = PED_BE32_TO_CPU (header->first_leaf_node);
+ leaf_node;
+ leaf_node = PED_BE32_TO_CPU (desc->next)) {
+ if (!hfs_file_read_sector (priv_data->extent_file, node,
+ leaf_node))
+ return 0;
+ record_number = PED_BE16_TO_CPU (desc->rec_nb);
+ for (i = 1; i <= record_number; i++) {
+ uint8_t where;
+ extent_key = (HfsExtentKey*)
+ (node + PED_BE16_TO_CPU(*((uint16_t *)
+ (node+(PED_SECTOR_SIZE_DEFAULT - 2*i)))));
+ /* size is cst */
+ extent = (HfsExtDescriptor*)(((uint8_t*)extent_key)
+ + sizeof (HfsExtentKey));
+ /* check for obvious error in FS */
+ if (((uint8_t*)extent_key - node < HFS_FIRST_REC)
+ || ((uint8_t*)extent - node
+ >= PED_SECTOR_SIZE_DEFAULT
+ - 2 * (signed)(record_number+1))) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("The file system contains errors."));
+ return 0;
+ }
+
+ switch (extent_key->file_ID) {
+ case PED_CPU_TO_BE32 (HFS_XTENT_ID) :
+ if (ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("The extents overflow file should not"
+ " contain its own extents! You "
+ "should check the file system."))
+ != PED_EXCEPTION_IGNORE)
+ return 0;
+ where = CR_BTREE_EXT_EXT;
+ break;
+ case PED_CPU_TO_BE32 (HFS_CATALOG_ID) :
+ where = CR_BTREE_EXT_CAT;
+ break;
+ default :
+ where = CR_BTREE_EXT_0;
+ break;
+ }
+
+ for (j = 0; j < HFS_EXT_NB; ++j) {
+ if (!extent[j].block_count) break;
+ if (!hfsc_cache_add_extent(
+ cache,
+ PED_BE16_TO_CPU(extent[j].start_block),
+ PED_BE16_TO_CPU(extent[j].block_count),
+ leaf_node,
+ (uint8_t*)extent - node,
+ 1, /* hfs => btree block = 512 b */
+ where,
+ j )
+ )
+ return 0;
+ }
+ }
+ }
+
+ return 1;
+}
+
+/* This function cache every extents start and length stored in any
+ fs structure into the adt defined in cache.[ch]
+ Returns NULL on failure */
+static HfsCPrivateCache*
+hfs_cache_extents(PedFileSystem *fs, PedTimer* timer)
+{
+ HfsPrivateFSData* priv_data = (HfsPrivateFSData*)
+ fs->type_specific;
+ HfsCPrivateCache* ret;
+ unsigned int file_number, block_number;
+
+ file_number = PED_BE32_TO_CPU(priv_data->mdb->file_count);
+ block_number = PED_BE16_TO_CPU(priv_data->mdb->total_blocks);
+ ret = hfsc_new_cache(block_number, file_number);
+ if (!ret) return NULL;
+
+ if (!hfs_cache_from_mdb(ret, fs, timer) ||
+ !hfs_cache_from_catalog(ret, fs, timer) ||
+ !hfs_cache_from_extent(ret, fs, timer)) {
+ ped_exception_throw(
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Could not cache the file system in memory."));
+ hfsc_delete_cache(ret);
+ return NULL;
+ }
+
+ return ret;
+}
+
+/* This function moves file's data to compact used and free space,
+ starting at fblock block */
+/* return 0 on error */
+int
+hfs_pack_free_space_from_block (PedFileSystem *fs, unsigned int fblock,
+ PedTimer* timer, unsigned int to_free)
+{
+ PedSector bytes_buff;
+ HfsPrivateFSData* priv_data = (HfsPrivateFSData*)
+ fs->type_specific;
+ HfsMasterDirectoryBlock* mdb = priv_data->mdb;
+ HfsCPrivateCache* cache;
+ unsigned int to_fblock = fblock;
+ unsigned int start = fblock;
+ unsigned int div = PED_BE16_TO_CPU (mdb->total_blocks)
+ + 1 - start - to_free;
+ int ret;
+
+ PED_ASSERT (!hfs_block, return 0);
+
+ cache = hfs_cache_extents (fs, timer);
+ if (!cache)
+ return 0;
+
+ /* Calculate the size of the copy buffer :
+ * Takes BLOCK_MAX_BUFF HFS blocks, but if > BYTES_MAX_BUFF
+ * takes the maximum number of HFS blocks so that the buffer
+ * will remain smaller than or equal to BYTES_MAX_BUFF, with
+ * a minimum of 1 HFS block */
+ bytes_buff = PED_BE32_TO_CPU (priv_data->mdb->block_size)
+ * (PedSector) BLOCK_MAX_BUFF;
+ if (bytes_buff > BYTES_MAX_BUFF) {
+ hfs_block_count = BYTES_MAX_BUFF
+ / PED_BE32_TO_CPU (priv_data->mdb->block_size);
+ if (!hfs_block_count)
+ hfs_block_count = 1;
+ bytes_buff = (PedSector) hfs_block_count
+ * PED_BE32_TO_CPU (priv_data->mdb->block_size);
+ } else
+ hfs_block_count = BLOCK_MAX_BUFF;
+
+ /* If the cache code requests more space, give it to him */
+ if (bytes_buff < hfsc_cache_needed_buffer (cache))
+ bytes_buff = hfsc_cache_needed_buffer (cache);
+
+ hfs_block = (uint8_t*) ped_malloc (bytes_buff);
+ if (!hfs_block)
+ goto error_cache;
+
+ if (!hfs_read_bad_blocks (fs)) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Bad blocks list could not be loaded."));
+ goto error_alloc;
+ }
+
+ while (fblock < PED_BE16_TO_CPU (mdb->total_blocks)) {
+ if (TST_BLOC_OCCUPATION(priv_data->alloc_map,fblock)
+ && (!hfs_is_bad_block (fs, fblock))) {
+ if (!(ret = hfs_move_extent_starting_at (fs, &fblock,
+ &to_fblock, cache)))
+ to_fblock = ++fblock;
+ else if (ret == -1) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("An error occurred during extent "
+ "relocation."));
+ goto error_alloc;
+ }
+ } else {
+ fblock++;
+ }
+
+ ped_timer_update(timer, (float)(to_fblock - start)/div);
+ }
+
+ ped_free (hfs_block); hfs_block = NULL; hfs_block_count = 0;
+ hfsc_delete_cache (cache);
+ return 1;
+
+error_alloc:
+ ped_free (hfs_block); hfs_block = NULL; hfs_block_count = 0;
+error_cache:
+ hfsc_delete_cache (cache);
+ return 0;
+}
+
+#endif /* !DISCOVER_ONLY */
diff --git a/libparted/fs/hfs/reloc.h b/libparted/fs/hfs/reloc.h
new file mode 100644
index 0000000..627dd0c
--- /dev/null
+++ b/libparted/fs/hfs/reloc.h
@@ -0,0 +1,36 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2004 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef _RELOC_H
+#define _RELOC_H
+
+#include <parted/parted.h>
+#include <parted/endian.h>
+#include <parted/debug.h>
+
+#include "hfs.h"
+
+int
+hfs_update_mdb (PedFileSystem *fs);
+
+int
+hfs_pack_free_space_from_block (PedFileSystem *fs, unsigned int fblock,
+ PedTimer* timer, unsigned int to_free);
+
+#endif /* _RELOC_H */
diff --git a/libparted/fs/hfs/reloc_plus.c b/libparted/fs/hfs/reloc_plus.c
new file mode 100644
index 0000000..cb618bd
--- /dev/null
+++ b/libparted/fs/hfs/reloc_plus.c
@@ -0,0 +1,948 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef DISCOVER_ONLY
+
+#include "config.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <parted/parted.h>
+#include <parted/endian.h>
+#include <parted/debug.h>
+#include <stdint.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+#include "hfs.h"
+#include "file_plus.h"
+#include "advfs_plus.h"
+#include "cache.h"
+#include "journal.h"
+
+#include "reloc_plus.h"
+
+/* This function moves data of size blocks starting at block *ptr_fblock
+ to block *ptr_to_fblock */
+/* return new start or -1 on failure */
+/* -1 is ok because there can only be 2^32-1 blocks, so the max possible
+ last one is 2^32-2 (and anyway it contains Alternate VH), so
+ -1 (== 2^32-1[2^32]) never represent a valid block */
+static int
+hfsplus_effect_move_extent (PedFileSystem *fs, unsigned int *ptr_fblock,
+ unsigned int *ptr_to_fblock, unsigned int size)
+{
+ HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*)
+ fs->type_specific;
+ unsigned int i, ok = 0;
+ unsigned int next_to_fblock;
+ unsigned int start, stop;
+
+ PED_ASSERT (hfsp_block != NULL, return -1);
+ PED_ASSERT (*ptr_to_fblock <= *ptr_fblock, return -1);
+ /* quiet GCC */
+ next_to_fblock = start = stop = 0;
+
+/*
+ Try to fit the extent AT or _BEFORE_ the wanted place,
+ or then in the gap between dest and source.
+ If failed try to fit the extent after source, for 2 pass relocation
+ The extent is always copied in a non overlapping way
+*/
+
+ /* Backward search */
+ /* 1 pass relocation AT or BEFORE *ptr_to_fblock */
+ if (*ptr_to_fblock != *ptr_fblock) {
+ start = stop = *ptr_fblock < *ptr_to_fblock+size ?
+ *ptr_fblock : *ptr_to_fblock+size;
+ while (start && stop-start != size) {
+ --start;
+ if (TST_BLOC_OCCUPATION(priv_data->alloc_map,start))
+ stop = start;
+ }
+ ok = (stop-start == size);
+ }
+
+ /* Forward search */
+ /* 1 pass relocation in the gap merged with 2 pass reloc after source */
+ if (!ok && *ptr_to_fblock != *ptr_fblock) {
+ start = stop = *ptr_to_fblock+1;
+ while (stop < PED_BE32_TO_CPU(priv_data->vh->total_blocks)
+ && stop-start != size) {
+ if (TST_BLOC_OCCUPATION(priv_data->alloc_map,stop))
+ start = stop + 1;
+ ++stop;
+ }
+ ok = (stop-start == size);
+ }
+
+ /* new non overlapping room has been found ? */
+ if (ok) {
+ /* enough room */
+ PedSector abs_sector;
+ unsigned int ai, j, block;
+ unsigned int block_sz = (PED_BE32_TO_CPU (
+ priv_data->vh->block_size)
+ / PED_SECTOR_SIZE_DEFAULT);
+
+ if (stop > *ptr_to_fblock && stop <= *ptr_fblock)
+ /* Fit in the gap */
+ next_to_fblock = stop;
+ else
+ /* Before or after the gap */
+ next_to_fblock = *ptr_to_fblock;
+
+ /* move blocks */
+ for (i = 0; i < size; /*i++*/) {
+ j = size - i; j = (j < hfsp_block_count) ?
+ j : hfsp_block_count ;
+
+ abs_sector = (PedSector) (*ptr_fblock + i) * block_sz;
+ if (!ped_geometry_read (priv_data->plus_geom,
+ hfsp_block, abs_sector,
+ block_sz * j))
+ return -1;
+
+ abs_sector = (PedSector) (start + i) * block_sz;
+ if (!ped_geometry_write (priv_data->plus_geom,
+ hfsp_block, abs_sector,
+ block_sz * j))
+ return -1;
+
+ for (ai = i+j; i < ai; i++) {
+ /* free source block */
+ block = *ptr_fblock + i;
+ CLR_BLOC_OCCUPATION(priv_data->alloc_map,block);
+ SET_BLOC_OCCUPATION(priv_data->dirty_alloc_map,
+ block/(PED_SECTOR_SIZE_DEFAULT*8));
+
+ /* set dest block */
+ block = start + i;
+ SET_BLOC_OCCUPATION(priv_data->alloc_map,block);
+ SET_BLOC_OCCUPATION(priv_data->dirty_alloc_map,
+ block/(PED_SECTOR_SIZE_DEFAULT*8));
+ }
+ }
+ if (!ped_geometry_sync_fast (priv_data->plus_geom))
+ return -1;
+
+ *ptr_fblock += size;
+ *ptr_to_fblock = next_to_fblock;
+ } else {
+ if (*ptr_fblock != *ptr_to_fblock)
+ /* not enough room */
+ ped_exception_throw (PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_IGNORE,
+ _("An extent has not been relocated."));
+ start = *ptr_fblock;
+ *ptr_fblock = *ptr_to_fblock = start + size;
+ }
+
+ return start;
+}
+
+/* Returns 0 on error */
+/* 1 on succes */
+int
+hfsplus_update_vh (PedFileSystem *fs)
+{
+ HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*)
+ fs->type_specific;
+ uint8_t node[PED_SECTOR_SIZE_DEFAULT];
+
+ if (!ped_geometry_read (priv_data->plus_geom, node, 2, 1))
+ return 0;
+ memcpy (node, priv_data->vh, sizeof (HfsPVolumeHeader));
+ if (!ped_geometry_write (priv_data->plus_geom, node, 2, 1)
+ || !ped_geometry_write (priv_data->plus_geom, node,
+ priv_data->plus_geom->length - 2, 1)
+ || !ped_geometry_sync_fast (priv_data->plus_geom))
+ return 0;
+ return 1;
+}
+
+static int
+hfsplus_do_move (PedFileSystem* fs, unsigned int *ptr_src,
+ unsigned int *ptr_dest, HfsCPrivateCache* cache,
+ HfsCPrivateExtent* ref)
+{
+ HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*)
+ fs->type_specific;
+ HfsPPrivateFile* file;
+ HfsPExtDescriptor* extent;
+ HfsCPrivateExtent* move;
+ int new_start;
+
+ new_start = hfsplus_effect_move_extent (fs, ptr_src, ptr_dest,
+ ref->ext_length);
+
+ if (new_start == -1) return -1;
+
+ if (ref->ext_start != (unsigned) new_start) {
+ switch (ref->where) {
+ /************ VH ************/
+ case CR_PRIM_CAT :
+ priv_data->catalog_file
+ ->first[ref->ref_index].start_block =
+ PED_CPU_TO_BE32(new_start);
+ goto CR_PRIM;
+ case CR_PRIM_EXT :
+ priv_data->extents_file
+ ->first[ref->ref_index].start_block =
+ PED_CPU_TO_BE32(new_start);
+ goto CR_PRIM;
+ case CR_PRIM_ATTR :
+ priv_data->attributes_file
+ ->first[ref->ref_index].start_block =
+ PED_CPU_TO_BE32(new_start);
+ goto CR_PRIM;
+ case CR_PRIM_ALLOC :
+ priv_data->allocation_file
+ ->first[ref->ref_index].start_block =
+ PED_CPU_TO_BE32(new_start);
+ goto CR_PRIM;
+ case CR_PRIM_START :
+ /* No startup file opened */
+ CR_PRIM :
+ extent = ( HfsPExtDescriptor* )
+ ( (uint8_t*)priv_data->vh + ref->ref_offset );
+ extent[ref->ref_index].start_block =
+ PED_CPU_TO_BE32(new_start);
+ if (!hfsplus_update_vh(fs))
+ return -1;
+ break;
+
+ /************** BTREE *************/
+ case CR_BTREE_CAT_JIB :
+ if (!hfsj_update_jib(fs, new_start))
+ return -1;
+ goto BTREE_CAT;
+
+ case CR_BTREE_CAT_JL :
+ if (!hfsj_update_jl(fs, new_start))
+ return -1;
+ goto BTREE_CAT;
+
+ BTREE_CAT:
+ case CR_BTREE_CAT :
+ file = priv_data->catalog_file;
+ goto CR_BTREE;
+
+ case CR_BTREE_ATTR :
+ file = priv_data->attributes_file;
+ goto CR_BTREE;
+
+ case CR_BTREE_EXT_ATTR :
+ if (priv_data->attributes_file
+ ->cache[ref->ref_index].start_block
+ == PED_CPU_TO_BE32(ref->ext_start))
+ priv_data->attributes_file
+ ->cache[ref->ref_index].start_block =
+ PED_CPU_TO_BE32(new_start);
+ goto CR_BTREE_EXT;
+ case CR_BTREE_EXT_CAT :
+ if (priv_data->catalog_file
+ ->cache[ref->ref_index].start_block
+ == PED_CPU_TO_BE32(ref->ext_start))
+ priv_data->catalog_file
+ ->cache[ref->ref_index].start_block =
+ PED_CPU_TO_BE32(new_start);
+ goto CR_BTREE_EXT;
+ case CR_BTREE_EXT_ALLOC :
+ if (priv_data->allocation_file
+ ->cache[ref->ref_index].start_block
+ == PED_CPU_TO_BE32(ref->ext_start))
+ priv_data->allocation_file
+ ->cache[ref->ref_index].start_block =
+ PED_CPU_TO_BE32(new_start);
+ goto CR_BTREE_EXT;
+ case CR_BTREE_EXT_START :
+ /* No startup file opened */
+ CR_BTREE_EXT :
+ case CR_BTREE_EXT_0 :
+ file = priv_data->extents_file;
+
+ CR_BTREE :
+ PED_ASSERT(PED_SECTOR_SIZE_DEFAULT * ref->sect_by_block
+ > ref->ref_offset, return -1 );
+ if (!hfsplus_file_read(file, hfsp_block,
+ (PedSector)ref->ref_block * ref->sect_by_block,
+ ref->sect_by_block))
+ return -1;
+ extent = ( HfsPExtDescriptor* )
+ ( hfsp_block + ref->ref_offset );
+ extent[ref->ref_index].start_block =
+ PED_CPU_TO_BE32(new_start);
+ if (!hfsplus_file_write(file, hfsp_block,
+ (PedSector)ref->ref_block * ref->sect_by_block,
+ ref->sect_by_block)
+ || !ped_geometry_sync_fast (priv_data->plus_geom))
+ return -1;
+ break;
+
+ /********** BUG *********/
+ default :
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("A reference to an extent comes from a place "
+ "it should not. You should check the file "
+ "system!"));
+ return -1;
+ break;
+ }
+
+ move = hfsc_cache_move_extent(cache, ref->ext_start, new_start);
+ if (!move) return -1;
+ PED_ASSERT(move == ref, return -1);
+ }
+
+ return new_start;
+}
+
+/* save any dirty sector of the allocation bitmap file */
+static int
+hfsplus_save_allocation(PedFileSystem *fs)
+{
+ HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*)
+ fs->type_specific;
+ unsigned int map_sectors, i, j;
+ int ret = 1;
+
+ map_sectors = ( PED_BE32_TO_CPU (priv_data->vh->total_blocks)
+ + PED_SECTOR_SIZE_DEFAULT * 8 - 1 ) / (PED_SECTOR_SIZE_DEFAULT * 8);
+
+ for (i = 0; i < map_sectors;) {
+ for (j = i;
+ (TST_BLOC_OCCUPATION(priv_data->dirty_alloc_map,j));
+ ++j)
+ CLR_BLOC_OCCUPATION(priv_data->dirty_alloc_map,j);
+ if (j-i) {
+ ret = hfsplus_file_write(priv_data->allocation_file,
+ priv_data->alloc_map + i * PED_SECTOR_SIZE_DEFAULT,
+ i, j-i) && ret;
+ i = j;
+ } else
+ ++i;
+ }
+
+ return ret;
+}
+
+/* This function moves an extent starting at block fblock
+ to block to_fblock if there's enough room */
+/* Return 1 if everything was fine */
+/* Return -1 if an error occurred */
+/* Return 0 if no extent was found */
+static int
+hfsplus_move_extent_starting_at (PedFileSystem *fs, unsigned int *ptr_fblock,
+ unsigned int *ptr_to_fblock,
+ HfsCPrivateCache* cache)
+{
+ HfsCPrivateExtent* ref;
+ unsigned int old_start, new_start;
+
+ ref = hfsc_cache_search_extent(cache, *ptr_fblock);
+ if (!ref) return 0;
+
+ old_start = *ptr_fblock;
+ new_start = hfsplus_do_move(fs, ptr_fblock, ptr_to_fblock, cache, ref);
+ if (new_start == (unsigned)-1) return -1;
+ if (new_start > old_start) {
+ new_start = hfsplus_do_move(fs, &new_start, ptr_to_fblock,
+ cache, ref);
+ if (new_start == (unsigned)-1 || new_start > old_start)
+ return -1;
+ }
+
+ hfsplus_save_allocation(fs);
+ return 1;
+}
+
+static int
+hfsplus_cache_from_vh(HfsCPrivateCache* cache, PedFileSystem* fs,
+ PedTimer* timer)
+{
+ HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*)
+ fs->type_specific;
+ HfsPExtDescriptor* extent;
+ unsigned int j;
+
+ extent = priv_data->vh->allocation_file.extents;
+ for (j = 0; j < HFSP_EXT_NB; ++j) {
+ if (!extent[j].block_count) break;
+ if (!hfsc_cache_add_extent(
+ cache,
+ PED_BE32_TO_CPU(extent[j].start_block),
+ PED_BE32_TO_CPU(extent[j].block_count),
+ 0, /* unused for vh */
+ ((uint8_t*)extent) - ((uint8_t*)priv_data->vh),
+ 1, /* load / save 1 sector */
+ CR_PRIM_ALLOC,
+ j )
+ )
+ return 0;
+ }
+
+ extent = priv_data->vh->extents_file.extents;
+ for (j = 0; j < HFSP_EXT_NB; ++j) {
+ if (!extent[j].block_count) break;
+ if (!hfsc_cache_add_extent(
+ cache,
+ PED_BE32_TO_CPU(extent[j].start_block),
+ PED_BE32_TO_CPU(extent[j].block_count),
+ 0, /* unused for vh */
+ ((uint8_t*)extent) - ((uint8_t*)priv_data->vh),
+ 1, /* load / save 1 sector */
+ CR_PRIM_EXT,
+ j )
+ )
+ return 0;
+ }
+
+ extent = priv_data->vh->catalog_file.extents;
+ for (j = 0; j < HFSP_EXT_NB; ++j) {
+ if (!extent[j].block_count) break;
+ if (!hfsc_cache_add_extent(
+ cache,
+ PED_BE32_TO_CPU(extent[j].start_block),
+ PED_BE32_TO_CPU(extent[j].block_count),
+ 0, /* unused for vh */
+ ((uint8_t*)extent) - ((uint8_t*)priv_data->vh),
+ 1, /* load / save 1 sector */
+ CR_PRIM_CAT,
+ j )
+ )
+ return 0;
+ }
+
+ extent = priv_data->vh->attributes_file.extents;
+ for (j = 0; j < HFSP_EXT_NB; ++j) {
+ if (!extent[j].block_count) break;
+ if (!hfsc_cache_add_extent(
+ cache,
+ PED_BE32_TO_CPU(extent[j].start_block),
+ PED_BE32_TO_CPU(extent[j].block_count),
+ 0, /* unused for vh */
+ ((uint8_t*)extent) - ((uint8_t*)priv_data->vh),
+ 1, /* load / save 1 sector */
+ CR_PRIM_ATTR,
+ j )
+ )
+ return 0;
+ }
+
+ extent = priv_data->vh->startup_file.extents;
+ for (j = 0; j < HFSP_EXT_NB; ++j) {
+ if (!extent[j].block_count) break;
+ if (!hfsc_cache_add_extent(
+ cache,
+ PED_BE32_TO_CPU(extent[j].start_block),
+ PED_BE32_TO_CPU(extent[j].block_count),
+ 0, /* unused for vh */
+ ((uint8_t*)extent) - ((uint8_t*)priv_data->vh),
+ 1, /* load / save 1 sector */
+ CR_PRIM_START,
+ j )
+ )
+ return 0;
+ }
+
+ return 1;
+}
+
+static int
+hfsplus_cache_from_catalog(HfsCPrivateCache* cache, PedFileSystem* fs,
+ PedTimer* timer)
+{
+ HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*)
+ fs->type_specific;
+ uint8_t node_1[PED_SECTOR_SIZE_DEFAULT];
+ uint8_t* node;
+ HfsPHeaderRecord* header;
+ HfsPNodeDescriptor* desc = (HfsPNodeDescriptor*) node_1;
+ HfsPCatalogKey* catalog_key;
+ HfsPCatalog* catalog_data;
+ HfsPExtDescriptor* extent;
+ unsigned int leaf_node, record_number;
+ unsigned int i, j, size, bsize;
+ uint32_t jib = priv_data->jib_start_block,
+ jl = priv_data->jl_start_block;
+
+ if (!priv_data->catalog_file->sect_nb) {
+ ped_exception_throw (
+ PED_EXCEPTION_INFORMATION,
+ PED_EXCEPTION_OK,
+ _("This HFS+ volume has no catalog file. "
+ "This is very unusual!"));
+ return 1;
+ }
+
+ /* Search the extent starting at *ptr_block in the catalog file */
+ if (!hfsplus_file_read_sector (priv_data->catalog_file, node_1, 0))
+ return 0;
+ header = (HfsPHeaderRecord*) (node_1 + HFS_FIRST_REC);
+ leaf_node = PED_BE32_TO_CPU (header->first_leaf_node);
+ bsize = PED_BE16_TO_CPU (header->node_size);
+ size = bsize / PED_SECTOR_SIZE_DEFAULT;
+ PED_ASSERT(size < 256, return 0);
+
+ node = (uint8_t*) ped_malloc(bsize);
+ if (!node) return 0;
+ desc = (HfsPNodeDescriptor*) node;
+
+ for (; leaf_node; leaf_node = PED_BE32_TO_CPU (desc->next)) {
+ if (!hfsplus_file_read (priv_data->catalog_file, node,
+ (PedSector) leaf_node * size, size)) {
+ ped_free (node);
+ return 0;
+ }
+ record_number = PED_BE16_TO_CPU (desc->rec_nb);
+ for (i = 1; i <= record_number; i++) {
+ unsigned int skip;
+ uint8_t where;
+
+ catalog_key = (HfsPCatalogKey*)
+ ( node + PED_BE16_TO_CPU (*((uint16_t *)
+ (node+(bsize - 2*i)))) );
+ skip = ( 2 + PED_BE16_TO_CPU (catalog_key->key_length)
+ + 1) & ~1;
+ catalog_data = (HfsPCatalog*)
+ (((uint8_t*)catalog_key) + skip);
+ /* check for obvious error in FS */
+ if (((uint8_t*)catalog_key - node < HFS_FIRST_REC)
+ || ((uint8_t*)catalog_data - node
+ >= (signed) bsize
+ - 2 * (signed)(record_number+1))) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("The file system contains errors."));
+ ped_free (node);
+ return 0;
+ }
+
+ if (PED_BE16_TO_CPU(catalog_data->type)!=HFS_CAT_FILE)
+ continue;
+
+ extent = catalog_data->sel.file.data_fork.extents;
+ for (j = 0; j < HFSP_EXT_NB; ++j) {
+ if (!extent[j].block_count) break;
+ where = CR_BTREE_CAT;
+ if ( PED_BE32_TO_CPU(extent[j].start_block)
+ == jib ) {
+ jib = 0;
+ where = CR_BTREE_CAT_JIB;
+ } else
+ if ( PED_BE32_TO_CPU(extent[j].start_block)
+ == jl ) {
+ jl = 0;
+ where = CR_BTREE_CAT_JL;
+ }
+ if (!hfsc_cache_add_extent(
+ cache,
+ PED_BE32_TO_CPU(extent[j].start_block),
+ PED_BE32_TO_CPU(extent[j].block_count),
+ leaf_node,
+ (uint8_t*)extent - node,
+ size,
+ where,
+ j )
+ ) {
+ ped_free (node);
+ return 0;
+ }
+ }
+
+ extent = catalog_data->sel.file.res_fork.extents;
+ for (j = 0; j < HFSP_EXT_NB; ++j) {
+ if (!extent[j].block_count) break;
+ if (!hfsc_cache_add_extent(
+ cache,
+ PED_BE32_TO_CPU(extent[j].start_block),
+ PED_BE32_TO_CPU(extent[j].block_count),
+ leaf_node,
+ (uint8_t*)extent - node,
+ size,
+ CR_BTREE_CAT,
+ j )
+ ) {
+ ped_free (node);
+ return 0;
+ }
+ }
+ }
+ }
+
+ ped_free (node);
+ return 1;
+}
+
+static int
+hfsplus_cache_from_extent(HfsCPrivateCache* cache, PedFileSystem* fs,
+ PedTimer* timer)
+{
+ HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*)
+ fs->type_specific;
+ uint8_t node_1[PED_SECTOR_SIZE_DEFAULT];
+ uint8_t* node;
+ HfsPHeaderRecord* header;
+ HfsPNodeDescriptor* desc = (HfsPNodeDescriptor*) node_1;
+ HfsPExtentKey* extent_key;
+ HfsPExtDescriptor* extent;
+ unsigned int leaf_node, record_number;
+ unsigned int i, j, size, bsize;
+
+ if (!priv_data->extents_file->sect_nb) {
+ ped_exception_throw (
+ PED_EXCEPTION_INFORMATION,
+ PED_EXCEPTION_OK,
+ _("This HFS+ volume has no extents overflow "
+ "file. This is quite unusual!"));
+ return 1;
+ }
+
+ if (!hfsplus_file_read_sector (priv_data->extents_file, node_1, 0))
+ return 0;
+ header = ((HfsPHeaderRecord*) (node_1 + HFS_FIRST_REC));
+ leaf_node = PED_BE32_TO_CPU (header->first_leaf_node);
+ bsize = PED_BE16_TO_CPU (header->node_size);
+ size = bsize / PED_SECTOR_SIZE_DEFAULT;
+ PED_ASSERT(size < 256, return 0);
+
+ node = (uint8_t*) ped_malloc (bsize);
+ if (!node) return -1;
+ desc = (HfsPNodeDescriptor*) node;
+
+ for (; leaf_node; leaf_node = PED_BE32_TO_CPU (desc->next)) {
+ if (!hfsplus_file_read (priv_data->extents_file, node,
+ (PedSector) leaf_node * size, size)) {
+ ped_free (node);
+ return 0;
+ }
+ record_number = PED_BE16_TO_CPU (desc->rec_nb);
+ for (i = 1; i <= record_number; i++) {
+ uint8_t where;
+ extent_key = (HfsPExtentKey*)
+ (node + PED_BE16_TO_CPU(*((uint16_t *)
+ (node+(bsize - 2*i)))));
+ extent = (HfsPExtDescriptor*)
+ (((uint8_t*)extent_key) + sizeof (HfsPExtentKey));
+ /* check for obvious error in FS */
+ if (((uint8_t*)extent_key - node < HFS_FIRST_REC)
+ || ((uint8_t*)extent - node
+ >= (signed)bsize
+ - 2 * (signed)(record_number+1))) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("The file system contains errors."));
+ ped_free (node);
+ return -1;
+ }
+
+ switch (extent_key->file_ID) {
+ case PED_CPU_TO_BE32 (HFS_XTENT_ID) :
+ if (ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("The extents overflow file should not"
+ " contain its own extents! You should "
+ "check the file system."))
+ != PED_EXCEPTION_IGNORE)
+ return 0;
+ where = CR_BTREE_EXT_EXT;
+ break;
+ case PED_CPU_TO_BE32 (HFS_CATALOG_ID) :
+ where = CR_BTREE_EXT_CAT;
+ break;
+ case PED_CPU_TO_BE32 (HFSP_ALLOC_ID) :
+ where = CR_BTREE_EXT_ALLOC;
+ break;
+ case PED_CPU_TO_BE32 (HFSP_STARTUP_ID) :
+ where = CR_BTREE_EXT_START;
+ break;
+ case PED_CPU_TO_BE32 (HFSP_ATTRIB_ID) :
+ where = CR_BTREE_EXT_ATTR;
+ break;
+ default :
+ where = CR_BTREE_EXT_0;
+ break;
+ }
+
+ for (j = 0; j < HFSP_EXT_NB; ++j) {
+ if (!extent[j].block_count) break;
+ if (!hfsc_cache_add_extent(
+ cache,
+ PED_BE32_TO_CPU(extent[j].start_block),
+ PED_BE32_TO_CPU(extent[j].block_count),
+ leaf_node,
+ (uint8_t*)extent - node,
+ size,
+ where,
+ j )
+ ) {
+ ped_free (node);
+ return 0;
+ }
+ }
+ }
+ }
+
+ ped_free (node);
+ return 1;
+}
+
+static int
+hfsplus_cache_from_attributes(HfsCPrivateCache* cache, PedFileSystem* fs,
+ PedTimer* timer)
+{
+ HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*)
+ fs->type_specific;
+ uint8_t node_1[PED_SECTOR_SIZE_DEFAULT];
+ uint8_t* node;
+ HfsPHeaderRecord* header;
+ HfsPNodeDescriptor* desc = (HfsPNodeDescriptor*) node_1;
+ HfsPPrivateGenericKey* generic_key;
+ HfsPForkDataAttr* fork_ext_data;
+ HfsPExtDescriptor* extent;
+ unsigned int leaf_node, record_number;
+ unsigned int i, j, size, bsize;
+
+ /* attributes file is facultative */
+ if (!priv_data->attributes_file->sect_nb)
+ return 1;
+
+ /* Search the extent starting at *ptr_block in the catalog file */
+ if (!hfsplus_file_read_sector (priv_data->attributes_file, node_1, 0))
+ return 0;
+ header = ((HfsPHeaderRecord*) (node_1 + HFS_FIRST_REC));
+ leaf_node = PED_BE32_TO_CPU (header->first_leaf_node);
+ bsize = PED_BE16_TO_CPU (header->node_size);
+ size = bsize / PED_SECTOR_SIZE_DEFAULT;
+ PED_ASSERT(size < 256, return 0);
+
+ node = (uint8_t*) ped_malloc(bsize);
+ if (!node) return 0;
+ desc = (HfsPNodeDescriptor*) node;
+
+ for (; leaf_node; leaf_node = PED_BE32_TO_CPU (desc->next)) {
+ if (!hfsplus_file_read (priv_data->attributes_file, node,
+ (PedSector) leaf_node * size, size)) {
+ ped_free (node);
+ return 0;
+ }
+ record_number = PED_BE16_TO_CPU (desc->rec_nb);
+ for (i = 1; i <= record_number; i++) {
+ unsigned int skip;
+ generic_key = (HfsPPrivateGenericKey*)
+ (node + PED_BE16_TO_CPU(*((uint16_t *)
+ (node+(bsize - 2*i)))));
+ skip = ( 2 + PED_BE16_TO_CPU (generic_key->key_length)
+ + 1 ) & ~1;
+ fork_ext_data = (HfsPForkDataAttr*)
+ (((uint8_t*)generic_key) + skip);
+ /* check for obvious error in FS */
+ if (((uint8_t*)generic_key - node < HFS_FIRST_REC)
+ || ((uint8_t*)fork_ext_data - node
+ >= (signed) bsize
+ - 2 * (signed)(record_number+1))) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("The file system contains errors."));
+ ped_free (node);
+ return 0;
+ }
+
+ if (fork_ext_data->record_type
+ == PED_CPU_TO_BE32 ( HFSP_ATTR_FORK ) ) {
+ extent = fork_ext_data->fork_res.fork.extents;
+ for (j = 0; j < HFSP_EXT_NB; ++j) {
+ if (!extent[j].block_count) break;
+ if (!hfsc_cache_add_extent(
+ cache,
+ PED_BE32_TO_CPU (
+ extent[j].start_block ),
+ PED_BE32_TO_CPU (
+ extent[j].block_count ),
+ leaf_node,
+ (uint8_t*)extent-node,
+ size,
+ CR_BTREE_ATTR,
+ j )
+ ) {
+ ped_free(node);
+ return 0;
+ }
+ }
+ } else if (fork_ext_data->record_type
+ == PED_CPU_TO_BE32 ( HFSP_ATTR_EXTENTS ) ) {
+ extent = fork_ext_data->fork_res.extents;
+ for (j = 0; j < HFSP_EXT_NB; ++j) {
+ if (!extent[j].block_count) break;
+ if (!hfsc_cache_add_extent(
+ cache,
+ PED_BE32_TO_CPU (
+ extent[j].start_block ),
+ PED_BE32_TO_CPU (
+ extent[j].block_count ),
+ leaf_node,
+ (uint8_t*)extent-node,
+ size,
+ CR_BTREE_ATTR,
+ j )
+ ) {
+ ped_free(node);
+ return 0;
+ }
+ }
+ } else continue;
+ }
+ }
+
+ ped_free (node);
+ return 1;
+}
+
+static HfsCPrivateCache*
+hfsplus_cache_extents(PedFileSystem* fs, PedTimer* timer)
+{
+ HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*)
+ fs->type_specific;
+ HfsCPrivateCache* ret;
+ unsigned int file_number, block_number;
+
+ file_number = PED_BE32_TO_CPU(priv_data->vh->file_count);
+ block_number = PED_BE32_TO_CPU(priv_data->vh->total_blocks);
+ ret = hfsc_new_cache(block_number, file_number);
+ if (!ret) return NULL;
+
+ if (!hfsplus_cache_from_vh(ret, fs, timer) ||
+ !hfsplus_cache_from_catalog(ret, fs, timer) ||
+ !hfsplus_cache_from_extent(ret, fs, timer) ||
+ !hfsplus_cache_from_attributes(ret, fs, timer)) {
+ ped_exception_throw(
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Could not cache the file system in memory."));
+ hfsc_delete_cache(ret);
+ return NULL;
+ }
+
+ return ret;
+}
+
+/* This function moves file's data to compact used and free space,
+ starting at fblock block */
+/* return 0 on error */
+int
+hfsplus_pack_free_space_from_block (PedFileSystem *fs, unsigned int fblock,
+ PedTimer* timer, unsigned int to_free)
+{
+ PedSector bytes_buff;
+ HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*)
+ fs->type_specific;
+ HfsPVolumeHeader* vh = priv_data->vh;
+ HfsCPrivateCache* cache;
+ unsigned int to_fblock = fblock;
+ unsigned int start = fblock;
+ unsigned int div = PED_BE32_TO_CPU (vh->total_blocks)
+ + 1 - start - to_free;
+ int ret;
+
+ PED_ASSERT (!hfsp_block, return 0);
+
+ cache = hfsplus_cache_extents (fs, timer);
+ if (!cache)
+ return 0;
+
+ /* Calculate the size of the copy buffer :
+ * Takes BLOCK_MAX_BUFF HFS blocks, but if > BYTES_MAX_BUFF
+ * takes the maximum number of HFS blocks so that the buffer
+ * will remain smaller than or equal to BYTES_MAX_BUFF, with
+ * a minimum of 1 HFS block */
+ bytes_buff = PED_BE32_TO_CPU (priv_data->vh->block_size)
+ * (PedSector) BLOCK_MAX_BUFF;
+ if (bytes_buff > BYTES_MAX_BUFF) {
+ hfsp_block_count = BYTES_MAX_BUFF
+ / PED_BE32_TO_CPU (priv_data->vh->block_size);
+ if (!hfsp_block_count)
+ hfsp_block_count = 1;
+ bytes_buff = (PedSector) hfsp_block_count
+ * PED_BE32_TO_CPU (priv_data->vh->block_size);
+ } else
+ hfsp_block_count = BLOCK_MAX_BUFF;
+
+ /* If the cache code requests more space, give it to him */
+ if (bytes_buff < hfsc_cache_needed_buffer (cache))
+ bytes_buff = hfsc_cache_needed_buffer (cache);
+
+ hfsp_block = (uint8_t*) ped_malloc (bytes_buff);
+ if (!hfsp_block)
+ goto error_cache;
+
+ if (!hfsplus_read_bad_blocks (fs)) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Bad blocks list could not be loaded."));
+ goto error_alloc;
+ }
+
+ while ( fblock < ( priv_data->plus_geom->length - 2 )
+ / ( PED_BE32_TO_CPU (vh->block_size)
+ / PED_SECTOR_SIZE_DEFAULT ) ) {
+ if (TST_BLOC_OCCUPATION (priv_data->alloc_map, fblock)
+ && (!hfsplus_is_bad_block (fs, fblock))) {
+ if (!(ret = hfsplus_move_extent_starting_at (fs,
+ &fblock, &to_fblock, cache)))
+ to_fblock = ++fblock;
+ else if (ret == -1) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("An error occurred during extent "
+ "relocation."));
+ goto error_alloc;
+ }
+ } else {
+ fblock++;
+ }
+
+ ped_timer_update(timer, (float)(to_fblock - start) / div);
+ }
+
+ ped_free (hfsp_block); hfsp_block = NULL; hfsp_block_count = 0;
+ hfsc_delete_cache (cache);
+ return 1;
+
+error_alloc:
+ ped_free (hfsp_block); hfsp_block = NULL; hfsp_block_count = 0;
+error_cache:
+ hfsc_delete_cache (cache);
+ return 0;
+}
+
+#endif /* !DISCOVER_ONLY */
diff --git a/libparted/fs/hfs/reloc_plus.h b/libparted/fs/hfs/reloc_plus.h
new file mode 100644
index 0000000..07db0aa
--- /dev/null
+++ b/libparted/fs/hfs/reloc_plus.h
@@ -0,0 +1,37 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2004 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef _RELOC_PLUS_H
+#define _RELOC_PLUS_H
+
+#include <parted/parted.h>
+#include <parted/endian.h>
+#include <parted/debug.h>
+
+#include "hfs.h"
+
+int
+hfsplus_update_vh (PedFileSystem *fs);
+
+int
+hfsplus_pack_free_space_from_block (PedFileSystem *fs, unsigned int fblock,
+ PedTimer* timer, unsigned int to_free);
+
+
+#endif /* _RELOC_PLUS_H */
diff --git a/libparted/fs/jfs/Makefile.am b/libparted/fs/jfs/Makefile.am
new file mode 100644
index 0000000..48f270a
--- /dev/null
+++ b/libparted/fs/jfs/Makefile.am
@@ -0,0 +1,6 @@
+partedincludedir = -I$(top_srcdir)/include
+
+noinst_LTLIBRARIES = libjfs.la
+libjfs_la_SOURCES = jfs.c jfs_superblock.h jfs_types.h
+
+INCLUDES = $(partedincludedir) @INTLINCS@
diff --git a/libparted/fs/jfs/jfs.c b/libparted/fs/jfs/jfs.c
new file mode 100644
index 0000000..97ac14d
--- /dev/null
+++ b/libparted/fs/jfs/jfs.c
@@ -0,0 +1,112 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#include "config.h"
+
+#include <parted/parted.h>
+#include <parted/endian.h>
+
+#define _JFS_UTILITY
+#include "jfs_types.h"
+#include "jfs_superblock.h"
+
+#define JFS_SUPER_SECTOR 64
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+#include <string.h>
+
+#define JFS_BLOCK_SIZES ((int[2]){512, 0})
+
+static PedGeometry*
+jfs_probe (PedGeometry* geom)
+{
+ union {
+ struct superblock sb;
+ char bytes[512];
+ } buf;
+
+ if (geom->length < JFS_SUPER_SECTOR + 1)
+ return NULL;
+ if (!ped_geometry_read (geom, &buf, JFS_SUPER_SECTOR, 1))
+ return NULL;
+
+ if (strncmp (buf.sb.s_magic, JFS_MAGIC, 4) == 0) {
+ PedSector block_size = PED_LE32_TO_CPU (buf.sb.s_pbsize) / 512;
+ PedSector block_count = PED_LE64_TO_CPU (buf.sb.s_size);
+
+ return ped_geometry_new (geom->dev, geom->start,
+ block_size * block_count);
+ } else {
+ return NULL;
+ }
+}
+
+#ifndef DISCOVER_ONLY
+static int
+jfs_clobber (PedGeometry* geom)
+{
+ char buf[512];
+
+ memset (buf, 0, 512);
+ return ped_geometry_write (geom, buf, JFS_SUPER_SECTOR, 1);
+}
+#endif /* !DISCOVER_ONLY */
+
+static PedFileSystemOps jfs_ops = {
+ probe: jfs_probe,
+#ifndef DISCOVER_ONLY
+ clobber: jfs_clobber,
+#else
+ clobber: NULL,
+#endif
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ copy: NULL,
+ resize: NULL,
+ get_create_constraint: NULL,
+ get_resize_constraint: NULL,
+ get_copy_constraint: NULL
+};
+
+static PedFileSystemType jfs_type = {
+ next: NULL,
+ ops: &jfs_ops,
+ name: "jfs",
+ block_sizes: JFS_BLOCK_SIZES
+};
+
+void
+ped_file_system_jfs_init ()
+{
+ ped_file_system_type_register (&jfs_type);
+}
+
+void
+ped_file_system_jfs_done ()
+{
+ ped_file_system_type_unregister (&jfs_type);
+}
diff --git a/libparted/fs/jfs/jfs_superblock.h b/libparted/fs/jfs/jfs_superblock.h
new file mode 100644
index 0000000..c61dc24
--- /dev/null
+++ b/libparted/fs/jfs/jfs_superblock.h
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) International Business Machines Corp., 2000
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
+ * the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ *
+ */
+#ifndef _H_JFS_SUPERBLOCK
+#define _H_JFS_SUPERBLOCK
+/*
+ * jfs_superblock.h
+ */
+
+/*
+ * make the magic number something a human could read
+ */
+#define JFS_MAGIC "JFS1" /* Magic word: Version 1 */
+
+#define JFS_VERSION 1 /* Version number: Version 1 */
+
+#define LV_NAME_SIZE 11 /* MUST BE 11 for OS/2 boot sector */
+
+/*
+ * aggregate superblock
+ *
+ * The name superblock is too close to super_block, so the name has been
+ * changed to jfs_superblock. The utilities are still using the old name.
+ */
+#ifdef _JFS_UTILITY
+struct superblock
+#else
+struct jfs_superblock
+#endif
+{
+ char s_magic[4]; /* 4: magic number */
+ u32 s_version; /* 4: version number */
+
+ s64 s_size; /* 8: aggregate size in hardware/LVM blocks;
+ * VFS: number of blocks
+ */
+ s32 s_bsize; /* 4: aggregate block size in bytes;
+ * VFS: fragment size
+ */
+ s16 s_l2bsize; /* 2: log2 of s_bsize */
+ s16 s_l2bfactor; /* 2: log2(s_bsize/hardware block size) */
+ s32 s_pbsize; /* 4: hardware/LVM block size in bytes */
+ s16 s_l2pbsize; /* 2: log2 of s_pbsize */
+ s16 pad; /* 2: padding necessary for alignment */
+
+ u32 s_agsize; /* 4: allocation group size in aggr. blocks */
+
+ u32 s_flag; /* 4: aggregate attributes:
+ * see jfs_filsys.h
+ */
+ u32 s_state; /* 4: mount/unmount/recovery state:
+ * see jfs_filsys.h
+ */
+ s32 s_compress; /* 4: > 0 if data compression */
+
+ pxd_t s_ait2; /* 8: first extent of secondary
+ * aggregate inode table
+ */
+
+ pxd_t s_aim2; /* 8: first extent of secondary
+ * aggregate inode map
+ */
+ u32 s_logdev; /* 4: device address of log */
+ s32 s_logserial; /* 4: log serial number at aggregate mount */
+ pxd_t s_logpxd; /* 8: inline log extent */
+
+ pxd_t s_fsckpxd; /* 8: inline fsck work space extent */
+
+ struct timestruc_t s_time; /* 8: time last updated */
+
+ s32 s_fsckloglen; /* 4: Number of file system blocks reserved for
+ * the fsck service log.
+ * N.B. These blocks are divided among the
+ * versions kept. This is not a per
+ * version size.
+ * N.B. These blocks are included in the
+ * length field of s_fsckpxd.
+ */
+ s8 s_fscklog; /* 1: which fsck service log is most recent
+ * 0 => no service log data yet
+ * 1 => the first one
+ * 2 => the 2nd one
+ */
+ char s_fpack[11]; /* 11: file system volume name
+ * N.B. This must be 11 bytes to
+ * conform with the OS/2 BootSector
+ * requirements
+ */
+
+ /* extendfs() parameter under s_state & FM_EXTENDFS */
+ s64 s_xsize; /* 8: extendfs s_size */
+ pxd_t s_xfsckpxd; /* 8: extendfs fsckpxd */
+ pxd_t s_xlogpxd; /* 8: extendfs logpxd */
+ /* - 128 byte boundary - */
+
+ /*
+ * DFS VFS support (preliminary)
+ */
+ char s_attach; /* 1: VFS: flag: set when aggregate is attached
+ */
+ u8 rsrvd4[7]; /* 7: reserved - set to 0 */
+
+ u64 totalUsable; /* 8: VFS: total of 1K blocks which are
+ * available to "normal" (non-root) users.
+ */
+ u64 minFree; /* 8: VFS: # of 1K blocks held in reserve for
+ * exclusive use of root. This value can be 0,
+ * and if it is then totalUsable will be equal
+ * to # of blocks in aggregate. I believe this
+ * means that minFree + totalUsable = # blocks.
+ * In that case, we don't need to store both
+ * totalUsable and minFree since we can compute
+ * one from the other. I would guess minFree
+ * would be the one we should store, and
+ * totalUsable would be the one we should
+ * compute. (Just a guess...)
+ */
+
+ u64 realFree; /* 8: VFS: # of free 1K blocks can be used by
+ * "normal" users. It may be this is something
+ * we should compute when asked for instead of
+ * storing in the superblock. I don't know how
+ * often this information is needed.
+ */
+ /*
+ * graffiti area
+ */
+};
+
+#endif /*_H_JFS_SUPERBLOCK */
diff --git a/libparted/fs/jfs/jfs_types.h b/libparted/fs/jfs/jfs_types.h
new file mode 100644
index 0000000..7177f2a
--- /dev/null
+++ b/libparted/fs/jfs/jfs_types.h
@@ -0,0 +1,528 @@
+/*
+ * Copyright (c) International Business Machines Corp., 2000
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
+ * the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef _H_JFS_TYPES
+#define _H_JFS_TYPES
+
+/*
+ * jfs_types.h:
+ *
+ * basic type/utility definitions
+ *
+ * note: this header file must be the 1st include file
+ * of JFS include list in all JFS .c file.
+ */
+
+#ifdef _JFS_UTILITY
+/* this is defined in asm/byteorder.h for i386, but
+ * is NOT defined in asm/byteorder.h for ppc (non-kernel).
+ * Until that is changed, we'll define it here. */
+#define __BYTEORDER_HAS_U64__
+
+#include <sys/types.h>
+//#include <asm/byteorder.h>
+typedef unsigned short UniChar;
+#else
+#include <linux/types.h>
+#include <linux/jfs_fs.h>
+#include <linux/nls.h>
+
+#ifndef _ULS_UNICHAR_DEFINED
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,3,0))
+typedef wchar_t UniChar;
+#else
+typedef unsigned short UniChar;
+#endif
+#define _ULS_UNICHAR_DEFINED
+#endif
+#endif
+/* #include "endian24.h" */
+
+/*
+ * primitive types
+ */
+#ifdef _JFS_UTILITY
+typedef int8_t s8;
+typedef uint8_t u8;
+typedef int16_t s16;
+typedef uint16_t u16;
+typedef int32_t s32;
+typedef uint32_t u32;
+typedef int64_t s64;
+typedef uint64_t u64;
+
+#ifndef _UINT_TYPES
+ /* unicode includes also define these */
+typedef u16 uint16;
+typedef u32 uint32;
+#define _UINT_TYPES
+#endif
+
+typedef s8 int8;
+typedef u8 uint8;
+typedef s16 int16;
+typedef s32 int32;
+typedef s64 int64;
+typedef u64 uint64;
+
+#endif /* _JFS_UTILITY */
+/*
+ * Holdovers from OS/2. Try to get away from using these altogether.
+ */
+typedef unsigned long ULONG;
+typedef unsigned short USHORT;
+typedef unsigned char UCHAR;
+typedef void *PVOID;
+#define MAXPATHLEN 255
+
+
+/*
+ * Almost identical to Linux's timespec, but not quite
+ */
+struct timestruc_t {
+ u32 tv_sec;
+ u32 tv_nsec;
+};
+
+/*
+ * handy
+ */
+#undef MIN
+#define MIN(a,b) (((a)<(b))?(a):(b))
+#undef MAX
+#define MAX(a,b) (((a)>(b))?(a):(b))
+#undef ROUNDUP
+#define ROUNDUP(x, y) ( ((x) + ((y) - 1)) & ~((y) - 1) )
+
+#define LEFTMOSTONE 0x80000000
+#define HIGHORDER 0x80000000u /* high order bit on */
+#define ONES 0xffffffffu /* all bit on */
+
+typedef int boolean_t;
+#define TRUE 1
+#define FALSE 0
+
+/*
+ * logical xd (lxd)
+ */
+typedef struct {
+ unsigned len:24;
+ unsigned off1:8;
+ u32 off2;
+} lxd_t;
+
+/* lxd_t field construction */
+#define LXDlength(lxd, length32) ( (lxd)->len = length32 )
+#define LXDoffset(lxd, offset64)\
+{\
+ (lxd)->off1 = ((s64)offset64) >> 32;\
+ (lxd)->off2 = (offset64) & 0xffffffff;\
+}
+
+/* lxd_t field extraction */
+#define lengthLXD(lxd) ( (lxd)->len )
+#define offsetLXD(lxd)\
+ ( ((s64)((lxd)->off1)) << 32 | (lxd)->off2 )
+
+/* lxd list */
+typedef struct {
+ s16 maxnlxd;
+ s16 nlxd;
+ lxd_t *lxd;
+} lxdlist_t;
+
+/*
+ * physical xd (pxd)
+ */
+typedef struct {
+ unsigned len:24;
+ unsigned addr1:8;
+ u32 addr2;
+} pxd_t;
+
+/* xd_t field construction */
+
+#define PXDlength(pxd, length32) ((pxd)->len = __cpu_to_le24(length32))
+#define PXDaddress(pxd, address64)\
+{\
+ (pxd)->addr1 = ((s64)address64) >> 32;\
+ (pxd)->addr2 = __cpu_to_le32((address64) & 0xffffffff);\
+}
+
+/* xd_t field extraction */
+#define lengthPXD(pxd) __le24_to_cpu((pxd)->len)
+#define addressPXD(pxd)\
+ ( ((s64)((pxd)->addr1)) << 32 | __le32_to_cpu((pxd)->addr2))
+
+/* pxd list */
+typedef struct {
+ s16 maxnpxd;
+ s16 npxd;
+ pxd_t pxd[8];
+} pxdlist_t;
+
+
+/*
+ * data extent descriptor (dxd)
+ */
+typedef struct {
+ unsigned flag:8; /* 1: flags */
+ unsigned rsrvd:24; /* 3: */
+ u32 size; /* 4: size in byte */
+ unsigned len:24; /* 3: length in unit of fsblksize */
+ unsigned addr1:8; /* 1: address in unit of fsblksize */
+ u32 addr2; /* 4: address in unit of fsblksize */
+} dxd_t; /* - 16 - */
+
+/* dxd_t flags */
+#define DXD_INDEX 0x80 /* B+-tree index */
+#define DXD_INLINE 0x40 /* in-line data extent */
+#define DXD_EXTENT 0x20 /* out-of-line single extent */
+#define DXD_FILE 0x10 /* out-of-line file (inode) */
+#define DXD_CORRUPT 0x08 /* Inconsistency detected */
+
+/* dxd_t field construction
+ * Conveniently, the PXD macros work for DXD
+ */
+#define DXDlength PXDlength
+#define DXDaddress PXDaddress
+#define lengthDXD lengthPXD
+#define addressDXD addressPXD
+
+/*
+ * directory entry argument
+ */
+typedef struct component_name {
+ int namlen;
+ UniChar *name;
+} component_t;
+
+
+/*
+ * DASD limit information - stored in directory inode
+ */
+typedef struct dasd {
+ u8 thresh; /* Alert Threshold (in percent) */
+ u8 delta; /* Alert Threshold delta (in percent) */
+ u8 rsrvd1;
+ u8 limit_hi; /* DASD limit (in logical blocks) */
+ u32 limit_lo; /* DASD limit (in logical blocks) */
+ u8 rsrvd2[3];
+ u8 used_hi; /* DASD usage (in logical blocks) */
+ u32 used_lo; /* DASD usage (in logical blocks) */
+} dasd_t;
+
+#define DASDLIMIT(dasdp) \
+ (((u64)((dasdp)->limit_hi) << 32) + __le32_to_cpu((dasdp)->limit_lo))
+#define setDASDLIMIT(dasdp, limit)\
+{\
+ (dasdp)->limit_hi = ((u64)limit) >> 32;\
+ (dasdp)->limit_lo = __cpu_to_le32(limit);\
+}
+#define DASDUSED(dasdp) \
+ (((u64)((dasdp)->used_hi) << 32) + __le32_to_cpu((dasdp)->used_lo))
+#define setDASDUSED(dasdp, used)\
+{\
+ (dasdp)->used_hi = ((u64)used) >> 32;\
+ (dasdp)->used_lo = __cpu_to_le32(used);\
+}
+
+/*
+ * circular doubly-linked list (cdll)
+ *
+ * A circular doubly-linked list (cdll) is anchored by a pair of pointers,
+ * one to the head of the list and the other to the tail of the list.
+ * The elements are doubly linked so that an arbitrary element can be
+ * removed without a need to traverse the list.
+ * New elements can be added to the list before or after an existing element,
+ * at the head of the list, or at the tail of the list.
+ * A circle queue may be traversed in either direction.
+ *
+ * +----------+ +-------------------------------------+
+ * | | | |
+ * +->+-----+ | +->+-----+ +->+-----+ +->+-----+ |
+ * | | h +-+ | | h +--+ | n +----+ | n +--+
+ * | +-----+ | +-----+ | +-----+ | +-----+
+ * | | t +-+ +-----+ t | | | p +--+ | | p +--+
+ * | +-----+ | | | +-----+ | +-----+ | | +-----+ |
+ * +----------+ | +-----------------------+ | |
+ * | | | |
+ * | +-------------------------+
+ * | |
+ * +----------------------------+
+ */
+/*
+ * define header
+ *
+ * list header field definition in header element:
+ *
+ * type - type of list element struct embedding the link field
+ */
+#define CDLL_HEADER(type)\
+struct {\
+ struct type *head;\
+ struct type *tail;\
+}
+
+struct cdll_header {
+ struct cdll_header *head;
+ struct cdll_header *tail;
+};
+
+/*
+ * define link
+ *
+ * list link field definition in list element:
+ *
+ * type - type of parent list element struct embedding the link field
+ */
+#define CDLL_ENTRY(type)\
+struct {\
+ struct type *next;\
+ struct type *prev;\
+}
+
+struct cdll_entry {
+ struct cdll_entry *next;
+ struct cdll_entry *prev;
+};
+
+/*
+ * initialize header
+ *
+ * header - ptr to the header field in the header element
+ */
+#define CDLL_INIT(header) {\
+ (header)->head = (void *)(header);\
+ (header)->tail = (void *)(header);\
+}
+
+/*
+ * scan list
+ *
+ * header - ptr to the header field in the header element
+ * elm - ptr to the element to be inserted
+ * field - name of the link field in the list element
+ *
+ * struct header_container *container;
+ * struct header_type *header;
+ * struct element_type *elm;
+ *
+ * header = &container->header_field;
+ * for (elm = header->head; elm != (void *)header; elm = elm->field.next)
+ */
+
+/*
+ * insert <elm> at head of list anchored at <header>
+ *
+ * header - ptr to the header field in the header element
+ * elm - ptr to the list element to be inserted
+ * field - name of the link field in the list element
+ */
+#define CDLL_INSERT_HEAD(header, elm, field) {\
+ (elm)->field.next = (header)->head;\
+ (elm)->field.prev = (void *)(header);\
+ if ((header)->tail == (void *)(header))\
+ (header)->tail = (elm);\
+ else\
+ (header)->head->field.prev = (elm);\
+ (header)->head = (elm);\
+}
+
+/*
+ * insert <elm> at tail of list anchored at <header>
+ *
+ * header - ptr to the header field in the header element
+ * elm - ptr to the list element to be inserted
+ * field - name of the link field in the list element
+ */
+#define CDLL_INSERT_TAIL(header, elm, field) {\
+ (elm)->field.next = (void *)(header);\
+ (elm)->field.prev = (header)->tail;\
+ if ((header)->head == (void *)(header))\
+ (header)->head = (elm);\
+ else\
+ (header)->tail->field.next = (elm);\
+ (header)->tail = (elm);\
+}
+
+/*
+ * insert <elm> after <listelm> of list anchored at <header>
+ *
+ * header - ptr to the header field in the header element
+ * listelm - ptr to the list element at insertion point
+ * elm - ptr to the list element to be inserted
+ * field - name of the link field in the list element
+ */
+#define CDLL_INSERT_AFTER(header, listelm, elm, field) {\
+ (elm)->field.next = (listelm)->field.next;\
+ (elm)->field.prev = (listelm);\
+ if ((listelm)->field.next == (void *)(header))\
+ (header)->tail = (elm);\
+ else\
+ (listelm)->field.next->field.prev = (elm);\
+ (listelm)->field.next = (elm);\
+}
+
+/*
+ * insert <elm> before <listelm> of list anchored at <header>
+ *
+ * header - ptr to the header field in the header element
+ * listelm - ptr to list element at insertion point
+ * elm - ptr to the element to be inserted
+ * field - name of the link field in the list element
+ */
+#define CDLL_INSERT_BEFORE(header, listelm, elm, field) {\
+ (elm)->field.next = (listelm);\
+ (elm)->field.prev = (listelm)->field.prev;\
+ if ((listelm)->field.prev == (void *)(header))\
+ (header)->head = (elm);\
+ else\
+ (listelm)->field.prev->field.next = (elm);\
+ (listelm)->field.prev = (elm);\
+}
+
+/*
+ * remove <elm> from list anchored at <header>
+ *
+ * header - ptr to the header field in the header element
+ * elm - ptr to the list element to be removed
+ * field - name of the link field in the list element
+ */
+#define CDLL_REMOVE(header, elm, field) {\
+ if ((elm)->field.next == (void *)(header))\
+ (header)->tail = (elm)->field.prev;\
+ else\
+ (elm)->field.next->field.prev = (elm)->field.prev;\
+ if ((elm)->field.prev == (void *)(header))\
+ (header)->head = (elm)->field.next;\
+ else\
+ (elm)->field.prev->field.next = (elm)->field.next;\
+}
+
+#define CDLL_MOVE_TO_HEAD(header, elm, field) {\
+ if ((elm)->field.prev != (void *)(header))\
+ {\
+ if ((elm)->field.next == (void *)(header))\
+ (header)->tail = (elm)->field.prev;\
+ else\
+ (elm)->field.next->field.prev = (elm)->field.prev;\
+ (elm)->field.prev->field.next = (elm)->field.next;\
+ (elm)->field.next = (header)->head;\
+ (elm)->field.prev = (void *)(header);\
+ (header)->head->field.prev = (elm);\
+ (header)->head = (elm);\
+ }\
+}
+
+#define CDLL_MOVE_TO_TAIL(header, elm, field) {\
+ if ((elm)->field.next != (void *)(header))\
+ {\
+ (elm)->field.next->field.prev = (elm)->field.prev;\
+ if ((elm)->field.prev == (void *)(header))\
+ (header)->head = (elm)->field.next;\
+ else\
+ (elm)->field.prev->field.next = (elm)->field.next;\
+ (elm)->field.next = (void *)(header);\
+ (elm)->field.prev = (header)->tail;\
+ (header)->tail->field.next = (elm);\
+ (header)->tail = (elm);\
+ }\
+}
+
+/*
+ * orphan list element
+ */
+#define CDLL_SELF(elm, field)\
+ (elm)->field.next = (elm)->field.prev = (elm);
+
+
+/*
+ * single head doubly-linked list
+ *
+ * A list is headed by a single head pointer.
+ * The elements are doubly linked so that an arbitrary element can be
+ * removed without a need to traverse the list.
+ * New elements can be added to the list at the head of the list, or
+ * after an existing element (NO insert at tail).
+ * A list may only be traversed in the forward direction.
+ * (note: the list is NULL terminated in next field.)
+ *
+ * +-----+ +->+-----+ +->+-----+ +->+-----+
+ * | NULL| | | h +--+ | n +----+ | NULL|
+ * +-----+ | +-----+ | +-----+ +-----+
+ * | | | p +--+ | p +--+
+ * | | +-----+ | +-----+ |
+ * +-----------------------+ |
+ * | |
+ * +-------------------------+
+ */
+#define LIST_HEADER(type)\
+struct {\
+ struct type *head;\
+}
+
+#define LIST_ENTRY(type)\
+struct {\
+ struct type *next;\
+ struct type **prev;\
+}
+
+#define LIST_INIT(header) { (header)->head = NULL; }
+
+/*
+ * scan list
+ *
+ * header - ptr to the header (field in header element)
+ * elm - ptr to the element to be inserted
+ * field - name of the link field in list element
+ *
+ * struct header_container *container;
+ * struct header_type *header;
+ * struct element_type *elm;
+ *
+ * header = &container->header_field;
+ * for (elm = header->head; elm; elm = elm->field.next)
+ */
+
+#define LIST_INSERT_HEAD(header, elm, field) {\
+ if (((elm)->field.next = (header)->head) != NULL)\
+ (header)->head->field.prev = &(elm)->field.next;\
+ (header)->head = (elm);\
+ (elm)->field.prev = &(header)->head;\
+}
+
+#define LIST_INSERT_AFTER(listelm, elm, field) {\
+ if (((elm)->field.next = (listelm)->field.next) != NULL)\
+ (listelm)->field.next->field.prev = &(elm)->field.next;\
+ (listelm)->field.next = (elm);\
+ (elm)->field.prev = &(listelm)->field.next;\
+}
+
+#define LIST_REMOVE(elm, field) {\
+ if ((elm)->field.next != NULL)\
+ (elm)->field.next->field.prev = (elm)->field.prev;\
+ *(elm)->field.prev = (elm)->field.next;\
+}
+
+#define LIST_SELF(elm, field) {\
+ (elm)->field.next = NULL;\
+ (elm)->field.prev = &(elm)->field.next;\
+}
+
+#endif /* !_H_JFS_TYPES */
diff --git a/libparted/fs/linux_swap/Makefile.am b/libparted/fs/linux_swap/Makefile.am
new file mode 100644
index 0000000..b913fe3
--- /dev/null
+++ b/libparted/fs/linux_swap/Makefile.am
@@ -0,0 +1,6 @@
+partedincludedir = -I$(top_srcdir)/include
+
+noinst_LTLIBRARIES = liblinuxswap.la
+liblinuxswap_la_SOURCES = linux_swap.c
+
+INCLUDES = $(partedincludedir) @INTLINCS@
diff --git a/libparted/fs/linux_swap/linux_swap.c b/libparted/fs/linux_swap/linux_swap.c
new file mode 100644
index 0000000..02185e1
--- /dev/null
+++ b/libparted/fs/linux_swap/linux_swap.c
@@ -0,0 +1,520 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+/* It's a bit silly calling a swap partition a file system. Oh well... */
+
+#include "config.h"
+
+#include <parted/parted.h>
+#include <parted/endian.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+#include <unistd.h>
+#include <string.h>
+
+#define SWAP_SPECIFIC(fs) ((SwapSpecific*) (fs->type_specific))
+#define BUFFER_SIZE 128
+
+#define LINUXSWAP_BLOCK_SIZES ((int[2]){512, 0})
+
+typedef struct {
+ char page_map[1];
+} SwapOldHeader;
+
+/* ripped from mkswap */
+typedef struct {
+ char bootbits[1024]; /* Space for disklabel etc. */
+ unsigned int version;
+ unsigned int last_page;
+ unsigned int nr_badpages;
+ unsigned int padding[125];
+ unsigned int badpages[1];
+} SwapNewHeader;
+
+typedef struct {
+ union {
+ SwapNewHeader new;
+ SwapOldHeader old;
+ }* header;
+
+ void* buffer;
+ int buffer_size;
+
+ PedSector page_sectors;
+ unsigned int page_count;
+ unsigned int version;
+ unsigned int max_bad_pages;
+} SwapSpecific;
+
+static PedFileSystemType swap_type;
+
+static PedFileSystem* swap_open (PedGeometry* geom);
+static int swap_close (PedFileSystem* fs);
+
+static PedGeometry*
+swap_probe (PedGeometry* geom)
+{
+ PedFileSystem* fs;
+ SwapSpecific* fs_info;
+ PedGeometry* probed_geom;
+ PedSector length;
+
+ fs = swap_open (geom);
+ if (!fs)
+ goto error;
+ fs_info = SWAP_SPECIFIC (fs);
+
+ if (fs_info->version)
+ length = fs_info->page_sectors * fs_info->page_count;
+ else
+ length = geom->length;
+ probed_geom = ped_geometry_new (geom->dev, geom->start, length);
+ if (!probed_geom)
+ goto error_close_fs;
+ swap_close (fs);
+ return probed_geom;
+
+error_close_fs:
+ swap_close (fs);
+error:
+ return NULL;
+}
+
+#ifndef DISCOVER_ONLY
+static int
+swap_clobber (PedGeometry* geom)
+{
+ PedFileSystem* fs;
+ char buf[512];
+
+ fs = swap_open (geom);
+ if (!fs)
+ return 1;
+
+ memset (buf, 0, 512);
+ if (!ped_geometry_write (geom, buf, getpagesize() / 512 - 1, 1))
+ goto error_close_fs;
+
+ swap_close (fs);
+ return 1;
+
+error_close_fs:
+ swap_close (fs);
+error:
+ return 0;
+}
+#endif /* !DISCOVER_ONLY */
+
+static void
+swap_init (PedFileSystem* fs, int fresh)
+{
+ SwapSpecific* fs_info = SWAP_SPECIFIC (fs);
+
+ fs_info->page_sectors = getpagesize () / 512;
+ fs_info->page_count = fs->geom->length / fs_info->page_sectors;
+ fs_info->version = 1;
+ fs_info->max_bad_pages = (getpagesize()
+ - sizeof (SwapNewHeader)) / 4;
+
+ if (fresh)
+ memset (fs_info->header, 0, getpagesize());
+ else
+ ped_geometry_read (fs->geom, fs_info->header,
+ 0, fs_info->page_sectors);
+}
+
+static PedFileSystem*
+swap_alloc (PedGeometry* geom)
+{
+ PedFileSystem* fs;
+ SwapSpecific* fs_info;
+
+ fs = (PedFileSystem*) ped_malloc (sizeof (PedFileSystem));
+ if (!fs)
+ goto error;
+
+ fs->type_specific = (SwapSpecific*) ped_malloc (sizeof (SwapSpecific));
+ if (!fs->type_specific)
+ goto error_free_fs;
+
+ fs_info = SWAP_SPECIFIC (fs);
+ fs_info->header = ped_malloc (getpagesize());
+ if (!fs_info->header)
+ goto error_free_type_specific;
+
+ fs_info = SWAP_SPECIFIC (fs);
+ fs_info->buffer_size = getpagesize() * BUFFER_SIZE;
+ fs_info->buffer = ped_malloc (fs_info->buffer_size);
+ if (!fs_info->buffer)
+ goto error_free_header;
+
+ fs->geom = ped_geometry_duplicate (geom);
+ if (!fs->geom)
+ goto error_free_buffer;
+ fs->type = &swap_type;
+ return fs;
+
+error_free_buffer:
+ ped_free (fs_info->buffer);
+error_free_header:
+ ped_free (fs_info->header);
+error_free_type_specific:
+ ped_free (fs->type_specific);
+error_free_fs:
+ ped_free (fs);
+error:
+ return NULL;
+}
+
+static void
+swap_free (PedFileSystem* fs)
+{
+ SwapSpecific* fs_info = SWAP_SPECIFIC (fs);
+
+ ped_free (fs_info->buffer);
+ ped_free (fs_info->header);
+ ped_free (fs->type_specific);
+
+ ped_geometry_destroy (fs->geom);
+ ped_free (fs);
+}
+
+static PedFileSystem*
+swap_open (PedGeometry* geom)
+{
+ PedFileSystem* fs;
+ SwapSpecific* fs_info;
+ const char* sig;
+
+ fs = swap_alloc (geom);
+ if (!fs)
+ goto error;
+ swap_init (fs, 0);
+
+ fs_info = SWAP_SPECIFIC (fs);
+ if (!ped_geometry_read (fs->geom, fs_info->header, 0,
+ fs_info->page_sectors))
+ goto error_free_fs;
+
+ sig = ((char*) fs_info->header) + getpagesize() - 10;
+ if (strncmp (sig, "SWAP-SPACE", 10) == 0) {
+ fs_info->version = 0;
+ fs_info->page_count
+ = PED_MIN (fs->geom->length / fs_info->page_sectors,
+ 8 * (getpagesize() - 10));
+ } else if (strncmp (sig, "SWAPSPACE2", 10) == 0) {
+ fs_info->version = 1;
+ fs_info->page_count = fs_info->header->new.last_page;
+ } else {
+ char _sig [11];
+
+ memcpy (_sig, sig, 10);
+ _sig [10] = 0;
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("Unrecognised linux swap signature '%10s'."), _sig);
+ goto error_free_fs;
+ }
+
+ fs->checked = 1;
+ return fs;
+
+error_free_fs:
+ swap_free (fs);
+error:
+ return NULL;
+}
+
+static int
+swap_close (PedFileSystem* fs)
+{
+ swap_free (fs);
+ return 1;
+}
+
+#ifndef DISCOVER_ONLY
+static int
+swap_new_find_bad_page (PedFileSystem* fs, unsigned int page)
+{
+ SwapSpecific* fs_info = SWAP_SPECIFIC (fs);
+ unsigned int i;
+
+ for (i=0; i < fs_info->header->new.nr_badpages; i++) {
+ if (fs_info->header->new.badpages [i] == page)
+ return i;
+ }
+
+ return 0;
+}
+
+static int
+swap_new_remove_bad_page (PedFileSystem* fs, unsigned int page)
+{
+ SwapSpecific* fs_info = SWAP_SPECIFIC (fs);
+ unsigned int pos;
+
+ pos = swap_new_find_bad_page (fs, page);
+ if (!pos)
+ return 0;
+
+ for (; pos < fs_info->header->new.nr_badpages; pos++) {
+ fs_info->header->new.badpages [pos - 1]
+ = fs_info->header->new.badpages [pos];
+ }
+
+ return 1;
+}
+
+static int
+swap_mark_page (PedFileSystem* fs, unsigned int page, int ok)
+{
+ SwapSpecific* fs_info = SWAP_SPECIFIC (fs);
+ char* ptr;
+ unsigned int mask;
+
+ if (fs_info->version == 0) {
+ ptr = &fs_info->header->old.page_map [page/8];
+ mask = 1 << (page%8);
+ *ptr = (*ptr & ~mask) + ok * mask;
+ } else {
+ if (ok) {
+ if (swap_new_remove_bad_page (fs, page))
+ fs_info->header->new.nr_badpages--;
+ } else {
+ if (swap_new_find_bad_page (fs, page))
+ return 1;
+
+ if (fs_info->header->new.nr_badpages
+ > fs_info->max_bad_pages) {
+ ped_exception_throw (PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Too many bad pages."));
+ return 0;
+ }
+
+ fs_info->header->new.badpages
+ [fs_info->header->new.nr_badpages] = page;
+ fs_info->header->new.nr_badpages++;
+ }
+ }
+
+ return 1;
+}
+
+static void
+swap_clear_pages (PedFileSystem* fs)
+{
+ SwapSpecific* fs_info = SWAP_SPECIFIC (fs);
+ unsigned int i;
+
+ for (i = 1; i < fs_info->page_count; i++) {
+ swap_mark_page (fs, i, 1);
+ }
+
+ if (fs_info->version == 0) {
+ for (; i < 1024; i++) {
+ swap_mark_page (fs, i, 0);
+ }
+ }
+}
+
+static int
+swap_check_pages (PedFileSystem* fs, PedTimer* timer)
+{
+ SwapSpecific* fs_info = SWAP_SPECIFIC (fs);
+ PedSector result;
+ int first_page = 1;
+ int stop_page = 0;
+ int last_page = fs_info->page_count - 1;
+ PedTimer* nested_timer;
+
+ ped_timer_reset (timer);
+ ped_timer_set_state_name (timer, _("checking for bad blocks"));
+
+ swap_clear_pages (fs);
+ while (first_page <= last_page) {
+ nested_timer = ped_timer_new_nested (
+ timer,
+ 1.0 * (last_page - first_page) / last_page);
+ result = ped_geometry_check (
+ fs->geom,
+ fs_info->buffer,
+ fs_info->buffer_size / 512,
+ first_page * fs_info->page_sectors,
+ fs_info->page_sectors,
+ (last_page - first_page + 1)
+ * fs_info->page_sectors,
+ nested_timer);
+ ped_timer_destroy_nested (nested_timer);
+ if (!result)
+ return 1;
+ stop_page = result / fs_info->page_sectors;
+ if (!swap_mark_page (fs, stop_page, 0))
+ return 0;
+ first_page = stop_page + 1;
+ }
+ return 1;
+}
+
+static int
+swap_write (PedFileSystem* fs)
+{
+ SwapSpecific* fs_info = SWAP_SPECIFIC (fs);
+ char* sig = ((char*) fs_info->header) + getpagesize() - 10;
+
+ if (fs_info->version == 0) {
+ memcpy (sig, "SWAP-SPACE", 10);
+ } else {
+ fs_info->header->new.version = 1;
+ fs_info->header->new.last_page = fs_info->page_count - 1;
+ fs_info->header->new.nr_badpages = 0;
+ memcpy (sig, "SWAPSPACE2", 10);
+ }
+
+ return ped_geometry_write (fs->geom, fs_info->header, 0,
+ fs_info->page_sectors);
+}
+
+static PedFileSystem*
+swap_create (PedGeometry* geom, PedTimer* timer)
+{
+ PedFileSystem* fs;
+
+ fs = swap_alloc (geom);
+ if (!fs)
+ goto error;
+ swap_init (fs, 1);
+ if (!swap_write (fs))
+ goto error_free_fs;
+ return fs;
+
+error_free_fs:
+ swap_free (fs);
+error:
+ return NULL;
+}
+
+static int
+swap_resize (PedFileSystem* fs, PedGeometry* geom, PedTimer* timer)
+{
+ PedGeometry* old_geom = fs->geom;
+
+ fs->geom = ped_geometry_duplicate (geom);
+ swap_init (fs, old_geom->start != geom->start);
+ if (!swap_write (fs))
+ goto error;
+ ped_geometry_destroy (old_geom);
+ return 1;
+
+error:
+ ped_geometry_destroy (fs->geom);
+ fs->geom = old_geom;
+ return 0;
+}
+
+static PedFileSystem*
+swap_copy (const PedFileSystem* fs, PedGeometry* geom, PedTimer* timer)
+{
+ return ped_file_system_create (geom, &swap_type, timer);
+}
+
+static int
+swap_check (PedFileSystem* fs, PedTimer* timer)
+{
+ return swap_check_pages (fs, timer)
+ && swap_write (fs);
+}
+
+static PedConstraint*
+swap_get_create_constraint (const PedDevice* dev)
+{
+ PedGeometry full_dev;
+
+ if (!ped_geometry_init (&full_dev, dev, 0, dev->length - 1))
+ return NULL;
+
+ return ped_constraint_new (ped_alignment_any, ped_alignment_any,
+ &full_dev, &full_dev,
+ getpagesize() / 512, dev->length);
+}
+
+static PedConstraint*
+swap_get_resize_constraint (const PedFileSystem* fs)
+{
+ return swap_get_create_constraint (fs->geom->dev);
+}
+
+static PedConstraint*
+swap_get_copy_constraint (const PedFileSystem* fs, const PedDevice* dev)
+{
+ return swap_get_create_constraint (dev);
+}
+#endif /* !DISCOVER_ONLY */
+
+static PedFileSystemOps swap_ops = {
+ probe: swap_probe,
+#ifndef DISCOVER_ONLY
+ clobber: swap_clobber,
+ open: swap_open,
+ create: swap_create,
+ close: swap_close,
+ check: swap_check,
+ copy: swap_copy,
+ resize: swap_resize,
+ get_create_constraint: swap_get_create_constraint,
+ get_resize_constraint: swap_get_resize_constraint,
+ get_copy_constraint: swap_get_copy_constraint
+#else
+ clobber: NULL,
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ copy: NULL,
+ resize: NULL,
+ get_create_constraint: NULL,
+ get_resize_constraint: NULL,
+ get_copy_constraint: NULL
+#endif /* !DISCOVER_ONLY */
+};
+
+static PedFileSystemType swap_type = {
+ next: NULL,
+ ops: &swap_ops,
+ name: "linux-swap",
+ block_sizes: LINUXSWAP_BLOCK_SIZES
+};
+
+void
+ped_file_system_linux_swap_init ()
+{
+ ped_file_system_type_register (&swap_type);
+}
+
+void
+ped_file_system_linux_swap_done ()
+{
+ ped_file_system_type_unregister (&swap_type);
+}
+
diff --git a/libparted/fs/ntfs/Makefile.am b/libparted/fs/ntfs/Makefile.am
new file mode 100644
index 0000000..8a423bb
--- /dev/null
+++ b/libparted/fs/ntfs/Makefile.am
@@ -0,0 +1,6 @@
+partedincludedir = -I$(top_srcdir)/include
+
+noinst_LTLIBRARIES = libntfs.la
+libntfs_la_SOURCES = ntfs.c
+
+INCLUDES = $(partedincludedir) @INTLINCS@
diff --git a/libparted/fs/ntfs/ntfs.c b/libparted/fs/ntfs/ntfs.c
new file mode 100644
index 0000000..317d0e3
--- /dev/null
+++ b/libparted/fs/ntfs/ntfs.c
@@ -0,0 +1,104 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#include "config.h"
+
+#include <parted/parted.h>
+#include <parted/endian.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+#include <unistd.h>
+#include <string.h>
+
+
+#define NTFS_BLOCK_SIZES ((int[2]){512, 0})
+
+#define NTFS_SIGNATURE "NTFS"
+
+static PedGeometry*
+ntfs_probe (PedGeometry* geom)
+{
+ char buf[512];
+
+ if (!ped_geometry_read (geom, buf, 0, 1))
+ return 0;
+
+ if (strncmp (NTFS_SIGNATURE, buf + 3, strlen (NTFS_SIGNATURE)) == 0)
+ return ped_geometry_new (geom->dev, geom->start,
+ PED_LE64_TO_CPU (*(uint64_t*)
+ (buf + 0x28)));
+ else
+ return NULL;
+}
+
+#ifndef DISCOVER_ONLY
+static int
+ntfs_clobber (PedGeometry* geom)
+{
+ char buf[512];
+
+ memset (buf, 0, 512);
+ return ped_geometry_write (geom, buf, 0, 1);
+}
+#endif /* !DISCOVER_ONLY */
+
+static PedFileSystemOps ntfs_ops = {
+ probe: ntfs_probe,
+#ifndef DISCOVER_ONLY
+ clobber: ntfs_clobber,
+#else
+ clobber: NULL,
+#endif
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ copy: NULL,
+ resize: NULL,
+ get_create_constraint: NULL,
+ get_resize_constraint: NULL,
+ get_copy_constraint: NULL
+};
+
+static PedFileSystemType ntfs_type = {
+ next: NULL,
+ ops: &ntfs_ops,
+ name: "ntfs",
+ block_sizes: NTFS_BLOCK_SIZES
+};
+
+void
+ped_file_system_ntfs_init ()
+{
+ ped_file_system_type_register (&ntfs_type);
+}
+
+void
+ped_file_system_ntfs_done ()
+{
+ ped_file_system_type_unregister (&ntfs_type);
+}
+
+
diff --git a/libparted/fs/reiserfs/Makefile.am b/libparted/fs/reiserfs/Makefile.am
new file mode 100644
index 0000000..9812ede
--- /dev/null
+++ b/libparted/fs/reiserfs/Makefile.am
@@ -0,0 +1,7 @@
+partedincludedir = -I$(top_srcdir)/include
+
+noinst_LTLIBRARIES = libreiserfs.la
+
+libreiserfs_la_SOURCES = reiserfs.c reiserfs.h geom_dal.c geom_dal.h
+
+INCLUDES = $(partedincludedir) @INTLINCS@
diff --git a/libparted/fs/reiserfs/geom_dal.c b/libparted/fs/reiserfs/geom_dal.c
new file mode 100644
index 0000000..ad315f0
--- /dev/null
+++ b/libparted/fs/reiserfs/geom_dal.c
@@ -0,0 +1,139 @@
+/*
+ geom_dal.c -- parted device abstraction layer
+ Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#include "config.h"
+
+#if (DYNAMIC_LOADING || HAVE_LIBREISERFS) && !DISCOVER_ONLY
+
+#include "geom_dal.h"
+
+#include <parted/parted.h>
+#include <parted/debug.h>
+
+static blk_t __len(dal_t *dal) {
+ PED_ASSERT(dal != NULL, return 0);
+
+ return ((PedGeometry *)dal->dev)->length /
+ (dal->block_size / PED_SECTOR_SIZE_DEFAULT);
+}
+
+static int __read(dal_t *dal, void *buff, blk_t block, blk_t count) {
+ blk_t k;
+ PedSector block_pos;
+ PedSector block_count;
+
+ PED_ASSERT(dal != NULL, return 0);
+
+ k = dal->block_size / PED_SECTOR_SIZE_DEFAULT;
+ block_pos = (PedSector)(block * k);
+ block_count = (PedSector)(count * k);
+
+ return ped_geometry_read((PedGeometry *)dal->dev, buff, block_pos, block_count);
+}
+
+static int __write(dal_t *dal, void *buff, blk_t block, blk_t count) {
+ blk_t k;
+ PedSector block_pos;
+ PedSector block_count;
+
+ PED_ASSERT(dal != NULL, return 0);
+
+ k = dal->block_size / PED_SECTOR_SIZE_DEFAULT;
+ block_pos = (PedSector)(block * k);
+ block_count = (PedSector)(count * k);
+
+ return ped_geometry_write((PedGeometry *)dal->dev, buff, block_pos,
+ block_count);
+}
+
+static int __sync(dal_t *dal) {
+ PED_ASSERT(dal != NULL, return 0);
+ return ped_geometry_sync((PedGeometry *)dal->dev);
+}
+
+static int __flags(dal_t *dal) {
+ PED_ASSERT(dal != NULL, return 0);
+ return dal->flags;
+}
+
+static int __equals(dal_t *dal1, dal_t *dal2) {
+ PED_ASSERT(dal1 != NULL, return 0);
+ PED_ASSERT(dal2 != NULL, return 0);
+
+ return ped_geometry_test_equal((PedGeometry *)dal1->dev,
+ (PedGeometry *)dal2->dev);
+}
+
+static int __stat(dal_t *dal, struct stat *st) {
+
+ PED_ASSERT(dal != NULL, return 0);
+ PED_ASSERT(st != NULL, return 0);
+
+ if (stat(((PedGeometry *)dal->dev)->dev->path, st))
+ return 0;
+
+ return 1;
+}
+
+static dev_t __dev(dal_t *dal) {
+ struct stat st;
+
+ if (!__stat(dal, &st))
+ return (dev_t)0;
+
+ return st.st_dev;
+}
+
+static struct dal_ops ops = {
+ __len, __read, __write, __sync,
+ __flags, __equals, __stat, __dev
+};
+
+dal_t *geom_dal_create(PedGeometry *geom, size_t block_size, int flags) {
+ dal_t *dal;
+
+ if (!geom)
+ return NULL;
+
+ if (!(dal = ped_malloc(sizeof(dal_t))))
+ return NULL;
+
+ dal->ops = &ops;
+ dal->dev = geom;
+ dal->block_size = block_size;
+ dal->flags = flags;
+ dal->len = 0;
+
+ return dal;
+}
+
+int geom_dal_reopen(dal_t *dal, int flags) {
+
+ if (!dal) return 0;
+ dal->flags = flags;
+
+ return 1;
+}
+
+void geom_dal_free(dal_t *dal) {
+ PED_ASSERT(dal != NULL, return);
+ ped_free(dal);
+}
+
+#endif
diff --git a/libparted/fs/reiserfs/geom_dal.h b/libparted/fs/reiserfs/geom_dal.h
new file mode 100644
index 0000000..d4f29f3
--- /dev/null
+++ b/libparted/fs/reiserfs/geom_dal.h
@@ -0,0 +1,63 @@
+/*
+ geom_dal.h -- parted device abstraction layer
+ Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef GEOM_DAL_H
+#define GEOM_DAL_H
+
+#include "config.h"
+
+#include <parted/parted.h>
+
+#if DYNAMIC_LOADING || !DISCOVER_ONLY
+
+#include <sys/stat.h>
+
+typedef unsigned long blk_t;
+
+struct dal_ops;
+
+struct _dal {
+ struct dal_ops *ops;
+ const void *dev;
+ size_t block_size;
+ int flags;
+ void *data;
+ blk_t len;
+};
+
+typedef struct _dal dal_t;
+
+struct dal_ops {
+ blk_t (*len)(dal_t *);
+ int (*read)(dal_t *, void *, blk_t, blk_t);
+ int (*write)(dal_t *, void *, blk_t, blk_t);
+ int (*sync)(dal_t *);
+ int (*flags)(dal_t *);
+ int (*equals)(dal_t *, dal_t *);
+ int (*stat)(dal_t *, struct stat *);
+ dev_t (*dev)(dal_t *);
+};
+
+extern dal_t *geom_dal_create(PedGeometry *geom, size_t block_size, int flags);
+extern int geom_dal_reopen(dal_t *dal, int flags);
+extern void geom_dal_free(dal_t *dal);
+
+#endif
+
+#endif
diff --git a/libparted/fs/reiserfs/reiserfs.c b/libparted/fs/reiserfs/reiserfs.c
new file mode 100644
index 0000000..219857b
--- /dev/null
+++ b/libparted/fs/reiserfs/reiserfs.c
@@ -0,0 +1,867 @@
+/*
+ reiserfs.c -- libparted / libreiserfs glue
+ Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+
+ This is all rather complicated. There are a few combinations:
+ * shared libraries full support
+ * dynamic libraries present full support (via dlopen)
+ * dynamic libraries absent (full support disabled) (via dlopen)
+ * discover only
+
+ We'd love to hear comments...
+
+ So far, we've opted for maximum flexibility for the user. Is it
+ all worth it?
+*/
+
+#include "config.h"
+
+#if (HAVE_LIBREISERFS || DYNAMIC_LOADING) && !DISCOVER_ONLY
+# define REISER_FULL_SUPPORT
+#endif
+
+#include <uuid/uuid.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+#ifdef DYNAMIC_LOADING
+# include <dlfcn.h>
+#endif
+
+#include <parted/parted.h>
+#include <parted/debug.h>
+#include <parted/endian.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif
+
+#include "reiserfs.h"
+#include "geom_dal.h"
+
+#define REISERFS_BLOCK_SIZES ((int[2]){512, 0})
+
+static PedSector reiserfs_super_offset[] = { 128, 16, -1 };
+static PedFileSystemType* reiserfs_type;
+
+#ifdef DYNAMIC_LOADING
+# define FPTR *
+# define FCLASS static
+#else
+# define FPTR
+# define FCLASS extern
+#endif
+
+#ifdef DYNAMIC_LOADING
+
+static int libreiserfs_present;
+
+static void *libdal_handle;
+static void *libreiserfs_handle;
+
+#endif /* DYNAMIC_LOADING */
+
+#ifdef REISER_FULL_SUPPORT
+
+FCLASS blk_t (FPTR reiserfs_fs_probe) (dal_t *);
+
+FCLASS int (FPTR libreiserfs_exception_type) (reiserfs_exception_t *);
+FCLASS int (FPTR libreiserfs_exception_option) (reiserfs_exception_t *);
+FCLASS char *(FPTR libreiserfs_exception_message) (reiserfs_exception_t *);
+FCLASS void (FPTR libreiserfs_exception_set_handler)
+ (int(FPTR)(reiserfs_exception_t *));
+
+FCLASS void (FPTR dal_realize) (dal_t *);
+FCLASS size_t (FPTR dal_block_size) (dal_t *);
+FCLASS blk_t (FPTR dal_len) (dal_t *);
+FCLASS int (FPTR dal_flags) (dal_t *);
+
+FCLASS reiserfs_fs_t* (FPTR reiserfs_fs_open) (dal_t *, dal_t *);
+FCLASS reiserfs_fs_t* (FPTR reiserfs_fs_create) (dal_t *, dal_t *,
+ blk_t, blk_t, blk_t, size_t,
+ int, int, const char *,
+ const char *, blk_t,
+ reiserfs_gauge_t *);
+
+FCLASS int (FPTR reiserfs_fs_resize) (reiserfs_fs_t *, blk_t, reiserfs_gauge_t *);
+FCLASS int (FPTR reiserfs_fs_check) (reiserfs_fs_t *, reiserfs_gauge_t *);
+
+FCLASS reiserfs_fs_t *(FPTR reiserfs_fs_copy) (reiserfs_fs_t *, dal_t *,
+ reiserfs_gauge_t *);
+
+FCLASS int (FPTR reiserfs_fs_clobber) (dal_t *);
+FCLASS void (FPTR reiserfs_fs_close) (reiserfs_fs_t *);
+
+FCLASS int (FPTR reiserfs_fs_is_resizeable) (reiserfs_fs_t *);
+FCLASS int (FPTR reiserfs_fs_is_consistent) (reiserfs_fs_t *);
+
+FCLASS blk_t (FPTR reiserfs_fs_min_size) (reiserfs_fs_t *);
+FCLASS blk_t (FPTR reiserfs_fs_block_size) (reiserfs_fs_t *);
+FCLASS dal_t* (FPTR reiserfs_fs_host_dal) (reiserfs_fs_t *);
+
+FCLASS blk_t (FPTR reiserfs_fs_bitmap_used) (reiserfs_fs_t *);
+FCLASS int (FPTR reiserfs_fs_bitmap_check) (reiserfs_fs_t *);
+
+FCLASS reiserfs_gauge_t *(FPTR libreiserfs_gauge_create) (
+ char *, reiserfs_gauge_handler_t, void *);
+
+FCLASS void (FPTR libreiserfs_gauge_free) (reiserfs_gauge_t *);
+
+static void gauge_handler(const char *name, unsigned int value, void *data,
+ int determined, int update_header,
+ int update_footer)
+{
+ PedTimer *timer = (PedTimer *) data;
+ ped_timer_set_state_name(timer, name);
+ ped_timer_update(timer, 1.0 * value / 100);
+}
+
+static PedExceptionOption
+exopt_libreiserfs_to_parted(reiserfs_exception_option_t option)
+{
+ switch (option) {
+ case EXCEPTION_UNHANDLED:
+ return PED_EXCEPTION_UNHANDLED;
+ case EXCEPTION_FIX:
+ return PED_EXCEPTION_FIX;
+ case EXCEPTION_YES:
+ return PED_EXCEPTION_YES;
+ case EXCEPTION_NO:
+ return PED_EXCEPTION_NO;
+ case EXCEPTION_OK:
+ return PED_EXCEPTION_OK;
+ case EXCEPTION_RETRY:
+ return PED_EXCEPTION_RETRY;
+ case EXCEPTION_IGNORE:
+ return PED_EXCEPTION_IGNORE;
+ case EXCEPTION_CANCEL:
+ return PED_EXCEPTION_CANCEL;
+
+ default:
+ return PED_EXCEPTION_UNHANDLED;
+ }
+}
+
+static PedExceptionType
+extype_libreiserfs_to_parted(reiserfs_exception_type_t type)
+{
+ switch (type) {
+ case EXCEPTION_INFORMATION:
+ return PED_EXCEPTION_INFORMATION;
+ case EXCEPTION_WARNING:
+ return PED_EXCEPTION_WARNING;
+ case EXCEPTION_ERROR:
+ return PED_EXCEPTION_ERROR;
+ case EXCEPTION_FATAL:
+ return PED_EXCEPTION_FATAL;
+ case EXCEPTION_BUG:
+ return PED_EXCEPTION_BUG;
+ case EXCEPTION_NO_FEATURE:
+ return PED_EXCEPTION_NO_FEATURE;
+
+ default:
+ return PED_EXCEPTION_NO_FEATURE;
+ }
+}
+
+static int exception_handler(reiserfs_exception_t *exception)
+{
+ int ex_type = libreiserfs_exception_type(exception);
+ int ex_option = libreiserfs_exception_option(exception);
+ char *ex_message = libreiserfs_exception_message(exception);
+
+ return ped_exception_throw (extype_libreiserfs_to_parted (ex_type),
+ exopt_libreiserfs_to_parted (ex_option),
+ ex_message);
+}
+#endif /* REISER_FULL_SUPPORT */
+
+static PedGeometry *reiserfs_probe(PedGeometry *geom)
+{
+ int i;
+ reiserfs_super_block_t sb;
+
+ PED_ASSERT(geom != NULL, return NULL);
+
+ for (i = 0; reiserfs_super_offset[i] != -1; i++) {
+ if (reiserfs_super_offset[i] >= geom->length)
+ continue;
+ if (!ped_geometry_read (geom, &sb, reiserfs_super_offset[i], 1))
+ continue;
+
+ if (strncmp(REISERFS_SIGNATURE, sb.s_magic,
+ strlen(REISERFS_SIGNATURE)) == 0
+ || strncmp(REISER2FS_SIGNATURE, sb.s_magic,
+ strlen(REISER2FS_SIGNATURE)) == 0
+ || strncmp(REISER3FS_SIGNATURE, sb.s_magic,
+ strlen(REISER3FS_SIGNATURE)) == 0) {
+ PedSector block_size;
+ PedSector block_count;
+
+ block_size = PED_LE16_TO_CPU(sb.s_blocksize)
+ / PED_SECTOR_SIZE_DEFAULT;
+ block_count = PED_LE32_TO_CPU(sb.s_block_count);
+
+ return ped_geometry_new(geom->dev, geom->start,
+ block_size * block_count);
+ }
+ }
+ return NULL;
+}
+
+#ifndef DISCOVER_ONLY
+static int reiserfs_clobber(PedGeometry *geom)
+{
+ int i;
+ char buf[512];
+
+ PED_ASSERT(geom != NULL, return 0);
+
+ memset(buf, 0, 512);
+ for (i = 0; reiserfs_super_offset[i] != -1; i++) {
+ if (reiserfs_super_offset[i] >= geom->length)
+ continue;
+ if (!ped_geometry_write
+ (geom, buf, reiserfs_super_offset[i], 1))
+ return 0;
+ }
+ return 1;
+}
+#endif /* !DISCOVER_ONLY */
+
+#ifdef REISER_FULL_SUPPORT
+
+static PedFileSystem *reiserfs_open(PedGeometry *geom)
+{
+ PedFileSystem *fs;
+ PedGeometry *fs_geom;
+ dal_t *dal;
+ reiserfs_fs_t *fs_info;
+
+ PED_ASSERT(geom != NULL, return NULL);
+
+ if (!(fs_geom = ped_geometry_duplicate(geom)))
+ goto error;
+
+ if (! (dal = geom_dal_create(fs_geom, DEFAULT_BLOCK_SIZE, O_RDONLY)))
+ goto error_fs_geom_free;
+
+ /*
+ We are passing NULL as DAL for journal. Therefore we let libreiserfs know,
+ that journal not available and parted will be working fine for reiserfs
+ with relocated journal too.
+ */
+ if (!(fs = (PedFileSystem *) ped_malloc(sizeof(PedFileSystem))))
+ goto error_free_dal;
+
+ if (!(fs_info = reiserfs_fs_open(dal, NULL)))
+ goto error_free_fs;
+
+ fs->type = reiserfs_type;
+ fs->geom = fs_geom;
+ fs->type_specific = (void *) fs_info;
+
+ return fs;
+
+error_free_fs:
+ ped_free(fs);
+error_free_dal:
+ geom_dal_free(dal);
+error_fs_geom_free:
+ ped_geometry_destroy(fs_geom);
+error:
+ return NULL;
+}
+
+static PedFileSystem *reiserfs_create(PedGeometry *geom, PedTimer *timer)
+{
+ dal_t *dal;
+ uuid_t uuid;
+ PedFileSystem *fs;
+ PedGeometry *fs_geom;
+ reiserfs_fs_t *fs_info;
+ reiserfs_gauge_t *gauge = NULL;
+
+ PED_ASSERT(geom != NULL, return NULL);
+
+ fs_geom = ped_geometry_duplicate(geom);
+
+ if (!(dal = geom_dal_create(fs_geom, DEFAULT_BLOCK_SIZE, O_RDWR)))
+ goto error_fs_geom_free;
+
+ memset(uuid, 0, sizeof(uuid));
+ uuid_generate(uuid);
+
+ ped_timer_reset(timer);
+ ped_timer_set_state_name(timer, _("creating"));
+
+ if (libreiserfs_gauge_create && libreiserfs_gauge_free) {
+ if (! (gauge =
+ libreiserfs_gauge_create(NULL, gauge_handler, timer)))
+ goto error_free_dal;
+ }
+
+ if (!(fs_info = reiserfs_fs_create(dal, dal, 0, JOURNAL_MAX_TRANS,
+ DEFAULT_JOURNAL_SIZE,
+ DEFAULT_BLOCK_SIZE,
+ FS_FORMAT_3_6, R5_HASH, NULL,
+ (char *) uuid, dal_len(dal),
+ gauge)))
+ goto error_free_gauge;
+
+ ped_timer_update(timer, 1.0);
+
+ if (gauge)
+ libreiserfs_gauge_free(gauge);
+
+ if (!(fs = (PedFileSystem *) ped_malloc(sizeof(PedFileSystem))))
+ goto error_free_fs_info;
+
+ fs->type = reiserfs_type;
+ fs->geom = fs_geom;
+ fs->type_specific = (void *) fs_info;
+
+ return fs;
+
+error_free_fs_info:
+ ped_free(fs_info);
+error_free_gauge:
+ if (gauge)
+ libreiserfs_gauge_free(gauge);
+error_free_dal:
+ geom_dal_free(dal);
+error_fs_geom_free:
+ ped_geometry_destroy(fs_geom);
+error:
+ return NULL;
+}
+
+static int reiserfs_close(PedFileSystem *fs)
+{
+ dal_t *dal;
+
+ PED_ASSERT(fs != NULL, return 0);
+
+ dal = reiserfs_fs_host_dal(fs->type_specific);
+ reiserfs_fs_close(fs->type_specific);
+
+ geom_dal_free(dal);
+ ped_geometry_sync(fs->geom);
+
+ ped_free(fs);
+ return 1;
+}
+
+static PedConstraint *reiserfs_get_create_constraint(const PedDevice *dev)
+{
+ PedGeometry full_dev;
+ PedSector min_blks = (SUPER_OFFSET_IN_BYTES / DEFAULT_BLOCK_SIZE)
+ + 2 + DEFAULT_JOURNAL_SIZE + 1 + 100 + 1;
+
+ if (!ped_geometry_init(&full_dev, dev, 0, dev->length - 1))
+ return NULL;
+
+ return ped_constraint_new(ped_alignment_any, ped_alignment_any,
+ &full_dev, &full_dev,
+ min_blks * (DEFAULT_BLOCK_SIZE / 512),
+ dev->length);
+}
+
+static int reiserfs_check(PedFileSystem *fs, PedTimer *timer)
+{
+ reiserfs_fs_t *fs_info;
+ reiserfs_gauge_t *gauge = NULL;
+
+ PED_ASSERT(fs != NULL, return 0);
+
+ fs_info = fs->type_specific;
+
+ if (!reiserfs_fs_is_consistent(fs_info)) {
+ ped_exception_throw(PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("The file system is in an invalid "
+ "state. Perhaps it is mounted?"));
+ return 0;
+ }
+
+ if (!reiserfs_fs_is_resizeable(fs_info))
+ ped_exception_throw(PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_IGNORE,
+ _("The file system is in old "
+ "(unresizeable) format."));
+
+ if (!reiserfs_fs_bitmap_check(fs_info)) {
+ ped_exception_throw(PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Invalid free blocks count. Run "
+ "reiserfsck --check first."));
+ return 0;
+ }
+
+#ifdef HAVE_REISERFS_FS_CHECK
+ ped_timer_reset(timer);
+
+ if (libreiserfs_gauge_create && libreiserfs_gauge_free) {
+ if (!
+ (gauge =
+ libreiserfs_gauge_create(NULL, gauge_handler, timer)))
+ return 0;
+ }
+
+ ped_timer_set_state_name(timer, _("checking"));
+ ped_timer_update(timer, 0.0);
+
+ if (!reiserfs_fs_check(fs_info, gauge)) {
+ ped_exception_throw(PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Reiserfs tree seems to be corrupted. "
+ "Run reiserfsck --check first."));
+ return 0;
+ }
+
+ ped_timer_update(timer, 1.0);
+
+ if (gauge)
+ libreiserfs_gauge_free(gauge);
+#endif
+
+ ped_exception_throw(PED_EXCEPTION_INFORMATION, PED_EXCEPTION_OK,
+ _("The reiserfs file system passed a basic check. "
+ "For a more comprehensive check, run "
+ "reiserfsck --check."));
+
+ return 1;
+}
+
+static int reiserfs_resize(PedFileSystem *fs, PedGeometry *geom,
+ PedTimer *timer)
+{
+ dal_t *dal;
+ blk_t fs_len;
+ PedSector old_length;
+ reiserfs_fs_t *fs_info;
+ reiserfs_gauge_t *gauge = NULL;
+
+ PED_ASSERT(fs != NULL, return 0);
+
+ old_length = fs->geom->length;
+
+ PED_ASSERT (fs->geom->dev == geom->dev, return 0);
+
+ if (fs->geom->start != geom->start) {
+ ped_exception_throw(PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Sorry, can't move the start of "
+ "reiserfs partitions yet."));
+ return 0;
+ }
+
+ fs_info = fs->type_specific;
+
+ fs_len = (blk_t) (geom->length / (reiserfs_fs_block_size(fs_info) /
+ PED_SECTOR_SIZE_DEFAULT));
+
+ dal = reiserfs_fs_host_dal(fs_info);
+
+ if (dal_flags(dal) && O_RDONLY) {
+ if (!geom_dal_reopen(dal, O_RDWR)) {
+ ped_exception_throw(PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Couldn't reopen device "
+ "abstraction layer for "
+ "read/write."));
+ return 0;
+ }
+ }
+
+ ped_timer_reset(timer);
+
+ if (libreiserfs_gauge_create && libreiserfs_gauge_free) {
+ if (!
+ (gauge =
+ libreiserfs_gauge_create(NULL, gauge_handler, timer)))
+ return 0;
+ }
+
+ if (old_length > geom->length) {
+
+ ped_timer_set_state_name(timer, _("shrinking"));
+ ped_timer_update(timer, 0.0);
+
+ if (!reiserfs_fs_resize(fs_info, fs_len, gauge))
+ goto error_free_gauge;
+
+ ped_geometry_set_end (fs->geom, geom->end);
+ dal_realize(dal);
+ } else {
+ ped_geometry_set_end (fs->geom, geom->end);
+ dal_realize(dal);
+
+ ped_timer_set_state_name(timer, _("expanding"));
+ ped_timer_update(timer, 0.0);
+
+ if (!reiserfs_fs_resize(fs_info, fs_len, gauge))
+ goto error_free_gauge;
+ }
+
+ ped_timer_update(timer, 1.0);
+
+ if (gauge)
+ libreiserfs_gauge_free(gauge);
+
+ return 1;
+
+error_free_gauge:
+ if (gauge)
+ libreiserfs_gauge_free(gauge);
+error:
+ ped_geometry_set_end (fs->geom, fs->geom->start + old_length - 1);
+ return 0;
+}
+
+static PedConstraint *reiserfs_get_resize_constraint(const PedFileSystem *
+ fs)
+{
+ PedDevice *dev;
+ PedSector min_size;
+ PedGeometry full_disk;
+ reiserfs_fs_t *fs_info;
+ PedAlignment start_align;
+ PedGeometry start_sector;
+
+ PED_ASSERT(fs != NULL, return NULL);
+
+ fs_info = fs->type_specific;
+ dev = fs->geom->dev;
+
+ if (!ped_alignment_init(&start_align, fs->geom->start, 0))
+ return NULL;
+ if (!ped_geometry_init(&full_disk, dev, 0, dev->length - 1))
+ return NULL;
+ if (!ped_geometry_init(&start_sector, dev, fs->geom->start, 1))
+ return NULL;
+
+ /*
+ Minsize for reiserfs is area occupied by data blocks and
+ metadata blocks minus free space blocks and minus bitmap
+ blocks which describes free space blocks.
+ */
+ min_size = reiserfs_fs_min_size(fs_info) *
+ (reiserfs_fs_block_size(fs_info) / PED_SECTOR_SIZE_DEFAULT);
+
+ return ped_constraint_new(&start_align, ped_alignment_any,
+ &start_sector, &full_disk, min_size,
+ dev->length);
+}
+
+static PedFileSystem *reiserfs_copy(const PedFileSystem *fs,
+ PedGeometry *geom, PedTimer *timer)
+{
+ dal_t *dal;
+ PedGeometry *fs_geom;
+ PedFileSystem *new_fs;
+ blk_t fs_len, min_needed_blk;
+
+ reiserfs_fs_t *dest_fs, *src_fs;
+ reiserfs_gauge_t *gauge = NULL;
+
+ fs_geom = ped_geometry_duplicate(geom);
+
+ if (!(dal = geom_dal_create(fs_geom, DEFAULT_BLOCK_SIZE, O_RDWR))) {
+ ped_exception_throw(PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Couldn't create reiserfs device "
+ "abstraction handler."));
+ goto error_free_fs_geom;
+ }
+
+ src_fs = fs->type_specific;
+
+ fs_len =
+ (geom->length / (reiserfs_fs_block_size(src_fs) / PED_SECTOR_SIZE_DEFAULT));
+ min_needed_blk = reiserfs_fs_bitmap_used(src_fs);
+
+ if (fs_len <= min_needed_blk) {
+ ped_exception_throw(PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Device is too small for %lu blocks."),
+ min_needed_blk);
+ goto error_free_dal;
+ }
+
+ if (! (new_fs = (PedFileSystem *) ped_malloc(sizeof(PedFileSystem))))
+ goto error_free_dal;
+
+ ped_timer_reset(timer);
+ ped_timer_set_state_name(timer, _("copying"));
+ ped_timer_update(timer, 0.0);
+
+ if (libreiserfs_gauge_create && libreiserfs_gauge_free) {
+ if (! (gauge =
+ libreiserfs_gauge_create(NULL, gauge_handler, timer)))
+ goto error_free_new_fs;
+ }
+
+ if (!(dest_fs = reiserfs_fs_copy(src_fs, dal, gauge)))
+ goto error_free_gauge;
+
+ ped_timer_update(timer, 1.0);
+
+ if (gauge)
+ libreiserfs_gauge_free(gauge);
+
+ new_fs->type = reiserfs_type;
+ new_fs->geom = fs_geom;
+ new_fs->type_specific = (void *) dest_fs;
+
+ return new_fs;
+
+error_free_gauge:
+ if (gauge)
+ libreiserfs_gauge_free(gauge);
+error_free_new_fs:
+ ped_free(new_fs);
+error_free_dal:
+ geom_dal_free(dal);
+error_free_fs_geom:
+ ped_geometry_destroy(fs_geom);
+error:
+ return NULL;
+}
+
+static PedConstraint *reiserfs_get_copy_constraint(const PedFileSystem *fs,
+ const PedDevice *dev)
+{
+ PedGeometry full_dev;
+
+ PED_ASSERT(fs != NULL, return NULL);
+ PED_ASSERT(dev != NULL, return NULL);
+
+ if (!ped_geometry_init(&full_dev, dev, 0, dev->length - 1))
+ return NULL;
+
+ return ped_constraint_new(ped_alignment_any, ped_alignment_any,
+ &full_dev, &full_dev,
+ reiserfs_fs_bitmap_used(fs->type_specific),
+ dev->length);
+}
+
+#endif /* !REISER_FULL_SUPPORT */
+
+#ifdef DYNAMIC_LOADING
+
+#define INIT_SYM(SYM) SYM = getsym (libreiserfs_handle, #SYM)
+
+static void *getsym(void *handle, const char *symbol)
+{
+ void *entry;
+ char *error;
+
+ entry = dlsym(handle, symbol);
+ if ((error = dlerror()) != NULL) {
+ ped_exception_throw(PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_IGNORE,
+ _("Couldn't resolve symbol %s. "
+ "Error: %s."),
+ symbol, error);
+ return NULL;
+ }
+
+ return entry;
+}
+
+static int reiserfs_ops_interface_version_check(void)
+{
+ int min_interface_version, max_interface_version;
+ int (*libreiserfs_get_max_interface_version) (void);
+ int (*libreiserfs_get_min_interface_version) (void);
+
+ INIT_SYM(libreiserfs_get_max_interface_version);
+ INIT_SYM(libreiserfs_get_min_interface_version);
+
+ if (!libreiserfs_get_min_interface_version ||
+ !libreiserfs_get_max_interface_version) {
+ ped_exception_throw(
+ PED_EXCEPTION_WARNING, PED_EXCEPTION_CANCEL,
+ _("GNU Parted found an invalid libreiserfs library."));
+ return 0;
+ }
+
+ min_interface_version = libreiserfs_get_min_interface_version();
+ max_interface_version = libreiserfs_get_max_interface_version();
+
+ if (REISERFS_API_VERSION < min_interface_version ||
+ REISERFS_API_VERSION > max_interface_version) {
+ ped_exception_throw(
+ PED_EXCEPTION_WARNING, PED_EXCEPTION_CANCEL,
+ _("GNU Parted has detected libreiserfs interface "
+ "version mismatch. Found %d-%d, required %d. "
+ "ReiserFS support will be disabled."),
+ min_interface_version,
+ max_interface_version,
+ REISERFS_API_VERSION);
+ return 0;
+ }
+
+ return 1;
+}
+
+static int reiserfs_ops_init(void)
+{
+ if (!(libreiserfs_handle = dlopen("libreiserfs.so", RTLD_NOW)))
+ goto error;
+
+ if (!reiserfs_ops_interface_version_check())
+ goto error_free_libreiserfs_handle;
+
+ if (!(libdal_handle = dlopen("libdal.so", RTLD_NOW)))
+ goto error_free_libreiserfs_handle;
+
+ INIT_SYM(reiserfs_fs_probe);
+ INIT_SYM(libreiserfs_exception_type);
+
+ INIT_SYM(libreiserfs_exception_option);
+ INIT_SYM(libreiserfs_exception_message);
+ INIT_SYM(libreiserfs_exception_set_handler);
+
+ INIT_SYM(reiserfs_fs_clobber);
+ INIT_SYM(reiserfs_fs_open);
+ INIT_SYM(reiserfs_fs_create);
+ INIT_SYM(reiserfs_fs_resize);
+ INIT_SYM(reiserfs_fs_copy);
+
+ INIT_SYM(reiserfs_fs_is_resizeable);
+ INIT_SYM(reiserfs_fs_is_consistent);
+
+ INIT_SYM(reiserfs_fs_bitmap_check);
+ INIT_SYM(reiserfs_fs_bitmap_used);
+
+ INIT_SYM(reiserfs_fs_min_size);
+ INIT_SYM(reiserfs_fs_block_size);
+
+ INIT_SYM(reiserfs_fs_host_dal);
+ INIT_SYM(reiserfs_fs_close);
+
+ INIT_SYM(libreiserfs_gauge_create);
+ INIT_SYM(libreiserfs_gauge_free);
+
+ INIT_SYM(dal_realize);
+ INIT_SYM(dal_flags);
+
+ INIT_SYM(dal_block_size);
+ INIT_SYM(dal_len);
+
+ return 1;
+
+error_free_libreiserfs_handle:
+ dlclose(libreiserfs_handle);
+error:
+ return 0;
+}
+
+static void reiserfs_ops_done()
+{
+ if (libdal_handle)
+ dlclose(libdal_handle);
+ if (libreiserfs_handle)
+ dlclose(libreiserfs_handle);
+}
+#endif /* DYNAMIC_LOADING */
+
+#define REISER_BLOCK_SIZES ((int[]){512, 1024, 2048, 4096, 8192, 0})
+
+#ifdef REISER_FULL_SUPPORT
+static PedFileSystemOps reiserfs_full_ops = {
+ probe: reiserfs_probe,
+ clobber: reiserfs_clobber,
+ open: reiserfs_open,
+ create: reiserfs_create,
+ close: reiserfs_close,
+ check: reiserfs_check,
+ copy: reiserfs_copy,
+ resize: reiserfs_resize,
+ get_create_constraint: reiserfs_get_create_constraint,
+ get_resize_constraint: reiserfs_get_resize_constraint,
+ get_copy_constraint: reiserfs_get_copy_constraint
+};
+
+static PedFileSystemType reiserfs_full_type = {
+ next: NULL,
+ ops: &reiserfs_full_ops,
+ name: "reiserfs",
+ block_sizes: REISER_BLOCK_SIZES
+};
+#endif /* REISER_FULL_SUPPORT */
+
+static PedFileSystemOps reiserfs_simple_ops = {
+ probe: reiserfs_probe,
+#ifdef DISCOVER_ONLY
+ clobber: NULL,
+#else
+ clobber: reiserfs_clobber,
+#endif
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ copy: NULL,
+ resize: NULL,
+ get_create_constraint: NULL,
+ get_resize_constraint: NULL,
+ get_copy_constraint: NULL
+};
+
+static PedFileSystemType reiserfs_simple_type = {
+ next: NULL,
+ ops: &reiserfs_simple_ops,
+ name: "reiserfs",
+ block_sizes: REISER_BLOCK_SIZES
+};
+
+void ped_file_system_reiserfs_init()
+{
+#ifdef DYNAMIC_LOADING
+ libreiserfs_present = reiserfs_ops_init();
+ if (libreiserfs_present) {
+ reiserfs_type = &reiserfs_full_type;
+ libreiserfs_exception_set_handler(exception_handler);
+ } else {
+ reiserfs_type = &reiserfs_simple_type;
+ }
+#else /* !DYNAMIC_LOADING */
+#ifdef REISER_FULL_SUPPORT
+ libreiserfs_exception_set_handler(exception_handler);
+ reiserfs_type = &reiserfs_full_type;
+#else
+ reiserfs_type = &reiserfs_simple_type;
+#endif
+#endif /* !DYNAMIC_LOADING */
+ ped_file_system_type_register(reiserfs_type);
+}
+
+void ped_file_system_reiserfs_done()
+{
+ ped_file_system_type_unregister(reiserfs_type);
+#ifdef DYNAMIC_LOADING
+ reiserfs_ops_done();
+#endif /* DYNAMIC_LOADING */
+}
+
diff --git a/libparted/fs/reiserfs/reiserfs.h b/libparted/fs/reiserfs/reiserfs.h
new file mode 100644
index 0000000..67bf9bf
--- /dev/null
+++ b/libparted/fs/reiserfs/reiserfs.h
@@ -0,0 +1,109 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef REISERFS_H
+#define REISERFS_H
+
+#define REISERFS_API_VERSION 0
+
+#define REISERFS_SIGNATURE "ReIsErFs"
+#define REISER2FS_SIGNATURE "ReIsEr2Fs"
+#define REISER3FS_SIGNATURE "ReIsEr3Fs"
+
+#define DEFAULT_BLOCK_SIZE 4096
+
+struct reiserfs_super_block {
+ uint32_t s_block_count;
+ uint32_t s_free_blocks;
+ uint32_t s_root_block;
+ uint32_t s_journal_block;
+ uint32_t s_journal_dev;
+ uint32_t s_orig_journal_size;
+ uint32_t s_journal_trans_max;
+ uint32_t s_journal_block_count;
+ uint32_t s_journal_max_batch;
+ uint32_t s_journal_max_commit_age;
+ uint32_t s_journal_max_trans_age;
+ uint16_t s_blocksize;
+ uint16_t s_oid_maxsize;
+ uint16_t s_oid_cursize;
+ uint16_t s_state;
+ char s_magic[10];
+ uint16_t s_fsck_state;
+ uint32_t s_hash_function_code;
+ uint16_t s_tree_height;
+ uint16_t s_bmap_nr;
+ uint16_t s_version;
+ char padding[438];
+};
+
+typedef struct reiserfs_super_block reiserfs_super_block_t;
+
+enum reiserfs_exception_type {
+ EXCEPTION_INFORMATION = 1,
+ EXCEPTION_WARNING = 2,
+ EXCEPTION_ERROR = 3,
+ EXCEPTION_FATAL = 4,
+ EXCEPTION_BUG = 5,
+ EXCEPTION_NO_FEATURE = 6
+};
+
+typedef enum reiserfs_exception_type reiserfs_exception_type_t;
+
+enum reiserfs_exception_option {
+ EXCEPTION_UNHANDLED = 1 << 0,
+ EXCEPTION_FIX = 1 << 1,
+ EXCEPTION_YES = 1 << 2,
+ EXCEPTION_NO = 1 << 3,
+ EXCEPTION_OK = 1 << 4,
+ EXCEPTION_RETRY = 1 << 5,
+ EXCEPTION_IGNORE = 1 << 6,
+ EXCEPTION_CANCEL = 1 << 7
+};
+
+typedef enum reiserfs_exception_option reiserfs_exception_option_t;
+
+typedef void (reiserfs_gauge_handler_t)(const char *, unsigned int, void *, int, int, int);
+
+typedef void * reiserfs_exception_t;
+typedef void * reiserfs_gauge_t;
+typedef void * reiserfs_fs_t;
+
+#define FS_FORMAT_3_5 0
+#define FS_FORMAT_3_6 2
+
+#define SUPER_OFFSET_IN_BYTES 64*1024
+
+#define DEFAULT_JOURNAL_SIZE 8192
+
+#define JOURNAL_MIN_SIZE 512
+#define JOURNAL_MIN_TRANS 256
+#define JOURNAL_MAX_TRANS 1024
+
+#define JOURNAL_DEF_RATIO 8
+#define JOURNAL_MIN_RATIO 2
+#define JOURNAL_MAX_BATCH 900
+#define JOURNAL_MAX_COMMIT_AGE 30
+#define JOURNAL_MAX_TRANS_AGE 30
+
+#define TEA_HASH 1
+#define YURA_HASH 2
+#define R5_HASH 3
+
+#endif
diff --git a/libparted/fs/ufs/Makefile.am b/libparted/fs/ufs/Makefile.am
new file mode 100644
index 0000000..b506bd7
--- /dev/null
+++ b/libparted/fs/ufs/Makefile.am
@@ -0,0 +1,6 @@
+partedincludedir = -I$(top_srcdir)/include
+
+noinst_LTLIBRARIES = libufs.la
+libufs_la_SOURCES = ufs.c
+
+INCLUDES = $(partedincludedir) @INTLINCS@
diff --git a/libparted/fs/ufs/ufs.c b/libparted/fs/ufs/ufs.c
new file mode 100644
index 0000000..6428e7d
--- /dev/null
+++ b/libparted/fs/ufs/ufs.c
@@ -0,0 +1,325 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+
+ Contributor: Ben Collins <bcollins@debian.org>
+*/
+
+#include "config.h"
+
+#include <parted/parted.h>
+#include <parted/endian.h>
+#include <parted/debug.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+#include <unistd.h>
+#include <string.h>
+
+#define SUN_UFS_BLOCK_SIZES ((int[2]){512, 0})
+#define HP_UFS_BLOCK_SIZES ((int[2]){512, 0})
+
+
+/* taken from ufs_fs.h in Linux */
+#define UFS_MAXNAMLEN 255
+#define UFS_MAXMNTLEN 512
+#define UFS_MAXCSBUFS 31
+#define UFS_LINK_MAX 32000
+
+#define UFS_MAGIC 0x00011954
+#define UFS_MAGIC_LFN 0x00095014
+#define UFS_MAGIC_FEA 0x00195612
+#define UFS_MAGIC_4GB 0x05231994
+
+struct ufs_csum {
+ uint32_t cs_ndir; /* number of directories */
+ uint32_t cs_nbfree; /* number of free blocks */
+ uint32_t cs_nifree; /* number of free inodes */
+ uint32_t cs_nffree; /* number of free frags */
+};
+
+struct ufs_super_block {
+ uint32_t fs_link; /* UNUSED */
+ uint32_t fs_rlink; /* UNUSED */
+ uint32_t fs_sblkno; /* addr of super-block in filesys */
+ uint32_t fs_cblkno; /* offset of cyl-block in filesys */
+ uint32_t fs_iblkno; /* offset of inode-blocks in filesys */
+ uint32_t fs_dblkno; /* offset of first data after cg */
+ uint32_t fs_cgoffset; /* cylinder group offset in cylinder */
+ uint32_t fs_cgmask; /* used to calc mod fs_ntrak */
+ uint32_t fs_time; /* last time written -- time_t */
+ uint32_t fs_size; /* number of blocks in fs */
+ uint32_t fs_dsize; /* number of data blocks in fs */
+ uint32_t fs_ncg; /* number of cylinder groups */
+ uint32_t fs_bsize; /* size of basic blocks in fs */
+ uint32_t fs_fsize; /* size of frag blocks in fs */
+ uint32_t fs_frag; /* number of frags in a block in fs */
+/* these are configuration parameters */
+ uint32_t fs_minfree; /* minimum percentage of free blocks */
+ uint32_t fs_rotdelay; /* num of ms for optimal next block */
+ uint32_t fs_rps; /* disk revolutions per second */
+/* these fields can be computed from the others */
+ uint32_t fs_bmask; /* ``blkoff'' calc of blk offsets */
+ uint32_t fs_fmask; /* ``fragoff'' calc of frag offsets */
+ uint32_t fs_bshift; /* ``lblkno'' calc of logical blkno */
+ uint32_t fs_fshift; /* ``numfrags'' calc number of frags */
+/* these are configuration parameters */
+ uint32_t fs_maxcontig; /* max number of contiguous blks */
+ uint32_t fs_maxbpg; /* max number of blks per cyl group */
+/* these fields can be computed from the others */
+ uint32_t fs_fragshift; /* block to frag shift */
+ uint32_t fs_fsbtodb; /* fsbtodb and dbtofsb shift constant */
+ uint32_t fs_sbsize; /* actual size of super block */
+ uint32_t fs_csmask; /* csum block offset */
+ uint32_t fs_csshift; /* csum block number */
+ uint32_t fs_nindir; /* value of NINDIR */
+ uint32_t fs_inopb; /* value of INOPB */
+ uint32_t fs_nspf; /* value of NSPF */
+/* yet another configuration parameter */
+ uint32_t fs_optim; /* optimization preference, see below */
+/* these fields are derived from the hardware */
+ union {
+ struct {
+ uint32_t fs_npsect; /* # sectors/track including spares */
+ } fs_sun;
+ struct {
+ int32_t fs_state; /* file system state time stamp */
+ } fs_sunx86;
+ } fs_u1;
+ uint32_t fs_interleave; /* hardware sector interleave */
+ uint32_t fs_trackskew; /* sector 0 skew, per track */
+/* a unique id for this file system (currently unused and unmaintained) */
+/* In 4.3 Tahoe this space is used by fs_headswitch and fs_trkseek */
+/* Neither of those fields is used in the Tahoe code right now but */
+/* there could be problems if they are. */
+ uint32_t fs_id[2]; /* file system id */
+/* sizes determined by number of cylinder groups and their sizes */
+ uint32_t fs_csaddr; /* blk addr of cyl grp summary area */
+ uint32_t fs_cssize; /* size of cyl grp summary area */
+ uint32_t fs_cgsize; /* cylinder group size */
+/* these fields are derived from the hardware */
+ uint32_t fs_ntrak; /* tracks per cylinder */
+ uint32_t fs_nsect; /* sectors per track */
+ uint32_t fs_spc; /* sectors per cylinder */
+/* this comes from the disk driver partitioning */
+ uint32_t fs_ncyl; /* cylinders in file system */
+/* these fields can be computed from the others */
+ uint32_t fs_cpg; /* cylinders per group */
+ uint32_t fs_ipg; /* inodes per group */
+ uint32_t fs_fpg; /* blocks per group * fs_frag */
+/* this data must be re-computed after crashes */
+ struct ufs_csum fs_cstotal; /* cylinder summary information */
+/* these fields are cleared at mount time */
+ int8_t fs_fmod; /* super block modified flag */
+ int8_t fs_clean; /* file system is clean flag */
+ int8_t fs_ronly; /* mounted read-only flag */
+ int8_t fs_flags; /* currently unused flag */
+ int8_t fs_fsmnt[UFS_MAXMNTLEN]; /* name mounted on */
+/* these fields retain the current block allocation info */
+ uint32_t fs_cgrotor; /* last cg searched */
+ uint32_t fs_csp[UFS_MAXCSBUFS]; /* list of fs_cs info buffers */
+ uint32_t fs_maxcluster;
+ uint32_t fs_cpc; /* cyl per cycle in postbl */
+ uint16_t fs_opostbl[16][8]; /* old rotation block list head */
+ union {
+ struct {
+ int32_t fs_sparecon[53];/* reserved for future constants */
+ int32_t fs_reclaim;
+ int32_t fs_sparecon2[1];
+ int32_t fs_state; /* file system state time stamp */
+ uint32_t fs_qbmask[2]; /* ~usb_bmask */
+ uint32_t fs_qfmask[2]; /* ~usb_fmask */
+ } fs_sun;
+ struct {
+ int32_t fs_sparecon[53];/* reserved for future constants */
+ int32_t fs_reclaim;
+ int32_t fs_sparecon2[1];
+ uint32_t fs_npsect; /* # sectors/track including spares */
+ uint32_t fs_qbmask[2]; /* ~usb_bmask */
+ uint32_t fs_qfmask[2]; /* ~usb_fmask */
+ } fs_sunx86;
+ struct {
+ int32_t fs_sparecon[50];/* reserved for future constants */
+ int32_t fs_contigsumsize;/* size of cluster summary array */
+ int32_t fs_maxsymlinklen;/* max length of an internal symlink */
+ int32_t fs_inodefmt; /* format of on-disk inodes */
+ uint32_t fs_maxfilesize[2]; /* max representable file size */
+ uint32_t fs_qbmask[2]; /* ~usb_bmask */
+ uint32_t fs_qfmask[2]; /* ~usb_fmask */
+ int32_t fs_state; /* file system state time stamp */
+ } fs_44;
+ } fs_u2;
+ int32_t fs_postblformat; /* format of positional layout tables */
+ int32_t fs_nrpos; /* number of rotational positions */
+ int32_t fs_postbloff; /* (__s16) rotation block list head */
+ int32_t fs_rotbloff; /* (uint8_t) blocks for each rotation */
+ int32_t fs_magic; /* magic number */
+ uint8_t fs_space[4]; /* list of blocks for each rotation */
+};
+
+static PedGeometry*
+ufs_probe_sun (PedGeometry* geom)
+{
+ int8_t buf[512 * 3];
+ struct ufs_super_block *sb;
+
+ if (geom->length < 5)
+ return 0;
+ if (!ped_geometry_read (geom, buf, 16, 3))
+ return 0;
+
+ sb = (struct ufs_super_block *)buf;
+
+ if (PED_BE32_TO_CPU(sb->fs_magic) == UFS_MAGIC) {
+ PedSector block_size = PED_BE32_TO_CPU(sb->fs_bsize) / 512;
+ PedSector block_count = PED_BE32_TO_CPU(sb->fs_size);
+ return ped_geometry_new (geom->dev, geom->start,
+ block_size * block_count);
+ }
+ if (PED_LE32_TO_CPU(sb->fs_magic) == UFS_MAGIC) {
+ PedSector block_size = PED_LE32_TO_CPU(sb->fs_bsize) / 512;
+ PedSector block_count = PED_LE32_TO_CPU(sb->fs_size);
+ return ped_geometry_new (geom->dev, geom->start,
+ block_size * block_count);
+ }
+ return NULL;
+}
+
+static PedGeometry*
+ufs_probe_hp (PedGeometry* geom)
+{
+ int8_t buf[1536];
+ struct ufs_super_block *sb;
+ PedSector block_size;
+ PedSector block_count;
+
+ if (geom->length < 5)
+ return 0;
+ if (!ped_geometry_read (geom, buf, 16, 3))
+ return 0;
+
+ sb = (struct ufs_super_block *)buf;
+
+ /* Try sane bytesex */
+ switch (PED_BE32_TO_CPU(sb->fs_magic)) {
+ case UFS_MAGIC_LFN:
+ case UFS_MAGIC_FEA:
+ case UFS_MAGIC_4GB:
+ block_size = PED_BE32_TO_CPU(sb->fs_bsize) / 512;
+ block_count = PED_BE32_TO_CPU(sb->fs_size);
+ return ped_geometry_new (geom->dev, geom->start,
+ block_size * block_count);
+ }
+
+ /* Try perverted bytesex */
+ switch (PED_LE32_TO_CPU(sb->fs_magic)) {
+ case UFS_MAGIC_LFN:
+ case UFS_MAGIC_FEA:
+ case UFS_MAGIC_4GB:
+ block_size = PED_LE32_TO_CPU(sb->fs_bsize) / 512;
+ block_count = PED_LE32_TO_CPU(sb->fs_size);
+ return ped_geometry_new (geom->dev, geom->start,
+ block_size * block_count);
+ }
+ return NULL;
+}
+
+#ifndef DISCOVER_ONLY
+static int
+ufs_clobber (PedGeometry* geom)
+{
+ char buf[1536];
+
+ if (!ped_geometry_read (geom, buf, 16, 3))
+ return 0;
+
+ memset (buf, 0, sizeof(struct ufs_super_block));
+
+ return ped_geometry_write (geom, buf, 16, 3);
+}
+#endif /* !DISCOVER_ONLY */
+
+static PedFileSystemOps ufs_ops_sun = {
+ probe: ufs_probe_sun,
+#ifndef DISCOVER_ONLY
+ clobber: ufs_clobber,
+#else
+ clobber: NULL,
+#endif
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ copy: NULL,
+ resize: NULL,
+ get_create_constraint: NULL,
+ get_resize_constraint: NULL,
+ get_copy_constraint: NULL
+};
+
+static PedFileSystemOps ufs_ops_hp = {
+ probe: ufs_probe_hp,
+#ifndef DISCOVER_ONLY
+ clobber: ufs_clobber,
+#else
+ clobber: NULL,
+#endif
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ copy: NULL,
+ resize: NULL,
+ get_create_constraint: NULL,
+ get_resize_constraint: NULL,
+ get_copy_constraint: NULL
+};
+
+static PedFileSystemType ufs_type_sun = {
+ next: NULL,
+ ops: &ufs_ops_sun,
+ name: "sun-ufs",
+ block_sizes: SUN_UFS_BLOCK_SIZES
+};
+
+static PedFileSystemType ufs_type_hp = {
+ next: NULL,
+ ops: &ufs_ops_hp,
+ name: "hp-ufs",
+ block_sizes: HP_UFS_BLOCK_SIZES
+};
+
+void
+ped_file_system_ufs_init ()
+{
+ PED_ASSERT (sizeof (struct ufs_super_block) == 1380, return);
+
+ ped_file_system_type_register (&ufs_type_sun);
+ ped_file_system_type_register (&ufs_type_hp);
+}
+
+void
+ped_file_system_ufs_done ()
+{
+ ped_file_system_type_unregister (&ufs_type_hp);
+ ped_file_system_type_unregister (&ufs_type_sun);
+}
diff --git a/libparted/fs/xfs/Makefile.am b/libparted/fs/xfs/Makefile.am
new file mode 100644
index 0000000..84ab926
--- /dev/null
+++ b/libparted/fs/xfs/Makefile.am
@@ -0,0 +1,6 @@
+partedincludedir = -I$(top_srcdir)/include
+
+noinst_LTLIBRARIES = libxfs.la
+libxfs_la_SOURCES = xfs.c xfs_sb.h xfs_types.h platform_defs.h
+
+INCLUDES = $(partedincludedir) @INTLINCS@
diff --git a/libparted/fs/xfs/platform_defs.h b/libparted/fs/xfs/platform_defs.h
new file mode 100644
index 0000000..a2b45b9
--- /dev/null
+++ b/libparted/fs/xfs/platform_defs.h
@@ -0,0 +1,115 @@
+/* include/platform_defs.h. Generated automatically by configure. */
+/*
+ * Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like. Any license provided herein, whether implied or
+ * otherwise, applies only to this software file. Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston MA 02110-1301, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA 94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ *
+ * @configure_input@
+ */
+#ifndef __XFS_PLATFORM_DEFS_H__
+#define __XFS_PLATFORM_DEFS_H__
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <endian.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/param.h>
+#include <sys/types.h>
+
+#if (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 1)
+# define constpp const char * const *
+#else
+# define constpp char * const *
+#endif
+
+#ifdef __sparc__
+# ifndef O_DIRECT
+# define O_DIRECT 0x100000
+# endif
+#endif
+
+typedef loff_t xfs_off_t;
+typedef uint64_t xfs_ino_t;
+typedef uint32_t xfs_dev_t;
+typedef int64_t xfs_daddr_t;
+typedef char* xfs_caddr_t;
+
+/* long and pointer must be either 32 bit or 64 bit */
+/* #undef HAVE_64BIT_LONG */
+#define HAVE_32BIT_LONG 1
+#define HAVE_32BIT_PTR 1
+/* #undef HAVE_64BIT_PTR */
+
+/* Check if __psint_t is set to something meaningful */
+/* #undef HAVE___PSINT_T */
+#ifndef HAVE___PSINT_T
+# ifdef HAVE_32BIT_PTR
+typedef int __psint_t;
+# elif defined HAVE_64BIT_PTR
+# ifdef HAVE_64BIT_LONG
+typedef long __psint_t;
+# else
+/* This is a very strange architecture, which has 64 bit pointers but
+ * not 64 bit longs. So, I'd just punt here and assume long long is Ok */
+typedef long long __psint_t;
+# endif
+# else
+# error Unknown pointer size
+# endif
+#endif
+
+/* Check if __psunsigned_t is set to something meaningful */
+/* #undef HAVE___PSUNSIGNED_T */
+#ifndef HAVE___PSUNSIGNED_T
+# ifdef HAVE_32BIT_PTR
+typedef unsigned int __psunsigned_t;
+# elif defined HAVE_64BIT_PTR
+# ifdef HAVE_64BIT_LONG
+typedef long __psunsigned_t;
+# else
+/* This is a very strange architecture, which has 64 bit pointers but
+ * not 64 bit longs. So, I'd just punt here and assume long long is Ok */
+typedef unsigned long long __psunsigned_t;
+# endif
+# else
+# error Unknown pointer size
+# endif
+#endif
+
+#ifdef DEBUG
+# define ASSERT assert
+#else
+# define ASSERT(EX) ((void) 0)
+#endif
+
+#endif /* __XFS_PLATFORM_DEFS_H__ */
diff --git a/libparted/fs/xfs/xfs.c b/libparted/fs/xfs/xfs.c
new file mode 100644
index 0000000..e583442
--- /dev/null
+++ b/libparted/fs/xfs/xfs.c
@@ -0,0 +1,122 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#include "config.h"
+
+#include <parted/parted.h>
+#include <parted/endian.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+#include <uuid/uuid.h>
+#include "platform_defs.h"
+#include "xfs_types.h"
+#include "xfs_sb.h"
+
+#include <string.h>
+
+#define XFS_BLOCK_SIZES ((int[2]){512, 0})
+
+static PedGeometry*
+xfs_probe (PedGeometry* geom)
+{
+ PedSector block_size;
+ PedSector block_count;
+ union {
+ struct xfs_sb sb;
+ char bytes [512];
+ } buf;
+
+ if (geom->length < XFS_SB_DADDR + 1)
+ return NULL;
+ if (!ped_geometry_read (geom, &buf, XFS_SB_DADDR, 1))
+ return NULL;
+
+ if (PED_LE32_TO_CPU (buf.sb.sb_magicnum) == XFS_SB_MAGIC) {
+ block_size = PED_LE32_TO_CPU (buf.sb.sb_blocksize) / 512;
+ block_count = PED_LE64_TO_CPU (buf.sb.sb_dblocks);
+
+ return ped_geometry_new (geom->dev, geom->start,
+ block_size * block_count);
+ }
+
+ if (PED_BE32_TO_CPU (buf.sb.sb_magicnum) == XFS_SB_MAGIC) {
+ block_size = PED_BE32_TO_CPU (buf.sb.sb_blocksize) / 512;
+ block_count = PED_BE64_TO_CPU (buf.sb.sb_dblocks);
+
+ return ped_geometry_new (geom->dev, geom->start,
+ block_size * block_count);
+ }
+
+ return NULL;
+}
+
+#ifndef DISCOVER_ONLY
+static int
+xfs_clobber (PedGeometry* geom)
+{
+ char buf[512];
+
+ memset (buf, 0, 512);
+ return ped_geometry_write (geom, buf, XFS_SB_DADDR, 1);
+}
+#endif /* !DISCOVER_ONLY */
+
+static PedFileSystemOps xfs_ops = {
+ probe: xfs_probe,
+#ifndef DISCOVER_ONLY
+ clobber: xfs_clobber,
+#else
+ clobber: NULL,
+#endif
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ copy: NULL,
+ resize: NULL,
+ get_create_constraint: NULL,
+ get_resize_constraint: NULL,
+ get_copy_constraint: NULL
+};
+
+static PedFileSystemType xfs_type = {
+ next: NULL,
+ ops: &xfs_ops,
+ name: "xfs",
+ block_sizes: XFS_BLOCK_SIZES
+};
+
+void
+ped_file_system_xfs_init ()
+{
+ ped_file_system_type_register (&xfs_type);
+}
+
+void
+ped_file_system_xfs_done ()
+{
+ ped_file_system_type_unregister (&xfs_type);
+}
+
diff --git a/libparted/fs/xfs/xfs_sb.h b/libparted/fs/xfs/xfs_sb.h
new file mode 100644
index 0000000..1411c47
--- /dev/null
+++ b/libparted/fs/xfs/xfs_sb.h
@@ -0,0 +1,490 @@
+/*
+ * Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like. Any license provided herein, whether implied or
+ * otherwise, applies only to this software file. Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston MA 02110-1301, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA 94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ */
+#ifndef __XFS_SB_H__
+#define __XFS_SB_H__
+
+/*
+ * Super block
+ * Fits into a 512-byte buffer at daddr_t 0 of each allocation group.
+ * Only the first of these is ever updated except during growfs.
+ */
+
+struct xfs_buf;
+struct xfs_mount;
+
+#define XFS_SB_MAGIC 0x58465342 /* 'XFSB' */
+#define XFS_SB_VERSION_1 1 /* 5.3, 6.0.1, 6.1 */
+#define XFS_SB_VERSION_2 2 /* 6.2 - attributes */
+#define XFS_SB_VERSION_3 3 /* 6.2 - new inode version */
+#define XFS_SB_VERSION_4 4 /* 6.2+ - bitmask version */
+#define XFS_SB_VERSION_NUMBITS 0x000f
+#define XFS_SB_VERSION_ALLFBITS 0xfff0
+#define XFS_SB_VERSION_SASHFBITS 0xf000
+#define XFS_SB_VERSION_REALFBITS 0x0ff0
+#define XFS_SB_VERSION_ATTRBIT 0x0010
+#define XFS_SB_VERSION_NLINKBIT 0x0020
+#define XFS_SB_VERSION_QUOTABIT 0x0040
+#define XFS_SB_VERSION_ALIGNBIT 0x0080
+#define XFS_SB_VERSION_DALIGNBIT 0x0100
+#define XFS_SB_VERSION_SHAREDBIT 0x0200
+#define XFS_SB_VERSION_EXTFLGBIT 0x1000
+#define XFS_SB_VERSION_DIRV2BIT 0x2000
+#define XFS_SB_VERSION_OKSASHFBITS \
+ (XFS_SB_VERSION_EXTFLGBIT | \
+ XFS_SB_VERSION_DIRV2BIT)
+#define XFS_SB_VERSION_OKREALFBITS \
+ (XFS_SB_VERSION_ATTRBIT | \
+ XFS_SB_VERSION_NLINKBIT | \
+ XFS_SB_VERSION_QUOTABIT | \
+ XFS_SB_VERSION_ALIGNBIT | \
+ XFS_SB_VERSION_DALIGNBIT | \
+ XFS_SB_VERSION_SHAREDBIT)
+#define XFS_SB_VERSION_OKSASHBITS \
+ (XFS_SB_VERSION_NUMBITS | \
+ XFS_SB_VERSION_REALFBITS | \
+ XFS_SB_VERSION_OKSASHFBITS)
+#define XFS_SB_VERSION_OKREALBITS \
+ (XFS_SB_VERSION_NUMBITS | \
+ XFS_SB_VERSION_OKREALFBITS | \
+ XFS_SB_VERSION_OKSASHFBITS)
+#define XFS_SB_VERSION_MKFS(ia,dia,extflag,dirv2) \
+ (((ia) || (dia) || (extflag) || (dirv2)) ? \
+ (XFS_SB_VERSION_4 | \
+ ((ia) ? XFS_SB_VERSION_ALIGNBIT : 0) | \
+ ((dia) ? XFS_SB_VERSION_DALIGNBIT : 0) | \
+ ((extflag) ? XFS_SB_VERSION_EXTFLGBIT : 0) | \
+ ((dirv2) ? XFS_SB_VERSION_DIRV2BIT : 0)) : \
+ XFS_SB_VERSION_1)
+
+typedef struct xfs_sb
+{
+ uint32_t sb_magicnum; /* magic number == XFS_SB_MAGIC */
+ uint32_t sb_blocksize; /* logical block size, bytes */
+ xfs_drfsbno_t sb_dblocks; /* number of data blocks */
+ xfs_drfsbno_t sb_rblocks; /* number of realtime blocks */
+ xfs_drtbno_t sb_rextents; /* number of realtime extents */
+ uuid_t sb_uuid; /* file system unique id */
+ xfs_dfsbno_t sb_logstart; /* starting block of log if internal */
+ xfs_ino_t sb_rootino; /* root inode number */
+ xfs_ino_t sb_rbmino; /* bitmap inode for realtime extents */
+ xfs_ino_t sb_rsumino; /* summary inode for rt bitmap */
+ xfs_agblock_t sb_rextsize; /* realtime extent size, blocks */
+ xfs_agblock_t sb_agblocks; /* size of an allocation group */
+ xfs_agnumber_t sb_agcount; /* number of allocation groups */
+ xfs_extlen_t sb_rbmblocks; /* number of rt bitmap blocks */
+ xfs_extlen_t sb_logblocks; /* number of log blocks */
+ uint16_t sb_versionnum; /* header version == XFS_SB_VERSION */
+ uint16_t sb_sectsize; /* volume sector size, bytes */
+ uint16_t sb_inodesize; /* inode size, bytes */
+ uint16_t sb_inopblock; /* inodes per block */
+ char sb_fname[12]; /* file system name */
+ uint8_t sb_blocklog; /* log2 of sb_blocksize */
+ uint8_t sb_sectlog; /* log2 of sb_sectsize */
+ uint8_t sb_inodelog; /* log2 of sb_inodesize */
+ uint8_t sb_inopblog; /* log2 of sb_inopblock */
+ uint8_t sb_agblklog; /* log2 of sb_agblocks (rounded up) */
+ uint8_t sb_rextslog; /* log2 of sb_rextents */
+ uint8_t sb_inprogress; /* mkfs is in progress, don't mount */
+ uint8_t sb_imax_pct; /* max % of fs for inode space */
+ /* statistics */
+ /*
+ * These fields must remain contiguous. If you really
+ * want to change their layout, make sure you fix the
+ * code in xfs_trans_apply_sb_deltas().
+ */
+ uint64_t sb_icount; /* allocated inodes */
+ uint64_t sb_ifree; /* free inodes */
+ uint64_t sb_fdblocks; /* free data blocks */
+ uint64_t sb_frextents; /* free realtime extents */
+ /*
+ * End contiguous fields.
+ */
+ xfs_ino_t sb_uquotino; /* user quota inode */
+ xfs_ino_t sb_gquotino; /* group quota inode */
+ uint16_t sb_qflags; /* quota flags */
+ uint8_t sb_flags; /* misc. flags */
+ uint8_t sb_shared_vn; /* shared version number */
+ xfs_extlen_t sb_inoalignmt; /* inode chunk alignment, fsblocks */
+ uint32_t sb_unit; /* stripe or raid unit */
+ uint32_t sb_width; /* stripe or raid width */
+ uint8_t sb_dirblklog; /* log2 of dir block size (fsbs) */
+ uint8_t sb_dummy[7]; /* padding */
+} xfs_sb_t;
+
+/*
+ * Sequence number values for the fields.
+ */
+typedef enum {
+ XFS_SBS_MAGICNUM, XFS_SBS_BLOCKSIZE, XFS_SBS_DBLOCKS, XFS_SBS_RBLOCKS,
+ XFS_SBS_REXTENTS, XFS_SBS_UUID, XFS_SBS_LOGSTART, XFS_SBS_ROOTINO,
+ XFS_SBS_RBMINO, XFS_SBS_RSUMINO, XFS_SBS_REXTSIZE, XFS_SBS_AGBLOCKS,
+ XFS_SBS_AGCOUNT, XFS_SBS_RBMBLOCKS, XFS_SBS_LOGBLOCKS,
+ XFS_SBS_VERSIONNUM, XFS_SBS_SECTSIZE, XFS_SBS_INODESIZE,
+ XFS_SBS_INOPBLOCK, XFS_SBS_FNAME, XFS_SBS_BLOCKLOG,
+ XFS_SBS_SECTLOG, XFS_SBS_INODELOG, XFS_SBS_INOPBLOG, XFS_SBS_AGBLKLOG,
+ XFS_SBS_REXTSLOG, XFS_SBS_INPROGRESS, XFS_SBS_IMAX_PCT, XFS_SBS_ICOUNT,
+ XFS_SBS_IFREE, XFS_SBS_FDBLOCKS, XFS_SBS_FREXTENTS, XFS_SBS_UQUOTINO,
+ XFS_SBS_GQUOTINO, XFS_SBS_QFLAGS, XFS_SBS_FLAGS, XFS_SBS_SHARED_VN,
+ XFS_SBS_INOALIGNMT, XFS_SBS_UNIT, XFS_SBS_WIDTH, XFS_SBS_DIRBLKLOG,
+ XFS_SBS_DUMMY,
+ XFS_SBS_FIELDCOUNT
+} xfs_sb_field_t;
+
+/*
+ * Mask values, defined based on the xfs_sb_field_t values.
+ * Only define the ones we're using.
+ */
+#define XFS_SB_MVAL(x) (1LL << XFS_SBS_ ## x)
+#define XFS_SB_UUID XFS_SB_MVAL(UUID)
+#define XFS_SB_FNAME XFS_SB_MVAL(FNAME)
+#define XFS_SB_ROOTINO XFS_SB_MVAL(ROOTINO)
+#define XFS_SB_RBMINO XFS_SB_MVAL(RBMINO)
+#define XFS_SB_RSUMINO XFS_SB_MVAL(RSUMINO)
+#define XFS_SB_VERSIONNUM XFS_SB_MVAL(VERSIONNUM)
+#define XFS_SB_UQUOTINO XFS_SB_MVAL(UQUOTINO)
+#define XFS_SB_GQUOTINO XFS_SB_MVAL(GQUOTINO)
+#define XFS_SB_QFLAGS XFS_SB_MVAL(QFLAGS)
+#define XFS_SB_SHARED_VN XFS_SB_MVAL(SHARED_VN)
+#define XFS_SB_UNIT XFS_SB_MVAL(UNIT)
+#define XFS_SB_WIDTH XFS_SB_MVAL(WIDTH)
+#define XFS_SB_NUM_BITS ((int)XFS_SBS_FIELDCOUNT)
+#define XFS_SB_ALL_BITS ((1LL << XFS_SB_NUM_BITS) - 1)
+#define XFS_SB_MOD_BITS \
+ (XFS_SB_UUID | XFS_SB_ROOTINO | XFS_SB_RBMINO | XFS_SB_RSUMINO | \
+ XFS_SB_VERSIONNUM | XFS_SB_UQUOTINO | XFS_SB_GQUOTINO | \
+ XFS_SB_QFLAGS | XFS_SB_SHARED_VN | XFS_SB_UNIT | XFS_SB_WIDTH)
+
+/*
+ * Misc. Flags - warning - these will be cleared by xfs_repair unless
+ * a feature bit is set when the flag is used.
+ */
+#define XFS_SBF_NOFLAGS 0x00 /* no flags set */
+#define XFS_SBF_READONLY 0x01 /* only read-only mounts allowed */
+
+/*
+ * define max. shared version we can interoperate with
+ */
+#define XFS_SB_MAX_SHARED_VN 0
+
+#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_NUM)
+int xfs_sb_version_num(xfs_sb_t *sbp);
+#define XFS_SB_VERSION_NUM(sbp) xfs_sb_version_num(sbp)
+#else
+#define XFS_SB_VERSION_NUM(sbp) ((sbp)->sb_versionnum & XFS_SB_VERSION_NUMBITS)
+#endif
+
+#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_GOOD_VERSION)
+int xfs_sb_good_version(xfs_sb_t *sbp);
+#define XFS_SB_GOOD_VERSION(sbp) xfs_sb_good_version(sbp)
+#else
+#define XFS_SB_GOOD_VERSION_INT(sbp) \
+ ((((sbp)->sb_versionnum >= XFS_SB_VERSION_1) && \
+ ((sbp)->sb_versionnum <= XFS_SB_VERSION_3)) || \
+ ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
+ !((sbp)->sb_versionnum & ~XFS_SB_VERSION_OKREALBITS)
+#ifdef __KERNEL__
+#define XFS_SB_GOOD_VERSION(sbp) \
+ (XFS_SB_GOOD_VERSION_INT(sbp) && \
+ (sbp)->sb_shared_vn <= XFS_SB_MAX_SHARED_VN) ))
+#else
+/*
+ * extra 2 paren's here (( to unconfuse paren-matching editors
+ * like vi because XFS_SB_GOOD_VERSION_INT is a partial expression
+ * and the two XFS_SB_GOOD_VERSION's each 2 more close paren's to
+ * complete the expression.
+ */
+#define XFS_SB_GOOD_VERSION(sbp) \
+ (XFS_SB_GOOD_VERSION_INT(sbp) && \
+ (!((sbp)->sb_versionnum & XFS_SB_VERSION_SHAREDBIT) || \
+ (sbp)->sb_shared_vn <= XFS_SB_MAX_SHARED_VN)) ))
+#endif /* __KERNEL__ */
+#endif
+
+#define XFS_SB_GOOD_SASH_VERSION(sbp) \
+ ((((sbp)->sb_versionnum >= XFS_SB_VERSION_1) && \
+ ((sbp)->sb_versionnum <= XFS_SB_VERSION_3)) || \
+ ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
+ !((sbp)->sb_versionnum & ~XFS_SB_VERSION_OKSASHBITS)))
+
+#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_TONEW)
+unsigned xfs_sb_version_tonew(unsigned v);
+#define XFS_SB_VERSION_TONEW(v) xfs_sb_version_tonew(v)
+#else
+#define XFS_SB_VERSION_TONEW(v) \
+ ((((v) == XFS_SB_VERSION_1) ? \
+ 0 : \
+ (((v) == XFS_SB_VERSION_2) ? \
+ XFS_SB_VERSION_ATTRBIT : \
+ (XFS_SB_VERSION_ATTRBIT | XFS_SB_VERSION_NLINKBIT))) | \
+ XFS_SB_VERSION_4)
+#endif
+
+#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_TOOLD)
+unsigned xfs_sb_version_toold(unsigned v);
+#define XFS_SB_VERSION_TOOLD(v) xfs_sb_version_toold(v)
+#else
+#define XFS_SB_VERSION_TOOLD(v) \
+ (((v) & (XFS_SB_VERSION_QUOTABIT | XFS_SB_VERSION_ALIGNBIT)) ? \
+ 0 : \
+ (((v) & XFS_SB_VERSION_NLINKBIT) ? \
+ XFS_SB_VERSION_3 : \
+ (((v) & XFS_SB_VERSION_ATTRBIT) ? \
+ XFS_SB_VERSION_2 : \
+ XFS_SB_VERSION_1)))
+#endif
+
+#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_HASATTR)
+int xfs_sb_version_hasattr(xfs_sb_t *sbp);
+#define XFS_SB_VERSION_HASATTR(sbp) xfs_sb_version_hasattr(sbp)
+#else
+#define XFS_SB_VERSION_HASATTR(sbp) \
+ (((sbp)->sb_versionnum == XFS_SB_VERSION_2) || \
+ ((sbp)->sb_versionnum == XFS_SB_VERSION_3) || \
+ ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
+ ((sbp)->sb_versionnum & XFS_SB_VERSION_ATTRBIT)))
+#endif
+
+#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_ADDATTR)
+void xfs_sb_version_addattr(xfs_sb_t *sbp);
+#define XFS_SB_VERSION_ADDATTR(sbp) xfs_sb_version_addattr(sbp)
+#else
+#define XFS_SB_VERSION_ADDATTR(sbp) \
+ ((sbp)->sb_versionnum = \
+ (((sbp)->sb_versionnum == XFS_SB_VERSION_1) ? \
+ XFS_SB_VERSION_2 : \
+ ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) ? \
+ ((sbp)->sb_versionnum | XFS_SB_VERSION_ATTRBIT) : \
+ (XFS_SB_VERSION_4 | XFS_SB_VERSION_ATTRBIT))))
+#endif
+
+#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_HASNLINK)
+int xfs_sb_version_hasnlink(xfs_sb_t *sbp);
+#define XFS_SB_VERSION_HASNLINK(sbp) xfs_sb_version_hasnlink(sbp)
+#else
+#define XFS_SB_VERSION_HASNLINK(sbp) \
+ (((sbp)->sb_versionnum == XFS_SB_VERSION_3) || \
+ ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
+ ((sbp)->sb_versionnum & XFS_SB_VERSION_NLINKBIT)))
+#endif
+
+#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_ADDNLINK)
+void xfs_sb_version_addnlink(xfs_sb_t *sbp);
+#define XFS_SB_VERSION_ADDNLINK(sbp) xfs_sb_version_addnlink(sbp)
+#else
+#define XFS_SB_VERSION_ADDNLINK(sbp) \
+ ((sbp)->sb_versionnum = \
+ ((sbp)->sb_versionnum <= XFS_SB_VERSION_2 ? \
+ XFS_SB_VERSION_3 : \
+ ((sbp)->sb_versionnum | XFS_SB_VERSION_NLINKBIT)))
+#endif
+
+#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_HASQUOTA)
+int xfs_sb_version_hasquota(xfs_sb_t *sbp);
+#define XFS_SB_VERSION_HASQUOTA(sbp) xfs_sb_version_hasquota(sbp)
+#else
+#define XFS_SB_VERSION_HASQUOTA(sbp) \
+ ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
+ ((sbp)->sb_versionnum & XFS_SB_VERSION_QUOTABIT))
+#endif
+
+#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_ADDQUOTA)
+void xfs_sb_version_addquota(xfs_sb_t *sbp);
+#define XFS_SB_VERSION_ADDQUOTA(sbp) xfs_sb_version_addquota(sbp)
+#else
+#define XFS_SB_VERSION_ADDQUOTA(sbp) \
+ ((sbp)->sb_versionnum = \
+ (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 ? \
+ ((sbp)->sb_versionnum | XFS_SB_VERSION_QUOTABIT) : \
+ (XFS_SB_VERSION_TONEW((sbp)->sb_versionnum) | \
+ XFS_SB_VERSION_QUOTABIT)))
+#endif
+
+#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_HASALIGN)
+int xfs_sb_version_hasalign(xfs_sb_t *sbp);
+#define XFS_SB_VERSION_HASALIGN(sbp) xfs_sb_version_hasalign(sbp)
+#else
+#define XFS_SB_VERSION_HASALIGN(sbp) \
+ ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
+ ((sbp)->sb_versionnum & XFS_SB_VERSION_ALIGNBIT))
+#endif
+
+#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_SUBALIGN)
+void xfs_sb_version_subalign(xfs_sb_t *sbp);
+#define XFS_SB_VERSION_SUBALIGN(sbp) xfs_sb_version_subalign(sbp)
+#else
+#define XFS_SB_VERSION_SUBALIGN(sbp) \
+ ((sbp)->sb_versionnum = \
+ XFS_SB_VERSION_TOOLD((sbp)->sb_versionnum & ~XFS_SB_VERSION_ALIGNBIT))
+#endif
+
+#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_HASDALIGN)
+int xfs_sb_version_hasdalign(xfs_sb_t *sbp);
+#define XFS_SB_VERSION_HASDALIGN(sbp) xfs_sb_version_hasdalign(sbp)
+#else
+#define XFS_SB_VERSION_HASDALIGN(sbp) \
+ ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
+ ((sbp)->sb_versionnum & XFS_SB_VERSION_DALIGNBIT))
+#endif
+
+#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_ADDDALIGN)
+int xfs_sb_version_adddalign(xfs_sb_t *sbp);
+#define XFS_SB_VERSION_ADDDALIGN(sbp) xfs_sb_version_adddalign(sbp)
+#else
+#define XFS_SB_VERSION_ADDDALIGN(sbp) \
+ ((sbp)->sb_versionnum = \
+ ((sbp)->sb_versionnum | XFS_SB_VERSION_DALIGNBIT))
+#endif
+
+#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_HASSHARED)
+int xfs_sb_version_hasshared(xfs_sb_t *sbp);
+#define XFS_SB_VERSION_HASSHARED(sbp) xfs_sb_version_hasshared(sbp)
+#else
+#define XFS_SB_VERSION_HASSHARED(sbp) \
+ ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
+ ((sbp)->sb_versionnum & XFS_SB_VERSION_SHAREDBIT))
+#endif
+
+#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_ADDSHARED)
+int xfs_sb_version_addshared(xfs_sb_t *sbp);
+#define XFS_SB_VERSION_ADDSHARED(sbp) xfs_sb_version_addshared(sbp)
+#else
+#define XFS_SB_VERSION_ADDSHARED(sbp) \
+ ((sbp)->sb_versionnum = \
+ ((sbp)->sb_versionnum | XFS_SB_VERSION_SHAREDBIT))
+#endif
+
+#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_SUBSHARED)
+int xfs_sb_version_subshared(xfs_sb_t *sbp);
+#define XFS_SB_VERSION_SUBSHARED(sbp) xfs_sb_version_subshared(sbp)
+#else
+#define XFS_SB_VERSION_SUBSHARED(sbp) \
+ ((sbp)->sb_versionnum = \
+ ((sbp)->sb_versionnum & ~XFS_SB_VERSION_SHAREDBIT))
+#endif
+
+#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_HASDIRV2)
+int xfs_sb_version_hasdirv2(xfs_sb_t *sbp);
+#define XFS_SB_VERSION_HASDIRV2(sbp) xfs_sb_version_hasdirv2(sbp)
+#else
+#define XFS_SB_VERSION_HASDIRV2(sbp) \
+ ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
+ ((sbp)->sb_versionnum & XFS_SB_VERSION_DIRV2BIT))
+#endif
+
+#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_HASEXTFLGBIT)
+int xfs_sb_version_hasextflgbit(xfs_sb_t *sbp);
+#define XFS_SB_VERSION_HASEXTFLGBIT(sbp) xfs_sb_version_hasextflgbit(sbp)
+#else
+#define XFS_SB_VERSION_HASEXTFLGBIT(sbp) \
+ ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
+ ((sbp)->sb_versionnum & XFS_SB_VERSION_EXTFLGBIT))
+#endif
+
+#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_ADDEXTFLGBIT)
+int xfs_sb_version_addextflgbit(xfs_sb_t *sbp);
+#define XFS_SB_VERSION_ADDEXTFLGBIT(sbp) xfs_sb_version_addextflgbit(sbp)
+#else
+#define XFS_SB_VERSION_ADDEXTFLGBIT(sbp) \
+ ((sbp)->sb_versionnum = \
+ ((sbp)->sb_versionnum | XFS_SB_VERSION_EXTFLGBIT))
+#endif
+
+#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_SUBEXTFLGBIT)
+int xfs_sb_version_subextflgbit(xfs_sb_t *sbp);
+#define XFS_SB_VERSION_SUBEXTFLGBIT(sbp) xfs_sb_version_subextflgbit(sbp)
+#else
+#define XFS_SB_VERSION_SUBEXTFLGBIT(sbp) \
+ ((sbp)->sb_versionnum = \
+ ((sbp)->sb_versionnum & ~XFS_SB_VERSION_EXTFLGBIT))
+#endif
+
+/*
+ * end of superblock version macros
+ */
+
+#define XFS_SB_DADDR ((xfs_daddr_t)0) /* daddr in file system/ag */
+#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_BLOCK)
+xfs_agblock_t xfs_sb_block(struct xfs_mount *mp);
+#define XFS_SB_BLOCK(mp) xfs_sb_block(mp)
+#else
+#define XFS_SB_BLOCK(mp) XFS_HDR_BLOCK(mp, XFS_SB_DADDR)
+#endif
+
+#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_HDR_BLOCK)
+xfs_agblock_t xfs_hdr_block(struct xfs_mount *mp, xfs_daddr_t d);
+#define XFS_HDR_BLOCK(mp,d) xfs_hdr_block(mp,d)
+#else
+#define XFS_HDR_BLOCK(mp,d) ((xfs_agblock_t)(XFS_BB_TO_FSBT(mp,d)))
+#endif
+#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DADDR_TO_FSB)
+xfs_fsblock_t xfs_daddr_to_fsb(struct xfs_mount *mp, xfs_daddr_t d);
+#define XFS_DADDR_TO_FSB(mp,d) xfs_daddr_to_fsb(mp,d)
+#else
+#define XFS_DADDR_TO_FSB(mp,d) \
+ XFS_AGB_TO_FSB(mp, XFS_DADDR_TO_AGNO(mp,d), XFS_DADDR_TO_AGBNO(mp,d))
+#endif
+#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_FSB_TO_DADDR)
+xfs_daddr_t xfs_fsb_to_daddr(struct xfs_mount *mp, xfs_fsblock_t fsbno);
+#define XFS_FSB_TO_DADDR(mp,fsbno) xfs_fsb_to_daddr(mp,fsbno)
+#else
+#define XFS_FSB_TO_DADDR(mp,fsbno) \
+ XFS_AGB_TO_DADDR(mp, XFS_FSB_TO_AGNO(mp,fsbno), \
+ XFS_FSB_TO_AGBNO(mp,fsbno))
+#endif
+
+/*
+ * File system block to basic block conversions.
+ */
+#define XFS_FSB_TO_BB(mp,fsbno) ((fsbno) << (mp)->m_blkbb_log)
+#define XFS_BB_TO_FSB(mp,bb) \
+ (((bb) + (XFS_FSB_TO_BB(mp,1) - 1)) >> (mp)->m_blkbb_log)
+#define XFS_BB_TO_FSBT(mp,bb) ((bb) >> (mp)->m_blkbb_log)
+#define XFS_BB_FSB_OFFSET(mp,bb) ((bb) & ((mp)->m_bsize - 1))
+
+/*
+ * File system block to byte conversions.
+ */
+#define XFS_FSB_TO_B(mp,fsbno) ((xfs_fsize_t)(fsbno) << \
+ (mp)->m_sb.sb_blocklog)
+#define XFS_B_TO_FSB(mp,b) \
+ ((((uint64_t)(b)) + (mp)->m_blockmask) >> (mp)->m_sb.sb_blocklog)
+#define XFS_B_TO_FSBT(mp,b) (((uint64_t)(b)) >> (mp)->m_sb.sb_blocklog)
+#define XFS_B_FSB_OFFSET(mp,b) ((b) & (mp)->m_blockmask)
+
+#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BUF_TO_SBP)
+xfs_sb_t *xfs_buf_to_sbp(struct xfs_buf *bp);
+#define XFS_BUF_TO_SBP(bp) xfs_buf_to_sbp(bp)
+#else
+#define XFS_BUF_TO_SBP(bp) ((xfs_sb_t *)XFS_BUF_PTR(bp))
+#endif
+
+#endif /* __XFS_SB_H__ */
diff --git a/libparted/fs/xfs/xfs_types.h b/libparted/fs/xfs/xfs_types.h
new file mode 100644
index 0000000..e62dd53
--- /dev/null
+++ b/libparted/fs/xfs/xfs_types.h
@@ -0,0 +1,303 @@
+/*
+ * Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like. Any license provided herein, whether implied or
+ * otherwise, applies only to this software file. Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston MA 02110-1301, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA 94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ */
+#ifndef __XFS_TYPES_H__
+#define __XFS_TYPES_H__
+
+/*
+ * Some types are conditional based on the selected configuration.
+ * Set XFS_BIG_FILES=1 or 0 and XFS_BIG_FILESYSTEMS=1 or 0 depending
+ * on the desired configuration.
+ * XFS_BIG_FILES needs pgno_t to be 64 bits (64-bit kernels).
+ * XFS_BIG_FILESYSTEMS needs daddr_t to be 64 bits (N32 and 64-bit kernels).
+ *
+ * Expect these to be set from klocaldefs, or from the machine-type
+ * defs files for the normal case.
+ */
+
+#define XFS_BIG_FILES 1
+#define XFS_BIG_FILESYSTEMS 1
+
+typedef uint32_t xfs_agblock_t; /* blockno in alloc. group */
+typedef uint32_t xfs_extlen_t; /* extent length in blocks */
+typedef uint32_t xfs_agnumber_t; /* allocation group number */
+typedef int32_t xfs_extnum_t; /* # of extents in a file */
+typedef int16_t xfs_aextnum_t; /* # extents in an attribute fork */
+typedef int64_t xfs_fsize_t; /* bytes in a file */
+typedef uint64_t xfs_ufsize_t; /* unsigned bytes in a file */
+
+typedef int32_t xfs_suminfo_t; /* type of bitmap summary info */
+typedef int32_t xfs_rtword_t; /* word type for bitmap manipulations */
+
+typedef int64_t xfs_lsn_t; /* log sequence number */
+typedef int32_t xfs_tid_t; /* transaction identifier */
+
+typedef uint32_t xfs_dablk_t; /* dir/attr block number (in file) */
+typedef uint32_t xfs_dahash_t; /* dir/attr hash value */
+
+typedef uint16_t xfs_prid_t; /* prid_t truncated to 16bits in XFS */
+
+/*
+ * These types are 64 bits on disk but are either 32 or 64 bits in memory.
+ * Disk based types:
+ */
+typedef uint64_t xfs_dfsbno_t; /* blockno in filesystem (agno|agbno) */
+typedef uint64_t xfs_drfsbno_t; /* blockno in filesystem (raw) */
+typedef uint64_t xfs_drtbno_t; /* extent (block) in realtime area */
+typedef uint64_t xfs_dfiloff_t; /* block number in a file */
+typedef uint64_t xfs_dfilblks_t; /* number of blocks in a file */
+
+/*
+ * Memory based types are conditional.
+ */
+#if XFS_BIG_FILESYSTEMS
+typedef uint64_t xfs_fsblock_t; /* blockno in filesystem (agno|agbno) */
+typedef uint64_t xfs_rfsblock_t; /* blockno in filesystem (raw) */
+typedef uint64_t xfs_rtblock_t; /* extent (block) in realtime area */
+typedef int64_t xfs_srtblock_t; /* signed version of xfs_rtblock_t */
+#else
+typedef uint32_t xfs_fsblock_t; /* blockno in filesystem (agno|agbno) */
+typedef uint32_t xfs_rfsblock_t; /* blockno in filesystem (raw) */
+typedef uint32_t xfs_rtblock_t; /* extent (block) in realtime area */
+typedef int32_t xfs_srtblock_t; /* signed version of xfs_rtblock_t */
+#endif
+#if XFS_BIG_FILES
+typedef uint64_t xfs_fileoff_t; /* block number in a file */
+typedef int64_t xfs_sfiloff_t; /* signed block number in a file */
+typedef uint64_t xfs_filblks_t; /* number of blocks in a file */
+#else
+typedef uint32_t xfs_fileoff_t; /* block number in a file */
+typedef int32_t xfs_sfiloff_t; /* signed block number in a file */
+typedef uint32_t xfs_filblks_t; /* number of blocks in a file */
+#endif
+
+typedef uint8_t xfs_arch_t; /* architecutre of an xfs fs */
+
+/*
+ * Null values for the types.
+ */
+#define NULLDFSBNO ((xfs_dfsbno_t)-1)
+#define NULLDRFSBNO ((xfs_drfsbno_t)-1)
+#define NULLDRTBNO ((xfs_drtbno_t)-1)
+#define NULLDFILOFF ((xfs_dfiloff_t)-1)
+
+#define NULLFSBLOCK ((xfs_fsblock_t)-1)
+#define NULLRFSBLOCK ((xfs_rfsblock_t)-1)
+#define NULLRTBLOCK ((xfs_rtblock_t)-1)
+#define NULLFILEOFF ((xfs_fileoff_t)-1)
+
+#define NULLAGBLOCK ((xfs_agblock_t)-1)
+#define NULLAGNUMBER ((xfs_agnumber_t)-1)
+#define NULLEXTNUM ((xfs_extnum_t)-1)
+
+#define NULLCOMMITLSN ((xfs_lsn_t)-1)
+
+/*
+ * Max values for extlen, extnum, aextnum.
+ */
+#define MAXEXTLEN ((xfs_extlen_t)0x001fffff) /* 21 bits */
+#define MAXEXTNUM ((xfs_extnum_t)0x7fffffff) /* signed int */
+#define MAXAEXTNUM ((xfs_aextnum_t)0x7fff) /* signed short */
+
+/*
+ * MAXNAMELEN is the length (including the terminating null) of
+ * the longest permissible file (component) name.
+ */
+#define MAXNAMELEN 256
+
+typedef enum {
+ XFS_LOOKUP_EQi, XFS_LOOKUP_LEi, XFS_LOOKUP_GEi
+} xfs_lookup_t;
+
+typedef enum {
+ XFS_BTNUM_BNOi, XFS_BTNUM_CNTi, XFS_BTNUM_BMAPi, XFS_BTNUM_INOi,
+ XFS_BTNUM_MAX
+} xfs_btnum_t;
+
+
+#ifdef CONFIG_PROC_FS
+/*
+ * XFS global statistics
+ */
+struct xfsstats {
+# define XFSSTAT_END_EXTENT_ALLOC 4
+ uint32_t xs_allocx;
+ uint32_t xs_allocb;
+ uint32_t xs_freex;
+ uint32_t xs_freeb;
+# define XFSSTAT_END_ALLOC_BTREE (XFSSTAT_END_EXTENT_ALLOC+4)
+ uint32_t xs_abt_lookup;
+ uint32_t xs_abt_compare;
+ uint32_t xs_abt_insrec;
+ uint32_t xs_abt_delrec;
+# define XFSSTAT_END_BLOCK_MAPPING (XFSSTAT_END_ALLOC_BTREE+7)
+ uint32_t xs_blk_mapr;
+ uint32_t xs_blk_mapw;
+ uint32_t xs_blk_unmap;
+ uint32_t xs_add_exlist;
+ uint32_t xs_del_exlist;
+ uint32_t xs_look_exlist;
+ uint32_t xs_cmp_exlist;
+# define XFSSTAT_END_BLOCK_MAP_BTREE (XFSSTAT_END_BLOCK_MAPPING+4)
+ uint32_t xs_bmbt_lookup;
+ uint32_t xs_bmbt_compare;
+ uint32_t xs_bmbt_insrec;
+ uint32_t xs_bmbt_delrec;
+# define XFSSTAT_END_DIRECTORY_OPS (XFSSTAT_END_BLOCK_MAP_BTREE+4)
+ uint32_t xs_dir_lookup;
+ uint32_t xs_dir_create;
+ uint32_t xs_dir_remove;
+ uint32_t xs_dir_getdents;
+# define XFSSTAT_END_TRANSACTIONS (XFSSTAT_END_DIRECTORY_OPS+3)
+ uint32_t xs_trans_sync;
+ uint32_t xs_trans_async;
+ uint32_t xs_trans_empty;
+# define XFSSTAT_END_INODE_OPS (XFSSTAT_END_TRANSACTIONS+7)
+ uint32_t xs_ig_attempts;
+ uint32_t xs_ig_found;
+ uint32_t xs_ig_frecycle;
+ uint32_t xs_ig_missed;
+ uint32_t xs_ig_dup;
+ uint32_t xs_ig_reclaims;
+ uint32_t xs_ig_attrchg;
+# define XFSSTAT_END_LOG_OPS (XFSSTAT_END_INODE_OPS+5)
+ uint32_t xs_log_writes;
+ uint32_t xs_log_blocks;
+ uint32_t xs_log_noiclogs;
+ uint32_t xs_log_force;
+ uint32_t xs_log_force_sleep;
+# define XFSSTAT_END_TAIL_PUSHING (XFSSTAT_END_LOG_OPS+10)
+ uint32_t xs_try_logspace;
+ uint32_t xs_sleep_logspace;
+ uint32_t xs_push_ail;
+ uint32_t xs_push_ail_success;
+ uint32_t xs_push_ail_pushbuf;
+ uint32_t xs_push_ail_pinned;
+ uint32_t xs_push_ail_locked;
+ uint32_t xs_push_ail_flushing;
+ uint32_t xs_push_ail_restarts;
+ uint32_t xs_push_ail_flush;
+# define XFSSTAT_END_WRITE_CONVERT (XFSSTAT_END_TAIL_PUSHING+2)
+ uint32_t xs_xstrat_quick;
+ uint32_t xs_xstrat_split;
+# define XFSSTAT_END_READ_WRITE_OPS (XFSSTAT_END_WRITE_CONVERT+2)
+ uint32_t xs_write_calls;
+ uint32_t xs_read_calls;
+# define XFSSTAT_END_ATTRIBUTE_OPS (XFSSTAT_END_READ_WRITE_OPS+4)
+ uint32_t xs_attr_get;
+ uint32_t xs_attr_set;
+ uint32_t xs_attr_remove;
+ uint32_t xs_attr_list;
+# define XFSSTAT_END_QUOTA_OPS (XFSSTAT_END_ATTRIBUTE_OPS+8)
+ uint32_t xs_qm_dqreclaims;
+ uint32_t xs_qm_dqreclaim_misses;
+ uint32_t xs_qm_dquot_dups;
+ uint32_t xs_qm_dqcachemisses;
+ uint32_t xs_qm_dqcachehits;
+ uint32_t xs_qm_dqwants;
+ uint32_t xs_qm_dqshake_reclaims;
+ uint32_t xs_qm_dqinact_reclaims;
+# define XFSSTAT_END_INODE_CLUSTER (XFSSTAT_END_QUOTA_OPS+3)
+ uint32_t xs_iflush_count;
+ uint32_t xs_icluster_flushcnt;
+ uint32_t xs_icluster_flushinode;
+# define XFSSTAT_END_VNODE_OPS (XFSSTAT_END_INODE_CLUSTER+8)
+ uint32_t vn_active; /* # vnodes not on free lists */
+ uint32_t vn_alloc; /* # times vn_alloc called */
+ uint32_t vn_get; /* # times vn_get called */
+ uint32_t vn_hold; /* # times vn_hold called */
+ uint32_t vn_rele; /* # times vn_rele called */
+ uint32_t vn_reclaim; /* # times vn_reclaim called */
+ uint32_t vn_remove; /* # times vn_remove called */
+ uint32_t vn_free; /* # times vn_free called */
+ struct xfsstats_xpc {
+ uint64_t xs_xstrat_bytes;
+ uint64_t xs_write_bytes;
+ uint64_t xs_read_bytes;
+ } xpc;
+} xfsstats;
+
+# define XFS_STATS_INC(count) ( xfsstats.##count ++ )
+# define XFS_STATS_DEC(count) ( xfsstats.##count -- )
+# define XFS_STATS_ADD(count, inc) ( xfsstats.##count += (inc) )
+# define XFS_STATS64_INC(count) ( xfsstats.xpc.##count ++ )
+# define XFS_STATS64_ADD(count, inc) ( xfsstats.xpc.##count += (inc) )
+#else /* !CONFIG_PROC_FS */
+# define XFS_STATS_INC(count)
+# define XFS_STATS_DEC(count)
+# define XFS_STATS_ADD(count, inc)
+# define XFS_STATS64_INC(count)
+# define XFS_STATS64_ADD(count, inc)
+#endif /* !CONFIG_PROC_FS */
+
+
+#ifdef __KERNEL__
+
+/* juggle IRIX device numbers - still used in ondisk structures */
+
+#define IRIX_DEV_BITSMAJOR 14
+#define IRIX_DEV_BITSMINOR 18
+#define IRIX_DEV_MAXMAJ 0x1ff
+#define IRIX_DEV_MAXMIN 0x3ffff
+#define IRIX_DEV_MAJOR(dev) ((int)(((unsigned)(dev)>>IRIX_DEV_BITSMINOR) \
+ & IRIX_DEV_MAXMAJ))
+#define IRIX_DEV_MINOR(dev) ((int)((dev)&IRIX_DEV_MAXMIN))
+#define IRIX_MKDEV(major,minor) ((xfs_dev_t)(((major)<<IRIX_DEV_BITSMINOR) \
+ | (minor&IRIX_DEV_MAXMIN)))
+
+#define IRIX_DEV_TO_KDEVT(dev) MKDEV(IRIX_DEV_MAJOR(dev),IRIX_DEV_MINOR(dev))
+#define IRIX_DEV_TO_DEVT(dev) ((IRIX_DEV_MAJOR(dev)<<8)|IRIX_DEV_MINOR(dev))
+
+/* __psint_t is the same size as a pointer */
+#if (BITS_PER_LONG == 32)
+typedef int32_t __psint_t;
+typedef uint32_t __psunsigned_t;
+#elif (BITS_PER_LONG == 64)
+typedef int64_t __psint_t;
+typedef uint64_t __psunsigned_t;
+#else
+#error BITS_PER_LONG must be 32 or 64
+#endif
+
+
+/*
+ * struct for passing owner/requestor id
+ */
+typedef struct flid {
+#ifdef CELL_CAPABLE
+ pid_t fl_pid;
+ sysid_t fl_sysid;
+#endif
+} flid_t;
+
+#endif /* __KERNEL__ */
+
+#endif /* !__XFS_TYPES_H */
diff --git a/libparted/labels/Makefile.am b/libparted/labels/Makefile.am
new file mode 100644
index 0000000..c8efbe4
--- /dev/null
+++ b/libparted/labels/Makefile.am
@@ -0,0 +1,35 @@
+# This file is part of GNU Parted
+# Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+#
+# This file may be modified and/or distributed without restriction.
+
+LIBS = @INTLLIBS@ @LIBS@
+
+partedincludedir = -I$(top_srcdir)/include
+noinst_LTLIBRARIES = liblabels.la
+liblabels_la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
+ -release $(LT_RELEASE)
+
+liblabels_la_SOURCES = rdb.c \
+ bsd.c \
+ dasd.c \
+ fdasd.c \
+ fdash.h \
+ vtoc.c \
+ vtoc.h \
+ efi_crc32.c \
+ dos.c \
+ dvh.h \
+ dvh.c \
+ gpt.c \
+ loop.c \
+ mac.c \
+ pc98.c \
+ sun.c \
+ aix.c
+
+
+liblabels_la_LIBADD = @OS_LIBS@
+
+INCLUDES = $(partedincludedir) @INTLINCS@
+
diff --git a/libparted/labels/aix.c b/libparted/labels/aix.c
new file mode 100644
index 0000000..4d28b18
--- /dev/null
+++ b/libparted/labels/aix.c
@@ -0,0 +1,282 @@
+/* -*- Mode: c; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Contributor: Matt Wilson <msw@redhat.com>
+*/
+
+#include "config.h"
+
+#include <string.h>
+
+#include <parted/parted.h>
+#include <parted/debug.h>
+#include <parted/endian.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+typedef struct {
+ unsigned int magic; /* expect AIX_LABEL_MAGIC */
+ unsigned int fillbytes[127];
+} AixLabel;
+
+#define AIX_LABEL_MAGIC 0xc9c2d4c1
+
+static PedDiskType aix_disk_type;
+
+static int
+aix_probe (const PedDevice *dev)
+{
+ PedDiskType* disk_type;
+ AixLabel label;
+ int i;
+
+ PED_ASSERT (dev != NULL, return 0);
+
+ if (!ped_device_read (dev, &label, 0, 1))
+ return 0;
+
+ if (PED_BE32_TO_CPU (label.magic) != AIX_LABEL_MAGIC)
+ return 0;
+
+ return 1;
+}
+
+#ifndef DISCOVER_ONLY
+static int
+aix_clobber (PedDevice* dev)
+{
+ AixLabel label;
+
+ PED_ASSERT (dev != NULL, return 0);
+ PED_ASSERT (aix_probe (dev), return 0);
+
+ if (!ped_device_read (dev, &label, 0, 1))
+ return 0;
+
+ label.magic = 0;
+ return ped_device_write (dev, &label, 0, 1);
+}
+#endif /* !DISCOVER_ONLY */
+
+static PedDisk*
+aix_alloc (const PedDevice* dev)
+{
+ PedDisk* disk;
+
+ disk = _ped_disk_alloc (dev, &aix_disk_type);
+ if (!disk)
+ return NULL;
+
+ return disk;
+}
+
+static PedDisk*
+aix_duplicate (const PedDisk* disk)
+{
+ PedDisk* new_disk;
+
+ new_disk = ped_disk_new_fresh (disk->dev, &aix_disk_type);
+ if (!new_disk)
+ return NULL;
+
+ return new_disk;
+}
+
+static void
+aix_free (PedDisk *disk)
+{
+ _ped_disk_free (disk);
+}
+
+static int
+aix_read (PedDisk* disk)
+{
+ ped_disk_delete_all (disk);
+ ped_exception_throw (PED_EXCEPTION_NO_FEATURE,
+ PED_EXCEPTION_CANCEL,
+ _("Support for reading AIX disk labels is "
+ "is not implemented yet."));
+ return 0;
+}
+
+#ifndef DISCOVER_ONLY
+static int
+aix_write (PedDisk* disk)
+{
+ ped_exception_throw (PED_EXCEPTION_NO_FEATURE,
+ PED_EXCEPTION_CANCEL,
+ _("Support for writing AIX disk labels is "
+ "is not implemented yet."));
+ return 0;
+}
+#endif /* !DISCOVER_ONLY */
+
+static PedPartition*
+aix_partition_new (const PedDisk* disk, PedPartitionType part_type,
+ const PedFileSystemType* fs_type,
+ PedSector start, PedSector end)
+{
+ PedPartition* part;
+
+ ped_exception_throw (PED_EXCEPTION_NO_FEATURE,
+ PED_EXCEPTION_CANCEL,
+ _("Support for adding partitions to AIX disk "
+ "labels is not implemented yet."));
+ return NULL;
+}
+
+static PedPartition*
+aix_partition_duplicate (const PedPartition* part)
+{
+ PedPartition* new_part;
+
+ ped_exception_throw (PED_EXCEPTION_NO_FEATURE,
+ PED_EXCEPTION_CANCEL,
+ _("Support for duplicating partitions in AIX "
+ "disk labels is not implemented yet."));
+ return NULL;
+}
+
+static void
+aix_partition_destroy (PedPartition* part)
+{
+ PED_ASSERT (part != NULL, return);
+
+ _ped_partition_free (part);
+}
+
+static int
+aix_partition_set_system (PedPartition* part, const PedFileSystemType* fs_type)
+{
+ ped_exception_throw (PED_EXCEPTION_NO_FEATURE,
+ PED_EXCEPTION_CANCEL,
+ _("Support for setting system type of partitions "
+ "in AIX disk labels is not implemented yet."));
+ return 0;
+}
+
+static int
+aix_partition_set_flag (PedPartition* part, PedPartitionFlag flag, int state)
+{
+ ped_exception_throw (PED_EXCEPTION_NO_FEATURE,
+ PED_EXCEPTION_CANCEL,
+ _("Support for setting flags "
+ "in AIX disk labels is not implemented yet."));
+ return 0;
+}
+
+static int
+aix_partition_get_flag (const PedPartition* part, PedPartitionFlag flag)
+{
+ return 0;
+}
+
+
+static int
+aix_partition_is_flag_available (const PedPartition* part,
+ PedPartitionFlag flag)
+{
+ return 0;
+}
+
+
+static int
+aix_get_max_primary_partition_count (const PedDisk* disk)
+{
+ return 4;
+}
+
+static int
+aix_partition_align (PedPartition* part, const PedConstraint* constraint)
+{
+ PED_ASSERT (part != NULL, return 0);
+
+ return 1;
+}
+
+static int
+aix_partition_enumerate (PedPartition* part)
+{
+ return 1;
+}
+
+static int
+aix_alloc_metadata (PedDisk* disk)
+{
+ return 1;
+}
+
+static PedDiskOps aix_disk_ops = {
+ probe: aix_probe,
+#ifndef DISCOVER_ONLY
+ clobber: aix_clobber,
+#else
+ clobber: NULL,
+#endif
+ alloc: aix_alloc,
+ duplicate: aix_duplicate,
+ free: aix_free,
+ read: aix_read,
+#ifndef DISCOVER_ONLY
+ write: aix_write,
+#else
+ write: NULL,
+#endif
+
+ partition_new: aix_partition_new,
+ partition_duplicate: aix_partition_duplicate,
+ partition_destroy: aix_partition_destroy,
+ partition_set_system: aix_partition_set_system,
+ partition_set_flag: aix_partition_set_flag,
+ partition_get_flag: aix_partition_get_flag,
+ partition_is_flag_available: aix_partition_is_flag_available,
+ partition_align: aix_partition_align,
+ partition_enumerate: aix_partition_enumerate,
+ alloc_metadata: aix_alloc_metadata,
+ get_max_primary_partition_count:
+ aix_get_max_primary_partition_count,
+
+ partition_set_name: NULL,
+ partition_get_name: NULL,
+};
+
+static PedDiskType aix_disk_type = {
+ next: NULL,
+ name: "aix",
+ ops: &aix_disk_ops,
+ features: 0
+};
+
+void
+ped_disk_aix_init ()
+{
+ PED_ASSERT (sizeof (AixLabel) == 512, return);
+ ped_register_disk_type (&aix_disk_type);
+}
+
+void
+ped_disk_aix_done ()
+{
+ ped_unregister_disk_type (&aix_disk_type);
+}
diff --git a/libparted/labels/bsd.c b/libparted/labels/bsd.c
new file mode 100644
index 0000000..21ee870
--- /dev/null
+++ b/libparted/labels/bsd.c
@@ -0,0 +1,617 @@
+/* -*- Mode: c; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+
+ Contributor: Matt Wilson <msw@redhat.com>
+*/
+
+#include "config.h"
+
+#include <string.h>
+
+#include <parted/parted.h>
+#include <parted/debug.h>
+#include <parted/endian.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+/* struct's & #define's stolen from libfdisk, which probably came from
+ * Linux...
+ */
+
+#define BSD_DISKMAGIC (0x82564557UL) /* The disk magic number */
+#define BSD_MAXPARTITIONS 8
+#define BSD_FS_UNUSED 0 /* disklabel unused partition entry ID */
+#define BSD_LABEL_OFFSET 64
+
+#define BSD_DTYPE_SMD 1 /* SMD, XSMD; VAX hp/up */
+#define BSD_DTYPE_MSCP 2 /* MSCP */
+#define BSD_DTYPE_DEC 3 /* other DEC (rk, rl) */
+#define BSD_DTYPE_SCSI 4 /* SCSI */
+#define BSD_DTYPE_ESDI 5 /* ESDI interface */
+#define BSD_DTYPE_ST506 6 /* ST506 etc. */
+#define BSD_DTYPE_HPIB 7 /* CS/80 on HP-IB */
+#define BSD_DTYPE_HPFL 8 /* HP Fiber-link */
+#define BSD_DTYPE_FLOPPY 10 /* floppy */
+
+#define BSD_BBSIZE 8192 /* size of boot area, with label */
+#define BSD_SBSIZE 8192 /* max size of fs superblock */
+
+typedef struct _BSDRawPartition BSDRawPartition;
+typedef struct _BSDRawLabel BSDRawLabel;
+
+struct _BSDRawPartition { /* the partition table */
+ uint32_t p_size; /* number of sectors in partition */
+ uint32_t p_offset; /* starting sector */
+ uint32_t p_fsize; /* file system basic fragment size */
+ uint8_t p_fstype; /* file system type, see below */
+ uint8_t p_frag; /* file system fragments per block */
+ uint16_t p_cpg; /* file system cylinders per group */
+} __attribute__((packed));
+
+struct _BSDRawLabel {
+ uint32_t d_magic; /* the magic number */
+ int16_t d_type; /* drive type */
+ int16_t d_subtype; /* controller/d_type specific */
+ int8_t d_typename[16]; /* type name, e.g. "eagle" */
+ int8_t d_packname[16]; /* pack identifier */
+ uint32_t d_secsize; /* # of bytes per sector */
+ uint32_t d_nsectors; /* # of data sectors per track */
+ uint32_t d_ntracks; /* # of tracks per cylinder */
+ uint32_t d_ncylinders; /* # of data cylinders per unit */
+ uint32_t d_secpercyl; /* # of data sectors per cylinder */
+ uint32_t d_secperunit; /* # of data sectors per unit */
+ uint16_t d_sparespertrack; /* # of spare sectors per track */
+ uint16_t d_sparespercyl; /* # of spare sectors per cylinder */
+ uint32_t d_acylinders; /* # of alt. cylinders per unit */
+ uint16_t d_rpm; /* rotational speed */
+ uint16_t d_interleave; /* hardware sector interleave */
+ uint16_t d_trackskew; /* sector 0 skew, per track */
+ uint16_t d_cylskew; /* sector 0 skew, per cylinder */
+ uint32_t d_headswitch; /* head switch time, usec */
+ uint32_t d_trkseek; /* track-to-track seek, usec */
+ uint32_t d_flags; /* generic flags */
+#define NDDATA 5
+ uint32_t d_drivedata[NDDATA]; /* drive-type specific information */
+#define NSPARE 5
+ uint32_t d_spare[NSPARE]; /* reserved for future use */
+ uint32_t d_magic2; /* the magic number (again) */
+ uint16_t d_checksum; /* xor of data incl. partitions */
+
+ /* file system and partition information: */
+ uint16_t d_npartitions; /* number of partitions in following */
+ uint32_t d_bbsize; /* size of boot area at sn0, bytes */
+ uint32_t d_sbsize; /* max size of fs superblock, bytes */
+ BSDRawPartition d_partitions[BSD_MAXPARTITIONS]; /* actually may be more */
+} __attribute__((packed));
+
+typedef struct {
+ char boot_code [512];
+} BSDDiskData;
+
+typedef struct {
+ uint8_t type;
+} BSDPartitionData;
+
+static PedDiskType bsd_disk_type;
+
+/* XXX fixme: endian? */
+static unsigned short
+xbsd_dkcksum (BSDRawLabel *lp) {
+ unsigned short *start, *end;
+ unsigned short sum = 0;
+
+ lp->d_checksum = 0;
+ start = (u_short*) lp;
+ end = (u_short*) &lp->d_partitions [
+ PED_LE16_TO_CPU (lp->d_npartitions)];
+ while (start < end)
+ sum ^= *start++;
+ return sum;
+}
+
+/* XXX fixme: endian? */
+static void
+alpha_bootblock_checksum (char *boot) {
+ uint64_t *dp, sum;
+ int i;
+
+ dp = (uint64_t *)boot;
+ sum = 0;
+ for (i = 0; i < 63; i++)
+ sum += dp[i];
+ dp[63] = sum;
+}
+
+
+static int
+bsd_probe (const PedDevice *dev)
+{
+ char boot[512];
+ BSDRawLabel *label;
+ int i;
+
+ PED_ASSERT (dev != NULL, return 0);
+
+ if (dev->sector_size != 512)
+ return 0;
+
+ if (!ped_device_read (dev, boot, 0, 1))
+ return 0;
+
+ label = (BSDRawLabel *) (boot + BSD_LABEL_OFFSET);
+
+ alpha_bootblock_checksum(boot);
+
+ /* check magic */
+ if (PED_LE32_TO_CPU (label->d_magic) != BSD_DISKMAGIC)
+ return 0;
+
+ return 1;
+}
+
+static PedDisk*
+bsd_alloc (const PedDevice* dev)
+{
+ PedDisk* disk;
+ BSDDiskData* bsd_specific;
+ BSDRawLabel* label;
+
+ PED_ASSERT(dev->sector_size % 512 == 0, return 0);
+
+ disk = _ped_disk_alloc ((PedDevice*)dev, &bsd_disk_type);
+ if (!disk)
+ goto error;
+ disk->disk_specific = bsd_specific = ped_malloc (sizeof (BSDDiskData));
+ if (!bsd_specific)
+ goto error_free_disk;
+
+ label = (BSDRawLabel*) (bsd_specific->boot_code + BSD_LABEL_OFFSET);
+ memset(label, 0, sizeof(BSDRawLabel));
+
+ label->d_magic = PED_CPU_TO_LE32 (BSD_DISKMAGIC);
+ label->d_type = PED_CPU_TO_LE16 (BSD_DTYPE_SCSI);
+ label->d_flags = 0;
+ label->d_secsize = PED_CPU_TO_LE16 (dev->sector_size);
+ label->d_nsectors = PED_CPU_TO_LE32 (dev->bios_geom.sectors);
+ label->d_ntracks = PED_CPU_TO_LE32 (dev->bios_geom.heads);
+ label->d_ncylinders = PED_CPU_TO_LE32 (dev->bios_geom.cylinders);
+ label->d_secpercyl = PED_CPU_TO_LE32 (dev->bios_geom.sectors
+ * dev->bios_geom.heads);
+ label->d_secperunit
+ = PED_CPU_TO_LE32 (dev->bios_geom.sectors
+ * dev->bios_geom.heads
+ * dev->bios_geom.cylinders);
+
+ label->d_rpm = PED_CPU_TO_LE16 (3600);
+ label->d_interleave = PED_CPU_TO_LE16 (1);;
+ label->d_trackskew = 0;
+ label->d_cylskew = 0;
+ label->d_headswitch = 0;
+ label->d_trkseek = 0;
+
+ label->d_magic2 = PED_CPU_TO_LE32 (BSD_DISKMAGIC);
+ label->d_bbsize = PED_CPU_TO_LE32 (BSD_BBSIZE);
+ label->d_sbsize = PED_CPU_TO_LE32 (BSD_SBSIZE);
+
+ label->d_npartitions = 0;
+ label->d_checksum = xbsd_dkcksum (label);
+ return disk;
+
+error_free_disk:
+ ped_free (disk);
+error:
+ return NULL;
+}
+
+static PedDisk*
+bsd_duplicate (const PedDisk* disk)
+{
+ PedDisk* new_disk;
+ BSDDiskData* new_bsd_data;
+ BSDDiskData* old_bsd_data = (BSDDiskData*) disk->disk_specific;
+
+ new_disk = ped_disk_new_fresh (disk->dev, &bsd_disk_type);
+ if (!new_disk)
+ return NULL;
+
+ new_bsd_data = (BSDDiskData*) new_disk->disk_specific;
+ memcpy (new_bsd_data->boot_code, old_bsd_data->boot_code, 512);
+ return new_disk;
+}
+
+static void
+bsd_free (PedDisk* disk)
+{
+ ped_free (disk->disk_specific);
+ _ped_disk_free (disk);
+}
+
+#ifndef DISCOVER_ONLY
+static int
+bsd_clobber (PedDevice* dev)
+{
+ char boot [512];
+ BSDRawLabel* label = (BSDRawLabel *) (boot + BSD_LABEL_OFFSET);
+
+ if (!ped_device_read (dev, boot, 0, 1))
+ return 0;
+ label->d_magic = 0;
+ return ped_device_write (dev, (void*) boot, 0, 1);
+}
+#endif /* !DISCOVER_ONLY */
+
+static int
+bsd_read (PedDisk* disk)
+{
+ BSDDiskData* bsd_specific = (BSDDiskData*) disk->disk_specific;
+ BSDRawLabel* label;
+ int i;
+
+ ped_disk_delete_all (disk);
+
+ if (!ped_device_read (disk->dev, bsd_specific->boot_code, 0, 1))
+ goto error;
+ label = (BSDRawLabel *) (bsd_specific->boot_code + BSD_LABEL_OFFSET);
+
+ for (i = 1; i <= BSD_MAXPARTITIONS; i++) {
+ PedPartition* part;
+ BSDPartitionData* bsd_part_data;
+ PedSector start;
+ PedSector end;
+ PedConstraint* constraint_exact;
+
+ if (!label->d_partitions[i - 1].p_size
+ || !label->d_partitions[i - 1].p_fstype)
+ continue;
+ start = PED_LE32_TO_CPU(label->d_partitions[i - 1].p_offset);
+ end = PED_LE32_TO_CPU(label->d_partitions[i - 1].p_offset)
+ + PED_LE32_TO_CPU(label->d_partitions[i - 1].p_size) - 1;
+ part = ped_partition_new (disk, 0, NULL, start, end);
+ if (!part)
+ goto error;
+ bsd_part_data = part->disk_specific;
+ bsd_part_data->type = label->d_partitions[i - 1].p_fstype;
+ part->num = i;
+ part->fs_type = ped_file_system_probe (&part->geom);
+
+ constraint_exact = ped_constraint_exact (&part->geom);
+ if (!ped_disk_add_partition (disk, part, constraint_exact))
+ goto error;
+ ped_constraint_destroy (constraint_exact);
+ }
+
+ return 1;
+
+error:
+ return 0;
+}
+
+static void
+_probe_and_add_boot_code (PedDisk* disk)
+{
+ BSDDiskData* bsd_specific;
+ BSDRawLabel* old_label;
+ char old_boot_code [512];
+
+ bsd_specific = (BSDDiskData*) disk->disk_specific;
+ old_label = (BSDRawLabel*) (old_boot_code + BSD_LABEL_OFFSET);
+
+ if (!ped_device_read (disk->dev, old_boot_code, 0, 1))
+ return;
+ if (old_boot_code [0]
+ && old_label->d_magic == PED_CPU_TO_LE32 (BSD_DISKMAGIC))
+ memcpy (bsd_specific->boot_code, old_boot_code, 512);
+}
+
+#ifndef DISCOVER_ONLY
+static int
+bsd_write (PedDisk* disk)
+{
+ BSDDiskData* bsd_specific;
+ BSDRawLabel* label;
+ BSDPartitionData* bsd_data;
+ PedPartition* part;
+ int i;
+ int max_part = 0;
+
+ PED_ASSERT (disk != NULL, return 0);
+ PED_ASSERT (disk->dev != NULL, return 0);
+
+ bsd_specific = (BSDDiskData*) disk->disk_specific;
+ label = (BSDRawLabel *) (bsd_specific->boot_code + BSD_LABEL_OFFSET);
+
+ if (!bsd_specific->boot_code [0])
+ _probe_and_add_boot_code (disk);
+
+ memset (label->d_partitions, 0,
+ sizeof (BSDRawPartition) * BSD_MAXPARTITIONS);
+
+ for (i = 1; i <= BSD_MAXPARTITIONS; i++) {
+ part = ped_disk_get_partition (disk, i);
+ if (!part)
+ continue;
+ bsd_data = part->disk_specific;
+ label->d_partitions[i - 1].p_fstype = bsd_data->type;
+ label->d_partitions[i - 1].p_offset
+ = PED_CPU_TO_LE32 (part->geom.start);
+ label->d_partitions[i - 1].p_size
+ = PED_CPU_TO_LE32 (part->geom.length);
+ max_part = i;
+ }
+
+ label->d_npartitions = PED_CPU_TO_LE16 (max_part) + 1;
+ label->d_checksum = xbsd_dkcksum (label);
+
+ alpha_bootblock_checksum (bsd_specific->boot_code);
+
+ if (!ped_device_write (disk->dev, (void*) bsd_specific->boot_code,
+ 0, 1))
+ goto error;
+ return ped_device_sync (disk->dev);
+
+error:
+ return 0;
+}
+#endif /* !DISCOVER_ONLY */
+
+static PedPartition*
+bsd_partition_new (const PedDisk* disk, PedPartitionType part_type,
+ const PedFileSystemType* fs_type,
+ PedSector start, PedSector end)
+{
+ PedPartition* part;
+ BSDPartitionData* bsd_data;
+
+ part = _ped_partition_alloc (disk, part_type, fs_type, start, end);
+ if (!part)
+ goto error;
+
+ if (ped_partition_is_active (part)) {
+ part->disk_specific
+ = bsd_data = ped_malloc (sizeof (BSDPartitionData));
+ if (!bsd_data)
+ goto error_free_part;
+ bsd_data->type = 0;
+ } else {
+ part->disk_specific = NULL;
+ }
+ return part;
+
+error_free_bsd_data:
+ ped_free (bsd_data);
+error_free_part:
+ ped_free (part);
+error:
+ return 0;
+}
+
+static PedPartition*
+bsd_partition_duplicate (const PedPartition* part)
+{
+ PedPartition* new_part;
+ BSDPartitionData* new_bsd_data;
+ BSDPartitionData* old_bsd_data;
+
+ new_part = ped_partition_new (part->disk, part->type,
+ part->fs_type, part->geom.start,
+ part->geom.end);
+ if (!new_part)
+ return NULL;
+ new_part->num = part->num;
+
+ old_bsd_data = (BSDPartitionData*) part->disk_specific;
+ new_bsd_data = (BSDPartitionData*) new_part->disk_specific;
+ new_bsd_data->type = old_bsd_data->type;
+ return new_part;
+}
+
+static void
+bsd_partition_destroy (PedPartition* part)
+{
+ PED_ASSERT (part != NULL, return);
+
+ if (ped_partition_is_active (part))
+ ped_free (part->disk_specific);
+ _ped_partition_free (part);
+}
+
+static int
+bsd_partition_set_system (PedPartition* part, const PedFileSystemType* fs_type)
+{
+ BSDPartitionData* bsd_data = part->disk_specific;
+
+ part->fs_type = fs_type;
+
+ if (!fs_type)
+ bsd_data->type = 0x8;
+ else if (!strcmp (fs_type->name, "linux-swap"))
+ bsd_data->type = 0x1;
+ else
+ bsd_data->type = 0x8;
+
+ return 1;
+}
+
+static int
+bsd_partition_set_flag (PedPartition* part, PedPartitionFlag flag, int state)
+{
+ /* no flags for bsd */
+ return 0;
+}
+
+static int
+bsd_partition_get_flag (const PedPartition* part, PedPartitionFlag flag)
+{
+ /* no flags for bsd */
+ return 0;
+}
+
+static int
+bsd_partition_is_flag_available (const PedPartition* part,
+ PedPartitionFlag flag)
+{
+ /* no flags for bsd */
+ return 0;
+}
+
+
+static int
+bsd_get_max_primary_partition_count (const PedDisk* disk)
+{
+ return BSD_MAXPARTITIONS;
+}
+
+static PedConstraint*
+_get_constraint (const PedDevice* dev)
+{
+ PedGeometry max;
+
+ ped_geometry_init (&max, dev, 1, dev->length - 1);
+ return ped_constraint_new_from_max (&max);
+}
+
+static int
+bsd_partition_align (PedPartition* part, const PedConstraint* constraint)
+{
+ if (_ped_partition_attempt_align (part, constraint,
+ _get_constraint (part->disk->dev)))
+ return 1;
+
+#ifndef DISCOVER_ONLY
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Unable to satisfy all constraints on the partition."));
+#endif
+ return 0;
+}
+
+static int
+bsd_partition_enumerate (PedPartition* part)
+{
+ int i;
+ PedPartition* p;
+
+ /* never change the partition numbers */
+ if (part->num != -1)
+ return 1;
+ for (i = 1; i <= BSD_MAXPARTITIONS; i++) {
+ p = ped_disk_get_partition (part->disk, i);
+ if (!p) {
+ part->num = i;
+ return 1;
+ }
+ }
+
+ /* failed to allocate a number */
+#ifndef DISCOVER_ONLY
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("Unable to allocate a bsd disklabel slot."));
+#endif
+ return 0;
+}
+
+static int
+bsd_alloc_metadata (PedDisk* disk)
+{
+ PedPartition* new_part;
+ PedConstraint* constraint_any = NULL;
+
+ PED_ASSERT (disk != NULL, goto error);
+ PED_ASSERT (disk->dev != NULL, goto error);
+
+ constraint_any = ped_constraint_any (disk->dev);
+
+ /* allocate 1 sector for the disk label at the start */
+ new_part = ped_partition_new (disk, PED_PARTITION_METADATA, NULL, 0, 0);
+ if (!new_part)
+ goto error;
+
+ if (!ped_disk_add_partition (disk, new_part, constraint_any)) {
+ ped_partition_destroy (new_part);
+ goto error;
+ }
+
+ ped_constraint_destroy (constraint_any);
+ return 1;
+error:
+ ped_constraint_destroy (constraint_any);
+ return 0;
+}
+
+static PedDiskOps bsd_disk_ops = {
+ probe: bsd_probe,
+#ifndef DISCOVER_ONLY
+ clobber: bsd_clobber,
+#else
+ clobber: NULL,
+#endif
+ alloc: bsd_alloc,
+ duplicate: bsd_duplicate,
+ free: bsd_free,
+ read: bsd_read,
+#ifndef DISCOVER_ONLY
+ write: bsd_write,
+#else
+ write: NULL,
+#endif
+
+ partition_new: bsd_partition_new,
+ partition_duplicate: bsd_partition_duplicate,
+ partition_destroy: bsd_partition_destroy,
+ partition_set_system: bsd_partition_set_system,
+ partition_set_flag: bsd_partition_set_flag,
+ partition_get_flag: bsd_partition_get_flag,
+ partition_is_flag_available: bsd_partition_is_flag_available,
+ partition_set_name: NULL,
+ partition_get_name: NULL,
+ partition_align: bsd_partition_align,
+ partition_enumerate: bsd_partition_enumerate,
+
+ alloc_metadata: bsd_alloc_metadata,
+ get_max_primary_partition_count:
+ bsd_get_max_primary_partition_count
+};
+
+static PedDiskType bsd_disk_type = {
+ next: NULL,
+ name: "bsd",
+ ops: &bsd_disk_ops,
+ features: 0
+};
+
+void
+ped_disk_bsd_init ()
+{
+ PED_ASSERT (sizeof (BSDRawPartition) == 16, return);
+ PED_ASSERT (sizeof (BSDRawLabel) == 276, return);
+
+ ped_register_disk_type (&bsd_disk_type);
+}
+
+void
+ped_disk_bsd_done ()
+{
+ ped_unregister_disk_type (&bsd_disk_type);
+}
diff --git a/libparted/labels/dasd.c b/libparted/labels/dasd.c
new file mode 100644
index 0000000..4405cab
--- /dev/null
+++ b/libparted/labels/dasd.c
@@ -0,0 +1,874 @@
+/* -*- Mode: c; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Contributor: Phil Knirsch <phil@redhat.de>
+ Harald Hoyer <harald@redhat.de>
+*/
+
+#include "config.h"
+
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+#include <ctype.h>
+#include <time.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <parted/parted.h>
+#include <parted/endian.h>
+#include <parted/debug.h>
+
+#include <parted/vtoc.h>
+#include <parted/fdasd.h>
+#include <parted/linux.h>
+
+#include <libintl.h>
+#if ENABLE_NLS
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+#define PARTITION_LINUX_SWAP 0x82
+#define PARTITION_LINUX 0x83
+#define PARTITION_LINUX_EXT 0x85
+#define PARTITION_LINUX_LVM 0x8e
+#define PARTITION_LINUX_RAID 0xfd
+#define PARTITION_LINUX_LVM_OLD 0xfe
+
+extern void ped_disk_dasd_init ();
+extern void ped_disk_dasd_done ();
+
+#define DASD_NAME "dasd"
+
+typedef struct {
+ int type;
+ int system;
+ int raid;
+ int lvm;
+ void *part_info;
+} DasdPartitionData;
+
+typedef struct {
+ unsigned int real_sector_size;
+ unsigned int format_type;
+ /* IBM internal dasd structure (i guess ;), required. */
+ struct fdasd_anchor *anchor;
+} DasdDiskSpecific;
+
+static int dasd_probe (const PedDevice *dev);
+static int dasd_clobber (PedDevice* dev);
+static int dasd_read (PedDisk* disk);
+static int dasd_write (PedDisk* disk);
+
+static PedPartition* dasd_partition_new (const PedDisk* disk,
+ PedPartitionType part_type,
+ const PedFileSystemType* fs_type,
+ PedSector start,
+ PedSector end);
+static void dasd_partition_destroy (PedPartition* part);
+static int dasd_partition_set_flag (PedPartition* part,
+ PedPartitionFlag flag,
+ int state);
+static int dasd_partition_get_flag (const PedPartition* part,
+ PedPartitionFlag flag);
+static int dasd_partition_is_flag_available (const PedPartition* part,
+ PedPartitionFlag flag);
+static int dasd_partition_align (PedPartition* part,
+ const PedConstraint* constraint);
+static int dasd_partition_enumerate (PedPartition* part);
+static int dasd_get_max_primary_partition_count (const PedDisk* disk);
+
+static PedDisk* dasd_alloc (const PedDevice* dev);
+static PedDisk* dasd_duplicate (const PedDisk* disk);
+static void dasd_free (PedDisk* disk);
+static int dasd_partition_set_system (PedPartition* part,
+ const PedFileSystemType* fs_type);
+static int dasd_alloc_metadata (PedDisk* disk);
+
+static PedDiskOps dasd_disk_ops = {
+ probe: dasd_probe,
+ clobber: dasd_clobber,
+ read: dasd_read,
+ write: dasd_write,
+
+ alloc: dasd_alloc,
+ duplicate: dasd_duplicate,
+ free: dasd_free,
+ partition_set_system: dasd_partition_set_system,
+
+ partition_new: dasd_partition_new,
+ partition_destroy: dasd_partition_destroy,
+ partition_set_flag: dasd_partition_set_flag,
+ partition_get_flag: dasd_partition_get_flag,
+ partition_is_flag_available: dasd_partition_is_flag_available,
+ partition_set_name: NULL,
+ partition_get_name: NULL,
+ partition_align: dasd_partition_align,
+ partition_enumerate: dasd_partition_enumerate,
+
+ alloc_metadata: dasd_alloc_metadata,
+ get_max_primary_partition_count: dasd_get_max_primary_partition_count,
+
+ partition_duplicate: NULL
+};
+
+static PedDiskType dasd_disk_type = {
+ next: NULL,
+ name: "dasd",
+ ops: &dasd_disk_ops,
+ features: 0
+};
+
+static PedDisk*
+dasd_alloc (const PedDevice* dev)
+{
+ PedDisk* disk;
+ LinuxSpecific* arch_specific;
+ DasdDiskSpecific *disk_specific;
+
+ PED_ASSERT (dev != NULL, return NULL);
+
+ arch_specific = LINUX_SPECIFIC (dev);
+ disk = _ped_disk_alloc (dev, &dasd_disk_type);
+ if (!disk)
+ return NULL;
+
+ disk->disk_specific = disk_specific = ped_malloc(sizeof(DasdDiskSpecific));
+ if (!disk->disk_specific) {
+ ped_free (disk);
+ return NULL;
+ }
+
+ /* because we lie to parted we have to compensate with the
+ real sector size. Record that now. */
+ if (ioctl(arch_specific->fd, BLKSSZGET,
+ &disk_specific->real_sector_size) == -1) {
+ ped_exception_throw(PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("Unable to determine the block "
+ "size of this dasd"));
+ ped_free(disk_specific);
+ ped_free(disk);
+ return NULL;
+ }
+
+ return disk;
+}
+
+static PedDisk*
+dasd_duplicate (const PedDisk* disk)
+{
+ PedDisk* new_disk;
+
+ new_disk = ped_disk_new_fresh(disk->dev, &dasd_disk_type);
+
+ if (!new_disk)
+ return NULL;
+
+ new_disk->disk_specific = NULL;
+
+ return new_disk;
+}
+
+static void
+dasd_free (PedDisk* disk)
+{
+ PED_ASSERT(disk != NULL, return);
+
+ _ped_disk_free(disk);
+}
+
+
+void
+ped_disk_dasd_init ()
+{
+ ped_register_disk_type(&dasd_disk_type);
+}
+
+void
+ped_disk_dasd_done ()
+{
+ ped_unregister_disk_type(&dasd_disk_type);
+}
+
+static int
+dasd_probe (const PedDevice *dev)
+{
+ char *errstr = 0;
+ LinuxSpecific* arch_specific;
+ struct fdasd_anchor anchor;
+
+ PED_ASSERT(dev != NULL, return 0);
+ PED_ASSERT((dev->type == PED_DEVICE_DASD
+ || dev->type == PED_DEVICE_VIODASD), return 0);
+
+ arch_specific = LINUX_SPECIFIC(dev);
+
+ /* add partition test here */
+ fdasd_initialize_anchor(&anchor);
+
+ fdasd_get_geometry(&anchor, arch_specific->fd);
+
+ fdasd_check_api_version(&anchor, arch_specific->fd);
+
+ if (fdasd_check_volume(&anchor, arch_specific->fd))
+ goto error_cleanup;
+
+ fdasd_cleanup(&anchor);
+
+ return 1;
+
+error_cleanup:
+ fdasd_cleanup(&anchor);
+error:
+ ped_exception_throw(PED_EXCEPTION_ERROR,PED_EXCEPTION_IGNORE_CANCEL,errstr);
+
+ return 0;
+}
+
+static int
+dasd_clobber (PedDevice* dev)
+{
+ int i;
+ LinuxSpecific* arch_specific;
+ struct fdasd_anchor anchor;
+
+ PED_ASSERT(dev != NULL, return 0);
+
+ arch_specific = LINUX_SPECIFIC(dev);
+
+ fdasd_initialize_anchor(&anchor);
+ fdasd_get_geometry(&anchor, arch_specific->fd);
+
+ fdasd_recreate_vtoc(&anchor);
+ fdasd_write_labels(&anchor, arch_specific->fd);
+
+ return 1;
+error:
+ return 0;
+}
+
+static int
+dasd_read (PedDisk* disk)
+{
+ int i, s;
+ char str[20];
+ PedDevice* dev;
+ PedPartition* part;
+ PedSector start, end;
+ PedConstraint* constraint_exact;
+ partition_info_t *p;
+ LinuxSpecific* arch_specific;
+ DasdDiskSpecific* disk_specific;
+
+ PDEBUG;
+
+ PED_ASSERT (disk != NULL, return 0);
+ PDEBUG;
+ PED_ASSERT (disk->dev != NULL, return 0);
+ PDEBUG;
+
+ dev = disk->dev;
+
+ arch_specific = LINUX_SPECIFIC(dev);
+ disk_specific = disk->disk_specific;
+
+ disk_specific->anchor = ped_malloc(sizeof(fdasd_anchor_t));
+
+ PDEBUG;
+
+ fdasd_initialize_anchor(disk_specific->anchor);
+
+ fdasd_get_geometry(disk_specific->anchor, arch_specific->fd);
+
+ /* check dasd for labels and vtoc */
+ if (fdasd_check_volume(disk_specific->anchor, arch_specific->fd))
+ goto error_close_dev;
+
+ if ((disk_specific->anchor->geo.cylinders
+ * disk_specific->anchor->geo.heads) > BIG_DISK_SIZE)
+ disk_specific->anchor->big_disk++;
+
+ ped_disk_delete_all (disk);
+
+ if (strncmp(disk_specific->anchor->vlabel->volkey,
+ vtoc_ebcdic_enc ("LNX1", str, 4), 4) == 0) {
+ DasdPartitionData* dasd_data;
+
+ /* LDL format, old one */
+ disk_specific->format_type = 1;
+ start = 24;
+ end = (long long)(long long) disk_specific->anchor->geo.cylinders
+ * (long long)disk_specific->anchor->geo.heads
+ * (long long)disk->dev->hw_geom.sectors
+ * (long long)disk_specific->real_sector_size
+ / (long long)disk->dev->sector_size - 1;
+ part = ped_partition_new (disk, PED_PARTITION_PROTECTED, NULL, start, end);
+ if (!part)
+ goto error_close_dev;
+
+ part->num = 1;
+ part->fs_type = ped_file_system_probe (&part->geom);
+ dasd_data = part->disk_specific;
+ dasd_data->raid = 0;
+ dasd_data->lvm = 0;
+ dasd_data->type = 0;
+
+ if (!ped_disk_add_partition (disk, part, NULL))
+ goto error_close_dev;
+
+ return 1;
+ }
+
+ /* CDL format, newer */
+ disk_specific->format_type = 2;
+
+ p = disk_specific->anchor->first;
+ PDEBUG;
+
+ for (i = 1 ; i <= USABLE_PARTITIONS; i++) {
+ char *ch = p->f1->DS1DSNAM;
+ DasdPartitionData* dasd_data;
+
+
+ if (p->used != 0x01)
+ continue;
+
+ PDEBUG;
+
+ start = (long long)(long long) p->start_trk
+ * (long long) disk->dev->hw_geom.sectors
+ * (long long) disk_specific->real_sector_size
+ / (long long) disk->dev->sector_size;
+ end = (long long)((long long) p->end_trk + 1)
+ * (long long) disk->dev->hw_geom.sectors
+ * (long long) disk_specific->real_sector_size
+ / (long long) disk->dev->sector_size - 1;
+ part = ped_partition_new(disk, 0, NULL, start, end);
+ PDEBUG;
+
+ if (!part)
+ goto error_close_dev;
+
+ PDEBUG;
+
+ part->num = i;
+ part->fs_type = ped_file_system_probe(&part->geom);
+
+ vtoc_ebcdic_dec(p->f1->DS1DSNAM, p->f1->DS1DSNAM, 44);
+ ch = strstr(p->f1->DS1DSNAM, "PART");
+
+ if (ch != NULL) {
+ strncpy(str, ch+9, 6);
+ str[6] = '\0';
+ }
+
+ dasd_data = part->disk_specific;
+
+ if (strncmp(PART_TYPE_RAID, str, 6) == 0)
+ ped_partition_set_flag(part, PED_PARTITION_RAID, 1);
+ else
+ ped_partition_set_flag(part, PED_PARTITION_RAID, 0);
+
+ if (strncmp(PART_TYPE_LVM, str, 6) == 0)
+ ped_partition_set_flag(part, PED_PARTITION_LVM, 1);
+ else
+ ped_partition_set_flag(part, PED_PARTITION_LVM, 0);
+
+ if (strncmp(PART_TYPE_SWAP, str, 6) == 0) {
+ dasd_data->system = PARTITION_LINUX_SWAP;
+ PDEBUG;
+ }
+
+ vtoc_ebcdic_enc(p->f1->DS1DSNAM, p->f1->DS1DSNAM, 44);
+
+ dasd_data->part_info = (void *) p;
+ dasd_data->type = 0;
+
+ constraint_exact = ped_constraint_exact (&part->geom);
+ if (!constraint_exact)
+ goto error_close_dev;
+ if (!ped_disk_add_partition(disk, part, constraint_exact))
+ goto error_close_dev;
+ ped_constraint_destroy(constraint_exact);
+
+ if (p->fspace_trk > 0) {
+ start = (long long)((long long) p->end_trk + 1)
+ * (long long) disk->dev->hw_geom.sectors
+ * (long long) disk_specific->real_sector_size
+ / (long long) disk->dev->sector_size;
+ end = (long long)((long long) p->end_trk + 1 + p->fspace_trk)
+ * (long long) disk->dev->hw_geom.sectors
+ * (long long) disk_specific->real_sector_size
+ / (long long) disk->dev->sector_size - 1;
+ part = ped_partition_new (disk, 0, NULL, start, end);
+
+ if (!part)
+ goto error_close_dev;
+
+ part->type = PED_PARTITION_FREESPACE;
+ constraint_exact = ped_constraint_exact(&part->geom);
+
+ if (!constraint_exact)
+ goto error_close_dev;
+ if (!ped_disk_add_partition(disk, part, constraint_exact))
+ goto error_close_dev;
+
+ ped_constraint_destroy (constraint_exact);
+ }
+
+ p = p->next;
+ }
+
+ PDEBUG;
+ return 1;
+
+error_close_dev:
+ PDEBUG;
+ return 0;
+}
+
+static int
+dasd_update_type (PedDisk* disk)
+{
+ PedPartition* part;
+ LinuxSpecific* arch_specific;
+ DasdDiskSpecific* disk_specific;
+ char *sys = NULL;
+
+ arch_specific = LINUX_SPECIFIC(disk->dev);
+ disk_specific = disk->disk_specific;
+
+ PDEBUG;
+
+ for (part = ped_disk_next_partition(disk, NULL); part;
+ part = ped_disk_next_partition(disk, part)) {
+ partition_info_t *p;
+ char *ch = NULL;
+ DasdPartitionData* dasd_data;
+
+ PDEBUG;
+
+ if (part->type & PED_PARTITION_FREESPACE
+ || part->type & PED_PARTITION_METADATA)
+ continue;
+
+ PDEBUG;
+
+ dasd_data = part->disk_specific;
+ p = dasd_data->part_info;
+
+ if (!p ) {
+ PDEBUG;
+ continue;
+ }
+
+ vtoc_ebcdic_dec(p->f1->DS1DSNAM, p->f1->DS1DSNAM, 44);
+ ch = strstr(p->f1->DS1DSNAM, "PART");
+
+ PDEBUG;
+ if (ch == NULL) {
+ vtoc_ebcdic_enc(p->f1->DS1DSNAM, p->f1->DS1DSNAM, 44);
+ PDEBUG;
+ continue;
+ }
+
+ ch += 9;
+
+ switch (dasd_data->system) {
+ case PARTITION_LINUX_LVM:
+ PDEBUG;
+ strncpy(ch, PART_TYPE_LVM, 6);
+ break;
+ case PARTITION_LINUX_RAID:
+ PDEBUG;
+ strncpy(ch, PART_TYPE_RAID, 6);
+ break;
+ case PARTITION_LINUX:
+ PDEBUG;
+ strncpy(ch, PART_TYPE_NATIVE, 6);
+ break;
+ case PARTITION_LINUX_SWAP:
+ PDEBUG;
+ strncpy(ch, PART_TYPE_SWAP, 6);
+ break;
+ default:
+ PDEBUG;
+ strncpy(ch, PART_TYPE_NATIVE, 6);
+ break;
+ }
+
+ disk_specific->anchor->vtoc_changed++;
+ vtoc_ebcdic_enc(p->f1->DS1DSNAM, p->f1->DS1DSNAM, 44);
+ }
+
+ return 1;
+}
+
+static int
+dasd_write (PedDisk* disk)
+{
+ DasdPartitionData* dasd_data;
+ PedPartition* part;
+ int i;
+ int ret;
+ partition_info_t *p;
+ LinuxSpecific* arch_specific;
+ DasdDiskSpecific* disk_specific;
+ PED_ASSERT(disk != NULL, return 0);
+ PED_ASSERT(disk->dev != NULL, return 0);
+
+ arch_specific = LINUX_SPECIFIC (disk->dev);
+ disk_specific = disk->disk_specific;
+
+ PDEBUG;
+
+ /* If formated in LDL, don't write anything. */
+ if (disk_specific->format_type == 1)
+ return 1;
+
+ /* XXX re-initialize anchor? */
+ fdasd_initialize_anchor(disk_specific->anchor);
+ fdasd_get_geometry(disk_specific->anchor, arch_specific->fd);
+
+ /* check dasd for labels and vtoc */
+ if (fdasd_check_volume(disk_specific->anchor, arch_specific->fd))
+ goto error;
+
+ if ((disk_specific->anchor->geo.cylinders
+ * disk_specific->anchor->geo.heads) > BIG_DISK_SIZE)
+ disk_specific->anchor->big_disk++;
+
+ fdasd_recreate_vtoc(disk_specific->anchor);
+
+ for (i = 1; i <= USABLE_PARTITIONS; i++) {
+ unsigned int start, stop;
+ int type;
+
+ PDEBUG;
+ part = ped_disk_get_partition(disk, i);
+ if (!part)
+ continue;
+
+ PDEBUG;
+
+ start = part->geom.start * disk->dev->sector_size
+ / disk_specific->real_sector_size / disk->dev->hw_geom.sectors;
+ stop = (part->geom.end + 1)
+ * disk->dev->sector_size / disk_specific->real_sector_size
+ / disk->dev->hw_geom.sectors - 1;
+
+ PDEBUG;
+ dasd_data = part->disk_specific;
+
+ type = dasd_data->type;
+ PDEBUG;
+
+ p = fdasd_add_partition(disk_specific->anchor, start, stop);
+ if (!p) {
+ PDEBUG;
+ return 0;
+ }
+ dasd_data->part_info = (void *) p;
+ p->type = dasd_data->system;
+ }
+
+ PDEBUG;
+
+ if (!fdasd_prepare_labels(disk_specific->anchor, arch_specific->fd))
+ return 0;
+
+ dasd_update_type(disk);
+ PDEBUG;
+
+ if (!fdasd_write_labels(disk_specific->anchor, arch_specific->fd))
+ return 0;
+
+ return 1;
+
+error:
+ PDEBUG;
+ return 0;
+}
+
+static PedPartition*
+dasd_partition_new (const PedDisk* disk, PedPartitionType part_type,
+ const PedFileSystemType* fs_type,
+ PedSector start, PedSector end)
+{
+ PedPartition* part;
+
+ part = _ped_partition_alloc(disk, part_type, fs_type, start, end);
+ if (!part)
+ goto error;
+
+ part->disk_specific = ped_malloc (sizeof (DasdPartitionData));
+ return part;
+
+error:
+ return 0;
+}
+
+static void
+dasd_partition_destroy (PedPartition* part)
+{
+ PED_ASSERT(part != NULL, return);
+
+ if (ped_partition_is_active(part))
+ ped_free(part->disk_specific);
+ ped_free(part);
+}
+
+static int
+dasd_partition_set_flag (PedPartition* part, PedPartitionFlag flag, int state)
+{
+ PedDisk* disk;
+ PedPartition* walk;
+ DasdPartitionData* dasd_data;
+ const PedFileSystemType* fs_type;
+
+ PED_ASSERT(part != NULL, return 0);
+ PED_ASSERT(part->disk_specific != NULL, return 0);
+ dasd_data = part->disk_specific;
+
+ switch (flag) {
+ case PED_PARTITION_RAID:
+ if (state)
+ dasd_data->lvm = 0;
+ dasd_data->raid = state;
+ return ped_partition_set_system(part, part->fs_type);
+ case PED_PARTITION_LVM:
+ if (state)
+ dasd_data->raid = 0;
+ dasd_data->lvm = state;
+ return ped_partition_set_system(part, part->fs_type);
+ default:
+ return 0;
+ }
+}
+
+static int
+dasd_partition_get_flag (const PedPartition* part, PedPartitionFlag flag)
+{
+ DasdPartitionData* dasd_data;
+
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->disk_specific != NULL, return 0);
+ dasd_data = part->disk_specific;
+
+ switch (flag) {
+ case PED_PARTITION_RAID:
+ return dasd_data->raid;
+ case PED_PARTITION_LVM:
+ return dasd_data->lvm;
+ default:
+ return 0;
+ }
+}
+
+static int
+dasd_partition_is_flag_available (const PedPartition* part,
+ PedPartitionFlag flag)
+{
+ switch (flag) {
+ case PED_PARTITION_RAID:
+ return 1;
+ case PED_PARTITION_LVM:
+ return 1;
+ default:
+ return 0;
+ }
+}
+
+
+static int
+dasd_get_max_primary_partition_count (const PedDisk* disk)
+{
+ DasdDiskSpecific* disk_specific;
+
+ disk_specific = disk->disk_specific;
+ /* If formated in LDL, maximum partition number is 1 */
+ if (disk_specific->format_type == 1)
+ return 1;
+
+ return USABLE_PARTITIONS;
+}
+
+static PedConstraint*
+_primary_constraint (PedDisk* disk)
+{
+ PedAlignment start_align;
+ PedAlignment end_align;
+ PedGeometry max_geom;
+ PedSector sector_size;
+ LinuxSpecific* arch_specific;
+ DasdDiskSpecific* disk_specific;
+
+ PDEBUG;
+
+ arch_specific = LINUX_SPECIFIC (disk->dev);
+ disk_specific = disk->disk_specific;
+ sector_size = disk_specific->real_sector_size / disk->dev->sector_size;
+
+ if (!ped_alignment_init (&start_align, 0,
+ disk->dev->hw_geom.sectors * sector_size))
+ return NULL;
+ if (!ped_alignment_init (&end_align, -1,
+ disk->dev->hw_geom.sectors * sector_size))
+ return NULL;
+ if (!ped_geometry_init (&max_geom, disk->dev, 0, disk->dev->length))
+ return NULL;
+
+ return ped_constraint_new(&start_align, &end_align, &max_geom,
+ &max_geom, 1, disk->dev->length);
+}
+
+static int
+dasd_partition_align (PedPartition* part, const PedConstraint* constraint)
+{
+ DasdDiskSpecific* disk_specific;
+
+ PED_ASSERT (part != NULL, return 0);
+
+ disk_specific = part->disk->disk_specific;
+ /* If formated in LDL, ignore metadata partition */
+ if (disk_specific->format_type == 1)
+ return 1;
+
+ if (_ped_partition_attempt_align(part, constraint,
+ _primary_constraint(part->disk)))
+ return 1;
+
+#ifndef DISCOVER_ONLY
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Unable to satisfy all constraints on the partition."));
+#endif
+
+ return 0;
+}
+
+static int
+dasd_partition_enumerate (PedPartition* part)
+{
+ int i;
+ PedPartition* p;
+
+ /* never change the partition numbers */
+ if (part->num != -1)
+ return 1;
+
+ for (i = 1; i <= USABLE_PARTITIONS; i++) {
+ p = ped_disk_get_partition (part->disk, i);
+ if (!p) {
+ part->num = i;
+ return 1;
+ }
+ }
+
+ /* failed to allocate a number */
+ ped_exception_throw(PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("Unable to allocate a dasd disklabel slot"));
+ return 0;
+}
+
+static int
+dasd_partition_set_system (PedPartition* part,
+ const PedFileSystemType* fs_type)
+{
+ DasdPartitionData* dasd_data = part->disk_specific;
+ PedSector cyl_size;
+
+ cyl_size=part->disk->dev->hw_geom.sectors * part->disk->dev->hw_geom.heads;
+ PDEBUG;
+
+ part->fs_type = fs_type;
+
+ if (dasd_data->lvm) {
+ dasd_data->system = PARTITION_LINUX_LVM;
+ PDEBUG;
+ return 1;
+ }
+
+ if (dasd_data->raid) {
+ dasd_data->system = PARTITION_LINUX_RAID;
+ PDEBUG;
+ return 1;
+ }
+
+ if (!fs_type) {
+ dasd_data->system = PARTITION_LINUX;
+ PDEBUG;
+ } else if (!strcmp (fs_type->name, "linux-swap")) {
+ dasd_data->system = PARTITION_LINUX_SWAP;
+ PDEBUG;
+ } else {
+ dasd_data->system = PARTITION_LINUX;
+ PDEBUG;
+ }
+
+ return 1;
+}
+
+static int
+dasd_alloc_metadata (PedDisk* disk)
+{
+ PedPartition* new_part;
+ PedConstraint* constraint_any = NULL;
+ PedSector vtoc_end;
+ LinuxSpecific* arch_specific;
+ DasdDiskSpecific* disk_specific;
+
+ PED_ASSERT (disk != NULL, goto error);
+ PED_ASSERT (disk->dev != NULL, goto error);
+
+ arch_specific = LINUX_SPECIFIC (disk->dev);
+ disk_specific = disk->disk_specific;
+
+ constraint_any = ped_constraint_any (disk->dev);
+
+ /* If formated in LDL, the real partition starts at sector 24. */
+ if (disk_specific->format_type == 1)
+ vtoc_end = 23;
+ else
+ /* Mark the start of the disk as metadata. */
+ vtoc_end = (FIRST_USABLE_TRK * (long long) disk->dev->hw_geom.sectors
+ * (long long) disk_specific->real_sector_size
+ / (long long) disk->dev->sector_size) - 1;
+
+ new_part = ped_partition_new (disk,PED_PARTITION_METADATA,NULL,0,vtoc_end);
+ if (!new_part)
+ goto error;
+
+ if (!ped_disk_add_partition (disk, new_part, constraint_any)) {
+ ped_partition_destroy (new_part);
+ goto error;
+ }
+
+ ped_constraint_destroy (constraint_any);
+ return 1;
+
+error:
+ ped_constraint_destroy (constraint_any);
+ return 0;
+}
diff --git a/libparted/labels/dos.c b/libparted/labels/dos.c
new file mode 100644
index 0000000..01d9602
--- /dev/null
+++ b/libparted/labels/dos.c
@@ -0,0 +1,2212 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#include "config.h"
+
+#include <sys/time.h>
+#include <parted/parted.h>
+#include <parted/debug.h>
+#include <parted/endian.h>
+#include <string.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+/* this MBR boot code is loaded into 0000:7c00 by the BIOS. See mbr.s for
+ * the source, and how to build it
+ */
+
+static char MBR_BOOT_CODE[] = {
+ 0xfa, 0xb8, 0x00, 0x10, 0x8e, 0xd0, 0xbc, 0x00,
+ 0xb0, 0xb8, 0x00, 0x00, 0x8e, 0xd8, 0x8e, 0xc0,
+ 0xfb, 0xbe, 0x00, 0x7c, 0xbf, 0x00, 0x06, 0xb9,
+ 0x00, 0x02, 0xf3, 0xa4, 0xea, 0x21, 0x06, 0x00,
+ 0x00, 0xbe, 0xbe, 0x07, 0x38, 0x04, 0x75, 0x0b,
+ 0x83, 0xc6, 0x10, 0x81, 0xfe, 0xfe, 0x07, 0x75,
+ 0xf3, 0xeb, 0x16, 0xb4, 0x02, 0xb0, 0x01, 0xbb,
+ 0x00, 0x7c, 0xb2, 0x80, 0x8a, 0x74, 0x01, 0x8b,
+ 0x4c, 0x02, 0xcd, 0x13, 0xea, 0x00, 0x7c, 0x00,
+ 0x00, 0xeb, 0xfe
+};
+
+#define MSDOS_MAGIC 0xAA55
+#define PARTITION_MAGIC_MAGIC 0xf6f6
+
+#define PARTITION_EMPTY 0x00
+#define PARTITION_FAT12 0x01
+#define PARTITION_FAT16_SM 0x04
+#define PARTITION_EXT 0x05
+#define PARTITION_FAT16 0x06
+#define PARTITION_NTFS 0x07
+#define PARTITION_HPFS 0x07
+#define PARTITION_FAT32 0x0b
+#define PARTITION_FAT32_LBA 0x0c
+#define PARTITION_FAT16_LBA 0x0e
+#define PARTITION_EXT_LBA 0x0f
+
+#define PART_FLAG_HIDDEN 0x10 /* Valid for FAT/NTFS only */
+#define PARTITION_FAT12_H (PARTITION_FAT12 | PART_FLAG_HIDDEN)
+#define PARTITION_FAT16_SM_H (PARTITION_FAT16_SM | PART_FLAG_HIDDEN)
+#define PARTITION_EXT_H (PARTITION_EXT | PART_FLAG_HIDDEN)
+#define PARTITION_FAT16_H (PARTITION_FAT16 | PART_FLAG_HIDDEN)
+#define PARTITION_NTFS_H (PARTITION_NTFS | PART_FLAG_HIDDEN)
+#define PARTITION_FAT32_H (PARTITION_FAT32 | PART_FLAG_HIDDEN)
+#define PARTITION_FAT32_LBA_H (PARTITION_FAT32_LBA | PART_FLAG_HIDDEN)
+#define PARTITION_FAT16_LBA_H (PARTITION_FAT16_LBA | PART_FLAG_HIDDEN)
+
+#define PARTITION_LDM 0x42
+
+#define PARTITION_COMPAQ_DIAG 0x12
+#define PARTITION_LINUX_SWAP 0x82
+#define PARTITION_LINUX 0x83
+#define PARTITION_LINUX_EXT 0x85
+#define PARTITION_LINUX_LVM 0x8e
+#define PARTITION_SUN_UFS 0xbf
+#define PARTITION_DELL_DIAG 0xde
+#define PARTITION_GPT 0xee
+#define PARTITION_PALO 0xf0
+#define PARTITION_PREP 0x41
+#define PARTITION_LINUX_RAID 0xfd
+#define PARTITION_LINUX_LVM_OLD 0xfe
+
+/* This constant contains the maximum cylinder number that can be represented
+ * in (C,H,S) notation. Higher cylinder numbers are reserved for
+ * "too big" indicators (in which case only LBA addressing can be used).
+ * Some partition tables in the wild indicate this number is 1021.
+ * (i.e. 1022 is sometimes used to indicate "use LBA").
+ */
+#define MAX_CHS_CYLINDER 1021
+
+typedef struct _DosRawPartition DosRawPartition;
+typedef struct _DosRawTable DosRawTable;
+
+/* note: lots of bit-bashing here, thus, you shouldn't look inside it.
+ * Use chs_to_sector() and sector_to_chs() instead.
+ */
+typedef struct {
+ uint8_t head;
+ uint8_t sector;
+ uint8_t cylinder;
+} __attribute__((packed)) RawCHS;
+
+/* ripped from Linux source */
+struct _DosRawPartition {
+ uint8_t boot_ind; /* 00: 0x80 - active */
+ RawCHS chs_start; /* 01: */
+ uint8_t type; /* 04: partition type */
+ RawCHS chs_end; /* 05: */
+ uint32_t start; /* 08: starting sector counting from 0 */
+ uint32_t length; /* 0c: nr of sectors in partition */
+} __attribute__((packed));
+
+struct _DosRawTable {
+ char boot_code [440];
+ uint32_t mbr_signature; /* really a unique ID */
+ uint16_t Unknown;
+ DosRawPartition partitions [4];
+ uint16_t magic;
+} __attribute__((packed));
+
+/* OrigState is information we want to preserve about the partition for
+ * dealing with CHS issues
+ */
+typedef struct {
+ PedGeometry geom;
+ DosRawPartition raw_part;
+ PedSector lba_offset; /* needed for computing start/end for
+ * logical partitions */
+} OrigState;
+
+typedef struct {
+ unsigned char system;
+ int boot;
+ int hidden;
+ int raid;
+ int lvm;
+ int lba;
+ int palo;
+ int prep;
+ OrigState* orig; /* used for CHS stuff */
+} DosPartitionData;
+
+static PedDiskType msdos_disk_type;
+
+static int
+msdos_probe (const PedDevice *dev)
+{
+ PedDiskType* disk_type;
+ DosRawTable part_table;
+ int i;
+
+ PED_ASSERT (dev != NULL, return 0);
+
+ if (dev->sector_size != 512)
+ return 0;
+
+ if (!ped_device_read (dev, &part_table, 0, 1))
+ return 0;
+
+ /* check magic */
+ if (PED_LE16_TO_CPU (part_table.magic) != MSDOS_MAGIC)
+ return 0;
+
+ /* if this is a FAT fs, fail here. Note that the Smart Boot Manager
+ * Loader (SBML) signature indicates a partition table, not a file
+ * system.
+ */
+ if ((!strncmp (part_table.boot_code + 0x36, "FAT", 3)
+ && strncmp (part_table.boot_code + 0x40, "SBML", 4) != 0)
+ || !strncmp (part_table.boot_code + 0x52, "FAT", 3))
+ return 0;
+
+ /* If this is a GPT disk, fail here */
+ for (i = 0; i < 4; i++) {
+ if (part_table.partitions[i].type == PARTITION_GPT)
+ return 0;
+ }
+
+ /* If this is an AIX Physical Volume, fail here. IBMA in EBCDIC */
+ if (part_table.boot_code[0] == (char) 0xc9 &&
+ part_table.boot_code[1] == (char) 0xc2 &&
+ part_table.boot_code[2] == (char) 0xd4 &&
+ part_table.boot_code[3] == (char) 0xc1)
+ return 0;
+
+#ifdef ENABLE_PC98
+ /* HACK: it's impossible to tell PC98 and msdos disk labels apart.
+ * Someone made the signatures the same (very clever). Since
+ * PC98 has some idiosyncracies with it's boot-loader, it's detection
+ * is more reliable */
+ disk_type = ped_disk_type_get ("pc98");
+ if (disk_type && disk_type->ops->probe (dev))
+ return 0;
+#endif /* ENABLE_PC98 */
+
+ return 1;
+}
+
+static PedDisk*
+msdos_alloc (const PedDevice* dev)
+{
+ PedDisk* disk;
+ PED_ASSERT (dev != NULL, return NULL);
+
+ disk = _ped_disk_alloc ((PedDevice*)dev, &msdos_disk_type);
+ if (disk)
+ disk->disk_specific = NULL;
+ return disk;
+}
+
+static PedDisk*
+msdos_duplicate (const PedDisk* disk)
+{
+ PedDisk* new_disk;
+
+ new_disk = ped_disk_new_fresh (disk->dev, &msdos_disk_type);
+ if (!new_disk)
+ return NULL;
+ new_disk->disk_specific = NULL;
+ return new_disk;
+}
+
+static void
+msdos_free (PedDisk* disk)
+{
+ PED_ASSERT (disk != NULL, return);
+
+ _ped_disk_free (disk);
+}
+
+#ifndef DISCOVER_ONLY
+static int
+msdos_clobber (PedDevice* dev)
+{
+ DosRawTable table;
+
+ PED_ASSERT (dev != NULL, return 0);
+ PED_ASSERT (msdos_probe (dev), return 0);
+
+ if (!ped_device_read (dev, &table, 0, 1))
+ return 0;
+ table.magic = 0;
+ return ped_device_write (dev, (void*) &table, 0, 1);
+}
+#endif /* !DISCOVER_ONLY */
+
+static int
+chs_get_cylinder (const RawCHS* chs)
+{
+ return chs->cylinder + ((chs->sector >> 6) << 8);
+}
+
+static int
+chs_get_head (const RawCHS* chs)
+{
+ return chs->head;
+}
+
+/* counts from 0 */
+static int
+chs_get_sector (const RawCHS* chs)
+{
+ return (chs->sector & 0x3f) - 1;
+}
+
+static PedSector
+chs_to_sector (PedDevice* dev, const PedCHSGeometry *bios_geom,
+ const RawCHS* chs)
+{
+ PedSector c; /* not measured in sectors, but need */
+ PedSector h; /* lots of bits */
+ PedSector s;
+
+ PED_ASSERT (bios_geom != NULL, return 0);
+ PED_ASSERT (chs != NULL, return 0);
+
+ c = chs_get_cylinder (chs);
+ h = chs_get_head (chs);
+ s = chs_get_sector (chs);
+
+ if (c > MAX_CHS_CYLINDER) /* MAGIC: C/H/S is irrelevant */
+ return 0;
+ if (s < 0)
+ return 0;
+ return ((c * bios_geom->heads + h) * bios_geom->sectors + s)
+ * (dev->sector_size / 512);
+}
+
+static void
+sector_to_chs (PedDevice* dev, const PedCHSGeometry* bios_geom,
+ PedSector sector, RawCHS* chs)
+{
+ PedSector real_c, real_h, real_s;
+
+ PED_ASSERT (dev != NULL, return);
+ PED_ASSERT (chs != NULL, return);
+
+ if (!bios_geom)
+ bios_geom = &dev->bios_geom;
+
+ sector /= (dev->sector_size / 512);
+
+ real_c = sector / (bios_geom->heads * bios_geom->sectors);
+ real_h = (sector / bios_geom->sectors) % bios_geom->heads;
+ real_s = sector % bios_geom->sectors;
+
+ if (real_c > MAX_CHS_CYLINDER) {
+ real_c = 1023;
+ real_h = bios_geom->heads - 1;
+ real_s = bios_geom->sectors - 1;
+ }
+
+ chs->cylinder = real_c % 0x100;
+ chs->head = real_h;
+ chs->sector = real_s + 1 + (real_c >> 8 << 6);
+}
+
+static PedSector
+legacy_start (PedDisk* disk, const PedCHSGeometry* bios_geom,
+ const DosRawPartition* raw_part)
+{
+ PED_ASSERT (disk != NULL, return 0);
+ PED_ASSERT (raw_part != NULL, return 0);
+
+ return chs_to_sector (disk->dev, bios_geom, &raw_part->chs_start);
+}
+
+static PedSector
+legacy_end (PedDisk* disk, const PedCHSGeometry* bios_geom,
+ const DosRawPartition* raw_part)
+{
+ PED_ASSERT (disk != NULL, return 0);
+ PED_ASSERT (raw_part != NULL, return 0);
+
+ return chs_to_sector (disk->dev, bios_geom, &raw_part->chs_end);
+}
+
+static PedSector
+linear_start (const PedDisk* disk, const DosRawPartition* raw_part,
+ PedSector offset)
+{
+ PED_ASSERT (disk != NULL, return 0);
+ PED_ASSERT (raw_part != NULL, return 0);
+
+ return offset
+ + PED_LE32_TO_CPU (raw_part->start)
+ * (disk->dev->sector_size / 512);
+}
+
+static PedSector
+linear_end (const PedDisk* disk, const DosRawPartition* raw_part,
+ PedSector offset)
+{
+ PED_ASSERT (disk != NULL, return 0);
+ PED_ASSERT (raw_part != NULL, return 0);
+
+ return linear_start (disk, raw_part, offset)
+ + (PED_LE32_TO_CPU (raw_part->length) - 1)
+ * (disk->dev->sector_size / 512);
+}
+
+#ifndef DISCOVER_ONLY
+static int
+partition_check_bios_geometry (PedPartition* part, PedCHSGeometry* bios_geom)
+{
+ PedSector leg_start, leg_end;
+ DosPartitionData* dos_data;
+ PedDisk* disk;
+
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->disk != NULL, return 0);
+ PED_ASSERT (part->disk_specific != NULL, return 0);
+ dos_data = part->disk_specific;
+
+ if (!dos_data->orig)
+ return 1;
+
+ disk = part->disk;
+ leg_start = legacy_start (disk, bios_geom, &dos_data->orig->raw_part);
+ leg_end = legacy_end (disk, bios_geom, &dos_data->orig->raw_part);
+
+ if (leg_start && leg_start != dos_data->orig->geom.start)
+ return 0;
+ if (leg_end && leg_end != dos_data->orig->geom.end)
+ return 0;
+ return 1;
+}
+
+static int
+disk_check_bios_geometry (PedDisk* disk, PedCHSGeometry* bios_geom)
+{
+ PedPartition* part = NULL;
+
+ PED_ASSERT (disk != NULL, return 0);
+
+ while ((part = ped_disk_next_partition (disk, part))) {
+ if (ped_partition_is_active (part)) {
+ if (!partition_check_bios_geometry (part, bios_geom))
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
+static int
+probe_filesystem_for_geom (const PedPartition* part, PedCHSGeometry* bios_geom)
+{
+ const char* ms_types[] = {"ntfs", "fat16", "fat32", NULL};
+ int i;
+ int found;
+ unsigned char* buf;
+ int sectors;
+ int heads;
+
+ PED_ASSERT (bios_geom != NULL, return 0);
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->disk != NULL, return 0);
+ PED_ASSERT (part->disk->dev != NULL, return 0);
+ PED_ASSERT (part->disk->dev->sector_size % 512 == 0, return 0);
+
+ buf = ped_malloc (part->disk->dev->sector_size);
+
+ if (!part->fs_type)
+ return 0;
+
+ found = 0;
+ for (i = 0; ms_types[i]; i++) {
+ if (!strcmp(ms_types[i], part->fs_type->name))
+ found = 1;
+ }
+ if (!found)
+ return 0;
+
+ if (!ped_geometry_read(&part->geom, buf, 0, 1))
+ return 0;
+
+ /* shared by the start of all Microsoft file systems */
+ sectors = buf[0x18] + (buf[0x19] << 8);
+ heads = buf[0x1a] + (buf[0x1b] << 8);
+
+ if (sectors < 1 || sectors > 63)
+ return 0;
+ if (heads > 255 || heads < 1)
+ return 0;
+
+ bios_geom->sectors = sectors;
+ bios_geom->heads = heads;
+ bios_geom->cylinders = part->disk->dev->length / (sectors * heads);
+ return 1;
+}
+
+/* This function attempts to infer the BIOS CHS geometry of the hard disk
+ * from the CHS + LBA information contained in the partition table from
+ * a single partition's entry.
+ *
+ * This involves some maths. Let (c,h,s,a) be the starting cylinder,
+ * starting head, starting sector and LBA start address of the partition.
+ * Likewise, (C,H,S,A) the end addresses. Using both of these pieces
+ * of information, we want to deduce cyl_sectors and head_sectors which
+ * are the sizes of a single cylinder and a single head, respectively.
+ *
+ * The relationships are:
+ * c*cyl_sectors + h * head_sectors + s = a
+ * C*cyl_sectors + H * head_sectors + S = A
+ *
+ * We can rewrite this in matrix form:
+ *
+ * [ c h ] [ cyl_sectors ] = [ s - a ] = [ a_ ]
+ * [ C H ] [ head_sectors ] [ S - A ] [ A_ ].
+ *
+ * (s - a is abbreviated to a_to simplify the notation.)
+ *
+ * This can be abbreviated into augmented matrix form:
+ *
+ * [ c h | a_ ]
+ * [ C H | A_ ].
+ *
+ * Solving these equations requires following the row reduction algorithm. We
+ * need to be careful about a few things though:
+ * - the equations might be linearly dependent, in which case there
+ * are many solutions.
+ * - the equations might be inconsistent, in which case there
+ * are no solutions. (Inconsistent partition table entry!)
+ * - there might be zeros, so we need to be careful about applying
+ * the algorithm. We know, however, that C > 0.
+ */
+static int
+probe_partition_for_geom (PedPartition* part, PedCHSGeometry* bios_geom)
+{
+ DosPartitionData* dos_data;
+ RawCHS* start_chs;
+ RawCHS* end_chs;
+ PedSector c, h, s, a, a_; /* start */
+ PedSector C, H, S, A, A_; /* end */
+ PedSector dont_overflow, denum;
+ PedSector cyl_size, head_size;
+ PedSector cylinders, heads, sectors;
+
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->disk_specific != NULL, return 0);
+ PED_ASSERT (bios_geom != NULL, return 0);
+
+ dos_data = part->disk_specific;
+
+ if (!dos_data->orig)
+ return 0;
+
+ start_chs = &dos_data->orig->raw_part.chs_start;
+ c = chs_get_cylinder (start_chs);
+ h = chs_get_head (start_chs);
+ s = chs_get_sector (start_chs);
+ a = dos_data->orig->geom.start;
+ a_ = a - s;
+
+ end_chs = &dos_data->orig->raw_part.chs_end;
+ C = chs_get_cylinder (end_chs);
+ H = chs_get_head (end_chs);
+ S = chs_get_sector (end_chs);
+ A = dos_data->orig->geom.end;
+ A_ = A - S;
+
+ if (h < 0 || H < 0 || h > 254 || H > 254)
+ return 0;
+ if (c > C)
+ return 0;
+
+ /* If no geometry is feasible, then don't even bother.
+ * Useful for eliminating assertions for broken partition
+ * tables generated by Norton Ghost et al.
+ */
+ if (A > (C+1) * 255 * 63)
+ return 0;
+
+ /* Not enough information. In theory, we can do better. Should we? */
+ if (C > MAX_CHS_CYLINDER)
+ return 0;
+ if (C == 0)
+ return 0;
+
+ /* Calculate the maximum number that can be multiplied by
+ * any head count without overflowing a PedSector
+ * 2^8 = 256, 8 bits + 1(sign bit) = 9
+ */
+ dont_overflow = 1;
+ dont_overflow <<= (8*sizeof(dont_overflow)) - 9;
+ dont_overflow--;
+
+ if (a_ > dont_overflow || A_ > dont_overflow)
+ return 0;
+
+ /* The matrix is solved by :
+ *
+ * [ c h | a_] R1
+ * [ C H | A_] R2
+ *
+ * (cH - Ch) cyl_size = a_H - A_h H R1 - h R2
+ * => (if cH - Ch != 0) cyl_size = (a_H - A_h) / (cH - Ch)
+ *
+ * (Hc - hC) head_size = A_c - a_C c R2 - C R1
+ * => (if cH - Ch != 0) head_size = (A_c - a_C) / (cH - Ch)
+ *
+ * But this calculation of head_size would need
+ * not overflowing A_c or a_C
+ * So substitution is use instead, to minimize dimension
+ * of temporary results :
+ *
+ * If h != 0 : head_size = ( a_ - c cyl_size ) / h
+ * If H != 0 : head_size = ( A_ - C cyl_size ) / H
+ *
+ */
+ denum = c * H - C * h;
+ if (denum == 0)
+ return 0;
+
+ cyl_size = (a_*H - A_*h) / denum;
+ /* Check for non integer result */
+ if (cyl_size * denum != a_*H - A_*h)
+ return 0;
+
+ PED_ASSERT (cyl_size > 0, return 0);
+ PED_ASSERT (cyl_size <= 255 * 63, return 0);
+
+ if (h > 0)
+ head_size = ( a_ - c * cyl_size ) / h;
+ else if (H > 0)
+ head_size = ( A_ - C * cyl_size ) / H;
+ else {
+ /* should not happen because denum != 0 */
+ head_size = 0;
+ PED_ASSERT (0, return 0);
+ }
+
+ PED_ASSERT (head_size > 0, return 0);
+ PED_ASSERT (head_size <= 63, return 0);
+
+ cylinders = part->disk->dev->length / cyl_size;
+ heads = cyl_size / head_size;
+ sectors = head_size;
+
+ PED_ASSERT (heads > 0, return 0);
+ PED_ASSERT (heads < 256, return 0);
+
+ PED_ASSERT (sectors > 0, return 0);
+ PED_ASSERT (sectors <= 63, return 0);
+
+ /* Some broken OEM partitioning program(s) seem to have an out-by-one
+ * error on the end of partitions. We should offer to fix the
+ * partition table...
+ */
+ if (((C + 1) * heads + H) * sectors + S == A)
+ C++;
+
+ PED_ASSERT ((c * heads + h) * sectors + s == a, return 0);
+ PED_ASSERT ((C * heads + H) * sectors + S == A, return 0);
+
+ bios_geom->cylinders = cylinders;
+ bios_geom->heads = heads;
+ bios_geom->sectors = sectors;
+
+ return 1;
+}
+
+static void
+partition_probe_bios_geometry (PedPartition* part, PedCHSGeometry* bios_geom)
+{
+ PED_ASSERT (part != NULL, return);
+ PED_ASSERT (part->disk != NULL, return);
+ PED_ASSERT (bios_geom != NULL, return);
+
+ if (ped_partition_is_active (part)) {
+ if (probe_partition_for_geom (part, bios_geom))
+ return;
+ if (part->type & PED_PARTITION_EXTENDED) {
+ if (probe_filesystem_for_geom (part, bios_geom))
+ return;
+ }
+ }
+ if (part->type & PED_PARTITION_LOGICAL) {
+ PedPartition* ext_part;
+ ext_part = ped_disk_extended_partition (part->disk);
+ PED_ASSERT (ext_part != NULL, return);
+ partition_probe_bios_geometry (ext_part, bios_geom);
+ } else {
+ *bios_geom = part->disk->dev->bios_geom;
+ }
+}
+
+static void
+disk_probe_bios_geometry (PedDisk* disk, PedCHSGeometry* bios_geom)
+{
+ PedPartition* part;
+
+ /* first look at the boot partition */
+ part = NULL;
+ while ((part = ped_disk_next_partition (disk, part))) {
+ if (!ped_partition_is_active (part))
+ continue;
+ if (ped_partition_get_flag (part, PED_PARTITION_BOOT)) {
+ if (probe_filesystem_for_geom (part, bios_geom))
+ return;
+ if (probe_partition_for_geom (part, bios_geom))
+ return;
+ }
+ }
+
+ /* that didn't work... try all partition table entries */
+ part = NULL;
+ while ((part = ped_disk_next_partition (disk, part))) {
+ if (ped_partition_is_active (part)) {
+ if (probe_partition_for_geom (part, bios_geom))
+ return;
+ }
+ }
+
+ /* that didn't work... look at all file systems */
+ part = NULL;
+ while ((part = ped_disk_next_partition (disk, part))) {
+ if (ped_partition_is_active (part)) {
+ if (probe_filesystem_for_geom (part, bios_geom))
+ return;
+ }
+ }
+}
+#endif /* !DISCOVER_ONLY */
+
+static int
+raw_part_is_extended (const DosRawPartition* raw_part)
+{
+ PED_ASSERT (raw_part != NULL, return 0);
+
+ switch (raw_part->type) {
+ case PARTITION_EXT:
+ case PARTITION_EXT_LBA:
+ case PARTITION_LINUX_EXT:
+ return 1;
+
+ default:
+ return 0;
+ }
+
+ return 0;
+}
+
+static int
+raw_part_is_hidden (const DosRawPartition* raw_part)
+{
+ PED_ASSERT (raw_part != NULL, return 0);
+
+ switch (raw_part->type) {
+ case PARTITION_FAT12_H:
+ case PARTITION_FAT16_SM_H:
+ case PARTITION_FAT16_H:
+ case PARTITION_FAT32_H:
+ case PARTITION_NTFS_H:
+ case PARTITION_FAT32_LBA_H:
+ case PARTITION_FAT16_LBA_H:
+ return 1;
+
+ default:
+ return 0;
+ }
+
+ return 0;
+}
+
+static int
+raw_part_is_lba (const DosRawPartition* raw_part)
+{
+ PED_ASSERT (raw_part != NULL, return 0);
+
+ switch (raw_part->type) {
+ case PARTITION_FAT32_LBA:
+ case PARTITION_FAT16_LBA:
+ case PARTITION_EXT_LBA:
+ case PARTITION_FAT32_LBA_H:
+ case PARTITION_FAT16_LBA_H:
+ return 1;
+
+ default:
+ return 0;
+ }
+
+ return 0;
+}
+
+PedPartition*
+raw_part_parse (PedDisk* disk, const DosRawPartition* raw_part,
+ PedSector lba_offset, PedPartitionType type)
+{
+ PedPartition* part;
+ DosPartitionData* dos_data;
+
+ PED_ASSERT (disk != NULL, return NULL);
+ PED_ASSERT (raw_part != NULL, return NULL);
+
+ part = ped_partition_new (
+ disk, type, NULL,
+ linear_start (disk, raw_part, lba_offset),
+ linear_end (disk, raw_part, lba_offset));
+ if (!part)
+ return NULL;
+ dos_data = part->disk_specific;
+ dos_data->system = raw_part->type;
+ dos_data->boot = raw_part->boot_ind != 0;
+ dos_data->hidden = raw_part_is_hidden (raw_part);
+ dos_data->raid = raw_part->type == PARTITION_LINUX_RAID;
+ dos_data->lvm = raw_part->type == PARTITION_LINUX_LVM_OLD
+ || raw_part->type == PARTITION_LINUX_LVM;
+ dos_data->lba = raw_part_is_lba (raw_part);
+ dos_data->palo = raw_part->type == PARTITION_PALO;
+ dos_data->prep = raw_part->type == PARTITION_PREP;
+ dos_data->orig = ped_malloc (sizeof (OrigState));
+ if (!dos_data->orig) {
+ ped_partition_destroy (part);
+ return NULL;
+ }
+ dos_data->orig->geom = part->geom;
+ dos_data->orig->raw_part = *raw_part;
+ dos_data->orig->lba_offset = lba_offset;
+ return part;
+}
+
+static int
+read_table (PedDisk* disk, PedSector sector, int is_extended_table)
+{
+ int i;
+ DosRawTable table;
+ DosRawPartition* raw_part;
+ PedPartition* part;
+ PedPartitionType type;
+ PedSector lba_offset;
+ PedConstraint* constraint_exact;
+
+ PED_ASSERT (disk != NULL, return 0);
+ PED_ASSERT (disk->dev != NULL, return 0);
+
+ if (!ped_device_read (disk->dev, (void*) &table, sector, 1))
+ goto error;
+
+ /* weird: empty extended partitions are filled with 0xf6 by PM */
+ if (is_extended_table
+ && PED_LE16_TO_CPU (table.magic) == PARTITION_MAGIC_MAGIC)
+ return 1;
+
+#ifndef DISCOVER_ONLY
+ if (PED_LE16_TO_CPU (table.magic) != MSDOS_MAGIC) {
+ if (ped_exception_throw (
+ PED_EXCEPTION_ERROR, PED_EXCEPTION_IGNORE_CANCEL,
+ _("Invalid partition table on %s "
+ "-- wrong signature %x."),
+ disk->dev->path,
+ PED_LE16_TO_CPU (table.magic))
+ != PED_EXCEPTION_IGNORE)
+ goto error;
+ return 1;
+ }
+#endif
+
+ /* parse the partitions from this table */
+ for (i = 0; i < 4; i++) {
+ raw_part = &table.partitions [i];
+ if (raw_part->type == PARTITION_EMPTY || !raw_part->length)
+ continue;
+
+ /* process nested extended partitions after normal logical
+ * partitions, to make sure we get the order right.
+ */
+ if (is_extended_table && raw_part_is_extended (raw_part))
+ continue;
+
+ lba_offset = is_extended_table ? sector : 0;
+
+ if (linear_start (disk, raw_part, lba_offset) == sector) {
+ if (ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("Invalid partition table - recursive "
+ "partition on %s."),
+ disk->dev->path)
+ != PED_EXCEPTION_IGNORE)
+ goto error;
+ continue; /* avoid infinite recursion */
+ }
+
+ if (is_extended_table)
+ type = PED_PARTITION_LOGICAL;
+ else if (raw_part_is_extended (raw_part))
+ type = PED_PARTITION_EXTENDED;
+ else
+ type = PED_PARTITION_NORMAL;
+
+ part = raw_part_parse (disk, raw_part, lba_offset, type);
+ if (!part)
+ goto error;
+ if (!is_extended_table)
+ part->num = i + 1;
+ if (type != PED_PARTITION_EXTENDED)
+ part->fs_type = ped_file_system_probe (&part->geom);
+
+ constraint_exact = ped_constraint_exact (&part->geom);
+ if (!ped_disk_add_partition (disk, part, constraint_exact))
+ goto error;
+ ped_constraint_destroy (constraint_exact);
+
+ /* non-nested extended partition */
+ if (part->type == PED_PARTITION_EXTENDED) {
+ if (!read_table (disk, part->geom.start, 1))
+ goto error;
+ }
+ }
+
+ if (is_extended_table) {
+ /* process the nested extended partitions */
+ for (i = 0; i < 4; i++) {
+ PedSector part_start;
+
+ raw_part = &table.partitions [i];
+ if (!raw_part_is_extended (raw_part))
+ continue;
+
+ lba_offset = ped_disk_extended_partition
+ (disk)->geom.start;
+ part_start = linear_start (disk, raw_part, lba_offset);
+ if (part_start == sector) {
+ /* recursive table - already threw an
+ * exception above.
+ */
+ continue;
+ }
+ if (!read_table (disk, part_start, 1))
+ goto error;
+ }
+ }
+
+ return 1;
+
+error:
+ ped_disk_delete_all (disk);
+ return 0;
+}
+
+static int
+msdos_read (PedDisk* disk)
+{
+ PED_ASSERT (disk != NULL, return 0);
+ PED_ASSERT (disk->dev != NULL, return 0);
+
+ ped_disk_delete_all (disk);
+ if (!read_table (disk, 0, 0))
+ return 0;
+
+#ifndef DISCOVER_ONLY
+ /* try to figure out the correct BIOS CHS values */
+ if (!disk_check_bios_geometry (disk, &disk->dev->bios_geom)) {
+ PedCHSGeometry bios_geom = disk->dev->bios_geom;
+ disk_probe_bios_geometry (disk, &bios_geom);
+
+ /* if the geometry was wrong, then we should reread, to
+ * make sure the metadata is allocated in the right places.
+ */
+ if (disk->dev->bios_geom.cylinders != bios_geom.cylinders
+ || disk->dev->bios_geom.heads != bios_geom.heads
+ || disk->dev->bios_geom.sectors != bios_geom.sectors) {
+ disk->dev->bios_geom = bios_geom;
+ return msdos_read (disk);
+ }
+ }
+#endif
+
+ return 1;
+}
+
+#ifndef DISCOVER_ONLY
+static int
+fill_raw_part (DosRawPartition* raw_part, PedPartition* part, PedSector offset)
+{
+ DosPartitionData* dos_data;
+ PedCHSGeometry bios_geom;
+
+ PED_ASSERT (raw_part != NULL, return 0);
+ PED_ASSERT (part != NULL, return 0);
+
+ partition_probe_bios_geometry (part, &bios_geom);
+
+ dos_data = part->disk_specific;
+
+ raw_part->boot_ind = 0x80 * dos_data->boot;
+ raw_part->type = dos_data->system;
+ raw_part->start = PED_CPU_TO_LE32 ((part->geom.start - offset)
+ / (part->disk->dev->sector_size / 512));
+ raw_part->length = PED_CPU_TO_LE32 (part->geom.length
+ / (part->disk->dev->sector_size / 512));
+
+ sector_to_chs (part->disk->dev, &bios_geom, part->geom.start,
+ &raw_part->chs_start);
+ sector_to_chs (part->disk->dev, &bios_geom, part->geom.end,
+ &raw_part->chs_end);
+
+ if (dos_data->orig) {
+ DosRawPartition* orig_raw_part = &dos_data->orig->raw_part;
+ if (dos_data->orig->geom.start == part->geom.start)
+ raw_part->chs_start = orig_raw_part->chs_start;
+ if (dos_data->orig->geom.end == part->geom.end)
+ raw_part->chs_end = orig_raw_part->chs_end;
+ }
+
+ return 1;
+}
+
+static int
+fill_ext_raw_part_geom (DosRawPartition* raw_part, PedCHSGeometry* bios_geom,
+ PedGeometry* geom, PedSector offset)
+{
+ PED_ASSERT (raw_part != NULL, return 0);
+ PED_ASSERT (geom != NULL, return 0);
+ PED_ASSERT (geom->dev != NULL, return 0);
+
+ raw_part->boot_ind = 0;
+ raw_part->type = PARTITION_EXT;
+ raw_part->start = PED_CPU_TO_LE32 ((geom->start - offset)
+ / (geom->dev->sector_size / 512));
+ raw_part->length = PED_CPU_TO_LE32 (geom->length
+ / (geom->dev->sector_size / 512));
+
+ sector_to_chs (geom->dev, bios_geom, geom->start, &raw_part->chs_start);
+ sector_to_chs (geom->dev, bios_geom, geom->start + geom->length - 1,
+ &raw_part->chs_end);
+
+ return 1;
+}
+
+static int
+write_ext_table (PedDisk* disk, PedSector sector, PedPartition* logical)
+{
+ DosRawTable table;
+ PedPartition* part;
+ PedSector lba_offset;
+
+ PED_ASSERT (disk != NULL, return 0);
+ PED_ASSERT (ped_disk_extended_partition (disk) != NULL, return 0);
+ PED_ASSERT (logical != NULL, return 0);
+
+ lba_offset = ped_disk_extended_partition (disk)->geom.start;
+
+ memset (&table, 0, sizeof (DosRawTable));
+ table.magic = PED_CPU_TO_LE16 (MSDOS_MAGIC);
+
+ if (!fill_raw_part (&table.partitions[0], logical, sector))
+ return 0;
+
+ part = ped_disk_get_partition (disk, logical->num + 1);
+ if (part) {
+ PedGeometry* geom;
+ PedCHSGeometry bios_geom;
+
+ geom = ped_geometry_new (disk->dev, part->prev->geom.start,
+ part->geom.end - part->prev->geom.start + 1);
+ if (!geom)
+ return 0;
+ partition_probe_bios_geometry (part, &bios_geom);
+ fill_ext_raw_part_geom (&table.partitions[1], &bios_geom,
+ geom, lba_offset);
+ ped_geometry_destroy (geom);
+
+ if (!write_ext_table (disk, part->prev->geom.start, part))
+ return 0;
+ }
+
+ return ped_device_write (disk->dev, (void*) &table, sector, 1);
+}
+
+static int
+write_empty_table (PedDisk* disk, PedSector sector)
+{
+ DosRawTable table;
+
+ PED_ASSERT (disk != NULL, return 0);
+
+ memset (&table, 0, sizeof (DosRawTable));
+ table.magic = PED_CPU_TO_LE16 (MSDOS_MAGIC);
+
+ return ped_device_write (disk->dev, (void*) &table, sector, 1);
+}
+
+/* Find the first logical partition, and write the partition table for it.
+ */
+static int
+write_extended_partitions (PedDisk* disk)
+{
+ PedPartition* ext_part;
+ PedPartition* part;
+ PedCHSGeometry bios_geom;
+
+ PED_ASSERT (disk != NULL, return 0);
+
+ ext_part = ped_disk_extended_partition (disk);
+ partition_probe_bios_geometry (ext_part, &bios_geom);
+ part = ped_disk_get_partition (disk, 5);
+ if (part)
+ return write_ext_table (disk, ext_part->geom.start, part);
+ else
+ return write_empty_table (disk, ext_part->geom.start);
+}
+
+static inline uint32_t generate_random_id()
+{
+ struct timeval tv;
+ int rc;
+ rc = gettimeofday(&tv, NULL);
+ if (rc == -1)
+ return 0;
+ return (uint32_t)(tv.tv_usec & 0xFFFFFFFFUL);
+}
+
+static int
+msdos_write (PedDisk* disk)
+{
+ DosRawTable table;
+ PedPartition* part;
+ int i;
+
+ PED_ASSERT (disk != NULL, return 0);
+ PED_ASSERT (disk->dev != NULL, return 0);
+
+ ped_device_read (disk->dev, &table, 0, 1);
+
+ if (!table.boot_code[0]) {
+ memset (table.boot_code, 0, 512);
+ memcpy (table.boot_code, MBR_BOOT_CODE, sizeof (MBR_BOOT_CODE));
+ }
+
+ /* If there is no unique identifier, generate a random one */
+ if (!table.mbr_signature)
+ table.mbr_signature = generate_random_id();
+
+ memset (table.partitions, 0, sizeof (DosRawPartition) * 4);
+ table.magic = PED_CPU_TO_LE16 (MSDOS_MAGIC);
+
+ for (i=1; i<=4; i++) {
+ part = ped_disk_get_partition (disk, i);
+ if (!part)
+ continue;
+
+ if (!fill_raw_part (&table.partitions [i - 1], part, 0))
+ return 0;
+
+ if (part->type == PED_PARTITION_EXTENDED) {
+ if (!write_extended_partitions (disk))
+ return 0;
+ }
+ }
+
+ if (!ped_device_write (disk->dev, (void*) &table, 0, 1))
+ return 0;
+ return ped_device_sync (disk->dev);
+}
+#endif /* !DISCOVER_ONLY */
+
+static PedPartition*
+msdos_partition_new (const PedDisk* disk, PedPartitionType part_type,
+ const PedFileSystemType* fs_type,
+ PedSector start, PedSector end)
+{
+ PedPartition* part;
+ DosPartitionData* dos_data;
+
+ part = _ped_partition_alloc (disk, part_type, fs_type, start, end);
+ if (!part)
+ goto error;
+
+ if (ped_partition_is_active (part)) {
+ part->disk_specific
+ = dos_data = ped_malloc (sizeof (DosPartitionData));
+ if (!dos_data)
+ goto error_free_part;
+ dos_data->orig = NULL;
+ dos_data->system = PARTITION_LINUX;
+ dos_data->hidden = 0;
+ dos_data->boot = 0;
+ dos_data->raid = 0;
+ dos_data->lvm = 0;
+ dos_data->lba = 0;
+ dos_data->palo = 0;
+ dos_data->prep = 0;
+ } else {
+ part->disk_specific = NULL;
+ }
+ return part;
+
+error_free_dos_data:
+ ped_free (dos_data);
+error_free_part:
+ ped_free (part);
+error:
+ return 0;
+}
+
+static PedPartition*
+msdos_partition_duplicate (const PedPartition* part)
+{
+ PedPartition* new_part;
+ DosPartitionData* new_dos_data;
+ DosPartitionData* old_dos_data;
+
+ new_part = ped_partition_new (part->disk, part->type, part->fs_type,
+ part->geom.start, part->geom.end);
+ if (!new_part)
+ return NULL;
+ new_part->num = part->num;
+
+ old_dos_data = (DosPartitionData*) part->disk_specific;
+ new_dos_data = (DosPartitionData*) new_part->disk_specific;
+ new_dos_data->system = old_dos_data->system;
+ new_dos_data->boot = old_dos_data->boot;
+ new_dos_data->hidden = old_dos_data->hidden;
+ new_dos_data->raid = old_dos_data->raid;
+ new_dos_data->lvm = old_dos_data->lvm;
+ new_dos_data->lba = old_dos_data->lba;
+ new_dos_data->palo = old_dos_data->palo;
+ new_dos_data->prep = old_dos_data->prep;
+
+ if (old_dos_data->orig) {
+ new_dos_data->orig = ped_malloc (sizeof (OrigState));
+ if (!new_dos_data->orig) {
+ ped_partition_destroy (new_part);
+ return NULL;
+ }
+ new_dos_data->orig->geom = old_dos_data->orig->geom;
+ new_dos_data->orig->raw_part = old_dos_data->orig->raw_part;
+ new_dos_data->orig->lba_offset = old_dos_data->orig->lba_offset;
+ }
+ return new_part;
+}
+
+static void
+msdos_partition_destroy (PedPartition* part)
+{
+ PED_ASSERT (part != NULL, return);
+
+ if (ped_partition_is_active (part)) {
+ DosPartitionData* dos_data;
+ dos_data = (DosPartitionData*) part->disk_specific;
+ if (dos_data->orig)
+ ped_free (dos_data->orig);
+ ped_free (part->disk_specific);
+ }
+ ped_free (part);
+}
+
+static int
+msdos_partition_set_system (PedPartition* part,
+ const PedFileSystemType* fs_type)
+{
+ DosPartitionData* dos_data = part->disk_specific;
+
+ part->fs_type = fs_type;
+
+ if (dos_data->hidden
+ && fs_type
+ && strncmp (fs_type->name, "fat", 3) != 0
+ && strcmp (fs_type->name, "ntfs") != 0)
+ dos_data->hidden = 0;
+
+ if (part->type & PED_PARTITION_EXTENDED) {
+ dos_data->raid = 0;
+ dos_data->lvm = 0;
+ dos_data->palo = 0;
+ dos_data->prep = 0;
+ if (dos_data->lba)
+ dos_data->system = PARTITION_EXT_LBA;
+ else
+ dos_data->system = PARTITION_EXT;
+ return 1;
+ }
+
+ if (dos_data->lvm) {
+ dos_data->system = PARTITION_LINUX_LVM;
+ return 1;
+ }
+ if (dos_data->raid) {
+ dos_data->system = PARTITION_LINUX_RAID;
+ return 1;
+ }
+ if (dos_data->palo) {
+ dos_data->system = PARTITION_PALO;
+ return 1;
+ }
+ if (dos_data->prep) {
+ dos_data->system = PARTITION_PREP;
+ return 1;
+ }
+
+ if (!fs_type)
+ dos_data->system = PARTITION_LINUX;
+ else if (!strcmp (fs_type->name, "fat16")) {
+ dos_data->system = dos_data->lba
+ ? PARTITION_FAT16_LBA : PARTITION_FAT16;
+ dos_data->system |= dos_data->hidden ? PART_FLAG_HIDDEN : 0;
+ } else if (!strcmp (fs_type->name, "fat32")) {
+ dos_data->system = dos_data->lba
+ ? PARTITION_FAT32_LBA : PARTITION_FAT32;
+ dos_data->system |= dos_data->hidden ? PART_FLAG_HIDDEN : 0;
+ } else if (!strcmp (fs_type->name, "ntfs")
+ || !strcmp (fs_type->name, "hpfs")) {
+ dos_data->system = PARTITION_NTFS;
+ dos_data->system |= dos_data->hidden ? PART_FLAG_HIDDEN : 0;
+ } else if (!strcmp (fs_type->name, "sun-ufs"))
+ dos_data->system = PARTITION_SUN_UFS;
+ else if (!strcmp (fs_type->name, "linux-swap"))
+ dos_data->system = PARTITION_LINUX_SWAP;
+ else
+ dos_data->system = PARTITION_LINUX;
+
+ return 1;
+}
+
+static int
+msdos_partition_set_flag (PedPartition* part, PedPartitionFlag flag, int state)
+{
+ PedDisk* disk;
+ PedPartition* walk;
+ DosPartitionData* dos_data;
+
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->disk_specific != NULL, return 0);
+ PED_ASSERT (part->disk != NULL, return 0);
+
+ dos_data = part->disk_specific;
+ disk = part->disk;
+
+ switch (flag) {
+ case PED_PARTITION_HIDDEN:
+ if (part->type == PED_PARTITION_EXTENDED) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Extended partitions cannot be hidden on "
+ "msdos disk labels."));
+ return 0;
+ }
+ dos_data->hidden = state;
+ return ped_partition_set_system (part, part->fs_type);
+
+ case PED_PARTITION_BOOT:
+ dos_data->boot = state;
+ if (!state)
+ return 1;
+
+ walk = ped_disk_next_partition (disk, NULL);
+ for (; walk; walk = ped_disk_next_partition (disk, walk)) {
+ if (walk == part || !ped_partition_is_active (walk))
+ continue;
+ msdos_partition_set_flag (walk, PED_PARTITION_BOOT, 0);
+ }
+ return 1;
+
+ case PED_PARTITION_RAID:
+ if (state) {
+ dos_data->hidden = 0;
+ dos_data->lvm = 0;
+ dos_data->palo = 0;
+ dos_data->prep = 0;
+ }
+ dos_data->raid = state;
+ return ped_partition_set_system (part, part->fs_type);
+
+ case PED_PARTITION_LVM:
+ if (state) {
+ dos_data->hidden = 0;
+ dos_data->raid = 0;
+ dos_data->palo = 0;
+ dos_data->prep = 0;
+ }
+ dos_data->lvm = state;
+ return ped_partition_set_system (part, part->fs_type);
+
+ case PED_PARTITION_LBA:
+ dos_data->lba = state;
+ return ped_partition_set_system (part, part->fs_type);
+
+ case PED_PARTITION_PALO:
+ if (state) {
+ dos_data->hidden = 0;
+ dos_data->raid = 0;
+ dos_data->lvm = 0;
+ }
+ dos_data->palo = state;
+ return ped_partition_set_system (part, part->fs_type);
+
+ case PED_PARTITION_PREP:
+ if (state) {
+ dos_data->hidden = 0;
+ dos_data->raid = 0;
+ dos_data->lvm = 0;
+ }
+ dos_data->prep = state;
+ return ped_partition_set_system (part, part->fs_type);
+
+ default:
+ return 0;
+ }
+}
+
+static int
+msdos_partition_get_flag (const PedPartition* part, PedPartitionFlag flag)
+{
+ DosPartitionData* dos_data;
+
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->disk_specific != NULL, return 0);
+
+ dos_data = part->disk_specific;
+ switch (flag) {
+ case PED_PARTITION_HIDDEN:
+ return dos_data->hidden;
+
+ case PED_PARTITION_BOOT:
+ return dos_data->boot;
+
+ case PED_PARTITION_RAID:
+ return dos_data->raid;
+
+ case PED_PARTITION_LVM:
+ return dos_data->lvm;
+
+ case PED_PARTITION_LBA:
+ return dos_data->lba;
+
+ case PED_PARTITION_PALO:
+ return dos_data->palo;
+
+ case PED_PARTITION_PREP:
+ return dos_data->prep;
+
+ default:
+ return 0;
+ }
+}
+
+static int
+msdos_partition_is_flag_available (const PedPartition* part,
+ PedPartitionFlag flag)
+{
+ switch (flag) {
+ case PED_PARTITION_HIDDEN:
+ case PED_PARTITION_BOOT:
+ case PED_PARTITION_RAID:
+ case PED_PARTITION_LVM:
+ case PED_PARTITION_LBA:
+ case PED_PARTITION_PALO:
+ case PED_PARTITION_PREP:
+ return 1;
+
+ default:
+ return 0;
+ }
+}
+
+static PedGeometry*
+_try_constraint (PedPartition* part, const PedConstraint* external,
+ PedConstraint* internal)
+{
+ PedConstraint* intersection;
+ PedGeometry* solution;
+
+ intersection = ped_constraint_intersect (external, internal);
+ ped_constraint_destroy (internal);
+ if (!intersection)
+ return NULL;
+
+ solution = ped_constraint_solve_nearest (intersection, &part->geom);
+ ped_constraint_destroy (intersection);
+ return solution;
+}
+
+static PedGeometry*
+_best_solution (const PedPartition* part, const PedCHSGeometry* bios_geom,
+ PedGeometry* a, PedGeometry* b)
+{
+ PedDevice* dev = part->disk->dev;
+ PedSector cyl_size = bios_geom->heads * bios_geom->sectors;
+ int a_cylinder;
+ int b_cylinder;
+
+ if (!a)
+ return b;
+ if (!b)
+ return a;
+
+ a_cylinder = a->start / cyl_size;
+ b_cylinder = b->start / cyl_size;
+
+ if (a_cylinder == b_cylinder) {
+ if ( (a->start / bios_geom->sectors) % bios_geom->heads
+ < (b->start / bios_geom->sectors) % bios_geom->heads)
+ goto choose_a;
+ else
+ goto choose_b;
+ } else {
+ PedSector a_delta;
+ PedSector b_delta;
+
+ a_delta = abs (part->geom.start - a->start);
+ b_delta = abs (part->geom.start - b->start);
+
+ if (a_delta < b_delta)
+ goto choose_a;
+ else
+ goto choose_b;
+ }
+
+ return NULL; /* never get here! */
+
+choose_a:
+ ped_geometry_destroy (b);
+ return a;
+
+choose_b:
+ ped_geometry_destroy (a);
+ return b;
+}
+
+/* This constraint is for "normal" primary partitions, that start at the
+ * beginning of a cylinder, and end at the end of a cylinder.
+ * Note: you can't start a partition at the beginning of the 1st
+ * cylinder, because that's where the partition table is! There are different
+ * rules for that - see the _primary_start_constraint.
+ */
+static PedConstraint*
+_primary_constraint (PedDisk* disk, const PedCHSGeometry* bios_geom,
+ PedGeometry* min_geom)
+{
+ PedDevice* dev = disk->dev;
+ PedSector cylinder_size = bios_geom->sectors * bios_geom->heads;
+ PedAlignment start_align;
+ PedAlignment end_align;
+ PedGeometry start_geom;
+ PedGeometry end_geom;
+
+ if (!ped_alignment_init (&start_align, 0, cylinder_size))
+ return NULL;
+ if (!ped_alignment_init (&end_align, -1, cylinder_size))
+ return NULL;
+
+ if (min_geom) {
+ if (min_geom->start < cylinder_size)
+ return NULL;
+ if (!ped_geometry_init (&start_geom, dev, cylinder_size,
+ min_geom->start + 1 - cylinder_size))
+ return NULL;
+ if (!ped_geometry_init (&end_geom, dev, min_geom->end,
+ dev->length - min_geom->end))
+ return NULL;
+ } else {
+ if (!ped_geometry_init (&start_geom, dev, cylinder_size,
+ dev->length - cylinder_size))
+ return NULL;
+ if (!ped_geometry_init (&end_geom, dev, 0, dev->length))
+ return NULL;
+ }
+
+ return ped_constraint_new (&start_align, &end_align, &start_geom,
+ &end_geom, 1, dev->length);
+}
+
+/* This constraint is for partitions starting on the first cylinder. They
+ * must start on the 2nd head of the 1st cylinder.
+ */
+static PedConstraint*
+_primary_start_constraint (PedDisk* disk, const PedCHSGeometry* bios_geom,
+ PedGeometry* min_geom)
+{
+ PedDevice* dev = disk->dev;
+ PedSector cylinder_size = bios_geom->sectors * bios_geom->heads;
+ PedAlignment start_align;
+ PedAlignment end_align;
+ PedGeometry start_geom;
+ PedGeometry end_geom;
+
+ if (!ped_alignment_init (&start_align, bios_geom->sectors, 0))
+ return NULL;
+ if (!ped_alignment_init (&end_align, -1, cylinder_size))
+ return NULL;
+ if (min_geom) {
+ if (!ped_geometry_init (&start_geom, dev,
+ bios_geom->sectors, 1))
+ return NULL;
+ if (!ped_geometry_init (&end_geom, dev, min_geom->end,
+ dev->length - min_geom->end))
+ return NULL;
+ } else {
+ if (!ped_geometry_init (&start_geom, dev, bios_geom->sectors,
+ dev->length - bios_geom->sectors))
+ return NULL;
+ if (!ped_geometry_init (&end_geom, dev, 0, dev->length))
+ return NULL;
+ }
+
+ return ped_constraint_new (&start_align, &end_align, &start_geom,
+ &end_geom, 1, dev->length);
+}
+
+/* constraints for logical partitions:
+ * - start_offset is the offset in the start alignment. "normally",
+ * this is bios_geom->sectors. exceptions: MINOR > 5 at the beginning of the
+ * extended partition, or MINOR == 5 in the middle of the extended partition
+ * - is_start_part == 1 if the constraint is for the first cylinder of
+ * the extended partition, or == 0 if the constraint is for the second cylinder
+ * onwards of the extended partition.
+ */
+static PedConstraint*
+_logical_constraint (PedDisk* disk, const PedCHSGeometry* bios_geom,
+ PedSector start_offset, int is_start_part)
+{
+ PedPartition* ext_part = ped_disk_extended_partition (disk);
+ PedDevice* dev = disk->dev;
+ PedSector cylinder_size = bios_geom->sectors * bios_geom->heads;
+ PedAlignment start_align;
+ PedAlignment end_align;
+ PedGeometry max_geom;
+
+ PED_ASSERT (ext_part != NULL, return NULL);
+
+ if (!ped_alignment_init (&start_align, start_offset, cylinder_size))
+ return NULL;
+ if (!ped_alignment_init (&end_align, -1, cylinder_size))
+ return NULL;
+ if (is_start_part) {
+ if (!ped_geometry_init (&max_geom, dev,
+ ext_part->geom.start,
+ ext_part->geom.length))
+ return NULL;
+ } else {
+ PedSector min_start;
+ PedSector max_length;
+
+ min_start = ped_round_up_to (ext_part->geom.start + 1,
+ cylinder_size);
+ max_length = ext_part->geom.end - min_start + 1;
+ if (min_start >= ext_part->geom.end)
+ return NULL;
+
+ if (!ped_geometry_init (&max_geom, dev, min_start, max_length))
+ return NULL;
+ }
+
+ return ped_constraint_new (&start_align, &end_align, &max_geom,
+ &max_geom, 1, dev->length);
+}
+
+/* returns the minimum geometry for the extended partition, given that the
+ * extended partition must contain:
+ * * all logical partitions
+ * * all partition tables for all logical partitions (except the first)
+ * * the extended partition table
+ */
+static PedGeometry*
+_get_min_extended_part_geom (const PedPartition* ext_part,
+ const PedCHSGeometry* bios_geom)
+{
+ PedDisk* disk = ext_part->disk;
+ PedSector head_size = bios_geom ? bios_geom->sectors : 1;
+ PedPartition* walk;
+ PedGeometry* min_geom;
+
+ walk = ped_disk_get_partition (disk, 5);
+ if (!walk)
+ return NULL;
+
+ min_geom = ped_geometry_duplicate (&walk->geom);
+ if (!min_geom)
+ return NULL;
+ ped_geometry_set_start (min_geom, walk->geom.start - 1 * head_size);
+
+ for (walk = ext_part->part_list; walk; walk = walk->next) {
+ if (!ped_partition_is_active (walk) || walk->num == 5)
+ continue;
+ if (walk->geom.start < min_geom->start)
+ ped_geometry_set_start (min_geom,
+ walk->geom.start - 2 * head_size);
+ if (walk->geom.end > min_geom->end)
+ ped_geometry_set_end (min_geom, walk->geom.end);
+ }
+
+ return min_geom;
+}
+
+static int
+_align_primary (PedPartition* part, const PedCHSGeometry* bios_geom,
+ const PedConstraint* constraint)
+{
+ PedDisk* disk = part->disk;
+ PedDevice* dev = disk->dev;
+ PedGeometry* min_geom = NULL;
+ PedGeometry* solution = NULL;
+
+ if (part->type == PED_PARTITION_EXTENDED)
+ min_geom = _get_min_extended_part_geom (part, bios_geom);
+
+ solution = _best_solution (part, bios_geom, solution,
+ _try_constraint (part, constraint,
+ _primary_start_constraint (disk,
+ bios_geom, min_geom)));
+ solution = _best_solution (part, bios_geom, solution,
+ _try_constraint (part, constraint,
+ _primary_constraint (disk, bios_geom,
+ min_geom)));
+
+ if (min_geom)
+ ped_geometry_destroy (min_geom);
+
+ if (solution) {
+ ped_geometry_set (&part->geom, solution->start,
+ solution->length);
+ ped_geometry_destroy (solution);
+ return 1;
+ }
+
+ return 0;
+}
+
+static int
+_logical_min_start_head (PedPartition* part, const PedCHSGeometry* bios_geom,
+ PedPartition* ext_part, int is_start_ext_part)
+{
+ PedDevice* dev = part->disk->dev;
+ PedSector cylinder_size = bios_geom->sectors * bios_geom->heads;
+ PedSector base_head;
+
+ if (is_start_ext_part)
+ base_head = 1 + (ext_part->geom.start % cylinder_size)
+ / bios_geom->sectors;
+ else
+ base_head = 0;
+
+ if (part->num == 5)
+ return base_head + 0;
+ else
+ return base_head + 1;
+}
+
+/* Shamelessly copied and adapted from _partition_get_overlap_constraint
+ * (in disk.c)
+ * This should get ride of the infamous Assertion (metadata_length > 0) failed
+ * bug for extended msdos disklabels generated by Parted.
+ * 1) There always is a partition table at the start of ext_part, so we leave
+ * a one sector gap there.
+ * 2)*The partition table of part5 is always at the beginning of the ext_part
+ * so there is no need to leave a one sector gap before part5.
+ * *There always is a partition table at the beginning of each partition != 5.
+ * We don't need to worry to much about consistency with
+ * _partition_get_overlap_constraint because missing it means we are in edge
+ * cases anyway, and we don't lose anything by just refusing to do the job in
+ * those cases.
+ */
+static PedConstraint*
+_log_meta_overlap_constraint (PedPartition* part, PedGeometry* geom)
+{
+ PedGeometry safe_space;
+ PedSector min_start;
+ PedSector max_end;
+ PedPartition* ext_part = ped_disk_extended_partition (part->disk);
+ PedPartition* walk;
+ int not_5 = (part->num != 5);
+
+ PED_ASSERT (ext_part != NULL, return NULL);
+
+ walk = ext_part->part_list;
+
+ /* 1) 2) */
+ min_start = ext_part->geom.start + 1 + not_5;
+ max_end = ext_part->geom.end;
+
+ while (walk != NULL /* 2) 2) */
+ && ( walk->geom.start - (walk->num != 5) < geom->start - not_5
+ || walk->geom.start - (walk->num != 5) <= min_start )) {
+ if (walk != part && ped_partition_is_active (walk))
+ min_start = walk->geom.end + 1 + not_5; /* 2) */
+ walk = walk->next;
+ }
+
+ while (walk && (walk == part || !ped_partition_is_active (walk)))
+ walk = walk->next;
+
+ if (walk)
+ max_end = walk->geom.start - 1 - (walk->num != 5); /* 2) */
+
+ if (min_start >= max_end)
+ return NULL;
+
+ ped_geometry_init (&safe_space, part->disk->dev,
+ min_start, max_end - min_start + 1);
+ return ped_constraint_new_from_max (&safe_space);
+}
+
+static int
+_align_logical (PedPartition* part, const PedCHSGeometry* bios_geom,
+ const PedConstraint* constraint)
+{
+ PedDisk* disk = part->disk;
+ PedDevice* dev = disk->dev;
+ PedPartition* ext_part = ped_disk_extended_partition (disk);
+ PedSector cyl_size = bios_geom->sectors * bios_geom->heads;
+ PedSector start_base;
+ int head;
+ PedGeometry* solution = NULL;
+ PedConstraint *intersect, *log_meta_overlap;
+
+ PED_ASSERT (ext_part != NULL, return 0);
+
+ log_meta_overlap = _log_meta_overlap_constraint(part, &part->geom);
+ intersect = ped_constraint_intersect (constraint, log_meta_overlap);
+ ped_constraint_destroy (log_meta_overlap);
+ if (!intersect)
+ return 0;
+
+ start_base = ped_round_down_to (part->geom.start, cyl_size);
+
+ for (head = _logical_min_start_head (part, bios_geom, ext_part, 0);
+ head < PED_MIN (5, bios_geom->heads); head++) {
+ PedConstraint* disk_constraint;
+ PedSector start = start_base + head * bios_geom->sectors;
+
+ if (head >= _logical_min_start_head (part, bios_geom,
+ ext_part, 1))
+ disk_constraint =
+ _logical_constraint (disk, bios_geom, start, 1);
+ else
+ disk_constraint =
+ _logical_constraint (disk, bios_geom, start, 0);
+
+ solution = _best_solution (part, bios_geom, solution,
+ _try_constraint (part, intersect,
+ disk_constraint));
+ }
+
+ ped_constraint_destroy (intersect);
+
+ if (solution) {
+ ped_geometry_set (&part->geom, solution->start,
+ solution->length);
+ ped_geometry_destroy (solution);
+ return 1;
+ }
+
+ return 0;
+}
+
+static int
+_align (PedPartition* part, const PedCHSGeometry* bios_geom,
+ const PedConstraint* constraint)
+{
+ if (part->type == PED_PARTITION_LOGICAL)
+ return _align_logical (part, bios_geom, constraint);
+ else
+ return _align_primary (part, bios_geom, constraint);
+}
+
+static PedConstraint*
+_no_geom_constraint (PedDisk* disk, PedSector start, PedSector end)
+{
+ PedGeometry max;
+
+ ped_geometry_init (&max, disk->dev, start, end - start + 1);
+ return ped_constraint_new_from_max (&max);
+}
+
+static PedConstraint*
+_no_geom_extended_constraint (PedPartition* part)
+{
+ PedDevice* dev = part->disk->dev;
+ PedGeometry* min = _get_min_extended_part_geom (part, NULL);
+ PedGeometry start_range;
+ PedGeometry end_range;
+ PedConstraint* constraint;
+
+ if (min) {
+ ped_geometry_init (&start_range, dev, 1, min->start);
+ ped_geometry_init (&end_range, dev, min->end,
+ dev->length - min->end);
+ ped_geometry_destroy (min);
+ } else {
+ ped_geometry_init (&start_range, dev, 1, dev->length - 1);
+ ped_geometry_init (&end_range, dev, 1, dev->length - 1);
+ }
+ constraint = ped_constraint_new (ped_alignment_any, ped_alignment_any,
+ &start_range, &end_range, 1, dev->length);
+ return constraint;
+}
+
+static int
+_align_primary_no_geom (PedPartition* part, const PedConstraint* constraint)
+{
+ PedDisk* disk = part->disk;
+ PedGeometry* solution;
+
+ if (part->type == PED_PARTITION_EXTENDED) {
+ solution = _try_constraint (part, constraint,
+ _no_geom_extended_constraint (part));
+ } else {
+ solution = _try_constraint (part, constraint,
+ _no_geom_constraint (disk, 1,
+ disk->dev->length - 1));
+ }
+
+ if (solution) {
+ ped_geometry_set (&part->geom, solution->start,
+ solution->length);
+ ped_geometry_destroy (solution);
+ return 1;
+ }
+ return 0;
+}
+
+static int
+_align_logical_no_geom (PedPartition* part, const PedConstraint* constraint)
+{
+ PedGeometry* solution;
+
+ solution = _try_constraint (part, constraint,
+ _log_meta_overlap_constraint (part, &part->geom));
+
+ if (solution) {
+ ped_geometry_set (&part->geom, solution->start,
+ solution->length);
+ ped_geometry_destroy (solution);
+ return 1;
+ }
+ return 0;
+}
+
+static int
+_align_no_geom (PedPartition* part, const PedConstraint* constraint)
+{
+ if (part->type == PED_PARTITION_LOGICAL)
+ return _align_logical_no_geom (part, constraint);
+ else
+ return _align_primary_no_geom (part, constraint);
+}
+
+static int
+msdos_partition_align (PedPartition* part, const PedConstraint* constraint)
+{
+ PedCHSGeometry bios_geom;
+ DosPartitionData* dos_data;
+
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->disk_specific != NULL, return 0);
+
+ dos_data = part->disk_specific;
+ if (dos_data->system == PARTITION_LDM && dos_data->orig) {
+ PedGeometry *orig_geom = &dos_data->orig->geom;
+
+ if (ped_geometry_test_equal (&part->geom, orig_geom)
+ && ped_constraint_is_solution (constraint, &part->geom))
+ return 1;
+
+ ped_geometry_set (&part->geom, orig_geom->start,
+ orig_geom->length);
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Parted can't resize partitions managed by "
+ "Windows Dynamic Disk."));
+ return 0;
+ }
+
+ partition_probe_bios_geometry (part, &bios_geom);
+
+ if (_align (part, &bios_geom, constraint))
+ return 1;
+ if (_align_no_geom (part, constraint))
+ return 1;
+
+#ifndef DISCOVER_ONLY
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Unable to satisfy all constraints on the partition."));
+#endif
+ return 0;
+}
+
+static int
+add_metadata_part (PedDisk* disk, PedPartitionType type, PedSector start,
+ PedSector end)
+{
+ PedPartition* new_part;
+
+ PED_ASSERT (disk != NULL, return 0);
+
+ new_part = ped_partition_new (disk, type | PED_PARTITION_METADATA, NULL,
+ start, end);
+ if (!new_part)
+ goto error;
+ if (!ped_disk_add_partition (disk, new_part, NULL))
+ goto error_destroy_new_part;
+
+ return 1;
+
+error_destroy_new_part:
+ ped_partition_destroy (new_part);
+error:
+ return 0;
+}
+
+/* There are a few objectives here:
+ * - avoid having lots of "free space" partitions lying around, to confuse
+ * the front end.
+ * - ensure that there's enough room to put in the extended partition
+ * tables, etc.
+ */
+static int
+add_logical_part_metadata (PedDisk* disk, PedPartition* log_part)
+{
+ PedPartition* ext_part = ped_disk_extended_partition (disk);
+ PedPartition* prev = log_part->prev;
+ PedDevice* dev = disk->dev;
+ PedCHSGeometry bios_geom;
+ PedSector cyl_size;
+ PedSector metadata_start;
+ PedSector metadata_end;
+ PedSector metadata_length;
+
+ partition_probe_bios_geometry (ext_part, &bios_geom);
+ cyl_size = bios_geom.sectors * bios_geom.heads;
+
+ /* if there's metadata shortly before the partition (on the same
+ * cylinder), then make this new metadata partition touch the end of
+ * the other. No point having 63 bytes (or whatever) of free space
+ * partition - just confuses front-ends, etc.
+ * Otherwise, start the metadata at the start of the cylinder
+ */
+
+ metadata_end = log_part->geom.start - 1;
+ metadata_start = ped_round_down_to (metadata_end, cyl_size);
+ if (prev)
+ metadata_start = PED_MAX (metadata_start, prev->geom.end + 1);
+ else
+ metadata_start = PED_MAX (metadata_start,
+ ext_part->geom.start + 1);
+ metadata_length = metadata_end - metadata_start + 1;
+
+ /* partition 5 doesn't need to have any metadata */
+ if (log_part->num == 5 && metadata_length < bios_geom.sectors)
+ return 1;
+
+ PED_ASSERT (metadata_length > 0, return 0);
+
+ return add_metadata_part (disk, PED_PARTITION_LOGICAL,
+ metadata_start, metadata_end);
+}
+
+static PedPartition*
+get_last_part (PedDisk* disk)
+{
+ PedPartition* first_part = disk->part_list;
+ PedPartition* walk;
+
+ if (!first_part)
+ return NULL;
+ for (walk = first_part; walk->next; walk = walk->next);
+ return walk;
+}
+
+/* Adds metadata placeholder partitions to cover the partition table (and
+ * "free" space after it that often has bootloader stuff), and the last
+ * incomplete cylinder at the end of the disk.
+ * Parted has to be mindful of the uncertainty of dev->bios_geom.
+ * It therefore makes sure this metadata doesn't overlap with partitions.
+ */
+static int
+add_startend_metadata (PedDisk* disk)
+{
+ PedDevice* dev = disk->dev;
+ PedSector cyl_size = dev->bios_geom.sectors * dev->bios_geom.heads;
+ PedPartition* first_part = disk->part_list;
+ PedPartition* last_part = get_last_part (disk);
+ PedSector start, end;
+
+ if (!first_part)
+ return 1;
+
+ start = 0;
+ end = PED_MIN (dev->bios_geom.sectors - 1, first_part->geom.start - 1);
+ if (!add_metadata_part (disk, PED_PARTITION_NORMAL, start, end))
+ return 0;
+
+ start = PED_MAX (last_part->geom.end + 1,
+ ped_round_down_to (dev->length, cyl_size));
+ end = dev->length - 1;
+ if (start < end) {
+ if (!add_metadata_part (disk, PED_PARTITION_NORMAL, start, end))
+ return 0;
+ }
+
+ return 1;
+}
+
+static int
+msdos_alloc_metadata (PedDisk* disk)
+{
+ PedPartition* ext_part;
+
+ PED_ASSERT (disk != NULL, return 0);
+ PED_ASSERT (disk->dev != NULL, return 0);
+
+ if (!add_startend_metadata (disk))
+ return 0;
+
+ ext_part = ped_disk_extended_partition (disk);
+ if (ext_part) {
+ int i;
+ PedSector start, end;
+ PedCHSGeometry bios_geom;
+
+ for (i=5; 1; i++) {
+ PedPartition* log_part;
+ log_part = ped_disk_get_partition (disk, i);
+ if (!log_part)
+ break;
+ if (!add_logical_part_metadata (disk, log_part))
+ return 0;
+ }
+
+ partition_probe_bios_geometry (ext_part, &bios_geom);
+ start = ext_part->geom.start;
+ end = start + bios_geom.sectors - 1;
+ if (ext_part->part_list)
+ end = PED_MIN (end,
+ ext_part->part_list->geom.start - 1);
+ if (!add_metadata_part (disk, PED_PARTITION_LOGICAL,
+ start, end))
+ return 0;
+ }
+
+ return 1;
+}
+
+static int
+next_primary (PedDisk* disk)
+{
+ int i;
+ for (i=1; i<=4; i++) {
+ if (!ped_disk_get_partition (disk, i))
+ return i;
+ }
+ return 0;
+}
+
+static int
+next_logical (PedDisk* disk)
+{
+ int i;
+ for (i=5; 1; i++) {
+ if (!ped_disk_get_partition (disk, i))
+ return i;
+ }
+}
+
+static int
+msdos_partition_enumerate (PedPartition* part)
+{
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->disk != NULL, return 0);
+
+ /* don't re-number a primary partition */
+ if (part->num != -1 && part->num <= 4)
+ return 1;
+
+ part->num = -1;
+
+ if (part->type & PED_PARTITION_LOGICAL)
+ part->num = next_logical (part->disk);
+ else
+ part->num = next_primary (part->disk);
+
+ return 1;
+}
+
+static int
+msdos_get_max_primary_partition_count (const PedDisk* disk)
+{
+ return 4;
+}
+
+static PedDiskOps msdos_disk_ops = {
+ probe: msdos_probe,
+#ifndef DISCOVER_ONLY
+ clobber: msdos_clobber,
+#else
+ clobber: NULL,
+#endif
+ alloc: msdos_alloc,
+ duplicate: msdos_duplicate,
+ free: msdos_free,
+ read: msdos_read,
+#ifndef DISCOVER_ONLY
+ write: msdos_write,
+#else
+ write: NULL,
+#endif
+
+ partition_new: msdos_partition_new,
+ partition_duplicate: msdos_partition_duplicate,
+ partition_destroy: msdos_partition_destroy,
+ partition_set_system: msdos_partition_set_system,
+ partition_set_flag: msdos_partition_set_flag,
+ partition_get_flag: msdos_partition_get_flag,
+ partition_is_flag_available: msdos_partition_is_flag_available,
+ partition_set_name: NULL,
+ partition_get_name: NULL,
+ partition_align: msdos_partition_align,
+ partition_enumerate: msdos_partition_enumerate,
+
+ alloc_metadata: msdos_alloc_metadata,
+ get_max_primary_partition_count:
+ msdos_get_max_primary_partition_count
+};
+
+static PedDiskType msdos_disk_type = {
+ next: NULL,
+ name: "msdos",
+ ops: &msdos_disk_ops,
+ features: PED_DISK_TYPE_EXTENDED
+};
+
+void
+ped_disk_msdos_init ()
+{
+ PED_ASSERT (sizeof (DosRawPartition) == 16, return);
+ PED_ASSERT (sizeof (DosRawTable) == 512, return);
+
+ ped_register_disk_type (&msdos_disk_type);
+}
+
+void
+ped_disk_msdos_done ()
+{
+ ped_unregister_disk_type (&msdos_disk_type);
+}
+
diff --git a/libparted/labels/dvh.c b/libparted/labels/dvh.c
new file mode 100644
index 0000000..12eece1
--- /dev/null
+++ b/libparted/labels/dvh.c
@@ -0,0 +1,916 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#include <string.h>
+
+#include <parted/parted.h>
+#include <parted/debug.h>
+#include <parted/endian.h>
+
+#include "dvh.h"
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+/* Default size for volhdr part, same val as IRIX's fx uses */
+#define PTYPE_VOLHDR_DFLTSZ 4096
+
+/* Partition numbers that seem to be strongly held convention */
+#define PNUM_VOLHDR 8
+#define PNUM_VOLUME 10
+
+/* Other notes of interest:
+ * PED_PARTITION_EXTENDED is used for volume headers
+ * PED_PARTITION_LOGICAL is used for bootfiles
+ * PED_PARTITION_NORMAL is used for all else
+ */
+
+typedef struct _DVHDiskData {
+ struct device_parameters dev_params;
+ int swap; /* part num of swap, 0=none */
+ int root; /* part num of root, 0=none */
+ int boot; /* part num of boot, 0=none */
+} DVHDiskData;
+
+typedef struct _DVHPartData {
+ int type;
+ char name[VDNAMESIZE + 1]; /* boot volumes only */
+ int real_file_size; /* boot volumes only */
+} DVHPartData;
+
+static PedDiskType dvh_disk_type;
+
+static int
+dvh_probe (const PedDevice *dev)
+{
+ struct volume_header vh;
+
+ if (dev->sector_size != 512)
+ return 0;
+
+ if (!ped_device_read (dev, &vh, 0, 1))
+ return 0;
+
+ return PED_BE32_TO_CPU (vh.vh_magic) == VHMAGIC;
+}
+
+#ifndef DISCOVER_ONLY
+static int
+dvh_clobber (PedDevice* dev)
+{
+ char zeros[512];
+
+ memset (zeros, 0, 512);
+ return ped_device_write (dev, zeros, 0, 1);
+}
+#endif /* !DISCOVER_ONLY */
+
+static PedDisk*
+dvh_alloc (const PedDevice* dev)
+{
+ PedDisk* disk;
+ DVHDiskData* dvh_disk_data;
+ PedPartition* volume_part;
+ PedConstraint* constraint_any;
+
+ disk = _ped_disk_alloc (dev, &dvh_disk_type);
+ if (!disk)
+ goto error;
+
+ disk->disk_specific = dvh_disk_data
+ = ped_malloc (sizeof (DVHDiskData));
+ if (!dvh_disk_data)
+ goto error_free_disk;
+
+ memset (&dvh_disk_data->dev_params, 0,
+ sizeof (struct device_parameters));
+ dvh_disk_data->swap = 0;
+ dvh_disk_data->root = 0;
+ dvh_disk_data->boot = 0;
+
+ volume_part = ped_partition_new (disk, PED_PARTITION_EXTENDED, NULL,
+ 0, PTYPE_VOLHDR_DFLTSZ - 1);
+ if (!volume_part)
+ goto error_free_disk_specific;
+ volume_part->num = PNUM_VOLHDR + 1;
+ constraint_any = ped_constraint_any (dev);
+ if (!ped_disk_add_partition (disk, volume_part, constraint_any))
+ goto error_destroy_constraint_any;
+ ped_constraint_destroy (constraint_any);
+ return disk;
+
+error_destroy_constraint_any:
+ ped_constraint_destroy (constraint_any);
+error_destroy_volume_part:
+ ped_partition_destroy (volume_part);
+error_free_disk_specific:
+ ped_free (disk->disk_specific);
+error_free_disk:
+ ped_free (disk);
+error:
+ return NULL;
+}
+
+static PedDisk*
+dvh_duplicate (const PedDisk* disk)
+{
+ PedDisk* new_disk;
+ DVHDiskData* new_dvh_disk_data;
+ DVHDiskData* old_dvh_disk_data = disk->disk_specific;
+
+ PED_ASSERT (old_dvh_disk_data != NULL, goto error);
+
+ new_disk = _ped_disk_alloc (disk->dev, &dvh_disk_type);
+ if (!new_disk)
+ goto error;
+
+ new_disk->disk_specific = new_dvh_disk_data
+ = ped_malloc (sizeof (DVHDiskData));
+ if (!new_dvh_disk_data)
+ goto error_free_new_disk;
+
+ new_dvh_disk_data->dev_params = old_dvh_disk_data->dev_params;
+ return new_disk;
+
+error_free_new_disk:
+ ped_free (new_disk);
+error:
+ return NULL;
+}
+
+static void
+dvh_free (PedDisk* disk)
+{
+ ped_free (disk->disk_specific);
+ _ped_disk_free (disk);
+}
+
+/* two's complement 32-bit checksum */
+static uint32_t
+_checksum (const uint32_t* base, size_t size)
+{
+ uint32_t sum = 0;
+ size_t i;
+
+ for (i = 0; i < size / sizeof (uint32_t); i++)
+ sum = sum - PED_BE32_TO_CPU (base[i]);
+
+ return sum;
+}
+
+/* try to make a reasonable volume header partition... */
+static PedExceptionOption
+_handle_no_volume_header (PedDisk* disk)
+{
+ PedExceptionOption ret;
+ PedPartition* part;
+ PedConstraint* constraint;
+
+ switch (ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_FIX + PED_EXCEPTION_CANCEL,
+ _("%s has no extended partition (volume header partition)."),
+ disk->dev->path)) {
+ case PED_EXCEPTION_UNHANDLED:
+ case PED_EXCEPTION_FIX:
+ default:
+ part = ped_partition_new (
+ disk, PED_PARTITION_EXTENDED, NULL,
+ 0, PTYPE_VOLHDR_DFLTSZ - 1);
+ if (!part)
+ goto error;
+ part->num = PNUM_VOLHDR + 1;
+ constraint = ped_constraint_any (part->disk->dev);
+ if (!constraint)
+ goto error_destroy_part;
+ if (!ped_disk_add_partition (disk, part, constraint))
+ goto error_destroy_constraint;
+ ped_constraint_destroy (constraint);
+ ret = PED_EXCEPTION_FIX;
+ break;
+
+ case PED_EXCEPTION_CANCEL:
+ goto error;
+ }
+ return ret;
+
+error_destroy_constraint:
+ ped_constraint_destroy (constraint);
+error_destroy_part:
+ ped_partition_destroy (part);
+error:
+ return PED_EXCEPTION_CANCEL;
+}
+
+static PedPartition*
+_parse_partition (PedDisk* disk, struct partition_table* pt)
+{
+ PedPartition* part;
+ DVHPartData* dvh_part_data;
+ PedSector start = PED_BE32_TO_CPU (pt->pt_firstlbn);
+ PedSector length = PED_BE32_TO_CPU (pt->pt_nblks);
+
+ part = ped_partition_new (disk,
+ pt->pt_type ? 0 : PED_PARTITION_EXTENDED,
+ NULL,
+ start, start + length - 1);
+ if (!part)
+ return NULL;
+
+ dvh_part_data = part->disk_specific;
+ dvh_part_data->type = PED_BE32_TO_CPU (pt->pt_type);
+ strcpy (dvh_part_data->name, "");
+
+ return part;
+}
+
+static PedPartition*
+_parse_boot_file (PedDisk* disk, struct volume_directory* vd)
+{
+ PedPartition* part;
+ DVHPartData* dvh_part_data;
+ PedSector start = PED_BE32_TO_CPU (vd->vd_lbn);
+ int length = PED_BE32_TO_CPU (vd->vd_nbytes);
+
+ part = ped_partition_new (disk, PED_PARTITION_LOGICAL, NULL,
+ start, start + length/512 - 1);
+ if (!part)
+ return NULL;
+
+ dvh_part_data = part->disk_specific;
+ dvh_part_data->real_file_size = length;
+
+ strncpy (dvh_part_data->name, vd->vd_name, VDNAMESIZE);
+ dvh_part_data->name[VDNAMESIZE] = 0;
+ return part;
+}
+
+static int dvh_write (PedDisk* disk);
+
+/* YUCK
+ *
+ * If you remove a boot/root/swap partition, the disk->disk_specific
+ * thing isn't updated. (Probably reflects a design bug somewhere...)
+ * Anyway, the workaround is: flush stale flags whenever we allocate
+ * new partition numbers, and before we write to disk.
+ */
+static void
+_flush_stale_flags (PedDisk* disk)
+{
+ DVHDiskData* dvh_disk_data = disk->disk_specific;
+
+ if (dvh_disk_data->root
+ && !ped_disk_get_partition (disk, dvh_disk_data->root))
+ dvh_disk_data->root = 0;
+ if (dvh_disk_data->swap
+ && !ped_disk_get_partition (disk, dvh_disk_data->swap))
+ dvh_disk_data->swap = 0;
+ if (dvh_disk_data->boot
+ && !ped_disk_get_partition (disk, dvh_disk_data->boot))
+ dvh_disk_data->boot = 0;
+}
+
+static int
+dvh_read (PedDisk* disk)
+{
+ DVHDiskData* dvh_disk_data = disk->disk_specific;
+ int i;
+ struct volume_header vh;
+ char boot_name [BFNAMESIZE + 1];
+#ifndef DISCOVER_ONLY
+ int write_back = 0;
+#endif
+
+ PED_ASSERT (dvh_disk_data != NULL, return 0);
+
+ ped_disk_delete_all (disk);
+
+ if (!ped_device_read (disk->dev, &vh, 0, 1))
+ return 0;
+
+ if (_checksum ((uint32_t*) &vh, sizeof (struct volume_header))) {
+ if (ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("Checksum is wrong, indicating the partition "
+ "table is corrupt."))
+ == PED_EXCEPTION_CANCEL)
+ return 0;
+ }
+
+ PED_ASSERT (PED_BE32_TO_CPU (vh.vh_magic) == VHMAGIC, return 0);
+
+ dvh_disk_data->dev_params = vh.vh_dp;
+ strncpy (boot_name, vh.vh_bootfile, BFNAMESIZE);
+ boot_name[BFNAMESIZE] = 0;
+
+ /* normal partitions */
+ for (i = 0; i < NPARTAB; i++) {
+ PedPartition* part;
+ PedConstraint* constraint_exact;
+
+ if (!vh.vh_pt[i].pt_nblks)
+ continue;
+ /* Skip the whole-disk partition, parted disklikes overlap */
+ if (PED_BE32_TO_CPU (vh.vh_pt[i].pt_type) == PTYPE_VOLUME)
+ continue;
+
+ part = _parse_partition (disk, &vh.vh_pt[i]);
+ if (!part)
+ goto error_delete_all;
+
+ part->fs_type = ped_file_system_probe (&part->geom);
+ part->num = i + 1;
+
+ if (PED_BE16_TO_CPU (vh.vh_rootpt) == i)
+ ped_partition_set_flag (part, PED_PARTITION_ROOT, 1);
+ if (PED_BE16_TO_CPU (vh.vh_swappt) == i)
+ ped_partition_set_flag (part, PED_PARTITION_SWAP, 1);
+
+ constraint_exact = ped_constraint_exact (&part->geom);
+ if (!ped_disk_add_partition(disk, part, constraint_exact)) {
+ ped_partition_destroy (part);
+ goto error_delete_all;
+ }
+ ped_constraint_destroy (constraint_exact);
+ }
+
+ if (!ped_disk_extended_partition (disk)) {
+#ifdef DISCOVER_ONLY
+ return 1;
+#else
+ switch (_handle_no_volume_header (disk)) {
+ case PED_EXCEPTION_CANCEL:
+ return 0;
+ case PED_EXCEPTION_IGNORE:
+ return 1;
+ case PED_EXCEPTION_FIX:
+ write_back = 1;
+ }
+#endif
+ }
+
+ /* boot partitions */
+ for (i = 0; i < NVDIR; i++) {
+ PedPartition* part;
+ PedConstraint* constraint_exact;
+
+ if (!vh.vh_vd[i].vd_nbytes)
+ continue;
+
+ part = _parse_boot_file (disk, &vh.vh_vd[i]);
+ if (!part)
+ goto error_delete_all;
+
+ part->fs_type = ped_file_system_probe (&part->geom);
+ part->num = NPARTAB + i + 1;
+
+ if (!strcmp (boot_name, ped_partition_get_name (part)))
+ ped_partition_set_flag (part, PED_PARTITION_BOOT, 1);
+
+ constraint_exact = ped_constraint_exact (&part->geom);
+ if (!ped_disk_add_partition(disk, part, constraint_exact)) {
+ ped_partition_destroy (part);
+ goto error_delete_all;
+ }
+ ped_constraint_destroy (constraint_exact);
+ }
+#ifndef DISCOVER_ONLY
+ if (write_back)
+ dvh_write (disk);
+#endif
+ return 1;
+
+error_delete_all:
+ ped_disk_delete_all (disk);
+error:
+ return 0;
+}
+
+#ifndef DISCOVER_ONLY
+static void
+_generate_partition (PedPartition* part, struct partition_table* pt)
+{
+ DVHPartData* dvh_part_data = part->disk_specific;
+
+ /* Assert not a bootfile */
+ PED_ASSERT ((part->type & PED_PARTITION_LOGICAL) == 0, return);
+
+ pt->pt_nblks = PED_CPU_TO_BE32 (part->geom.length);
+ pt->pt_firstlbn = PED_CPU_TO_BE32 (part->geom.start);
+ pt->pt_type = PED_CPU_TO_BE32 (dvh_part_data->type);
+}
+
+static void
+_generate_boot_file (PedPartition* part, struct volume_directory* vd)
+{
+ DVHPartData* dvh_part_data = part->disk_specific;
+
+ /* Assert it's a bootfile */
+ PED_ASSERT ((part->type & PED_PARTITION_LOGICAL) != 0, return);
+
+ vd->vd_nbytes = PED_CPU_TO_BE32 (dvh_part_data->real_file_size);
+ vd->vd_lbn = PED_CPU_TO_BE32 (part->geom.start);
+
+ memset (vd->vd_name, 0, VDNAMESIZE);
+ strncpy (vd->vd_name, dvh_part_data->name, VDNAMESIZE);
+}
+
+static int
+dvh_write (PedDisk* disk)
+{
+ DVHDiskData* dvh_disk_data = disk->disk_specific;
+ struct volume_header vh;
+ int i;
+
+ PED_ASSERT (dvh_disk_data != NULL, return 0);
+
+ _flush_stale_flags (disk);
+
+ memset (&vh, 0, sizeof (struct volume_header));
+
+ vh.vh_magic = PED_CPU_TO_BE32 (VHMAGIC);
+ vh.vh_rootpt = PED_CPU_TO_BE16 (dvh_disk_data->root - 1);
+ vh.vh_swappt = PED_CPU_TO_BE16 (dvh_disk_data->swap - 1);
+
+ if (dvh_disk_data->boot) {
+ PedPartition* boot_part;
+ boot_part = ped_disk_get_partition (disk, dvh_disk_data->boot);
+ strcpy (vh.vh_bootfile, ped_partition_get_name (boot_part));
+ }
+
+ vh.vh_dp = dvh_disk_data->dev_params;
+ /* Set up rudimentary device geometry */
+ vh.vh_dp.dp_cyls
+ = PED_CPU_TO_BE16 ((short)disk->dev->bios_geom.cylinders);
+ vh.vh_dp.dp_trks0 = PED_CPU_TO_BE16 ((short)disk->dev->bios_geom.heads);
+ vh.vh_dp.dp_secs
+ = PED_CPU_TO_BE16 ((short)disk->dev->bios_geom.sectors);
+ vh.vh_dp.dp_secbytes = PED_CPU_TO_BE16 ((short)disk->dev->sector_size);
+
+ for (i = 0; i < NPARTAB; i++) {
+ PedPartition* part = ped_disk_get_partition (disk, i + 1);
+ if (part)
+ _generate_partition (part, &vh.vh_pt[i]);
+ }
+
+ /* whole disk partition
+ * This is only ever written here, and never modified
+ * (or even shown) as it must contain the entire disk,
+ * and parted does not like overlapping partitions
+ */
+ vh.vh_pt[PNUM_VOLUME].pt_nblks = PED_CPU_TO_BE32 (disk->dev->length);
+ vh.vh_pt[PNUM_VOLUME].pt_firstlbn = PED_CPU_TO_BE32 (0);
+ vh.vh_pt[PNUM_VOLUME].pt_type = PED_CPU_TO_BE32 (PTYPE_VOLUME);
+
+ for (i = 0; i < NVDIR; i++) {
+ PedPartition* part = ped_disk_get_partition (disk,
+ i + 1 + NPARTAB);
+ if (part)
+ _generate_boot_file (part, &vh.vh_vd[i]);
+ }
+
+ vh.vh_csum = 0;
+ vh.vh_csum = PED_CPU_TO_BE32 (_checksum ((uint32_t*) &vh,
+ sizeof (struct volume_header)));
+
+ return ped_device_write (disk->dev, &vh, 0, 1)
+ && ped_device_sync (disk->dev);
+}
+#endif /* !DISCOVER_ONLY */
+
+static PedPartition*
+dvh_partition_new (const PedDisk* disk, PedPartitionType part_type,
+ const PedFileSystemType* fs_type,
+ PedSector start, PedSector end)
+{
+ PedPartition* part;
+ DVHPartData* dvh_part_data;
+
+ part = _ped_partition_alloc (disk, part_type, fs_type, start, end);
+ if (!part)
+ goto error;
+
+ if (!ped_partition_is_active (part)) {
+ part->disk_specific = NULL;
+ return part;
+ }
+
+ dvh_part_data = part->disk_specific =
+ ped_malloc (sizeof (DVHPartData));
+ if (!dvh_part_data)
+ goto error_free_part;
+
+ dvh_part_data->type = (part_type == PED_PARTITION_EXTENDED)
+ ? PTYPE_VOLHDR
+ : PTYPE_RAW;
+ strcpy (dvh_part_data->name, "");
+ dvh_part_data->real_file_size = part->geom.length * 512;
+ return part;
+
+error_free_part:
+ _ped_partition_free (part);
+error:
+ return NULL;
+}
+
+static PedPartition*
+dvh_partition_duplicate (const PedPartition* part)
+{
+ PedPartition* result;
+ DVHPartData* part_data = part->disk_specific;
+ DVHPartData* result_data;
+
+ result = _ped_partition_alloc (part->disk, part->type, part->fs_type,
+ part->geom.start, part->geom.end);
+ if (!result)
+ goto error;
+ result->num = part->num;
+
+ if (!ped_partition_is_active (part)) {
+ result->disk_specific = NULL;
+ return result;
+ }
+
+ result_data = result->disk_specific =
+ ped_malloc (sizeof (DVHPartData));
+ if (!result_data)
+ goto error_free_part;
+
+ result_data->type = part_data->type;
+ strcpy (result_data->name, part_data->name);
+ result_data->real_file_size = part_data->real_file_size;
+ return result;
+
+error_free_part:
+ _ped_partition_free (result);
+error:
+ return NULL;
+}
+
+static void
+dvh_partition_destroy (PedPartition* part)
+{
+ if (ped_partition_is_active (part)) {
+ PED_ASSERT (part->disk_specific != NULL, return);
+ ped_free (part->disk_specific);
+ }
+ _ped_partition_free (part);
+}
+
+static int
+dvh_partition_set_system (PedPartition* part, const PedFileSystemType* fs_type)
+{
+ DVHPartData* dvh_part_data = part->disk_specific;
+
+ part->fs_type = fs_type;
+
+ if (part->type == PED_PARTITION_EXTENDED) {
+ dvh_part_data->type = PTYPE_VOLHDR;
+ return 1;
+ }
+
+ /* Is this a bootfile? */
+ if (part->type == PED_PARTITION_LOGICAL)
+ return 1;
+
+ if (fs_type && !strcmp (fs_type->name, "xfs"))
+ dvh_part_data->type = PTYPE_XFS;
+ else
+ dvh_part_data->type = PTYPE_RAW;
+ return 1;
+}
+
+static int
+dvh_partition_set_flag (PedPartition* part, PedPartitionFlag flag, int state)
+{
+ DVHDiskData* dvh_disk_data = part->disk->disk_specific;
+
+ switch (flag) {
+ case PED_PARTITION_ROOT:
+ if (part->type != 0 && state) {
+#ifndef DISCOVER_ONLY
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Only primary partitions can be root "
+ "partitions."));
+#endif
+ return 0;
+ }
+ dvh_disk_data->root = state ? part->num : 0;
+ break;
+
+ case PED_PARTITION_SWAP:
+ if (part->type != 0 && state) {
+#ifndef DISCOVER_ONLY
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Only primary partitions can be swap "
+ "partitions."));
+ return 0;
+#endif
+ }
+ dvh_disk_data->swap = state ? part->num : 0;
+ break;
+
+ case PED_PARTITION_BOOT:
+ if (part->type != PED_PARTITION_LOGICAL && state) {
+#ifndef DISCOVER_ONLY
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Only logical partitions can be a boot "
+ "file."));
+#endif
+ return 0;
+ }
+ dvh_disk_data->boot = state ? part->num : 0;
+ break;
+
+ case PED_PARTITION_LVM:
+ case PED_PARTITION_LBA:
+ case PED_PARTITION_HIDDEN:
+ case PED_PARTITION_RAID:
+ default:
+ return 0;
+ }
+ return 1;
+}
+
+static int
+dvh_partition_get_flag (const PedPartition* part, PedPartitionFlag flag)
+{
+ DVHDiskData* dvh_disk_data = part->disk->disk_specific;
+
+ switch (flag) {
+ case PED_PARTITION_ROOT:
+ return dvh_disk_data->root == part->num;
+
+ case PED_PARTITION_SWAP:
+ return dvh_disk_data->swap == part->num;
+
+ case PED_PARTITION_BOOT:
+ return dvh_disk_data->boot == part->num;
+
+ case PED_PARTITION_LVM:
+ case PED_PARTITION_LBA:
+ case PED_PARTITION_HIDDEN:
+ case PED_PARTITION_RAID:
+ default:
+ return 0;
+ }
+ return 1;
+}
+
+static int
+dvh_partition_is_flag_available (const PedPartition* part,
+ PedPartitionFlag flag)
+{
+ DVHDiskData* dvh_disk_data = part->disk->disk_specific;
+
+ switch (flag) {
+ case PED_PARTITION_ROOT:
+ case PED_PARTITION_SWAP:
+ case PED_PARTITION_BOOT:
+ return 1;
+
+ case PED_PARTITION_LVM:
+ case PED_PARTITION_LBA:
+ case PED_PARTITION_HIDDEN:
+ case PED_PARTITION_RAID:
+ default:
+ return 0;
+ }
+ return 1;
+}
+
+static void
+dvh_partition_set_name (PedPartition* part, const char* name)
+{
+ DVHPartData* dvh_part_data = part->disk_specific;
+
+ if (part->type == PED_PARTITION_LOGICAL) {
+ /* Bootfile */
+ strncpy (dvh_part_data->name, name, VDNAMESIZE);
+ dvh_part_data->name[VDNAMESIZE] = 0;
+ } else {
+#ifndef DISCOVER_ONLY
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Only logical partitions (boot files) have a name."));
+#endif
+ }
+}
+
+static const char*
+dvh_partition_get_name (const PedPartition* part)
+{
+ DVHPartData* dvh_part_data = part->disk_specific;
+ return dvh_part_data->name;
+}
+
+/* The constraint for the volume header partition is different, because it must
+ * contain the first sector of the disk.
+ */
+static PedConstraint*
+_get_extended_constraint (PedDisk* disk)
+{
+ PedGeometry min_geom;
+ if (!ped_geometry_init (&min_geom, disk->dev, 0, 1))
+ return NULL;
+ return ped_constraint_new_from_min (&min_geom);
+}
+
+static PedConstraint*
+_get_primary_constraint (PedDisk* disk)
+{
+ PedGeometry max_geom;
+ if (!ped_geometry_init (&max_geom, disk->dev, 1, disk->dev->length - 1))
+ return NULL;
+ return ped_constraint_new_from_max (&max_geom);
+}
+
+static int
+dvh_partition_align (PedPartition* part, const PedConstraint* constraint)
+{
+ PED_ASSERT (part != NULL, return 0);
+
+ if (_ped_partition_attempt_align (
+ part, constraint,
+ (part->type == PED_PARTITION_EXTENDED)
+ ? _get_extended_constraint (part->disk)
+ : _get_primary_constraint (part->disk)))
+ return 1;
+
+#ifndef DISCOVER_ONLY
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Unable to satisfy all constraints on the partition."));
+#endif
+ return 0;
+}
+
+static int
+dvh_partition_enumerate (PedPartition* part)
+{
+ int i;
+
+ /* never change the partition numbers */
+ if (part->num != -1)
+ return 1;
+
+ _flush_stale_flags (part->disk);
+
+ if (part->type & PED_PARTITION_LOGICAL) {
+ /* Bootfile */
+ for (i = 1 + NPARTAB; i <= NPARTAB + NVDIR; i++) {
+ if (!ped_disk_get_partition (part->disk, i)) {
+ part->num = i;
+ return 1;
+ }
+ }
+ PED_ASSERT (0, return 0);
+ } else if (part->type & PED_PARTITION_EXTENDED) {
+ /* Volheader */
+ part->num = PNUM_VOLHDR + 1;
+ } else {
+ for (i = 1; i <= NPARTAB; i++) {
+ /* reserved for full volume partition */
+ if (i == PNUM_VOLUME + 1)
+ continue;
+
+ if (!ped_disk_get_partition (part->disk, i)) {
+ part->num = i;
+ return 1;
+ }
+ }
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Too many primary partitions"));
+ }
+
+ return 0;
+}
+
+static int
+dvh_get_max_primary_partition_count (const PedDisk* disk)
+{
+ return NPARTAB;
+}
+
+static int
+dvh_alloc_metadata (PedDisk* disk)
+{
+ PedPartition* part;
+ PedPartition* extended_part;
+ PedConstraint* constraint_exact;
+ PedPartitionType metadata_type;
+ PED_ASSERT(disk != NULL, return 0);
+
+ /* We don't need to "protect" the start of the disk from the volume
+ * header.
+ */
+ extended_part = ped_disk_extended_partition (disk);
+ if (extended_part && extended_part->geom.start == 0)
+ metadata_type = PED_PARTITION_METADATA | PED_PARTITION_LOGICAL;
+ else
+ metadata_type = PED_PARTITION_METADATA;
+
+ part = ped_partition_new (disk, metadata_type, NULL, 0, 0);
+ if (!part)
+ goto error;
+
+ constraint_exact = ped_constraint_exact (&part->geom);
+ if (!ped_disk_add_partition (disk, part, constraint_exact))
+ goto error_destroy_part;
+ ped_constraint_destroy (constraint_exact);
+ return 1;
+
+error_destroy_constraint:
+ ped_constraint_destroy (constraint_exact);
+error_destroy_part:
+ ped_partition_destroy (part);
+error:
+ return 0;
+}
+
+static PedDiskOps dvh_disk_ops = {
+ probe: dvh_probe,
+#ifndef DISCOVER_ONLY
+ clobber: dvh_clobber,
+#else
+ clobber: NULL,
+#endif
+ alloc: dvh_alloc,
+ duplicate: dvh_duplicate,
+ free: dvh_free,
+ read: dvh_read,
+#ifndef DISCOVER_ONLY
+ write: dvh_write,
+#else
+ write: NULL,
+#endif
+
+ partition_new: dvh_partition_new,
+ partition_duplicate: dvh_partition_duplicate,
+ partition_destroy: dvh_partition_destroy,
+ partition_set_system: dvh_partition_set_system,
+ partition_set_flag: dvh_partition_set_flag,
+ partition_get_flag: dvh_partition_get_flag,
+ partition_is_flag_available: dvh_partition_is_flag_available,
+ partition_set_name: dvh_partition_set_name,
+ partition_get_name: dvh_partition_get_name,
+ partition_align: dvh_partition_align,
+ partition_enumerate: dvh_partition_enumerate,
+
+ alloc_metadata: dvh_alloc_metadata,
+ get_max_primary_partition_count:
+ dvh_get_max_primary_partition_count
+};
+
+static PedDiskType dvh_disk_type = {
+ next: NULL,
+ name: "dvh",
+ ops: &dvh_disk_ops,
+ features: PED_DISK_TYPE_PARTITION_NAME | PED_DISK_TYPE_EXTENDED
+};
+
+void
+ped_disk_dvh_init ()
+{
+ PED_ASSERT (sizeof (struct volume_header) == 512, return);
+
+ ped_register_disk_type (&dvh_disk_type);
+}
+
+void
+ped_disk_dvh_done ()
+{
+ ped_unregister_disk_type (&dvh_disk_type);
+}
+
diff --git a/libparted/labels/dvh.h b/libparted/labels/dvh.h
new file mode 100644
index 0000000..a075da8
--- /dev/null
+++ b/libparted/labels/dvh.h
@@ -0,0 +1,179 @@
+/*
+ Copyright (C) 1985 MIPS Computer Systems, Inc.
+ Copyright (C) 2000 Silicon Graphics Computer Systems, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef _SYS_DVH_H
+#define _SYS_DVH_H
+
+/*
+ * Format for volume header information
+ *
+ * The volume header is a block located at the beginning of all disk
+ * media (sector 0). It contains information pertaining to physical
+ * device parameters and logical partition information.
+ *
+ * The volume header is manipulated by disk formatters/verifiers,
+ * partition builders (e.g. fx, dvhtool, and mkfs), and disk drivers.
+ *
+ * Previous versions of IRIX wrote a copy of the volume header is
+ * located at sector 0 of each track of cylinder 0. These copies were
+ * never used, and reduced the capacity of the volume header to hold large
+ * files, so this practice was discontinued.
+ * The volume header is constrained to be less than or equal to 512
+ * bytes long. A particular copy is assumed valid if no drive errors
+ * are detected, the magic number is correct, and the 32 bit 2's complement
+ * of the volume header is correct. The checksum is calculated by initially
+ * zeroing vh_csum, summing the entire structure and then storing the
+ * 2's complement of the sum. Thus a checksum to verify the volume header
+ * should be 0.
+ *
+ * The error summary table, bad sector replacement table, and boot blocks are
+ * located by searching the volume directory within the volume header.
+ *
+ * Tables are sized simply by the integral number of table records that
+ * will fit in the space indicated by the directory entry.
+ *
+ * The amount of space allocated to the volume header, replacement blocks,
+ * and other tables is user defined when the device is formatted.
+ */
+
+/*
+ * device parameters are in the volume header to determine mapping
+ * from logical block numbers to physical device addresses
+ *
+ * Linux doesn't care ...
+ */
+struct device_parameters {
+ unsigned char dp_skew; /* spiral addressing skew */
+ unsigned char dp_gap1; /* words of 0 before header */
+ unsigned char dp_gap2; /* words of 0 between hdr and data */
+ unsigned char dp_spares_cyl; /* This is for drives (such as SCSI
+ that support zone oriented sparing, where the zone is larger
+ than one track. It gets subracteded from the cylinder size
+ ( dp_trks0 * dp_sec) when doing partition size calculations */
+ unsigned short dp_cyls; /* number of usable cylinders (i.e.,
+ doesn't include cylinders reserved by the drive for badblocks,
+ etc.). For drives with variable geometry, this number may be
+ decreased so that:
+ dp_cyls * ((dp_heads * dp_trks0) - dp_spares_cyl) <= actualcapacity
+ This happens on SCSI drives such as the Wren IV and Toshiba 156
+ Also see dp_cylshi below */
+ unsigned short dp_shd0; /* starting head vol 0 */
+ unsigned short dp_trks0; /* number of tracks / cylinder vol 0*/
+ unsigned char dp_ctq_depth; /* Depth of CTQ queue */
+ unsigned char dp_cylshi; /* high byte of 24 bits of cylinder count */
+ unsigned short dp_unused; /* not used */
+ unsigned short dp_secs; /* number of sectors/track */
+ unsigned short dp_secbytes; /* length of sector in bytes */
+ unsigned short dp_interleave; /* sector interleave */
+ int dp_flags; /* controller characteristics */
+ int dp_datarate; /* bytes/sec for kernel stats */
+ int dp_nretries; /* max num retries on data error */
+ int dp_mspw; /* ms per word to xfer, for iostat */
+ unsigned short dp_xgap1; /* Gap 1 for xylogics controllers */
+ unsigned short dp_xsync; /* sync delay for xylogics controllers */
+ unsigned short dp_xrdly; /* read delay for xylogics controllers */
+ unsigned short dp_xgap2; /* gap 2 for xylogics controllers */
+ unsigned short dp_xrgate; /* read gate for xylogics controllers */
+ unsigned short dp_xwcont; /* write continuation for xylogics */
+};
+
+/*
+ * Device characterization flags
+ * (dp_flags)
+ */
+#define DP_SECTSLIP 0x00000001 /* sector slip to spare sector */
+#define DP_SECTFWD 0x00000002 /* forward to replacement sector */
+#define DP_TRKFWD 0x00000004 /* forward to replacement track */
+#define DP_MULTIVOL 0x00000008 /* multiple volumes per spindle */
+#define DP_IGNOREERRORS 0x00000010 /* transfer data regardless of errors */
+#define DP_RESEEK 0x00000020 /* recalibrate as last resort */
+#define DP_CTQ_EN 0x00000040 /* enable command tag queueing */
+
+/*
+ * Boot blocks, bad sector tables, and the error summary table, are located
+ * via the volume_directory.
+ */
+#define VDNAMESIZE 8
+
+struct volume_directory {
+ char vd_name[VDNAMESIZE]; /* name */
+ int vd_lbn; /* logical block number */
+ int vd_nbytes; /* file length in bytes */
+};
+
+/*
+ * partition table describes logical device partitions
+ * (device drivers examine this to determine mapping from logical units
+ * to cylinder groups, device formatters/verifiers examine this to determine
+ * location of replacement tracks/sectors, etc)
+ *
+ * NOTE: pt_firstlbn SHOULD BE CYLINDER ALIGNED
+ */
+struct partition_table { /* one per logical partition */
+ int pt_nblks; /* # of logical blks in partition */
+ int pt_firstlbn; /* first lbn of partition */
+ int pt_type; /* use of partition */
+};
+
+#define PTYPE_VOLHDR 0 /* partition is volume header */
+#define PTYPE_TRKREPL 1 /* partition is used for repl trks */
+#define PTYPE_SECREPL 2 /* partition is used for repl secs */
+#define PTYPE_RAW 3 /* partition is used for data */
+#define PTYPE_BSD42 4 /* partition is 4.2BSD file system */
+#define PTYPE_BSD 4 /* partition is 4.2BSD file system */
+#define PTYPE_SYSV 5 /* partition is SysV file system */
+#define PTYPE_VOLUME 6 /* partition is entire volume */
+#define PTYPE_EFS 7 /* partition is sgi EFS */
+#define PTYPE_LVOL 8 /* partition is part of a logical vol */
+#define PTYPE_RLVOL 9 /* part of a "raw" logical vol */
+#define PTYPE_XFS 10 /* partition is sgi XFS */
+#define PTYPE_XFSLOG 11 /* partition is sgi XFS log */
+#define PTYPE_XLV 12 /* partition is part of an XLV vol */
+#define PTYPE_XVM 13 /* partition is sgi XVM */
+#define NPTYPES 16
+
+#define VHMAGIC 0xbe5a941 /* randomly chosen value */
+#define NPARTAB 16 /* 16 unix partitions */
+#define NVDIR 15 /* max of 15 directory entries */
+#define BFNAMESIZE 16 /* max 16 chars in boot file name */
+
+/* Partition types for ARCS */
+#define NOT_USED 0 /* Not used */
+#define FAT_SHORT 1 /* FAT file system, 12-bit FAT entries */
+#define FAT_LONG 4 /* FAT file system, 16-bit FAT entries */
+#define EXTENDED 5 /* extended partition */
+#define HUGE 6 /* huge partition- MS/DOS 4.0 and later */
+
+/* Active flags for ARCS */
+#define BOOTABLE 0x00;
+#define NOT_BOOTABLE 0x80;
+
+struct volume_header {
+ int vh_magic; /* identifies volume header */
+ short vh_rootpt; /* root partition number */
+ short vh_swappt; /* swap partition number */
+ char vh_bootfile[BFNAMESIZE]; /* name of file to boot */
+ struct device_parameters vh_dp; /* device parameters */
+ struct volume_directory vh_vd[NVDIR]; /* other vol hdr contents */
+ struct partition_table vh_pt[NPARTAB]; /* device partition layout */
+ int vh_csum; /* volume header checksum */
+ int vh_fill; /* fill out to 512 bytes */
+};
+
+#endif /* _SYS_DVH_H */
diff --git a/libparted/labels/efi_crc32.c b/libparted/labels/efi_crc32.c
new file mode 100644
index 0000000..a44f262
--- /dev/null
+++ b/libparted/labels/efi_crc32.c
@@ -0,0 +1,125 @@
+/*
+ * Dec 5, 2000 Matt Domsch <Matt_Domsch@dell.com>
+ * - Copied crc32.c from the linux/drivers/net/cipe directory.
+ * - Now pass seed as an arg
+ * - changed unsigned long to uint32_t, added #include<stdint.h>
+ * - changed len to be an unsigned long
+ * - changed crc32val to be a register
+ * - License remains unchanged! It's still GPL-compatable!
+ */
+
+ /* ============================================================= */
+ /* COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or */
+ /* code or tables extracted from it, as desired without restriction. */
+ /* */
+ /* First, the polynomial itself and its table of feedback terms. The */
+ /* polynomial is */
+ /* X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0 */
+ /* */
+ /* Note that we take it "backwards" and put the highest-order term in */
+ /* the lowest-order bit. The X^32 term is "implied"; the LSB is the */
+ /* X^31 term, etc. The X^0 term (usually shown as "+1") results in */
+ /* the MSB being 1. */
+ /* */
+ /* Note that the usual hardware shift register implementation, which */
+ /* is what we're using (we're merely optimizing it by doing eight-bit */
+ /* chunks at a time) shifts bits into the lowest-order term. In our */
+ /* implementation, that means shifting towards the right. Why do we */
+ /* do it this way? Because the calculated CRC must be transmitted in */
+ /* order from highest-order term to lowest-order term. UARTs transmit */
+ /* characters in order from LSB to MSB. By storing the CRC this way, */
+ /* we hand it to the UART in the order low-byte to high-byte; the UART */
+ /* sends each low-bit to hight-bit; and the result is transmission bit */
+ /* by bit from highest- to lowest-order term without requiring any bit */
+ /* shuffling on our part. Reception works similarly. */
+ /* */
+ /* The feedback terms table consists of 256, 32-bit entries. Notes: */
+ /* */
+ /* The table can be generated at runtime if desired; code to do so */
+ /* is shown later. It might not be obvious, but the feedback */
+ /* terms simply represent the results of eight shift/xor opera- */
+ /* tions for all combinations of data and CRC register values. */
+ /* */
+ /* The values must be right-shifted by eight bits by the "updcrc" */
+ /* logic; the shift must be unsigned (bring in zeroes). On some */
+ /* hardware you could probably optimize the shift in assembler by */
+ /* using byte-swap instructions. */
+ /* polynomial $edb88320 */
+ /* */
+ /* -------------------------------------------------------------------- */
+
+#include <stdint.h>
+
+static uint32_t crc32_tab[] = {
+ 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
+ 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
+ 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,
+ 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL,
+ 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L,
+ 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L,
+ 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L,
+ 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL,
+ 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L,
+ 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL,
+ 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L,
+ 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L,
+ 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L,
+ 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL,
+ 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL,
+ 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L,
+ 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL,
+ 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L,
+ 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L,
+ 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L,
+ 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL,
+ 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L,
+ 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L,
+ 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL,
+ 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L,
+ 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L,
+ 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L,
+ 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L,
+ 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L,
+ 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL,
+ 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL,
+ 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L,
+ 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L,
+ 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL,
+ 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL,
+ 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L,
+ 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL,
+ 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L,
+ 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL,
+ 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L,
+ 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL,
+ 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L,
+ 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L,
+ 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL,
+ 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L,
+ 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L,
+ 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L,
+ 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L,
+ 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L,
+ 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L,
+ 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL,
+ 0x2d02ef8dL
+ };
+
+/* Return a 32-bit CRC of the contents of the buffer. */
+
+uint32_t
+__efi_crc32(const void *buf, unsigned long len, uint32_t seed)
+{
+ unsigned long i;
+ register uint32_t crc32val;
+ const unsigned char *s = buf;
+
+ crc32val = seed;
+ for (i = 0; i < len; i ++)
+ {
+ crc32val =
+ crc32_tab[(crc32val ^ s[i]) & 0xff] ^
+ (crc32val >> 8);
+ }
+ return crc32val;
+}
diff --git a/libparted/labels/fdasd.c b/libparted/labels/fdasd.c
new file mode 100644
index 0000000..df32205
--- /dev/null
+++ b/libparted/labels/fdasd.c
@@ -0,0 +1,1153 @@
+/*
+ * File...........: arch/s390/tools/fdasd.c
+ * Author(s)......: Volker Sameske <sameske@de.ibm.com>
+ * Bugreports.to..: <Linux390@de.ibm.com>
+ * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2001
+ *
+ * History of changes (starts March 2001)
+ * 2001-04-11 possibility to change volume serial added
+ * possibility to change partition type added
+ * some changes to DS4HPCHR and DS4DSREC
+ * 2001-05-03 check for invalid partition numbers added
+ * wrong free_space calculation bug fixed
+ * 2001-06-26 '-a' option added, it is now possible to add a single
+ * partition in non-interactive mode
+ * 2001-06-26 long parameter support added
+ *
+ */
+
+#include <parted/vtoc.h>
+#include <parted/fdasd.h>
+
+#include <parted/parted.h>
+
+#include <libintl.h>
+#if ENABLE_NLS
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+#define GETARG(x) {int k=strlen(optarg);x=malloc(k);strncpy(x,optarg,k);}
+
+static int
+getpos (fdasd_anchor_t *anc, int dsn)
+{
+ PDEBUG
+ return anc->partno[dsn];
+}
+
+static int
+getdsn (fdasd_anchor_t *anc, int pos)
+{
+ PDEBUG
+ int i;
+
+ for (i=0; i<USABLE_PARTITIONS; i++) {
+ if (anc->partno[i] == pos)
+ return i;
+ }
+
+ return -1;
+}
+
+static void
+setpos (fdasd_anchor_t *anc, int dsn, int pos)
+{
+ PDEBUG
+ anc->partno[dsn] = pos;
+}
+
+static void
+fdasd_check_volser (char *s, int devno)
+{
+ PDEBUG
+ int i, j;
+
+ for (i = 0; i < 6; i++) {
+ if ((s[i] < 0x20) || (s[i] > 0x7a)
+ || ((s[i] >= 0x21) && (s[i] <= 0x22))
+ || /* !" */ ((s[i] >= 0x26) && (s[i] <= 0x2f))
+ || /* &'()*+,-./ */ ((s[i] >= 0x3a) && (s[i] <= 0x3f))
+ || /* :;<=>? */ ((s[i] >= 0x5b) && (s[i] <= 0x60)))
+ /* \]^_´ */ s[i] = ' ';
+ s[i] = toupper (s[i]);
+ }
+
+ s[6] = 0x00;
+
+ for (i = 0; i < 6; i++) {
+ if (s[i] == ' ')
+ for (j = i; j < 6; j++)
+ if (s[j] != ' ') {
+ s[i] = s[j];
+ s[j] = ' ';
+ break;
+ }
+ }
+
+ if (s[0] == ' ') {
+ printf ("Usage error, switching to default.\n");
+ sprintf (s, "0X%04x", devno);
+ for (i = 0; i < 6; i++)
+ s[i] = toupper (s[i]);
+ }
+}
+
+void
+fdasd_cleanup (fdasd_anchor_t *anchor)
+{
+ PDEBUG
+ int i;
+ partition_info_t *p, *q;
+
+ if (anchor == NULL)
+ return;
+
+ if (anchor->f4 != NULL)
+ free(anchor->f4);
+
+ if (anchor->f5 != NULL)
+ free(anchor->f5);
+
+ if (anchor->f7 != NULL)
+ free(anchor->f7);
+
+ if (anchor->vlabel != NULL)
+ free(anchor->vlabel);
+
+ p = anchor->first;
+ if (p == NULL)
+ return;
+
+ for (i=1; i <= USABLE_PARTITIONS; i++) {
+ if (p == NULL)
+ return;
+ q = p->next;
+ free(p);
+ p = q;
+ }
+}
+
+static void
+fdasd_error (fdasd_anchor_t *anc, enum fdasd_failure why, char * str)
+{
+ PDEBUG
+ char error[2*LINE_LENGTH], *message = error;
+
+ switch (why) {
+ case unable_to_open_disk:
+ sprintf(error, _("%s open error\n%s\n"),
+ FDASD_ERROR, str);
+ break;
+ case unable_to_seek_disk:
+ sprintf(error, _("%s seek error\n%s\n"), FDASD_ERROR, str);
+ break;
+ case unable_to_read_disk:
+ sprintf(error, _("%s read error\n%s\n"), FDASD_ERROR, str);
+ break;
+ case read_only_disk:
+ sprintf(error, _("%s write error\n%s\n"), FDASD_ERROR, str);
+ break;
+ case unable_to_ioctl:
+ sprintf(error, _("%s IOCTL error\n%s\n"), FDASD_ERROR, str);
+ break;
+ case api_version_mismatch:
+ sprintf(error, _("%s API version mismatch\n%s\n"), FDASD_ERROR,str);
+ break;
+ case wrong_disk_type:
+ sprintf(error, _("%s Unsupported disk type\n%s\n"),
+ FDASD_ERROR, str);
+ break;
+ case wrong_disk_format:
+ sprintf(error, _("%s Unsupported disk format\n%s\n"),
+ FDASD_ERROR, str);
+ break;
+ case disk_in_use:
+ sprintf(error, _("%s Disk in use\n%s\n"), FDASD_ERROR, str);
+ break;
+ case config_syntax_error:
+ sprintf(error, _("%s Config file syntax error\n%s\n"),
+ FDASD_ERROR, str);
+ break;
+ case vlabel_corrupted:
+ sprintf(error, _("%s Volume label is corrupted.\n%s\n"),
+ FDASD_ERROR, str);
+ break;
+ case dsname_corrupted:
+ sprintf(error, _("%s a data set name is corrupted.\n%s\n"),
+ FDASD_ERROR, str);
+ break;
+ case malloc_failed:
+ sprintf(error, _("%s space allocation\n%s\n"),
+ FDASD_ERROR, str);
+ break;
+ case device_verification_failed:
+ sprintf(error, _("%s device verification failed\n" \
+ "The specified device is not a valid DASD device\n"),
+ FDASD_ERROR);
+ break;
+ default:
+ sprintf(error, _("%s Fatal error\n%s\n"), FDASD_ERROR, str);
+ }
+
+ ped_exception_throw(PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL, message);
+}
+
+/*
+ * converts cyl-cyl-head-head-blk to blk
+ */
+static unsigned long
+cchhb2blk (cchhb_t *p, struct fdasd_hd_geometry *geo)
+{
+ PDEBUG
+ return (unsigned long) (p->cc * geo->heads * geo->sectors
+ + p->hh * geo->sectors + p->b);
+}
+
+static char *fdasd_partition_type (char *str)
+{
+ PDEBUG
+
+ if (strncmp("NATIVE", str, 6) == 0)
+ strcpy(str, "Linux native");
+ else if (strncmp("NEW ", str, 6) == 0)
+ strcpy(str, "Linux native");
+ else if (strncmp("SWAP ", str, 6) == 0)
+ strcpy(str, "Linux swap");
+ else if (strncmp("RAID ", str, 6) == 0)
+ strcpy(str, "Linux Raid");
+ else
+ strcpy(str, "unknown");
+
+ return str;
+}
+
+/*
+ * initializes the anchor structure and allocates some
+ * memory for the labels
+ */
+void
+fdasd_initialize_anchor (fdasd_anchor_t * anc)
+{
+ PDEBUG
+ int i;
+ volume_label_t *v;
+ partition_info_t *p = NULL;
+ partition_info_t *q = NULL;
+
+ anc->devno = 0;
+ anc->dev_type = 0;
+ anc->used_partitions = 0;
+
+ anc->silent = 0;
+ anc->verbose = 0;
+ anc->big_disk = 0;
+ anc->volid_specified = 0;
+ anc->config_specified = 0;
+ anc->auto_partition = 0;
+ anc->devname_specified = 0;
+ anc->print_table = 0;
+
+ anc->option_reuse = 0;
+ anc->option_recreate = 0;
+
+ anc->vlabel_changed = 0;
+ anc->vtoc_changed = 0;
+ anc->blksize = 0;
+ anc->fspace_trk = 0;
+ anc->label_pos = 0;
+
+ for (i=0; i<USABLE_PARTITIONS; i++)
+ setpos(anc, i, -1);
+
+ bzero(anc->confdata, sizeof(config_data_t));
+
+ anc->f4 = malloc(sizeof(format4_label_t));
+ if (anc->f4 == NULL)
+ fdasd_error(anc, malloc_failed,
+ "FMT4 DSCB memory allocation failed.");
+
+ anc->f5 = malloc(sizeof(format5_label_t));
+ if (anc->f5 == NULL)
+ fdasd_error(anc, malloc_failed,
+ "FMT5 DSCB memory allocation failed.");
+
+ anc->f7 = malloc(sizeof(format7_label_t));
+ if (anc->f7 == NULL)
+ fdasd_error(anc, malloc_failed,
+ "FMT7 DSCB memory allocation failed.");
+
+ bzero(anc->f4, sizeof(format4_label_t));
+ bzero(anc->f5, sizeof(format5_label_t));
+ bzero(anc->f7, sizeof(format7_label_t));
+
+ v = malloc(sizeof(volume_label_t));
+ if (v == NULL)
+ fdasd_error(anc, malloc_failed,
+ "Volume label memory allocation failed.");
+ bzero(v, sizeof(volume_label_t));
+ anc->vlabel = v;
+
+ for (i=1; i<=USABLE_PARTITIONS; i++) {
+ p = malloc(sizeof(partition_info_t));
+ if (p == NULL)
+ fdasd_error(anc, malloc_failed,
+ "Partition info memory allocation failed.");
+ p->used = 0x00;
+ p->len_trk = 0;
+ p->start_trk = 0;
+ p->fspace_trk = 0;
+ p->type = 0;
+
+ /* add p to double pointered list */
+ if (i == 1) {
+ anc->first = p;
+ p->prev = NULL;
+ } else if (i == USABLE_PARTITIONS) {
+ anc->last = p;
+ p->next = NULL;
+ p->prev = q;
+ q->next = p;
+ } else {
+ p->prev = q;
+ q->next = p;
+ }
+
+ p->f1 = malloc(sizeof(format1_label_t));
+ if (p->f1 == NULL)
+ fdasd_error(anc, malloc_failed,
+ "FMT1 DSCB memory allocation failed.");
+ bzero(p->f1, sizeof(format1_label_t));
+
+ q = p;
+ }
+}
+
+/*
+ * call IOCTL to re-read the partition table
+ */
+static void
+fdasd_reread_partition_table (fdasd_anchor_t * anc, int fd)
+{
+ PDEBUG
+ char str[LINE_LENGTH];
+ int f;
+
+ if (ioctl (fd, BLKRRPART, NULL) != 0)
+ fdasd_error (anc, unable_to_ioctl, "Error while rereading "
+ "partition table.\nPlease reboot!");
+}
+
+/*
+ * writes all changes to dasd
+ */
+static void
+fdasd_write_vtoc_labels (fdasd_anchor_t * anc, int fd)
+{
+ PDEBUG
+ partition_info_t *p;
+ unsigned long b;
+ char dsno[6], s1[7], s2[45], *c1, *c2, *ch;
+ int i = 0, k = 0;
+
+ b = (cchhb2blk (&anc->vlabel->vtoc, &anc->geo) - 1) * anc->blksize;
+ if (b <= 0)
+ fdasd_error (anc, vlabel_corrupted, "");
+
+ /* write FMT4 DSCB */
+ vtoc_write_label (fd, b, NULL, anc->f4, NULL, NULL);
+
+ /* write FMT5 DSCB */
+ b += anc->blksize;
+ vtoc_write_label (fd, b, NULL, NULL, anc->f5, NULL);
+
+ /* write FMT7 DSCB */
+ if (anc->big_disk) {
+ b += anc->blksize;
+ vtoc_write_label (fd, b, NULL, NULL, NULL, anc->f7);
+ }
+
+ /* loop over all FMT1 DSCBs */
+ p = anc->first;
+ for (i = 0; i < USABLE_PARTITIONS; i++) {
+ b += anc->blksize;
+
+ if (p->used != 0x01) {
+ vtoc_write_label (fd, b, p->f1, NULL, NULL, NULL);
+ continue;
+ }
+
+ strncpy (p->f1->DS1DSSN, anc->vlabel->volid, 6);
+
+ ch = p->f1->DS1DSNAM;
+ vtoc_ebcdic_dec (ch, ch, 44);
+ c1 = ch + 7;
+
+ if (getdsn (anc, i) > -1) {
+ /* re-use the existing data set name */
+ c2 = strchr (c1, '.');
+ if (c2 != NULL)
+ strncpy (s2, c2, 31);
+ else
+ fdasd_error (anc, dsname_corrupted, "");
+
+ strncpy (s1, anc->vlabel->volid, 6);
+ vtoc_ebcdic_dec (s1, s1, 6);
+ s1[6] = ' ';
+ strncpy (c1, s1, 7);
+ c1 = strchr (ch, ' ');
+ strncpy (c1, s2, 31);
+ } else {
+ /* create a new data set name */
+ while (getpos (anc, k) > -1)
+ k++;
+
+ setpos (anc, k, i);
+
+ strncpy (s2, ch, 44);
+ s2[44] = 0;
+ vtoc_ebcdic_dec (s2, s2, 44);
+
+ strncpy (ch, "LINUX.V " " ", 44);
+
+ strncpy (s1, anc->vlabel->volid, 6);
+ vtoc_ebcdic_dec (s1, s1, 6);
+ strncpy (c1, s1, 6);
+
+ c1 = strchr (ch, ' ');
+ strncpy (c1, ".PART", 5);
+ c1 += 5;
+
+ sprintf (dsno, "%04d.", k + 1);
+ strncpy (c1, dsno, 5);
+
+ c1 += 5;
+ switch(p->type) {
+ case PARTITION_LINUX_LVM:
+ strncpy(c1, PART_TYPE_LVM, 6);
+ break;
+ case PARTITION_LINUX_RAID:
+ strncpy(c1, PART_TYPE_RAID, 6);
+ break;
+ case PARTITION_LINUX:
+ strncpy(c1, PART_TYPE_NATIVE, 6);
+ break;
+ case PARTITION_LINUX_SWAP:
+ strncpy(c1, PART_TYPE_SWAP, 6);
+ break;
+ default:
+ strncpy(c1, PART_TYPE_NATIVE, 6);
+ break;
+ }
+ }
+
+ vtoc_ebcdic_enc (ch, ch, 44);
+
+ vtoc_write_label (fd, b, p->f1, NULL, NULL, NULL);
+ p = p->next;
+ }
+}
+
+/*
+ * writes all changes to dasd
+ */
+int
+fdasd_write_labels (fdasd_anchor_t * anc, int fd)
+{
+ PDEBUG
+ if (anc->vlabel_changed)
+ vtoc_write_volume_label (fd, anc->label_pos, anc->vlabel);
+
+ if (anc->vtoc_changed)
+ fdasd_write_vtoc_labels (anc, fd);
+
+ return 1;
+}
+
+/*
+ * writes all changes to dasd
+ */
+int
+fdasd_prepare_labels (fdasd_anchor_t *anc, int fd)
+{
+ PDEBUG
+ partition_info_t *p = anc->first;
+ char dsno[6], s1[7], s2[45], *c1, *c2, *ch;
+ int i = 0, k = 0;
+
+ /* loop over all FMT1 DSCBs */
+ p = anc->first;
+ for (i = 0; i < USABLE_PARTITIONS; i++) {
+ strncpy (p->f1->DS1DSSN, anc->vlabel->volid, 6);
+
+ ch = p->f1->DS1DSNAM;
+ vtoc_ebcdic_dec (ch, ch, 44);
+ c1 = ch + 7;
+
+ if (getdsn (anc, i) > -1) {
+ /* re-use the existing data set name */
+ c2 = strchr (c1, '.');
+ if (c2 != NULL)
+ strncpy (s2, c2, 31);
+ else
+ fdasd_error (anc, dsname_corrupted, "");
+
+ strncpy (s1, anc->vlabel->volid, 6);
+ vtoc_ebcdic_dec (s1, s1, 6);
+ s1[6] = ' ';
+ strncpy (c1, s1, 7);
+ c1 = strchr (ch, ' ');
+ strncpy (c1, s2, 31);
+ } else {
+ /* create a new data set name */
+ while (getpos (anc, k) > -1)
+ k++;
+
+ setpos (anc, k, i);
+
+ strncpy (s2, ch, 44);
+ s2[44] = 0;
+ vtoc_ebcdic_dec (s2, s2, 44);
+
+ strncpy (ch, "LINUX.V " " ", 44);
+
+ strncpy (s1, anc->vlabel->volid, 6);
+ vtoc_ebcdic_dec (s1, s1, 6);
+ strncpy (c1, s1, 6);
+
+ c1 = strchr (ch, ' ');
+ strncpy (c1, ".PART", 5);
+ c1 += 5;
+
+ sprintf (dsno, "%04d.", k + 1);
+ strncpy (c1, dsno, 5);
+
+ c1 += 5;
+ switch(p->type) {
+ case PARTITION_LINUX_LVM:
+ strncpy(c1, PART_TYPE_LVM, 6);
+ break;
+ case PARTITION_LINUX_RAID:
+ strncpy(c1, PART_TYPE_RAID, 6);
+ break;
+ case PARTITION_LINUX:
+ strncpy(c1, PART_TYPE_NATIVE, 6);
+ break;
+ case PARTITION_LINUX_SWAP:
+ strncpy(c1, PART_TYPE_SWAP, 6);
+ break;
+ default:
+ strncpy(c1, PART_TYPE_NATIVE, 6);
+ break;
+ }
+ }
+
+ vtoc_ebcdic_enc (ch, ch, 44);
+ p = p->next;
+ }
+
+ return 1;
+}
+
+void
+fdasd_recreate_vtoc (fdasd_anchor_t *anc)
+{
+ PDEBUG
+ partition_info_t *p = anc->first;
+ int i;
+
+ vtoc_init_format4_label(anc->f4,
+ USABLE_PARTITIONS,
+ anc->geo.cylinders,
+ anc->geo.heads,
+ anc->geo.sectors,
+ anc->blksize,
+ anc->dev_type);
+
+ vtoc_init_format5_label(anc->f5);
+ vtoc_init_format7_label(anc->f7);
+ vtoc_set_freespace(anc->f4, anc->f5, anc->f7,
+ '+', anc->verbose,
+ FIRST_USABLE_TRK,
+ anc->geo.cylinders * anc->geo.heads - 1,
+ anc->geo.cylinders, anc->geo.heads);
+
+ for (i = 0; i < USABLE_PARTITIONS; i++) {
+ bzero(p->f1, sizeof(format1_label_t));
+ p->used = 0x00;
+ p->start_trk = 0;
+ p->end_trk = 0;
+ p->len_trk = 0;
+ p->fspace_trk = 0;
+ p->type = 0;
+ p = p->next;
+ }
+
+ anc->used_partitions = 0;
+ anc->fspace_trk = anc->geo.cylinders * anc->geo.heads - FIRST_USABLE_TRK;
+
+ for (i=0; i<USABLE_PARTITIONS; i++)
+ setpos(anc, i, -1);
+
+ anc->vtoc_changed++;
+}
+
+/*
+ * changes the volume serial
+ */
+static void
+fdasd_change_volser (fdasd_anchor_t *anc, char *line_ptr)
+{
+ PDEBUG
+ char str[10];
+
+ if (strcmp(line_ptr, "") != 0) {
+ int i;
+
+ /* fill with blanks if necessary and remove the linebreak */
+ i = strlen(line_ptr);
+ if (i <= 6)
+ strncpy(line_ptr + i - 1, " ", 6);
+
+ strncpy(str, line_ptr, 6);
+
+ for (i=0; i<6; i++) str[i] = toupper(str[i]);
+ str[6] = 0x00;
+
+ fdasd_check_volser (str, anc->devno);
+ vtoc_volume_label_set_volser(anc->vlabel, str);
+
+ vtoc_set_cchhb(&anc->vlabel->vtoc, 0x0000, 0x0001, 0x01);
+ anc->vlabel_changed++;
+ anc->vtoc_changed++;
+ }
+}
+
+/*
+ * sets some important partition data
+ * (like used, start_trk, end_trk, len_trk)
+ * by calculating these values with the
+ * information provided in the labels
+ */
+static void
+fdasd_update_partition_info (fdasd_anchor_t *anc)
+{
+ PDEBUG
+ partition_info_t *q = NULL, *p = anc->first;
+ unsigned int h = anc->geo.heads;
+ unsigned long max = anc->geo.cylinders * h - 1;
+ int i;
+ char *ch;
+
+ anc->used_partitions = anc->geo.sectors - 2 - anc->f4->DS4DSREC;
+
+ for (i = 1; i <= USABLE_PARTITIONS; i++) {
+ if (p->f1->DS1FMTID != 0xf1) {
+ if (i == 1)
+ /* there is no partition at all */
+ anc->fspace_trk = max - FIRST_USABLE_TRK + 1;
+ else
+ /* previous partition was the last one */
+ q->fspace_trk = max - q->end_trk;
+ break;
+ }
+
+ /* this is a valid format 1 label */
+ p->used = 0x01;
+ p->start_trk = p->f1->DS1EXT1.llimit.cc * h + p->f1->DS1EXT1.llimit.hh;
+ p->end_trk = p->f1->DS1EXT1.ulimit.cc * h + p->f1->DS1EXT1.ulimit.hh;
+ p->len_trk = p->end_trk - p->start_trk + 1;
+
+ if (i == 1) {
+ /* first partition, there is at least one */
+ anc->fspace_trk = p->start_trk - FIRST_USABLE_TRK;
+ } else {
+ if (i == USABLE_PARTITIONS)
+ /* last possible partition */
+ p->fspace_trk = max - p->end_trk;
+
+ /* set free space values of previous partition */
+ q->fspace_trk = p->start_trk - q->end_trk - 1;
+ }
+
+ ch = p->f1->DS1DSNAM;
+ vtoc_ebcdic_dec (ch, ch, 44);
+ if (strstr(ch, PART_TYPE_LVM))
+ p->type = PARTITION_LINUX_LVM;
+ else if (strstr(ch, PART_TYPE_RAID))
+ p->type = PARTITION_LINUX_RAID;
+ else if (strstr(ch, PART_TYPE_NATIVE))
+ p->type = PARTITION_LINUX;
+ else if (strstr(ch, PART_TYPE_SWAP))
+ p->type = PARTITION_LINUX_SWAP;
+ else
+ p->type = PARTITION_LINUX;
+ vtoc_ebcdic_enc (ch, ch, 44);
+
+ q = p;
+ p = p->next;
+ }
+}
+
+/*
+ * reorganizes all FMT1s, after that all used FMT1s should be right in
+ * front of all unused FMT1s
+ */
+static void
+fdasd_reorganize_FMT1s (fdasd_anchor_t *anc)
+{
+ PDEBUG
+ int i, j;
+ format1_label_t *ltmp;
+ partition_info_t *ptmp;
+
+ for (i=1; i<=USABLE_PARTITIONS - 1; i++) {
+ ptmp = anc->first;
+
+ for (j=1; j<=USABLE_PARTITIONS - i; j++) {
+ if (ptmp->f1->DS1FMTID < ptmp->next->f1->DS1FMTID) {
+ ltmp = ptmp->f1;
+ ptmp->f1 = ptmp->next->f1;
+ ptmp->next->f1 = ltmp;
+ }
+
+ ptmp=ptmp->next;
+ }
+ }
+}
+
+static void
+fdasd_process_valid_vtoc (fdasd_anchor_t * anc, unsigned long b, int fd)
+{
+ PDEBUG
+ int f5_counter = 0, f7_counter = 0, f1_counter = 0, oldfmt = 0;
+ int i, n, f1size = sizeof (format1_label_t);
+ partition_info_t *p = anc->first;
+ format1_label_t q;
+ char s[5], *ch;
+
+ b += anc->blksize;
+
+ for (i = 1; i <= anc->geo.sectors; i++) {
+ bzero (&q, f1size);
+ vtoc_read_label (fd, b, &q, NULL, NULL, NULL);
+
+ switch (q.DS1FMTID) {
+ case 0xf1:
+ if (p == NULL)
+ break;
+ memcpy (p->f1, &q, f1size);
+
+ n = -1;
+ vtoc_ebcdic_dec (p->f1->DS1DSNAM, p->f1->DS1DSNAM, 44);
+ ch = strstr (p->f1->DS1DSNAM, "PART");
+ if (ch != NULL) {
+ strncpy (s, ch + 4, 4);
+ s[4] = '\0';
+ n = atoi (s) - 1;
+ }
+
+ vtoc_ebcdic_enc (p->f1->DS1DSNAM, p->f1->DS1DSNAM, 44);
+
+ /* this dasd has data set names 0000-0002
+ but we use now 0001-0003 */
+ if (n == -1)
+ oldfmt++;
+
+ if (((oldfmt == 0) && (n < 0)) || (n >= USABLE_PARTITIONS)) {
+ /* no op */
+ } else {
+ if (oldfmt) {
+ /* correct +1 */
+ setpos (anc, n + 1, f1_counter);
+ } else {
+ setpos (anc, n, f1_counter);
+ }
+ }
+
+ p = p->next;
+ f1_counter++;
+ break;
+ case 0xf5:
+ memcpy (anc->f5, &q, f1size);
+ f5_counter++;
+ break;
+ case 0xf7:
+ if (f7_counter == 0)
+ memcpy (anc->f7, &q, f1size);
+ f7_counter++;
+ break;
+ }
+
+ b += anc->blksize;
+ }
+
+ if (oldfmt > 0) {
+ /* this is the old format PART0000 - PART0002 */
+ anc->vtoc_changed++;
+ }
+
+ if ((f5_counter == 0) || (anc->big_disk))
+ vtoc_init_format5_label (anc->f5);
+
+ if (f7_counter == 0)
+ vtoc_init_format7_label (anc->f7);
+
+ fdasd_reorganize_FMT1s (anc);
+ fdasd_update_partition_info (anc);
+}
+
+static int
+fdasd_valid_vtoc_pointer(fdasd_anchor_t *anc, unsigned long b, int fd)
+{
+ PDEBUG
+ char str[LINE_LENGTH];
+
+ /* VOL1 label contains valid VTOC pointer */
+ vtoc_read_label (fd, b, NULL, anc->f4, NULL, NULL);
+
+ if (anc->f4->DS4IDFMT != 0xf4) {
+ if (strncmp(anc->vlabel->volkey,vtoc_ebcdic_enc("LNX1",str,4),4) == 0)
+ return 0;
+ fdasd_error(anc, wrong_disk_format, "Invalid VTOC");
+ } else {
+ fdasd_process_valid_vtoc (anc, b, fd);
+ }
+
+ return 0;
+}
+
+/*
+ * check the dasd for a volume label
+ */
+int
+fdasd_check_volume (fdasd_anchor_t *anc, int fd)
+{
+ PDEBUG
+ volume_label_t *v = anc->vlabel;
+ unsigned long b = -1;
+ char str[LINE_LENGTH];
+
+ vtoc_read_volume_label (fd, anc->label_pos, v);
+
+ if (strncmp(v->vollbl, vtoc_ebcdic_enc ("VOL1", str, 4), 4) == 0) {
+ /* found VOL1 volume label */
+ b = (cchhb2blk (&v->vtoc, &anc->geo) - 1) * anc->blksize;
+
+ if (b > 0) {
+ int rc;
+ rc = fdasd_valid_vtoc_pointer (anc, b, fd);
+
+ if (rc < 0)
+ return 1;
+ else
+ return 0;
+ } else {
+ return 1;
+ }
+ } else if (strncmp (v->volkey, vtoc_ebcdic_enc ("LNX1", str, 4), 4) == 0) {
+ return 0;
+ }
+
+ return 1;
+}
+
+/*
+ * checks the current API version with the API version of the dasd driver
+ */
+void
+fdasd_check_api_version (fdasd_anchor_t *anc, int f)
+{
+ PDEBUG
+ int api;
+ char s[LINE_LENGTH];
+
+ if (ioctl(f, DASDAPIVER, &api) != 0)
+ fdasd_error(anc, unable_to_ioctl, "Could not retrieve API version.");
+
+ if (api != DASD_MIN_API_VERSION) {
+ sprintf(s, "The current API version '%d' doesn't " \
+ "match dasd driver API version " \
+ "'%d'!", api, DASD_MIN_API_VERSION);
+ fdasd_error(anc, api_version_mismatch, s);
+ }
+}
+
+/*
+ * reads dasd geometry data
+ */
+void
+fdasd_get_geometry (fdasd_anchor_t *anc, int f)
+{
+ PDEBUG
+ int blksize = 0;
+ dasd_information_t dasd_info;
+ char s[LINE_LENGTH];
+
+ if (ioctl(f, HDIO_GETGEO, &anc->geo) != 0)
+ fdasd_error(anc, unable_to_ioctl,
+ "Could not retrieve disk geometry information.");
+
+ if (ioctl(f, BLKSSZGET, &blksize) != 0)
+ fdasd_error(anc, unable_to_ioctl,
+ "Could not retrieve blocksize information.");
+
+ /* get disk type */
+ if (ioctl(f, BIODASDINFO, &dasd_info) != 0)
+ fdasd_error(anc, unable_to_ioctl,
+ "Could not retrieve disk information.");
+
+ if (strncmp(dasd_info.type, "ECKD", 4) != 0) {
+ sprintf(s, "This is not an ECKD disk! This disk type " \
+ "is not supported!");
+ fdasd_error(anc,wrong_disk_type, s);
+ }
+
+ anc->dev_type = dasd_info.dev_type;
+ anc->blksize = blksize;
+ anc->label_pos = dasd_info.label_block * blksize;
+ anc->devno = dasd_info.devno;
+ anc->fspace_trk = anc->geo.cylinders * anc->geo.heads - FIRST_USABLE_TRK;
+}
+
+/*
+ * returns unused partition info pointer if there
+ * is a free partition, otherwise NULL
+ */
+static partition_info_t *
+fdasd_get_empty_f1_label (fdasd_anchor_t * anc)
+{
+ PDEBUG
+ if (anc->used_partitions < USABLE_PARTITIONS)
+ return anc->last;
+ else
+ return NULL;
+}
+
+/*
+ * asks for and sets some important partition data
+ */
+static int
+fdasd_get_partition_data (fdasd_anchor_t *anc, extent_t *part_extent,
+ partition_info_t *p, unsigned int *start_ptr,
+ unsigned int *stop_ptr)
+{
+ PDEBUG
+ unsigned int limit, cc, hh;
+ cchh_t llimit, ulimit;
+ partition_info_t *q;
+ char mesg[48];
+ u_int8_t b1, b2;
+ u_int16_t c, h;
+ unsigned int start = *start_ptr, stop = *stop_ptr;
+ int i;
+ char *ch;
+
+ if (anc->f4->DS4DEVCT.DS4DEVFG & ALTERNATE_CYLINDERS_USED)
+ c = anc->f4->DS4DEVCT.DS4DSCYL - (u_int16_t) anc->f4->DS4DEVAC;
+ else
+ c = anc->f4->DS4DEVCT.DS4DSCYL;
+
+ h = anc->f4->DS4DEVCT.DS4DSTRK;
+ limit = (h * c - 1);
+
+ /* check start value from user */
+ q = anc->first;
+ for (i = 0; i < USABLE_PARTITIONS; i++) {
+ if ( q->next == NULL )
+ break;
+
+ if (start >= q->start_trk && start <= q->end_trk) {
+ /* start is within another partition */
+ start = q->end_trk + 1;
+
+ if (start > limit) {
+ start = FIRST_USABLE_TRK;
+ q = anc->first;
+ }
+ }
+
+ if (start < q->start_trk) {
+ limit = q->start_trk - 1;
+ break;
+ }
+
+ q = q->next;
+ }
+
+ if (start == limit)
+ stop = start;
+
+ /* update partition info */
+ p->len_trk = stop - start + 1;
+ p->start_trk = start;
+ p->end_trk = stop;
+
+ cc = start / anc->geo.heads;
+ hh = start - (cc * anc->geo.heads);
+ vtoc_set_cchh(&llimit, cc, hh);
+
+ /* check for cylinder boundary */
+ if (hh == 0)
+ b1 = 0x81;
+ else
+ b1 = 0x01;
+
+ cc = stop / anc->geo.heads;
+ hh = stop - cc * anc->geo.heads;
+ vtoc_set_cchh(&ulimit, cc, hh);
+
+ /* it is always the 1st extent */
+ b2 = 0x00;
+
+ vtoc_set_extent(part_extent, b1, b2, &llimit, &ulimit);
+
+ *start_ptr = start;
+ *stop_ptr = stop;
+
+ ch = p->f1->DS1DSNAM;
+ vtoc_ebcdic_dec (ch, ch, 44);
+
+ if (strstr(ch, PART_TYPE_LVM))
+ p->type = PARTITION_LINUX_LVM;
+ else if (strstr(ch, PART_TYPE_RAID))
+ p->type = PARTITION_LINUX_RAID;
+ else if (strstr(ch, PART_TYPE_NATIVE))
+ p->type = PARTITION_LINUX;
+ else if (strstr(ch, PART_TYPE_SWAP))
+ p->type = PARTITION_LINUX_SWAP;
+ else
+ p->type = PARTITION_LINUX;
+
+ vtoc_ebcdic_enc (ch, ch, 44);
+
+ return 0;
+}
+
+static void
+fdasd_enqueue_new_partition (fdasd_anchor_t *anc)
+{
+ PDEBUG
+ partition_info_t *q = anc->first, *p = anc->last;
+ int i, k=0;
+
+ for (i=1; i<USABLE_PARTITIONS; i++) {
+ if ((q->end_trk == 0) || (p->start_trk < q->start_trk)) {
+ break;
+ } else {
+ q = q->next;
+ k++;
+ }
+ }
+
+ if (anc->first == q)
+ anc->first = p;
+
+ if (p != q) {
+ anc->last->prev->next = NULL;
+ anc->last = anc->last->prev;
+
+ p->next = q;
+ p->prev = q->prev;
+ q->prev = p;
+
+ if (p->prev != NULL)
+ p->prev->next = p;
+ }
+
+ p->used = 0x01;
+ p->type = PARTITION_LINUX;
+
+ for (i=0; i<USABLE_PARTITIONS; i++) {
+ int j = getpos(anc, i);
+ if (j >= k)
+ setpos(anc, i, j + 1);
+ }
+
+ /* update free-space counters */
+ if (anc->first == p) {
+ /* partition is the first used partition */
+ if (p->start_trk == FIRST_USABLE_TRK) {
+ /* partition starts right behind VTOC */
+ p->fspace_trk = anc->fspace_trk - p->len_trk;
+ anc->fspace_trk = 0;
+ } else {
+ /* there is some space between VTOC and partition */
+ p->fspace_trk = anc->fspace_trk - p->len_trk - p->start_trk
+ + FIRST_USABLE_TRK;
+ anc->fspace_trk = p->start_trk - FIRST_USABLE_TRK;
+ }
+ } else {
+ /* there are partitons in front of the new one */
+ if (p->start_trk == p->prev->end_trk + 1) {
+ /* new partition is right behind the previous one */
+ p->fspace_trk = p->prev->fspace_trk - p->len_trk;
+ p->prev->fspace_trk = 0;
+ } else {
+ /* there is some space between new and prev. part. */
+ p->fspace_trk = p->prev->fspace_trk - p->len_trk
+ - p->start_trk + p->prev->end_trk + 1;
+ p->prev->fspace_trk = p->start_trk - p->prev->end_trk - 1;
+ }
+ }
+}
+
+/*
+ * adds a new partition to the 'partition table'
+ */
+partition_info_t *
+fdasd_add_partition (fdasd_anchor_t *anc, unsigned int start,
+ unsigned int stop)
+{
+ PDEBUG
+ cchhb_t hf1;
+ partition_info_t *p;
+ extent_t ext;
+ int i;
+
+ PDEBUG;
+
+ if ((p = fdasd_get_empty_f1_label(anc)) == NULL) {
+ PDEBUG;
+ return 0;
+ }
+
+ PDEBUG;
+ if (fdasd_get_partition_data(anc, &ext, p, &start, &stop) != 0)
+ return 0;
+
+ PDEBUG;
+ vtoc_init_format1_label(anc->vlabel->volid, anc->blksize, &ext, p->f1);
+
+ PDEBUG;
+ fdasd_enqueue_new_partition(anc);
+
+ PDEBUG;
+ anc->used_partitions += 1;
+
+ i = anc->used_partitions + 2;
+ if (anc->big_disk)
+ i++;
+ PDEBUG;
+
+ vtoc_set_cchhb(&hf1, VTOC_START_CC, VTOC_START_HH, i);
+
+ vtoc_update_format4_label(anc->f4, &hf1, anc->f4->DS4DSREC - 1);
+
+ PDEBUG;
+
+ start = ext.llimit.cc * anc->geo.heads + ext.llimit.hh;
+ stop = ext.ulimit.cc * anc->geo.heads + ext.ulimit.hh;
+
+ PDEBUG;
+ vtoc_set_freespace(anc->f4, anc->f5, anc->f7, '-', anc->verbose,
+ start, stop, anc->geo.cylinders, anc->geo.heads);
+
+ anc->vtoc_changed++;
+
+ PDEBUG;
+ return p;
+}
+
+/* vim:set tabstop=4 shiftwidth=4 softtabstop=4: */
diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c
new file mode 100644
index 0000000..80b4d9d
--- /dev/null
+++ b/libparted/labels/gpt.c
@@ -0,0 +1,1504 @@
+/*
+ libparted - a library for manipulating disk partitions
+
+ original version by Matt Domsch <Matt_Domsch@dell.com>
+ Disclaimed into the Public Domain
+
+ Portions Copyright (C) 2001, 2002, 2003, 2005, 2006
+ Free Software Foundation, Inc.
+
+ EFI GUID Partition Table handling
+ Per Intel EFI Specification v1.02
+ http://developer.intel.com/technology/efi/efi.htm
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#include "config.h"
+
+#include <parted/parted.h>
+#include <parted/debug.h>
+#include <parted/endian.h>
+#include <parted/crc32.h>
+#include <inttypes.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <uuid/uuid.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) gettext (String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+#define EFI_PMBR_OSTYPE_EFI 0xEE
+#define MSDOS_MBR_SIGNATURE 0xaa55
+
+#define GPT_HEADER_SIGNATURE 0x5452415020494645LL
+
+/* NOTE: the document that describes revision 1.00 is labelled "version 1.02",
+ * so some implementors got confused...
+ */
+#define GPT_HEADER_REVISION_V1_02 0x00010200
+#define GPT_HEADER_REVISION_V1_00 0x00010000
+#define GPT_HEADER_REVISION_V0_99 0x00009900
+
+typedef uint16_t efi_char16_t; /* UNICODE character */
+
+typedef struct {
+ uint32_t time_low;
+ uint16_t time_mid;
+ uint16_t time_hi_and_version;
+ uint8_t clock_seq_hi_and_reserved;
+ uint8_t clock_seq_low;
+ uint8_t node[6];
+} /* __attribute__ ((packed)) */ efi_guid_t;
+/* commented out "__attribute__ ((packed))" to work around gcc bug (fixed
+ * in gcc3.1): __attribute__ ((packed)) breaks addressing on initialized
+ * data. It turns out we don't need it in this case, so it doesn't break
+ * anything :)
+ */
+
+#define UNUSED_ENTRY_GUID \
+ ((efi_guid_t) { 0x00000000, 0x0000, 0x0000, 0x00, 0x00, \
+ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }})
+#define PARTITION_SYSTEM_GUID \
+ ((efi_guid_t) { PED_CPU_TO_LE32 (0xC12A7328), PED_CPU_TO_LE16 (0xF81F), \
+ PED_CPU_TO_LE16 (0x11d2), 0xBA, 0x4B, \
+ { 0x00, 0xA0, 0xC9, 0x3E, 0xC9, 0x3B }})
+#define LEGACY_MBR_PARTITION_GUID \
+ ((efi_guid_t) { PED_CPU_TO_LE32 (0x024DEE41), PED_CPU_TO_LE16 (0x33E7), \
+ PED_CPU_TO_LE16 (0x11d3, 0x9D, 0x69, \
+ { 0x00, 0x08, 0xC7, 0x81, 0xF3, 0x9F }})
+#define PARTITION_MSFT_RESERVED_GUID \
+ ((efi_guid_t) { PED_CPU_TO_LE32 (0xE3C9E316), PED_CPU_TO_LE16 (0x0B5C), \
+ PED_CPU_TO_LE16 (0x4DB8), 0x81, 0x7D, \
+ { 0xF9, 0x2D, 0xF0, 0x02, 0x15, 0xAE }})
+#define PARTITION_BASIC_DATA_GUID \
+ ((efi_guid_t) { PED_CPU_TO_LE32 (0xEBD0A0A2), PED_CPU_TO_LE16 (0xB9E5), \
+ PED_CPU_TO_LE16 (0x4433), 0x87, 0xC0, \
+ { 0x68, 0xB6, 0xB7, 0x26, 0x99, 0xC7 }})
+#define PARTITION_RAID_GUID \
+ ((efi_guid_t) { PED_CPU_TO_LE32 (0xa19d880f), PED_CPU_TO_LE16 (0x05fc), \
+ PED_CPU_TO_LE16 (0x4d3b), 0xa0, 0x06, \
+ { 0x74, 0x3f, 0x0f, 0x84, 0x91, 0x1e }})
+#define PARTITION_SWAP_GUID \
+ ((efi_guid_t) { PED_CPU_TO_LE32 (0x0657fd6d), PED_CPU_TO_LE16 (0xa4ab), \
+ PED_CPU_TO_LE16 (0x43c4), 0x84, 0xe5, \
+ { 0x09, 0x33, 0xc8, 0x4b, 0x4f, 0x4f }})
+#define PARTITION_LVM_GUID \
+ ((efi_guid_t) { PED_CPU_TO_LE32 (0xe6d6d379), PED_CPU_TO_LE16 (0xf507), \
+ PED_CPU_TO_LE16 (0x44c2), 0xa2, 0x3c, \
+ { 0x23, 0x8f, 0x2a, 0x3d, 0xf9, 0x28 }})
+#define PARTITION_RESERVED_GUID \
+ ((efi_guid_t) { PED_CPU_TO_LE32 (0x8da63339), PED_CPU_TO_LE16 (0x0007), \
+ PED_CPU_TO_LE16 (0x60c0), 0xc4, 0x36, \
+ { 0x08, 0x3a, 0xc8, 0x23, 0x09, 0x08 }})
+#define PARTITION_HPSERVICE_GUID \
+ ((efi_guid_t) { PED_CPU_TO_LE32 (0xe2a1e728), PED_CPU_TO_LE16 (0x32e3), \
+ PED_CPU_TO_LE16 (0x11d6), 0xa6, 0x82, \
+ { 0x7b, 0x03, 0xa0, 0x00, 0x00, 0x00 }})
+#define PARTITION_APPLE_HFS_GUID \
+ ((efi_guid_t) { PED_CPU_TO_LE32 (0x48465300), PED_CPU_TO_LE16 (0x0000), \
+ PED_CPU_TO_LE16 (0x11AA), 0xaa, 0x11, \
+ { 0x00, 0x30, 0x65, 0x43, 0xEC, 0xAC }})
+
+typedef struct _GuidPartitionTableHeader_t {
+ uint64_t Signature;
+ uint32_t Revision;
+ uint32_t HeaderSize;
+ uint32_t HeaderCRC32;
+ uint32_t Reserved1;
+ uint64_t MyLBA;
+ uint64_t AlternateLBA;
+ uint64_t FirstUsableLBA;
+ uint64_t LastUsableLBA;
+ efi_guid_t DiskGUID;
+ uint64_t PartitionEntryLBA;
+ uint32_t NumberOfPartitionEntries;
+ uint32_t SizeOfPartitionEntry;
+ uint32_t PartitionEntryArrayCRC32;
+ uint8_t* Reserved2;
+} __attribute__ ((packed)) GuidPartitionTableHeader_t;
+
+typedef struct _GuidPartitionEntryAttributes_t {
+#ifdef __GNUC__ /* XXX narrow this down to !TinyCC */
+ uint64_t RequiredToFunction:1;
+ uint64_t Reserved:47;
+ uint64_t GuidSpecific:16;
+#else
+# warning "Using crippled partition entry type"
+ uint32_t RequiredToFunction:1;
+ uint32_t Reserved:32;
+ uint32_t LOST:5;
+ uint32_t GuidSpecific:16;
+#endif
+} __attribute__ ((packed)) GuidPartitionEntryAttributes_t;
+
+typedef struct _GuidPartitionEntry_t {
+ efi_guid_t PartitionTypeGuid;
+ efi_guid_t UniquePartitionGuid;
+ uint64_t StartingLBA;
+ uint64_t EndingLBA;
+ GuidPartitionEntryAttributes_t Attributes;
+ efi_char16_t PartitionName[72 / sizeof(efi_char16_t)];
+} __attribute__ ((packed)) GuidPartitionEntry_t;
+
+#define GPT_PMBR_LBA 0
+#define GPT_PMBR_SECTORS 1
+#define GPT_PRIMARY_HEADER_LBA 1
+#define GPT_HEADER_SECTORS 1
+#define GPT_PRIMARY_PART_TABLE_LBA 2
+
+/*
+ These values are only defaults. The actual on-disk structures
+ may define different sizes, so use those unless creating a new GPT disk!
+*/
+
+#define GPT_DEFAULT_PARTITION_ENTRY_ARRAY_SIZE 16384
+
+/* Number of actual partition entries should be calculated as: */
+#define GPT_DEFAULT_PARTITION_ENTRIES \
+ (GPT_DEFAULT_PARTITION_ENTRY_ARRAY_SIZE / \
+ sizeof(GuidPartitionEntry_t))
+
+
+typedef struct _PartitionRecord_t {
+ /* Not used by EFI firmware. Set to 0x80 to indicate that this
+ is the bootable legacy partition. */
+ uint8_t BootIndicator;
+
+ /* Start of partition in CHS address, not used by EFI firmware. */
+ uint8_t StartHead;
+
+ /* Start of partition in CHS address, not used by EFI firmware. */
+ uint8_t StartSector;
+
+ /* Start of partition in CHS address, not used by EFI firmware. */
+ uint8_t StartTrack;
+
+ /* OS type. A value of 0xEF defines an EFI system partition.
+ Other values are reserved for legacy operating systems, and
+ allocated independently of the EFI specification. */
+ uint8_t OSType;
+
+ /* End of partition in CHS address, not used by EFI firmware. */
+ uint8_t EndHead;
+
+ /* End of partition in CHS address, not used by EFI firmware. */
+ uint8_t EndSector;
+
+ /* End of partition in CHS address, not used by EFI firmware. */
+ uint8_t EndTrack;
+
+ /* Starting LBA address of the partition on the disk. Used by
+ EFI firmware to define the start of the partition. */
+ uint32_t StartingLBA;
+
+ /* Size of partition in LBA. Used by EFI firmware to determine
+ the size of the partition. */
+ uint32_t SizeInLBA;
+} __attribute__ ((packed)) PartitionRecord_t;
+
+/* Protected Master Boot Record & Legacy MBR share same structure */
+/* Needs to be packed because the u16s force misalignment. */
+typedef struct _LegacyMBR_t {
+ uint8_t BootCode[440];
+ uint32_t UniqueMBRSignature;
+ uint16_t Unknown;
+ PartitionRecord_t PartitionRecord[4];
+ uint16_t Signature;
+} __attribute__ ((packed)) LegacyMBR_t;
+
+/* uses libparted's disk_specific field in PedDisk, to store our info */
+typedef struct _GPTDiskData {
+ PedGeometry data_area;
+ int entry_count;
+ efi_guid_t uuid;
+} GPTDiskData;
+
+/* uses libparted's disk_specific field in PedPartition, to store our info */
+typedef struct _GPTPartitionData {
+ efi_guid_t type;
+ efi_guid_t uuid;
+ char name[37];
+ int lvm;
+ int raid;
+ int boot;
+ int hp_service;
+ int hidden;
+ int msftres;
+} GPTPartitionData;
+
+static PedDiskType gpt_disk_type;
+
+
+static inline uint32_t
+pth_get_size (const PedDevice* dev)
+{
+ return GPT_HEADER_SECTORS * dev->sector_size;
+}
+
+
+static inline uint32_t
+pth_get_size_static (const PedDevice* dev)
+{
+ return sizeof (GuidPartitionTableHeader_t) - sizeof (uint8_t*);
+}
+
+
+static inline uint32_t
+pth_get_size_rsv2 (const PedDevice* dev)
+{
+ return pth_get_size(dev) - pth_get_size_static(dev);
+}
+
+
+static GuidPartitionTableHeader_t*
+pth_new (const PedDevice* dev)
+{
+ GuidPartitionTableHeader_t* pth = ped_malloc (
+ sizeof (GuidPartitionTableHeader_t)
+ + sizeof (uint8_t));
+
+ pth->Reserved2 = ped_malloc ( pth_get_size_rsv2 (dev) );
+
+ return pth;
+}
+
+
+static GuidPartitionTableHeader_t*
+pth_new_zeroed (const PedDevice* dev)
+{
+ GuidPartitionTableHeader_t* pth = pth_new (dev);
+
+ memset (pth, 0, pth_get_size_static (dev));
+ memset (pth->Reserved2, 0, pth_get_size_rsv2 (dev));
+
+ return (pth);
+}
+
+
+static GuidPartitionTableHeader_t*
+pth_new_from_raw (const PedDevice* dev, const uint8_t* pth_raw)
+{
+ GuidPartitionTableHeader_t* pth = pth_new (dev);
+
+ PED_ASSERT (pth_raw != NULL, return 0);
+
+ memcpy (pth, pth_raw, pth_get_size_static (dev));
+ memcpy (pth->Reserved2, pth_raw + pth_get_size_static (dev),
+ pth_get_size_rsv2 (dev));
+
+ return pth;
+}
+
+static void
+pth_free (GuidPartitionTableHeader_t* pth)
+{
+ PED_ASSERT (pth != NULL, return);
+ PED_ASSERT (pth->Reserved2 != NULL, return);
+
+ ped_free (pth->Reserved2);
+ ped_free (pth);
+}
+
+static uint8_t*
+pth_get_raw (const PedDevice* dev, const GuidPartitionTableHeader_t* pth)
+{
+ uint8_t* pth_raw = ped_malloc (pth_get_size (dev));
+ int size_static = pth_get_size_static (dev);
+
+ PED_ASSERT (pth != NULL, return 0);
+ PED_ASSERT (pth->Reserved2 != NULL, return 0);
+
+ memcpy (pth_raw, pth, size_static);
+ memcpy (pth_raw + size_static, pth->Reserved2, pth_get_size_rsv2 (dev));
+
+ return pth_raw;
+}
+
+
+/**
+ * swap_uuid_and_efi_guid() - converts between uuid formats
+ * @uuid - uuid_t in either format (converts it to the other)
+ *
+ * There are two different representations for Globally Unique Identifiers
+ * (GUIDs or UUIDs).
+ *
+ * The RFC specifies a UUID as a string of 16 bytes, essentially
+ * a big-endian array of char.
+ * Intel, in their EFI Specification, references the same RFC, but
+ * then defines a GUID as a structure of little-endian fields.
+ * Coincidentally, both structures have the same format when unparsed.
+ *
+ * When read from disk, EFI GUIDs are in struct of little endian format,
+ * and need to be converted to be treated as uuid_t in memory.
+ *
+ * When writing to disk, uuid_ts need to be converted into EFI GUIDs.
+ *
+ * Blame Intel.
+ */
+static void
+swap_uuid_and_efi_guid(uuid_t uuid)
+{
+ int i;
+ efi_guid_t *guid = (efi_guid_t *)uuid;
+
+ PED_ASSERT(uuid != NULL, return);
+ guid->time_low = PED_SWAP32(guid->time_low);
+ guid->time_mid = PED_SWAP16(guid->time_mid);
+ guid->time_hi_and_version = PED_SWAP16(guid->time_hi_and_version);
+}
+
+/* returns the EFI-style CRC32 value for buf
+ * This function uses the crc32 function by Gary S. Brown,
+ * but seeds the function with ~0, and xor's with ~0 at the end.
+ */
+static inline uint32_t
+efi_crc32(const void *buf, unsigned long len)
+{
+ return (__efi_crc32(buf, len, ~0L) ^ ~0L);
+}
+
+static inline uint32_t
+pth_crc32(const PedDevice* dev, const GuidPartitionTableHeader_t* pth)
+{
+ uint8_t* pth_raw = pth_get_raw (dev, pth);
+ uint32_t crc32 = 0;
+
+ PED_ASSERT (dev != NULL, return 0);
+ PED_ASSERT (pth != NULL, return 0);
+
+ crc32 = efi_crc32 (pth_raw, pth_get_size_static (dev));
+
+ ped_free (pth_raw);
+
+ return crc32;
+}
+
+static inline int
+guid_cmp (efi_guid_t left, efi_guid_t right)
+{
+ return memcmp(&left, &right, sizeof(efi_guid_t));
+}
+
+/* checks if 'mbr' is a protective MBR partition table */
+static inline int
+_pmbr_is_valid (const LegacyMBR_t* mbr)
+{
+ int i;
+
+ PED_ASSERT(mbr != NULL, return 0);
+
+ if (mbr->Signature != PED_CPU_TO_LE16(MSDOS_MBR_SIGNATURE))
+ return 0;
+ for (i = 0; i < 4; i++) {
+ if (mbr->PartitionRecord[i].OSType == EFI_PMBR_OSTYPE_EFI)
+ return 1;
+ }
+ return 0;
+}
+
+static int
+gpt_probe (const PedDevice * dev)
+{
+ GuidPartitionTableHeader_t* gpt = NULL;
+ uint8_t* pth_raw = ped_malloc (pth_get_size (dev));
+ LegacyMBR_t legacy_mbr;
+ int gpt_sig_found = 0;
+
+ PED_ASSERT (dev != NULL, return 0);
+
+ if (ped_device_read(dev, pth_raw, 1, GPT_HEADER_SECTORS)
+ || ped_device_read(dev, pth_raw, dev->length - 1, GPT_HEADER_SECTORS)) {
+ gpt = pth_new_from_raw (dev, pth_raw);
+ if (gpt->Signature == PED_CPU_TO_LE64(GPT_HEADER_SIGNATURE))
+ gpt_sig_found = 1;
+ }
+
+ ped_free (pth_raw);
+
+ if (gpt)
+ pth_free (gpt);
+
+
+ if (!gpt_sig_found)
+ return 0;
+
+ if (ped_device_read(dev, &legacy_mbr, 0, GPT_HEADER_SECTORS)) {
+ if (!_pmbr_is_valid (&legacy_mbr)) {
+ int ex_status = ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_YES_NO,
+ _("%s contains GPT signatures, indicating that it has "
+ "a GPT table. However, it does not have a valid "
+ "fake msdos partition table, as it should. Perhaps "
+ "it was corrupted -- possibly by a program that "
+ "doesn't understand GPT partition tables. Or "
+ "perhaps you deleted the GPT table, and are now "
+ "using an msdos partition table. Is this a GPT "
+ "partition table?"),
+ dev->path);
+ if (ex_status == PED_EXCEPTION_NO)
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
+#ifndef DISCOVER_ONLY
+/* writes zeros to the PMBR and the primary and alternate GPTHs and PTEs */
+static int
+gpt_clobber(PedDevice * dev)
+{
+ LegacyMBR_t pmbr;
+ uint8_t* zeroed_pth_raw = ped_malloc (pth_get_size (dev));
+ uint8_t* pth_raw = ped_malloc (pth_get_size (dev));
+ GuidPartitionTableHeader_t* gpt;
+ GuidPartitionEntry_t ptes[GPT_DEFAULT_PARTITION_ENTRIES];
+
+ PED_ASSERT (dev != NULL, return 0);
+
+ memset(&pmbr, 0, sizeof(pmbr));
+ memset(zeroed_pth_raw, 0, pth_get_size (dev));
+
+ /*
+ * TO DISCUSS: check whether checksum is correct?
+ * If not, we might get a wrong AlternateLBA field and destroy
+ * one sector of random data.
+ */
+ if (!ped_device_read(dev, pth_raw,
+ GPT_PRIMARY_HEADER_LBA, GPT_HEADER_SECTORS))
+ goto error_free;
+
+ gpt = pth_new_from_raw (dev, pth_raw);
+
+ if (!ped_device_write(dev, &pmbr, GPT_PMBR_LBA, GPT_PMBR_SECTORS))
+ goto error_free_with_gpt;
+ if (!ped_device_write(dev, &zeroed_pth_raw,
+ GPT_PRIMARY_HEADER_LBA, GPT_HEADER_SECTORS))
+ goto error_free_with_gpt;
+ if (!ped_device_write(dev, &zeroed_pth_raw, dev->length - GPT_HEADER_SECTORS,
+ GPT_HEADER_SECTORS))
+ goto error_free_with_gpt;
+
+ if ((PedSector) PED_LE64_TO_CPU (gpt->AlternateLBA) < dev->length - 1) {
+ if (!ped_device_write(dev, gpt,
+ PED_LE64_TO_CPU (gpt->AlternateLBA),
+ GPT_HEADER_SECTORS))
+ return 0;
+ }
+
+ pth_free (gpt);
+
+ return 1;
+
+error_free_with_gpt:
+ pth_free (gpt);
+error_free:
+ ped_free (pth_raw);
+ ped_free (zeroed_pth_raw);
+ return 0;
+}
+#endif /* !DISCOVER_ONLY */
+
+static PedDisk *
+gpt_alloc (const PedDevice * dev)
+{
+ PedDisk* disk;
+ GPTDiskData *gpt_disk_data;
+ PedSector data_start, data_end;
+
+ disk = _ped_disk_alloc ((PedDevice*)dev, &gpt_disk_type);
+ if (!disk)
+ goto error;
+ disk->disk_specific = gpt_disk_data = ped_malloc (sizeof (GPTDiskData));
+ if (!disk->disk_specific)
+ goto error_free_disk;
+
+ data_start = 2 + GPT_DEFAULT_PARTITION_ENTRY_ARRAY_SIZE / dev->sector_size;
+ data_end = dev->length - 2
+ - GPT_DEFAULT_PARTITION_ENTRY_ARRAY_SIZE / dev->sector_size;
+ ped_geometry_init (&gpt_disk_data->data_area, dev, data_start,
+ data_end - data_start + 1);
+ gpt_disk_data->entry_count = GPT_DEFAULT_PARTITION_ENTRIES;
+ uuid_generate ((unsigned char*) &gpt_disk_data->uuid);
+ swap_uuid_and_efi_guid((unsigned char*)(&gpt_disk_data->uuid));
+ return disk;
+
+error_free_disk:
+ ped_free (disk);
+error:
+ return NULL;
+}
+
+static PedDisk*
+gpt_duplicate (const PedDisk* disk)
+{
+ PedDisk* new_disk;
+ GPTDiskData* new_disk_data;
+ GPTDiskData* old_disk_data;
+
+ new_disk = ped_disk_new_fresh (disk->dev, &gpt_disk_type);
+ if (!new_disk)
+ return NULL;
+
+ old_disk_data = disk->disk_specific;
+ new_disk_data = new_disk->disk_specific;
+
+ ped_geometry_init (&new_disk_data->data_area, disk->dev,
+ old_disk_data->data_area.start,
+ old_disk_data->data_area.length);
+ new_disk_data->entry_count = old_disk_data->entry_count;
+ new_disk_data->uuid = old_disk_data->uuid;
+ return new_disk;
+}
+
+static void
+gpt_free(PedDisk * disk)
+{
+ ped_disk_delete_all (disk);
+ ped_free (disk->disk_specific);
+ _ped_disk_free (disk);
+}
+
+static int
+_header_is_valid (const PedDevice* dev, GuidPartitionTableHeader_t* gpt)
+{
+ uint32_t crc, origcrc;
+
+ if (PED_LE64_TO_CPU (gpt->Signature) != GPT_HEADER_SIGNATURE)
+ return 0;
+ if (PED_LE32_TO_CPU (gpt->HeaderSize)
+ > pth_get_size_static (dev))
+ return 0;
+
+ origcrc = gpt->HeaderCRC32;
+ gpt->HeaderCRC32 = 0;
+ crc = pth_crc32 (dev, gpt);
+ gpt->HeaderCRC32 = origcrc;
+
+ return crc == PED_LE32_TO_CPU (origcrc);
+}
+
+static int
+_read_header (const PedDevice* dev, GuidPartitionTableHeader_t** gpt,
+ PedSector where)
+{
+ uint8_t* pth_raw = ped_malloc (pth_get_size (dev));
+
+ PED_ASSERT (dev != NULL, return 0);
+
+ if (!ped_device_read (dev, pth_raw, where, GPT_HEADER_SECTORS)) {
+ ped_free (pth_raw);
+ return 0;
+ }
+
+ *gpt = pth_new_from_raw (dev, pth_raw);
+
+ ped_free (pth_raw);
+
+ if (_header_is_valid (dev, *gpt))
+ return 1;
+
+ pth_free (*gpt);
+ return 0;
+}
+
+static int
+_parse_header (PedDisk* disk, GuidPartitionTableHeader_t* gpt,
+ int *update_needed)
+{
+ GPTDiskData* gpt_disk_data = disk->disk_specific;
+ PedSector first_usable;
+ PedSector last_usable;
+ PedSector last_usable_if_grown, last_usable_min_default;
+ static int asked_already;
+
+ PED_ASSERT (_header_is_valid (disk->dev, gpt), return 0);
+
+#ifndef DISCOVER_ONLY
+ if (PED_CPU_TO_LE32 (gpt->Revision) > GPT_HEADER_REVISION_V1_02
+ || PED_CPU_TO_LE32 (gpt->HeaderSize) != pth_get_size_static (
+ disk->dev)) {
+ if (ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("The format of the GPT partition table is version "
+ "%x, which is newer than what Parted can "
+ "recognise. Please tell us! bug-parted@gnu.org"),
+ PED_CPU_TO_LE32 (gpt->Revision))
+ != PED_EXCEPTION_IGNORE)
+ return 0;
+ }
+#endif
+
+ first_usable = PED_CPU_TO_LE64 (gpt->FirstUsableLBA);
+ last_usable = PED_CPU_TO_LE64 (gpt->LastUsableLBA);
+
+
+/*
+ Need to check whether the volume has grown, the LastUsableLBA is
+ normally set to disk->dev->length - 2 - ptes_size (at least for parted
+ created volumes), where ptes_size is the number of entries *
+ size of each entry / sector size or 16k / sector size, whatever the greater.
+ If the volume has grown, offer the user the chance to use the new
+ space or continue with the current usable area. Only ask once per
+ parted invocation.
+*/
+
+ last_usable_if_grown
+ = PED_CPU_TO_LE64 (disk->dev->length - 2 -
+ ((PedSector)(PED_CPU_TO_LE32(gpt->NumberOfPartitionEntries)) *
+ (PedSector)(PED_CPU_TO_LE32(gpt->SizeOfPartitionEntry)) /
+ disk->dev->sector_size));
+
+ last_usable_min_default = disk->dev->length - 2 -
+ GPT_DEFAULT_PARTITION_ENTRY_ARRAY_SIZE / disk->dev->sector_size;
+
+ if ( last_usable_if_grown > last_usable_min_default ) {
+
+ last_usable_if_grown = last_usable_min_default;
+ }
+
+
+ PED_ASSERT (last_usable > first_usable, return 0);
+ PED_ASSERT (last_usable <= disk->dev->length, return 0);
+
+ PED_ASSERT (last_usable_if_grown > first_usable, return 0);
+ PED_ASSERT (last_usable_if_grown <= disk->dev->length, return 0);
+
+ if ( !asked_already && last_usable < last_usable_if_grown ) {
+
+ PedExceptionOption q;
+
+ q = ped_exception_throw (PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_FIX | PED_EXCEPTION_IGNORE,
+ _("Not all of the space available to %s appears "
+ "to be used, you can fix the GPT to use all of the "
+ "space (an extra %llu blocks) or continue with the "
+ "current setting? "), disk->dev->path,
+ (uint64_t)(last_usable_if_grown - last_usable));
+
+
+ if (q == PED_EXCEPTION_FIX) {
+
+ last_usable = last_usable_if_grown;
+ *update_needed = 1;
+
+ }
+ else if (q != PED_EXCEPTION_UNHANDLED ) {
+
+ asked_already = 1;
+ }
+ }
+
+ ped_geometry_init (&gpt_disk_data->data_area, disk->dev,
+ first_usable, last_usable - first_usable + 1);
+
+
+ gpt_disk_data->entry_count
+ = PED_CPU_TO_LE32 (gpt->NumberOfPartitionEntries);
+ PED_ASSERT (gpt_disk_data->entry_count > 0, return 0);
+ PED_ASSERT (gpt_disk_data->entry_count <= 8192, return 0);
+
+ gpt_disk_data->uuid = gpt->DiskGUID;
+
+ return 1;
+}
+
+static PedPartition*
+_parse_part_entry (PedDisk* disk, GuidPartitionEntry_t* pte)
+{
+ PedPartition* part;
+ GPTPartitionData* gpt_part_data;
+ unsigned int i;
+
+ part = ped_partition_new (disk, 0, NULL,
+ PED_LE64_TO_CPU(pte->StartingLBA),
+ PED_LE64_TO_CPU(pte->EndingLBA));
+ if (!part)
+ return NULL;
+
+ gpt_part_data = part->disk_specific;
+ gpt_part_data->type = pte->PartitionTypeGuid;
+ gpt_part_data->uuid = pte->UniquePartitionGuid;
+ for (i = 0; i < 72 / sizeof (efi_char16_t); i++)
+ gpt_part_data->name[i] = (efi_char16_t) PED_LE16_TO_CPU(
+ (uint16_t) pte->PartitionName[i]);
+ gpt_part_data->name[i] = 0;
+
+ gpt_part_data->lvm = gpt_part_data->raid
+ = gpt_part_data->boot = gpt_part_data->hp_service
+ = gpt_part_data->hidden = gpt_part_data->msftres = 0;
+
+ if (pte->Attributes.RequiredToFunction & 0x1)
+ gpt_part_data->hidden = 1;
+
+ if (!guid_cmp (gpt_part_data->type, PARTITION_SYSTEM_GUID))
+ gpt_part_data->boot = 1;
+ else if (!guid_cmp (gpt_part_data->type, PARTITION_RAID_GUID))
+ gpt_part_data->raid = 1;
+ else if (!guid_cmp (gpt_part_data->type, PARTITION_LVM_GUID))
+ gpt_part_data->lvm = 1;
+ else if (!guid_cmp (gpt_part_data->type, PARTITION_HPSERVICE_GUID))
+ gpt_part_data->hp_service = 1;
+ else if (!guid_cmp (gpt_part_data->type, PARTITION_MSFT_RESERVED_GUID))
+ gpt_part_data->msftres = 1;
+
+ return part;
+}
+
+/************************************************************
+ * Intel is changing the EFI Spec. (after v1.02) to say that a
+ * disk is considered to have a GPT label only if the GPT
+ * structures are correct, and the MBR is actually a Protective
+ * MBR (has one 0xEE type partition).
+ * Problem occurs when a GPT-partitioned disk is then
+ * edited with a legacy (non-GPT-aware) application, such as
+ * fdisk (which doesn't generally erase the PGPT or AGPT).
+ * How should such a disk get handled? As a GPT disk (throwing
+ * away the fdisk changes), or as an MSDOS disk (throwing away
+ * the GPT information). Previously, I've taken the GPT-is-right,
+ * MBR is wrong, approach, to stay consistent with the EFI Spec.
+ * Intel disagrees, saying the disk should then be treated
+ * as having a msdos label, not a GPT label. If this is true,
+ * then what's the point of having an AGPT, since if the PGPT
+ * is screwed up, likely the PMBR is too, and the PMBR becomes
+ * a single point of failure.
+ * So, in the Linux kernel, I'm going to test for PMBR, and
+ * warn if it's not there, and treat the disk as MSDOS, with a note
+ * for users to use Parted to "fix up" their disk if they
+ * really want it to be considered GPT.
+ ************************************************************/
+static int
+gpt_read (PedDisk * disk)
+{
+ GPTDiskData *gpt_disk_data = disk->disk_specific;
+ GuidPartitionTableHeader_t* gpt;
+ GuidPartitionEntry_t* ptes;
+ int ptes_size;
+ int i;
+#ifndef DISCOVER_ONLY
+ int write_back = 0;
+#endif
+
+ ped_disk_delete_all (disk);
+
+ /*
+ * motivation: let the user decide about the pmbr... during
+ * ped_disk_probe(), they probably didn't get a choice...
+ */
+ if (!gpt_probe (disk->dev))
+ goto error;
+
+ if (_read_header (disk->dev, &gpt, 1)) {
+ PED_ASSERT ((PedSector) PED_LE64_TO_CPU (gpt->AlternateLBA)
+ <= disk->dev->length - 1, goto error_free_gpt);
+ if ((PedSector) PED_LE64_TO_CPU (gpt->AlternateLBA)
+ < disk->dev->length - 1) {
+ char* zeros = ped_malloc (pth_get_size (disk->dev));
+
+#ifndef DISCOVER_ONLY
+ if (ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_FIX | PED_EXCEPTION_CANCEL,
+ _("The backup GPT table is not at the end of the disk, as it "
+ "should be. This might mean that another operating system "
+ "believes the disk is smaller. Fix, by moving the backup "
+ "to the end (and removing the old backup)?"))
+ == PED_EXCEPTION_CANCEL)
+ goto error_free_gpt;
+
+ write_back = 1;
+ memset (zeros, 0, disk->dev->sector_size);
+ ped_device_write (disk->dev, zeros,
+ PED_LE64_TO_CPU (gpt->AlternateLBA),
+ 1);
+#endif /* !DISCOVER_ONLY */
+ }
+ } else { /* primary GPT *not* ok */
+ int alternate_ok = 0;
+
+#ifndef DISCOVER_ONLY
+ write_back = 1;
+#endif
+
+ if ((PedSector) PED_LE64_TO_CPU (gpt->AlternateLBA)
+ < disk->dev->length - 1) {
+ alternate_ok = _read_header (disk->dev, &gpt,
+ PED_LE64_TO_CPU(gpt->AlternateLBA));
+ }
+ if (!alternate_ok) {
+ alternate_ok = _read_header (disk->dev, &gpt,
+ disk->dev->length - 1);
+ }
+
+ if (alternate_ok) {
+ if (ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_OK_CANCEL,
+ _("The primary GPT table is corrupt, but the "
+ "backup appears OK, so that will be used."))
+ == PED_EXCEPTION_CANCEL)
+ goto error_free_gpt;
+ } else {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Both the primary and backup GPT tables "
+ "are corrupt. Try making a fresh table, "
+ "and using Parted's rescue feature to "
+ "recover partitions."));
+ goto error;
+ }
+ }
+
+ if (!_parse_header (disk, gpt, &write_back))
+ goto error_free_gpt;
+
+
+ ptes_size = sizeof (GuidPartitionEntry_t) * gpt_disk_data->entry_count;
+ ptes = (GuidPartitionEntry_t*) ped_malloc (ptes_size);
+ if (!ped_device_read (disk->dev, ptes,
+ PED_LE64_TO_CPU(gpt->PartitionEntryLBA),
+ ptes_size / disk->dev->sector_size))
+ goto error_free_ptes;
+
+ for (i = 0; i < gpt_disk_data->entry_count; i++) {
+ PedPartition* part;
+ PedConstraint* constraint_exact;
+
+ if (!guid_cmp (ptes[i].PartitionTypeGuid, UNUSED_ENTRY_GUID))
+ continue;
+
+ part = _parse_part_entry (disk, &ptes[i]);
+ if (!part)
+ goto error_delete_all;
+
+ part->fs_type = ped_file_system_probe (&part->geom);
+ part->num = i + 1;
+
+ constraint_exact = ped_constraint_exact (&part->geom);
+ if (!ped_disk_add_partition(disk, part, constraint_exact)) {
+ ped_partition_destroy (part);
+ goto error_delete_all;
+ }
+ ped_constraint_destroy (constraint_exact);
+ }
+ ped_free (ptes);
+
+#ifndef DISCOVER_ONLY
+ if (write_back)
+ ped_disk_commit_to_dev (disk);
+#endif
+
+ return 1;
+
+error_delete_all:
+ ped_disk_delete_all (disk);
+error_free_ptes:
+ ped_free (ptes);
+error_free_gpt:
+ pth_free (gpt);
+error:
+ return 0;
+}
+
+#ifndef DISCOVER_ONLY
+/* Writes the protective MBR (to keep DOS happy) */
+static int
+_write_pmbr (PedDevice * dev)
+{
+ LegacyMBR_t pmbr;
+
+ memset(&pmbr, 0, sizeof(pmbr));
+ pmbr.Signature = PED_CPU_TO_LE16(MSDOS_MBR_SIGNATURE);
+ pmbr.PartitionRecord[0].OSType = EFI_PMBR_OSTYPE_EFI;
+ pmbr.PartitionRecord[0].StartSector = 1;
+ pmbr.PartitionRecord[0].EndHead = 0xFE;
+ pmbr.PartitionRecord[0].EndSector = 0xFF;
+ pmbr.PartitionRecord[0].EndTrack = 0xFF;
+ pmbr.PartitionRecord[0].StartingLBA = PED_CPU_TO_LE32(1);
+ if ((dev->length - 1ULL) > 0xFFFFFFFFULL)
+ pmbr.PartitionRecord[0].SizeInLBA = PED_CPU_TO_LE32(0xFFFFFFFF);
+ else
+ pmbr.PartitionRecord[0].SizeInLBA = PED_CPU_TO_LE32(dev->length - 1UL);
+
+ return ped_device_write (dev, &pmbr, GPT_PMBR_LBA, GPT_PMBR_SECTORS);
+}
+
+static void
+_generate_header (PedDisk* disk, int alternate, uint32_t ptes_crc,
+ GuidPartitionTableHeader_t** gpt_p)
+{
+ GPTDiskData* gpt_disk_data = disk->disk_specific;
+ GuidPartitionTableHeader_t* gpt;
+
+ *gpt_p = pth_new_zeroed (disk->dev);
+
+ gpt = *gpt_p;
+
+ gpt->Signature = PED_CPU_TO_LE64 (GPT_HEADER_SIGNATURE);
+ gpt->Revision = PED_CPU_TO_LE32 (GPT_HEADER_REVISION_V1_00);
+
+ /* per 1.00 spec */
+ gpt->HeaderSize = PED_CPU_TO_LE32 (pth_get_size_static (disk->dev));
+ gpt->HeaderCRC32 = 0;
+ gpt->Reserved1 = 0;
+
+ if (alternate) {
+ PedSector ptes_size = gpt_disk_data->entry_count
+ * sizeof (GuidPartitionEntry_t) / disk->dev->sector_size;
+
+ gpt->MyLBA = PED_CPU_TO_LE64 (disk->dev->length - 1);
+ gpt->AlternateLBA = PED_CPU_TO_LE64 (1);
+ gpt->PartitionEntryLBA
+ = PED_CPU_TO_LE64 (disk->dev->length - 1 - ptes_size);
+ } else {
+ gpt->MyLBA = PED_CPU_TO_LE64 (1);
+ gpt->AlternateLBA = PED_CPU_TO_LE64 (disk->dev->length - 1);
+ gpt->PartitionEntryLBA = PED_CPU_TO_LE64 (2);
+ }
+
+ gpt->FirstUsableLBA = PED_CPU_TO_LE64 (gpt_disk_data->data_area.start);
+ gpt->LastUsableLBA = PED_CPU_TO_LE64 (gpt_disk_data->data_area.end);
+ gpt->DiskGUID = gpt_disk_data->uuid;
+ gpt->NumberOfPartitionEntries
+ = PED_CPU_TO_LE32 (gpt_disk_data->entry_count);
+ gpt->SizeOfPartitionEntry
+ = PED_CPU_TO_LE32 (sizeof (GuidPartitionEntry_t));
+ gpt->PartitionEntryArrayCRC32 = PED_CPU_TO_LE32 (ptes_crc);
+ gpt->HeaderCRC32 = PED_CPU_TO_LE32 (pth_crc32 (disk->dev, gpt));
+}
+
+static void
+_partition_generate_part_entry (PedPartition* part, GuidPartitionEntry_t* pte)
+{
+ GPTPartitionData* gpt_part_data = part->disk_specific;
+ unsigned int i;
+
+ PED_ASSERT (gpt_part_data != NULL, return);
+
+ pte->PartitionTypeGuid = gpt_part_data->type;
+ pte->UniquePartitionGuid = gpt_part_data->uuid;
+ pte->StartingLBA = PED_CPU_TO_LE64(part->geom.start);
+ pte->EndingLBA = PED_CPU_TO_LE64(part->geom.end);
+ memset (&pte->Attributes, 0, sizeof (GuidPartitionEntryAttributes_t));
+
+ if (gpt_part_data->hidden)
+ pte->Attributes.RequiredToFunction = 1;
+
+ for (i = 0; i < 72 / sizeof(efi_char16_t); i++)
+ pte->PartitionName[i]
+ = (efi_char16_t) PED_CPU_TO_LE16(
+ (uint16_t) gpt_part_data->name[i]);
+}
+
+static int
+gpt_write(PedDisk * disk)
+{
+ GPTDiskData* gpt_disk_data;
+ GuidPartitionEntry_t* ptes;
+ uint32_t ptes_crc;
+ uint8_t* pth_raw = ped_malloc (pth_get_size (disk->dev));
+ GuidPartitionTableHeader_t* gpt;
+ PedPartition* part;
+ int ptes_size;
+ unsigned int i;
+
+ PED_ASSERT (disk != NULL, goto error);
+ PED_ASSERT (disk->dev != NULL, goto error);
+ PED_ASSERT (disk->disk_specific != NULL, goto error);
+
+ gpt_disk_data = disk->disk_specific;
+
+ ptes_size = sizeof (GuidPartitionEntry_t) * gpt_disk_data->entry_count;
+ ptes = (GuidPartitionEntry_t*) ped_malloc (ptes_size);
+ if (!ptes)
+ goto error;
+ memset (ptes, 0, ptes_size);
+ for (part = ped_disk_next_partition (disk, NULL); part;
+ part = ped_disk_next_partition (disk, part)) {
+ if (part->type != 0)
+ continue;
+ _partition_generate_part_entry (part, &ptes[part->num - 1]);
+ }
+
+ ptes_crc = efi_crc32 (ptes, ptes_size);
+
+ /* Write protective MBR */
+ if (!_write_pmbr (disk->dev))
+ goto error_free_ptes;
+
+ /* Write PTH and PTEs */
+ _generate_header (disk, 0, ptes_crc, &gpt);
+ pth_raw = pth_get_raw (disk->dev, gpt);
+ if (!ped_device_write (disk->dev, pth_raw, 1, 1))
+ goto error_free_ptes;
+ if (!ped_device_write (disk->dev, ptes, 2, ptes_size / disk->dev->sector_size))
+ goto error_free_ptes;
+
+ /* Write Alternate PTH & PTEs */
+ _generate_header (disk, 1, ptes_crc, &gpt);
+ pth_raw = pth_get_raw (disk->dev, gpt);
+ if (!ped_device_write (disk->dev, pth_raw, disk->dev->length - 1, 1))
+ goto error_free_ptes;
+ if (!ped_device_write (disk->dev, ptes,
+ disk->dev->length - 1 - ptes_size / disk->dev->sector_size,
+ ptes_size / disk->dev->sector_size))
+ goto error_free_ptes;
+
+ ped_free (ptes);
+ return ped_device_sync (disk->dev);
+
+error_free_ptes:
+ ped_free (ptes);
+error:
+ return 0;
+}
+#endif /* !DISCOVER_ONLY */
+
+static int
+add_metadata_part(PedDisk * disk, PedSector start, PedSector length)
+{
+ PedPartition* part;
+ PedConstraint* constraint_exact;
+ PED_ASSERT(disk != NULL, return 0);
+
+ part = ped_partition_new (disk, PED_PARTITION_METADATA, NULL,
+ start, start + length - 1);
+ if (!part)
+ goto error;
+
+ constraint_exact = ped_constraint_exact (&part->geom);
+ if (!ped_disk_add_partition (disk, part, constraint_exact))
+ goto error_destroy_constraint;
+ ped_constraint_destroy (constraint_exact);
+ return 1;
+
+error_destroy_constraint:
+ ped_constraint_destroy (constraint_exact);
+error_destroy_part:
+ ped_partition_destroy (part);
+error:
+ return 0;
+}
+
+static PedPartition*
+gpt_partition_new (const PedDisk* disk,
+ PedPartitionType part_type, const PedFileSystemType* fs_type,
+ PedSector start, PedSector end)
+{
+ PedPartition* part;
+ GPTPartitionData* gpt_part_data;
+
+ part = _ped_partition_alloc (disk, part_type, fs_type, start, end);
+ if (!part)
+ goto error;
+
+ if (part_type != 0)
+ return part;
+
+ gpt_part_data = part->disk_specific =
+ ped_malloc (sizeof (GPTPartitionData));
+ if (!gpt_part_data)
+ goto error_free_part;
+
+ gpt_part_data->type = PARTITION_BASIC_DATA_GUID;
+ gpt_part_data->lvm = 0;
+ gpt_part_data->raid = 0;
+ gpt_part_data->boot = 0;
+ gpt_part_data->hp_service = 0;
+ gpt_part_data->hidden = 0;
+ gpt_part_data->msftres = 0;
+ uuid_generate ((unsigned char*) &gpt_part_data->uuid);
+ swap_uuid_and_efi_guid((unsigned char*)(&gpt_part_data->uuid));
+ strcpy (gpt_part_data->name, "");
+ return part;
+
+error_free_part:
+ _ped_partition_free (part);
+error:
+ return NULL;
+}
+
+static PedPartition*
+gpt_partition_duplicate (const PedPartition* part)
+{
+ PedPartition* result;
+ GPTPartitionData* part_data = part->disk_specific;
+ GPTPartitionData* result_data;
+
+ result = _ped_partition_alloc (part->disk, part->type, part->fs_type,
+ part->geom.start, part->geom.end);
+ if (!result)
+ goto error;
+ result->num = part->num;
+
+ if (result->type != 0)
+ return result;
+
+ result_data = result->disk_specific =
+ ped_malloc (sizeof (GPTPartitionData));
+ if (!result_data)
+ goto error_free_part;
+
+ result_data->type = part_data->type;
+ result_data->uuid = part_data->uuid;
+ strcpy (result_data->name, part_data->name);
+ return result;
+
+error_free_part:
+ _ped_partition_free (result);
+error:
+ return NULL;
+}
+
+static void
+gpt_partition_destroy (PedPartition *part)
+{
+ if (part->type == 0) {
+ PED_ASSERT (part->disk_specific != NULL, return);
+ ped_free (part->disk_specific);
+ }
+
+ _ped_partition_free (part);
+}
+
+static int
+gpt_partition_set_system (PedPartition* part, const PedFileSystemType* fs_type)
+{
+ GPTPartitionData* gpt_part_data = part->disk_specific;
+
+ PED_ASSERT (gpt_part_data != NULL, return 0);
+
+ part->fs_type = fs_type;
+
+ if (gpt_part_data->lvm) {
+ gpt_part_data->type = PARTITION_LVM_GUID;
+ return 1;
+ }
+ if (gpt_part_data->raid) {
+ gpt_part_data->type = PARTITION_RAID_GUID;
+ return 1;
+ }
+ if (gpt_part_data->boot) {
+ gpt_part_data->type = PARTITION_SYSTEM_GUID;
+ return 1;
+ }
+ if (gpt_part_data->hp_service) {
+ gpt_part_data->type = PARTITION_HPSERVICE_GUID;
+ return 1;
+ }
+ if (gpt_part_data->msftres) {
+ gpt_part_data->type = PARTITION_MSFT_RESERVED_GUID;
+ return 1;
+ }
+
+ if (fs_type) {
+ if (strncmp (fs_type->name, "fat", 3) == 0
+ || strcmp (fs_type->name, "ntfs") == 0) {
+ gpt_part_data->type = PARTITION_MSFT_RESERVED_GUID;
+ return 1;
+ }
+ if (strncmp (fs_type->name, "hfs", 3) == 0) {
+ gpt_part_data->type = PARTITION_APPLE_HFS_GUID;
+ return 1;
+ }
+ if (strstr (fs_type->name, "swap")) {
+ gpt_part_data->type = PARTITION_SWAP_GUID;
+ return 1;
+ }
+ }
+
+ gpt_part_data->type = PARTITION_BASIC_DATA_GUID;
+ return 1;
+}
+
+/* Allocate metadata partitions for the GPTH and PTES */
+static int
+gpt_alloc_metadata (PedDisk * disk)
+{
+ PedSector gptlength, pteslength = 0;
+ GPTDiskData *gpt_disk_data;
+
+ PED_ASSERT(disk != NULL, return 0);
+ PED_ASSERT(disk->dev != NULL, return 0);
+ PED_ASSERT(disk->disk_specific != NULL, return 0);
+ gpt_disk_data = disk->disk_specific;
+
+ gptlength = ped_div_round_up (sizeof (GuidPartitionTableHeader_t),
+ disk->dev->sector_size);
+ pteslength = ped_div_round_up (gpt_disk_data->entry_count
+ * sizeof (GuidPartitionEntry_t), disk->dev->sector_size);
+
+ /* metadata at the start of the disk includes the MBR */
+ if (!add_metadata_part(disk, GPT_PMBR_LBA,
+ GPT_PMBR_SECTORS + gptlength + pteslength))
+ return 0;
+
+ /* metadata at the end of the disk */
+ if (!add_metadata_part(disk, disk->dev->length - gptlength - pteslength,
+ gptlength + pteslength))
+ return 0;
+
+ return 1;
+}
+
+/* Does nothing, as the read/new/destroy functions maintain part->num */
+static int
+gpt_partition_enumerate (PedPartition* part)
+{
+ GPTDiskData* gpt_disk_data = part->disk->disk_specific;
+ int i;
+
+ /* never change the partition numbers */
+ if (part->num != -1)
+ return 1;
+
+ for (i = 1; i <= gpt_disk_data->entry_count; i++) {
+ if (!ped_disk_get_partition (part->disk, i)) {
+ part->num = i;
+ return 1;
+ }
+ }
+
+ PED_ASSERT (0, return 0); return 0;
+}
+
+static int
+gpt_partition_set_flag(PedPartition *part,
+ PedPartitionFlag flag,
+ int state)
+{
+ GPTPartitionData *gpt_part_data;
+ PED_ASSERT(part != NULL, return 0);
+ PED_ASSERT(part->disk_specific != NULL, return 0);
+ gpt_part_data = part->disk_specific;
+
+ switch (flag) {
+ case PED_PARTITION_BOOT:
+ gpt_part_data->boot = state;
+ if (state)
+ gpt_part_data->raid
+ = gpt_part_data->lvm
+ = gpt_part_data->hp_service
+ = gpt_part_data->msftres = 0;
+ return gpt_partition_set_system (part, part->fs_type);
+ case PED_PARTITION_RAID:
+ gpt_part_data->raid = state;
+ if (state)
+ gpt_part_data->boot
+ = gpt_part_data->lvm
+ = gpt_part_data->hp_service
+ = gpt_part_data->msftres = 0;
+ return gpt_partition_set_system (part, part->fs_type);
+ case PED_PARTITION_LVM:
+ gpt_part_data->lvm = state;
+ if (state)
+ gpt_part_data->boot
+ = gpt_part_data->raid
+ = gpt_part_data->hp_service
+ = gpt_part_data->msftres = 0;
+ return gpt_partition_set_system (part, part->fs_type);
+ case PED_PARTITION_HPSERVICE:
+ gpt_part_data->hp_service = state;
+ if (state)
+ gpt_part_data->boot
+ = gpt_part_data->raid
+ = gpt_part_data->lvm
+ = gpt_part_data->msftres = 0;
+ return gpt_partition_set_system (part, part->fs_type);
+ case PED_PARTITION_MSFT_RESERVED:
+ gpt_part_data->msftres = state;
+ if (state)
+ gpt_part_data->boot
+ = gpt_part_data->raid
+ = gpt_part_data->lvm
+ = gpt_part_data->hp_service = 0;
+ return gpt_partition_set_system (part, part->fs_type);
+ case PED_PARTITION_HIDDEN:
+ gpt_part_data->hidden = state;
+ return 1;
+ case PED_PARTITION_SWAP:
+ case PED_PARTITION_ROOT:
+ case PED_PARTITION_LBA:
+ default:
+ return 0;
+ }
+ return 1;
+}
+
+static int
+gpt_partition_get_flag(const PedPartition *part, PedPartitionFlag flag)
+{
+ GPTPartitionData *gpt_part_data;
+ PED_ASSERT(part->disk_specific != NULL, return 0);
+ gpt_part_data = part->disk_specific;
+
+ switch (flag) {
+ case PED_PARTITION_RAID:
+ return gpt_part_data->raid;
+ case PED_PARTITION_LVM:
+ return gpt_part_data->lvm;
+ case PED_PARTITION_BOOT:
+ return gpt_part_data->boot;
+ case PED_PARTITION_HPSERVICE:
+ return gpt_part_data->hp_service;
+ case PED_PARTITION_MSFT_RESERVED:
+ return gpt_part_data->msftres;
+ case PED_PARTITION_HIDDEN:
+ return gpt_part_data->hidden;
+ case PED_PARTITION_SWAP:
+ case PED_PARTITION_LBA:
+ case PED_PARTITION_ROOT:
+ default:
+ return 0;
+ }
+ return 0;
+}
+
+static int
+gpt_partition_is_flag_available(const PedPartition * part,
+ PedPartitionFlag flag)
+{
+ switch (flag) {
+ case PED_PARTITION_RAID:
+ case PED_PARTITION_LVM:
+ case PED_PARTITION_BOOT:
+ case PED_PARTITION_HPSERVICE:
+ case PED_PARTITION_MSFT_RESERVED:
+ case PED_PARTITION_HIDDEN:
+ return 1;
+ case PED_PARTITION_SWAP:
+ case PED_PARTITION_ROOT:
+ case PED_PARTITION_LBA:
+ default:
+ return 0;
+ }
+ return 0;
+}
+
+static void
+gpt_partition_set_name (PedPartition *part, const char *name)
+{
+ GPTPartitionData *gpt_part_data = part->disk_specific;
+
+ strncpy (gpt_part_data->name, name, 36);
+ gpt_part_data->name [36] = 0;
+}
+
+static const char *
+gpt_partition_get_name (const PedPartition * part)
+{
+ GPTPartitionData* gpt_part_data = part->disk_specific;
+ return gpt_part_data->name;
+}
+
+static int
+gpt_get_max_primary_partition_count (const PedDisk *disk)
+{
+ const GPTDiskData* gpt_disk_data = disk->disk_specific;
+ return gpt_disk_data->entry_count;
+}
+
+static PedConstraint*
+_non_metadata_constraint (const PedDisk* disk)
+{
+ GPTDiskData* gpt_disk_data = disk->disk_specific;
+
+ return ped_constraint_new_from_max (&gpt_disk_data->data_area);
+}
+
+static int
+gpt_partition_align (PedPartition* part, const PedConstraint* constraint)
+{
+ PED_ASSERT (part != NULL, return 0);
+
+ if (_ped_partition_attempt_align (part, constraint,
+ _non_metadata_constraint (part->disk)))
+ return 1;
+
+#ifndef DISCOVER_ONLY
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Unable to satisfy all constraints on the partition."));
+#endif
+ return 0;
+}
+
+static PedDiskOps gpt_disk_ops = {
+ probe: gpt_probe,
+#ifndef DISCOVER_ONLY
+ clobber: gpt_clobber,
+#else
+ clobber: NULL,
+#endif
+ alloc: gpt_alloc,
+ duplicate: gpt_duplicate,
+ free: gpt_free,
+ read: gpt_read,
+#ifndef DISCOVER_ONLY
+ write: gpt_write,
+#else
+ write: NULL,
+#endif
+ partition_new: gpt_partition_new,
+ partition_duplicate: gpt_partition_duplicate,
+ partition_destroy: gpt_partition_destroy,
+ partition_set_system: gpt_partition_set_system,
+ partition_set_flag: gpt_partition_set_flag,
+ partition_get_flag: gpt_partition_get_flag,
+ partition_is_flag_available: gpt_partition_is_flag_available,
+ partition_set_name: gpt_partition_set_name,
+ partition_get_name: gpt_partition_get_name,
+ partition_align: gpt_partition_align,
+ partition_enumerate: gpt_partition_enumerate,
+ alloc_metadata: gpt_alloc_metadata,
+ get_max_primary_partition_count: gpt_get_max_primary_partition_count
+};
+
+static PedDiskType gpt_disk_type = {
+ next: NULL,
+ name: "gpt",
+ ops: &gpt_disk_ops,
+ features: PED_DISK_TYPE_PARTITION_NAME
+};
+
+void
+ped_disk_gpt_init()
+{
+ PED_ASSERT(sizeof(GuidPartitionEntryAttributes_t) == 8, return);
+ PED_ASSERT(sizeof(GuidPartitionEntry_t) == 128, return);
+
+ ped_register_disk_type(&gpt_disk_type);
+}
+
+void
+ped_disk_gpt_done()
+{
+ ped_unregister_disk_type(&gpt_disk_type);
+}
+
diff --git a/libparted/labels/loop.c b/libparted/labels/loop.c
new file mode 100644
index 0000000..272d61b
--- /dev/null
+++ b/libparted/labels/loop.c
@@ -0,0 +1,338 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#include "config.h"
+
+#include <parted/parted.h>
+#include <parted/debug.h>
+#include <parted/endian.h>
+#include <string.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+#define LOOP_SIGNATURE "GNU Parted Loopback 0"
+
+static PedDiskType loop_disk_type;
+
+static PedDisk* loop_alloc (const PedDevice* dev);
+static void loop_free (PedDisk* disk);
+
+static int
+loop_probe (const PedDevice* dev)
+{
+ PedDisk* disk;
+ char buf [512];
+ int result;
+
+ if (dev->sector_size != 512)
+ return 0;
+
+ disk = loop_alloc (dev);
+ if (!disk)
+ goto error;
+
+ if (!ped_device_read (dev, buf, 0, 1))
+ goto error_destroy_disk;
+ if (strncmp (buf, LOOP_SIGNATURE, strlen (LOOP_SIGNATURE)) == 0) {
+ result = 1;
+ } else {
+ PedGeometry* geom;
+
+ geom = ped_geometry_new (dev, 0, disk->dev->length);
+ if (!geom)
+ goto error_destroy_disk;
+ result = ped_file_system_probe (geom) != NULL;
+ ped_geometry_destroy (geom);
+ }
+ loop_free (disk);
+ return result;
+
+error_destroy_disk:
+ loop_free (disk);
+error:
+ return 0;
+}
+
+#ifndef DISCOVER_ONLY
+static int
+loop_clobber (PedDevice* dev)
+{
+ char buf [512];
+ PedSector i = 0;
+
+ PED_ASSERT (dev != NULL, return 0);
+
+ memset (buf, 0, 512);
+
+ while (loop_probe (dev)) {
+ if (!ped_device_write (dev, buf, i++, 1))
+ return 0;
+ }
+ return 1;
+}
+#endif /* !DISCOVER_ONLY */
+
+static PedDisk*
+loop_alloc (const PedDevice* dev)
+{
+ PedDisk* disk;
+
+ PED_ASSERT (dev != NULL, return 0);
+
+ if (dev->length < 256)
+ return NULL;
+ return _ped_disk_alloc ((PedDevice*)dev, &loop_disk_type);
+}
+
+static PedDisk*
+loop_duplicate (const PedDisk* disk)
+{
+ return ped_disk_new_fresh (disk->dev, &loop_disk_type);
+}
+
+static void
+loop_free (PedDisk* disk)
+{
+ PED_ASSERT (disk != NULL, return);
+
+ _ped_disk_free (disk);
+}
+
+static int
+loop_read (PedDisk* disk)
+{
+ PedDevice* dev = NULL;
+ char buf [512];
+ PedGeometry* geom;
+ PedFileSystemType* fs_type;
+ PedPartition* part;
+ PedConstraint* constraint_any;
+
+ PED_ASSERT (disk != NULL, return 0);
+ dev = disk->dev;
+ constraint_any = ped_constraint_any (dev);
+
+ ped_disk_delete_all (disk);
+
+ if (!ped_device_read (dev, buf, 0, 1))
+ goto error;
+ if (!strncmp (buf, LOOP_SIGNATURE, strlen (LOOP_SIGNATURE)))
+ return 1;
+
+ geom = ped_geometry_new (dev, 0, dev->length);
+ if (!geom)
+ goto error;
+
+ fs_type = ped_file_system_probe (geom);
+ if (!fs_type)
+ goto error_free_geom;
+
+ part = ped_partition_new (disk, 0, fs_type, geom->start, geom->end);
+ ped_geometry_destroy (geom);
+ if (!part)
+ goto error;
+ part->fs_type = fs_type;
+
+ if (!ped_disk_add_partition (disk, part, constraint_any))
+ goto error;
+ ped_constraint_destroy (constraint_any);
+ return 1;
+
+error_free_geom:
+ ped_geometry_destroy (geom);
+error:
+ ped_constraint_destroy (constraint_any);
+ return 0;
+}
+
+#ifndef DISCOVER_ONLY
+static int
+loop_write (PedDisk* disk)
+{
+ char buf [512];
+
+ if (ped_disk_get_partition (disk, 1)) {
+ if (!ped_device_read (disk->dev, buf, 0, 1))
+ return 0;
+ if (strncmp (buf, LOOP_SIGNATURE, strlen (LOOP_SIGNATURE)) != 0)
+ return 1;
+ memset (buf, 0, strlen (LOOP_SIGNATURE));
+ return ped_device_write (disk->dev, buf, 0, 1);
+ }
+
+ memset (buf, 0, 512);
+ strcpy (buf, LOOP_SIGNATURE);
+
+ return ped_device_write (disk->dev, buf, 0, 1);
+}
+#endif /* !DISCOVER_ONLY */
+
+static PedPartition*
+loop_partition_new (const PedDisk* disk, PedPartitionType part_type,
+ const PedFileSystemType* fs_type,
+ PedSector start, PedSector end)
+{
+ PedPartition* part;
+
+ part = _ped_partition_alloc (disk, part_type, fs_type, start, end);
+ if (!part)
+ return NULL;
+ part->disk_specific = NULL;
+ return part;
+}
+
+static PedPartition*
+loop_partition_duplicate (const PedPartition* part)
+{
+ PedPartition* result;
+
+ result = ped_partition_new (part->disk, part->type, part->fs_type,
+ part->geom.start, part->geom.end);
+ result->num = part->num;
+ return result;
+}
+
+static void
+loop_partition_destroy (PedPartition* part)
+{
+ ped_free (part);
+}
+
+static int
+loop_partition_set_system (PedPartition* part, const PedFileSystemType* fs_type)
+{
+ part->fs_type = fs_type;
+ return 1;
+}
+
+static int
+loop_partition_set_flag (PedPartition* part, PedPartitionFlag flag, int state)
+{
+ return 0;
+}
+
+static int
+loop_partition_get_flag (const PedPartition* part, PedPartitionFlag flag)
+{
+ return 0;
+}
+
+static int
+loop_partition_align (PedPartition* part, const PedConstraint* constraint)
+{
+ PedGeometry* new_geom;
+
+ new_geom = ped_constraint_solve_nearest (constraint, &part->geom);
+ if (!new_geom) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Unable to satisfy all constraints on the "
+ "partition."));
+ return 0;
+ }
+ ped_geometry_set (&part->geom, new_geom->start, new_geom->length);
+ ped_geometry_destroy (new_geom);
+ return 1;
+}
+
+static int
+loop_partition_is_flag_available (const PedPartition* part,
+ PedPartitionFlag flag)
+{
+ return 0;
+}
+
+static int
+loop_partition_enumerate (PedPartition* part)
+{
+ part->num = 1;
+ return 1;
+}
+
+static int
+loop_alloc_metadata (PedDisk* disk)
+{
+ return 1;
+}
+
+static int
+loop_get_max_primary_partition_count (const PedDisk* disk)
+{
+ return 1;
+}
+
+static PedDiskOps loop_disk_ops = {
+ probe: loop_probe,
+#ifndef DISCOVER_ONLY
+ clobber: loop_clobber,
+#else
+ clobber: NULL,
+#endif
+ alloc: loop_alloc,
+ duplicate: loop_duplicate,
+ free: loop_free,
+ read: loop_read,
+#ifndef DISCOVER_ONLY
+ write: loop_write,
+#else
+ write: NULL,
+#endif
+
+ partition_new: loop_partition_new,
+ partition_duplicate: loop_partition_duplicate,
+ partition_destroy: loop_partition_destroy,
+ partition_set_system: loop_partition_set_system,
+ partition_set_flag: loop_partition_set_flag,
+ partition_get_flag: loop_partition_get_flag,
+ partition_is_flag_available: loop_partition_is_flag_available,
+ partition_set_name: NULL,
+ partition_get_name: NULL,
+ partition_align: loop_partition_align,
+ partition_enumerate: loop_partition_enumerate,
+
+ alloc_metadata: loop_alloc_metadata,
+ get_max_primary_partition_count:
+ loop_get_max_primary_partition_count
+};
+
+static PedDiskType loop_disk_type = {
+ next: NULL,
+ name: "loop",
+ ops: &loop_disk_ops,
+ features: 0
+};
+
+void
+ped_disk_loop_init ()
+{
+ ped_register_disk_type (&loop_disk_type);
+}
+
+void
+ped_disk_loop_done ()
+{
+ ped_unregister_disk_type (&loop_disk_type);
+}
+
diff --git a/libparted/labels/mac.c b/libparted/labels/mac.c
new file mode 100644
index 0000000..d642e3c
--- /dev/null
+++ b/libparted/labels/mac.c
@@ -0,0 +1,1616 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#include "config.h"
+
+#include <parted/parted.h>
+#include <parted/debug.h>
+#include <parted/endian.h>
+#include <string.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+/* struct's hacked from Linux source: fs/partitions/mac.h
+ * I believe it was originally written by Paul Mackerras (from comments in
+ * Quik source)
+ *
+ * See also:
+ * http://developer.apple.com/documentation/mac/Devices/Devices-126.html
+ * http://developer.apple.com/documentation/mac/Devices/Devices-121.html
+ * http://devworld.apple.com/technotes/tn/tn1189.html
+ *
+ * Partition types:
+ * Apple_Bootstrap new-world (HFS) boot partition
+ * Apple_partition_map partition map (table)
+ * Apple_Driver device driver
+ * Apple_Driver43 SCSI Manager 4.3 device driver
+ * Apple_MFS original Macintosh File System
+ * Apple_HFS Hierarchical File System (and +)
+ * Apple_HFSX HFS+ with case sensitivity and more
+ * Apple_UNIX_SVR2 UNIX file system (UFS?)
+ * Apple_PRODOS ProDOS file system
+ * Apple_Free unused space
+ * Apple_Scratch empty
+ * Apple_Void padding for iso9660
+ * Apple_Extra an unused partition map entry
+ *
+ * Quick explanation:
+ * ------------------
+ * Terminology:
+ *
+ * Parted Apple
+ * ------ -----
+ * device disk/device
+ * disk no equivalent.
+ * partition volume or partition
+ * sector block
+ *
+ * * All space must be accounted for, except block 0 (driver block) and
+ * block 1-X (the partition map: i.e. lots of MacRawPartitions)
+ *
+ * * It's really hard to grow/shrink the number of MacRawPartition
+ * entries in the partition map, because the first partition starts
+ * immediately after the partition map. When we can move the start of
+ * HFS and ext2 partitions, this problem will disappear ;-)
+ */
+
+#define MAC_PARTITION_MAGIC_1 0x5453 /* old */
+#define MAC_PARTITION_MAGIC_2 0x504d
+#define MAC_DISK_MAGIC 0x4552
+
+#define MAC_STATUS_BOOTABLE 8 /* partition is bootable */
+
+typedef struct {
+ uint16_t signature; /* expected to be MAC_PARTITION_MAGIC */
+ uint16_t res1;
+ uint32_t map_count; /* # blocks in partition map */
+ uint32_t start_block; /* absolute starting block # of partition */
+ uint32_t block_count; /* number of blocks in partition */
+ char name[32]; /* partition name */
+ char type[32]; /* string type description */
+ uint32_t data_start; /* rel block # of first data block */
+ uint32_t data_count; /* number of data blocks */
+ uint32_t status; /* partition status bits */
+ uint32_t boot_start;
+ uint32_t boot_count;
+ uint32_t boot_load;
+ uint32_t boot_load2;
+ uint32_t boot_entry;
+ uint32_t boot_entry2;
+ uint32_t boot_cksum;
+ char processor[16]; /* Contains 680x0, x=0,2,3,4; or empty */
+ uint32_t driver_sig;
+ char _padding[372];
+} __attribute__ ((packed)) MacRawPartition;
+
+/* Driver descriptor structure, in block 0 */
+typedef struct {
+ uint16_t signature; /* expected to be MAC_DRIVER_MAGIC */
+ uint16_t block_size; /* physical sector size */
+ uint32_t block_count; /* size of device in blocks */
+ uint16_t dev_type; /* reserved */
+ uint16_t dev_id; /* reserved */
+ uint32_t data; /* reserved */
+ uint16_t driver_count; /* # of driver descriptor entries */
+ uint8_t driverlist[488]; /* info about available drivers */
+ uint16_t padding[3]; /* pad to 512 bytes */
+} __attribute__ ((packed)) MacRawDisk;
+
+typedef struct {
+ uint32_t block; /* startblock in MacRawDisk->block_size units */
+ uint16_t size; /* size in 512 byte units */
+ uint16_t type; /* operating system type (MacOS = 1) */
+} __attribute__ ((packed)) MacDeviceDriver;
+
+typedef struct {
+ char volume_name[33]; /* eg: "Games" */
+ char system_name[33]; /* eg: "Apple_Unix_SVR2" */
+ char processor_name[17];
+
+ int is_boot;
+ int is_driver;
+ int has_driver;
+ int is_root;
+ int is_swap;
+ int is_lvm;
+ int is_raid;
+
+ PedSector data_region_length;
+ PedSector boot_region_length;
+
+ uint32_t boot_base_address;
+ uint32_t boot_entry_address;
+ uint32_t boot_checksum;
+
+ uint32_t status;
+ uint32_t driver_sig;
+} MacPartitionData;
+
+typedef struct {
+ int ghost_size; /* sectors per "driver" block */
+ int part_map_entry_count; /* # entries (incl. ghost) */
+ int part_map_entry_num; /* partition map location */
+
+ int active_part_entry_count; /* # real partitions */
+ int free_part_entry_count; /* # free space */
+ int last_part_entry_num; /* last entry number */
+
+ uint16_t block_size; /* physical sector size */
+ uint16_t driver_count;
+ MacDeviceDriver driverlist[1 + 60]; /* 488 bytes */
+} MacDiskData;
+
+static PedDiskType mac_disk_type;
+
+static int
+_check_signature (MacRawDisk* raw_disk)
+{
+ if (PED_BE16_TO_CPU (raw_disk->signature) != MAC_DISK_MAGIC) {
+#ifdef DISCOVER_ONLY
+ return 0;
+#else
+ return ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("Invalid signature %x for Mac disk labels."),
+ (int) PED_BE16_TO_CPU (raw_disk->signature))
+ == PED_EXCEPTION_IGNORE;
+#endif
+ }
+
+ return 1;
+}
+
+static int
+_rawpart_check_signature (MacRawPartition* raw_part)
+{
+ int sig = (int) PED_BE16_TO_CPU (raw_part->signature);
+ return sig == MAC_PARTITION_MAGIC_1 || sig == MAC_PARTITION_MAGIC_2;
+}
+
+static int
+mac_probe (const PedDevice * dev)
+{
+ MacRawDisk buf;
+
+ PED_ASSERT (dev != NULL, return 0);
+
+ if (dev->sector_size != 512)
+ return 0;
+
+ if (!ped_device_read (dev, &buf, 0, 1))
+ return 0;
+
+ return _check_signature (&buf);
+}
+
+static int
+_disk_add_part_map_entry (PedDisk* disk, int warn)
+{
+ MacDiskData* mac_disk_data = disk->disk_specific;
+ PedPartition* new_part;
+ MacPartitionData* mac_part_data;
+ PedSector part_map_size;
+ PedConstraint* constraint_any = ped_constraint_any (disk->dev);
+
+#ifndef DISCOVER_ONLY
+ if (warn && ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_FIX | PED_EXCEPTION_CANCEL,
+ _("Partition map has no partition map entry!"))
+ != PED_EXCEPTION_FIX)
+ goto error;
+#endif /* !DISCOVER_ONLY */
+
+ part_map_size
+ = ped_round_up_to (mac_disk_data->last_part_entry_num, 64);
+ if (part_map_size == 0)
+ part_map_size = 64;
+
+ new_part = ped_partition_new (disk, 0, NULL, 1, part_map_size - 1);
+ if (!new_part)
+ goto error;
+
+ mac_part_data = new_part->disk_specific;
+ strcpy (mac_part_data->volume_name, "Apple");
+ strcpy (mac_part_data->system_name, "Apple_partition_map");
+
+ if (!ped_disk_add_partition (disk, new_part, constraint_any))
+ goto error_destroy_new_part;
+
+ mac_disk_data->part_map_entry_num = new_part->num;
+ mac_disk_data->part_map_entry_count
+ = new_part->geom.end - mac_disk_data->ghost_size;
+ ped_constraint_destroy (constraint_any);
+ return 1;
+
+error_destroy_new_part:
+ ped_partition_destroy (new_part);
+error:
+ ped_constraint_destroy (constraint_any);
+ return 0;
+}
+
+PedDisk*
+mac_alloc (const PedDevice* dev)
+{
+ PedDisk* disk;
+ MacDiskData* mac_disk_data;
+
+ PED_ASSERT (dev != NULL, return NULL);
+
+#ifndef DISCOVER_ONLY
+ if (dev->length < 256) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("%s is too small for a Mac disk label!"),
+ dev->path);
+ goto error;
+ }
+#endif
+
+ disk = _ped_disk_alloc (dev, &mac_disk_type);
+ if (!disk)
+ goto error;
+
+ mac_disk_data = (MacDiskData*) ped_malloc (sizeof (MacDiskData));
+ if (!mac_disk_data)
+ goto error_free_disk;
+ disk->disk_specific = mac_disk_data;
+ mac_disk_data->ghost_size = disk->dev->sector_size / 512;
+ mac_disk_data->active_part_entry_count = 0;
+ mac_disk_data->free_part_entry_count = 1;
+ mac_disk_data->last_part_entry_num = 1;
+ mac_disk_data->block_size = 0;
+ mac_disk_data->driver_count = 0;
+ memset(&mac_disk_data->driverlist[0], 0, sizeof(mac_disk_data->driverlist));
+
+ if (!_disk_add_part_map_entry (disk, 0))
+ goto error_free_disk;
+ return disk;
+
+error_free_disk:
+ _ped_disk_free (disk);
+error:
+ return NULL;
+}
+
+static PedDisk*
+mac_duplicate (const PedDisk* disk)
+{
+ PedDisk* new_disk;
+ MacDiskData* new_mac_data;
+ MacDiskData* old_mac_data = (MacDiskData*) disk->disk_specific;
+ PedPartition* partition_map;
+
+ new_disk = ped_disk_new_fresh (disk->dev, &mac_disk_type);
+ if (!new_disk)
+ goto error;
+
+ new_mac_data = (MacDiskData*) new_disk->disk_specific;
+
+ /* remove the partition map partition - it will be duplicated
+ * later.
+ */
+ partition_map = ped_disk_get_partition_by_sector (new_disk, 1);
+ PED_ASSERT (partition_map != NULL, return 0);
+ ped_disk_remove_partition (new_disk, partition_map);
+
+ /* ugly, but C is ugly :p */
+ memcpy (new_mac_data, old_mac_data, sizeof (MacDiskData));
+ return new_disk;
+
+error_free_new_disk:
+ _ped_disk_free (new_disk);
+error:
+ return NULL;
+}
+
+static void
+mac_free (PedDisk* disk)
+{
+ MacDiskData* mac_disk_data = disk->disk_specific;
+
+ _ped_disk_free (disk);
+ ped_free (mac_disk_data);
+}
+
+#ifndef DISCOVER_ONLY
+static int
+_clobber_part_map (PedDevice* dev)
+{
+ MacRawPartition raw_part;
+ PedSector sector;
+
+ for (sector=1; 1; sector++) {
+ if (!ped_device_read (dev, &raw_part, sector, 1))
+ return 0;
+ if (!_rawpart_check_signature (&raw_part))
+ return 1;
+ memset (&raw_part, 0, 512);
+ if (!ped_device_write (dev, &raw_part, sector, 1))
+ return 0;
+ }
+}
+
+static int
+mac_clobber (PedDevice* dev)
+{
+ MacRawDisk raw_disk;
+
+ if (!ped_device_read (dev, &raw_disk, 0, 1))
+ return 0;
+ if (!_check_signature (&raw_disk))
+ return 0;
+ memset (&raw_disk, 0, 512);
+ if (!ped_device_write (dev, &raw_disk, 0, 1))
+ return 0;
+
+ return _clobber_part_map (dev);
+}
+#endif /* !DISCOVER_ONLY */
+
+static int
+_rawpart_cmp_type (MacRawPartition* raw_part, char* type)
+{
+ return strncasecmp (raw_part->type, type, 32) == 0;
+}
+
+static int
+_rawpart_cmp_name (MacRawPartition* raw_part, char* name)
+{
+ return strncasecmp (raw_part->name, name, 32) == 0;
+}
+
+static int
+_rawpart_is_partition_map (MacRawPartition* raw_part)
+{
+ return _rawpart_cmp_type (raw_part, "Apple_partition_map");
+}
+
+static int
+strncasestr (const char* haystack, const char* needle, int n)
+{
+ int needle_size = strlen (needle);
+ int i;
+
+ for (i = 0; haystack[i] && i < n - needle_size; i++) {
+ if (strncasecmp (haystack + i, needle, needle_size) == 0)
+ return 1;
+ }
+
+ return 0;
+}
+
+static int
+_rawpart_is_boot (MacRawPartition* raw_part)
+{
+ return !strcasecmp (raw_part->type, "Apple_Bootstrap");
+}
+
+static int
+_rawpart_is_driver (MacRawPartition* raw_part)
+{
+ if (strncmp (raw_part->type, "Apple_", 6) != 0)
+ return 0;
+ if (!strncasestr (raw_part->type, "driver", 32))
+ return 0;
+ return 1;
+}
+
+static int
+_rawpart_has_driver (MacRawPartition* raw_part, MacDiskData* mac_disk_data)
+{
+ MacDeviceDriver *driverlist;
+ uint16_t i, bsz;
+ uint32_t driver_bs, driver_be, part_be;
+
+ driverlist = &mac_disk_data->driverlist[0];
+ bsz = mac_disk_data->block_size / 512;
+ for (i = 0; i < mac_disk_data->driver_count; i++) {
+ driver_bs = driverlist->block * bsz;
+ driver_be = driver_bs + driverlist->size;
+ part_be = raw_part->start_block + raw_part->block_count;
+ if (driver_bs >= raw_part->start_block && driver_be <= part_be)
+ return 1;
+ driverlist++;
+ }
+ return 0;
+}
+
+static int
+_rawpart_is_root (MacRawPartition* raw_part)
+{
+ if (!_rawpart_cmp_type (raw_part, "Apple_UNIX_SVR2"))
+ return 0;
+ if (strcmp (raw_part->name, "root") != 0)
+ return 0;
+ return 1;
+}
+
+static int
+_rawpart_is_swap (MacRawPartition* raw_part)
+{
+ if (!_rawpart_cmp_type (raw_part, "Apple_UNIX_SVR2"))
+ return 0;
+ if (strcmp (raw_part->name, "swap") != 0)
+ return 0;
+ return 1;
+}
+
+static int
+_rawpart_is_lvm (MacRawPartition* raw_part)
+{
+ if (strcmp (raw_part->type, "Linux_LVM") != 0)
+ return 0;
+ return 1;
+}
+
+static int
+_rawpart_is_raid (MacRawPartition* raw_part)
+{
+ if (strcmp (raw_part->type, "Linux_RAID") != 0)
+ return 0;
+ return 1;
+}
+
+static int
+_rawpart_is_void (MacRawPartition* raw_part)
+{
+ return _rawpart_cmp_type (raw_part, "Apple_Void");
+}
+
+/* returns 1 if the raw_part represents a partition that is "unused space", or
+ * doesn't represent a partition at all. NOTE: some people make Apple_Free
+ * partitions with MacOS, because they can't select another type. So, if the
+ * name is anything other than "Extra" or "", it is treated as a "real"
+ * partition.
+ */
+static int
+_rawpart_is_active (MacRawPartition* raw_part)
+{
+ if (_rawpart_cmp_type (raw_part, "Apple_Free")
+ && (_rawpart_cmp_name (raw_part, "Extra")
+ || _rawpart_cmp_name (raw_part, "")))
+ return 0;
+ if (_rawpart_cmp_type (raw_part, "Apple_Void"))
+ return 0;
+ if (_rawpart_cmp_type (raw_part, "Apple_Scratch"))
+ return 0;
+ if (_rawpart_cmp_type (raw_part, "Apple_Extra"))
+ return 0;
+
+ return 1;
+}
+
+static PedPartition*
+_rawpart_analyse (MacRawPartition* raw_part, PedDisk* disk, int num)
+{
+ MacDiskData* mac_disk_data;
+ PedPartition* part;
+ MacPartitionData* mac_part_data;
+ PedSector block_size;
+ PedSector start, length;
+
+ if (!_rawpart_check_signature (raw_part)) {
+#ifndef DISCOVER_ONLY
+ if (ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("Partition %d has an invalid signature %x."),
+ num,
+ (int) PED_BE16_TO_CPU (raw_part->signature))
+ != PED_EXCEPTION_IGNORE)
+#endif
+ goto error;
+ }
+
+ mac_disk_data = (MacDiskData*) disk->disk_specific;
+ block_size = disk->dev->sector_size / 512;
+
+ start = PED_BE32_TO_CPU (raw_part->start_block) * block_size;
+ length = PED_BE32_TO_CPU (raw_part->block_count) * block_size;
+ if (length == 0) {
+#ifndef DISCOVER_ONLY
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Partition %d has an invalid length of 0 bytes!"),
+ num);
+#endif
+ return NULL;
+ }
+ part = ped_partition_new (disk, 0, NULL, start, start + length - 1);
+ if (!part)
+ goto error;
+
+ mac_part_data = part->disk_specific;
+
+ strncpy (mac_part_data->volume_name, raw_part->name, 32);
+ strncpy (mac_part_data->system_name, raw_part->type, 32);
+ strncpy (mac_part_data->processor_name, raw_part->processor, 16);
+
+ mac_part_data->is_boot = _rawpart_is_boot (raw_part);
+ mac_part_data->is_driver = _rawpart_is_driver (raw_part);
+ if (mac_part_data->is_driver)
+ mac_part_data->has_driver = _rawpart_has_driver(raw_part, mac_disk_data);
+ mac_part_data->is_root = _rawpart_is_root (raw_part);
+ mac_part_data->is_swap = _rawpart_is_swap (raw_part);
+ mac_part_data->is_lvm = _rawpart_is_lvm (raw_part);
+ mac_part_data->is_raid = _rawpart_is_raid (raw_part);
+
+ /* "data" region */
+#ifndef DISCOVER_ONLY
+ if (raw_part->data_start) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("The data region doesn't start at the start "
+ "of the partition."));
+ goto error_destroy_part;
+ }
+#endif /* !DISCOVER_ONLY */
+ mac_part_data->data_region_length
+ = PED_BE32_TO_CPU (raw_part->data_count) * block_size;
+
+ /* boot region - we have no idea what this is for, but Mac OSX
+ * seems to put garbage here, and doesn't pay any attention to
+ * it afterwards. [clausen, dan burcaw]
+ */
+#if 0
+ if (raw_part->boot_start) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("The boot region doesn't start at the start "
+ "of the partition."));
+ goto error_destroy_part;
+ }
+#endif
+ mac_part_data->boot_region_length
+ = PED_BE32_TO_CPU (raw_part->boot_count) * block_size;
+
+#ifndef DISCOVER_ONLY
+ if (mac_part_data->has_driver) {
+ if (mac_part_data->boot_region_length < part->geom.length) {
+ if (ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("The partition's boot region doesn't occupy "
+ "the entire partition."))
+ != PED_EXCEPTION_IGNORE)
+ goto error_destroy_part;
+ }
+ } else {
+ if (mac_part_data->data_region_length < part->geom.length) {
+ if (ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("The partition's data region doesn't occupy "
+ "the entire partition."))
+ != PED_EXCEPTION_IGNORE)
+ goto error_destroy_part;
+ }
+ }
+#endif /* !DISCOVER_ONLY */
+
+ mac_part_data->boot_base_address
+ = PED_BE32_TO_CPU (raw_part->boot_load);
+ mac_part_data->boot_entry_address
+ = PED_BE32_TO_CPU (raw_part->boot_entry);
+ mac_part_data->boot_checksum
+ = PED_BE32_TO_CPU (raw_part->boot_cksum);
+
+ mac_part_data->status = PED_BE32_TO_CPU (raw_part->status);
+ mac_part_data->driver_sig = PED_BE32_TO_CPU (raw_part->driver_sig);
+
+ return part;
+
+error_destroy_part:
+ ped_partition_destroy (part);
+error:
+ return NULL;
+}
+
+/* looks at the partition map size field in a mac raw partition, and calculates
+ * what the size of the partition map should be, from it
+ */
+static int
+_rawpart_get_partmap_size (MacRawPartition* raw_part, PedDisk* disk)
+{
+ MacDiskData* mac_disk_data = disk->disk_specific;
+ PedSector sector_size = disk->dev->sector_size / 512;
+ PedSector part_map_start;
+ PedSector part_map_end;
+
+ part_map_start = mac_disk_data->ghost_size;
+ part_map_end = sector_size * PED_BE32_TO_CPU (raw_part->map_count);
+
+ return part_map_end - part_map_start + 1;
+}
+
+static int
+_disk_analyse_block_size (PedDisk* disk, MacRawDisk* raw_disk)
+{
+ PedSector block_size;
+
+ if (PED_BE16_TO_CPU (raw_disk->block_size) % 512) {
+#ifndef DISCOVER_ONLY
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Weird block size on device descriptor: %d bytes is "
+ "not divisible by 512."),
+ (int) PED_BE16_TO_CPU (raw_disk->block_size));
+#endif
+ goto error;
+ }
+
+ block_size = PED_BE16_TO_CPU (raw_disk->block_size) / 512;
+ if (block_size != disk->dev->sector_size / 512) {
+#ifndef DISCOVER_ONLY
+ if (ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("The driver descriptor says the physical block size "
+ "is %d bytes, but Linux says it is %d bytes."),
+ (int) block_size * 512,
+ (int) disk->dev->sector_size)
+ != PED_EXCEPTION_IGNORE)
+ goto error;
+#endif
+ disk->dev->sector_size = block_size * 512;
+ }
+
+ return 1;
+
+error:
+ return 0;
+}
+
+/* Tries to figure out the block size used by the drivers, for the ghost
+ * partitioning scheme. Ghost partitioning works like this: the OpenFirmware
+ * (OF) sees 512 byte blocks, but some drivers use 2048 byte blocks (and,
+ * perhaps, some other number?). To remain compatible, the partition map
+ * only has "real" partition map entries on ghost-aligned block numbers (and
+ * the others are padded with Apple_Void partitions). This function tries
+ * to figure out what the "ghost-aligned" size is... (which, believe-it-or-not,
+ * doesn't always equal 2048!!!)
+ */
+static int
+_disk_analyse_ghost_size (PedDisk* disk)
+{
+ MacDiskData* mac_disk_data = disk->disk_specific;
+ MacRawPartition raw_part;
+ int i;
+
+ for (i = 1; i < 64; i *= 2) {
+ if (!ped_device_read (disk->dev, &raw_part, i, 1))
+ return 0;
+ if (_rawpart_check_signature (&raw_part)
+ && !_rawpart_is_void (&raw_part)) {
+ mac_disk_data->ghost_size = i;
+ PED_ASSERT (i <= disk->dev->sector_size / 512,
+ return 0);
+ return 1;
+ }
+ }
+
+#ifndef DISCOVER_ONLY
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("No valid partition map found."));
+#endif
+ return 0;
+}
+
+static int
+mac_read (PedDisk* disk)
+{
+ MacRawDisk raw_disk;
+ MacRawPartition raw_part;
+ MacDiskData* mac_disk_data;
+ PedPartition* part;
+ int num;
+ PedSector ghost_size;
+ PedConstraint* constraint_exact;
+ int last_part_entry_num = 0;
+
+ PED_ASSERT (disk != NULL, return 0);
+
+ mac_disk_data = disk->disk_specific;
+ mac_disk_data->part_map_entry_num = 0; /* 0 == none */
+
+ if (!ped_device_read (disk->dev, &raw_disk, 0, 1))
+ goto error;
+ if (!_check_signature (&raw_disk))
+ goto error;
+
+ if (!_disk_analyse_block_size (disk, &raw_disk))
+ goto error;
+ if (!_disk_analyse_ghost_size (disk))
+ goto error;
+ ghost_size = mac_disk_data->ghost_size;
+
+ if (!ped_disk_delete_all (disk))
+ goto error;
+
+ if (raw_disk.driver_count && raw_disk.driver_count < 62) {
+ memcpy(&mac_disk_data->driverlist[0], &raw_disk.driverlist[0],
+ sizeof(mac_disk_data->driverlist));
+ mac_disk_data->driver_count = raw_disk.driver_count;
+ mac_disk_data->block_size = raw_disk.block_size;
+ }
+
+ for (num=1; num==1 || num <= last_part_entry_num; num++) {
+ if (!ped_device_read (disk->dev, &raw_part,
+ num * ghost_size, 1))
+ goto error_delete_all;
+
+ if (!_rawpart_check_signature (&raw_part))
+ continue;
+
+ if (num == 1)
+ last_part_entry_num
+ = _rawpart_get_partmap_size (&raw_part, disk);
+ if (_rawpart_get_partmap_size (&raw_part, disk)
+ != last_part_entry_num) {
+ if (ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("Conflicting partition map entry sizes! "
+ "Entry 1 says it is %d, but entry %d says "
+ "it is %d!"),
+ last_part_entry_num,
+ _rawpart_get_partmap_size (&raw_part, disk))
+ != PED_EXCEPTION_IGNORE)
+ goto error_delete_all;
+ }
+
+ if (!_rawpart_is_active (&raw_part))
+ continue;
+
+ part = _rawpart_analyse (&raw_part, disk, num);
+ if (!part)
+ goto error_delete_all;
+ part->num = num;
+ part->fs_type = ped_file_system_probe (&part->geom);
+ constraint_exact = ped_constraint_exact (&part->geom);
+ if (!ped_disk_add_partition (disk, part, constraint_exact))
+ goto error_delete_all;
+ ped_constraint_destroy (constraint_exact);
+
+ if (_rawpart_is_partition_map (&raw_part)) {
+ if (mac_disk_data->part_map_entry_num
+ && ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("Weird! There are 2 partitions "
+ "map entries!"))
+ != PED_EXCEPTION_IGNORE)
+ goto error_delete_all;
+
+ mac_disk_data->part_map_entry_num = num;
+ mac_disk_data->part_map_entry_count
+ = part->geom.end - ghost_size + 1;
+ }
+ }
+
+ if (!mac_disk_data->part_map_entry_num) {
+ if (!_disk_add_part_map_entry (disk, 1))
+ goto error_delete_all;
+ ped_disk_commit_to_dev (disk);
+ }
+ return 1;
+
+error_delete_all:
+ ped_disk_delete_all (disk);
+error:
+ return 0;
+}
+
+#ifndef DISCOVER_ONLY
+/* The Ghost partition: is a blank entry, used to pad out each block (where
+ * there physical block size > 512 bytes). This is because OpenFirmware uses
+ * 512 byte blocks, but device drivers Think Different TM, with a different
+ * lbock size, so we need to do this to avoid a clash (!)
+ */
+static int
+_pad_raw_part (PedDisk* disk, int num, MacRawPartition* part_map)
+{
+ MacDiskData* mac_disk_data = disk->disk_specific;
+ MacRawPartition ghost_entry;
+ int i;
+
+ memset (&ghost_entry, 0, sizeof (ghost_entry));
+ ghost_entry.signature = PED_CPU_TO_BE16 (MAC_PARTITION_MAGIC_2);
+ strcpy (ghost_entry.type, "Apple_Void");
+ ghost_entry.map_count
+ = PED_CPU_TO_BE32 (mac_disk_data->last_part_entry_num);
+
+ for (i=0; i < mac_disk_data->ghost_size - 1; i++)
+ memcpy (&part_map [i + (num - 1) * mac_disk_data->ghost_size],
+ &ghost_entry, sizeof (MacRawPartition));
+
+ return 1;
+}
+
+static void
+_update_driver_count (MacRawPartition* part_map_entry,
+ MacDiskData *mac_driverdata, const MacDiskData* mac_disk_data)
+{
+ uint16_t i, count_orig, count_cur, bsz;
+ uint32_t driver_bs, driver_be, part_be;
+
+ bsz = mac_disk_data->block_size / 512;
+ count_cur = mac_driverdata->driver_count;
+ count_orig = mac_disk_data->driver_count;
+ for (i = 0; i < count_orig; i++) {
+ driver_bs = mac_disk_data->driverlist[i].block * bsz;
+ driver_be = driver_bs + mac_disk_data->driverlist[i].size;
+ part_be = part_map_entry->start_block + part_map_entry->block_count;
+ if (driver_bs >= part_map_entry->start_block
+ && driver_be <= part_be) {
+ mac_driverdata->driverlist[count_cur].block
+ = mac_disk_data->driverlist[i].block;
+ mac_driverdata->driverlist[count_cur].size
+ = mac_disk_data->driverlist[i].size;
+ mac_driverdata->driverlist[count_cur].type
+ = mac_disk_data->driverlist[i].type;
+ mac_driverdata->driver_count++;
+ break;
+ }
+ }
+}
+
+static int
+_generate_raw_part (PedDisk* disk, PedPartition* part,
+ MacRawPartition* part_map, MacDiskData *mac_driverdata)
+{
+ MacDiskData* mac_disk_data;
+ MacPartitionData* mac_part_data;
+ MacRawPartition* part_map_entry;
+ PedSector block_size = disk->dev->sector_size / 512;
+
+ PED_ASSERT (part->num > 0, goto error);
+
+ mac_disk_data = disk->disk_specific;
+ mac_part_data = part->disk_specific;
+
+ part_map_entry = &part_map [part->num * mac_disk_data->ghost_size - 1];
+
+ part_map_entry->signature = PED_CPU_TO_BE16 (MAC_PARTITION_MAGIC_2);
+ part_map_entry->map_count
+ = PED_CPU_TO_BE32 (mac_disk_data->last_part_entry_num);
+ part_map_entry->start_block
+ = PED_CPU_TO_BE32 (part->geom.start / block_size);
+ part_map_entry->block_count
+ = PED_CPU_TO_BE32 (part->geom.length / block_size);
+ strcpy (part_map_entry->name, mac_part_data->volume_name);
+ strcpy (part_map_entry->type, mac_part_data->system_name);
+
+ if (mac_part_data->is_driver) {
+ mac_part_data->boot_region_length = part->geom.length;
+ if (mac_part_data->has_driver)
+ _update_driver_count(part_map_entry, mac_driverdata,
+ mac_disk_data);
+ } else
+ mac_part_data->data_region_length = part->geom.length;
+ part_map_entry->data_count = PED_CPU_TO_BE32 (
+ mac_part_data->data_region_length / block_size);
+ part_map_entry->boot_count = PED_CPU_TO_BE32 (
+ mac_part_data->boot_region_length / block_size);
+ part_map_entry->status = PED_CPU_TO_BE32 (mac_part_data->status);
+ part_map_entry->driver_sig
+ = PED_CPU_TO_BE32 (mac_part_data->driver_sig);
+
+ part_map_entry->boot_load =
+ PED_CPU_TO_BE32 (mac_part_data->boot_base_address);
+ part_map_entry->boot_entry =
+ PED_CPU_TO_BE32 (mac_part_data->boot_entry_address);
+ part_map_entry->boot_cksum =
+ PED_CPU_TO_BE32 (mac_part_data->boot_checksum);
+
+ strncpy (part_map_entry->processor, mac_part_data->processor_name, 16);
+
+ if (!_pad_raw_part (disk, part->num, part_map))
+ goto error;
+
+ return 1;
+
+error:
+ return 0;
+}
+
+static int
+_generate_raw_freespace_part (PedDisk* disk, PedGeometry* geom, int num,
+ MacRawPartition* part_map)
+{
+ MacDiskData* mac_disk_data = disk->disk_specific;
+ MacRawPartition* part_map_entry;
+ PedSector block_size = disk->dev->sector_size / 512;
+
+ PED_ASSERT (num > 0, goto error);
+
+ part_map_entry = &part_map [num * mac_disk_data->ghost_size - 1];
+
+ part_map_entry->signature = PED_CPU_TO_BE16 (MAC_PARTITION_MAGIC_2);
+ part_map_entry->map_count
+ = PED_CPU_TO_BE32 (mac_disk_data->last_part_entry_num);
+ part_map_entry->start_block
+ = PED_CPU_TO_BE32 (geom->start / block_size);
+ part_map_entry->block_count
+ = PED_CPU_TO_BE32 (geom->length / block_size);
+ strcpy (part_map_entry->name, "Extra");
+ strcpy (part_map_entry->type, "Apple_Free");
+
+ part_map_entry->data_count = PED_CPU_TO_BE32 (geom->length);
+ part_map_entry->status = 0;
+ part_map_entry->driver_sig = 0;
+
+ if (!_pad_raw_part (disk, num, part_map))
+ goto error;
+
+ return 1;
+
+error:
+ return 0;
+}
+
+static int
+_generate_empty_part (PedDisk* disk, int num, MacRawPartition* part_map)
+{
+ MacDiskData* mac_disk_data = disk->disk_specific;
+ MacRawPartition* part_map_entry;
+
+ PED_ASSERT (num > 0, return 0);
+
+ part_map_entry = &part_map [num * mac_disk_data->ghost_size - 1];
+ part_map_entry->signature = PED_CPU_TO_BE16 (MAC_PARTITION_MAGIC_2);
+ part_map_entry->map_count
+ = PED_CPU_TO_BE32 (mac_disk_data->last_part_entry_num);
+ strcpy (part_map_entry->type, "Apple_Void");
+
+ return _pad_raw_part (disk, num, part_map);
+}
+
+/* returns the first empty entry in the partition map */
+static int
+_get_first_empty_part_entry (PedDisk* disk, MacRawPartition* part_map)
+{
+ MacDiskData* mac_disk_data = disk->disk_specific;
+ int i;
+
+ for (i=1; i <= mac_disk_data->last_part_entry_num; i++) {
+ if (!part_map[i * mac_disk_data->ghost_size - 1].signature)
+ return i;
+ }
+
+ return 0;
+}
+
+static int
+write_block_zero (PedDisk* disk, MacDiskData* mac_driverdata)
+{
+ PedDevice* dev = disk->dev;
+ MacRawDisk raw_disk;
+
+ if (!ped_device_read (dev, &raw_disk, 0, 1))
+ return 0;
+
+ raw_disk.signature = PED_CPU_TO_BE16 (MAC_DISK_MAGIC);
+ raw_disk.block_size = PED_CPU_TO_BE16 (dev->sector_size);
+ raw_disk.block_count
+ = PED_CPU_TO_BE32 (dev->length / (dev->sector_size / 512));
+
+ raw_disk.driver_count = mac_driverdata->driver_count;
+ memcpy(&raw_disk.driverlist[0], &mac_driverdata->driverlist[0],
+ sizeof(raw_disk.driverlist));
+
+ return ped_device_write (dev, &raw_disk, 0, 1);
+}
+
+static int
+mac_write (PedDisk* disk)
+{
+ MacRawPartition* part_map;
+ MacDiskData* mac_disk_data;
+ MacDiskData* mac_driverdata; /* updated driver list */
+ PedPartition* part;
+ int num;
+
+ PED_ASSERT (disk != NULL, return 0);
+ PED_ASSERT (disk->disk_specific != NULL, return 0);
+ PED_ASSERT (disk->dev != NULL, return 0);
+ PED_ASSERT (!disk->update_mode, return 0);
+
+ mac_disk_data = disk->disk_specific;
+
+ if (!ped_disk_get_partition (disk, mac_disk_data->part_map_entry_num)) {
+ if (!_disk_add_part_map_entry (disk, 1))
+ goto error;
+ }
+
+ mac_driverdata = ped_malloc(sizeof(MacDiskData));
+ if (!mac_driverdata)
+ goto error;
+ memset (mac_driverdata, 0, sizeof(MacDiskData));
+
+ part_map = (MacRawPartition*)
+ ped_malloc (mac_disk_data->part_map_entry_count * 512);
+ if (!part_map)
+ goto error_free_driverdata;
+ memset (part_map, 0, mac_disk_data->part_map_entry_count * 512);
+
+/* write (to memory) the "real" partitions */
+ for (part = ped_disk_next_partition (disk, NULL); part;
+ part = ped_disk_next_partition (disk, part)) {
+ if (!ped_partition_is_active (part))
+ continue;
+ if (!_generate_raw_part (disk, part, part_map, mac_driverdata))
+ goto error_free_part_map;
+ }
+
+/* write the "free space" partitions */
+ for (part = ped_disk_next_partition (disk, NULL); part;
+ part = ped_disk_next_partition (disk, part)) {
+ if (part->type != PED_PARTITION_FREESPACE)
+ continue;
+ num = _get_first_empty_part_entry (disk, part_map);
+ if (!_generate_raw_freespace_part (disk, &part->geom, num,
+ part_map))
+ goto error_free_part_map;
+ }
+
+/* write the "void" (empty) partitions */
+ for (num = _get_first_empty_part_entry (disk, part_map); num;
+ num = _get_first_empty_part_entry (disk, part_map))
+ _generate_empty_part (disk, num, part_map);
+
+/* write to disk */
+ if (!ped_device_write (disk->dev, part_map, 1,
+ mac_disk_data->part_map_entry_count))
+ goto error_free_part_map;
+ ped_free (part_map);
+ return write_block_zero (disk, mac_driverdata);
+
+error_free_part_map:
+ ped_free (part_map);
+error_free_driverdata:
+ ped_free (mac_driverdata);
+error:
+ return 0;
+}
+#endif /* !DISCOVER_ONLY */
+
+static PedPartition*
+mac_partition_new (
+ const PedDisk* disk, PedPartitionType part_type,
+ const PedFileSystemType* fs_type, PedSector start, PedSector end)
+{
+ PedPartition* part;
+ MacPartitionData* mac_data;
+
+ part = _ped_partition_alloc (disk, part_type, fs_type, start, end);
+ if (!part)
+ goto error;
+
+ if (ped_partition_is_active (part)) {
+ part->disk_specific
+ = mac_data = ped_malloc (sizeof (MacPartitionData));
+ if (!mac_data)
+ goto error_free_part;
+
+ memset (mac_data, 0, sizeof (MacPartitionData));
+
+ mac_data->data_region_length = 0;
+ mac_data->boot_region_length = 0;
+ mac_data->is_driver = 0;
+ mac_data->has_driver = 0;
+ mac_data->is_boot = 0;
+ mac_data->is_root = 0;
+ mac_data->is_swap = 0;
+ mac_data->is_lvm = 0;
+ mac_data->is_raid = 0;
+
+ strcpy (mac_data->volume_name, "untitled");
+ } else {
+ part->disk_specific = NULL;
+ }
+ return part;
+
+error_free_mac_data:
+ ped_free (mac_data);
+error_free_part:
+ ped_free (part);
+error:
+ return 0;
+}
+
+static PedPartition*
+mac_partition_duplicate (const PedPartition* part)
+{
+ PedPartition* new_part;
+ MacPartitionData* new_mac_data;
+ MacPartitionData* old_mac_data;
+
+ new_part = ped_partition_new (part->disk, part->type,
+ part->fs_type, part->geom.start,
+ part->geom.end);
+ if (!new_part)
+ return NULL;
+ new_part->num = part->num;
+
+ old_mac_data = (MacPartitionData*) part->disk_specific;
+ new_mac_data = (MacPartitionData*) new_part->disk_specific;
+
+ /* ugly, but C is ugly :p */
+ memcpy (new_mac_data, old_mac_data, sizeof (MacPartitionData));
+ return new_part;
+}
+
+static void
+mac_partition_destroy (PedPartition* part)
+{
+ PED_ASSERT (part != NULL, return);
+
+ if (ped_partition_is_active (part))
+ ped_free (part->disk_specific);
+ ped_free (part);
+}
+
+static int
+mac_partition_set_system (PedPartition* part, const PedFileSystemType* fs_type)
+{
+ MacPartitionData* mac_data = part->disk_specific;
+
+ part->fs_type = fs_type;
+
+ if (fs_type && !strcmp (fs_type->name, "linux-swap"))
+ ped_partition_set_flag (part, PED_PARTITION_SWAP, 1);
+
+ if (mac_data->is_boot) {
+ strcpy (mac_data->system_name, "Apple_Bootstrap");
+ mac_data->status = 0x33;
+ return 1;
+ }
+
+ if (fs_type && (!strcmp (fs_type->name, "hfs")
+ || !strcmp (fs_type->name, "hfs+"))) {
+ strcpy (mac_data->system_name, "Apple_HFS");
+ mac_data->status |= 0x7f;
+ } else if (fs_type && !strcmp (fs_type->name, "hfsx")) {
+ strcpy (mac_data->system_name, "Apple_HFSX");
+ mac_data->status |= 0x7f;
+ } else {
+ strcpy (mac_data->system_name, "Apple_UNIX_SVR2");
+ mac_data->status = 0x33;
+ }
+
+ return 1;
+}
+
+static int
+mac_partition_set_flag (PedPartition* part, PedPartitionFlag flag, int state)
+{
+ PedFileSystemType* hfs = ped_file_system_type_get ("hfs");
+ MacPartitionData* mac_data;
+
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->disk_specific != NULL, return 0);
+
+ mac_data = part->disk_specific;
+
+ switch (flag) {
+ case PED_PARTITION_BOOT:
+ mac_data->is_boot = state;
+
+ if (part->fs_type)
+ return mac_partition_set_system (part, part->fs_type);
+
+ if (state) {
+ strcpy (mac_data->system_name, "Apple_Bootstrap");
+ mac_data->status = 0x33;
+ }
+ return 1;
+
+ case PED_PARTITION_ROOT:
+ if (state) {
+ strcpy (mac_data->volume_name, "root");
+ mac_data->is_swap = 0;
+ } else {
+ if (mac_data->is_root)
+ strcpy (mac_data->volume_name, "untitled");
+ }
+ mac_data->is_root = state;
+ return 1;
+
+ case PED_PARTITION_SWAP:
+ if (state) {
+ strcpy (mac_data->volume_name, "swap");
+ mac_data->is_root = 0;
+ } else {
+ if (mac_data->is_swap)
+ strcpy (mac_data->volume_name, "untitled");
+ }
+ mac_data->is_swap = state;
+ return 1;
+
+ case PED_PARTITION_LVM:
+ mac_data->is_lvm = state;
+ if (state)
+ strcpy (mac_data->system_name, "Linux_LVM");
+ else
+ mac_partition_set_system (part, part->fs_type);
+ return 1;
+
+ case PED_PARTITION_RAID:
+ mac_data->is_raid = state;
+ if (state)
+ strcpy (mac_data->system_name, "Linux_RAID");
+ else
+ mac_partition_set_system (part, part->fs_type);
+ return 1;
+
+ default:
+ return 0;
+ }
+}
+
+static int
+mac_partition_get_flag (const PedPartition* part, PedPartitionFlag flag)
+{
+ MacPartitionData* mac_data;
+
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->disk_specific != NULL, return 0);
+
+ mac_data = part->disk_specific;
+ switch (flag) {
+ case PED_PARTITION_BOOT:
+ return mac_data->is_boot;
+
+ case PED_PARTITION_ROOT:
+ return mac_data->is_root;
+
+ case PED_PARTITION_SWAP:
+ return mac_data->is_swap;
+
+ case PED_PARTITION_LVM:
+ return mac_data->is_lvm;
+
+ case PED_PARTITION_RAID:
+ return mac_data->is_raid;
+
+ default:
+ return 0;
+ }
+}
+
+static int
+mac_partition_is_flag_available (
+ const PedPartition* part, PedPartitionFlag flag)
+{
+ switch (flag) {
+ case PED_PARTITION_BOOT:
+ case PED_PARTITION_ROOT:
+ case PED_PARTITION_SWAP:
+ case PED_PARTITION_LVM:
+ case PED_PARTITION_RAID:
+ return 1;
+
+ default:
+ return 0;
+ }
+}
+
+static void
+mac_partition_set_name (PedPartition* part, const char* name)
+{
+ MacPartitionData* mac_data;
+ int i;
+
+ PED_ASSERT (part != NULL, return);
+ PED_ASSERT (part->disk_specific != NULL, return);
+ mac_data = part->disk_specific;
+
+#ifndef DISCOVER_ONLY
+ if (mac_data->is_root || mac_data->is_swap) {
+ if (ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("Changing the name of a root or swap partition "
+ "will prevent Linux from recognising it as such."))
+ != PED_EXCEPTION_IGNORE)
+ return;
+ mac_data->is_root = mac_data->is_swap = 0;
+ }
+#endif
+
+ strncpy (mac_data->volume_name, name, 32);
+ mac_data->volume_name [32] = 0;
+ for (i = strlen (mac_data->volume_name) - 1;
+ mac_data->volume_name[i] == ' '; i--)
+ mac_data->volume_name [i] = 0;
+}
+
+static const char*
+mac_partition_get_name (const PedPartition* part)
+{
+ MacPartitionData* mac_data;
+
+ PED_ASSERT (part != NULL, return NULL);
+ PED_ASSERT (part->disk_specific != NULL, return NULL);
+ mac_data = part->disk_specific;
+
+ return mac_data->volume_name;
+}
+
+static PedConstraint*
+_primary_constraint (PedDisk* disk)
+{
+ PedAlignment start_align;
+ PedAlignment end_align;
+ PedGeometry max_geom;
+ PedSector sector_size;
+
+ sector_size = disk->dev->sector_size / 512;
+
+ if (!ped_alignment_init (&start_align, 0, sector_size))
+ return NULL;
+ if (!ped_alignment_init (&end_align, -1, sector_size))
+ return NULL;
+ if (!ped_geometry_init (&max_geom, disk->dev, 1, disk->dev->length - 1))
+ return NULL;
+
+ return ped_constraint_new (&start_align, &end_align, &max_geom,
+ &max_geom, 1, disk->dev->length);
+}
+
+static int
+mac_partition_align (PedPartition* part, const PedConstraint* constraint)
+{
+ PED_ASSERT (part != NULL, return 0);
+
+ if (_ped_partition_attempt_align (part, constraint,
+ _primary_constraint (part->disk)))
+ return 1;
+
+#ifndef DISCOVER_ONLY
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Unable to satisfy all constraints on the partition."));
+#endif
+ return 0;
+}
+
+static int
+mac_partition_enumerate (PedPartition* part)
+{
+ PedDisk* disk;
+ MacDiskData* mac_disk_data;
+ int i;
+ int max_part_count;
+
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->disk != NULL, return 0);
+
+ disk = part->disk;
+ mac_disk_data = (MacDiskData*) disk->disk_specific;
+
+ max_part_count = ped_disk_get_max_primary_partition_count (disk);
+
+ if (part->num > 0 && part->num <= mac_disk_data->part_map_entry_count)
+ return 1;
+
+ for (i = 1; i <= max_part_count; i++) {
+ if (!ped_disk_get_partition (disk, i)) {
+ part->num = i;
+ return 1;
+ }
+ }
+
+#ifndef DISCOVER_ONLY
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Can't add another partition -- the partition map is too "
+ "small!"));
+#endif
+
+ return 0;
+}
+
+static int
+_disk_count_partitions (PedDisk* disk)
+{
+ MacDiskData* mac_disk_data = disk->disk_specific;
+ PedPartition* part = NULL;
+ PedPartition* last = NULL;
+
+ PED_ASSERT (disk->update_mode, return 0);
+
+ mac_disk_data->active_part_entry_count = 0;
+ mac_disk_data->free_part_entry_count = 0;
+ mac_disk_data->last_part_entry_num = 0;
+
+ /* subtle: we only care about free space after the partition map.
+ * the partition map is an "active" partition, BTW... */
+ for (part = ped_disk_next_partition (disk, part); part;
+ part = ped_disk_next_partition (disk, part)) {
+ if (!ped_partition_is_active (part))
+ continue;
+
+ mac_disk_data->active_part_entry_count++;
+ if (last && last->geom.end + 1 < part->geom.start)
+ mac_disk_data->free_part_entry_count++;
+ mac_disk_data->last_part_entry_num
+ = PED_MAX (mac_disk_data->last_part_entry_num,
+ part->num);
+
+ last = part;
+ }
+
+ if (last && last->geom.end < disk->dev->length - 1)
+ mac_disk_data->free_part_entry_count++;
+
+ mac_disk_data->last_part_entry_num
+ = PED_MAX (mac_disk_data->last_part_entry_num,
+ mac_disk_data->active_part_entry_count
+ + mac_disk_data->free_part_entry_count);
+ return 1;
+}
+
+static int
+add_metadata_part (PedDisk* disk, PedSector start, PedSector end)
+{
+ PedPartition* new_part;
+ PedConstraint* constraint_any = ped_constraint_any (disk->dev);
+
+ PED_ASSERT (disk != NULL, return 0);
+
+ new_part = ped_partition_new (disk, PED_PARTITION_METADATA, NULL,
+ start, end);
+ if (!new_part)
+ goto error;
+ if (!ped_disk_add_partition (disk, new_part, constraint_any))
+ goto error_destroy_new_part;
+
+ ped_constraint_destroy (constraint_any);
+ return 1;
+
+error_destroy_new_part:
+ ped_partition_destroy (new_part);
+error:
+ ped_constraint_destroy (constraint_any);
+ return 0;
+}
+
+static int
+mac_alloc_metadata (PedDisk* disk)
+{
+ MacDiskData* mac_disk_data;
+
+ PED_ASSERT (disk != NULL, return 0);
+ PED_ASSERT (disk->disk_specific != NULL, return 0);
+ PED_ASSERT (disk->dev != NULL, return 0);
+
+ mac_disk_data = disk->disk_specific;
+
+ if (!add_metadata_part (disk, 0, disk->dev->sector_size / 512 - 1))
+ return 0;
+
+ /* hack: this seems to be a good place, to update the partition map
+ * entry count, since mac_alloc_metadata() gets called during
+ * _disk_pop_update_mode()
+ */
+ return _disk_count_partitions (disk);
+}
+
+static int
+mac_get_max_primary_partition_count (const PedDisk* disk)
+{
+ MacDiskData* mac_disk_data = disk->disk_specific;
+ PedPartition* part_map_partition;
+
+ part_map_partition = ped_disk_get_partition (disk,
+ mac_disk_data->part_map_entry_num);
+
+ /* HACK: if we haven't found the partition map partition (yet),
+ * we return this.
+ */
+ if (!part_map_partition) {
+ mac_disk_data->part_map_entry_num = 0;
+ return 65536;
+ }
+
+ /* HACK: since Mac labels need an entry for free-space regions, we
+ * must allow half plus 1 entries for free-space partitions. I hate
+ * this, but things get REALLY complicated, otherwise.
+ * (I'm prepared to complicate things later, but I want to get
+ * everything working, first)
+ */
+ return mac_disk_data->part_map_entry_count / mac_disk_data->ghost_size
+ - mac_disk_data->free_part_entry_count + 1;
+}
+
+static PedDiskOps mac_disk_ops = {
+ probe: mac_probe,
+#ifndef DISCOVER_ONLY
+ clobber: mac_clobber,
+#else
+ clobber: NULL,
+#endif
+ alloc: mac_alloc,
+ duplicate: mac_duplicate,
+ free: mac_free,
+ read: mac_read,
+#ifndef DISCOVER_ONLY
+ write: mac_write,
+#else
+ write: NULL,
+#endif
+
+ partition_new: mac_partition_new,
+ partition_duplicate: mac_partition_duplicate,
+ partition_destroy: mac_partition_destroy,
+ partition_set_system: mac_partition_set_system,
+ partition_set_flag: mac_partition_set_flag,
+ partition_get_flag: mac_partition_get_flag,
+ partition_is_flag_available: mac_partition_is_flag_available,
+ partition_set_name: mac_partition_set_name,
+ partition_get_name: mac_partition_get_name,
+ partition_align: mac_partition_align,
+ partition_enumerate: mac_partition_enumerate,
+
+ alloc_metadata: mac_alloc_metadata,
+ get_max_primary_partition_count:
+ mac_get_max_primary_partition_count
+};
+
+static PedDiskType mac_disk_type = {
+ next: NULL,
+ name: "mac",
+ ops: &mac_disk_ops,
+ features: PED_DISK_TYPE_PARTITION_NAME
+};
+
+void
+ped_disk_mac_init ()
+{
+ PED_ASSERT (sizeof (MacRawPartition) == 512, return);
+ PED_ASSERT (sizeof (MacRawDisk) == 512, return);
+
+ ped_register_disk_type (&mac_disk_type);
+}
+
+void
+ped_disk_mac_done ()
+{
+ ped_unregister_disk_type (&mac_disk_type);
+}
+
diff --git a/libparted/labels/pc98.c b/libparted/labels/pc98.c
new file mode 100644
index 0000000..d9a54db
--- /dev/null
+++ b/libparted/labels/pc98.c
@@ -0,0 +1,892 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#include "config.h"
+
+#include <parted/parted.h>
+#include <parted/debug.h>
+#include <parted/endian.h>
+#include <string.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+/* hacked from Linux/98 source: fs/partitions/nec98.h
+ *
+ * See also:
+ * http://people.FreeBSD.org/~kato/pc98.html
+ * http://www.kmc.kyoto-u.ac.jp/proj/linux98/index-english.html
+ *
+ * Partition types:
+ *
+ * id0(mid):
+ * bit 7: 1=bootable, 0=not bootable
+ * # Linux uses this flag to make a distinction between ext2 and swap.
+ * bit 6--0:
+ * 00H : N88-BASIC(data)?, PC-UX(data)?
+ * 04H : PC-UX(data)
+ * 06H : N88-BASIC
+ * 10H : N88-BASIC
+ * 14H : *BSD, PC-UX
+ * 20H : DOS(data), Windows95/98/NT, Linux
+ * 21H..2FH : DOS(system#1 .. system#15)
+ * 40H : Minix
+ *
+ * id1(sid):
+ * bit 7: 1=active, 0=sleep(hidden)
+ * # PC-UX uses this flag to make a distinction between its file system
+ * # and its swap.
+ * bit 6--0:
+ * 01H: FAT12
+ * 11H: FAT16, <32MB [accessible to DOS 3.3]
+ * 21H: FAT16, >=32MB [Large Partition]
+ * 31H: NTFS
+ * 28H: Windows NT (Volume/Stripe Set?)
+ * 41H: Windows NT (Volume/Stripe Set?)
+ * 48H: Windows NT (Volume/Stripe Set?)
+ * 61H: FAT32
+ * 04H: PC-UX
+ * 06H: N88-BASIC
+ * 44H: *BSD
+ * 62H: ext2, linux-swap
+ */
+
+#define MAX_PART_COUNT 16
+#define PC9800_EXTFMT_MAGIC 0xAA55
+
+#define BIT(x) (1 << (x))
+#define GET_BIT(n,bit) (((n) & BIT(bit)) != 0)
+#define SET_BIT(n,bit,val) n = (val)? (n | BIT(bit)) : (n & ~BIT(bit))
+
+typedef struct _PC98RawPartition PC98RawPartition;
+typedef struct _PC98RawTable PC98RawTable;
+
+/* ripped from Linux/98 source */
+struct _PC98RawPartition {
+ uint8_t mid; /* 0x80 - boot */
+ uint8_t sid; /* 0x80 - active */
+ uint8_t dum1; /* dummy for padding */
+ uint8_t dum2; /* dummy for padding */
+ uint8_t ipl_sect; /* IPL sector */
+ uint8_t ipl_head; /* IPL head */
+ uint16_t ipl_cyl; /* IPL cylinder */
+ uint8_t sector; /* starting sector */
+ uint8_t head; /* starting head */
+ uint16_t cyl; /* starting cylinder */
+ uint8_t end_sector; /* end sector */
+ uint8_t end_head; /* end head */
+ uint16_t end_cyl; /* end cylinder */
+ char name[16];
+} __attribute__((packed));
+
+struct _PC98RawTable {
+ uint8_t boot_code [510];
+ uint16_t magic;
+ PC98RawPartition partitions [MAX_PART_COUNT];
+} __attribute__((packed));
+
+typedef struct {
+ PedSector ipl_sector;
+ int system;
+ int boot;
+ int hidden;
+ char name [17];
+} PC98PartitionData;
+
+/* this MBR boot code is dummy */
+static char MBR_BOOT_CODE[] = {
+ 0xcb, /* retf */
+ 0x00, 0x00, 0x00, /* */
+ 0x49, 0x50, 0x4c, 0x31 /* "IPL1" */
+};
+
+static PedDiskType pc98_disk_type;
+
+static PedSector chs_to_sector (const PedDevice* dev, int c, int h, int s);
+static void sector_to_chs (const PedDevice* dev, PedSector sector,
+ int* c, int* h, int* s);
+
+/* magic(?) check */
+static int
+pc98_check_magic (const PC98RawTable *part_table)
+{
+ /* check "extended-format" (have partition table?) */
+ if (PED_LE16_TO_CPU(part_table->magic) != PC9800_EXTFMT_MAGIC)
+ return 0;
+
+ return 1;
+}
+
+static int
+pc98_check_ipl_signature (const PC98RawTable *part_table)
+{
+ return !memcmp (part_table->boot_code + 4, "IPL1", 4);
+}
+
+static int
+check_partition_consistency (const PedDevice* dev,
+ const PC98RawPartition* raw_part)
+{
+ if (raw_part->ipl_sect >= dev->hw_geom.sectors
+ || raw_part->sector >= dev->hw_geom.sectors
+ || raw_part->end_sector >= dev->hw_geom.sectors
+ || raw_part->ipl_head >= dev->hw_geom.heads
+ || raw_part->head >= dev->hw_geom.heads
+ || raw_part->end_head >= dev->hw_geom.heads
+ || PED_LE16_TO_CPU(raw_part->ipl_cyl) >= dev->hw_geom.cylinders
+ || PED_LE16_TO_CPU(raw_part->cyl) >= dev->hw_geom.cylinders
+ || PED_LE16_TO_CPU(raw_part->end_cyl) >= dev->hw_geom.cylinders
+ || PED_LE16_TO_CPU(raw_part->cyl)
+ > PED_LE16_TO_CPU(raw_part->end_cyl)
+#if 0
+ || !chs_to_sector(dev, PED_LE16_TO_CPU(raw_part->ipl_cyl),
+ raw_part->ipl_head, raw_part->ipl_sect)
+ || !chs_to_sector(dev, PED_LE16_TO_CPU(raw_part->cyl),
+ raw_part->head, raw_part->sector)
+ || !chs_to_sector(dev, PED_LE16_TO_CPU(raw_part->end_cyl),
+ raw_part->end_head, raw_part->end_sector)
+#endif
+ || PED_LE16_TO_CPU(raw_part->end_cyl)
+ < PED_LE16_TO_CPU(raw_part->cyl))
+ return 0;
+
+ return 1;
+}
+
+static int
+pc98_probe (const PedDevice *dev)
+{
+ PC98RawTable part_table;
+ int empty;
+ const PC98RawPartition* p;
+
+ PED_ASSERT (dev != NULL, return 0);
+
+ if (dev->sector_size != 512)
+ return 0;
+
+ if (!ped_device_read (dev, &part_table, 0, 2))
+ return 0;
+
+ /* check magic */
+ if (!pc98_check_magic (&part_table))
+ return 0;
+
+ /* check consistency */
+ empty = 1;
+ for (p = part_table.partitions;
+ p < part_table.partitions + MAX_PART_COUNT;
+ p++)
+ {
+ if (p->mid == 0 && p->sid == 0)
+ continue;
+ empty = 0;
+ if (!check_partition_consistency (dev, p))
+ return 0;
+ }
+
+ /* check boot loader */
+ if (pc98_check_ipl_signature (&part_table))
+ return 1;
+ else if (part_table.boot_code[0]) /* invalid boot loader */
+ return 0;
+
+ /* Not to mistake msdos disk map for PC-9800's empty disk map */
+ if (empty)
+ return 0;
+
+ return 1;
+}
+
+#ifndef DISCOVER_ONLY
+static int
+pc98_clobber (PedDevice* dev)
+{
+ PC98RawTable table;
+
+ PED_ASSERT (dev != NULL, return 0);
+ PED_ASSERT (pc98_probe (dev), return 0);
+
+ if (!ped_device_read (dev, &table, 0, 1))
+ return 0;
+
+ memset (table.partitions, 0, sizeof (table.partitions));
+ table.magic = PED_CPU_TO_LE16(0);
+
+ if (pc98_check_ipl_signature (&table))
+ memset (table.boot_code, 0, sizeof (table.boot_code));
+
+ if (!ped_device_write (dev, (void*) &table, 0, 1))
+ return 0;
+ return ped_device_sync (dev);
+}
+#endif /* !DISCOVER_ONLY */
+
+static PedDisk*
+pc98_alloc (const PedDevice* dev)
+{
+ PedDisk* disk;
+
+ PED_ASSERT (dev != NULL, return 0);
+
+ return _ped_disk_alloc (dev, &pc98_disk_type);
+}
+
+static PedDisk*
+pc98_duplicate (const PedDisk* disk)
+{
+ return ped_disk_new_fresh (disk->dev, &pc98_disk_type);
+}
+
+static void
+pc98_free (PedDisk* disk)
+{
+ PED_ASSERT (disk != NULL, return);
+
+ _ped_disk_free (disk);
+}
+
+static PedSector
+chs_to_sector (const PedDevice* dev, int c, int h, int s)
+{
+ PED_ASSERT (dev != NULL, return 0);
+ return (c * dev->hw_geom.heads + h) * dev->hw_geom.sectors + s;
+}
+
+static void
+sector_to_chs (const PedDevice* dev, PedSector sector, int* c, int* h, int* s)
+{
+ PedSector cyl_size;
+
+ PED_ASSERT (dev != NULL, return);
+ PED_ASSERT (c != NULL, return);
+ PED_ASSERT (h != NULL, return);
+ PED_ASSERT (s != NULL, return);
+
+ cyl_size = dev->hw_geom.heads * dev->hw_geom.sectors;
+
+ *c = sector / cyl_size;
+ *h = (sector) % cyl_size / dev->hw_geom.sectors;
+ *s = (sector) % cyl_size % dev->hw_geom.sectors;
+}
+
+static PedSector
+legacy_start (const PedDisk* disk, const PC98RawPartition* raw_part)
+{
+ PED_ASSERT (disk != NULL, return 0);
+ PED_ASSERT (raw_part != NULL, return 0);
+
+ return chs_to_sector (disk->dev, PED_LE16_TO_CPU(raw_part->cyl),
+ raw_part->head, raw_part->sector);
+}
+
+static PedSector
+legacy_end (const PedDisk* disk, const PC98RawPartition* raw_part)
+{
+ PED_ASSERT (disk != NULL, return 0);
+ PED_ASSERT (raw_part != NULL, return 0);
+
+ if (raw_part->end_head == 0 && raw_part->end_sector == 0) {
+ return chs_to_sector (disk->dev,
+ PED_LE16_TO_CPU(raw_part->end_cyl),
+ disk->dev->hw_geom.heads - 1,
+ disk->dev->hw_geom.sectors - 1);
+ } else {
+ return chs_to_sector (disk->dev,
+ PED_LE16_TO_CPU(raw_part->end_cyl),
+ raw_part->end_head,
+ raw_part->end_sector);
+ }
+}
+
+static int
+is_unused_partition(const PC98RawPartition* raw_part)
+{
+ if (raw_part->mid || raw_part->sid
+ || raw_part->ipl_sect
+ || raw_part->ipl_head
+ || PED_LE16_TO_CPU(raw_part->ipl_cyl)
+ || raw_part->sector
+ || raw_part->head
+ || PED_LE16_TO_CPU(raw_part->cyl)
+ || raw_part->end_sector
+ || raw_part->end_head
+ || PED_LE16_TO_CPU(raw_part->end_cyl))
+ return 0;
+ return 1;
+}
+
+static int
+read_table (PedDisk* disk)
+{
+ int i;
+ PC98RawTable table;
+ PedConstraint* constraint_any;
+
+ PED_ASSERT (disk != NULL, return 0);
+ PED_ASSERT (disk->dev != NULL, return 0);
+
+ constraint_any = ped_constraint_any (disk->dev);
+
+ if (!ped_device_read (disk->dev, (void*) &table, 0, 2))
+ goto error;
+
+ if (!pc98_check_magic(&table)) {
+ if (ped_exception_throw (
+ PED_EXCEPTION_ERROR, PED_EXCEPTION_IGNORE_CANCEL,
+ _("Invalid partition table on %s."),
+ disk->dev->path))
+ goto error;
+ }
+
+ for (i = 0; i < MAX_PART_COUNT; i++) {
+ PC98RawPartition* raw_part;
+ PedPartition* part;
+ PC98PartitionData* pc98_data;
+ PedSector part_start;
+ PedSector part_end;
+
+ raw_part = &table.partitions [i];
+
+ if (is_unused_partition(raw_part))
+ continue;
+
+ part_start = legacy_start (disk, raw_part);
+ part_end = legacy_end (disk, raw_part);
+
+ part = ped_partition_new (disk, 0, NULL, part_start, part_end);
+ if (!part)
+ goto error;
+ pc98_data = part->disk_specific;
+ PED_ASSERT (pc98_data != NULL, goto error);
+
+ pc98_data->system = (raw_part->mid << 8) | raw_part->sid;
+ pc98_data->boot = GET_BIT(raw_part->mid, 7);
+ pc98_data->hidden = !GET_BIT(raw_part->sid, 7);
+
+ ped_partition_set_name (part, raw_part->name);
+
+ pc98_data->ipl_sector = chs_to_sector (
+ disk->dev,
+ PED_LE16_TO_CPU(raw_part->ipl_cyl),
+ raw_part->ipl_head,
+ raw_part->ipl_sect);
+
+ /* hack */
+ if (pc98_data->ipl_sector == part->geom.start)
+ pc98_data->ipl_sector = 0;
+
+ part->num = i + 1;
+
+ if (!ped_disk_add_partition (disk, part, constraint_any))
+ goto error;
+
+ if (part->geom.start != part_start
+ || part->geom.end != part_end) {
+ ped_exception_throw (
+ PED_EXCEPTION_NO_FEATURE,
+ PED_EXCEPTION_CANCEL,
+ _("Partition %d isn't aligned to cylinder "
+ "boundaries. This is still unsupported."),
+ part->num);
+ goto error;
+ }
+
+ part->fs_type = ped_file_system_probe (&part->geom);
+ }
+
+ ped_constraint_destroy (constraint_any);
+ return 1;
+
+error:
+ ped_disk_delete_all (disk);
+ ped_constraint_destroy (constraint_any);
+ return 0;
+}
+
+static int
+pc98_read (PedDisk* disk)
+{
+ PED_ASSERT (disk != NULL, return 0);
+ PED_ASSERT (disk->dev != NULL, return 0);
+
+ ped_disk_delete_all (disk);
+ return read_table (disk);
+}
+
+#ifndef DISCOVER_ONLY
+static int
+fill_raw_part (PC98RawPartition* raw_part, const PedPartition* part)
+{
+ PC98PartitionData* pc98_data;
+ int c, h, s;
+ const char* name;
+
+ PED_ASSERT (raw_part != NULL, return 0);
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->disk_specific != NULL, return 0);
+
+ pc98_data = part->disk_specific;
+ raw_part->mid = (pc98_data->system >> 8) & 0xFF;
+ raw_part->sid = pc98_data->system & 0xFF;
+
+ SET_BIT(raw_part->mid, 7, pc98_data->boot);
+ SET_BIT(raw_part->sid, 7, !pc98_data->hidden);
+
+ memset (raw_part->name, ' ', sizeof(raw_part->name));
+ name = ped_partition_get_name (part);
+ PED_ASSERT (name != NULL, return 0);
+ PED_ASSERT (strlen (name) <= 16, return 0);
+ if (!strlen (name) && part->fs_type)
+ name = part->fs_type->name;
+ memcpy (raw_part->name, name, strlen (name));
+
+ sector_to_chs (part->disk->dev, part->geom.start, &c, &h, &s);
+ raw_part->cyl = PED_CPU_TO_LE16(c);
+ raw_part->head = h;
+ raw_part->sector = s;
+
+ if (pc98_data->ipl_sector) {
+ sector_to_chs (part->disk->dev, pc98_data->ipl_sector,
+ &c, &h, &s);
+ raw_part->ipl_cyl = PED_CPU_TO_LE16(c);
+ raw_part->ipl_head = h;
+ raw_part->ipl_sect = s;
+ } else {
+ raw_part->ipl_cyl = raw_part->cyl;
+ raw_part->ipl_head = raw_part->head;
+ raw_part->ipl_sect = raw_part->sector;
+ }
+
+ sector_to_chs (part->disk->dev, part->geom.end, &c, &h, &s);
+ if (h != part->disk->dev->hw_geom.heads - 1
+ || s != part->disk->dev->hw_geom.sectors - 1) {
+ ped_exception_throw (
+ PED_EXCEPTION_NO_FEATURE,
+ PED_EXCEPTION_CANCEL,
+ _("Partition %d isn't aligned to cylinder "
+ "boundaries. This is still unsupported."),
+ part->num);
+ return 0;
+ }
+ raw_part->end_cyl = PED_CPU_TO_LE16(c);
+#if 0
+ raw_part->end_head = h;
+ raw_part->end_sector = s;
+#else
+ raw_part->end_head = 0;
+ raw_part->end_sector = 0;
+#endif
+
+ return 1;
+}
+
+static int
+pc98_write (PedDisk* disk)
+{
+ PC98RawTable table;
+ PedPartition* part;
+ int i;
+
+ PED_ASSERT (disk != NULL, return 0);
+ PED_ASSERT (disk->dev != NULL, return 0);
+
+ if (!ped_device_read (disk->dev, &table, 0, 2))
+ return 0;
+
+ if (!pc98_check_ipl_signature (&table)) {
+ memset (table.boot_code, 0, sizeof(table.boot_code));
+ memcpy (table.boot_code, MBR_BOOT_CODE, sizeof(MBR_BOOT_CODE));
+ }
+
+ memset (table.partitions, 0, sizeof (table.partitions));
+ table.magic = PED_CPU_TO_LE16(PC9800_EXTFMT_MAGIC);
+
+ for (i = 1; i <= MAX_PART_COUNT; i++) {
+ part = ped_disk_get_partition (disk, i);
+ if (!part)
+ continue;
+
+ if (!fill_raw_part (&table.partitions [i - 1], part))
+ return 0;
+ }
+
+ if (!ped_device_write (disk->dev, (void*) &table, 0, 2))
+ return 0;
+ return ped_device_sync (disk->dev);
+}
+#endif /* !DISCOVER_ONLY */
+
+static PedPartition*
+pc98_partition_new (
+ const PedDisk* disk, PedPartitionType part_type,
+ const PedFileSystemType* fs_type, PedSector start, PedSector end)
+{
+ PedPartition* part;
+ PC98PartitionData* pc98_data;
+
+ part = _ped_partition_alloc (disk, part_type, fs_type, start, end);
+ if (!part)
+ goto error;
+
+ if (ped_partition_is_active (part)) {
+ part->disk_specific
+ = pc98_data = ped_malloc (sizeof (PC98PartitionData));
+ if (!pc98_data)
+ goto error_free_part;
+ pc98_data->ipl_sector = 0;
+ pc98_data->hidden = 0;
+ pc98_data->boot = 0;
+ strcpy (pc98_data->name, "");
+ } else {
+ part->disk_specific = NULL;
+ }
+ return part;
+
+error_free_pc98_data:
+ ped_free (pc98_data);
+error_free_part:
+ ped_free (part);
+error:
+ return 0;
+}
+
+static PedPartition*
+pc98_partition_duplicate (const PedPartition* part)
+{
+ PedPartition* new_part;
+ PC98PartitionData* new_pc98_data;
+ PC98PartitionData* old_pc98_data;
+
+ new_part = ped_partition_new (part->disk, part->type,
+ part->fs_type, part->geom.start,
+ part->geom.end);
+ if (!new_part)
+ return NULL;
+ new_part->num = part->num;
+
+ old_pc98_data = (PC98PartitionData*) part->disk_specific;
+ new_pc98_data = (PC98PartitionData*) new_part->disk_specific;
+
+ /* ugly, but C is ugly :p */
+ memcpy (new_pc98_data, old_pc98_data, sizeof (PC98PartitionData));
+ return new_part;
+}
+
+static void
+pc98_partition_destroy (PedPartition* part)
+{
+ PED_ASSERT (part != NULL, return);
+
+ if (ped_partition_is_active (part))
+ ped_free (part->disk_specific);
+ ped_free (part);
+}
+
+static int
+pc98_partition_set_system (PedPartition* part, const PedFileSystemType* fs_type)
+{
+ PC98PartitionData* pc98_data = part->disk_specific;
+
+ part->fs_type = fs_type;
+
+ pc98_data->system = 0x2062;
+ if (fs_type) {
+ if (!strcmp (fs_type->name, "fat16")) {
+ if (part->geom.length * 512 >= 32 * 1024 * 1024)
+ pc98_data->system = 0x2021;
+ else
+ pc98_data->system = 0x2011;
+ } else if (!strcmp (fs_type->name, "fat32")) {
+ pc98_data->system = 0x2061;
+ } else if (!strcmp (fs_type->name, "ntfs")) {
+ pc98_data->system = 0x2031;
+ } else if (!strncmp (fs_type->name, "ufs", 3)) {
+ pc98_data->system = 0x2044;
+ } else { /* ext2, reiser, xfs, etc. */
+ /* ext2 partitions must be marked boot */
+ pc98_data->boot = 1;
+ pc98_data->system = 0xa062;
+ }
+ }
+
+ if (pc98_data->boot)
+ pc98_data->system |= 0x8000;
+ if (!pc98_data->hidden)
+ pc98_data->system |= 0x0080;
+ return 1;
+}
+
+static int
+pc98_partition_set_flag (PedPartition* part, PedPartitionFlag flag, int state)
+{
+ PedDisk* disk;
+ PC98PartitionData* pc98_data;
+
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->disk_specific != NULL, return 0);
+
+ pc98_data = part->disk_specific;
+
+ switch (flag) {
+ case PED_PARTITION_HIDDEN:
+ pc98_data->hidden = state;
+ return ped_partition_set_system (part, part->fs_type);
+
+ case PED_PARTITION_BOOT:
+ pc98_data->boot = state;
+ return ped_partition_set_system (part, part->fs_type);
+
+ default:
+ return 0;
+ }
+}
+
+static int
+pc98_partition_get_flag (const PedPartition* part, PedPartitionFlag flag)
+{
+ PC98PartitionData* pc98_data;
+
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->disk_specific != NULL, return 0);
+
+ pc98_data = part->disk_specific;
+ switch (flag) {
+ case PED_PARTITION_HIDDEN:
+ return pc98_data->hidden;
+
+ case PED_PARTITION_BOOT:
+ return pc98_data->boot;
+
+ default:
+ return 0;
+ }
+}
+
+static int
+pc98_partition_is_flag_available (
+ const PedPartition* part, PedPartitionFlag flag)
+{
+ switch (flag) {
+ case PED_PARTITION_HIDDEN:
+ case PED_PARTITION_BOOT:
+ return 1;
+
+ default:
+ return 0;
+ }
+}
+
+static void
+pc98_partition_set_name (PedPartition* part, const char* name)
+{
+ PC98PartitionData* pc98_data;
+ int i;
+
+ PED_ASSERT (part != NULL, return);
+ PED_ASSERT (part->disk_specific != NULL, return);
+ pc98_data = part->disk_specific;
+
+ strncpy (pc98_data->name, name, 16);
+ pc98_data->name [16] = 0;
+ for (i = strlen (pc98_data->name) - 1; pc98_data->name[i] == ' '; i--)
+ pc98_data->name [i] = 0;
+}
+
+static const char*
+pc98_partition_get_name (const PedPartition* part)
+{
+ PC98PartitionData* pc98_data;
+
+ PED_ASSERT (part != NULL, return NULL);
+ PED_ASSERT (part->disk_specific != NULL, return NULL);
+ pc98_data = part->disk_specific;
+
+ return pc98_data->name;
+}
+
+static PedConstraint*
+_primary_constraint (PedDisk* disk)
+{
+ PedDevice* dev = disk->dev;
+ PedAlignment start_align;
+ PedAlignment end_align;
+ PedGeometry max_geom;
+ PedSector cylinder_size;
+
+ cylinder_size = dev->hw_geom.sectors * dev->hw_geom.heads;
+
+ if (!ped_alignment_init (&start_align, 0, cylinder_size))
+ return NULL;
+ if (!ped_alignment_init (&end_align, -1, cylinder_size))
+ return NULL;
+ if (!ped_geometry_init (&max_geom, dev, cylinder_size,
+ dev->length - cylinder_size))
+ return NULL;
+
+ return ped_constraint_new (&start_align, &end_align, &max_geom,
+ &max_geom, 1, dev->length);
+}
+
+static int
+pc98_partition_align (PedPartition* part, const PedConstraint* constraint)
+{
+ PED_ASSERT (part != NULL, return 0);
+
+ if (_ped_partition_attempt_align (part, constraint,
+ _primary_constraint (part->disk)))
+ return 1;
+
+#ifndef DISCOVER_ONLY
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Unable to satisfy all constraints on the partition."));
+#endif
+ return 0;
+}
+
+static int
+next_primary (PedDisk* disk)
+{
+ int i;
+ for (i=1; i<=MAX_PART_COUNT; i++) {
+ if (!ped_disk_get_partition (disk, i))
+ return i;
+ }
+ return 0;
+}
+
+static int
+pc98_partition_enumerate (PedPartition* part)
+{
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->disk != NULL, return 0);
+
+ /* don't re-number a partition */
+ if (part->num != -1)
+ return 1;
+
+ PED_ASSERT (ped_partition_is_active (part), return 0);
+
+ part->num = next_primary (part->disk);
+ if (!part->num) {
+ ped_exception_throw (PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Can't add another partition."));
+ return 0;
+ }
+
+ return 1;
+}
+
+static int
+pc98_alloc_metadata (PedDisk* disk)
+{
+ PedPartition* new_part;
+ PedConstraint* constraint_any = NULL;
+ PedSector cyl_size;
+
+ PED_ASSERT (disk != NULL, goto error);
+ PED_ASSERT (disk->dev != NULL, goto error);
+
+ constraint_any = ped_constraint_any (disk->dev);
+
+ cyl_size = disk->dev->hw_geom.sectors * disk->dev->hw_geom.heads;
+ new_part = ped_partition_new (disk, PED_PARTITION_METADATA, NULL,
+ 0, cyl_size - 1);
+ if (!new_part)
+ goto error;
+
+ if (!ped_disk_add_partition (disk, new_part, constraint_any)) {
+ ped_partition_destroy (new_part);
+ goto error;
+ }
+
+ ped_constraint_destroy (constraint_any);
+ return 1;
+
+error:
+ ped_constraint_destroy (constraint_any);
+ return 0;
+}
+
+static int
+pc98_get_max_primary_partition_count (const PedDisk* disk)
+{
+ return MAX_PART_COUNT;
+}
+
+static PedDiskOps pc98_disk_ops = {
+ probe: pc98_probe,
+#ifndef DISCOVER_ONLY
+ clobber: pc98_clobber,
+#else
+ clobber: NULL,
+#endif
+ alloc: pc98_alloc,
+ duplicate: pc98_duplicate,
+ free: pc98_free,
+ read: pc98_read,
+#ifndef DISCOVER_ONLY
+ write: pc98_write,
+#else
+ write: NULL,
+#endif
+
+ partition_new: pc98_partition_new,
+ partition_duplicate: pc98_partition_duplicate,
+ partition_destroy: pc98_partition_destroy,
+ partition_set_system: pc98_partition_set_system,
+ partition_set_flag: pc98_partition_set_flag,
+ partition_get_flag: pc98_partition_get_flag,
+ partition_is_flag_available: pc98_partition_is_flag_available,
+ partition_set_name: pc98_partition_set_name,
+ partition_get_name: pc98_partition_get_name,
+ partition_align: pc98_partition_align,
+ partition_enumerate: pc98_partition_enumerate,
+
+ alloc_metadata: pc98_alloc_metadata,
+ get_max_primary_partition_count:
+ pc98_get_max_primary_partition_count
+};
+
+static PedDiskType pc98_disk_type = {
+ next: NULL,
+ name: "pc98",
+ ops: &pc98_disk_ops,
+ features: PED_DISK_TYPE_PARTITION_NAME
+};
+
+void
+ped_disk_pc98_init ()
+{
+ PED_ASSERT (sizeof (PC98RawTable) == 512 * 2, return);
+ ped_register_disk_type (&pc98_disk_type);
+}
+
+void
+ped_disk_pc98_done ()
+{
+ ped_unregister_disk_type (&pc98_disk_type);
+}
diff --git a/libparted/labels/rdb.c b/libparted/labels/rdb.c
new file mode 100644
index 0000000..b8fb920
--- /dev/null
+++ b/libparted/labels/rdb.c
@@ -0,0 +1,1191 @@
+/* -*- Mode: c; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+
+ libparted - a library for manipulating disk partitions
+ disk_amiga.c - libparted module to manipulate amiga RDB partition tables.
+ Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+
+ Contributor: Sven Luther <luther@debian.org>
+*/
+
+#include "config.h"
+
+#include <string.h>
+
+#include <parted/parted.h>
+#include <parted/debug.h>
+#include <parted/endian.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+/* String manipulation */
+static void _amiga_set_bstr (const char *cstr, char *bstr, int maxsize) {
+ int size = strlen (cstr);
+ int i;
+
+ if (size >= maxsize) return;
+ bstr[0] = size;
+ for (i = 0; i<size; i++) bstr[i+1] = cstr[i];
+}
+static const char * _amiga_get_bstr (char * bstr) {
+ char * cstr = bstr + 1;
+ int size = bstr[0];
+
+ cstr[size] = '\0';
+ return cstr;
+}
+
+#define IDNAME_RIGIDDISK (uint32_t)0x5244534B /* 'RDSK' */
+#define IDNAME_BADBLOCK (uint32_t)0x42414442 /* 'BADB' */
+#define IDNAME_PARTITION (uint32_t)0x50415254 /* 'PART' */
+#define IDNAME_FILESYSHEADER (uint32_t)0x46534844 /* 'FSHD' */
+#define IDNAME_LOADSEG (uint32_t)0x4C534547 /* 'LSEG' */
+#define IDNAME_BOOT (uint32_t)0x424f4f54 /* 'BOOT' */
+#define IDNAME_FREE (uint32_t)0xffffffff
+
+static const char *
+_amiga_block_id (uint32_t id) {
+ switch (id) {
+ case IDNAME_RIGIDDISK :
+ return "RDSK";
+ case IDNAME_BADBLOCK :
+ return "BADB";
+ case IDNAME_PARTITION :
+ return "PART";
+ case IDNAME_FILESYSHEADER :
+ return "FSHD";
+ case IDNAME_LOADSEG :
+ return "LSEG";
+ case IDNAME_BOOT :
+ return "BOOT";
+ case IDNAME_FREE :
+ return "<free>";
+ default :
+ return "<unknown>";
+ }
+}
+static int
+_amiga_valid_block_id (uint32_t id) {
+ switch (id) {
+ case IDNAME_RIGIDDISK :
+ case IDNAME_BADBLOCK :
+ case IDNAME_PARTITION :
+ case IDNAME_FILESYSHEADER :
+ case IDNAME_LOADSEG :
+ case IDNAME_BOOT :
+ return 1;
+ case IDNAME_FREE :
+ default :
+ return 0;
+ }
+}
+
+struct AmigaIds {
+ uint32_t ID;
+ struct AmigaIds *next;
+};
+
+static struct AmigaIds *
+_amiga_add_id (uint32_t id, struct AmigaIds *ids) {
+ struct AmigaIds *newid;
+
+ if ((newid=ped_malloc(sizeof (struct AmigaIds)))==NULL)
+ return 0;
+ newid->ID = id;
+ newid->next = ids;
+ return newid;
+}
+
+static void
+_amiga_free_ids (struct AmigaIds *ids) {
+ struct AmigaIds *current, *next;
+
+ for (current = ids; current != NULL; current = next) {
+ next = current->next;
+ ped_free (current);
+ }
+}
+static int
+_amiga_id_in_list (uint32_t id, struct AmigaIds *ids) {
+ struct AmigaIds *current;
+
+ for (current = ids; current != NULL; current = current->next) {
+ if (id == current->ID)
+ return 1;
+ }
+ return 0;
+}
+
+struct AmigaBlock {
+ uint32_t amiga_ID; /* Identifier 32 bit word */
+ uint32_t amiga_SummedLongss; /* Size of the structure for checksums */
+ int32_t amiga_ChkSum; /* Checksum of the structure */
+};
+#define AMIGA(pos) ((struct AmigaBlock *)(pos))
+
+static int
+_amiga_checksum (struct AmigaBlock *blk) {
+ uint32_t *rdb = (uint32_t *) blk;
+ uint32_t sum;
+ int i, end;
+
+ sum = PED_BE32_TO_CPU (rdb[0]);
+ end = PED_BE32_TO_CPU (rdb[1]);
+
+ if (end > PED_SECTOR_SIZE_DEFAULT) end = PED_SECTOR_SIZE_DEFAULT;
+
+ for (i = 1; i < end; i++) sum += PED_BE32_TO_CPU (rdb[i]);
+
+ return sum;
+}
+
+static void
+_amiga_calculate_checksum (struct AmigaBlock *blk) {
+ blk->amiga_ChkSum = PED_CPU_TO_BE32(
+ PED_BE32_TO_CPU(blk->amiga_ChkSum) -
+ _amiga_checksum((struct AmigaBlock *) blk));
+ return;
+}
+
+static struct AmigaBlock *
+_amiga_read_block (const PedDevice *dev, struct AmigaBlock *blk,
+ PedSector block, struct AmigaIds *ids)
+{
+ if (!ped_device_read (dev, blk, block, 1))
+ return NULL;
+ if (ids && !_amiga_id_in_list(PED_BE32_TO_CPU(blk->amiga_ID), ids))
+ return NULL;
+ if (_amiga_checksum (blk) != 0) {
+ switch (ped_exception_throw(PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_FIX | PED_EXCEPTION_IGNORE | PED_EXCEPTION_CANCEL,
+ _("%s : Bad checksum on block %llu of type %s."),
+ __func__, block, _amiga_block_id(PED_BE32_TO_CPU(blk->amiga_ID))))
+ {
+ case PED_EXCEPTION_CANCEL :
+ return NULL;
+ case PED_EXCEPTION_FIX :
+ _amiga_calculate_checksum(AMIGA(blk));
+ if (!ped_device_write ((PedDevice*)dev, blk, block, 1))
+ return NULL;
+ case PED_EXCEPTION_IGNORE :
+ case PED_EXCEPTION_UNHANDLED :
+ default :
+ return blk;
+ }
+ }
+ return blk;
+}
+
+struct RigidDiskBlock {
+ uint32_t rdb_ID; /* Identifier 32 bit word : 'RDSK' */
+ uint32_t rdb_SummedLongs; /* Size of the structure for checksums */
+ int32_t rdb_ChkSum; /* Checksum of the structure */
+ uint32_t rdb_HostID; /* SCSI Target ID of host, not really used */
+ uint32_t rdb_BlockBytes; /* Size of disk blocks */
+ uint32_t rdb_Flags; /* RDB Flags */
+ /* block list heads */
+ uint32_t rdb_BadBlockList; /* Bad block list */
+ uint32_t rdb_PartitionList; /* Partition list */
+ uint32_t rdb_FileSysHeaderList; /* File system header list */
+ uint32_t rdb_DriveInit; /* Drive specific init code */
+ uint32_t rdb_BootBlockList; /* Amiga OS 4 Boot Blocks */
+ uint32_t rdb_Reserved1[5]; /* Unused word, need to be set to $ffffffff */
+ /* physical drive characteristics */
+ uint32_t rdb_Cylinders; /* Number of the cylinders of the drive */
+ uint32_t rdb_Sectors; /* Number of sectors of the drive */
+ uint32_t rdb_Heads; /* Number of heads of the drive */
+ uint32_t rdb_Interleave; /* Interleave */
+ uint32_t rdb_Park; /* Head parking cylinder */
+ uint32_t rdb_Reserved2[3]; /* Unused word, need to be set to $ffffffff */
+ uint32_t rdb_WritePreComp; /* Starting cylinder of write precompensation */
+ uint32_t rdb_ReducedWrite; /* Starting cylinder of reduced write current */
+ uint32_t rdb_StepRate; /* Step rate of the drive */
+ uint32_t rdb_Reserved3[5]; /* Unused word, need to be set to $ffffffff */
+ /* logical drive characteristics */
+ uint32_t rdb_RDBBlocksLo; /* low block of range reserved for hardblocks */
+ uint32_t rdb_RDBBlocksHi; /* high block of range for these hardblocks */
+ uint32_t rdb_LoCylinder; /* low cylinder of partitionable disk area */
+ uint32_t rdb_HiCylinder; /* high cylinder of partitionable data area */
+ uint32_t rdb_CylBlocks; /* number of blocks available per cylinder */
+ uint32_t rdb_AutoParkSeconds; /* zero for no auto park */
+ uint32_t rdb_HighRDSKBlock; /* highest block used by RDSK */
+ /* (not including replacement bad blocks) */
+ uint32_t rdb_Reserved4;
+ /* drive identification */
+ char rdb_DiskVendor[8];
+ char rdb_DiskProduct[16];
+ char rdb_DiskRevision[4];
+ char rdb_ControllerVendor[8];
+ char rdb_ControllerProduct[16];
+ char rdb_ControllerRevision[4];
+ uint32_t rdb_Reserved5[10];
+};
+
+#define RDSK(pos) ((struct RigidDiskBlock *)(pos))
+
+#define AMIGA_RDB_NOT_FOUND ((uint32_t)0xffffffff)
+#define RDB_LOCATION_LIMIT 16
+#define AMIGA_MAX_PARTITIONS 128
+#define MAX_RDB_BLOCK (RDB_LOCATION_LIMIT + 2 * AMIGA_MAX_PARTITIONS + 2)
+
+static uint32_t
+_amiga_find_rdb (const PedDevice *dev, struct RigidDiskBlock *rdb) {
+ int i;
+ struct AmigaIds *ids;
+
+ ids = _amiga_add_id (IDNAME_RIGIDDISK, NULL);
+
+ for (i = 0; i<RDB_LOCATION_LIMIT; i++) {
+ if (!_amiga_read_block (dev, AMIGA(rdb), i, ids)) {
+ continue;
+ }
+ if (PED_BE32_TO_CPU (rdb->rdb_ID) == IDNAME_RIGIDDISK) {
+ _amiga_free_ids (ids);
+ return i;
+ }
+ }
+ _amiga_free_ids (ids);
+ return AMIGA_RDB_NOT_FOUND;
+}
+
+struct PartitionBlock {
+ uint32_t pb_ID; /* Identifier 32 bit word : 'PART' */
+ uint32_t pb_SummedLongs; /* Size of the structure for checksums */
+ int32_t pb_ChkSum; /* Checksum of the structure */
+ uint32_t pb_HostID; /* SCSI Target ID of host, not really used */
+ uint32_t pb_Next; /* Block number of the next PartitionBlock */
+ uint32_t pb_Flags; /* Part Flags (NOMOUNT and BOOTABLE) */
+ uint32_t pb_Reserved1[2];
+ uint32_t pb_DevFlags; /* Preferred flags for OpenDevice */
+ char pb_DriveName[32]; /* Preferred DOS device name: BSTR form */
+ uint32_t pb_Reserved2[15];
+ uint32_t de_TableSize; /* Size of Environment vector */
+ /* Size of the blocks in 32 bit words, usually 128 */
+ uint32_t de_SizeBlock;
+ uint32_t de_SecOrg; /* Not used; must be 0 */
+ uint32_t de_Surfaces; /* Number of heads (surfaces) */
+ /* Disk sectors per block, used with SizeBlock, usually 1 */
+ uint32_t de_SectorPerBlock;
+ uint32_t de_BlocksPerTrack; /* Blocks per track. drive specific */
+ uint32_t de_Reserved; /* DOS reserved blocks at start of partition. */
+ uint32_t de_PreAlloc; /* DOS reserved blocks at end of partition */
+ uint32_t de_Interleave; /* Not used, usually 0 */
+ uint32_t de_LowCyl; /* First cylinder of the partition */
+ uint32_t de_HighCyl; /* Last cylinder of the partition */
+ uint32_t de_NumBuffers; /* Initial # DOS of buffers. */
+ uint32_t de_BufMemType; /* Type of mem to allocate for buffers */
+ uint32_t de_MaxTransfer; /* Max number of bytes to transfer at a time */
+ uint32_t de_Mask; /* Address Mask to block out certain memory */
+ int32_t de_BootPri; /* Boot priority for autoboot */
+ uint32_t de_DosType; /* Dostype of the file system */
+ uint32_t de_Baud; /* Baud rate for serial handler */
+ uint32_t de_Control; /* Control word for handler/filesystem */
+ uint32_t de_BootBlocks; /* Number of blocks containing boot code */
+ uint32_t pb_EReserved[12];
+};
+
+#define PART(pos) ((struct PartitionBlock *)(pos))
+
+#define PBFB_BOOTABLE 0 /* this partition is intended to be bootable */
+#define PBFF_BOOTABLE 1L /* (expected directories and files exist) */
+#define PBFB_NOMOUNT 1 /* do not mount this partition (e.g. manually */
+#define PBFF_NOMOUNT 2L /* mounted, but space reserved here) */
+#define PBFB_RAID 2 /* this partition is intended to be part of */
+#define PBFF_RAID 4L /* a RAID array */
+#define PBFB_LVM 3 /* this partition is intended to be part of */
+#define PBFF_LVM 8L /* a LVM volume group */
+
+
+struct LinkedBlock {
+ uint32_t lk_ID; /* Identifier 32 bit word */
+ uint32_t lk_SummedLongs; /* Size of the structure for checksums */
+ int32_t lk_ChkSum; /* Checksum of the structure */
+ uint32_t pb_HostID; /* SCSI Target ID of host, not really used */
+ uint32_t lk_Next; /* Block number of the next PartitionBlock */
+};
+struct Linked2Block {
+ uint32_t lk2_ID; /* Identifier 32 bit word */
+ uint32_t lk2_SummedLongs; /* Size of the structure for checksums */
+ int32_t lk2_ChkSum; /* Checksum of the structure */
+ uint32_t lk2_HostID; /* SCSI Target ID of host, not really used */
+ uint32_t lk2_Next; /* Block number of the next PartitionBlock */
+ uint32_t lk2_Reverved[13];
+ uint32_t lk2_Linked; /* Secondary linked list */
+};
+#define LINK_END (uint32_t)0xffffffff
+#define LNK(pos) ((struct LinkedBlock *)(pos))
+#define LNK2(pos) ((struct Linked2Block *)(pos))
+
+
+static PedDiskType amiga_disk_type;
+
+static int
+amiga_probe (const PedDevice *dev)
+{
+ struct RigidDiskBlock *rdb;
+ uint32_t found;
+ PED_ASSERT(dev != NULL, return 0);
+
+ if ((rdb=RDSK(ped_malloc(dev->sector_size)))==NULL)
+ return 0;
+ found = _amiga_find_rdb (dev, rdb);
+ ped_free (rdb);
+
+ return (found == AMIGA_RDB_NOT_FOUND ? 0 : 1);
+}
+
+static PedDisk*
+amiga_alloc (const PedDevice* dev)
+{
+ PedDisk *disk;
+ struct AmigaDisk *adsk;
+ struct RigidDiskBlock *rdb;
+ PedSector cyl_size;
+ int highest_cylinder, highest_block;
+
+ PED_ASSERT(dev != NULL, return NULL);
+ cyl_size = dev->hw_geom.sectors * dev->hw_geom.heads;
+
+ if (!(disk = _ped_disk_alloc (dev, &amiga_disk_type)))
+ return NULL;
+
+ if (!(disk->disk_specific = ped_malloc (PED_SECTOR_SIZE_DEFAULT))) {
+ ped_free (disk);
+ return NULL;
+ }
+ rdb = disk->disk_specific;
+
+ memset(rdb, 0, sizeof(struct RigidDiskBlock));
+
+ rdb->rdb_ID = PED_CPU_TO_BE32 (IDNAME_RIGIDDISK);
+ rdb->rdb_SummedLongs = PED_CPU_TO_BE32 (64);
+ rdb->rdb_HostID = PED_CPU_TO_BE32 (0);
+ rdb->rdb_BlockBytes = PED_CPU_TO_BE32 (PED_SECTOR_SIZE_DEFAULT);
+ rdb->rdb_Flags = PED_CPU_TO_BE32 (0);
+
+ /* Block lists */
+ rdb->rdb_BadBlockList = PED_CPU_TO_BE32 (LINK_END);
+ rdb->rdb_PartitionList = PED_CPU_TO_BE32 (LINK_END);
+ rdb->rdb_FileSysHeaderList = PED_CPU_TO_BE32 (LINK_END);
+ rdb->rdb_DriveInit = PED_CPU_TO_BE32 (LINK_END);
+ rdb->rdb_BootBlockList = PED_CPU_TO_BE32 (LINK_END);
+
+ /* Physical drive characteristics */
+ rdb->rdb_Cylinders = PED_CPU_TO_BE32 (dev->hw_geom.cylinders);
+ rdb->rdb_Sectors = PED_CPU_TO_BE32 (dev->hw_geom.sectors);
+ rdb->rdb_Heads = PED_CPU_TO_BE32 (dev->hw_geom.heads);
+ rdb->rdb_Interleave = PED_CPU_TO_BE32 (0);
+ rdb->rdb_Park = PED_CPU_TO_BE32 (dev->hw_geom.cylinders);
+ rdb->rdb_WritePreComp = PED_CPU_TO_BE32 (dev->hw_geom.cylinders);
+ rdb->rdb_ReducedWrite = PED_CPU_TO_BE32 (dev->hw_geom.cylinders);
+ rdb->rdb_StepRate = PED_CPU_TO_BE32 (0);
+
+ highest_cylinder = 1 + MAX_RDB_BLOCK / cyl_size;
+ highest_block = highest_cylinder * cyl_size - 1;
+
+ /* Logical driver characteristics */
+ rdb->rdb_RDBBlocksLo = PED_CPU_TO_BE32 (0);
+ rdb->rdb_RDBBlocksHi = PED_CPU_TO_BE32 (highest_block);
+ rdb->rdb_LoCylinder = PED_CPU_TO_BE32 (highest_cylinder);
+ rdb->rdb_HiCylinder = PED_CPU_TO_BE32 (dev->hw_geom.cylinders -1);
+ rdb->rdb_CylBlocks = PED_CPU_TO_BE32 (cyl_size);
+ rdb->rdb_AutoParkSeconds = PED_CPU_TO_BE32 (0);
+ /* rdb_HighRDSKBlock will only be set when writing */
+ rdb->rdb_HighRDSKBlock = PED_CPU_TO_BE32 (0);
+
+ /* Driver identification */
+ _amiga_set_bstr("", rdb->rdb_DiskVendor, 8);
+ _amiga_set_bstr(dev->model, rdb->rdb_DiskProduct, 16);
+ _amiga_set_bstr("", rdb->rdb_DiskRevision, 4);
+ _amiga_set_bstr("", rdb->rdb_ControllerVendor, 8);
+ _amiga_set_bstr("", rdb->rdb_ControllerProduct, 16);
+ _amiga_set_bstr("", rdb->rdb_ControllerRevision, 4);
+
+ /* And calculate the checksum */
+ _amiga_calculate_checksum ((struct AmigaBlock *) rdb);
+
+ return disk;
+}
+
+static PedDisk*
+amiga_duplicate (const PedDisk* disk)
+{
+ PedDisk* new_disk;
+ struct RigidDiskBlock * new_rdb;
+ struct RigidDiskBlock * old_rdb;
+ PED_ASSERT(disk != NULL, return NULL);
+ PED_ASSERT(disk->dev != NULL, return NULL);
+ PED_ASSERT(disk->disk_specific != NULL, return NULL);
+
+ old_rdb = (struct RigidDiskBlock *) disk->disk_specific;
+
+ if (!(new_disk = ped_disk_new_fresh (disk->dev, &amiga_disk_type)))
+ return NULL;
+
+ new_rdb = (struct RigidDiskBlock *) new_disk->disk_specific;
+ memcpy (new_rdb, old_rdb, 256);
+ return new_disk;
+}
+
+static void
+amiga_free (PedDisk* disk)
+{
+ PED_ASSERT(disk != NULL, return);
+ PED_ASSERT(disk->disk_specific != NULL, return);
+
+ ped_free (disk->disk_specific);
+ _ped_disk_free (disk);
+}
+
+#ifndef DISCOVER_ONLY
+static int
+amiga_clobber (PedDevice* dev)
+{
+ struct RigidDiskBlock *rdb;
+ uint32_t i;
+ int result = 0;
+ PED_ASSERT(dev != NULL, return 0);
+
+ if ((rdb=RDSK(ped_malloc(PED_SECTOR_SIZE_DEFAULT)))==NULL)
+ return 0;
+
+ while ((i = _amiga_find_rdb (dev, rdb)) != AMIGA_RDB_NOT_FOUND) {
+ rdb->rdb_ID = PED_CPU_TO_BE32 (0);
+ result = ped_device_write (dev, (void*) rdb, i, 1);
+ }
+
+ ped_free (rdb);
+
+ return result;
+}
+#endif /* !DISCOVER_ONLY */
+
+static int
+_amiga_loop_check (uint32_t block, uint32_t * blocklist, uint32_t max)
+{
+ uint32_t i;
+
+ for (i = 0; i < max; i++)
+ if (block == blocklist[i]) {
+ /* We are looping, let's stop. */
+ return 1;
+ }
+ blocklist[max] = block;
+ return 0;
+}
+
+/* We have already allocated a rdb, we are now reading it from the disk */
+static int
+amiga_read (PedDisk* disk)
+{
+ struct RigidDiskBlock *rdb;
+ struct PartitionBlock *partition;
+ uint32_t partblock;
+ uint32_t partlist[AMIGA_MAX_PARTITIONS];
+ PedSector cylblocks;
+ int i;
+
+ PED_ASSERT(disk != NULL, return 0);
+ PED_ASSERT(disk->dev != NULL, return 0);
+ PED_ASSERT(disk->dev->sector_size % 512 == 0, return 0);
+ PED_ASSERT(disk->disk_specific != NULL, return 0);
+ rdb = RDSK(disk->disk_specific);
+
+ if (_amiga_find_rdb (disk->dev, rdb) == AMIGA_RDB_NOT_FOUND) {
+ ped_exception_throw(PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("%s : Didn't find rdb block, should never happen."), __func__);
+ return 0;
+ }
+
+ /* Let's copy the rdb read geometry to the dev */
+ /* FIXME: should this go into disk->dev->bios_geom instead? */
+ disk->dev->hw_geom.cylinders = PED_BE32_TO_CPU (rdb->rdb_Cylinders);
+ disk->dev->hw_geom.heads = PED_BE32_TO_CPU (rdb->rdb_Heads);
+ disk->dev->hw_geom.sectors = PED_BE32_TO_CPU (rdb->rdb_Sectors);
+ cylblocks = (PedSector) PED_BE32_TO_CPU (rdb->rdb_Heads) *
+ (PedSector) PED_BE32_TO_CPU (rdb->rdb_Sectors);
+
+ /* Remove all partitions in the former in memory table */
+ ped_disk_delete_all (disk);
+
+ /* Let's allocate a partition block */
+ if (!(partition = ped_malloc (disk->dev->sector_size)))
+ return 0;
+
+ /* We initialize the hardblock free list to detect loops */
+ for (i = 0; i < AMIGA_MAX_PARTITIONS; i++) partlist[i] = LINK_END;
+
+ for (i = 1, partblock = PED_BE32_TO_CPU(rdb->rdb_PartitionList);
+ i < AMIGA_MAX_PARTITIONS && partblock != LINK_END;
+ i++, partblock = PED_BE32_TO_CPU(partition->pb_Next))
+ {
+ PedPartition *part;
+ PedSector start, end;
+ struct DosEnvec *de;
+ PedConstraint *constraint_exact;
+ int j;
+
+ /* Let's look for loops in the partition table */
+ if (_amiga_loop_check(partblock, partlist, i)) {
+ break;
+ }
+
+ /* Let's allocate and read a partition block to get its geometry*/
+ if (!_amiga_read_block (disk->dev, AMIGA(partition),
+ (PedSector)partblock, NULL)) {
+ ped_free(partition);
+ return 0;
+ }
+
+ start = ((PedSector) PED_BE32_TO_CPU (partition->de_LowCyl))
+ * cylblocks;
+ end = (((PedSector) PED_BE32_TO_CPU (partition->de_HighCyl))
+ + 1) * cylblocks - 1;
+
+ /* We can now construct a new partition */
+ if (!(part = ped_partition_new (disk, 0, NULL, start, end))) {
+ ped_free(partition);
+ return 0;
+ }
+ /* And copy over the partition block */
+ memcpy(part->disk_specific, partition, 256);
+
+ part->num = i;
+ part->type = 0;
+ /* Let's probe what file system is present on the disk */
+ part->fs_type = ped_file_system_probe (&part->geom);
+
+ constraint_exact = ped_constraint_exact (&part->geom);
+ if (!ped_disk_add_partition (disk, part, constraint_exact)) {
+ ped_partition_destroy(part);
+ ped_free(partition);
+ return 0;
+ }
+ ped_constraint_destroy (constraint_exact);
+ }
+ return 1;
+}
+
+static int
+_amiga_find_free_blocks(PedDisk *disk, uint32_t *table,
+ struct LinkedBlock *block, uint32_t first, uint32_t type)
+{
+ PedSector next;
+
+ PED_ASSERT(disk != NULL, return 0);
+ PED_ASSERT(disk->dev != NULL, return 0);
+
+ for (next = first; next != LINK_END; next = PED_BE32_TO_CPU(block->lk_Next)) {
+ if (table[next] != IDNAME_FREE) {
+ switch (ped_exception_throw(PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_FIX | PED_EXCEPTION_IGNORE | PED_EXCEPTION_CANCEL,
+ _("%s : Loop detected at block %d."), __func__, next))
+ {
+ case PED_EXCEPTION_CANCEL :
+ return 0;
+ case PED_EXCEPTION_FIX :
+ /* TODO : Need to add fixing code */
+ case PED_EXCEPTION_IGNORE :
+ case PED_EXCEPTION_UNHANDLED :
+ default :
+ return 1;
+ }
+ }
+
+ if (!_amiga_read_block (disk->dev, AMIGA(block), next, NULL)) {
+ return 0;
+ }
+ if (PED_BE32_TO_CPU(block->lk_ID) != type) {
+ switch (ped_exception_throw(PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("%s : The %s list seems bad at block %s."),
+ __func__, _amiga_block_id(PED_BE32_TO_CPU(block->lk_ID)), next))
+ {
+ /* TODO : to more subtile things here */
+ case PED_EXCEPTION_CANCEL :
+ case PED_EXCEPTION_UNHANDLED :
+ default :
+ return 0;
+ }
+ }
+ table[next] = type;
+ if (PED_BE32_TO_CPU(block->lk_ID) == IDNAME_FILESYSHEADER) {
+ if (_amiga_find_free_blocks(disk, table, block,
+ PED_BE32_TO_CPU(LNK2(block)->lk2_Linked),
+ IDNAME_LOADSEG) == 0) return 0;
+ }
+ }
+ return 1;
+}
+static uint32_t
+_amiga_next_free_block(uint32_t *table, uint32_t start, uint32_t type) {
+ int i;
+
+ for (i = start; table[i] != type && table[i] != IDNAME_FREE; i++);
+ return i;
+}
+static PedPartition *
+_amiga_next_real_partition(PedDisk *disk, PedPartition *part) {
+ PedPartition *next;
+
+ for (next = ped_disk_next_partition (disk, part);
+ next != NULL && !ped_partition_is_active (next);
+ next = ped_disk_next_partition (disk, next));
+ return next;
+}
+#ifndef DISCOVER_ONLY
+static int
+amiga_write (PedDisk* disk)
+{
+ struct RigidDiskBlock *rdb;
+ struct LinkedBlock *block;
+ struct PartitionBlock *partition;
+ PedPartition *part, *next_part;
+ PedSector cylblocks, first_hb, last_hb, last_used_hb;
+ uint32_t * table;
+ uint32_t i, rdb_block, max_part;
+ uint32_t rdb_num, part_num, block_num, next_num;
+
+ PED_ASSERT (disk != NULL, return 0;);
+ PED_ASSERT (disk->dev != NULL, return 0;);
+ PED_ASSERT (disk->disk_specific != NULL, return 0;);
+
+ if (!(rdb = ped_malloc (PED_SECTOR_SIZE_DEFAULT)))
+ return 0;
+
+ /* Let's read the rdb */
+ if ((rdb_num = _amiga_find_rdb (disk->dev, rdb)) == AMIGA_RDB_NOT_FOUND) {
+ rdb_num = 2;
+ } else {
+ memcpy (RDSK(disk->disk_specific), rdb, PED_SECTOR_SIZE_DEFAULT);
+ }
+ ped_free (rdb);
+ rdb = RDSK(disk->disk_specific);
+
+ cylblocks = (PedSector) PED_BE32_TO_CPU (rdb->rdb_Heads) *
+ (PedSector) PED_BE32_TO_CPU (rdb->rdb_Sectors);
+ first_hb = (PedSector) PED_BE32_TO_CPU (rdb->rdb_RDBBlocksLo);
+ last_hb = (PedSector) PED_BE32_TO_CPU (rdb->rdb_RDBBlocksHi);
+ last_used_hb = (PedSector) PED_BE32_TO_CPU (rdb->rdb_HighRDSKBlock);
+
+ /* let's allocate a free block table and initialize it */
+ if (!(table = ped_malloc ((last_hb - first_hb + 1) * sizeof(uint32_t))))
+ return 0;
+
+ memset(table, 0xff, (last_hb - first_hb + 1) * sizeof(uint32_t));
+ for (i = 0; i<=rdb_num; i++) table[i] = IDNAME_RIGIDDISK;
+
+ /* Let's allocate a partition block */
+ if (!(block = ped_malloc (PED_SECTOR_SIZE_DEFAULT))) {
+ ped_free (table);
+ return 0;
+ }
+
+ /* And fill the free block table */
+ if (_amiga_find_free_blocks(disk, table, block,
+ PED_BE32_TO_CPU (rdb->rdb_BadBlockList), IDNAME_BADBLOCK) == 0)
+ {
+ ped_exception_throw(PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("%s : Failed to list bad blocks."), __func__);
+ goto error_free_table;
+ }
+ if (_amiga_find_free_blocks(disk, table, block,
+ PED_BE32_TO_CPU (rdb->rdb_PartitionList), IDNAME_PARTITION) == 0)
+ {
+ ped_exception_throw(PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("%s : Failed to list partition blocks."), __func__);
+ goto error_free_table;
+ }
+ if (_amiga_find_free_blocks(disk, table, block,
+ PED_BE32_TO_CPU (rdb->rdb_FileSysHeaderList), IDNAME_FILESYSHEADER) == 0)
+ {
+ ped_exception_throw(PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("%s : Failed to list file system blocks."), __func__);
+ goto error_free_table;
+ }
+ if (_amiga_find_free_blocks(disk, table, block,
+ PED_BE32_TO_CPU (rdb->rdb_BootBlockList), IDNAME_BOOT) == 0)
+ {
+ ped_exception_throw(PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("%s : Failed to list boot blocks."), __func__);
+ goto error_free_table;
+ }
+
+ block_num = next_num = part_num = _amiga_next_free_block(table, rdb_num+1,
+ IDNAME_PARTITION);
+ part = _amiga_next_real_partition(disk, NULL);
+ rdb->rdb_PartitionList = PED_CPU_TO_BE32(part ? part_num : LINK_END);
+ for (; part != NULL; part = next_part, block_num = next_num) {
+ PED_ASSERT(part->disk_specific != NULL, return 0);
+ PED_ASSERT(part->geom.start % cylblocks == 0, return 0);
+ PED_ASSERT((part->geom.end + 1) % cylblocks == 0, return 0);
+
+ next_part = _amiga_next_real_partition(disk, part);
+ next_num = _amiga_next_free_block(table, block_num+1, IDNAME_PARTITION);
+
+ partition = PART(part->disk_specific);
+ if (next_part == NULL)
+ partition->pb_Next = PED_CPU_TO_BE32(LINK_END);
+ else
+ partition->pb_Next = PED_CPU_TO_BE32(next_num);
+ partition->de_LowCyl = PED_CPU_TO_BE32(part->geom.start/cylblocks);
+ partition->de_HighCyl = PED_CPU_TO_BE32((part->geom.end+1)/cylblocks-1);
+ _amiga_calculate_checksum(AMIGA(partition));
+ if (!ped_device_write (disk->dev, (void*) partition, block_num, 1)) {
+ ped_exception_throw(PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Failed to write partition block at %d."),
+ block_num);
+ goto error_free_table;
+ /* WARNING : If we fail here, we stop everything,
+ * and the partition table is lost. A better
+ * solution should be found, using the second
+ * half of the hardblocks to not overwrite the
+ * old partition table. It becomes problematic
+ * if we use more than half of the hardblocks. */
+ }
+ }
+
+ if (block_num > PED_BE32_TO_CPU (rdb->rdb_HighRDSKBlock))
+ rdb->rdb_HighRDSKBlock = PED_CPU_TO_BE32(block_num);
+
+ _amiga_calculate_checksum(AMIGA(rdb));
+ if (!ped_device_write (disk->dev, (void*) disk->disk_specific, rdb_num, 1))
+ goto error_free_table;
+
+ ped_free (table);
+ ped_free (block);
+ return ped_device_sync (disk->dev);
+
+error_free_table:
+ ped_free (table);
+error_free_block:
+ ped_free (block);
+error:
+ return 0;
+}
+#endif /* !DISCOVER_ONLY */
+
+static PedPartition*
+amiga_partition_new (const PedDisk* disk, PedPartitionType part_type,
+ const PedFileSystemType* fs_type,
+ PedSector start, PedSector end)
+{
+ PedPartition *part;
+ PedDevice *dev;
+ PedSector cyl;
+ struct PartitionBlock *partition;
+ struct RigidDiskBlock *rdb;
+
+ PED_ASSERT(disk != NULL, return NULL);
+ PED_ASSERT(disk->dev != NULL, return NULL);
+ PED_ASSERT(disk->disk_specific != NULL, return NULL);
+ dev = disk->dev;
+ cyl = (PedSector) (dev->hw_geom.sectors * dev->hw_geom.heads);
+ rdb = RDSK(disk->disk_specific);
+
+ if (!(part = _ped_partition_alloc (disk, part_type, fs_type, start, end)))
+ return NULL;
+
+ if (ped_partition_is_active (part)) {
+ if (!(part->disk_specific = ped_malloc (PED_SECTOR_SIZE_DEFAULT))) {
+ ped_free (part);
+ return NULL;
+ }
+ partition = PART(part->disk_specific);
+ memset(partition, 0, sizeof(struct PartitionBlock));
+
+ partition->pb_ID = PED_CPU_TO_BE32(IDNAME_PARTITION);
+ partition->pb_SummedLongs = PED_CPU_TO_BE32(64);
+ partition->pb_HostID = rdb->rdb_HostID;
+ partition->pb_Flags = PED_CPU_TO_BE32(0);
+ /* TODO : use a scheme including the device name and the
+ * partition number, if it is possible */
+ _amiga_set_bstr("dhx", partition->pb_DriveName, 32);
+
+ partition->de_TableSize = PED_CPU_TO_BE32(19);
+ partition->de_SizeBlock = PED_CPU_TO_BE32(128);
+ partition->de_SecOrg = PED_CPU_TO_BE32(0);
+ partition->de_Surfaces = PED_CPU_TO_BE32(dev->hw_geom.heads);
+ partition->de_SectorPerBlock = PED_CPU_TO_BE32(1);
+ partition->de_BlocksPerTrack
+ = PED_CPU_TO_BE32(dev->hw_geom.sectors);
+ partition->de_Reserved = PED_CPU_TO_BE32(2);
+ partition->de_PreAlloc = PED_CPU_TO_BE32(0);
+ partition->de_Interleave = PED_CPU_TO_BE32(0);
+ partition->de_LowCyl = PED_CPU_TO_BE32(start/cyl);
+ partition->de_HighCyl = PED_CPU_TO_BE32((end+1)/cyl-1);
+ partition->de_NumBuffers = PED_CPU_TO_BE32(30);
+ partition->de_BufMemType = PED_CPU_TO_BE32(0);
+ partition->de_MaxTransfer = PED_CPU_TO_BE32(0x7fffffff);
+ partition->de_Mask = PED_CPU_TO_BE32(0xffffffff);
+ partition->de_BootPri = PED_CPU_TO_BE32(0);
+ partition->de_DosType = PED_CPU_TO_BE32(0x4c4e5800);
+ partition->de_Baud = PED_CPU_TO_BE32(0);
+ partition->de_Control = PED_CPU_TO_BE32(0);
+ partition->de_BootBlocks = PED_CPU_TO_BE32(0);
+
+ } else {
+ part->disk_specific = NULL;
+ }
+ return part;
+}
+
+static PedPartition*
+amiga_partition_duplicate (const PedPartition* part)
+{
+ PedPartition *new_part;
+ struct PartitionBlock *new_amiga_part;
+ struct PartitionBlock *old_amiga_part;
+
+ PED_ASSERT(part != NULL, return NULL);
+ PED_ASSERT(part->disk != NULL, return NULL);
+ PED_ASSERT(part->disk_specific != NULL, return NULL);
+ old_amiga_part = (struct PartitionBlock *) part->disk_specific;
+
+ new_part = ped_partition_new (part->disk, part->type,
+ part->fs_type, part->geom.start,
+ part->geom.end);
+ if (!new_part)
+ return NULL;
+
+ new_amiga_part = (struct PartitionBlock *) new_part->disk_specific;
+ memcpy (new_amiga_part, old_amiga_part, 256);
+
+ return new_part;
+}
+
+static void
+amiga_partition_destroy (PedPartition* part)
+{
+ PED_ASSERT (part != NULL, return);
+
+ if (ped_partition_is_active (part)) {
+ PED_ASSERT (part->disk_specific != NULL, return);
+ ped_free (part->disk_specific);
+ }
+ _ped_partition_free (part);
+}
+
+static int
+amiga_partition_set_system (PedPartition* part,
+ const PedFileSystemType* fs_type)
+{
+ struct PartitionBlock *partition;
+
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->disk_specific != NULL, return 0);
+ partition = PART(part->disk_specific);
+
+ part->fs_type = fs_type;
+
+ if (!fs_type)
+ partition->de_DosType = PED_CPU_TO_BE32(0x4c4e5800); /* 'LNX\0' */
+ else if (!strcmp (fs_type->name, "ext2"))
+ partition->de_DosType = PED_CPU_TO_BE32(0x4c4e5800); /* 'LNX\0' */
+ else if (!strcmp (fs_type->name, "ext3"))
+ partition->de_DosType = PED_CPU_TO_BE32(0x45585403); /* 'EXT\3' */
+ else if (!strcmp (fs_type->name, "linux-swap"))
+ partition->de_DosType = PED_CPU_TO_BE32(0x53575000); /* 'SWP\0' */
+ else if (!strcmp (fs_type->name, "fat16"))
+ partition->de_DosType = PED_CPU_TO_BE32(0x46415400); /* 'FAT\0' */
+ else if (!strcmp (fs_type->name, "fat32"))
+ partition->de_DosType = PED_CPU_TO_BE32(0x46415401); /* 'FAT\1'*/
+ else if (!strcmp (fs_type->name, "hfs"))
+ partition->de_DosType = PED_CPU_TO_BE32(0x48465300); /* 'HFS\0' */
+ else if (!strcmp (fs_type->name, "jfs"))
+ partition->de_DosType = PED_CPU_TO_BE32(0x4a465300); /* 'JFS\0' */
+ else if (!strcmp (fs_type->name, "ntfs"))
+ partition->de_DosType = PED_CPU_TO_BE32(0x4e544653); /* 'NTFS' */
+ else if (!strcmp (fs_type->name, "reiserfs"))
+ partition->de_DosType = PED_CPU_TO_BE32(0x52465300); /* 'RFS\0' */
+ else if (!strcmp (fs_type->name, "sun-ufs"))
+ partition->de_DosType = PED_CPU_TO_BE32(0x53554653); /* 'SUFS' */
+ else if (!strcmp (fs_type->name, "hp-ufs"))
+ partition->de_DosType = PED_CPU_TO_BE32(0x48554653); /* 'HUFS' */
+ else if (!strcmp (fs_type->name, "xfs"))
+ partition->de_DosType = PED_CPU_TO_BE32(0x58465300); /* 'XFS\0' */
+ else
+ partition->de_DosType = PED_CPU_TO_BE32(0x00000000); /* unknown */
+ return 1;
+}
+
+static int
+amiga_partition_set_flag (PedPartition* part, PedPartitionFlag flag, int state)
+{
+ struct PartitionBlock *partition;
+
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->disk_specific != NULL, return 0);
+
+ partition = PART(part->disk_specific);
+
+ switch (flag) {
+ case PED_PARTITION_BOOT:
+ if (state) partition->pb_Flags |= PED_CPU_TO_BE32(PBFF_BOOTABLE);
+ else partition->pb_Flags &= ~(PED_CPU_TO_BE32(PBFF_BOOTABLE));
+ return 1;
+ case PED_PARTITION_HIDDEN:
+ if (state) partition->pb_Flags |= PED_CPU_TO_BE32(PBFF_NOMOUNT);
+ else partition->pb_Flags &= ~(PED_CPU_TO_BE32(PBFF_NOMOUNT));
+ return 1;
+ case PED_PARTITION_RAID:
+ if (state) partition->pb_Flags |= PED_CPU_TO_BE32(PBFF_RAID);
+ else partition->pb_Flags &= ~(PED_CPU_TO_BE32(PBFF_RAID));
+ return 1;
+ case PED_PARTITION_LVM:
+ if (state) partition->pb_Flags |= PED_CPU_TO_BE32(PBFF_LVM);
+ else partition->pb_Flags &= ~(PED_CPU_TO_BE32(PBFF_LVM));
+ return 1;
+ default:
+ return 0;
+ }
+}
+
+static int
+amiga_partition_get_flag (const PedPartition* part, PedPartitionFlag flag)
+{
+ struct PartitionBlock *partition;
+
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->disk_specific != NULL, return 0);
+
+ partition = PART(part->disk_specific);
+
+ switch (flag) {
+ case PED_PARTITION_BOOT:
+ return (partition->pb_Flags & PED_CPU_TO_BE32(PBFF_BOOTABLE));
+ case PED_PARTITION_HIDDEN:
+ return (partition->pb_Flags & PED_CPU_TO_BE32(PBFF_NOMOUNT));
+ case PED_PARTITION_RAID:
+ return (partition->pb_Flags & PED_CPU_TO_BE32(PBFF_RAID));
+ case PED_PARTITION_LVM:
+ return (partition->pb_Flags & PED_CPU_TO_BE32(PBFF_LVM));
+ default:
+ return 0;
+ }
+}
+
+static int
+amiga_partition_is_flag_available (const PedPartition* part,
+ PedPartitionFlag flag)
+{
+ switch (flag) {
+ case PED_PARTITION_BOOT:
+ case PED_PARTITION_HIDDEN:
+ case PED_PARTITION_RAID:
+ case PED_PARTITION_LVM:
+ return 1;
+ default:
+ return 0;
+ }
+}
+
+static void
+amiga_partition_set_name (PedPartition* part, const char* name)
+{
+ struct PartitionBlock *partition;
+
+ PED_ASSERT (part != NULL, return);
+ PED_ASSERT (part->disk_specific != NULL, return);
+
+ partition = PART(part->disk_specific);
+ _amiga_set_bstr(name, partition->pb_DriveName, 32);
+}
+static const char*
+amiga_partition_get_name (const PedPartition* part)
+{
+ struct PartitionBlock *partition;
+
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->disk_specific != NULL, return 0);
+
+ partition = PART(part->disk_specific);
+
+ return _amiga_get_bstr(partition->pb_DriveName);
+}
+
+static PedConstraint*
+_amiga_get_constraint (const PedDisk *disk)
+{
+ PedDevice *dev = disk->dev;
+ PedAlignment start_align, end_align;
+ PedGeometry max_geom;
+ struct RigidDiskBlock *rdb = RDSK(disk->disk_specific);
+ PedSector cyl_size = dev->hw_geom.sectors * dev->hw_geom.heads;
+
+ if (!ped_alignment_init(&start_align, 0, cyl_size))
+ return NULL;
+ if (!ped_alignment_init(&end_align, -1, cyl_size))
+ return NULL;
+ if (!ped_geometry_init(&max_geom, dev, MAX_RDB_BLOCK + 1,
+ dev->length - MAX_RDB_BLOCK - 1))
+ return NULL;
+
+ return ped_constraint_new (&start_align, &end_align,
+ &max_geom, &max_geom, 1, dev->length);
+}
+
+static int
+amiga_partition_align (PedPartition* part, const PedConstraint* constraint)
+{
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->disk != NULL, return 0);
+
+ if (_ped_partition_attempt_align (part, constraint,
+ _amiga_get_constraint (part->disk)))
+ return 1;
+
+#ifndef DISCOVER_ONLY
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("Unable to satisfy all constraints on the partition."));
+#endif
+ return 0;
+}
+
+static int
+amiga_partition_enumerate (PedPartition* part)
+{
+ int i;
+ PedPartition* p;
+
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->disk != NULL, return 0);
+
+ /* never change the partition numbers */
+ if (part->num != -1)
+ return 1;
+ for (i = 1; i <= AMIGA_MAX_PARTITIONS; i++) {
+ p = ped_disk_get_partition (part->disk, i);
+ if (!p) {
+ part->num = i;
+ return 1;
+ }
+ }
+
+ /* failed to allocate a number */
+#ifndef DISCOVER_ONLY
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("Unable to allocate a partition number."));
+#endif
+ return 0;
+}
+
+static int
+amiga_alloc_metadata (PedDisk* disk)
+{
+ PedPartition* new_part;
+ PedConstraint* constraint_any = NULL;
+ PedSector highest_block;
+
+ PED_ASSERT (disk != NULL, goto error);
+ PED_ASSERT (disk->dev != NULL, goto error);
+
+ constraint_any = ped_constraint_any (disk->dev);
+
+ /* Allocate space for the RDB */
+ new_part = ped_partition_new (disk, PED_PARTITION_METADATA, NULL,
+ 0, MAX_RDB_BLOCK);
+ if (!new_part)
+ goto error;
+
+ if (!ped_disk_add_partition (disk, new_part, constraint_any)) {
+ ped_partition_destroy (new_part);
+ goto error;
+ }
+
+ ped_constraint_destroy (constraint_any);
+ return 1;
+error:
+ ped_constraint_destroy (constraint_any);
+ return 0;
+}
+
+static int
+amiga_get_max_primary_partition_count (const PedDisk* disk)
+{
+ return AMIGA_MAX_PARTITIONS;
+}
+
+static PedDiskOps amiga_disk_ops = {
+ probe: amiga_probe,
+#ifndef DISCOVER_ONLY
+ clobber: amiga_clobber,
+#else
+ clobber: NULL,
+#endif
+ alloc: amiga_alloc,
+ duplicate: amiga_duplicate,
+ free: amiga_free,
+ read: amiga_read,
+#ifndef DISCOVER_ONLY
+ write: amiga_write,
+#else
+ write: NULL,
+#endif
+
+ partition_new: amiga_partition_new,
+ partition_duplicate: amiga_partition_duplicate,
+ partition_destroy: amiga_partition_destroy,
+ partition_set_system: amiga_partition_set_system,
+ partition_set_flag: amiga_partition_set_flag,
+ partition_get_flag: amiga_partition_get_flag,
+ partition_is_flag_available:
+ amiga_partition_is_flag_available,
+ partition_set_name: amiga_partition_set_name,
+ partition_get_name: amiga_partition_get_name,
+ partition_align: amiga_partition_align,
+ partition_enumerate: amiga_partition_enumerate,
+
+
+ alloc_metadata: amiga_alloc_metadata,
+ get_max_primary_partition_count:
+ amiga_get_max_primary_partition_count
+};
+
+static PedDiskType amiga_disk_type = {
+ next: NULL,
+ name: "amiga",
+ ops: &amiga_disk_ops,
+ features: PED_DISK_TYPE_PARTITION_NAME
+};
+
+void
+ped_disk_amiga_init ()
+{
+ PED_ASSERT(sizeof(struct AmigaBlock) != 3, return);
+ PED_ASSERT(sizeof(struct RigidDiskBlock) != 64, return);
+ PED_ASSERT(sizeof(struct PartitionBlock) != 64, return);
+ PED_ASSERT(sizeof(struct LinkedBlock) != 5, return);
+ PED_ASSERT(sizeof(struct Linked2Block) != 18, return);
+
+ ped_register_disk_type (&amiga_disk_type);
+}
+
+void
+ped_disk_amiga_done ()
+{
+ ped_unregister_disk_type (&amiga_disk_type);
+}
diff --git a/libparted/labels/sun.c b/libparted/labels/sun.c
new file mode 100644
index 0000000..6d9606c
--- /dev/null
+++ b/libparted/labels/sun.c
@@ -0,0 +1,853 @@
+/* -*- Mode: c; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2000, 2001, 2005 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+
+ Contributor: Ben Collins <bcollins@debian.org>
+*/
+
+#include "config.h"
+
+#include <string.h>
+
+#include <parted/parted.h>
+#include <parted/debug.h>
+#include <parted/endian.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+/* Most of this came from util-linux's sun support, which was mostly done
+ by Jakub Jelinek. */
+
+#define SUN_DISK_MAGIC 0xDABE /* Disk magic number */
+#define SUN_DISK_MAXPARTITIONS 8
+
+#define WHOLE_DISK_ID 0x05
+#define WHOLE_DISK_PART 2 /* as in 0, 1, 2 (3rd partition) */
+#define LINUX_SWAP_ID 0x82
+
+typedef struct {
+ u_int32_t start_cylinder; /* where the part starts... */
+ u_int32_t num_sectors; /* ...and it's length */
+} __attribute__ ((packed)) SunRawPartition;
+
+typedef struct {
+ u_int8_t spare1;
+ u_int8_t id; /* Partition type */
+ u_int8_t spare2;
+ u_int8_t flags; /* Partition flags */
+} __attribute__ ((packed)) SunPartitionInfo;
+
+typedef struct {
+ char info[128]; /* Informative text string */
+ u_int8_t spare0[14];
+ SunPartitionInfo infos[SUN_DISK_MAXPARTITIONS];
+ u_int8_t spare1[246]; /* Boot information etc. */
+ u_int16_t rspeed; /* Disk rotational speed */
+ u_int16_t pcylcount; /* Physical cylinder count */
+ u_int16_t sparecyl; /* extra sects per cylinder */
+ u_int8_t spare2[4]; /* More magic... */
+ u_int16_t ilfact; /* Interleave factor */
+ u_int16_t ncyl; /* Data cylinder count */
+ u_int16_t nacyl; /* Alt. cylinder count */
+ u_int16_t ntrks; /* Tracks per cylinder */
+ u_int16_t nsect; /* Sectors per track */
+ u_int8_t spare3[4]; /* Even more magic... */
+ SunRawPartition partitions[SUN_DISK_MAXPARTITIONS];
+ u_int16_t magic; /* Magic number */
+ u_int16_t csum; /* Label xor'd checksum */
+} __attribute__ ((packed)) SunRawLabel;
+
+typedef struct {
+ u_int8_t type;
+ int is_boot;
+ int is_root;
+ int is_lvm;
+} SunPartitionData;
+
+typedef struct {
+ PedSector length; /* This is based on cyl - alt-cyl */
+ SunRawLabel raw_label;
+} SunDiskData;
+
+static PedDiskType sun_disk_type;
+
+/* Checksum computation */
+static void
+sun_compute_checksum (SunRawLabel *label)
+{
+ u_int16_t *ush = (u_int16_t *)label;
+ u_int16_t csum = 0;
+
+ while(ush < (u_int16_t *)(&label->csum))
+ csum ^= *ush++;
+ label->csum = csum;
+}
+
+/* Checksum Verification */
+static int
+sun_verify_checksum (SunRawLabel *label)
+{
+ u_int16_t *ush = ((u_int16_t *)(label + 1)) - 1;
+ u_int16_t csum = 0;
+
+ while (ush >= (u_int16_t *)label)
+ csum ^= *ush--;
+
+ return !csum;
+}
+
+static int
+sun_probe (const PedDevice *dev)
+{
+ PedDiskType* disk_type;
+ SunRawLabel label;
+ int i;
+
+ PED_ASSERT (dev != NULL, return 0);
+
+ if (dev->sector_size != 512)
+ return 0;
+
+ if (!ped_device_read (dev, &label, 0, 1))
+ return 0;
+
+ /* check magic */
+ if (PED_BE16_TO_CPU (label.magic) != SUN_DISK_MAGIC)
+ return 0;
+
+#ifndef DISCOVER_ONLY
+ if (!sun_verify_checksum(&label)) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Corrupted Sun disk label detected."));
+ return 0;
+ }
+#endif
+
+ return 1;
+}
+
+#ifndef DISCOVER_ONLY
+static int
+sun_clobber (PedDevice* dev)
+{
+ SunRawLabel label;
+
+ PED_ASSERT (dev != NULL, return 0);
+ PED_ASSERT (sun_probe (dev), return 0);
+
+ if (!ped_device_read (dev, &label, 0, 1))
+ return 0;
+
+ label.magic = 0;
+ return ped_device_write (dev, &label, 0, 1);
+}
+#endif /* !DISCOVER_ONLY */
+
+static PedDisk*
+sun_alloc (const PedDevice* dev)
+{
+ PedDisk* disk;
+ SunRawLabel* label;
+ SunDiskData* sun_specific;
+ PedCHSGeometry* bios_geom = &((PedDevice*)dev)->bios_geom;
+ PedSector cyl_size = bios_geom->sectors * bios_geom->heads;
+
+ disk = _ped_disk_alloc (dev, &sun_disk_type);
+ if (!disk)
+ goto error;
+
+ disk->disk_specific = (SunDiskData*) ped_malloc (sizeof (SunDiskData));
+ if (!disk->disk_specific)
+ goto error_free_disk;
+ sun_specific = (SunDiskData*) disk->disk_specific;
+
+ bios_geom->cylinders = dev->length / cyl_size;
+ sun_specific->length = bios_geom->cylinders * cyl_size;
+
+ label = &sun_specific->raw_label;
+ memset(label, 0, sizeof(SunRawLabel));
+
+ /* #gentoo-sparc people agree that nacyl = 0 is the best option */
+ label->magic = PED_CPU_TO_BE16 (SUN_DISK_MAGIC);
+ label->nacyl = 0;
+ label->pcylcount = PED_CPU_TO_BE16 (bios_geom->cylinders);
+ label->rspeed = PED_CPU_TO_BE16 (5400);
+ label->ilfact = PED_CPU_TO_BE16 (1);
+ label->sparecyl = 0;
+ label->ntrks = PED_CPU_TO_BE16 (bios_geom->heads);
+ label->nsect = PED_CPU_TO_BE16 (bios_geom->sectors);
+ label->ncyl = PED_CPU_TO_BE16 (bios_geom->cylinders - 0);
+
+ /* Add a whole disk partition at a minimum */
+ label->infos[WHOLE_DISK_PART].id = WHOLE_DISK_ID;
+ label->partitions[WHOLE_DISK_PART].start_cylinder = 0;
+ label->partitions[WHOLE_DISK_PART].num_sectors =
+ PED_CPU_TO_BE32(bios_geom->cylinders * cyl_size);
+
+ /* Now a neato string to describe this label */
+ snprintf(label->info, sizeof(label->info) - 1,
+ "GNU Parted Custom cyl %d alt %d hd %d sec %d",
+ PED_BE16_TO_CPU(label->ncyl),
+ PED_BE16_TO_CPU(label->nacyl),
+ PED_BE16_TO_CPU(label->ntrks),
+ PED_BE16_TO_CPU(label->nsect));
+
+ sun_compute_checksum(label);
+ return disk;
+
+error_free_disk:
+ _ped_disk_free (disk);
+error:
+ return NULL;
+}
+
+static PedDisk*
+sun_duplicate (const PedDisk* disk)
+{
+ PedDisk* new_disk;
+ SunDiskData* new_sun_data;
+ SunDiskData* old_sun_data = (SunDiskData*) disk->disk_specific;
+
+ new_disk = ped_disk_new_fresh (disk->dev, &sun_disk_type);
+ if (!new_disk)
+ return NULL;
+
+ new_sun_data = (SunDiskData*) new_disk->disk_specific;
+ memcpy (new_sun_data, old_sun_data, sizeof (SunDiskData));
+ return new_disk;
+}
+
+static void
+sun_free (PedDisk *disk)
+{
+ ped_free (disk->disk_specific);
+ _ped_disk_free (disk);
+}
+
+static int
+_check_geometry_sanity (PedDisk* disk, SunRawLabel* label)
+{
+ PedDevice* dev = disk->dev;
+
+ if (PED_BE16_TO_CPU(label->nsect) == dev->hw_geom.sectors &&
+ PED_BE16_TO_CPU(label->ntrks) == dev->hw_geom.heads)
+ dev->bios_geom = dev->hw_geom;
+
+ if (PED_BE16_TO_CPU(label->nsect) != dev->bios_geom.sectors ||
+ PED_BE16_TO_CPU(label->ntrks) != dev->bios_geom.heads) {
+#ifndef DISCOVER_ONLY
+ if (ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("The disk CHS geometry (%d,%d,%d) reported "
+ "by the operating system does not match "
+ "the geometry stored on the disk label "
+ "(%d,%d,%d)."),
+ dev->bios_geom.cylinders,
+ dev->bios_geom.heads,
+ dev->bios_geom.sectors,
+ PED_BE16_TO_CPU(label->pcylcount),
+ PED_BE16_TO_CPU(label->ntrks),
+ PED_BE16_TO_CPU(label->nsect))
+ == PED_EXCEPTION_CANCEL)
+ return 0;
+#endif
+ dev->bios_geom.sectors = PED_BE16_TO_CPU(label->nsect);
+ dev->bios_geom.heads = PED_BE16_TO_CPU(label->ntrks);
+ dev->bios_geom.cylinders = PED_BE16_TO_CPU(label->pcylcount);
+
+ if (dev->bios_geom.sectors * dev->bios_geom.heads
+ * dev->bios_geom.cylinders > dev->length) {
+ if (ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("The disk label describes a disk bigger than "
+ "%s."),
+ dev->path)
+ != PED_EXCEPTION_IGNORE)
+ return 0;
+ }
+ }
+ return 1;
+}
+
+static int
+sun_read (PedDisk* disk)
+{
+ SunRawLabel* label;
+ SunPartitionData* sun_data;
+ SunDiskData* disk_data;
+ int i;
+ PedPartition* part;
+ PedSector end, start, block;
+ PedConstraint* constraint_exact;
+
+ PED_ASSERT (disk != NULL, return 0);
+ PED_ASSERT (disk->dev != NULL, return 0);
+ PED_ASSERT (disk->disk_specific != NULL, return 0);
+
+ disk_data = (SunDiskData*) disk->disk_specific;
+ label = &disk_data->raw_label;
+
+ ped_disk_delete_all (disk);
+
+ if (!ped_device_read (disk->dev, label, 0, 1))
+ goto error;
+ if (!_check_geometry_sanity (disk, label))
+ goto error;
+
+ block = disk->dev->bios_geom.sectors * disk->dev->bios_geom.heads;
+ disk_data->length = block * disk->dev->bios_geom.cylinders;
+
+ for (i = 0; i < SUN_DISK_MAXPARTITIONS; i++) {
+ if (!PED_BE32_TO_CPU(label->partitions[i].num_sectors))
+ continue;
+ if (!label->infos[i].id)
+ continue;
+ if (label->infos[i].id == WHOLE_DISK_ID)
+ continue;
+
+ start = PED_BE32_TO_CPU(label->partitions[i].start_cylinder)
+ * block;
+ end = start
+ + PED_BE32_TO_CPU(label->partitions[i].num_sectors) - 1;
+
+ part = ped_partition_new (disk, 0, NULL, start, end);
+ if (!part)
+ goto error;
+
+ sun_data = part->disk_specific;
+ sun_data->type = label->infos[i].id;
+ sun_data->is_boot = sun_data->type == 0x1;
+ sun_data->is_root = sun_data->type == 0x2;
+ sun_data->is_lvm = sun_data->type == 0x8e;
+
+ part->num = i + 1;
+ part->fs_type = ped_file_system_probe (&part->geom);
+
+ constraint_exact = ped_constraint_exact (&part->geom);
+ if (!ped_disk_add_partition (disk, part, constraint_exact))
+ goto error;
+ ped_constraint_destroy (constraint_exact);
+ }
+
+ return 1;
+
+ error:
+ return 0;
+}
+
+#ifndef DISCOVER_ONLY
+static void
+_probe_and_use_old_info (PedDisk* disk)
+{
+ SunDiskData* sun_specific;
+ SunRawLabel old_label;
+
+ sun_specific = (SunDiskData*) disk->disk_specific;
+
+ if (!ped_device_read (disk->dev, &old_label, 0, 1))
+ return;
+ if (old_label.info [0]
+ && PED_BE16_TO_CPU (old_label.magic) == SUN_DISK_MAGIC)
+ memcpy (&sun_specific->raw_label, &old_label, 512);
+}
+
+static int
+sun_write (PedDisk* disk)
+{
+ SunRawLabel* label;
+ SunPartitionData* sun_data;
+ SunDiskData* disk_data;
+ PedPartition* part;
+ int i;
+
+ PED_ASSERT (disk != NULL, return 0);
+ PED_ASSERT (disk->dev != NULL, return 0);
+
+ _probe_and_use_old_info (disk);
+
+ disk_data = (SunDiskData*) disk->disk_specific;
+ label = &disk_data->raw_label;
+
+ memset (label->partitions, 0,
+ sizeof (SunRawPartition) * SUN_DISK_MAXPARTITIONS);
+ memset (label->infos, 0,
+ sizeof (SunPartitionInfo) * SUN_DISK_MAXPARTITIONS);
+
+ for (i = 0; i < SUN_DISK_MAXPARTITIONS; i++) {
+ part = ped_disk_get_partition (disk, i + 1);
+
+ if (!part && i == WHOLE_DISK_PART) {
+ /* Ok, nothing explicitly in the whole disk
+ partition, so let's put it there for safety
+ sake. */
+
+ label->infos[i].id = WHOLE_DISK_ID;
+ label->partitions[i].start_cylinder = 0;
+ label->partitions[i].num_sectors =
+ PED_CPU_TO_BE32(disk_data->length);
+ continue;
+ }
+ if (!part)
+ continue;
+
+ sun_data = part->disk_specific;
+ label->infos[i].id = sun_data->type;
+ label->partitions[i].start_cylinder
+ = PED_CPU_TO_BE32 (part->geom.start
+ / (disk->dev->bios_geom.sectors
+ * disk->dev->bios_geom.heads));
+ label->partitions[i].num_sectors
+ = PED_CPU_TO_BE32 (part->geom.end
+ - part->geom.start + 1);
+ }
+
+ /* We assume the harddrive is always right, and that the label may
+ be wrong. I don't think this will cause any problems, since the
+ cylinder count is always enforced by our alignment, and we
+ sanity checked the sectors/heads when we detected the device. The
+ worst that could happen here is that the drive seems bigger or
+ smaller than it really is, but we'll have that problem even if we
+ don't do this. */
+
+ if (disk->dev->bios_geom.cylinders > 65536) {
+ ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_IGNORE,
+ _("The disk has %d cylinders, which is greater than "
+ "the maximum of 65536."),
+ disk->dev->bios_geom.cylinders);
+ }
+
+ label->pcylcount = PED_CPU_TO_BE16 (disk->dev->bios_geom.cylinders);
+ label->ncyl = PED_CPU_TO_BE16 (disk->dev->bios_geom.cylinders
+ - PED_BE16_TO_CPU (label->nacyl));
+
+ sun_compute_checksum (label);
+
+ if (!ped_device_write (disk->dev, label, 0, 1))
+ goto error;
+ return ped_device_sync (disk->dev);
+
+error:
+ return 0;
+}
+#endif /* !DISCOVER_ONLY */
+
+static PedPartition*
+sun_partition_new (const PedDisk* disk, PedPartitionType part_type,
+ const PedFileSystemType* fs_type,
+ PedSector start, PedSector end)
+{
+ PedPartition* part;
+ SunPartitionData* sun_data;
+
+ part = _ped_partition_alloc (disk, part_type, fs_type, start, end);
+ if (!part)
+ goto error;
+
+ if (ped_partition_is_active (part)) {
+ part->disk_specific
+ = sun_data = ped_malloc (sizeof (SunPartitionData));
+ if (!sun_data)
+ goto error_free_part;
+ sun_data->type = 0;
+ sun_data->is_boot = 0;
+ sun_data->is_root = 0;
+ sun_data->is_lvm = 0;
+ } else {
+ part->disk_specific = NULL;
+ }
+
+ return part;
+
+error_free_sun_data:
+ ped_free (sun_data);
+error_free_part:
+ ped_free (part);
+error:
+ return NULL;
+}
+
+static PedPartition*
+sun_partition_duplicate (const PedPartition* part)
+{
+ PedPartition* new_part;
+ SunPartitionData* new_sun_data;
+ SunPartitionData* old_sun_data;
+
+ new_part = ped_partition_new (part->disk, part->type,
+ part->fs_type, part->geom.start,
+ part->geom.end);
+ if (!new_part)
+ return NULL;
+ new_part->num = part->num;
+
+ old_sun_data = (SunPartitionData*) part->disk_specific;
+ new_sun_data = (SunPartitionData*) new_part->disk_specific;
+ new_sun_data->type = old_sun_data->type;
+ new_sun_data->is_boot = old_sun_data->is_boot;
+ new_sun_data->is_root = old_sun_data->is_root;
+ new_sun_data->is_lvm = old_sun_data->is_lvm;
+ return new_part;
+}
+
+static void
+sun_partition_destroy (PedPartition* part)
+{
+ PED_ASSERT (part != NULL, return);
+
+ if (ped_partition_is_active (part))
+ ped_free (part->disk_specific);
+ ped_free (part);
+}
+
+static int
+sun_partition_set_system (PedPartition* part, const PedFileSystemType* fs_type)
+{
+ SunPartitionData* sun_data = part->disk_specific;
+
+ part->fs_type = fs_type;
+
+ if (sun_data->is_boot) {
+ sun_data->type = 0x1;
+ return 1;
+ }
+ if (sun_data->is_root) {
+ sun_data->type = 0x2;
+ return 1;
+ }
+ if (sun_data->is_lvm) {
+ sun_data->type = 0x8e;
+ return 1;
+ }
+
+ sun_data->type = 0x83;
+ if (fs_type) {
+ if (!strcmp (fs_type->name, "linux-swap"))
+ sun_data->type = 0x82;
+ else if (!strcmp (fs_type->name, "ufs"))
+ sun_data->type = 0x6;
+ }
+
+ return 1;
+}
+
+static int
+sun_partition_set_flag (PedPartition* part, PedPartitionFlag flag, int state)
+{
+ SunPartitionData* sun_data;
+
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->disk_specific != NULL, return 0);
+ PED_ASSERT (ped_partition_is_flag_available (part, flag), return 0);
+
+ sun_data = part->disk_specific;
+
+ switch (flag) {
+ case PED_PARTITION_BOOT:
+ sun_data->is_boot = state;
+ if (state)
+ sun_data->is_root = sun_data->is_lvm = 0;
+ return ped_partition_set_system (part, part->fs_type);
+
+ case PED_PARTITION_ROOT:
+ sun_data->is_root = state;
+ if (state)
+ sun_data->is_boot = sun_data->is_lvm = 0;
+ return ped_partition_set_system (part, part->fs_type);
+
+ case PED_PARTITION_LVM:
+ sun_data->is_lvm = state;
+ if (state)
+ sun_data->is_root = sun_data->is_boot = 0;
+ return ped_partition_set_system (part, part->fs_type);
+
+ default:
+ return 0;
+ }
+}
+
+
+static int
+sun_partition_get_flag (const PedPartition* part, PedPartitionFlag flag)
+{
+ SunPartitionData* sun_data;
+
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->disk_specific != NULL, return 0);
+
+ sun_data = part->disk_specific;
+
+ switch (flag) {
+ case PED_PARTITION_BOOT:
+ return sun_data->is_boot;
+ case PED_PARTITION_ROOT:
+ return sun_data->is_root;
+ case PED_PARTITION_LVM:
+ return sun_data->is_lvm;
+
+ default:
+ return 0;
+ }
+}
+
+
+static int
+sun_partition_is_flag_available (const PedPartition* part,
+ PedPartitionFlag flag)
+{
+ switch (flag) {
+ case PED_PARTITION_BOOT:
+ case PED_PARTITION_ROOT:
+ case PED_PARTITION_LVM:
+ return 1;
+
+ default:
+ return 0;
+ }
+}
+
+
+static int
+sun_get_max_primary_partition_count (const PedDisk* disk)
+{
+ return SUN_DISK_MAXPARTITIONS;
+}
+
+static PedConstraint*
+_get_strict_constraint (PedDisk* disk)
+{
+ PedDevice* dev = disk->dev;
+ PedAlignment start_align;
+ PedAlignment end_align;
+ PedGeometry max_geom;
+ SunDiskData* disk_data = disk->disk_specific;
+ PedSector block = dev->bios_geom.sectors * dev->bios_geom.heads;
+
+ if (!ped_alignment_init (&start_align, 0, block))
+ return NULL;
+ if (!ped_alignment_init (&end_align, -1, block))
+ return NULL;
+ if (!ped_geometry_init (&max_geom, dev, 0, disk_data->length))
+ return NULL;
+
+ return ped_constraint_new (&start_align, &end_align, &max_geom,
+ &max_geom, 1, dev->length);
+}
+
+static PedConstraint*
+_get_lax_constraint (PedDisk* disk)
+{
+ PedDevice* dev = disk->dev;
+ PedAlignment start_align;
+ PedGeometry max_geom;
+ SunDiskData* disk_data = disk->disk_specific;
+ PedSector block = dev->bios_geom.sectors * dev->bios_geom.heads;
+
+ if (!ped_alignment_init (&start_align, 0, block))
+ return NULL;
+ if (!ped_geometry_init (&max_geom, dev, 0, disk_data->length))
+ return NULL;
+
+ return ped_constraint_new (&start_align, ped_alignment_any, &max_geom,
+ &max_geom, 1, dev->length);
+}
+
+/* _get_strict_constraint() will align the partition to the end of the cylinder.
+ * This isn't required, but since partitions must start at the start of the
+ * cylinder, space between the end of a partition and the end of a cylinder
+ * is unusable, so there's no point wasting space!
+ * However, if they really insist (via constraint)... which they will
+ * if they're reading a weird table of the disk... then we allow the end to
+ * be anywhere, with _get_lax_constraint()
+ */
+static int
+sun_partition_align (PedPartition* part, const PedConstraint* constraint)
+{
+ PED_ASSERT (part != NULL, return 0);
+
+ if (_ped_partition_attempt_align (part, constraint,
+ _get_strict_constraint (part->disk)))
+ return 1;
+ if (_ped_partition_attempt_align (part, constraint,
+ _get_lax_constraint (part->disk)))
+ return 1;
+
+#ifndef DISCOVER_ONLY
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Unable to satisfy all constraints on the partition."));
+#endif
+ return 0;
+}
+
+static int
+sun_partition_enumerate (PedPartition* part)
+{
+ int i;
+ PedPartition* p;
+
+ /* never change the partition numbers */
+ if (part->num != -1)
+ return 1;
+ for (i = 1; i <= SUN_DISK_MAXPARTITIONS; i++) {
+ /* skip the Whole Disk partition for now */
+ if (i == WHOLE_DISK_PART + 1)
+ continue;
+ p = ped_disk_get_partition (part->disk, i);
+ if (!p) {
+ part->num = i;
+ return 1;
+ }
+ }
+
+#ifndef DISCOVER_ONLY
+ /* Ok, now allocate the Whole disk if it isn't already */
+ p = ped_disk_get_partition (part->disk, WHOLE_DISK_PART + 1);
+ if (!p) {
+ int i = ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("The Whole Disk partition is the only "
+ "available one left. Generally, it is not a "
+ "good idea to overwrite this partition with "
+ "a real one. Solaris may not be able to "
+ "boot without it, and SILO (the sparc boot "
+ "loader) appreciates it as well."));
+ if (i == PED_EXCEPTION_IGNORE) {
+ /* bad bad bad...you will suffer your own fate */
+ part->num = WHOLE_DISK_PART + 1;
+ return 1;
+ }
+ }
+
+ /* failed to allocate a number, this means we are full */
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("Sun disk label is full."));
+#endif
+ return 0;
+}
+
+static int
+sun_alloc_metadata (PedDisk* disk)
+{
+ PedPartition* new_part;
+ SunDiskData* disk_data;
+ PedConstraint* constraint_any;
+
+ PED_ASSERT (disk != NULL, return 0);
+ PED_ASSERT (disk->disk_specific != NULL, return 0);
+ PED_ASSERT (disk->dev != NULL, return 0);
+
+ constraint_any = ped_constraint_any (disk->dev);
+
+ /* Sun disk label does not need to allocate a sector. The disk
+ label is contained within the first 512 bytes, which should not
+ be overwritten by any boot loader or superblock. It is safe for
+ most partitions to start at sector 0. We do however, allocate
+ the space used by alt-cyl's, since we cannot use those. Put them
+ at the end of the disk. */
+
+ disk_data = disk->disk_specific;
+
+ if (disk->dev->length <= 0 ||
+ disk_data->length <= 0 ||
+ disk->dev->length == disk_data->length)
+ goto error;
+
+ new_part = ped_partition_new (disk, PED_PARTITION_METADATA, NULL,
+ disk_data->length, disk->dev->length - 1);
+ if (!new_part)
+ goto error;
+
+ if (!ped_disk_add_partition (disk, new_part, constraint_any)) {
+ ped_partition_destroy (new_part);
+ goto error;
+ }
+
+ ped_constraint_destroy (constraint_any);
+ return 1;
+error:
+ ped_constraint_destroy (constraint_any);
+ return 0;
+}
+
+static PedDiskOps sun_disk_ops = {
+ probe: sun_probe,
+#ifndef DISCOVER_ONLY
+ clobber: sun_clobber,
+#else
+ clobber: NULL,
+#endif
+ alloc: sun_alloc,
+ duplicate: sun_duplicate,
+ free: sun_free,
+ read: sun_read,
+#ifndef DISCOVER_ONLY
+ write: sun_write,
+#else
+ write: NULL,
+#endif
+
+ partition_new: sun_partition_new,
+ partition_duplicate: sun_partition_duplicate,
+ partition_destroy: sun_partition_destroy,
+ partition_set_system: sun_partition_set_system,
+ partition_set_flag: sun_partition_set_flag,
+ partition_get_flag: sun_partition_get_flag,
+ partition_is_flag_available: sun_partition_is_flag_available,
+ partition_align: sun_partition_align,
+ partition_enumerate: sun_partition_enumerate,
+ alloc_metadata: sun_alloc_metadata,
+ get_max_primary_partition_count:
+ sun_get_max_primary_partition_count,
+
+ partition_set_name: NULL,
+ partition_get_name: NULL,
+};
+
+static PedDiskType sun_disk_type = {
+ next: NULL,
+ name: "sun",
+ ops: &sun_disk_ops,
+ features: 0
+};
+
+void
+ped_disk_sun_init ()
+{
+ PED_ASSERT (sizeof (SunRawLabel) == 512, return);
+ ped_register_disk_type (&sun_disk_type);
+}
+
+void
+ped_disk_sun_done ()
+{
+ ped_unregister_disk_type (&sun_disk_type);
+}
+
diff --git a/libparted/labels/vtoc.c b/libparted/labels/vtoc.c
new file mode 100644
index 0000000..ad25bbe
--- /dev/null
+++ b/libparted/labels/vtoc.c
@@ -0,0 +1,1162 @@
+#include <parted/vtoc.h>
+
+#ifdef DEBUG_DASD
+#define PDEBUG fprintf(stderr, "%s:%d:%s\n", \
+ __FILE__, \
+ __LINE__, \
+ __PRETTY_FUNCTION__);
+#else
+#define PDEBUG
+#endif
+
+#include <parted/parted.h>
+
+#include <libintl.h>
+#if ENABLE_NLS
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+static unsigned char EBCtoASC[256] =
+{
+/* 0x00 NUL SOH STX ETX *SEL HT *RNL DEL */
+ 0x00, 0x01, 0x02, 0x03, 0x07, 0x09, 0x07, 0x7F,
+/* 0x08 -GE -SPS -RPT VT FF CR SO SI */
+ 0x07, 0x07, 0x07, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+/* 0x10 DLE DC1 DC2 DC3 -RES -NL BS -POC
+ -ENP ->LF */
+ 0x10, 0x11, 0x12, 0x13, 0x07, 0x0A, 0x08, 0x07,
+/* 0x18 CAN EM -UBS -CU1 -IFS -IGS -IRS -ITB
+ -IUS */
+ 0x18, 0x19, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
+/* 0x20 -DS -SOS FS -WUS -BYP LF ETB ESC
+ -INP */
+ 0x07, 0x07, 0x1C, 0x07, 0x07, 0x0A, 0x17, 0x1B,
+/* 0x28 -SA -SFE -SM -CSP -MFA ENQ ACK BEL
+ -SW */
+ 0x07, 0x07, 0x07, 0x07, 0x07, 0x05, 0x06, 0x07,
+/* 0x30 ---- ---- SYN -IR -PP -TRN -NBS EOT */
+ 0x07, 0x07, 0x16, 0x07, 0x07, 0x07, 0x07, 0x04,
+/* 0x38 -SBS -IT -RFF -CU3 DC4 NAK ---- SUB */
+ 0x07, 0x07, 0x07, 0x07, 0x14, 0x15, 0x07, 0x1A,
+/* 0x40 SP RSP ---- */
+ 0x20, 0xFF, 0x83, 0x84, 0x85, 0xA0, 0x07, 0x86,
+/* 0x48 . < ( + | */
+ 0x87, 0xA4, 0x9B, 0x2E, 0x3C, 0x28, 0x2B, 0x7C,
+/* 0x50 & ---- */
+ 0x26, 0x82, 0x88, 0x89, 0x8A, 0xA1, 0x8C, 0x07,
+/* 0x58 ! $ * ) ; */
+ 0x8D, 0xE1, 0x21, 0x24, 0x2A, 0x29, 0x3B, 0xAA,
+/* 0x60 - / ---- ---- ---- ---- */
+ 0x2D, 0x2F, 0x07, 0x8E, 0x07, 0x07, 0x07, 0x8F,
+/* 0x68 ---- , % _ > ? */
+ 0x80, 0xA5, 0x07, 0x2C, 0x25, 0x5F, 0x3E, 0x3F,
+/* 0x70 --- ---- ---- ---- ---- ---- ---- */
+ 0x07, 0x90, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
+/* 0x78 * ` : # @ ' = " */
+ 0x70, 0x60, 0x3A, 0x23, 0x40, 0x27, 0x3D, 0x22,
+/* 0x80 * a b c d e f g */
+ 0x07, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
+/* 0x88 h i ---- ---- ---- */
+ 0x68, 0x69, 0xAE, 0xAF, 0x07, 0x07, 0x07, 0xF1,
+/* 0x90 j k l m n o p */
+ 0xF8, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70,
+/* 0x98 q r ---- ---- */
+ 0x71, 0x72, 0xA6, 0xA7, 0x91, 0x07, 0x92, 0x07,
+/* 0xA0 ~ s t u v w x */
+ 0xE6, 0x7E, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
+/* 0xA8 y z ---- ---- ---- ---- */
+ 0x79, 0x7A, 0xAD, 0xAB, 0x07, 0x07, 0x07, 0x07,
+/* 0xB0 ^ ---- ---- */
+ 0x5E, 0x9C, 0x9D, 0xFA, 0x07, 0x07, 0x07, 0xAC,
+/* 0xB8 ---- [ ] ---- ---- ---- ---- */
+ 0xAB, 0x07, 0x5B, 0x5D, 0x07, 0x07, 0x07, 0x07,
+/* 0xC0 { A B C D E F G */
+ 0x7B, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+/* 0xC8 H I ---- ---- */
+ 0x48, 0x49, 0x07, 0x93, 0x94, 0x95, 0xA2, 0x07,
+/* 0xD0 } J K L M N O P */
+ 0x7D, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50,
+/* 0xD8 Q R ---- */
+ 0x51, 0x52, 0x07, 0x96, 0x81, 0x97, 0xA3, 0x98,
+/* 0xE0 \ S T U V W X */
+ 0x5C, 0xF6, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
+/* 0xE8 Y Z ---- ---- ---- ---- */
+ 0x59, 0x5A, 0xFD, 0x07, 0x99, 0x07, 0x07, 0x07,
+/* 0xF0 0 1 2 3 4 5 6 7 */
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+/* 0xF8 8 9 ---- ---- ---- ---- ---- */
+ 0x38, 0x39, 0x07, 0x07, 0x9A, 0x07, 0x07, 0x07
+};
+
+static unsigned char ASCtoEBC[256] =
+{
+ /*00 NL SH SX EX ET NQ AK BL */
+ 0x00, 0x01, 0x02, 0x03, 0x37, 0x2D, 0x2E, 0x2F,
+ /*08 BS HT LF VT FF CR SO SI */
+ 0x16, 0x05, 0x15, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+ /*10 DL D1 D2 D3 D4 NK SN EB */
+ 0x10, 0x11, 0x12, 0x13, 0x3C, 0x15, 0x32, 0x26,
+ /*18 CN EM SB EC FS GS RS US */
+ 0x18, 0x19, 0x3F, 0x27, 0x1C, 0x1D, 0x1E, 0x1F,
+ /*20 SP ! " # $ % & ' */
+ 0x40, 0x5A, 0x7F, 0x7B, 0x5B, 0x6C, 0x50, 0x7D,
+ /*28 ( ) * + , - . / */
+ 0x4D, 0x5D, 0x5C, 0x4E, 0x6B, 0x60, 0x4B, 0x61,
+ /*30 0 1 2 3 4 5 6 7 */
+ 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,
+ /*38 8 9 : ; < = > ? */
+ 0xF8, 0xF9, 0x7A, 0x5E, 0x4C, 0x7E, 0x6E, 0x6F,
+ /*40 @ A B C D E F G */
+ 0x7C, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7,
+ /*48 H I J K L M N O */
+ 0xC8, 0xC9, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6,
+ /*50 P Q R S T U V W */
+ 0xD7, 0xD8, 0xD9, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6,
+ /*58 X Y Z [ \ ] ^ _ */
+ 0xE7, 0xE8, 0xE9, 0xAD, 0xE0, 0xBD, 0x5F, 0x6D,
+ /*60 ` a b c d e f g */
+ 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+ /*68 h i j k l m n o */
+ 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
+ /*70 p q r s t u v w */
+ 0x97, 0x98, 0x99, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6,
+ /*78 x y z { | } ~ DL */
+ 0xA7, 0xA8, 0xA9, 0xC0, 0x4F, 0xD0, 0xA1, 0x07,
+ 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
+ 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
+ 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
+ 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
+ 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
+ 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
+ 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
+ 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
+ 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
+ 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
+ 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
+ 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
+ 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
+ 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
+ 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
+ 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0xFF
+};
+
+enum failure {
+ unable_to_open,
+ unable_to_seek,
+ unable_to_write,
+ unable_to_read
+};
+
+static char buffer[85];
+
+static void
+vtoc_error (enum failure why, char *s1, char *s2)
+{
+ PDEBUG
+ char error[8192];
+
+ switch (why) {
+ case unable_to_open:
+ sprintf(error, _("%s opening device '%s' failed.\n%s\n"),
+ VTOC_ERROR, s1, s2);
+ break;
+ case unable_to_seek:
+ sprintf(error, _("%s seeking device '%s' failed.\n%s\n"),
+ VTOC_ERROR, s1, s2);
+ break;
+ case unable_to_write:
+ sprintf(error, _("%s writing to device '%s' failed,\n%s\n"),
+ VTOC_ERROR, s1, s2);
+ break;
+ case unable_to_read:
+ sprintf(error, _("%s reading from device '%s' failed.\n%s\n"),
+ VTOC_ERROR, s1, s2);
+ break;
+ default:
+ sprintf(error, _("Fatal error\n"));
+ }
+
+ ped_exception_throw(PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL, error);
+}
+
+char *
+vtoc_ebcdic_enc (char source[LINE_LENGTH],
+ char target[LINE_LENGTH],
+ int l)
+{
+ PDEBUG
+ int i;
+
+ for (i = 0; i < l; i++)
+ target[i]=ASCtoEBC[(unsigned char)(source[i])];
+
+ return target;
+}
+
+char *
+vtoc_ebcdic_dec (char source[LINE_LENGTH],
+ char target[LINE_LENGTH],
+ int l)
+{
+ PDEBUG
+ int i;
+
+ for (i = 0; i < l; i++)
+ target[i]=EBCtoASC[(unsigned char)(source[i])];
+
+ return target;
+}
+
+void
+vtoc_set_extent (extent_t *ext, u_int8_t typeind, u_int8_t seqno,
+ cchh_t *lower, cchh_t *upper)
+{
+ PDEBUG
+ ext->typeind = typeind;
+ ext->seqno = seqno;
+ memcpy(&ext->llimit,lower,sizeof(cchh_t));
+ memcpy(&ext->ulimit,upper,sizeof(cchh_t));
+}
+
+void
+vtoc_set_cchh (cchh_t *addr, u_int16_t cc, u_int16_t hh)
+{
+ PDEBUG
+ addr->cc = cc;
+ addr->hh = hh;
+}
+
+static void
+vtoc_set_ttr (ttr_t *addr, u_int16_t tt, u_int8_t r)
+{
+ PDEBUG
+ addr->tt = tt;
+ addr->r = r;
+}
+
+void
+vtoc_set_cchhb (cchhb_t *addr, u_int16_t cc, u_int16_t hh, u_int8_t b)
+{
+ PDEBUG
+ addr->cc = cc;
+ addr->hh = hh;
+ addr->b = b;
+}
+
+void
+vtoc_set_date (labeldate_t * d, u_int8_t year, u_int16_t day)
+{
+ PDEBUG
+ d->year = year;
+ d->day = day;
+}
+
+/*
+ * initializes the volume label with EBCDIC spaces
+ */
+void
+vtoc_volume_label_init (volume_label_t *vlabel)
+{
+ PDEBUG
+ sprintf(buffer, "%84s", " ");
+ vtoc_ebcdic_enc(buffer, buffer, 84);
+ strncpy(vlabel->volkey, buffer, 84);
+}
+
+/*
+ * reads the volume label from dasd
+ */
+int
+vtoc_read_volume_label (int f, unsigned long vlabel_start,
+ volume_label_t *vlabel)
+{
+ PDEBUG
+ int rc;
+
+ if (lseek(f, vlabel_start, SEEK_SET) == -1) {
+ vtoc_error(unable_to_seek, "vtoc_read_volume_label",
+ "Could not read volume label.");
+ return 1;
+ }
+
+ rc = read(f, vlabel, sizeof(volume_label_t));
+ if (rc != sizeof(volume_label_t)) {
+ vtoc_error(unable_to_read, "vtoc_read_volume_label",
+ "Could not read volume label.");
+ return 1;
+ }
+
+ return 0;
+}
+
+/*
+ * writes the volume label to dasd
+ */
+int
+vtoc_write_volume_label (int f, unsigned long vlabel_start,
+ volume_label_t *vlabel)
+{
+ PDEBUG
+ int rc;
+
+ if (lseek(f, vlabel_start, SEEK_SET) == -1)
+ vtoc_error(unable_to_seek, "vtoc_write_volume_label",
+ "Could not write volume label.");
+
+ rc = write(f, vlabel, sizeof(volume_label_t));
+ if (rc != sizeof(volume_label_t))
+ vtoc_error(unable_to_write, "vtoc_write_volume_label",
+ "Could not write volume label.");
+
+ return 0;
+}
+
+/*
+ * takes a string as input, converts it to uppercase, translates
+ * it to EBCDIC and fills it up with spaces before it copies it
+ * as volume serial to the volume label
+ */
+void
+vtoc_volume_label_set_volser (volume_label_t *vlabel, char *volser)
+{
+ PDEBUG
+ int j, i = strlen(volser);
+ char s[VOLSER_LENGTH + 1];
+
+ strcpy(s, " ");
+ vtoc_ebcdic_enc(s, s, VOLSER_LENGTH);
+ strncpy(vlabel->volid, s, VOLSER_LENGTH);
+
+ if (i > VOLSER_LENGTH)
+ i = VOLSER_LENGTH;
+
+ strncpy(s, volser, i);
+ for (j=0; j<i; j++)
+ s[j] = toupper(s[j]);
+
+ s[VOLSER_LENGTH] = 0x00;
+ vtoc_ebcdic_enc(s, s, i);
+ strncpy(vlabel->volid, s, i);
+
+ return;
+}
+
+/*
+ * returns the volume serial number right after it is translated
+ * to ASCII
+ */
+char *
+vtoc_volume_label_get_volser (volume_label_t *vlabel, char *volser)
+{
+ PDEBUG
+ vtoc_ebcdic_dec(vlabel->volid, volser, VOLSER_LENGTH);
+
+ return volser;
+}
+
+/*
+ * sets the volume label key right after
+ * it has been translated to EBCDIC
+ */
+void
+vtoc_volume_label_set_key (volume_label_t *vlabel, char *key)
+{
+ PDEBUG
+ char s[4];
+
+ vtoc_ebcdic_enc(key, s, 4);
+ strncpy(vlabel->volkey, s, 4);
+
+ return;
+}
+
+/*
+ * sets the volume label identifier right
+ * after it has been translated to EBCDIC
+ */
+void
+vtoc_volume_label_set_label (volume_label_t *vlabel, char *lbl)
+{
+ PDEBUG
+ char s[4];
+
+ vtoc_ebcdic_enc(lbl, s, 4);
+ strncpy(vlabel->vollbl, s, 4);
+
+ return;
+}
+
+/*
+ * returns the volume label key = the label identifier
+ * right after it has been translated to ASCII
+ */
+char *
+vtoc_volume_label_get_label (volume_label_t *vlabel, char *lbl)
+{
+ PDEBUG
+ vtoc_ebcdic_dec(vlabel->vollbl, lbl, 4);
+
+ return lbl;
+}
+
+/*
+ * reads either a format4 label or a format1 label
+ * from the specified position
+ */
+void
+vtoc_read_label (int f, unsigned long position, format1_label_t *f1,
+ format4_label_t *f4, format5_label_t *f5, format7_label_t *f7)
+{
+ PDEBUG
+ int t;
+
+ if (lseek(f, position, SEEK_SET) == -1)
+ vtoc_error(unable_to_seek, "vtoc_read_label",
+ _("Could not read VTOC labels."));
+
+ if (f1 != NULL) {
+ t = sizeof(format1_label_t);
+ if (read(f, f1, t) != t)
+ vtoc_error(unable_to_read, "vtoc_read_label",
+ _("Could not read VTOC FMT1 DSCB."));
+ }
+
+ if (f4 != NULL) {
+ t = sizeof(format4_label_t);
+ if (read(f, f4, t) != t)
+ vtoc_error(unable_to_read, "vtoc_read_label",
+ _("Could not read VTOC FMT4 DSCB."));
+ }
+
+ if (f5 != NULL) {
+ t = sizeof(format5_label_t);
+ if (read(f, f5, t) != t)
+ vtoc_error(unable_to_read, "vtoc_read_label",
+ _("Could not read VTOC FMT5 DSCB."));
+ }
+
+ if (f7 != NULL) {
+ t = sizeof(format7_label_t);
+ if (read(f, f7, t) != t)
+ vtoc_error(unable_to_read, "vtoc_read_label",
+ _("Could not read VTOC FMT7 DSCB."));
+ }
+}
+
+/*
+ * writes either a FMT1, FMT4 or FMT5 label
+ * to the specified position
+ */
+void
+vtoc_write_label (int f, unsigned long position, format1_label_t *f1,
+ format4_label_t *f4, format5_label_t *f5, format7_label_t *f7)
+{
+ PDEBUG
+ int t;
+
+ if (lseek(f, position, SEEK_SET) == -1)
+ vtoc_error(unable_to_seek, "vtoc_write_label",
+ _("Could not write VTOC labels."));
+
+ if (f1 != NULL) {
+ t = sizeof(format1_label_t);
+ if (write(f, f1, t) != t)
+ vtoc_error(unable_to_write, "vtoc_write_label",
+ _("Could not write VTOC FMT1 DSCB."));
+ }
+
+ if (f4 != NULL) {
+ t = sizeof(format4_label_t);
+ if (write(f, f4, t) != t)
+ vtoc_error(unable_to_write, "vtoc_write_label",
+ _("Could not write VTOC FMT4 DSCB."));
+ }
+
+ if (f5 != NULL) {
+ t = sizeof(format5_label_t);
+ if (write(f, f5, t) != t)
+ vtoc_error(unable_to_write, "vtoc_write_label",
+ _("Could not write VTOC FMT5 DSCB."));
+ }
+
+ if (f7 != NULL) {
+ t = sizeof(format7_label_t);
+ if (write(f, f7, t) != t)
+ vtoc_error(unable_to_write, "vtoc_write_label",
+ _("Could not write VTOC FMT7 DSCB."));
+ }
+}
+
+/*
+ * initializes a format4 label
+ */
+void
+vtoc_init_format4_label (format4_label_t *f4, unsigned int usable_partitions,
+ unsigned int cylinders, unsigned int tracks,
+ unsigned int blocks, unsigned int blksize,
+ u_int16_t dev_type)
+{
+ PDEBUG
+ int i;
+
+ cchh_t lower = {VTOC_START_CC, VTOC_START_HH};
+ cchh_t upper = {VTOC_START_CC, VTOC_START_HH};
+
+ for (i=0; i<44; i++) f4->DS4KEYCD[i] = 0x04;
+ f4->DS4IDFMT = 0xf4;
+
+ vtoc_set_cchhb(&f4->DS4HPCHR, 0x0000, 0x0000, 0x00);
+ f4->DS4DSREC = blocks - 2;
+ /* free space starts right behind VTOC
+ vtoc_set_cchh(&f4->DS4HCCHH, VTOC_START_CC, VTOC_START_HH + 1);*/
+ vtoc_set_cchh(&f4->DS4HCCHH, 0x0000, 0x0000);
+ f4->DS4NOATK = 0x0000;
+ f4->DS4VTOCI = 0x00;
+ f4->DS4NOEXT = 0x01;
+ f4->DS4SMSFG = 0x00;
+ f4->DS4DEVAC = 0x00;
+
+ /* -- begin f4->DS4DEVCT -- */
+ f4->DS4DEVCT.DS4DSCYL = cylinders;
+ f4->DS4DEVCT.DS4DSTRK = tracks;
+
+ switch (dev_type) {
+ case DASD_3380_TYPE:
+ f4->DS4DEVCT.DS4DEVTK = DASD_3380_VALUE;
+ break;
+ case DASD_3390_TYPE:
+ f4->DS4DEVCT.DS4DEVTK = DASD_3390_VALUE;
+ break;
+ case DASD_9345_TYPE:
+ f4->DS4DEVCT.DS4DEVTK = DASD_9345_VALUE;
+ break;
+ default:
+ f4->DS4DEVCT.DS4DEVTK = blocks * blksize;;
+ }
+
+ f4->DS4DEVCT.DS4DEVI = 0x00;
+ f4->DS4DEVCT.DS4DEVL = 0x00;
+ f4->DS4DEVCT.DS4DEVK = 0x00;
+ f4->DS4DEVCT.DS4DEVFG = 0x30;
+ f4->DS4DEVCT.DS4DEVTL = 0x0000;
+ f4->DS4DEVCT.DS4DEVDT = blocks;
+ f4->DS4DEVCT.DS4DEVDB = 0x00;
+ /* -- end f4->DS4DEVCT -- */
+
+ bzero(f4->DS4AMTIM, sizeof(f4->DS4AMTIM));
+ bzero(f4->DS4AMCAT, sizeof(f4->DS4AMCAT));
+ bzero(f4->DS4R2TIM, sizeof(f4->DS4R2TIM));
+ bzero(f4->res1, sizeof(f4->res1));
+ bzero(f4->DS4F6PTR, sizeof(f4->DS4F6PTR));
+
+ /* -- begin f4lbl->DS4VTOCE -- */
+ vtoc_set_extent(&f4->DS4VTOCE, 0x01, 0x00, &lower, &upper);
+ /* -- end f4lbl->DS4VTOCE -- */
+
+ bzero(f4->res2, sizeof(f4->res2));
+ f4->DS4EFLVL = 0x00;
+ bzero(&f4->DS4EFPTR, sizeof(f4->DS4EFPTR));
+ bzero(f4->res3, sizeof(f4->res3));
+}
+
+/*
+ * initializes a format5 label
+ */
+void
+vtoc_init_format5_label (format5_label_t *f5)
+{
+ PDEBUG
+ int i;
+
+ bzero(f5, sizeof(format5_label_t));
+ for (i=0; i<4; i++)
+ f5->DS5KEYID[i] = 0x05;
+ f5->DS5FMTID = 0xf5;
+}
+
+/*
+ * initializes a format7 label
+ */
+void
+vtoc_init_format7_label (format7_label_t *f7)
+{
+ PDEBUG
+ int i;
+
+ bzero(f7, sizeof(format7_label_t));
+ for (i=0; i<4; i++)
+ f7->DS7KEYID[i] = 0x07;
+ f7->DS7FMTID = 0xf7;
+}
+
+/*
+ * initializes a format1 label
+ */
+void
+vtoc_init_format1_label (char *volid, unsigned int blksize,
+ extent_t *part_extent, format1_label_t *f1)
+{
+ PDEBUG
+ struct tm * creatime;
+ time_t t;
+ char str[80];
+
+ /* get actual date */
+ t = time(NULL);
+ creatime = gmtime(&t);
+
+ bzero(f1->DS1DSNAM, sizeof(f1->DS1DSNAM));
+ sprintf(str, "PART .NEW ");
+ vtoc_ebcdic_enc(str, str, 44);
+ strncpy(f1->DS1DSNAM, str, 44);
+ f1->DS1FMTID = 0xf1;
+ strncpy(f1->DS1DSSN, " ", 6);
+ f1->DS1VOLSQ = 0x0001;
+
+ vtoc_set_date(&f1->DS1CREDT, (u_int8_t) creatime->tm_year,
+ (u_int16_t) creatime->tm_yday);
+ /* expires never - 99 365 */
+ vtoc_set_date(&f1->DS1EXPDT, 0x63, 0x016D);
+ f1->DS1NOEPV = 0x01;
+ f1->DS1NOBDB = 0x00;
+ f1->DS1FLAG1 = 0x00;
+ vtoc_ebcdic_enc("IBM LINUX ", str, 13);
+ strncpy(f1->DS1SYSCD, str, 13);
+ vtoc_set_date(&f1->DS1REFD, (u_int8_t) creatime->tm_year,
+ (u_int16_t) creatime->tm_yday);
+ f1->DS1SMSFG = 0x00;
+ f1->DS1SCXTF = 0x00;
+ f1->DS1SCXTV = 0x0000;
+ f1->DS1DSRG1 = 0x00;
+ f1->DS1DSRG2 = 0x00;
+ f1->DS1RECFM = 0x88;
+ f1->DS1OPTCD = 0x00;
+ f1->DS1BLKL = blksize;
+ f1->DS1LRECL = blksize;
+ f1->DS1KEYL = 0x00;
+ f1->DS1RKP = 0x0000;
+ f1->DS1DSIND = 0x80; /* last volume for this dataset */
+ f1->DS1SCAL1 = 0x80;
+ bzero(&f1->DS1SCAL3, sizeof(f1->DS1SCAL3));
+ vtoc_set_ttr(&f1->DS1LSTAR, 0x0000, 0x00);
+ f1->DS1TRBAL = 0x00;
+ bzero(&f1->res1, sizeof(f1->res1));
+ memcpy(&f1->DS1EXT1, part_extent, sizeof(extent_t));
+ bzero(&f1->DS1EXT2, sizeof(extent_t));
+ bzero(&f1->DS1EXT3, sizeof(extent_t));
+ vtoc_set_cchhb(&f1->DS1PTRDS, 0x0000, 0x0000, 0x00);
+}
+
+/*
+ * do some updates to the VTOC format4 label
+ */
+void
+vtoc_update_format4_label (format4_label_t *f4, cchhb_t *highest_f1,
+ u_int16_t unused_update)
+{
+ PDEBUG
+ /* update highest address of a format 1 label */
+ memcpy(&f4->DS4HPCHR, highest_f1, sizeof(cchhb_t));
+
+ /* update unused DSCB count */
+ f4->DS4DSREC = unused_update;
+}
+
+/*
+ * reorganizes all extents within a FMT5 label
+ */
+static void
+vtoc_reorganize_FMT5_extents (format5_label_t *f5)
+{
+ PDEBUG
+ ds5ext_t *ext, *last, tmp;
+ int i, j;
+
+ for (i=0; i<26; i++) {
+ if (i==0)
+ last = &f5->DS5AVEXT;
+ else if ((i > 0) && (i < 8))
+ last = &f5->DS5EXTAV[i-1];
+ else
+ last = &f5->DS5MAVET[i-8];
+
+ for (j=i; j<26; j++) {
+ if (j==0)
+ ext = &f5->DS5AVEXT;
+ else if ((j > 0) && (j < 8))
+ ext = &f5->DS5EXTAV[j-1];
+ else
+ ext = &f5->DS5MAVET[j-8];
+
+ if (((ext->t > 0) && (last->t == 0)) ||
+ ((ext->t > 0) && (ext->t < last->t)))
+ {
+ tmp.t = last->t;
+ tmp.fc = last->fc;
+ tmp.ft = last->ft;
+ last->t = ext->t;
+ last->fc = ext->fc;
+ last->ft = ext->ft;
+ ext->t = tmp.t;
+ ext->fc = tmp.fc;
+ ext->ft = tmp.ft;
+ }
+ }
+ }
+}
+
+/*
+ * add a free space extent description to the VTOC FMT5 DSCB
+ */
+void
+vtoc_update_format5_label_add (format5_label_t *f5, int verbose, int cyl,
+ int trk, u_int16_t a, u_int16_t b, u_int8_t c)
+{
+ PDEBUG
+ ds5ext_t *ext = NULL, *tmp = NULL;
+ int i;
+
+ for (i=0; i<26; i++) {
+ if (i==0)
+ ext = &f5->DS5AVEXT;
+ else if ((i > 0) && (i < 8))
+ ext = &f5->DS5EXTAV[i-1];
+ else
+ ext = &f5->DS5MAVET[i-8];
+
+ if (((a < ext->t) && (a + b*trk + c > ext->t)) ||
+ ((a > ext->t) && (ext->t + ext->fc*trk + ext->ft > a)))
+ {
+ printf("BUG: overlapping free space extents " \
+ "in FMT5 DSCB!\nexiting...\n");
+ exit(1);
+ }
+
+ if ((ext->t + ext->fc + ext->ft) == 0x0000) {
+ ext->t = a;
+ ext->fc = b;
+ ext->ft = c;
+ tmp = ext;
+ if (verbose)
+ printf("FMT5 add extent: " \
+ "add new extent\n");
+ break;
+ }
+ }
+
+ if (tmp == NULL) {
+ /* BUG: no free extent found */
+ printf("BUG: no free FMT5 DSCB extent found!\nexiting...\n");
+ exit(1);
+ }
+
+ for (i=0; i<26; i++) {
+ if (i==0)
+ ext = &f5->DS5AVEXT;
+ else if ((i > 0) && (i < 8))
+ ext = &f5->DS5EXTAV[i-1];
+ else
+ ext = &f5->DS5MAVET[i-8];
+
+ if ((ext->t + ext->fc + ext->ft) == 0x0000)
+ continue;
+
+ if ((ext->t + ext->fc*trk + ext->ft) == tmp->t) {
+ /* this extent precedes the new one */
+ ext->fc += (tmp->fc + (tmp->ft + ext->ft)/trk);
+ ext->ft = (tmp->ft + ext->ft) % trk;
+ bzero(tmp, sizeof(ds5ext_t));
+ tmp = ext;
+
+ if (verbose)
+ printf("FMT5 add extent: " \
+ "merge with predecessor\n");
+
+ i = -1;
+ continue;
+ }
+
+ if ((tmp->t + tmp->fc*trk + tmp->ft) == ext->t) {
+ /* this extent succeeds the new one */
+ ext->t = tmp->t;
+ ext->fc += (tmp->fc + (tmp->ft + ext->ft)/trk);
+ ext->ft = (tmp->ft + ext->ft) % trk;
+ bzero(tmp, sizeof(ds5ext_t));
+ tmp = ext;
+
+ if (verbose)
+ printf("FMT5 add extent: " \
+ "merge with successor\n");
+
+ i = -1;
+ continue;
+ }
+ }
+}
+
+/*
+ * remove a free space extent description from the VTOC FMT5 DSCB
+ */
+void
+vtoc_update_format5_label_del (format5_label_t *f5, int verbose, int cyl,
+ int trk, u_int16_t a, u_int16_t b, u_int8_t c)
+{
+ PDEBUG
+ ds5ext_t *ext;
+ int i, counter=0;
+
+ for (i=0; i<26; i++) {
+ if (i==0)
+ ext = &f5->DS5AVEXT;
+ else if ((i > 0) && (i < 8))
+ ext = &f5->DS5EXTAV[i-1];
+ else
+ ext = &f5->DS5MAVET[i-8];
+
+ if ((a == ext->t) && (b == ext->fc) && (c == ext->ft)) {
+ /* fills up whole free space gap */
+ bzero(ext, sizeof(ds5ext_t));
+
+ if (verbose)
+ printf("FMT5 del extent: fills whole gap\n");
+
+ counter++;
+ break;
+ }
+
+ if ((a == ext->t) && ((b < ext->fc) || (c < ext->ft))) {
+ /* left-bounded in free space gap */
+ ext->t = ext->t + b*trk + c;
+
+ if (c > ext->ft) {
+ ext->fc -= (b + 1);
+ ext->ft -= (c - trk);
+ } else {
+ ext->fc -= b;
+ ext->ft -= c;
+ }
+
+ if (verbose)
+ printf("FMT5 del extent: left bounded\n");
+
+ counter++;
+ break;
+ }
+
+ if ((ext->t < a)
+ && ((ext->t + ext->fc*trk + ext->ft) == (a + b*trk + c)))
+ {
+ /* right-bounded in free space gap */
+ if (c > ext->ft) {
+ ext->fc -= (b + 1);
+ ext->ft -= (c - trk);
+ } else {
+ ext->fc -= b;
+ ext->ft -= c;
+ }
+
+ if (verbose)
+ printf("FMT5 del extent: right bounded\n");
+
+ counter++;
+ break;
+ }
+
+ if ((a > ext->t)
+ && ((ext->t + ext->fc*trk + ext->ft) > (a + b*trk + c)))
+ {
+ /* partition devides free space into 2 pieces */
+ u_int16_t x = a + b*trk + c;
+ u_int16_t w,y;
+ u_int8_t z;
+
+ w = (ext->t + ext->fc*trk + ext->ft) - (a + b*trk + c);
+ y = w / trk;
+ z = w % trk;
+
+ ext->fc = (a - ext->t) / trk;
+ ext->ft = (a - ext->t) % trk;
+
+ vtoc_update_format5_label_add(f5, verbose,
+ cyl, trk, x, y, z);
+
+ if (verbose)
+ printf("FMT5 del extent: 2 pieces\n");
+
+ counter++;
+ break;
+ }
+
+ if ((a < ext->t) && (a + b*trk + c > ext->t)
+ && (a + b*trk + c < ext->t + ext->fc*trk + ext->ft))
+ {
+ printf("BUG: corresponding free space extent " \
+ "doesn't match free space currently shown " \
+ "in FMT5 DSCB!\nexiting...\n");
+ exit(1);
+ }
+
+ if ((a > ext->t) && (a < ext->t + ext->fc*trk + ext->ft)
+ && (a + b*trk + c > ext->t + ext->fc*trk + ext->ft))
+ {
+ printf("BUG: specified free space extent for " \
+ "deleting doesn't match free space " \
+ "currently shown in FMT5 DSCB!\n" \
+ "exiting...\n");
+ exit(1);
+ }
+ }
+
+ if (counter > 0)
+ return;
+
+ printf("BUG: specified free space extent for " \
+ "deleting not found in FMT5 DSCB!\n" \
+ "exiting...\n");
+ exit(1);
+}
+
+/*
+ * reorganizes all extents within a FMT7 label
+ */
+static void
+vtoc_reorganize_FMT7_extents (format7_label_t *f7)
+{
+ PDEBUG
+ ds7ext_t *ext, *last, tmp;
+ int i, j;
+
+ for (i=0; i<16; i++) {
+ if (i<5)
+ last = &f7->DS7EXTNT[i];
+ else
+ last = &f7->DS7ADEXT[i-5];
+
+ for (j=i; j<16; j++) {
+ if (j<5)
+ ext = &f7->DS7EXTNT[j];
+ else
+ ext = &f7->DS7ADEXT[j-5];
+
+ if (((ext->a > 0) && (last->a == 0))
+ || ((ext->a > 0) && (ext->a < last->a)))
+ {
+ tmp.a = last->a;
+ tmp.b = last->b;
+ last->a = ext->a;
+ last->b = ext->b;
+ ext->a = tmp.a;
+ ext->b = tmp.b;
+ }
+ }
+ }
+}
+
+/*
+ * add a free space extent description to the VTOC FMT7 DSCB
+ */
+void
+vtoc_update_format7_label_add (format7_label_t *f7, int verbose,
+ u_int32_t a, u_int32_t b)
+{
+ PDEBUG
+ ds7ext_t *ext = NULL, *tmp = NULL;
+ int i;
+
+ for (i=0; i<16; i++) {
+ if (i<5)
+ ext = &f7->DS7EXTNT[i];
+ else
+ ext = &f7->DS7ADEXT[i-5];
+
+ if (((a < ext->a) && (b > ext->a) && (b < ext->b))
+ || ((a > ext->a) && (a < ext->b) && (b > ext->b)))
+ {
+ printf("BUG: overlapping free space extents " \
+ "in FMT7 DSCB!\nexiting...\n");
+ exit(1);
+ }
+
+ if ((ext->a + ext->b) == 0x00000000) {
+ ext->a = a;
+ ext->b = b;
+ tmp = ext;
+
+ if (verbose)
+ printf("FMT7 add extent: " \
+ "add new extent\n");
+
+ break;
+ }
+ }
+
+ if (tmp == NULL) {
+ /* BUG: no free extent found */
+ printf("BUG: no free FMT7 DSCB extent found!\nexiting...\n");
+ exit(1);
+ }
+
+ for (i=0; i<16; i++) {
+ if (i<5)
+ ext = &f7->DS7EXTNT[i];
+ else
+ ext = &f7->DS7ADEXT[i-5];
+
+ if ((ext->a + ext->b) == 0x00000000)
+ continue;
+
+ if ((ext->b + 1) == tmp->a) {
+ /* this extent precedes the new one */
+ ext->b = tmp->b;
+ bzero(tmp, sizeof(ds7ext_t));
+ tmp = ext;
+
+ if (verbose)
+ printf("FMT7 add extent: " \
+ "merge with predecessor\n");
+
+ i = -1;
+ continue;
+ }
+
+ if (ext->a == (tmp->b + 1)) {
+ /* this extent succeeds the new one */
+ ext->a = tmp->a;
+ bzero(tmp, sizeof(ds7ext_t));
+ tmp = ext;
+
+ if (verbose)
+ printf("FMT7 add extent: " \
+ "merge with successor\n");
+
+ i = -1;
+ continue;
+ }
+ }
+}
+
+/*
+ * remove a free space extent description from the VTOC FMT7 DSCB
+ */
+void
+vtoc_update_format7_label_del (format7_label_t *f7, int verbose,
+ u_int32_t a, u_int32_t b)
+{
+ PDEBUG
+ ds7ext_t *ext;
+ int i, counter=0;
+
+ for (i=0; i<16; i++) {
+ if (i<5)
+ ext = &f7->DS7EXTNT[i];
+ else
+ ext = &f7->DS7ADEXT[i-5];
+
+ if ((a == ext->a) && (b == ext->b)) {
+ /* fills up whole free space gap */
+ bzero(ext, sizeof(ds7ext_t));
+
+ if (verbose)
+ printf("FMT7 del extent: " \
+ "fills whole gap\n");
+
+ counter++;
+ break;
+ }
+
+ if ((a == ext->a) && (b < ext->b)) {
+ /* left-bounded in free space gap */
+ ext->a = b + 1;
+
+ if (verbose)
+ printf("FMT7 add extent: " \
+ "left-bounded\n");
+
+ counter++;
+ break;
+ }
+
+ if ((a > ext->a) && (b == ext->b)) {
+ /* right-bounded in free space gap */
+ ext->b = a - 1;
+
+ if (verbose)
+ printf("FMT7 add extent: " \
+ "right-bounded\n");
+
+ counter++;
+ break;
+ }
+
+ if ((a > ext->a) && (b < ext->b)) {
+ /* partition devides free space into 2 pieces */
+ vtoc_update_format7_label_add(f7, verbose, b+1, ext->b);
+ ext->b = a - 1;
+
+ if (verbose)
+ printf("FMT7 add extent: " \
+ "2 pieces\n");
+
+ counter++;
+ break;
+ }
+
+ if (((a < ext->a) && (b > ext->a)) || ((a < ext->b) && (b > ext->b))) {
+ printf ("BUG: specified free space extent for deleting "
+ "doesn't match free space currently shown in "
+ "FMT7 DSCB!\nexiting...\n");
+ printf ("%d %d %d %d\n", a, b, ext->a, ext->b);
+ exit(1);
+ }
+ }
+
+ if (counter > 0)
+ return;
+
+ printf("BUG: specified free space extent for " \
+ "deleting not found in FMT7 DSCB!\n" \
+ "exiting...\n");
+ exit(1);
+}
+
+void
+vtoc_set_freespace(format4_label_t *f4, format5_label_t *f5,
+ format7_label_t *f7, char ch, int verbose,
+ u_int32_t start, u_int32_t stop, int cyl, int trk)
+{
+ PDEBUG
+ if ((cyl * trk) > BIG_DISK_SIZE) {
+ if (ch == '+')
+ vtoc_update_format7_label_add(f7, verbose, start, stop);
+ else if (ch == '-')
+ vtoc_update_format7_label_del(f7, verbose, start, stop);
+ else
+ printf("BUG: syntax error in " \
+ "vtoc_set_freespace call\n");
+
+ vtoc_reorganize_FMT7_extents (f7);
+
+ f4->DS4VTOCI = 0xa0;
+ f4->DS4EFLVL = 0x07;
+ vtoc_set_cchhb(&f4->DS4EFPTR, 0x0000, 0x0001, 0x03);
+ } else {
+ u_int16_t x,y;
+ u_int8_t z;
+
+ x = (u_int16_t) start;
+ y = (u_int16_t) ((stop - start + 1) / trk);
+ z = (u_int8_t) ((stop - start + 1) % trk);
+
+ if (ch == '+')
+ vtoc_update_format5_label_add(f5, verbose, cyl, trk, x, y, z);
+ else if (ch == '-')
+ vtoc_update_format5_label_del(f5, verbose, cyl, trk, x, y, z);
+ else
+ printf("BUG: syntax error in " \
+ "vtoc_set_freespace call\n");
+
+ vtoc_reorganize_FMT5_extents (f5);
+ }
+}
diff --git a/libparted/libparted.c b/libparted/libparted.c
new file mode 100644
index 0000000..c3c8ab4
--- /dev/null
+++ b/libparted/libparted.c
@@ -0,0 +1,345 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#include "config.h"
+
+#include <parted/parted.h>
+#include <parted/debug.h>
+
+#ifdef linux
+# include <parted/linux.h>
+#elif defined(__BEOS__)
+# include <parted/beos.h>
+#else
+# include <parted/gnu.h>
+#endif
+
+#include <string.h>
+#include <stdlib.h>
+
+#if ENABLE_NLS
+# include <locale.h>
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+const PedArchitecture* ped_architecture;
+
+/* ped_malloc() debugging. Stick the address and size of memory blocks that
+ * weren't ped_free()d in here, and an exception will be thrown when it is
+ * allocated. That way, you can find out what, exactly, the allocated thing
+ * is, and where it is created.
+ */
+typedef struct
+{
+ void* pointer;
+ size_t size;
+} pointer_size_type;
+
+#ifdef DEBUG
+static pointer_size_type dodgy_malloc_list[] = {
+ {0, 0},
+ {0, 0},
+ {0, 0},
+ {0, 0},
+ {0, 0},
+ {0, 0},
+ {0, 0},
+ {0, 0},
+ {0, 0},
+ {0, 0}
+};
+
+static int dodgy_memory_active[100];
+#endif /* DEBUG */
+
+int
+ped_set_architecture (const PedArchitecture* arch)
+{
+ PED_ASSERT (ped_device_get_next (NULL) == NULL, return 0);
+
+ ped_architecture = arch;
+ return 1;
+}
+
+extern void ped_disk_aix_init ();
+extern void ped_disk_bsd_init ();
+extern void ped_disk_dvh_init ();
+extern void ped_disk_gpt_init ();
+extern void ped_disk_loop_init ();
+extern void ped_disk_mac_init ();
+extern void ped_disk_msdos_init ();
+extern void ped_disk_pc98_init ();
+extern void ped_disk_sun_init ();
+extern void ped_disk_amiga_init ();
+extern void ped_disk_dasd_init ();
+
+static void
+init_disk_types ()
+{
+ ped_disk_loop_init (); /* must be last in the probe list */
+
+#if defined(__s390__) || defined(__s390x__)
+ ped_disk_dasd_init();
+#endif
+
+ ped_disk_sun_init ();
+#ifdef ENABLE_PC98
+ ped_disk_pc98_init ();
+#endif
+ ped_disk_msdos_init ();
+ ped_disk_mac_init ();
+ ped_disk_gpt_init ();
+ ped_disk_dvh_init ();
+ ped_disk_bsd_init ();
+ ped_disk_amiga_init ();
+ ped_disk_aix_init ();
+}
+
+#ifdef ENABLE_FS
+extern void ped_file_system_amiga_init (void);
+extern void ped_file_system_xfs_init (void);
+extern void ped_file_system_ufs_init (void);
+extern void ped_file_system_reiserfs_init (void);
+extern void ped_file_system_ntfs_init (void);
+extern void ped_file_system_linux_swap_init (void);
+extern void ped_file_system_jfs_init (void);
+extern void ped_file_system_hfs_init (void);
+extern void ped_file_system_fat_init (void);
+extern void ped_file_system_ext2_init (void);
+
+static void
+init_file_system_types ()
+{
+ ped_file_system_amiga_init ();
+ ped_file_system_xfs_init ();
+ ped_file_system_ufs_init ();
+ ped_file_system_reiserfs_init ();
+ ped_file_system_ntfs_init ();
+ ped_file_system_linux_swap_init ();
+ ped_file_system_jfs_init ();
+ ped_file_system_hfs_init ();
+ ped_file_system_fat_init ();
+ ped_file_system_ext2_init ();
+}
+#endif /* ENABLE_FS */
+
+extern void ped_disk_aix_done ();
+extern void ped_disk_bsd_done ();
+extern void ped_disk_dvh_done ();
+extern void ped_disk_gpt_done ();
+extern void ped_disk_loop_done ();
+extern void ped_disk_mac_done ();
+extern void ped_disk_msdos_done ();
+extern void ped_disk_pc98_done ();
+extern void ped_disk_sun_done ();
+extern void ped_disk_amiga_done ();
+extern void ped_disk_dasd_done ();
+
+static void
+done_disk_types ()
+{
+#if defined(__s390__) || (__s390x__)
+ ped_disk_dasd_done ();
+#endif
+ ped_disk_sun_done ();
+#ifdef ENABLE_PC98
+ ped_disk_pc98_done ();
+#endif
+ ped_disk_msdos_done ();
+ ped_disk_mac_done ();
+ ped_disk_loop_done ();
+ ped_disk_gpt_done ();
+ ped_disk_dvh_done ();
+ ped_disk_bsd_done ();
+ ped_disk_amiga_done ();
+ ped_disk_aix_done ();
+}
+
+static void _init() __attribute__ ((constructor));
+
+static void
+_init()
+{
+#ifdef ENABLE_NLS
+ bindtextdomain (PACKAGE, LOCALEDIR);
+#endif
+
+ init_disk_types ();
+
+#ifdef ENABLE_FS
+ init_file_system_types ();
+#endif
+
+ /* FIXME: a better way of doing this? */
+#ifdef linux
+ ped_set_architecture (&ped_linux_arch);
+#elif defined(__BEOS__)
+ ped_set_architecture (&ped_beos_arch);
+#else
+ ped_set_architecture (&ped_gnu_arch);
+#endif
+
+#ifdef DEBUG
+ memset (dodgy_memory_active, 0, sizeof (dodgy_memory_active));
+#endif
+}
+
+#ifdef ENABLE_FS
+extern void ped_file_system_ext2_done (void);
+extern void ped_file_system_fat_done (void);
+extern void ped_file_system_hfs_done (void);
+extern void ped_file_system_jfs_done (void);
+extern void ped_file_system_linux_swap_done (void);
+extern void ped_file_system_ntfs_done (void);
+extern void ped_file_system_reiserfs_done (void);
+extern void ped_file_system_ufs_done (void);
+extern void ped_file_system_xfs_done (void);
+extern void ped_file_system_amiga_done (void);
+
+static void
+done_file_system_types ()
+{
+ ped_file_system_ext2_done ();
+ ped_file_system_fat_done ();
+ ped_file_system_hfs_done ();
+ ped_file_system_jfs_done ();
+ ped_file_system_linux_swap_done ();
+ ped_file_system_ntfs_done ();
+ ped_file_system_reiserfs_done ();
+ ped_file_system_ufs_done ();
+ ped_file_system_xfs_done ();
+ ped_file_system_amiga_done ();
+}
+#endif /* ENABLE_FS */
+
+static void _done() __attribute__ ((destructor));
+
+static void
+_done()
+{
+ ped_device_free_all ();
+
+ done_disk_types ();
+
+#ifdef ENABLE_FS
+ done_file_system_types ();
+#endif
+}
+
+const char*
+ped_get_version ()
+{
+ return VERSION;
+}
+
+#ifdef DEBUG
+static void
+_check_dodgy_pointer (const void* ptr, size_t size, int is_malloc)
+{
+ int i;
+
+ for (i=0; dodgy_malloc_list[i].pointer; i++) {
+ if (dodgy_malloc_list[i].pointer != ptr)
+ continue;
+ if (is_malloc && dodgy_malloc_list[i].size != size)
+ continue;
+ if (!is_malloc && !dodgy_memory_active[i])
+ continue;
+
+
+ if (is_malloc) {
+ ped_exception_throw (
+ PED_EXCEPTION_INFORMATION,
+ PED_EXCEPTION_OK,
+ "Dodgy malloc(%x) == %p occurred (active==%d)",
+ size, ptr, dodgy_memory_active[i]);
+ dodgy_memory_active[i]++;
+ } else {
+ ped_exception_throw (
+ PED_EXCEPTION_INFORMATION,
+ PED_EXCEPTION_OK,
+ "Dodgy free(%p) occurred (active==%d)",
+ ptr, dodgy_memory_active[i]);
+ dodgy_memory_active[i]--;
+ }
+
+ return;
+ }
+}
+#endif /* DEBUG */
+
+void*
+ped_malloc (size_t size)
+{
+ void* mem;
+
+ mem = (void*) malloc (size);
+ if (!mem) {
+ ped_exception_throw (PED_EXCEPTION_FATAL, PED_EXCEPTION_CANCEL,
+ _("Out of memory."));
+ return NULL;
+ }
+
+#ifdef DEBUG
+ memset (mem, 0xff, size);
+ _check_dodgy_pointer (mem, size, 1);
+#endif
+
+ return mem;
+}
+
+int
+ped_realloc (void** old, size_t size)
+{
+ void* mem;
+
+ mem = (void*) realloc (*old, size);
+ if (!mem) {
+ ped_exception_throw (PED_EXCEPTION_FATAL, PED_EXCEPTION_CANCEL,
+ _("Out of memory."));
+ return 0;
+ }
+ *old = mem;
+ return 1;
+}
+
+
+void* ped_calloc (size_t size)
+{
+ void* buf = ped_malloc (size);
+
+ memset (buf, 0, size);
+
+ return buf;
+}
+
+
+void
+ped_free (void* ptr)
+{
+#ifdef DEBUG
+ _check_dodgy_pointer (ptr, 0, 0);
+#endif
+
+ free (ptr);
+}
+
diff --git a/libparted/mbr.s b/libparted/mbr.s
new file mode 100644
index 0000000..0d35aa9
--- /dev/null
+++ b/libparted/mbr.s
@@ -0,0 +1,86 @@
+; libparted - a library for manipulating disk partitions
+; Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+;
+; This program is free software; you can redistribute it and/or modify
+; it under the terms of the GNU General Public License as published by
+; the Free Software Foundation; either version 2 of the License, or
+; (at your option) any later version.
+;
+; This program is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+; GNU General Public License for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with this program; if not, write to the Free Software
+; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+
+; NOTE: I build this with:
+; $ as86 -b /dev/stdout mbr.s | hexdump -e '8/1 "0x%02x, " "\n"'
+;
+; The build isn't done automagically by make, because as86 may not be on many
+; machines (particularly non-x86). Also, it seems rather difficult to get
+; as86 to build object files that can be linked, especially as it's 16 bit
+; code...
+
+USE16
+
+; This code, plus the partition table is loaded into 0000:7C00 by the BIOS
+
+.text
+
+; set top of stack to 1000:B000
+
+ cli
+
+ mov ax, #0x1000
+ mov ss, ax
+ mov sp, #0xB000
+
+ mov ax, #0x0000
+ mov ds, ax
+ mov es, ax
+
+ sti
+
+; Copy what the BIOS loaded (i.e. the MBR + head of partition table) from
+; 0000:7c00 to 0000:0600
+
+ mov si, #0x7c00
+ mov di, #0x0600
+ mov cx, #0x200
+ rep
+ movsb
+
+; Jump to the copy of the MBR
+
+ jmp 0x0000:find_boot_partition + 0x0600
+
+find_boot_partition:
+ mov si, #0x07BE
+
+check_next_bootable:
+ cmp [si], al
+ jnz found_bootable
+ add si, #0x0010
+ cmp si, #0x07FE
+ jnz check_next_bootable
+ jmp error
+
+found_bootable:
+
+; Load in the boot sector at 0000:7c00
+
+ mov ah, #2 ; BIOS command (read)
+ mov al, #1 ; count
+ mov bx, #0x7c00 ; destination pointer
+ mov dl, #0x80 ; drive
+ mov dh, byte ptr [si + 1] ; head
+ mov cx, word ptr [si + 2] ; sector / cylinder
+ int #0x13 ; BIOS read interrupt
+
+ jmp 0x0000:0x7c00 ; hand control to boot sector
+
+error:
+ jmp error
+
diff --git a/libparted/timer.c b/libparted/timer.c
new file mode 100644
index 0000000..ac403ba
--- /dev/null
+++ b/libparted/timer.c
@@ -0,0 +1,245 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+/** \file timer.c */
+
+/**
+ * \addtogroup PedTimer
+ *
+ * \brief A PedTimer keeps track of the progress of a single (possibly
+ * compound) operation.
+ *
+ * The user of libparted constructs a PedTimer, and passes it to libparted
+ * functions that are likely to be expensive operations
+ * (like ped_file_system_resize). Use of timers is optional... you may
+ * pass NULL instead.
+ *
+ * When you create a PedTimer, you must specify a timer handler function.
+ * This will be called when there's an update on how work is progressing.
+ *
+ * Timers may be nested. When a timer is constructed, you can choose
+ * to assign it a parent, along with an estimate of what proportion of
+ * the total (parent's) time will be used in the nested operation. In
+ * this case, the nested timer's handler is internal to libparted,
+ * and simply updates the parent's progress, and calls its handler.
+ *
+ * @{
+ */
+
+
+#include <parted/parted.h>
+#include <parted/debug.h>
+
+#define PED_TIMER_START_DELAY 2
+
+typedef struct {
+ PedTimer* parent;
+ float nest_frac;
+ float start_frac;
+} NestedContext;
+
+
+/**
+ * \brief Creates a timer.
+ *
+ * Context will be passed in the \p context
+ * argument to the \p handler, when it is invoked.
+ *
+ * \return a new PedTimer
+ */
+PedTimer*
+ped_timer_new (PedTimerHandler* handler, void* context)
+{
+ PedTimer* timer;
+
+ PED_ASSERT (handler != NULL, return NULL);
+
+ timer = (PedTimer*) ped_malloc (sizeof (PedTimer));
+ if (!timer)
+ return NULL;
+
+ timer->handler = handler;
+ timer->context = context;
+ ped_timer_reset (timer);
+ return timer;
+}
+
+
+/**
+ * \brief Destroys a \p timer.
+ */
+void
+ped_timer_destroy (PedTimer* timer)
+{
+ if (!timer)
+ return;
+
+ ped_free (timer);
+}
+
+/* This function is used by ped_timer_new_nested() as the timer->handler
+ * function.
+ */
+static void
+_nest_handler (PedTimer* timer, void* context)
+{
+ NestedContext* ncontext = (NestedContext*) context;
+
+ ped_timer_update (
+ ncontext->parent,
+ ncontext->start_frac + ncontext->nest_frac * timer->frac);
+}
+
+
+/**
+ * \brief Creates a new nested timer.
+ *
+ * This function creates a "nested" timer that describes the progress
+ * of a subtask. \p parent is the parent timer, and \p nested_frac is
+ * the estimated proportion (between 0 and 1) of the time that will be
+ * spent doing the nested timer's operation. The timer should only be
+ * constructed immediately prior to starting the nested operation.
+ * (It will be inaccurate, otherwise).
+ * Updates to the progress of the subtask are propagated
+ * back through to the parent task's timer.
+ *
+ * \return nested timer
+ */
+PedTimer*
+ped_timer_new_nested (PedTimer* parent, float nest_frac)
+{
+ NestedContext* context;
+
+ if (!parent)
+ return NULL;
+
+ PED_ASSERT (nest_frac >= 0.0, return NULL);
+ PED_ASSERT (nest_frac <= 1.0, return NULL);
+
+ context = (NestedContext*) ped_malloc (sizeof (NestedContext));
+ if (!context)
+ return NULL;
+ context->parent = parent;
+ context->nest_frac = nest_frac;
+ context->start_frac = parent->frac;
+
+ return ped_timer_new (_nest_handler, context);
+}
+
+/**
+ * \brief Destroys a nested \p timer.
+ */
+void
+ped_timer_destroy_nested (PedTimer* timer)
+{
+ if (!timer)
+ return;
+
+ ped_free (timer->context);
+ ped_timer_destroy (timer);
+}
+
+/**
+ * \internal
+ *
+ * \brief This function calls the update handler, making sure that it has
+ * the latest time.
+ *
+ * First it updates \p timer->now and recomputes \p timer->predicted_end,
+ * and then calls the handler.
+ */
+void
+ped_timer_touch (PedTimer* timer)
+{
+ if (!timer)
+ return;
+
+ timer->now = time (NULL);
+ if (timer->now > timer->predicted_end)
+ timer->predicted_end = timer->now;
+
+ timer->handler (timer, timer->context);
+}
+
+/**
+ * \internal
+ *
+ * \brief This function sets the \p timer into a "start of task" position.
+ *
+ * It resets the \p timer, by setting \p timer->start and \p timer->now
+ * to the current time.
+ */
+void
+ped_timer_reset (PedTimer* timer)
+{
+ if (!timer)
+ return;
+
+ timer->start = timer->now = timer->predicted_end = time (NULL);
+ timer->state_name = NULL;
+ timer->frac = 0;
+
+ ped_timer_touch (timer);
+}
+
+/**
+ * \internal
+ *
+ * \brief This function tells a \p timer what fraction \p frac of the task
+ * has been completed.
+ *
+ * Sets the new \p timer->frac, and calls ped_timer_touch().
+ */
+void
+ped_timer_update (PedTimer* timer, float frac)
+{
+ if (!timer)
+ return;
+
+ timer->now = time (NULL);
+ timer->frac = frac;
+
+ if (frac)
+ timer->predicted_end
+ = timer->start
+ + (long) ((timer->now - timer->start) / frac);
+
+ ped_timer_touch (timer);
+}
+
+/**
+ * \internal
+ *
+ * \brief This function changes the description of the current task that the
+ * \p timer describes.
+ *
+ * Sets a new name - \p state_name - for the current "phase" of the operation,
+ * and calls ped_timer_touch().
+ */
+void
+ped_timer_set_state_name (PedTimer* timer, const char* state_name)
+{
+ if (!timer)
+ return;
+
+ timer->state_name = state_name;
+ ped_timer_touch (timer);
+}
+
+/** @} */
diff --git a/libparted/unit.c b/libparted/unit.c
new file mode 100644
index 0000000..ac4d74e
--- /dev/null
+++ b/libparted/unit.c
@@ -0,0 +1,564 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+/** \file unit.c */
+
+/**
+ * \addtogroup PedUnit
+ *
+ * \brief The PedUnit module provides a standard mechanism for describing
+ * and parsing locations within devices in human-friendly plain text.
+ *
+ * Internally, libparted uses PedSector (which is typedef'ed to be long long
+ * in <parted/device.h>) to describe device locations such as the start and
+ * end of partitions. However, sector numbers are often long and unintuitive.
+ * For example, my extended partition starts at sector 208845. PedUnit allows
+ * this location to be represented in more intutitive ways, including "106Mb",
+ * "0Gb" and "0%", as well as "208845s". PedUnit aims to provide facilities
+ * to provide a consistent system for describing device locations all
+ * throughout libparted.
+ *
+ * PedUnit provides two basic services: converting a PedSector into a text
+ * representation, and parsing a text representation into a PedSector.
+ * PedUnit currently supports these units:
+ *
+ * sectors, bytes, kilobytes, megabytes, gigabytes, terabytes, compact,
+ * cylinder and percent.
+ *
+ * PedUnit has a global variable that contains the default unit for all
+ * conversions.
+ *
+ * @{
+ */
+
+
+
+
+#include <parted/parted.h>
+#include <parted/debug.h>
+
+#include <ctype.h>
+#include <stdio.h>
+#include <string.h>
+#include <float.h>
+
+#define N_(String) String
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+
+static PedUnit default_unit = PED_UNIT_COMPACT;
+static const char* unit_names[] = {
+ "s",
+ "B",
+ "kB",
+ "MB",
+ "GB",
+ "TB",
+ "compact",
+ "cyl",
+ "chs",
+ "%",
+ "kiB",
+ "MiB",
+ "GiB",
+ "TiB"
+};
+
+
+/**
+ * \brief Set the default \p unit used by subsequent calls to the PedUnit API.
+ *
+ * In particular, this affects how locations inside error messages
+ * (exceptions) are displayed.
+ */
+void
+ped_unit_set_default (PedUnit unit)
+{
+ default_unit = unit;
+}
+
+
+/**
+ * \brief Get the current default unit.
+ */
+PedUnit
+ped_unit_get_default ()
+{
+ return default_unit;
+}
+
+/**
+ * Get the byte size of a given \p unit.
+ */
+long long
+ped_unit_get_size (PedDevice* dev, PedUnit unit)
+{
+ PedSector cyl_size = dev->bios_geom.heads * dev->bios_geom.sectors;
+
+ switch (unit) {
+ case PED_UNIT_SECTOR: return dev->sector_size;
+ case PED_UNIT_BYTE: return 1;
+ case PED_UNIT_KILOBYTE: return PED_KILOBYTE_SIZE;
+ case PED_UNIT_MEGABYTE: return PED_MEGABYTE_SIZE;
+ case PED_UNIT_GIGABYTE: return PED_GIGABYTE_SIZE;
+ case PED_UNIT_TERABYTE: return PED_TERABYTE_SIZE;
+ case PED_UNIT_KIBIBYTE: return PED_KIBIBYTE_SIZE;
+ case PED_UNIT_MEBIBYTE: return PED_MEBIBYTE_SIZE;
+ case PED_UNIT_GIBIBYTE: return PED_GIBIBYTE_SIZE;
+ case PED_UNIT_TEBIBYTE: return PED_TEBIBYTE_SIZE;
+ case PED_UNIT_CYLINDER: return cyl_size * dev->sector_size;
+ case PED_UNIT_CHS: return dev->sector_size;
+
+ case PED_UNIT_PERCENT:
+ return dev->length * dev->sector_size / 100;
+
+ case PED_UNIT_COMPACT:
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("Cannot get unit size for special unit "
+ "'COMPACT'."));
+ return 0;
+ }
+
+ /* never reached */
+ PED_ASSERT(0, return 0);
+ return 0;
+}
+
+/**
+ * Get a textual (non-internationalized) representation of a \p unit.
+ *
+ * For example, the textual representation of PED_UNIT_SECTOR is "s".
+ */
+const char*
+ped_unit_get_name (PedUnit unit)
+{
+ return unit_names[unit];
+}
+
+/**
+ * Get a unit based on its textual representation: \p unit_name.
+ *
+ * For example, ped_unit_get_by_name("Mb") returns PED_UNIT_MEGABYTE.
+ */
+PedUnit
+ped_unit_get_by_name (const char* unit_name)
+{
+ PedUnit unit;
+ for (unit = PED_UNIT_FIRST; unit <= PED_UNIT_LAST; unit++) {
+ if (!strcasecmp (unit_names[unit], unit_name))
+ return unit;
+ }
+ return -1;
+}
+
+static char*
+ped_strdup (const char *str)
+{
+ char *result;
+ result = ped_malloc (strlen (str) + 1);
+ if (!result)
+ return NULL;
+ strcpy (result, str);
+ return result;
+}
+
+/**
+ * \brief Get a string that describes the location of the \p byte on
+ * device \p dev.
+ *
+ * The string is described with the desired \p unit.
+ * The returned string must be freed with ped_free().
+ */
+char*
+ped_unit_format_custom_byte (PedDevice* dev, PedSector byte, PedUnit unit)
+{
+ char buf[100];
+ PedSector sector = byte / dev->sector_size;
+ double d, w;
+ int p;
+
+ PED_ASSERT (dev != NULL, return NULL);
+
+ /* CHS has a special comma-separated format. */
+ if (unit == PED_UNIT_CHS) {
+ PedCHSGeometry *chs = &dev->bios_geom;
+ snprintf (buf, 100, "%lld,%lld,%lld",
+ sector / chs->sectors / chs->heads,
+ (sector / chs->sectors) % chs->heads,
+ sector % chs->sectors);
+ return ped_strdup (buf);
+ }
+
+ /* Cylinders, sectors and bytes should be rounded down... */
+ if (unit == PED_UNIT_CYLINDER
+ || unit == PED_UNIT_SECTOR
+ || unit == PED_UNIT_BYTE) {
+ snprintf (buf, 100, "%lld%s",
+ byte / ped_unit_get_size (dev, unit),
+ ped_unit_get_name (unit));
+ return ped_strdup (buf);
+ }
+
+ if (unit == PED_UNIT_COMPACT) {
+ if (byte >= 10LL * PED_TERABYTE_SIZE)
+ unit = PED_UNIT_TERABYTE;
+ else if (byte >= 10LL * PED_GIGABYTE_SIZE)
+ unit = PED_UNIT_GIGABYTE;
+ else if (byte >= 10LL * PED_MEGABYTE_SIZE)
+ unit = PED_UNIT_MEGABYTE;
+ else
+ unit = PED_UNIT_KILOBYTE;
+ }
+
+ /* IEEE754 says that 100.5 has to be rounded to 100 (by printf) */
+ /* but 101.5 has to be rounded to 102... so we multiply by 1+E. */
+ /* This just divide by 2 the natural IEEE754 extended precision */
+ /* and won't cause any trouble before 1000 TB */
+ d = ((double)byte / (double)ped_unit_get_size (dev, unit))
+ * (1. + DBL_EPSILON);
+ w = d + ( (d < 10. ) ? 0.005 :
+ (d < 100.) ? 0.05 :
+ 0.5 );
+ p = (w < 10. ) ? 2 :
+ (w < 100.) ? 1 :
+ 0 ;
+
+#ifdef __BEOS__
+ snprintf (buf, 100, "%.*f%s", p, d, ped_unit_get_name(unit));
+#else
+ snprintf (buf, 100, "%1$.*2$f%3$s", d, p, ped_unit_get_name (unit));
+#endif
+
+ return ped_strdup (buf);
+}
+
+/**
+ * \brief Get a string that describes the location of the \p byte on
+ * device \p dev.
+ *
+ * The string is described with the default unit, which is set
+ * by ped_unit_set_default().
+ * The returned string must be freed with ped_free().
+ */
+char*
+ped_unit_format_byte (PedDevice* dev, PedSector byte)
+{
+ PED_ASSERT (dev != NULL, return NULL);
+ return ped_unit_format_custom_byte (dev, byte, default_unit);
+}
+
+/**
+ * \brief Get a string that describes the location \p sector on device \p dev.
+ *
+ * The string is described with the desired \p unit.
+ * The returned string must be freed with ped_free().
+ */
+char*
+ped_unit_format_custom (PedDevice* dev, PedSector sector, PedUnit unit)
+{
+ PED_ASSERT (dev != NULL, return NULL);
+ return ped_unit_format_custom_byte(dev, sector*dev->sector_size, unit);
+}
+
+/**
+ * \brief Get a string that describes the location \p sector on device \p dev.
+ *
+ * The string is described with the default unit, which is set
+ * by ped_unit_set_default().
+ * The returned string must be freed with ped_free().
+ */
+char*
+ped_unit_format (PedDevice* dev, PedSector sector)
+{
+ PED_ASSERT (dev != NULL, return NULL);
+ return ped_unit_format_custom_byte (dev, sector * dev->sector_size,
+ default_unit);
+}
+
+/**
+ * If \p str contains a valid description of a location on \p dev,
+ * then \p *sector is modified to describe the location and a geometry
+ * is created in \p *range describing a 2 units large area centered on
+ * \p *sector. If the \p range as described here would be partially outside
+ * the device \p dev, the geometry returned is the intersection between the
+ * former and the whole device geometry. If no units are specified, then the
+ * default unit is assumed.
+ *
+ * \return \c 1 if \p str is a valid location description, \c 0 otherwise
+ */
+int
+ped_unit_parse (const char* str, PedDevice* dev, PedSector *sector,
+ PedGeometry** range)
+{
+ return ped_unit_parse_custom (str, dev, default_unit, sector, range);
+}
+
+/* Inefficiently removes all spaces from a string, in-place. */
+static void
+strip_string (char* str)
+{
+ int i;
+
+ for (i = 0; str[i] != 0; i++) {
+ if (isspace (str[i])) {
+ int j;
+ for (j = i + 1; str[j] != 0; j++)
+ str[j - 1] = str[j];
+ }
+ }
+}
+
+
+/* Find non-number suffix. Eg: find_suffix("32Mb") returns a pointer to
+ * "Mb". */
+static char*
+find_suffix (char* str)
+{
+ while (str[0] != 0 && (isdigit (str[0]) || strchr(",.-", str[0])))
+ str++;
+ return str;
+}
+
+static void
+remove_punct (char* str)
+{
+ int i = 0;
+
+ for (i = 0; str[i]; i++) {
+ if (ispunct (str[i]))
+ str[i] = ' ';
+ }
+}
+
+static int
+is_chs (const char* str)
+{
+ int punct_count = 0;
+ int i = 0;
+
+ for (i = 0; str[i]; i++)
+ punct_count += ispunct (str[i]) != 0;
+ return punct_count == 2;
+}
+
+static int
+parse_chs (const char* str, PedDevice* dev, PedSector* sector,
+ PedGeometry** range)
+{
+ PedSector cyl_size = dev->bios_geom.heads * dev->bios_geom.sectors;
+ char* copy = ped_strdup (str);
+ PedCHSGeometry chs;
+
+ copy = ped_strdup (str);
+ if (!copy)
+ return 0;
+ strip_string (copy);
+ remove_punct (copy);
+
+ if (sscanf (copy, "%d %d %d",
+ &chs.cylinders, &chs.heads, &chs.sectors) != 3) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("\"%s\" has invalid syntax for locations."),
+ copy);
+ goto error_free_copy;
+ }
+
+ if (chs.heads >= dev->bios_geom.heads) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("The maximum head value is %d."),
+ dev->bios_geom.heads - 1);
+ goto error_free_copy;
+ }
+ if (chs.sectors >= dev->bios_geom.sectors) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("The maximum sector value is %d."),
+ dev->bios_geom.sectors - 1);
+ goto error_free_copy;
+ }
+
+ *sector = 1LL * chs.cylinders * cyl_size
+ + chs.heads * dev->bios_geom.sectors
+ + chs.sectors;
+
+ if (*sector >= dev->length) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("The location %s is outside of the "
+ "device %s."),
+ str, dev->path);
+ goto error_free_copy;
+ }
+ if (range)
+ *range = ped_geometry_new (dev, *sector, 1);
+ ped_free (copy);
+ return !range || *range != NULL;
+
+error_free_copy:
+ ped_free (copy);
+error:
+ *sector = 0;
+ if (range)
+ *range = NULL;
+ return 0;
+}
+
+static PedSector
+clip (PedDevice* dev, PedSector sector)
+{
+ if (sector < 0)
+ return 0;
+ if (sector > dev->length - 1)
+ return dev->length - 1;
+ return sector;
+}
+
+static PedGeometry*
+geometry_from_centre_radius (PedDevice* dev, PedSector sector, PedSector radius)
+{
+ PedSector start = clip (dev, sector - radius);
+ PedSector end = clip (dev, sector + radius);
+ if (sector - end > radius || start - sector > radius)
+ return NULL;
+ return ped_geometry_new (dev, start, end - start + 1);
+}
+
+static PedUnit
+parse_unit_suffix (const char* suffix, PedUnit suggested_unit)
+{
+ if (strlen (suffix) > 1 && tolower (suffix[1]) == 'i') {
+ switch (tolower (suffix[0])) {
+ case 'k': return PED_UNIT_KIBIBYTE;
+ case 'm': return PED_UNIT_MEBIBYTE;
+ case 'g': return PED_UNIT_GIBIBYTE;
+ case 't': return PED_UNIT_TEBIBYTE;
+ }
+ } else if (strlen (suffix) > 0) {
+ switch (tolower (suffix[0])) {
+ case 's': return PED_UNIT_SECTOR;
+ case 'b': return PED_UNIT_BYTE;
+ case 'k': return PED_UNIT_KILOBYTE;
+ case 'm': return PED_UNIT_MEGABYTE;
+ case 'g': return PED_UNIT_GIGABYTE;
+ case 't': return PED_UNIT_TERABYTE;
+ case 'c': return PED_UNIT_CYLINDER;
+ case '%': return PED_UNIT_PERCENT;
+ }
+ }
+
+ if (suggested_unit == PED_UNIT_COMPACT) {
+ if (default_unit == PED_UNIT_COMPACT)
+ return PED_UNIT_MEGABYTE;
+ else
+ return default_unit;
+ }
+
+ return suggested_unit;
+}
+
+/**
+ * If \p str contains a valid description of a location on \p dev, then
+ * \p *sector is modified to describe the location and a geometry is created
+ * in \p *range describing a 2 units large area centered on \p *sector. If the
+ * \p range as described here would be partially outside the device \p dev, the
+ * geometry returned is the intersection between the former and the whole
+ * device geometry. If no units are specified, then the default unit is
+ * assumed.
+ *
+ * \throws PED_EXCEPTION_ERROR if \p str contains invalid description of a
+ * location
+ * \throws PED_EXCEPTION_ERROR if location described by \p str
+ * is outside of the device \p dev->path
+ *
+ * \return \c 1 if \p str is a valid location description, \c 0 otherwise.
+ */
+int
+ped_unit_parse_custom (const char* str, PedDevice* dev, PedUnit unit,
+ PedSector* sector, PedGeometry** range)
+{
+ char* copy;
+ char* suffix;
+ double num;
+ long long unit_size;
+ PedSector radius;
+
+ if (is_chs (str))
+ return parse_chs (str, dev, sector, range);
+
+ copy = ped_strdup (str);
+ if (!copy)
+ goto error;
+ strip_string (copy);
+
+ suffix = find_suffix (copy);
+ unit = parse_unit_suffix (suffix, unit);
+ suffix[0] = 0;
+
+ if (sscanf (copy, "%lf", &num) != 1) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Invalid number."));
+ goto error_free_copy;
+ }
+
+ unit_size = ped_unit_get_size (dev, unit);
+ radius = ped_div_round_up (unit_size, dev->sector_size) - 1;
+ if (radius < 0)
+ radius = 0;
+
+ *sector = num * unit_size / dev->sector_size;
+ /* negative numbers count from the end */
+ if (copy[0] == '-')
+ *sector += dev->length;
+ if (range) {
+ *range = geometry_from_centre_radius (dev, *sector, radius);
+ if (!*range) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("The location %s is outside of the "
+ "device %s."),
+ str, dev->path);
+ goto error_free_copy;
+ }
+ }
+ *sector = clip (dev, *sector);
+
+ ped_free (copy);
+ return 1;
+
+error_free_copy:
+ ped_free (copy);
+error:
+ *sector = 0;
+ if (range)
+ *range = NULL;
+ return 0;
+}
+
+
+/** @} */
diff --git a/parted.lsm b/parted.lsm
new file mode 100644
index 0000000..badf223
--- /dev/null
+++ b/parted.lsm
@@ -0,0 +1,17 @@
+Begin4
+Title: parted
+Version: 1.7
+Entered-date:
+Description: GNU Parted is a program for creating, destroying, resizing,
+checking and copying partitions, and the filesystems on them. This is useful for
+creating space for new operating systems, reorganising disk usage, copying data
+between hard disks, and disk imaging.
+Keywords: partition, partitioning, file system, format, hard disk, storage, disk, disk label, fdisk, boot
+Author: <clausen@gnu.org> (Andrew Clausen)
+Maintained-by: <parted-devel@lists.alioth.debian.org> (GNU Parted development team)
+Primary-site: ftp://ftp.gnu.org/gnu/parted
+1.1M parted-1.7.0.tar.bz2
+1.5M parted-1.7.0.tar.gz
+Platforms: Linux, FreeBSD, BeOS; compiles with GCC and probably other C99 compilers.
+Copying-policy: GPL
+End
diff --git a/parted.m4 b/parted.m4
new file mode 100644
index 0000000..9f1e81d
--- /dev/null
+++ b/parted.m4
@@ -0,0 +1,110 @@
+# library paths for libparted
+# written by Damien Genet <damien.genet@free.fr>
+
+dnl Usage:
+dnl PARTED_CHECK_LIBPARTED([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl where MINIMUM-VERSION must be >= 1.2.8 and != 1.3.0
+dnl
+dnl Example:
+dnl PARTED_CHECK_LIBPARTED(1.2.8, , [AC_MSG_ERROR([*** libparted >= 1.2.8 not installed - please install first ***])])
+dnl
+dnl Adds the required libraries to $PARTED_LIBS and does an
+dnl AC_SUBST(PARTED_LIBS)
+dnl
+
+
+AC_DEFUN([PARTED_CHECK_LIBPARTED],
+[
+AC_REQUIRE([AC_CANONICAL_HOST])
+
+dnl save LIBS
+saved_LIBS="$LIBS"
+
+dnl Check for headers and library
+AC_CHECK_HEADER(parted/parted.h, ,
+ [AC_MSG_ERROR([<parted/parted.h> not found; install GNU/Parted])]
+ $3)
+AC_CHECK_LIB(uuid, uuid_generate, ,
+ [AC_MSG_ERROR([libuuid not found; install e2fsprogs available at http://web.mit.edu/tytso/www/linux/e2fsprogs.html])]
+ $3)
+AC_CHECK_LIB(parted,ped_device_read, ,
+ [AC_MSG_ERROR([libparted not found; install GNU/Parted available at http://www.gnu.org/software/parted/parted.html])]
+ $3)
+
+case "$host_os" in
+ gnu*) # The Hurd requires some special system libraries
+ # with very generic names, which is why we special
+ # case these tests.
+
+ AC_CHECK_LIB(shouldbeinlibc,lcm, ,
+ [AC_MSG_ERROR([libshouldbeinlibc not found; install the Hurd development libraries.])]
+ $3)
+
+ AC_CHECK_LIB(store,store_open, ,
+ [AC_MSG_ERROR([libstore not found; install the Hurd development libraries.])]
+ $3)
+ ;;
+ *) ;;
+esac
+
+AC_MSG_CHECKING(for libparted - version >= $1)
+
+AC_TRY_LINK_FUNC(ped_get_version,,
+ AC_MSG_RESULT(failed)
+ AC_MSG_ERROR([*** libparted < 1.2.8 or == 1.3.0 can't execute test ***]))
+
+dnl Get major, minor, and micro version from arg MINIMUM-VERSION
+parted_config_major_version=`echo $1 | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+parted_config_minor_version=`echo $1 | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+parted_config_micro_version=`echo $1 | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+
+dnl Compare MINIMUM-VERSION with libparted version
+AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+#include <parted/parted.h>
+
+int main ()
+{
+ int major, minor, micro;
+ const char *version;
+
+ if ( !(version = ped_get_version ()) )
+ exit(1);
+ if (sscanf(version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+ printf("%s, bad version string\n", version);
+ exit(1);
+ }
+
+ if ((major > $parted_config_major_version) ||
+ ((major == $parted_config_major_version) && (minor > $parted_config_minor_version)) ||
+ ((major == $parted_config_major_version) && (minor == $parted_config_minor_version) && (micro >= $parted_config_micro_version))) {
+ return 0;
+ } else {
+ printf("\n*** An old version of libparted (%s) was found.\n",
+ version);
+ printf("*** You need a version of libparted equal to or newer than %d.%d.%d.\n",
+ $parted_config_major_version,
+ $parted_config_minor_version,
+ $parted_config_micro_version);
+ printf("*** You can get it at - ftp://ftp.gnu.org/gnu/parted/\n");
+ return 1;
+ }
+}
+],
+ AC_MSG_RESULT(yes),
+ AC_MSG_RESULT(no) ; $3,
+ [echo $ac_n "cross compiling; assumed OK... $ac_c"])
+
+dnl restore orignial LIBS and set @PARTED_LIBS@
+PARTED_LIBS="$LIBS"
+LIBS="$saved_LIBS"
+AC_SUBST(PARTED_LIBS)
+
+dnl Execute ACTION-IF-FOUND
+$2
+
+])
diff --git a/parted.spec.in b/parted.spec.in
new file mode 100644
index 0000000..520108c
--- /dev/null
+++ b/parted.spec.in
@@ -0,0 +1,78 @@
+%define name @PACKAGE@
+%define ver @VERSION@
+%define rel 1
+%define prefix /usr
+%define sbindir /sbin
+%define mandir /usr/share/man
+%define aclocaldir /usr/share/aclocal
+
+
+Summary : flexible partitioning tool
+Name : %{name}
+Version : %{ver}
+Release : %{rel}
+Source : ftp://ftp.gnu.org/gnu/%{name}/%{name}-%{ver}.tar.gz
+Buildroot : %{_tmppath}/%{name}-root
+Packager : Fabian Emmes <fab@orlen.de>
+Copyright : GPL
+Group : Applications/System
+Requires : e2fsprogs, readline
+BuildPrereq : e2fsprogs-devel, readline-devel
+%description
+GNU Parted is a program that allows you to create, destroy,
+resize, move and copy hard disk partitions. This is useful for
+creating space for new operating systems, reorganising disk
+usage, and copying data to new hard disks.
+
+
+%package devel
+Summary : files required to compile software that uses libparted
+Group : Development/System
+Requires : e2fsprogs
+BuildPrereq : e2fsprogs-devel, readline-devel
+%description devel
+This package includes the header files and libraries needed to
+statically link software with libparted.
+
+
+%prep
+%setup
+
+%build
+if [ -n "$LINGUAS" ]; then unset LINGUAS; fi
+%configure --prefix=%{prefix} --sbindir=%{sbindir}
+make
+
+
+%install
+rm -rf "$RPM_BUILD_ROOT"
+make DESTDIR="$RPM_BUILD_ROOT" install
+strip "${RPM_BUILD_ROOT}%{sbindir}"/parted
+
+
+%clean
+rm -rf "$RPM_BUILD_ROOT"
+
+
+%files
+%defattr(-,root,root)
+%doc AUTHORS BUGS COPYING ChangeLog NEWS README THANKS TODO doc/COPYING.DOC doc/API doc/USER doc/FAT
+%{prefix}/share/locale/*/*/*
+%{sbindir}/*
+%{mandir}/*/*
+%{prefix}/lib/*.so*
+
+
+%files devel
+%defattr(-,root,root)
+%{prefix}/include/*
+%{aclocaldir}/*
+%{prefix}/lib/*.a*
+%{prefix}/lib/*.la*
+
+%changelog
+* Mon Mar 13 2000 Fabian Emmes <fab@orlen.de>
+- changed "unset LINGUAS" line
+- reintroduced %build section ;)
+- started changelog
+
diff --git a/parted/ChangeLog b/parted/ChangeLog
new file mode 100644
index 0000000..5430001
--- /dev/null
+++ b/parted/ChangeLog
@@ -0,0 +1,120 @@
+2006-09-12 Anant Narayanan <anant@kix.in>
+ * ui.c (sig*_handler): fallback to signal() if sigaction() is not
+ available
+
+2006-09-01 David Cantrell <dcantrell@redhat.com>
+ * parted.c (do_print): wrap assignment-as-test in while statement.
+
+2006-09-01 Darren Lavender <dl1@hppine99.gbr.hp.com>
+ * ui.c (command_line_get_ex_opt): fix SIGSEGV in parted 1.6.19
+ and assertion error in 1.7.0
+
+2006-07-31 Leslie P. Polzer <polzer@gnu.org>
+ * parted.c (do_print): simplified a loop.
+
+2006-05-15 Leslie P. Polzer <polzer@gnu.org>
+ * parted.c: fixed spelling of non-root message and made it non-fatal.
+
+2006-05-13 Anant Narayanan <anant@kix.in>
+ * parted.c: Show a friendly message if parted is run as a non-root
+ user
+
+ * ../configure.ac: Check for presence of getuid()
+
+2006-04-06 Leslie P. Polzer <polzer@gnu.org>
+ * ui.c (sigsegv_handler, sigfpe_handler, sigsegv_handler):
+ abort() immediately after printing error message.
+
+ * ui.c (sigint_handler, exception_handler):
+ return PED_EXCEPTION_UNHANDLED on SIGINT.
+
+2006-04-04 Anant Narayanan <anant@kix.in>
+ * ui.c (sigint_handler, _readline): fall back to old signal API
+ for operating systems without sigaction().
+
+2006-03-21 Anant Narayanan <anant@kix.in>
+ * ui.c: Added 'default' cases for Signal type handlers.
+
+2006-03-13 Anant Narayanan <anant@kix.in>
+ * ui.c: Switched to sigaction() from signal() and catch SIGFPE
+ and SIGILL too.
+
+2006-03-13 Anant Narayanan <anant@kix.in>
+ * parted.c: Intoduced a new "toggle" command, and reverted the
+ "set" command back to its old semantics.
+
+2006-03-11 Leslie P. Polzer <polzer@gnu.org>
+ * parted.c (partition_print_flags): added some pointer juggling to
+ avoid problems with -fstrict-aliasing enabled.
+
+2006-03-09 Leslie P. Polzer <polzer@gnu.org>
+ * parted.c (do_mkpart, do_mkpartfs): catch exceptions that occur.
+
+2006-03-08 Leslie P. Polzer <polzer@gnu.org>
+ * table.h, table.c: use wide character version with ENABLE_NLS.
+ * parted.c: print wide character table with ENABLE_NLS.
+
+2006-03-05 Anant Narayanan <anant@kix.in>
+ * ui.c: Added a SIGSEGV handler, implemented signal masking and
+ slightly modified the default bug message.
+
+2006-02-27 Anant Narayanan <anant@kix.in>
+ * ui.c (command_line_get_partition): Automatically select the
+ partition if only one is present.
+
+2006-02-25 Leslie P. Polzer <polzer@gnu.org>
+ * parted.c (do_mkpart, do_mkpartfs): offer the user an alternative
+ when his constraints can't be satisfied (this was the behaviour
+ before the introduction of PedUnit in 1.6.24).
+
+ * parted.c (partition_print_flags, do_print): fixed memory leak and
+ adapted function call to new signature.
+
+ * table.c (table_add_row): row vector is allocated correctly now.
+
+2006-02-23 Leslie P. Polzer <polzer@gnu.org>
+ * parted.c: MEGABYTE_SECTORS is a function now, taking a PedDevice
+ and thereby returning the correct size for devices with block size
+ != 2^9.
+
+2006-02-22 Leslie P. Polzer <polzer@gnu.org>
+ * table.h, table.c: added.
+ * parted.c (do_print): uses the table formatter now.
+ * parted.c (partition_print_flags): changed signature; this function
+ now returns a string instead of printing to stdout.
+
+2006-02-20 Leslie P. Polzer <polzer@gnu.org>
+ * parted.c (do_mkpart): added new constraint from
+ ped_device_get_constraint
+
+2006-02-14 Anant Narayanan <anant@kix.in>
+ * parted/parted.c: The "set" command now inverts the flags state
+ automatically, instead of prompting for its state.
+
+2006-02-14 Anant Narayanan <anant@kix.in>
+ * parted/parted.c: Merged the "print-all" command into do_print
+ with [all] as an optional parameter to the "print" command.
+
+2006-02-13 Anant Narayanan <anant@kix.in>
+ * parted/parted.c: Implemented the "print-all" command and fixed
+ indentation of commands and their descriptions.
+
+2006-02-13 Anant Narayanan <anant@kix.in>
+ * parted/parted.c: Fixed 80-line breaks and copyright message.
+
+ * parted/ui.c: Modified bug message to point to website instead
+ of the mailing list.
+
+2006-02-06 Anant Narayanan <anant@kix.in>
+ * parted/parted.c: Implemented the "version" command that displays
+ copyright and version info instead of at the beginning.
+
+ * parted/ui.c: Removed initial copyright message and created a
+ welcome message instead.
+-----------------------------------------------------------------------------
+
+This file is part of GNU Parted
+Copyright (C) 1999 - 2006 Free Software Foundation Inc.
+
+This file may be modified and/or distributed without restriction. This is
+not an invitation to misrepresent the history of GNU Parted.
diff --git a/parted/Makefile.am b/parted/Makefile.am
new file mode 100644
index 0000000..aeb5cf7
--- /dev/null
+++ b/parted/Makefile.am
@@ -0,0 +1,24 @@
+sbin_PROGRAMS = parted
+
+partedincludedir = -I$(top_srcdir)/include
+
+parted_SOURCES = command.c \
+ command.h \
+ parted.c \
+ strlist.c \
+ strlist.h \
+ ui.c \
+ ui.h \
+ table.c \
+ table.h
+
+#parted_CFLAGS = -DBUILDINFO='"\"'@BUILDINFO@'\""'
+parted_CFLAGS = -DBUILDINFO=
+
+parted_LDADD = @INTLLIBS@ @LIBS@ $(top_builddir)/libparted/libparted.la \
+ @PARTED_LIBS@
+
+parted_LDFLAGS = @PARTEDLDFLAGS@
+
+INCLUDES = $(partedincludedir) @INTLINCS@
+
diff --git a/parted/command.c b/parted/command.c
new file mode 100644
index 0000000..2f78e5c
--- /dev/null
+++ b/parted/command.c
@@ -0,0 +1,140 @@
+/*
+ parted - a frontend to libparted
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#include "command.h"
+#include "ui.h"
+
+#include <parted/debug.h>
+
+#include <stdlib.h>
+#include <string.h>
+
+Command*
+command_create (const StrList* names,
+ int (*method) (PedDevice** dev),
+ const StrList* summary,
+ const StrList* help,
+ const int non_interactive)
+{
+ Command* cmd;
+
+ cmd = malloc (sizeof (Command));
+
+ if (non_interactive)
+ cmd->non_interactive = 1;
+ else
+ cmd->non_interactive = 0;
+
+ cmd->names = (StrList*) names;
+ cmd->method = method;
+ cmd->summary = (StrList*) summary;
+ cmd->help = (StrList*) help;
+
+ return cmd;
+}
+
+void
+command_destroy (Command* cmd)
+{
+ str_list_destroy (cmd->names);
+ str_list_destroy (cmd->summary);
+ str_list_destroy (cmd->help);
+ free (cmd);
+}
+
+void
+command_register (Command** list, Command* cmd)
+{
+ int i;
+
+ for (i = 0; list [i]; i++);
+
+ list [i] = cmd;
+ list [i + 1] = (Command*) NULL;
+}
+
+Command*
+command_get (Command** list, char* name)
+{
+ int i;
+ int partial_match = -1;
+ int ambiguous = 0;
+
+ if (!name)
+ return NULL;
+
+ for (i=0; list [i]; i++) {
+ switch (str_list_match_any (list [i]->names, name)) {
+ case 2:
+ return list [i];
+
+ case 1:
+ if (!ambiguous) {
+ if (partial_match == -1) {
+ partial_match = i;
+ } else {
+ partial_match = -1;
+ ambiguous = 1;
+ }
+ }
+ }
+ }
+
+ if (partial_match == -1)
+ return NULL;
+ else
+ return list [partial_match];
+}
+
+StrList*
+command_get_names (Command** list)
+{
+ Command** walk;
+ StrList* result = NULL;
+
+ for (walk = list; *walk; walk++)
+ result = str_list_join (result,
+ str_list_duplicate ((*walk)->names));
+ return result;
+}
+
+void
+command_print_summary (Command* cmd)
+{
+ printf (" ");
+ str_list_print_wrap (cmd->summary, screen_width(), 2, 8);
+ printf ("\n");
+}
+
+void
+command_print_help (Command* cmd)
+{
+ command_print_summary (cmd);
+ if (cmd->help) {
+ printf ("\n\t");
+ str_list_print_wrap (cmd->help, screen_width(), 8, 8);
+ }
+}
+
+int
+command_run (Command* cmd, PedDevice** dev)
+{
+ return cmd->method (dev);
+}
+
diff --git a/parted/command.h b/parted/command.h
new file mode 100644
index 0000000..b636af7
--- /dev/null
+++ b/parted/command.h
@@ -0,0 +1,49 @@
+/*
+ parted - a frontend to libparted
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef COMMAND_H_INCLUDED
+#define COMMAND_H_INCLUDED
+
+#include <parted/parted.h>
+#include "strlist.h"
+
+typedef struct {
+ StrList* names;
+ int (*method) (PedDevice** dev);
+ StrList* summary;
+ StrList* help;
+ int non_interactive:1;
+} Command;
+
+extern Command* command_create (const StrList* names,
+ int (*method) (PedDevice** dev),
+ const StrList* summary,
+ const StrList* help,
+ int non_interactive);
+extern void command_destroy (Command* cmd);
+void command_register (Command** list, Command* cmd);
+
+extern Command* command_get (Command** list, char* name);
+extern StrList* command_get_names (Command** list);
+extern void command_print_summary (Command* cmd);
+extern void command_print_help (Command* cmd);
+extern int command_run (Command* cmd, PedDevice** dev);
+
+#endif /* COMMAND_H_INCLUDED */
+
diff --git a/parted/parted.c b/parted/parted.c
new file mode 100644
index 0000000..957de14
--- /dev/null
+++ b/parted/parted.c
@@ -0,0 +1,2259 @@
+/*
+ parted - a frontend to libparted
+ Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005, 2006
+ Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#include "../config.h"
+#include "command.h"
+#include "ui.h"
+#include "table.h"
+
+#define N_(String) String
+#if ENABLE_NLS
+# include <libintl.h>
+# include <locale.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+#include <parted/parted.h>
+#include <parted/debug.h>
+
+#include <ctype.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#ifdef ENABLE_MTRACE
+#include <mcheck.h>
+#endif
+
+#ifdef HAVE_GETOPT_H
+#include <getopt.h>
+
+/* minimum amount of free space to leave, or maximum amount to gobble up */
+#define MIN_FREESPACE (1000 * 2) /* 1000k */
+
+static int MEGABYTE_SECTORS (PedDevice* dev)
+{
+ return PED_MEGABYTE_SIZE / dev->sector_size;
+}
+
+
+typedef struct {
+ time_t last_update;
+ time_t predicted_time_left;
+} TimerContext;
+
+static struct option options[] = {
+ /* name, has-arg, string-return-val, char-return-val */
+ {"help", 0, NULL, 'h'},
+ {"interactive", 0, NULL, 'i'},
+ {"script", 0, NULL, 's'},
+ {"version", 0, NULL, 'v'},
+ {NULL, 0, NULL, 0}
+};
+#endif
+
+static char* options_help [][2] = {
+ {"help", N_("displays this help message")},
+ {"interactive", N_("where necessary, prompts for user intervention")},
+ {"script", N_("never prompts for user intervention")},
+ {"version", N_("displays the version")},
+ {NULL, NULL}
+};
+
+int opt_script_mode;
+int is_toggle_mode = 0;
+
+static char* number_msg = N_(
+"NUMBER is the partition number used by Linux. On MS-DOS disk labels, the "
+"primary partitions number from 1 to 4, logical partitions from 5 onwards.\n");
+
+static char* label_type_msg_start = N_("LABEL-TYPE is one of: ");
+static char* flag_msg_start = N_("FLAG is one of: ");
+static char* unit_msg_start = N_("UNIT is one of: ");
+static char* part_type_msg = N_("PART-TYPE is one of: primary, logical, "
+ "extended\n");
+static char* fs_type_msg_start = N_("FS-TYPE is one of: ");
+static char* start_end_msg = N_("START and END are disk locations, such as "
+ "4GB or 10%. Negative values count from the end of the disk. "
+ "For example, -1s specifies exactly the last sector.\n");
+static char* state_msg = N_("STATE is one of: on, off\n");
+static char* device_msg = N_("DEVICE is usually /dev/hda or /dev/sda\n");
+static char* name_msg = N_("NAME is any word you want\n");
+static char* resize_msg_start = N_("The partition must have one of the "
+ "following FS-TYPEs: ");
+
+static char* version_msg = N_("GNU Parted Version information:\n");
+static char* copyright_msg = N_(
+"Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n"
+"This program is free software, covered by the GNU General Public License.\n"
+"\n"
+"This program is distributed in the hope that it will be useful, "
+"but WITHOUT ANY WARRANTY; without even the implied warranty of "
+"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the "
+"GNU General Public License for more details.\n\n");
+
+static char* label_type_msg;
+static char* flag_msg;
+static char* unit_msg;
+
+static char* mkfs_fs_type_msg;
+static char* mkpart_fs_type_msg;
+static char* resize_fs_type_msg;
+
+static Command* commands [256] = {NULL};
+static PedTimer* timer;
+static TimerContext timer_context;
+
+static void _done (PedDevice* dev);
+
+static void
+_timer_handler (PedTimer* timer, void* context)
+{
+ TimerContext* tcontext = (TimerContext*) context;
+ int draw_this_time;
+
+ if (opt_script_mode || !isatty(fileno(stdout)))
+ return;
+
+ if (tcontext->last_update != timer->now && timer->now > timer->start) {
+ tcontext->predicted_time_left
+ = timer->predicted_end - timer->now;
+ tcontext->last_update = timer->now;
+ draw_this_time = 1;
+ } else {
+ draw_this_time = 0;
+ }
+
+ if (draw_this_time) {
+ wipe_line ();
+
+ if (timer->state_name)
+ printf ("%s... ", timer->state_name);
+ printf (_("%0.f%%\t(time left %.2d:%.2d)"),
+ 100.0 * timer->frac,
+ tcontext->predicted_time_left / 60,
+ tcontext->predicted_time_left % 60);
+
+ fflush (stdout);
+ }
+}
+
+static int
+_partition_warn_busy (PedPartition* part)
+{
+ char* path = ped_partition_get_path (part);
+
+ if (ped_partition_is_busy (part)) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Partition %s is being used. You must unmount it "
+ "before you modify it with Parted."),
+ path);
+ ped_free (path);
+ return 0;
+ }
+ ped_free (path);
+ return 1;
+}
+
+static int
+_disk_warn_busy (PedDisk* disk)
+{
+ if (ped_device_is_busy (disk->dev)) {
+ if (ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("Partition(s) on %s are being used."),
+ disk->dev->path)
+ != PED_EXCEPTION_IGNORE)
+ return 0;
+ }
+ return 1;
+}
+
+/* This function changes "sector" to "new_sector" if the new value lies
+ * within the required range.
+ */
+static int
+snap (PedSector* sector, PedSector new_sector, PedGeometry* range)
+{
+ PED_ASSERT (ped_geometry_test_sector_inside (range, *sector), return 0);
+ if (!ped_geometry_test_sector_inside (range, new_sector))
+ return 0;
+ *sector = new_sector;
+ return 1;
+}
+
+typedef enum {
+ MOVE_NO = 0,
+ MOVE_STILL = 1,
+ MOVE_UP = 2,
+ MOVE_DOWN = 4
+} EMoves;
+
+enum { /* Don't change these values */
+ SECT_START = 0,
+ SECT_END = -1
+};
+
+/* Find the prefered way to adjust the sector s inside range.
+ * If a move isn't allowed or is out of range it can't be selected.
+ * what contains SECT_START if the sector to adjust is a start sector
+ * or SECT_END if it's an end one.
+ * The prefered move is to the nearest allowed boundary of the part
+ * partition (if at equal distance: to start if SECT_START or to end
+ * if SECT_END).
+ * The distance is returned in dist.
+ */
+static EMoves
+prefer_snap (PedSector s, int what, PedGeometry* range, EMoves* allow,
+ PedPartition* part, PedSector* dist)
+{
+ PedSector up_dist = -1, down_dist = -1;
+ PedSector new_sect;
+ EMoves move;
+
+ PED_ASSERT (what == SECT_START || what == SECT_END, return 0);
+
+ if (!(*allow & (MOVE_UP | MOVE_DOWN))) {
+ *dist = 0;
+ return MOVE_STILL;
+ }
+
+ if (*allow & MOVE_UP) {
+ new_sect = part->geom.end + 1 + what;
+ if (ped_geometry_test_sector_inside (range, new_sect))
+ up_dist = new_sect - s;
+ else
+ *allow &= ~MOVE_UP;
+ }
+
+ if (*allow & MOVE_DOWN) {
+ new_sect = part->geom.start + what;
+ if (ped_geometry_test_sector_inside (range, new_sect))
+ down_dist = s - new_sect;
+ else
+ *allow &= ~MOVE_DOWN;
+ }
+
+ move = MOVE_STILL;
+ if ((*allow & MOVE_UP) && (*allow & MOVE_DOWN)) {
+ if (down_dist < up_dist || (down_dist == up_dist
+ && what == SECT_START) )
+ move = MOVE_DOWN;
+ else if (up_dist < down_dist || (down_dist == up_dist
+ && what == SECT_END) )
+ move = MOVE_UP;
+ else
+ PED_ASSERT (0, return 0);
+ } else if (*allow & MOVE_UP)
+ move = MOVE_UP;
+ else if (*allow & MOVE_DOWN)
+ move = MOVE_DOWN;
+
+ *dist = ( move == MOVE_DOWN ? down_dist :
+ ( move == MOVE_UP ? up_dist :
+ 0 ) );
+ return move;
+}
+
+/* Snaps a partition to nearby partition boundaries. This is useful for
+ * gobbling up small amounts of free space, and also for reinterpreting small
+ * changes to a partition as non-changes (eg: perhaps the user only wanted to
+ * resize the end of a partition).
+ * Note that this isn't the end of the story... this function is
+ * always called before the constraint solver kicks in. So you don't need to
+ * worry too much about inadvertantly creating overlapping partitions, etc.
+ */
+static void
+snap_to_boundaries (PedGeometry* new_geom, PedGeometry* old_geom,
+ PedDisk* disk,
+ PedGeometry* start_range, PedGeometry* end_range)
+{
+ PedPartition* start_part;
+ PedPartition* end_part;
+ PedSector start = new_geom->start;
+ PedSector end = new_geom->end;
+ PedSector start_dist = -1, end_dist = -1;
+ EMoves start_allow, end_allow, start_want, end_want;
+ int adjacent;
+
+ start_want = end_want = MOVE_NO;
+ start_allow = end_allow = MOVE_STILL | MOVE_UP | MOVE_DOWN;
+
+ start_part = ped_disk_get_partition_by_sector (disk, start);
+ end_part = ped_disk_get_partition_by_sector (disk, end);
+ adjacent = (start_part->geom.end + 1 == end_part->geom.start);
+
+ /* If we can snap to old_geom, then we will... */
+ /* and this will enforce the snapped positions */
+ if (old_geom) {
+ if (snap (&start, old_geom->start, start_range))
+ start_allow = MOVE_STILL;
+ if (snap (&end, old_geom->end, end_range))
+ end_allow = MOVE_STILL;
+ }
+
+ /* If start and end are on the same partition, we */
+ /* don't allow them to cross. */
+ if (start_part == end_part) {
+ start_allow &= ~MOVE_UP;
+ end_allow &= ~MOVE_DOWN;
+ }
+
+ /* Let's find our way */
+ start_want = prefer_snap (start, SECT_START, start_range, &start_allow,
+ start_part, &start_dist );
+ end_want = prefer_snap (end, SECT_END, end_range, &end_allow,
+ end_part, &end_dist );
+
+ PED_ASSERT (start_dist >= 0 && end_dist >= 0, return);
+
+ /* If start and end are on adjacent partitions, */
+ /* and if they would prefer crossing, then refrain */
+ /* the farthest to do so. */
+ if (adjacent && start_want == MOVE_UP && end_want == MOVE_DOWN) {
+ if (end_dist < start_dist) {
+ start_allow &= ~MOVE_UP;
+ start_want = prefer_snap (start, SECT_START,
+ start_range, &start_allow,
+ start_part, &start_dist );
+ PED_ASSERT (start_dist >= 0, return);
+ } else {
+ end_allow &= ~MOVE_DOWN;
+ end_want = prefer_snap (end, SECT_END,
+ end_range, &end_allow,
+ end_part, &end_dist );
+ PED_ASSERT (end_dist >= 0, return);
+ }
+ }
+
+ /* New positions */
+ start = ( start_want == MOVE_DOWN ? start_part->geom.start :
+ ( start_want == MOVE_UP ? start_part->geom.end + 1 :
+ start ) );
+ end = ( end_want == MOVE_DOWN ? end_part->geom.start - 1 :
+ ( end_want == MOVE_UP ? end_part->geom.end :
+ end ) );
+ PED_ASSERT (ped_geometry_test_sector_inside(start_range,start), return);
+ PED_ASSERT (ped_geometry_test_sector_inside (end_range, end), return);
+ PED_ASSERT (start <= end,
+ PED_DEBUG (0, "start = %d, end = %d\n", start, end));
+ ped_geometry_set (new_geom, start, end - start + 1);
+}
+
+/* This functions constructs a constraint from the following information:
+ * start, is_start_exact, end, is_end_exact.
+ *
+ * If is_start_exact == 1, then the constraint requires start be as given in
+ * "start". Otherwise, the constraint does not set any requirements on the
+ * start.
+ */
+static PedConstraint*
+constraint_from_start_end (PedDevice* dev, PedGeometry* range_start,
+ PedGeometry* range_end)
+{
+ return ped_constraint_new (ped_alignment_any, ped_alignment_any,
+ range_start, range_end, 1, dev->length);
+}
+
+static PedConstraint*
+constraint_intersect_and_destroy (PedConstraint* a, PedConstraint* b)
+{
+ PedConstraint* result = ped_constraint_intersect (a, b);
+ ped_constraint_destroy (a);
+ ped_constraint_destroy (b);
+ return result;
+}
+
+void
+help_on (char* topic)
+{
+ Command* cmd;
+
+ cmd = command_get (commands, topic);
+ if (!cmd) return;
+
+ command_print_help (cmd);
+}
+
+static int
+do_check (PedDevice** dev)
+{
+ PedDisk* disk;
+ PedFileSystem* fs;
+ PedPartition* part = NULL;
+ int part_num;
+
+ disk = ped_disk_new (*dev);
+ if (!disk)
+ goto error;
+
+ if (!command_line_get_partition (_("Partition number?"), disk, &part))
+ goto error_destroy_disk;
+ if (!_partition_warn_busy (part))
+ goto error_destroy_disk;
+
+ if (!ped_disk_check (disk))
+ goto error_destroy_disk;
+
+ fs = ped_file_system_open (&part->geom);
+ if (!fs)
+ goto error_destroy_disk;
+ if (!ped_file_system_check (fs, timer))
+ goto error_close_fs;
+ ped_file_system_close (fs);
+ ped_disk_destroy (disk);
+ return 1;
+
+error_close_fs:
+ ped_file_system_close (fs);
+error_destroy_disk:
+ ped_disk_destroy (disk);
+error:
+ return 0;
+}
+
+static int
+do_cp (PedDevice** dev)
+{
+ PedDisk* src_disk;
+ PedDisk* dst_disk;
+ PedDevice* src_device;
+ PedPartition* src = NULL;
+ PedPartition* dst = NULL;
+ PedFileSystem* src_fs;
+ PedFileSystem* dst_fs;
+ PedFileSystemType* dst_fs_type;
+
+ dst_disk = ped_disk_new (*dev);
+ if (!dst_disk)
+ goto error;
+
+ src_disk = dst_disk;
+ if (!command_line_is_integer ()) {
+ if (!command_line_get_disk (_("Source device?"), &src_disk))
+ goto error_destroy_disk;
+ }
+
+ if (!command_line_get_partition (_("Source partition number?"),
+ src_disk, &src))
+ goto error_destroy_disk;
+ if (src->type == PED_PARTITION_EXTENDED) {
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("Can't copy an extended partition."));
+ goto error_destroy_disk;
+ }
+ if (!_partition_warn_busy (src))
+ goto error_destroy_disk;
+
+ if (!command_line_get_partition (_("Destination partition number?"),
+ dst_disk, &dst))
+ goto error_destroy_disk;
+ if (!_partition_warn_busy (dst))
+ goto error_destroy_disk;
+
+/* do the copy */
+ src_fs = ped_file_system_open (&src->geom);
+ if (!src_fs)
+ goto error_destroy_disk;
+ dst_fs = ped_file_system_copy (src_fs, &dst->geom, timer);
+ if (!dst_fs)
+ goto error_close_src_fs;
+ dst_fs_type = dst_fs->type; /* may be different to src_fs->type */
+ ped_file_system_close (src_fs);
+ ped_file_system_close (dst_fs);
+
+/* update the partition table, close disks */
+ if (!ped_partition_set_system (dst, dst_fs_type))
+ goto error_destroy_disk;
+ if (!ped_disk_commit (dst_disk))
+ goto error_destroy_disk;
+ if (src_disk != dst_disk)
+ ped_disk_destroy (src_disk);
+ ped_disk_destroy (dst_disk);
+ return 1;
+
+error_close_src_fs:
+ ped_file_system_close (src_fs);
+error_destroy_disk:
+ if (src_disk && src_disk != dst_disk)
+ ped_disk_destroy (src_disk);
+ ped_disk_destroy (dst_disk);
+error:
+ return 0;
+}
+
+void
+print_commands_help ()
+{
+ int i;
+
+ for (i=0; commands [i]; i++)
+ command_print_summary (commands [i]);
+}
+
+void
+print_options_help ()
+{
+ int i;
+
+ for (i=0; options_help [i][0]; i++) {
+ printf (" -%c, --%-23.23s %s\n",
+ options_help [i][0][0],
+ options_help [i][0],
+ _(options_help [i][1]));
+ }
+}
+
+int
+do_help (PedDevice** dev)
+{
+ if (command_line_get_word_count ()) {
+ char* word = command_line_pop_word ();
+ if (word) {
+ help_on (word);
+ free (word);
+ }
+ } else {
+ print_commands_help();
+ }
+ return 1;
+}
+
+static int
+do_mklabel (PedDevice** dev)
+{
+ PedDisk* disk;
+ const PedDiskType* type = ped_disk_probe (*dev);
+
+ ped_exception_fetch_all ();
+ disk = ped_disk_new (*dev);
+ if (!disk) ped_exception_catch ();
+ ped_exception_leave_all ();
+
+ if (disk) {
+ if (!_disk_warn_busy (disk)) {
+ ped_disk_destroy (disk);
+ goto error;
+ }
+ ped_disk_destroy (disk);
+ }
+
+ if (!command_line_get_disk_type (_("New disk label type?"), &type))
+ goto error;
+
+ disk = ped_disk_new_fresh (*dev, type);
+ if (!disk)
+ goto error;
+
+ if (!ped_disk_commit (disk))
+ goto error_destroy_disk;
+ ped_disk_destroy (disk);
+ return 1;
+
+error_destroy_disk:
+ ped_disk_destroy (disk);
+error:
+ return 0;
+}
+
+static int
+do_mkfs (PedDevice** dev)
+{
+ PedDisk* disk;
+ PedPartition* part = NULL;
+ const PedFileSystemType* type = ped_file_system_type_get ("ext2");
+ PedFileSystem* fs;
+
+ disk = ped_disk_new (*dev);
+ if (!disk)
+ goto error;
+
+ if (!command_line_get_partition (_("Partition number?"), disk, &part))
+ goto error_destroy_disk;
+ if (!_partition_warn_busy (part))
+ goto error_destroy_disk;
+ if (!command_line_get_fs_type (_("File system?"), &type))
+ goto error_destroy_disk;
+
+ fs = ped_file_system_create (&part->geom, type, timer);
+ if (!fs)
+ goto error_destroy_disk;
+ ped_file_system_close (fs);
+
+ if (!ped_partition_set_system (part, type))
+ goto error_destroy_disk;
+ if (ped_partition_is_flag_available (part, PED_PARTITION_LBA))
+ ped_partition_set_flag (part, PED_PARTITION_LBA, 1);
+ if (!ped_disk_commit (disk))
+ goto error_destroy_disk;
+ ped_disk_destroy (disk);
+ return 1;
+
+error_destroy_disk:
+ ped_disk_destroy (disk);
+error:
+ return 0;
+}
+
+static int
+do_mkpart (PedDevice** dev)
+{
+ PedDisk* disk;
+ PedPartition* part;
+ PedPartitionType part_type;
+ const PedFileSystemType* fs_type = ped_file_system_type_get ("ext2");
+ PedSector start = 0, end = 0;
+ PedGeometry *range_start = NULL, *range_end = NULL;
+ PedConstraint* user_constraint;
+ PedConstraint* dev_constraint;
+ PedConstraint* final_constraint;
+ char* peek_word;
+ char* part_name = NULL;
+ char *start_usr = NULL, *end_usr = NULL;
+ char *start_sol = NULL, *end_sol = NULL;
+
+ disk = ped_disk_new (*dev);
+ if (!disk)
+ goto error;
+
+ if (!ped_disk_type_check_feature (disk->type, PED_DISK_TYPE_EXTENDED)) {
+ part_type = PED_PARTITION_NORMAL;
+ } else {
+ if (!command_line_get_part_type (_("Partition type?"),
+ disk, &part_type))
+ goto error_destroy_disk;
+ }
+
+ if (ped_disk_type_check_feature (disk->type,
+ PED_DISK_TYPE_PARTITION_NAME))
+ part_name = command_line_get_word (_("Partition name?"),
+ "", NULL, 1);
+
+ peek_word = command_line_peek_word ();
+ if (part_type == PED_PARTITION_EXTENDED
+ || (peek_word && isdigit (peek_word[0]))) {
+ fs_type = NULL;
+ } else {
+ if (!command_line_get_fs_type (_("File system type?"),
+ &fs_type))
+ goto error_destroy_disk;
+ }
+ if (peek_word)
+ ped_free (peek_word);
+
+ if (!command_line_get_sector (_("Start?"), *dev, &start, &range_start))
+ goto error_destroy_disk;
+ if (!command_line_get_sector (_("End?"), *dev, &end, &range_end))
+ goto error_destroy_disk;
+
+ /* processing starts here */
+ part = ped_partition_new (disk, part_type, fs_type, start, end);
+ if (!part)
+ goto error_destroy_disk;
+
+ snap_to_boundaries (&part->geom, NULL, disk, range_start, range_end);
+
+ /* create constraints */
+ user_constraint = constraint_from_start_end (*dev, range_start,
+ range_end);
+ PED_ASSERT (user_constraint != NULL, return 0);
+
+ dev_constraint = ped_device_get_constraint (*dev);
+ PED_ASSERT (dev_constraint != NULL, return 0);
+
+ final_constraint = ped_constraint_intersect (user_constraint,
+ dev_constraint);
+ if (!final_constraint)
+ goto error_destroy_simple_constraints;
+
+ /* subject to partition constraint */
+ ped_exception_fetch_all();
+ if (!ped_disk_add_partition (disk, part, final_constraint)) {
+ ped_exception_leave_all();
+
+ if (ped_disk_add_partition (disk, part,
+ ped_constraint_any (*dev))) {
+ start_usr = ped_unit_format (*dev, start);
+ end_usr = ped_unit_format (*dev, end);
+ start_sol = ped_unit_format (*dev, part->geom.start);
+ end_sol = ped_unit_format (*dev, part->geom.end);
+
+ switch (ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_YES_NO,
+ _("You requested a partition from %s to %s.\n"
+ "The closest location we can manage is "
+ "%s to %s. "
+ "Is this still acceptable to you?"),
+ start_usr, end_usr, start_sol, end_sol))
+ {
+ case PED_EXCEPTION_YES:
+ /* all is well in this state */
+ break;
+ case PED_EXCEPTION_NO:
+ case PED_EXCEPTION_UNHANDLED:
+ default:
+ /* undo partition addition */
+ goto error_remove_part;
+ }
+ } else {
+ goto error_remove_part;
+ }
+ }
+ ped_exception_catch();
+
+ /* set minor attributes */
+ if (part_name)
+ PED_ASSERT (ped_partition_set_name (part, part_name), return 0);
+ if (!ped_partition_set_system (part, fs_type))
+ goto error_destroy_disk;
+ if (ped_partition_is_flag_available (part, PED_PARTITION_LBA))
+ ped_partition_set_flag (part, PED_PARTITION_LBA, 1);
+
+ if (!ped_disk_commit (disk))
+ goto error_destroy_disk;
+
+ /* clean up */
+ ped_constraint_destroy (final_constraint);
+ ped_constraint_destroy (user_constraint);
+ ped_constraint_destroy (dev_constraint);
+
+ ped_disk_destroy (disk);
+
+ if (range_start != NULL)
+ ped_geometry_destroy (range_start);
+ if (range_end != NULL)
+ ped_geometry_destroy (range_end);
+
+ if (start_usr != NULL)
+ ped_free (start_usr);
+ if (end_usr != NULL)
+ ped_free (end_usr);
+ if (start_sol != NULL)
+ ped_free (start_sol);
+ if (end_sol != NULL)
+ ped_free (end_sol);
+
+ return 1;
+
+error_remove_part:
+ ped_disk_remove_partition (disk, part);
+error_destroy_all_constraints:
+ ped_constraint_destroy (final_constraint);
+error_destroy_simple_constraints:
+ ped_constraint_destroy (user_constraint);
+ ped_constraint_destroy (dev_constraint);
+error_destroy_part:
+ ped_partition_destroy (part);
+error_destroy_disk:
+ ped_disk_destroy (disk);
+error:
+ if (range_start != NULL)
+ ped_geometry_destroy (range_start);
+ if (range_end != NULL)
+ ped_geometry_destroy (range_end);
+
+ if (start_usr != NULL)
+ ped_free (start_usr);
+ if (end_usr != NULL)
+ ped_free (end_usr);
+ if (start_sol != NULL)
+ ped_free (start_sol);
+ if (end_sol != NULL)
+ ped_free (end_sol);
+
+ return 0;
+}
+
+static int
+do_mkpartfs (PedDevice** dev)
+{
+ PedDisk* disk;
+ PedPartition* part;
+ PedPartitionType part_type;
+ const PedFileSystemType* fs_type = ped_file_system_type_get ("ext2");
+ PedSector start = 0, end = 0;
+ PedGeometry *range_start = NULL, *range_end = NULL;
+ PedConstraint* user_constraint;
+ PedConstraint* dev_constraint;
+ PedConstraint* final_constraint;
+ PedFileSystem* fs;
+ char* part_name = NULL;
+ char *start_usr = NULL, *end_usr = NULL;
+ char *start_sol = NULL, *end_sol = NULL;
+
+ disk = ped_disk_new (*dev);
+ if (!disk)
+ goto error;
+
+ if (!ped_disk_type_check_feature (disk->type, PED_DISK_TYPE_EXTENDED)) {
+ part_type = PED_PARTITION_NORMAL;
+ } else {
+ if (!command_line_get_part_type (_("Partition type?"),
+ disk, &part_type))
+ goto error_destroy_disk;
+ }
+
+ if (ped_disk_type_check_feature (disk->type,
+ PED_DISK_TYPE_PARTITION_NAME))
+ part_name = command_line_get_word (_("Partition name?"),
+ "", NULL, 1);
+
+ if (part_type == PED_PARTITION_EXTENDED) {
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("An extended partition cannot hold a file system. "
+ "Did you want mkpart?"));
+ goto error_destroy_disk;
+ }
+
+ if (!command_line_get_fs_type (_("File system type?"), &fs_type))
+ goto error_destroy_disk;
+ if (!command_line_get_sector (_("Start?"), *dev, &start,
+ &range_start))
+ goto error_destroy_disk;
+ if (!command_line_get_sector (_("End?"), *dev, &end, &range_end))
+ goto error_destroy_disk;
+
+ /* attempt to create the partition now */
+ part = ped_partition_new (disk, part_type, fs_type, start, end);
+ if (!part)
+ goto error_destroy_disk;
+
+ snap_to_boundaries (&part->geom, NULL, disk, range_start, range_end);
+
+ /* create constraints */
+ user_constraint = constraint_from_start_end (*dev, range_start,
+ range_end);
+ PED_ASSERT (user_constraint != NULL, return 0);
+
+ dev_constraint = ped_device_get_constraint (*dev);
+ PED_ASSERT (dev_constraint != NULL, return 0);
+
+ final_constraint = ped_constraint_intersect (user_constraint,
+ dev_constraint);
+ if (!final_constraint)
+ goto error_destroy_simple_constraints;
+
+ /* subject to partition constraint */
+ ped_exception_fetch_all();
+ if (!ped_disk_add_partition (disk, part, final_constraint)) {
+ ped_exception_leave_all();
+
+ if (ped_disk_add_partition (disk, part,
+ ped_constraint_any (*dev))) {
+ start_usr = ped_unit_format (*dev, start);
+ end_usr = ped_unit_format (*dev, end);
+ start_sol = ped_unit_format (*dev, part->geom.start);
+ end_sol = ped_unit_format (*dev, part->geom.end);
+
+ switch (ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_YES_NO,
+ _("You requested a partition from %s to %s.\n"
+ "The closest location we can manage is "
+ "%s to %s. "
+ "Is this still acceptable to you?"),
+ start_usr, end_usr, start_sol, end_sol)) {
+ case PED_EXCEPTION_YES:
+ /* all is well in this state */
+ break;
+ case PED_EXCEPTION_NO:
+ case PED_EXCEPTION_UNHANDLED:
+ default:
+ /* undo partition addition */
+ goto error_remove_part;
+ }
+ } else {
+ goto error_remove_part;
+ }
+ }
+ ped_exception_catch();
+
+ /* set LBA flag automatically if available */
+ if (ped_partition_is_flag_available (part, PED_PARTITION_LBA))
+ ped_partition_set_flag (part, PED_PARTITION_LBA, 1);
+
+ /* fs creation */
+ fs = ped_file_system_create (&part->geom, fs_type, timer);
+ if (!fs)
+ goto error_destroy_disk;
+ ped_file_system_close (fs);
+
+ if (!ped_partition_set_system (part, fs_type))
+ goto error_destroy_disk;
+
+ if (!ped_disk_commit (disk))
+ goto error_destroy_disk;
+
+ /* clean up */
+ ped_constraint_destroy (final_constraint);
+ ped_constraint_destroy (user_constraint);
+ ped_constraint_destroy (dev_constraint);
+
+ ped_disk_destroy (disk);
+
+ if (range_start != NULL)
+ ped_geometry_destroy (range_start);
+ if (range_end != NULL)
+ ped_geometry_destroy (range_end);
+
+ if (start_usr != NULL)
+ ped_free (start_usr);
+ if (end_usr != NULL)
+ ped_free (end_usr);
+ if (start_sol != NULL)
+ ped_free (start_sol);
+ if (end_sol != NULL)
+ ped_free (end_sol);
+
+ return 1;
+
+error_remove_part:
+ ped_disk_remove_partition (disk, part);
+error_destroy_all_constraints:
+ ped_constraint_destroy (final_constraint);
+error_destroy_simple_constraints:
+ ped_constraint_destroy (user_constraint);
+ ped_constraint_destroy (dev_constraint);
+error_destroy_part:
+ ped_partition_destroy (part);
+error_destroy_disk:
+ ped_disk_destroy (disk);
+error:
+ if (range_start != NULL)
+ ped_geometry_destroy (range_start);
+ if (range_end != NULL)
+ ped_geometry_destroy (range_end);
+
+ if (start_usr != NULL)
+ ped_free (start_usr);
+ if (end_usr != NULL)
+ ped_free (end_usr);
+ if (start_sol != NULL)
+ ped_free (start_sol);
+ if (end_sol != NULL)
+ ped_free (end_sol);
+
+ return 0;
+}
+
+static int
+do_move (PedDevice** dev)
+{
+ PedDisk* disk;
+ PedPartition* part = NULL;
+ PedFileSystem* fs;
+ PedFileSystem* fs_copy;
+ PedConstraint* constraint;
+ PedSector start = 0, end = 0;
+ PedGeometry *range_start = NULL, *range_end = NULL;
+ PedGeometry old_geom, new_geom;
+
+ disk = ped_disk_new (*dev);
+ if (!disk)
+ goto error;
+
+ if (!command_line_get_partition (_("Partition number?"), disk, &part))
+ goto error_destroy_disk;
+ if (!_partition_warn_busy (part))
+ goto error_destroy_disk;
+ if (part->type == PED_PARTITION_EXTENDED) {
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("Can't move an extended partition."));
+ goto error_destroy_disk;
+ }
+ old_geom = part->geom;
+ fs = ped_file_system_open (&old_geom);
+ if (!fs)
+ goto error_destroy_disk;
+
+ /* get new target */
+ if (!command_line_get_sector (_("Start?"), *dev, &start, &range_start))
+ goto error_close_fs;
+ end = start + old_geom.length - 1;
+ if (!command_line_get_sector (_("End?"), *dev, &end, &range_end))
+ goto error_close_fs;
+
+ /* set / test on "disk" */
+ if (!ped_geometry_init (&new_geom, *dev, start, end - start + 1))
+ goto error_close_fs;
+ snap_to_boundaries (&new_geom, NULL, disk, range_start, range_end);
+
+ constraint = constraint_intersect_and_destroy (
+ ped_file_system_get_copy_constraint (fs, *dev),
+ constraint_from_start_end(*dev,range_start,range_end));
+ if (!ped_disk_set_partition_geom (disk, part, constraint,
+ new_geom.start, new_geom.end))
+ goto error_destroy_constraint;
+ ped_constraint_destroy (constraint);
+ if (ped_geometry_test_overlap (&old_geom, &part->geom)) {
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("Can't move a partition onto itself. Try using "
+ "resize, perhaps?"));
+ goto error_close_fs;
+ }
+
+ /* do the move */
+ fs_copy = ped_file_system_copy (fs, &part->geom, timer);
+ if (!fs_copy)
+ goto error_close_fs;
+ ped_file_system_close (fs_copy);
+ ped_file_system_close (fs);
+ if (!ped_disk_commit (disk))
+ goto error_destroy_disk;
+ ped_disk_destroy (disk);
+ if (range_start != NULL)
+ ped_geometry_destroy (range_start);
+ if (range_end != NULL)
+ ped_geometry_destroy (range_end);
+ return 1;
+
+error_destroy_constraint:
+ ped_constraint_destroy (constraint);
+error_close_fs:
+ ped_file_system_close (fs);
+error_destroy_disk:
+ ped_disk_destroy (disk);
+error:
+ if (range_start != NULL)
+ ped_geometry_destroy (range_start);
+ if (range_end != NULL)
+ ped_geometry_destroy (range_end);
+ return 0;
+}
+
+static int
+do_name (PedDevice** dev)
+{
+ PedDisk* disk;
+ PedPartition* part = NULL;
+ char* name;
+
+ disk = ped_disk_new (*dev);
+ if (!disk)
+ goto error;
+
+ if (!command_line_get_partition (_("Partition number?"), disk, &part))
+ goto error_destroy_disk;
+
+ name = command_line_get_word (_("Partition name?"),
+ ped_partition_get_name (part), NULL, 0);
+ if (!name)
+ goto error_destroy_disk;
+ if (!ped_partition_set_name (part, name))
+ goto error_free_name;
+ free (name);
+
+ if (!ped_disk_commit (disk))
+ goto error_destroy_disk;
+ ped_disk_destroy (disk);
+ return 1;
+
+error_free_name:
+ free (name);
+error_destroy_disk:
+ ped_disk_destroy (disk);
+error:
+ return 0;
+}
+
+static char*
+partition_print_flags (PedPartition* part)
+{
+ PedPartitionFlag flag;
+ int first_flag;
+ const char* name;
+ char* res = ped_malloc(1);
+ void* _res = res;
+
+ *res = '\0';
+
+ first_flag = 1;
+ for (flag = ped_partition_flag_next (0); flag;
+ flag = ped_partition_flag_next (flag)) {
+ if (ped_partition_get_flag (part, flag)) {
+ if (first_flag)
+ first_flag = 0;
+ else {
+ _res = res;
+ ped_realloc (&_res, strlen (res)
+ + 1 + 2);
+ res = _res;
+ strncat (res, ", ", 2);
+ }
+
+ name = _(ped_partition_flag_get_name (flag));
+ _res = res;
+ ped_realloc (&_res, strlen (res) + 1
+ + strlen (name));
+ res = _res;
+ strncat (res, name, 21);
+ }
+ }
+
+ return res;
+}
+
+/* Prints a sector out, first in compact form, and then with a percentage.
+ * Eg: 32Gb (40%)
+ */
+static void
+print_sector_compact_and_percent (PedSector sector, PedDevice* dev)
+{
+ char* compact;
+ char* percent;
+
+ if (ped_unit_get_default() == PED_UNIT_PERCENT)
+ compact = ped_unit_format (dev, sector);
+ else
+ compact = ped_unit_format_custom (dev, sector,
+ PED_UNIT_COMPACT);
+
+ percent = ped_unit_format_custom (dev, sector, PED_UNIT_PERCENT);
+
+ printf ("%s (%s)\n", compact, percent);
+
+ ped_free (compact);
+ ped_free (percent);
+}
+
+static int
+partition_print (PedPartition* part)
+{
+ PedFileSystem* fs;
+ PedConstraint* resize_constraint;
+ char* flags;
+
+ fs = ped_file_system_open (&part->geom);
+ if (!fs)
+ return 1;
+
+ printf ("\n");
+
+ flags = partition_print_flags (part);
+
+ printf (_("Minor: %d\n"), part->num);
+ printf (_("Flags: %s\n"), flags);
+ printf (_("File System: %s\n"), fs->type->name);
+ printf (_("Size: "));
+ print_sector_compact_and_percent (part->geom.length, part->geom.dev);
+
+ resize_constraint = ped_file_system_get_resize_constraint (fs);
+ if (resize_constraint) {
+ printf (_("Minimum size: "));
+ print_sector_compact_and_percent (resize_constraint->min_size,
+ part->geom.dev);
+ printf (_("Maximum size: "));
+ print_sector_compact_and_percent (resize_constraint->max_size,
+ part->geom.dev);
+ ped_constraint_destroy (resize_constraint);
+ }
+
+ printf ("\n");
+
+ ped_free (flags);
+ ped_file_system_close (fs);
+
+ return 1;
+}
+
+static int
+do_print (PedDevice** dev)
+{
+ PedDisk* disk;
+ PedPartition* part;
+ Table* table;
+ StrList* row;
+ int has_extended;
+ int has_name;
+ int has_num_arg = 0;
+ int has_free_arg = 0;
+ int has_all_arg = 0;
+ char* peek_word;
+ char* start;
+ char* end;
+ char* size;
+ const char* name;
+ char* tmp;
+ wchar_t* table_rendered;
+
+ disk = ped_disk_new (*dev);
+ if (!disk)
+ goto error;
+
+ peek_word = command_line_peek_word ();
+ if (peek_word) {
+ has_num_arg = isdigit (peek_word[0]);
+
+ if (strncmp (peek_word, "free", 4) == 0) {
+ command_line_pop_word ();
+ has_free_arg = 1;
+ }
+
+ if (strncmp (peek_word, "all", 3) == 0) {
+ command_line_pop_word();
+ has_all_arg = 1;
+ }
+
+ ped_free (peek_word);
+
+ }
+
+ if (has_num_arg) {
+ PedPartition* part = NULL;
+ int status = 0;
+ if (command_line_get_partition ("", disk, &part))
+ status = partition_print (part);
+ ped_disk_destroy (disk);
+ return status;
+ }
+
+ if (has_all_arg) {
+ int first_device;
+ PedDevice *current_dev;
+
+ ped_device_probe_all();
+ current_dev = NULL;
+
+ while ((current_dev = ped_device_get_next(current_dev))) {
+ do_print (&current_dev);
+ printf ("\n");
+ current_dev = ped_device_get_next (current_dev);
+ }
+
+ return 1;
+ }
+
+ start = ped_unit_format (*dev, 0);
+ end = ped_unit_format_byte (*dev, (*dev)->length * (*dev)->sector_size
+ - 1 );
+ printf ("\n");
+ /* TODO: insert dev->model and transport here */
+ printf (_("Disk %s: %s\n"), (*dev)->path, end);
+ printf (_("Sector size (logical/physical): %lldB/%lldB\n"),
+ (*dev)->sector_size, (*dev)->phys_sector_size);
+ ped_free (start);
+ ped_free (end);
+
+ if (ped_unit_get_default () == PED_UNIT_CHS
+ || ped_unit_get_default () == PED_UNIT_CYLINDER) {
+ PedCHSGeometry* chs = &(*dev)->bios_geom;
+ char* cyl_size = ped_unit_format_custom (*dev,
+ chs->heads * chs->sectors,
+ PED_UNIT_KILOBYTE);
+ printf (_("BIOS cylinder,head,sector geometry: %d,%d,%d. "
+ "Each cylinder is %s.\n"),
+ chs->cylinders, chs->heads, chs->sectors, cyl_size);
+ ped_free (cyl_size);
+ }
+
+ printf (_("Partition Table: %s\n"), disk->type->name);
+
+ printf ("\n");
+
+ has_extended = ped_disk_type_check_feature (disk->type,
+ PED_DISK_TYPE_EXTENDED);
+ has_name = ped_disk_type_check_feature (disk->type,
+ PED_DISK_TYPE_PARTITION_NAME);
+
+
+ if (ped_unit_get_default() == PED_UNIT_CHS) {
+ row = str_list_create (_("Number"), _("Start"),
+ _("End"), NULL);
+ } else {
+ row = str_list_create (_("Number"), _("Start"),
+ _("End"), _("Size"), NULL);
+ }
+
+ if (has_extended)
+ str_list_append (row, _("Type"));
+
+ str_list_append (row, _("File system"));
+
+ if (has_name)
+ str_list_append (row, _("Name"));
+
+ str_list_append (row, _("Flags"));
+
+
+ table = table_new (str_list_length(row));
+
+ table_add_row_from_strlist (table, row);
+
+
+ for (part = ped_disk_next_partition (disk, NULL); part;
+ part = ped_disk_next_partition (disk, part)) {
+
+ if ((!has_free_arg && !ped_partition_is_active(part)) ||
+ part->type & PED_PARTITION_METADATA)
+ continue;
+
+ tmp = ped_malloc (4);
+
+ if (part->num >= 0)
+ sprintf (tmp, "%2d ", part->num);
+ else
+ sprintf (tmp, "%2s ", "");
+
+ row = str_list_create (tmp, NULL);
+
+ start = ped_unit_format (*dev, part->geom.start);
+ end = ped_unit_format_byte (
+ *dev, (part->geom.end + 1) * (*dev)->sector_size - 1);
+ size = ped_unit_format (*dev, part->geom.length);
+ if (ped_unit_get_default() == PED_UNIT_CHS) {
+ str_list_append (row, start);
+ str_list_append (row, end);
+ } else {
+ str_list_append (row, start);
+ str_list_append (row, end);
+ str_list_append (row, size);
+ }
+
+ if (!(part->type & PED_PARTITION_FREESPACE)) {
+ name = _(ped_partition_type_get_name (part->type));
+
+ if (has_extended)
+ str_list_append (row, name);
+
+ str_list_append (row, part->fs_type ?
+ part->fs_type->name : "");
+
+ if (has_name)
+ str_list_append (row, name);
+
+ str_list_append (row, partition_print_flags (part));
+ } else {
+ if (has_extended)
+ str_list_append (row, "");
+ str_list_append (row, _("Free Space"));
+ if (has_name)
+ str_list_append (row, "");
+ str_list_append (row, "");
+ }
+
+ //PED_ASSERT (row.cols == caption.cols)
+ table_add_row_from_strlist (table, row);
+ }
+
+ table_rendered = table_render (table);
+#ifdef ENABLE_NLS
+ printf("%ls\n", table_rendered);
+#else
+ printf("%s\n", table_rendered);
+#endif
+ ped_free (table_rendered);
+
+ table_destroy (table);
+ ped_disk_destroy (disk);
+
+ return 1;
+
+error_destroy_disk:
+ ped_disk_destroy (disk);
+error:
+ return 0;
+}
+
+static int
+do_quit (PedDevice** dev)
+{
+ _done (*dev);
+ exit (0);
+}
+
+static PedPartitionType
+_disk_get_part_type_for_sector (PedDisk* disk, PedSector sector)
+{
+ PedPartition* extended;
+
+ extended = ped_disk_extended_partition (disk);
+ if (!extended
+ || !ped_geometry_test_sector_inside (&extended->geom, sector))
+ return 0;
+
+ return PED_PARTITION_LOGICAL;
+}
+
+/* This function checks if "part" contains a file system, and returs
+ * 0 if either no file system was found, or the user declined to add it.
+ * 1 if a file system was found, and the user chose to add it.
+ * -1 if the user chose to cancel the entire search.
+ */
+static int
+_rescue_add_partition (PedPartition* part)
+{
+ const PedFileSystemType* fs_type;
+ PedGeometry* probed;
+ PedExceptionOption ex_opt;
+ PedConstraint* constraint;
+ char* found_start;
+ char* found_end;
+
+ fs_type = ped_file_system_probe (&part->geom);
+ if (!fs_type)
+ return 0;
+ probed = ped_file_system_probe_specific (fs_type, &part->geom);
+ if (!probed)
+ return 0;
+
+ if (!ped_geometry_test_inside (&part->geom, probed)) {
+ ped_geometry_destroy (probed);
+ return 0;
+ }
+
+ constraint = ped_constraint_exact (probed);
+ if (!ped_disk_set_partition_geom (part->disk, part, constraint,
+ probed->start, probed->end)) {
+ ped_constraint_destroy (constraint);
+ return 0;
+ }
+ ped_constraint_destroy (constraint);
+
+ found_start = ped_unit_format (probed->dev, probed->start);
+ found_end = ped_unit_format (probed->dev, probed->end);
+ ex_opt = ped_exception_throw (
+ PED_EXCEPTION_INFORMATION,
+ PED_EXCEPTION_YES_NO_CANCEL,
+ _("A %s %s partition was found at %s -> %s. "
+ "Do you want to add it to the partition table?"),
+ fs_type->name, ped_partition_type_get_name (part->type),
+ found_start, found_end);
+ ped_geometry_destroy (probed);
+ ped_free (found_start);
+ ped_free (found_end);
+
+ switch (ex_opt) {
+ case PED_EXCEPTION_CANCEL: return -1;
+ case PED_EXCEPTION_NO: return 0;
+ }
+
+ ped_partition_set_system (part, fs_type);
+ ped_disk_commit (part->disk);
+ return 1;
+}
+
+/* hack: we only iterate through the start, since most (all) fs's have their
+ * superblocks at the start. We'll need to change this if we generalize
+ * for RAID, or something...
+ */
+static int
+_rescue_pass (PedDisk* disk, PedGeometry* start_range, PedGeometry* end_range)
+{
+ PedSector start;
+ PedGeometry start_geom_exact;
+ PedGeometry entire_dev;
+ PedConstraint constraint;
+ PedPartition* part;
+ PedPartitionType part_type;
+
+ part_type = _disk_get_part_type_for_sector (
+ disk, (start_range->start + end_range->end) / 2);
+
+ ped_geometry_init (&entire_dev, disk->dev, 0, disk->dev->length);
+
+ ped_timer_reset (timer);
+ ped_timer_set_state_name (timer, _("searching for file systems"));
+ for (start = start_range->start; start <= start_range->end; start++) {
+ ped_timer_update (timer, 1.0 * (start - start_range->start)
+ / start_range->length);
+
+ ped_geometry_init (&start_geom_exact, disk->dev, start, 1);
+ ped_constraint_init (
+ &constraint, ped_alignment_any, ped_alignment_any,
+ &start_geom_exact, &entire_dev,
+ 1, disk->dev->length);
+ part = ped_partition_new (disk, part_type, NULL, start,
+ end_range->end);
+ if (!part) {
+ ped_constraint_done (&constraint);
+ continue;
+ }
+
+ ped_exception_fetch_all ();
+ if (ped_disk_add_partition (disk, part, &constraint)) {
+ ped_exception_leave_all ();
+ switch (_rescue_add_partition (part)) {
+ case 1:
+ ped_constraint_done (&constraint);
+ return 1;
+
+ case 0:
+ ped_disk_remove_partition (disk, part);
+ break;
+
+ case -1:
+ goto error_remove_partition;
+ }
+ } else {
+ ped_exception_leave_all ();
+ }
+ ped_partition_destroy (part);
+ ped_constraint_done (&constraint);
+ }
+ ped_timer_update (timer, 1.0);
+
+ return 1;
+
+error_remove_partition:
+ ped_disk_remove_partition (disk, part);
+error_partition_destroy:
+ ped_partition_destroy (part);
+error_constraint_done:
+ ped_constraint_done (&constraint);
+error:
+ return 0;
+}
+
+static int
+do_rescue (PedDevice** dev)
+{
+ PedDisk* disk;
+ PedSector start = 0, end = 0;
+ PedSector fuzz;
+ PedGeometry probe_start_region;
+ PedGeometry probe_end_region;
+
+ disk = ped_disk_new (*dev);
+ if (!disk)
+ goto error;
+
+ if (!command_line_get_sector (_("Start?"), *dev, &start, NULL))
+ goto error_destroy_disk;
+ if (!command_line_get_sector (_("End?"), *dev, &end, NULL))
+ goto error_destroy_disk;
+
+ fuzz = PED_MAX (PED_MIN ((end - start) / 10, MEGABYTE_SECTORS(*dev)),
+ MEGABYTE_SECTORS(*dev) * 16);
+
+ ped_geometry_init (&probe_start_region, *dev,
+ PED_MAX(start - fuzz, 0),
+ PED_MIN(2 * fuzz, (*dev)->length - (start - fuzz)));
+ ped_geometry_init (&probe_end_region, *dev,
+ PED_MAX(end - fuzz, 0),
+ PED_MIN(2 * fuzz, (*dev)->length - (end - fuzz)));
+
+ if (!_rescue_pass (disk, &probe_start_region, &probe_end_region))
+ goto error_destroy_disk;
+
+ ped_disk_destroy (disk);
+ return 1;
+
+error_destroy_disk:
+ ped_disk_destroy (disk);
+error:
+ return 0;
+}
+
+static int
+do_resize (PedDevice** dev)
+{
+ PedDisk *disk;
+ PedPartition *part = NULL;
+ PedFileSystem *fs;
+ PedConstraint *constraint;
+ PedSector start, end;
+ PedGeometry *range_start = NULL, *range_end = NULL;
+ PedGeometry new_geom;
+
+ disk = ped_disk_new (*dev);
+ if (!disk)
+ goto error;
+
+ if (!command_line_get_partition (_("Partition number?"), disk, &part))
+ goto error_destroy_disk;
+ if (part->type != PED_PARTITION_EXTENDED) {
+ if (!_partition_warn_busy (part))
+ goto error_destroy_disk;
+ }
+
+ start = part->geom.start;
+ end = part->geom.end;
+ if (!command_line_get_sector (_("Start?"), *dev, &start, &range_start))
+ goto error_destroy_disk;
+ if (!command_line_get_sector (_("End?"), *dev, &end, &range_end))
+ goto error_destroy_disk;
+
+ if (!ped_geometry_init (&new_geom, *dev, start, end - start + 1))
+ goto error_destroy_disk;
+ snap_to_boundaries (&new_geom, &part->geom, disk,
+ range_start, range_end);
+
+ if (part->type == PED_PARTITION_EXTENDED) {
+ constraint = constraint_from_start_end (*dev,
+ range_start, range_end);
+ if (!ped_disk_set_partition_geom (disk, part, constraint,
+ new_geom.start, new_geom.end))
+ goto error_destroy_constraint;
+ ped_partition_set_system (part, NULL);
+ } else {
+ fs = ped_file_system_open (&part->geom);
+ if (!fs)
+ goto error_destroy_disk;
+ constraint = constraint_intersect_and_destroy (
+ ped_file_system_get_resize_constraint (fs),
+ constraint_from_start_end (
+ *dev, range_start, range_end));
+ if (!ped_disk_set_partition_geom (disk, part, constraint,
+ new_geom.start, new_geom.end))
+ goto error_close_fs;
+ if (!ped_file_system_resize (fs, &part->geom, timer))
+ goto error_close_fs;
+ /* may have changed... eg fat16 -> fat32 */
+ ped_partition_set_system (part, fs->type);
+ ped_file_system_close (fs);
+ }
+
+ ped_disk_commit (disk);
+ ped_constraint_destroy (constraint);
+ ped_disk_destroy (disk);
+ if (range_start != NULL)
+ ped_geometry_destroy (range_start);
+ if (range_end != NULL)
+ ped_geometry_destroy (range_end);
+ return 1;
+
+error_close_fs:
+ ped_file_system_close (fs);
+error_destroy_constraint:
+ ped_constraint_destroy (constraint);
+error_destroy_disk:
+ ped_disk_destroy (disk);
+error:
+ if (range_start != NULL)
+ ped_geometry_destroy (range_start);
+ if (range_end != NULL)
+ ped_geometry_destroy (range_end);
+ return 0;
+}
+
+static int
+do_rm (PedDevice** dev)
+{
+ PedDisk* disk;
+ PedPartition* part = NULL;
+
+ disk = ped_disk_new (*dev);
+ if (!disk)
+ goto error;
+
+ if (!command_line_get_partition (_("Partition number?"), disk, &part))
+ goto error_destroy_disk;
+ if (!_partition_warn_busy (part))
+ goto error_destroy_disk;
+
+ ped_disk_delete_partition (disk, part);
+ ped_disk_commit (disk);
+ ped_disk_destroy (disk);
+ return 1;
+
+error_destroy_disk:
+ ped_disk_destroy (disk);
+error:
+ return 0;
+}
+
+static int
+do_select (PedDevice** dev)
+{
+ PedDevice* new_dev = *dev;
+
+ if (!command_line_get_device (_("New device?"), &new_dev))
+ return 0;
+ if (!ped_device_open (new_dev))
+ return 0;
+
+ ped_device_close (*dev);
+ *dev = new_dev;
+ print_using_dev (*dev);
+ return 1;
+}
+
+static int
+do_set (PedDevice** dev)
+{
+ PedDisk* disk;
+ PedPartition* part = NULL;
+ PedPartitionFlag flag;
+ int state;
+
+ disk = ped_disk_new (*dev);
+ if (!disk)
+ goto error;
+
+ if (!command_line_get_partition (_("Partition number?"), disk, &part))
+ goto error_destroy_disk;
+ if (!command_line_get_part_flag (_("Flag to Invert?"), part, &flag))
+ goto error_destroy_disk;
+ state = (ped_partition_get_flag (part, flag) == 0 ? 1 : 0);
+
+ if (!is_toggle_mode) {
+ if (!command_line_get_state (_("New state?"), &state))
+ goto error_destroy_disk;
+ }
+
+ if (!ped_partition_set_flag (part, flag, state))
+ goto error_destroy_disk;
+ if (!ped_disk_commit (disk))
+ goto error_destroy_disk;
+ ped_disk_destroy (disk);
+ return 1;
+
+error_destroy_disk:
+ ped_disk_destroy (disk);
+error:
+ return 0;
+}
+
+static int
+do_toggle (PedDevice **dev)
+{
+ int result;
+
+ is_toggle_mode = 1;
+ result = do_set (dev);
+ is_toggle_mode = 0;
+
+ return result;
+}
+
+static int
+do_unit (PedDevice** dev)
+{
+ PedUnit unit = ped_unit_get_default ();
+ if (!command_line_get_unit (_("Unit?"), &unit))
+ return 0;
+ ped_unit_set_default (unit);
+ return 1;
+}
+
+static int
+do_version ()
+{
+ printf ("\n%s\n%s",
+ prog_name,
+ copyright_msg);
+ return 1;
+}
+
+static void
+_init_messages ()
+{
+ StrList* list;
+ int first;
+ PedFileSystemType* fs_type;
+ PedDiskType* disk_type;
+ PedPartitionFlag part_flag;
+ PedUnit unit;
+
+/* flags */
+ first = 1;
+ list = str_list_create (_(flag_msg_start), NULL);
+ for (part_flag = ped_partition_flag_next (0); part_flag;
+ part_flag = ped_partition_flag_next (part_flag)) {
+ if (first)
+ first = 0;
+ else
+ str_list_append (list, ", ");
+ str_list_append (list,
+ _(ped_partition_flag_get_name (part_flag)));
+ }
+ str_list_append (list, "\n");
+
+ flag_msg = str_list_convert (list);
+ str_list_destroy (list);
+
+/* units */
+ first = 1;
+ list = str_list_create (_(unit_msg_start), NULL);
+ for (unit = PED_UNIT_FIRST; unit <= PED_UNIT_LAST; unit++) {
+ if (first)
+ first = 0;
+ else
+ str_list_append (list, ", ");
+ str_list_append (list, ped_unit_get_name (unit));
+ }
+ str_list_append (list, "\n");
+
+ unit_msg = str_list_convert (list);
+ str_list_destroy (list);
+
+/* disk type */
+ list = str_list_create (_(label_type_msg_start), NULL);
+
+ first = 1;
+ for (disk_type = ped_disk_type_get_next (NULL);
+ disk_type; disk_type = ped_disk_type_get_next (disk_type)) {
+ if (disk_type->ops->write == NULL)
+ continue;
+
+ if (first)
+ first = 0;
+ else
+ str_list_append (list, ", ");
+ str_list_append (list, disk_type->name);
+ }
+ str_list_append (list, "\n");
+
+ label_type_msg = str_list_convert (list);
+ str_list_destroy (list);
+
+/* mkfs - file system types */
+ list = str_list_create (_(fs_type_msg_start), NULL);
+
+ first = 1;
+ for (fs_type = ped_file_system_type_get_next (NULL);
+ fs_type; fs_type = ped_file_system_type_get_next (fs_type)) {
+ if (fs_type->ops->create == NULL)
+ continue;
+
+ if (first)
+ first = 0;
+ else
+ str_list_append (list, ", ");
+ str_list_append (list, fs_type->name);
+ }
+ str_list_append (list, "\n");
+
+ mkfs_fs_type_msg = str_list_convert (list);
+ str_list_destroy (list);
+
+/* mkpart - file system types */
+ list = str_list_create (_(fs_type_msg_start), NULL);
+
+ first = 1;
+ for (fs_type = ped_file_system_type_get_next (NULL);
+ fs_type; fs_type = ped_file_system_type_get_next (fs_type)) {
+ if (first)
+ first = 0;
+ else
+ str_list_append (list, ", ");
+ str_list_append (list, fs_type->name);
+ }
+ str_list_append (list, "\n");
+
+ mkpart_fs_type_msg = str_list_convert (list);
+ str_list_destroy (list);
+
+/* resize - file system types */
+ list = str_list_create (_(resize_msg_start), NULL);
+
+ first = 1;
+ for (fs_type = ped_file_system_type_get_next (NULL);
+ fs_type; fs_type = ped_file_system_type_get_next (fs_type)) {
+ if (fs_type->ops->resize == NULL)
+ continue;
+
+ if (first)
+ first = 0;
+ else
+ str_list_append (list, ", ");
+ str_list_append (list, fs_type->name);
+ }
+ str_list_append (list, "\n");
+
+ resize_fs_type_msg = str_list_convert (list);
+ str_list_destroy (list);
+}
+
+static void
+_done_messages ()
+{
+ free (flag_msg);
+ free (mkfs_fs_type_msg);
+ free (mkpart_fs_type_msg);
+ free (resize_fs_type_msg);
+ free (label_type_msg);
+}
+
+static void
+_init_commands ()
+{
+ command_register (commands, command_create (
+ str_list_create_unique ("check", _("check"), NULL),
+ do_check,
+ str_list_create (
+_("check NUMBER do a simple check on the file "
+ "system"),
+NULL),
+ str_list_create (_(number_msg), NULL), 1));
+
+ command_register (commands, command_create (
+ str_list_create_unique ("cp", _("cp"), NULL),
+ do_cp,
+ str_list_create (
+_("cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another "
+ "partition"),
+NULL),
+ str_list_create (_(number_msg), _(device_msg), NULL), 1));
+
+ command_register (commands, command_create (
+ str_list_create_unique ("help", _("help"), NULL),
+ do_help,
+ str_list_create (
+_("help [COMMAND] prints general help, or help "
+ "on COMMAND"),
+NULL),
+ NULL, 1));
+
+ command_register (commands, command_create (
+ str_list_create_unique ("mklabel", _("mklabel"), NULL),
+ do_mklabel,
+ str_list_create (
+_("mklabel LABEL-TYPE create a new disklabel "
+ "(partition table)"),
+NULL),
+ str_list_create (label_type_msg, NULL), 1));
+
+ command_register (commands, command_create (
+ str_list_create_unique ("mkfs", _("mkfs"), NULL),
+ do_mkfs,
+ str_list_create (
+_("mkfs NUMBER FS-TYPE make a FS-TYPE file "
+ "system on partititon NUMBER"),
+NULL),
+ str_list_create (_(number_msg), _(mkfs_fs_type_msg), NULL), 1));
+
+ command_register (commands, command_create (
+ str_list_create_unique ("mkpart", _("mkpart"), NULL),
+ do_mkpart,
+ str_list_create (
+_("mkpart PART-TYPE [FS-TYPE] START END make a partition"),
+NULL),
+ str_list_create (_(part_type_msg),
+ _(mkpart_fs_type_msg),
+ _(start_end_msg),
+ "\n",
+_("mkpart makes a partition without creating a new file system on the "
+ "partition. FS-TYPE may be specified to set an appropriate partition ID.\n"),
+NULL), 1));
+
+ command_register (commands, command_create (
+ str_list_create_unique ("mkpartfs", _("mkpartfs"), NULL),
+ do_mkpartfs,
+ str_list_create (
+_("mkpartfs PART-TYPE FS-TYPE START END make a partition with a "
+"file system"),
+NULL),
+ str_list_create (_(part_type_msg), _(start_end_msg), NULL), 1));
+
+command_register (commands, command_create (
+ str_list_create_unique ("move", _("move"), NULL),
+ do_move,
+ str_list_create (
+_("move NUMBER START END move partition NUMBER"),
+NULL),
+ str_list_create (_(number_msg), _(start_end_msg), NULL), 1));
+
+command_register (commands, command_create (
+ str_list_create_unique ("name", _("name"), NULL),
+ do_name,
+ str_list_create (
+_("name NUMBER NAME name partition NUMBER as NAME"),
+NULL),
+ str_list_create (_(number_msg), _(name_msg), NULL), 1));
+
+command_register (commands, command_create (
+ str_list_create_unique ("print", _("print"), NULL),
+ do_print,
+ str_list_create (
+_("print [free|NUMBER|all] display the partition table, "
+ "a partition, or all devices"),
+NULL),
+ str_list_create (
+_("Without arguments, print displays the entire partition table. With 'free'\n"
+"argument, information about free space will be displayed otherwise if a\n"
+"partition number is given, then more detailed information is displayed\n"
+"about that partition. If the 'all' argument is passed instead, partition\n"
+"information for all devices will be displayed."),
+NULL), 1));
+
+command_register (commands, command_create (
+ str_list_create_unique ("quit", _("quit"), NULL),
+ do_quit,
+ str_list_create (
+_("quit exit program"),
+NULL),
+ NULL, 1));
+
+command_register (commands, command_create (
+ str_list_create_unique ("rescue", _("rescue"), NULL),
+ do_rescue,
+ str_list_create (
+_("rescue START END rescue a lost partition near "
+"START and END"),
+NULL),
+ str_list_create (_(start_end_msg), NULL), 1));
+
+command_register (commands, command_create (
+ str_list_create_unique ("resize", _("resize"), NULL),
+ do_resize,
+ str_list_create (
+_("resize NUMBER START END resize partition NUMBER and "
+"its file system"),
+NULL),
+ str_list_create (_(number_msg),
+ _(start_end_msg),
+ _(resize_fs_type_msg), NULL), 1));
+
+command_register (commands, command_create (
+ str_list_create_unique ("rm", _("rm"), NULL),
+ do_rm,
+ str_list_create (
+_("rm NUMBER delete partition NUMBER"),
+NULL),
+ str_list_create (_(number_msg), NULL), 1));
+
+command_register (commands, command_create (
+ str_list_create_unique ("select", _("select"), NULL),
+ do_select,
+ str_list_create (
+_("select DEVICE choose the device to edit"),
+NULL),
+ str_list_create (_(device_msg), NULL), 1));
+
+command_register (commands, command_create (
+ str_list_create_unique ("set", _("set"), NULL),
+ do_set,
+ str_list_create (
+_("set NUMBER FLAG STATE change the FLAG on partition "
+ "NUMBER"),
+NULL),
+ str_list_create (_(number_msg), flag_msg, _(state_msg), NULL), 1));
+
+command_register (commands, command_create (
+ str_list_create_unique ("toggle", _("toggle"), NULL),
+ do_toggle,
+ str_list_create (
+_("toggle [NUMBER [FLAG]] toggle the state of FLAG on "
+ "partition NUMBER"),
+NULL),
+ str_list_create (_(number_msg), flag_msg, NULL), 1));
+
+command_register (commands, command_create (
+ str_list_create_unique ("unit", _("unit"), NULL),
+ do_unit,
+ str_list_create (
+_("unit UNIT set the default unit to UNIT"),
+NULL),
+ str_list_create (unit_msg, NULL), 1));
+
+command_register (commands, command_create (
+ str_list_create_unique ("version", _("version"), NULL),
+ do_version,
+ str_list_create (
+_("version displays the current version "
+"of GNU Parted and copyright information"),
+NULL),
+ str_list_create (
+_("version displays copyright and version information corressponding to this "
+"copy of GNU Parted\n"),
+NULL), 1));
+
+}
+
+static void
+_done_commands ()
+{
+Command** walk;
+
+for (walk = commands; *walk; walk++) {
+ command_destroy (*walk);
+ *walk = NULL;
+}
+}
+
+static void
+_init_i18n ()
+{
+/* intialize i18n */
+#ifdef ENABLE_NLS
+setlocale(LC_ALL, "");
+bindtextdomain(PACKAGE, LOCALEDIR);
+textdomain(PACKAGE);
+#endif /* ENABLE_NLS */
+}
+
+void
+_version ()
+{
+printf (prog_name);
+exit (0);
+}
+
+static int
+_parse_options (int* argc_ptr, char*** argv_ptr)
+{
+int opt;
+
+while (1)
+{
+#ifdef HAVE_GETOPT_H
+ opt = getopt_long (*argc_ptr, *argv_ptr, "hisv",
+ options, NULL);
+#else
+ opt = getopt (*argc_ptr, *argv_ptr, "hisv");
+#endif
+ if (opt == -1)
+ break;
+
+ switch (opt) {
+ case 'h': help_msg (); break;
+ case 'i': opt_script_mode = 0; break;
+ case 's': opt_script_mode = 1; break;
+ case 'v': _version (); break;
+ }
+}
+
+*argc_ptr -= optind;
+*argv_ptr += optind;
+return 1;
+
+error:
+return 0;
+}
+
+static PedDevice*
+_choose_device (int* argc_ptr, char*** argv_ptr)
+{
+PedDevice* dev;
+
+/* specified on comand line? */
+if (*argc_ptr) {
+ dev = ped_device_get ((*argv_ptr) [0]);
+ if (!dev)
+ return NULL;
+ (*argc_ptr)--;
+ (*argv_ptr)++;
+} else {
+retry:
+ ped_device_probe_all ();
+ dev = ped_device_get_next (NULL);
+ if (!dev) {
+ if (ped_exception_throw (PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_RETRY_CANCEL,
+ _("No device found"))
+ == PED_EXCEPTION_RETRY)
+ goto retry;
+ else
+ return NULL;
+ }
+}
+
+if (!ped_device_open (dev))
+ return NULL;
+return dev;
+}
+
+static PedDevice*
+_init (int* argc_ptr, char*** argv_ptr)
+{
+PedDevice* dev;
+
+#ifdef ENABLE_MTRACE
+mtrace();
+#endif
+
+_init_i18n ();
+if (!init_ui ())
+ goto error;
+_init_messages ();
+_init_commands ();
+
+if (!_parse_options (argc_ptr, argv_ptr))
+ goto error_done_commands;
+dev = _choose_device (argc_ptr, argv_ptr);
+if (!dev)
+ goto error_done_commands;
+
+timer = ped_timer_new (_timer_handler, &timer_context);
+if (!timer)
+ goto error_done_commands;
+timer_context.last_update = 0;
+
+return dev;
+
+error_done_commands:
+_done_commands ();
+_done_messages ();
+error_done_ui:
+done_ui ();
+error:
+return NULL;
+}
+
+static void
+_done (PedDevice* dev)
+{
+if (dev->boot_dirty && dev->type != PED_DEVICE_FILE) {
+ ped_exception_throw (
+ PED_EXCEPTION_WARNING,
+ PED_EXCEPTION_OK,
+ _("You should reinstall your boot loader before "
+ "rebooting. Read section 4 of the Parted User "
+ "documentation for more information."));
+}
+if (dev->type != PED_DEVICE_FILE && !opt_script_mode) {
+ ped_exception_throw (
+ PED_EXCEPTION_INFORMATION, PED_EXCEPTION_OK,
+ _("Don't forget to update /etc/fstab, if "
+ "necessary.\n"));
+}
+
+ped_device_close (dev);
+
+ped_timer_destroy (timer);
+_done_commands ();
+_done_messages ();
+done_ui();
+}
+
+int
+main (int argc, char** argv)
+{
+ PedDevice* dev;
+ int status;
+
+#ifdef HAVE_GETUID
+ if (getuid() != 0) {
+ printf(_("WARNING: You are not superuser. Watch out for "
+ "permissions.\n"));
+ }
+#endif
+
+ dev = _init (&argc, &argv);
+ if (!dev)
+ return 1;
+
+ if (argc || opt_script_mode)
+ status = non_interactive_mode (&dev, commands, argc, argv);
+ else
+ status = interactive_mode (&dev, commands);
+
+ _done (dev);
+
+ return !status;
+}
diff --git a/parted/strlist.c b/parted/strlist.c
new file mode 100644
index 0000000..e4292be
--- /dev/null
+++ b/parted/strlist.c
@@ -0,0 +1,605 @@
+/*
+ parted - a frontend to libparted
+ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#include "config.h"
+
+#include <parted/debug.h>
+
+#include <ctype.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <limits.h>
+
+#ifdef ENABLE_NLS
+
+#undef __USE_GNU
+#define __USE_GNU
+
+#include <wchar.h>
+#include <wctype.h>
+
+#else /* ENABLE_NLS */
+
+#ifdef wchar_t
+#undef wchar_t
+#endif
+
+#define wchar_t char
+
+#endif /* !ENABLE_NLS */
+
+#include "strlist.h"
+
+#define MIN(a,b) ( (a<b)? a : b )
+
+int
+wchar_strlen (const wchar_t* str)
+{
+#ifdef ENABLE_NLS
+ return wcslen (str);
+#else
+ return strlen (str);
+#endif
+}
+
+wchar_t*
+wchar_strchr (const wchar_t* str, char ch)
+{
+#ifdef ENABLE_NLS
+ return wcschr (str, ch);
+#else
+ return strchr (str, ch);
+#endif
+}
+
+int
+wchar_strcasecmp (const wchar_t* a, const wchar_t* b)
+{
+#ifdef ENABLE_NLS
+ return wcscasecmp (a, b);
+#else
+ return strcasecmp (a, b);
+#endif
+}
+
+int
+wchar_strncasecmp (const wchar_t* a, const wchar_t* b, size_t n)
+{
+#ifdef ENABLE_NLS
+ return wcsncasecmp (a, b, n);
+#else
+ return strncasecmp (a, b, n);
+#endif
+}
+
+wchar_t*
+wchar_strdup (const wchar_t* str)
+{
+#ifdef ENABLE_NLS
+ return wcsdup (str);
+#else
+ return strdup (str);
+#endif
+}
+
+/* converts a string from the encoding in the gettext catalogues to wide
+ * character strings (of type wchar_t*).
+ */
+#ifdef ENABLE_NLS
+static wchar_t*
+gettext_to_wchar (const char* str)
+{
+ int count;
+ wchar_t* result;
+ size_t status;
+ mbstate_t ps;
+
+ count = strlen (str) + 1;
+ result = malloc (count * sizeof (wchar_t));
+ if (!result)
+ goto error;
+
+ memset(&ps, 0, sizeof (ps));
+ status = mbsrtowcs(result, &str, count, &ps);
+ if (status == (size_t) -1)
+ goto error;
+
+ result = realloc (result, (wcslen (result) + 1) * sizeof (wchar_t));
+ return result;
+
+error:
+ printf ("Error during translation: %s\n", strerror (errno));
+ exit (1);
+}
+
+#else /* ENABLE_NLS */
+
+static wchar_t*
+gettext_to_wchar (const char* str)
+{
+ return strdup (str);
+}
+
+#endif /* !ENABLE_NLS */
+
+
+#ifdef ENABLE_NLS
+static char*
+wchar_to_str (const wchar_t* str, size_t count)
+{
+ char* result;
+ char* out_buf;
+ size_t status;
+ mbstate_t ps;
+ size_t i;
+
+ if (count == 0 || wcslen(str) < count)
+ count = wcslen (str);
+
+ out_buf = result = malloc ((count + 1) * MB_LEN_MAX);
+ if (!result)
+ goto error;
+
+ memset(&ps, 0, sizeof(ps));
+
+ for (i = 0; i < count; i++) {
+ status = wcrtomb (out_buf, str[i], &ps);
+ if (status == (size_t) -1)
+ goto error;
+ out_buf += status;
+ }
+
+ status = wcrtomb (out_buf, 0, &ps);
+ if (status == (size_t) -1)
+ goto error;
+
+ result = realloc (result, strlen (result) + 1);
+ return result;
+
+error:
+ printf ("Error during translation: %s\n", strerror (errno));
+ exit (1);
+}
+
+#else /* ENABLE_NLS */
+
+static char*
+wchar_to_str (const wchar_t* str, size_t count)
+{
+ char* result;
+
+ result = strdup (str);
+ if (count && count < strlen (result))
+ result [count] = 0;
+ return result;
+}
+
+#endif /* !ENABLE_NLS */
+
+static void
+print_wchar (const wchar_t* str, size_t count)
+{
+ char* tmp = wchar_to_str (str, count);
+ printf ("%s", tmp);
+ free (tmp);
+}
+
+static StrList*
+str_list_alloc ()
+{
+ StrList* list;
+
+ list = (StrList*) malloc (sizeof (StrList));
+ list->next = NULL;
+
+ return list;
+}
+
+void
+str_list_destroy (StrList* list)
+{
+ if (list) {
+ str_list_destroy (list->next);
+ str_list_destroy_node (list);
+ }
+}
+
+void
+str_list_destroy_node (StrList* list)
+{
+ free ((wchar_t*) list->str);
+ free (list);
+}
+
+StrList*
+str_list_duplicate_node (const StrList* node)
+{
+ StrList* result = str_list_alloc ();
+ result->str = wchar_strdup (node->str);
+ return result;
+}
+
+StrList*
+str_list_duplicate (const StrList* list)
+{
+ if (list)
+ return str_list_join (str_list_duplicate_node (list),
+ str_list_duplicate (list->next));
+ else
+ return NULL;
+}
+
+StrList*
+str_list_join (StrList* a, StrList* b)
+{
+ StrList* walk;
+
+ for (walk = a; walk && walk->next; walk = walk->next);
+
+ if (walk) {
+ walk->next = b;
+ return a;
+ } else {
+ return b;
+ }
+}
+
+static StrList*
+_str_list_append (StrList* list, const wchar_t* str)
+{
+ StrList* walk;
+
+ if (list) {
+ for (walk = list; walk->next; walk = walk->next);
+ walk->next = str_list_alloc ();
+ walk = walk->next;
+ } else {
+ walk = list = str_list_alloc ();
+ }
+ walk->str = str;
+
+ return list;
+}
+
+StrList*
+str_list_append (StrList* list, const char* str)
+{
+ return _str_list_append (list, gettext_to_wchar (str));
+}
+
+StrList*
+str_list_append_unique (StrList* list, const char* str)
+{
+ StrList* walk;
+ wchar_t* new_str = gettext_to_wchar (str);
+
+ for (walk=list; walk; walk=walk->next) {
+ if (walk->str) {
+ if (wchar_strcasecmp (new_str, walk->str) == 0) {
+ free (new_str);
+ return list;
+ }
+ }
+ }
+
+ return _str_list_append (list, new_str);
+}
+
+StrList*
+str_list_insert (StrList* list, const char* str)
+{
+ return str_list_join (str_list_create (str, NULL), list);
+}
+
+StrList*
+str_list_create (const char* first, ...)
+{
+ va_list args;
+ char* str;
+ StrList* list;
+
+ list = str_list_append (NULL, first);
+
+ if (first) {
+ va_start (args, first);
+ while ( (str = va_arg (args, char*)) )
+ str_list_append (list, str);
+ va_end (args);
+ }
+
+ return list;
+}
+
+StrList*
+str_list_create_unique (const char* first, ...)
+{
+ va_list args;
+ char* str;
+ StrList* list;
+
+ list = str_list_append (NULL, first);
+
+ if (first) {
+ va_start (args, first);
+ while ( (str = va_arg (args, char*)) )
+ str_list_append_unique (list, str);
+ va_end (args);
+ }
+
+ return list;
+}
+
+char*
+str_list_convert_node (const StrList* list)
+{
+ return wchar_to_str (list->str, 0);
+}
+
+char*
+str_list_convert (const StrList* list)
+{
+ const StrList* walk;
+ int pos = 0;
+ int length = 1;
+ char* str = strdup ("");
+
+ for (walk = list; walk; walk = walk->next) {
+ if (walk->str) {
+ char* tmp = wchar_to_str (walk->str, 0);
+
+ length += strlen (tmp);
+
+ str = realloc (str, length);
+ strcpy (str + pos, tmp);
+
+ pos = length - 1;
+ free (tmp);
+ }
+ }
+
+ return str;
+}
+
+void
+str_list_print (const StrList* list)
+{
+ const StrList* walk;
+
+ for (walk=list; walk; walk=walk->next) {
+ if (walk->str)
+ print_wchar (walk->str, 0);
+ }
+}
+
+static char*
+get_spaces (int space_count)
+{
+ char* str;
+ int i;
+
+ str = malloc (space_count + 1);
+ for (i = 0; i < space_count; i++)
+ str [i] = ' ';
+ str [i] = 0;
+
+ return str;
+}
+
+static int
+str_search (const wchar_t* str, int n, wchar_t c)
+{
+ int i;
+
+ for (i=0; i<n; i++)
+ if (str [i] == c)
+ return i;
+ return -1;
+}
+
+
+/* Japanese don't leave spaces between words, so ALL Japanese characters
+ * are treated as delimiters. Note: since the translations should already
+ * be properly formatted (eg: spaces after commas), there should be no
+ * need to include them. Best not to avoid side effects, like 3.
+14159 :-)
+ * FIXME: how do we exclude "." and "(" ?
+ * FIXME: glibc doesn't like umlaute. i.e. \"o (TeX notation), which should
+ * look like:
+ */
+
+static int
+is_break_point (wchar_t c)
+{
+#ifdef ENABLE_NLS
+ return !iswalnum (c) && !iswpunct (c);
+#else
+ return !isalnum (c) && !ispunct (c);
+#endif
+}
+
+/* NOTE: this should not return '\n' as a space, because explicit '\n' may
+ * be placed inside strings.
+ */
+static int
+is_space (wchar_t c)
+{
+#ifdef ENABLE_NLS
+ return c == (wchar_t) btowc(' ');
+#else
+ return c == ' ';
+#endif
+}
+
+void
+str_list_print_wrap (const StrList* list, int line_length, int offset,
+ int indent)
+{
+ const StrList* walk;
+ const wchar_t* str;
+ int str_len;
+ int cut_right;
+ int cut_left;
+ int line_left;
+ char* spaces;
+ int search_result;
+ int line_break;
+
+ PED_ASSERT (line_length - indent > 10, return);
+
+ spaces = get_spaces (indent);
+ line_left = line_length - offset;
+
+ for (walk=list; walk; walk=walk->next) {
+ if (!walk->str)
+ continue;
+ str = walk->str;
+ str_len = wchar_strlen (str);
+
+ while (line_left < str_len || wchar_strchr (str, '\n')) {
+ line_break = 0;
+
+ cut_left = MIN (line_left - 1, str_len - 1);
+
+ /* we can have a space "over", but not a comma */
+ if (cut_left < str_len
+ && is_space (str [cut_left + 1]))
+ cut_left++;
+
+ while (cut_left && !is_break_point (str [cut_left]))
+ cut_left--;
+ while (cut_left && is_space (str [cut_left]))
+ cut_left--;
+
+ /* str [cut_left] is either the end of a word, or a
+ * Japanese character, or the start of a blank line.
+ */
+
+ search_result = str_search (str, cut_left + 1, '\n');
+ if (search_result != -1) {
+ cut_left = search_result - 1;
+ line_break = 1;
+ }
+
+ for (cut_right = cut_left + (line_break ? 2 : 1);
+ cut_right < str_len && is_space (str [cut_right]);
+ cut_right++);
+
+ if (cut_left > 0)
+ print_wchar (str, cut_left + 1);
+
+ str += cut_right;
+ str_len -= cut_right;
+ line_left = line_length - indent;
+
+ if (walk->next || *str)
+ printf ("\n%s", spaces);
+ else if (line_break)
+ printf ("\n");
+ }
+
+ print_wchar (str, 0);
+ line_left -= wchar_strlen (str);
+ }
+
+ free (spaces);
+}
+
+static int
+_str_list_match_node (const StrList* list, const wchar_t* str)
+{
+ if (wchar_strcasecmp (list->str, str) == 0)
+ return 2;
+ if (wchar_strncasecmp (list->str, str, wchar_strlen (str)) == 0)
+ return 1;
+ return 0;
+}
+
+int
+str_list_match_node (const StrList* list, const char* str)
+{
+ wchar_t* wc_str = gettext_to_wchar (str); /* FIXME */
+ int status;
+
+ status = _str_list_match_node (list, wc_str);
+ free (wc_str);
+
+ return status;
+}
+
+/* returns: 2 for full match
+ 1 for partial match
+ 0 for no match
+ */
+int
+str_list_match_any (const StrList* list, const char* str)
+{
+ const StrList* walk;
+ int best_status = 0;
+ wchar_t* wc_str = gettext_to_wchar (str);
+
+ for (walk = list; walk; walk = walk->next) {
+ int this_status = _str_list_match_node (walk, wc_str);
+ if (this_status > best_status)
+ best_status = this_status;
+ }
+
+ free (wc_str);
+ return best_status;
+}
+
+StrList*
+str_list_match (const StrList* list, const char* str)
+{
+ const StrList* walk;
+ const StrList* partial_match = NULL;
+ int ambiguous = 0;
+ wchar_t* wc_str = gettext_to_wchar (str);
+
+ for (walk = list; walk; walk = walk->next) {
+ switch (_str_list_match_node (walk, wc_str)) {
+ case 2:
+ free (wc_str);
+ return (StrList*) walk;
+
+ case 1:
+ if (partial_match)
+ ambiguous = 1;
+ partial_match = walk;
+ }
+ }
+
+ free (wc_str);
+ return ambiguous ? NULL : (StrList*) partial_match;
+}
+
+int
+str_list_length (const StrList* list)
+{
+ int length = 0;
+ const StrList* walk;
+
+ for (walk = list; walk; walk = walk->next)
+ length++;
+
+ return length;
+}
+
diff --git a/parted/strlist.h b/parted/strlist.h
new file mode 100644
index 0000000..e458ba1
--- /dev/null
+++ b/parted/strlist.h
@@ -0,0 +1,59 @@
+/*
+ parted - a frontend to libparted
+ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef STRLIST_H_INCLUDED
+#define STRLIST_H_INCLUDED
+
+#include <wchar.h>
+
+typedef struct _StrList StrList;
+struct _StrList {
+ StrList* next;
+ const wchar_t* str;
+};
+
+extern char* language;
+extern char* gettext_charset;
+extern char* term_charset;
+
+extern StrList* str_list_create (const char* first, ...);
+extern StrList* str_list_create_unique (const char* first, ...);
+extern void str_list_destroy (StrList* list);
+extern void str_list_destroy_node (StrList* list);
+
+extern StrList* str_list_duplicate (const StrList* list);
+extern StrList* str_list_duplicate_node (const StrList* list);
+extern StrList* str_list_insert (StrList* list, const char* str);
+extern StrList* str_list_append (StrList* list, const char* str);
+extern StrList* str_list_append_unique (StrList* list, const char* str);
+extern StrList* str_list_join (StrList* a, StrList* b);
+extern char* str_list_convert (const StrList* list);
+extern char* str_list_convert_node (const StrList* list);
+
+extern void str_list_print (const StrList* list);
+extern void str_list_print_wrap (const StrList* list, int line_length,
+ int offset, int indent);
+extern int str_list_match_any (const StrList* list, const char* str);
+extern int str_list_match_node (const StrList* list, const char* str);
+extern StrList* str_list_match (const StrList* list, const char* str);
+
+extern int str_list_length (const StrList* list);
+
+#endif /* STRLIST_H_INCLUDED */
+
diff --git a/parted/table.c b/parted/table.c
new file mode 100644
index 0000000..acd7ce1
--- /dev/null
+++ b/parted/table.c
@@ -0,0 +1,265 @@
+/*
+ * TODO: - make right and centered alignment possible
+ */
+/*
+ parted - a frontend to libparted
+ Copyright (C) 2006
+ Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <assert.h>
+
+#include <config.h>
+
+#ifdef ENABLE_NLS
+# define _GNU_SOURCE
+# include <wchar.h>
+ int wcswidth (const wchar_t *s, size_t n);
+#else
+# ifdef wchar_t
+# undef wchar_t
+# endif
+# define _GNU_SOURCE
+# include <string.h>
+# define wchar_t char
+# define wcslen strlen
+# define wcswidth strnlen
+# define wcscat strcat
+# define wcsdup strdup
+ size_t strnlen (const char *, size_t);
+#endif
+
+#include "strlist.h"
+
+
+static const unsigned int MAX_WIDTH = 512;
+#ifdef ENABLE_NLS
+static const wchar_t* DELIMITER = L" ";
+static const wchar_t* COLSUFFIX = L"\n";
+#else
+static const wchar_t* DELIMITER = " ";
+static const wchar_t* COLSUFFIX = "\n";
+#endif
+
+typedef struct
+{
+ unsigned int ncols;
+ unsigned int nrows;
+ wchar_t*** rows;
+ int* widths;
+} Table;
+
+
+Table* table_new(int ncols)
+{
+ assert ( ncols >= 0 );
+
+ Table *t = malloc(sizeof(Table));
+
+ t->ncols = ncols;
+ t->nrows = 0;
+ t->rows = (wchar_t***)NULL;
+ t->widths = NULL;
+
+ return t;
+}
+
+
+void table_destroy (Table* t)
+{
+ unsigned int r, c;
+
+ assert (t);
+ assert (t->ncols > 0);
+
+ for (r = 0; r < t->nrows; ++r)
+ {
+ for (c = 0; c < t->ncols; ++c)
+ free (t->rows[r][c]);
+ free (t->rows[r]);
+ }
+
+ if (t->rows)
+ free (t->rows);
+
+ if (t->widths)
+ free (t->widths);
+
+ free (t);
+}
+
+
+static int max (int x, int y)
+{
+ return x > y ? x : y;
+}
+
+
+static void table_calc_column_widths (Table* t)
+{
+ unsigned int r, c;
+
+ assert(t);
+ assert(t->ncols > 0);
+
+ if (!t->widths)
+ t->widths = (int*)malloc(t->ncols * sizeof(int));
+
+ for (c = 0; c < t->ncols; ++c)
+ t->widths[c] = 0;
+
+ for (r = 0; r < t->nrows; ++r)
+ for (c = 0; c < t->ncols; ++c)
+ {
+ t->widths[c] = max ( t->widths[c],
+ wcswidth(t->rows[r][c],
+ MAX_WIDTH) );
+ }
+}
+
+
+/*
+ * add a row which is a string array of ncols elements.
+ * 'row' will get freed by table_destroy; you must not free it
+ * yourself.
+ */
+void table_add_row (Table* t, wchar_t** row)
+{
+ assert(t);
+
+ /*unsigned int i;
+ printf("adding row: ");
+ for (i = 0; i < t->ncols; ++i)
+ printf("[%s]", row[i]);
+ printf("\n");*/
+
+ t->rows = (wchar_t***)realloc (t->rows, (t->nrows + 1)
+ * sizeof(wchar_t***));
+
+ t->rows[t->nrows] = row;
+
+ ++t->nrows;
+
+ table_calc_column_widths (t);
+}
+
+
+void table_add_row_from_strlist (Table* t, StrList* list)
+{
+ wchar_t** row = (wchar_t**)malloc(str_list_length(list)
+ * sizeof(wchar_t**));
+ int i = 0;
+
+ while (list)
+ {
+ row[i] = (wchar_t*)list->str;
+
+ list = list->next;
+ ++i;
+ }
+
+ table_add_row (t, row);
+}
+
+
+/* render a row */
+static void table_render_row (Table* t, int rownum, int ncols, wchar_t** s)
+{
+ wchar_t** row = t->rows[rownum];
+ int len = 1, i;
+ size_t newsize;
+
+ assert(t);
+ assert(s != NULL);
+
+ for (i = 0; i < ncols; ++i)
+ len += t->widths[i] + wcslen(DELIMITER);
+
+ len += wcslen(COLSUFFIX);
+
+ newsize = (wcslen(*s) + len + 1) * sizeof(wchar_t);
+ *s = realloc (*s, newsize);
+
+ for (i = 0; i < ncols; ++i)
+ {
+ int j;
+ int nspaces = max(t->widths[i] - wcswidth(row[i], MAX_WIDTH),
+ 0);
+ wchar_t* pad = malloc ( (nspaces + 1) * sizeof(wchar_t) );
+
+ for (j = 0; j < nspaces; ++j)
+ pad[j] = L' ';
+
+#ifdef ENABLE_NLS
+ pad[nspaces] = L'\0';
+#else
+ pad[nspaces] = '\0';
+#endif
+
+ wcscat (*s, row[i]);
+ wcscat (*s, pad);
+ if (i + 1 < ncols)
+ wcscat (*s, DELIMITER);
+
+ free (pad);
+ }
+
+ wcscat (*s, COLSUFFIX);
+}
+
+
+/*
+ * Render the rows.
+ * \p s must be a null-terminated string.
+ */
+static void table_render_rows (Table* t, wchar_t** s)
+{
+ unsigned int i;
+
+#ifdef ENABLE_NLS
+ assert (**s == L'\0');
+#else
+ assert (**s == '\0');
+#endif
+
+ for (i = 0; i < t->nrows; ++i)
+ table_render_row (t, i, t->ncols, s);
+}
+
+/*
+ * Render the table to a string.
+ * You are responsible for freeing the returned string.
+ */
+wchar_t* table_render(Table* t)
+{
+ wchar_t* s = malloc(sizeof(wchar_t));
+#ifdef ENABLE_NLS
+ *s = L'\0';
+#else
+ *s = '\0';
+#endif
+
+ table_render_rows (t, &s);
+
+ return s;
+}
+
diff --git a/parted/table.h b/parted/table.h
new file mode 100644
index 0000000..5eeacd8
--- /dev/null
+++ b/parted/table.h
@@ -0,0 +1,57 @@
+/*
+ parted - a frontend to libparted
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#define _GNU_SOURCE
+#include <wchar.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <assert.h>
+
+#include "strlist.h"
+
+#include <config.h>
+
+#ifdef ENABLE_NLS
+# define _GNU_SOURCE
+# include <wchar.h>
+#else
+# ifdef wchar_t
+# undef wchar_t
+# endif
+# define wchar_t char
+#endif
+
+
+/* opaque data type */
+typedef void Table;
+
+Table* table_new(int ncols);
+void table_destroy (Table* t);
+
+/*
+ * you must not free neither 'row' nor 'list'
+ * -- this will be done by table_destroy()
+ */
+void table_add_row (Table* t, wchar_t** row);
+void table_add_row_from_strlist (Table* t, StrList* list);
+
+wchar_t* table_render(Table* t);
+
diff --git a/parted/ui.c b/parted/ui.c
new file mode 100644
index 0000000..531d62a
--- /dev/null
+++ b/parted/ui.c
@@ -0,0 +1,1361 @@
+/*
+ parted - a frontend to libparted
+ Copyright (C) 1999, 2000, 2001, 2002, 2006 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#include <parted/parted.h>
+#include <parted/debug.h>
+
+#include <ctype.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <setjmp.h>
+
+#include "../config.h"
+#include "command.h"
+#include "strlist.h"
+#include "ui.h"
+
+#define N_(String) String
+#if ENABLE_NLS
+# include <libintl.h>
+# include <locale.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+#ifdef HAVE_LIBREADLINE
+
+#ifdef HAVE_TERMCAP_H
+#include <termcap.h>
+#else
+extern int tgetnum (char* key);
+#endif
+
+#include <readline/readline.h>
+#include <readline/history.h>
+
+#ifndef HAVE_RL_COMPLETION_MATCHES
+#define rl_completion_matches completion_matches
+#endif
+
+#ifndef rl_compentry_func_t
+#define rl_compentry_func_t void
+#endif
+
+#endif /* HAVE_LIBREADLINE */
+
+char* prog_name = "GNU Parted " VERSION "\n";
+
+static char* banner_msg = N_(
+"Welcome to GNU Parted! Type 'help' to view a list of commands.\n");
+
+static char* usage_msg = N_(
+"Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]\n"
+"Apply COMMANDs with PARAMETERS to DEVICE. If no COMMAND(s) are given, "
+"run in\ninteractive mode.\n");
+
+static char* bug_msg = N_(
+"\n\nYou found a bug in GNU Parted! Here's what you have to do:\n\n"
+"Don't panic! The bug has most likely not affected any of your data.\n"
+"Help us to fix this bug by doing the following:\n\n"
+"Check whether the bug has already been fixed by checking\n"
+"the last version of GNU Parted that you can find at:\n\n"
+"\thttp://ftp.gnu.org/gnu/parted/\n\n"
+"Please check this version prior to bug reporting.\n\n"
+"If this has not been fixed yet or if you don't know how to check,\n"
+"please visit the GNU Parted website:\n\n"
+"\thttp://www.gnu.org/software/parted\n\n"
+"for further information.\n\n"
+"Your report should contain the version of this release (%s)\n"
+"along with the error message below, the output of\n\n"
+"\tparted DEVICE unit co print unit s print\n\n"
+"and additional information about your setup you consider important.\n");
+
+#define MAX_WORDS 1024
+
+static StrList* command_line;
+static Command** commands;
+static StrList* ex_opt_str [64];
+static StrList* on_list;
+static StrList* off_list;
+static StrList* on_off_list;
+static StrList* fs_type_list;
+static StrList* disk_type_list;
+
+static struct {
+ const StrList* possibilities;
+ const StrList* cur_pos;
+ int in_readline;
+ sigjmp_buf jmp_state;
+} readline_state;
+
+static PedExceptionOption current_exception_opt = 0;
+
+static struct sigaction sig_segv;
+static struct sigaction sig_int;
+static struct sigaction sig_fpe;
+static struct sigaction sig_ill;
+
+volatile int got_ctrl_c = 0; /* used in exception_handler */
+
+int
+screen_width ()
+{
+ int width = 0;
+
+ if (opt_script_mode)
+ return 32768; /* no wrapping ;) */
+
+/* HACK: don't specify termcap separately - it'll annoy the users. */
+#ifdef HAVE_LIBREADLINE
+ width = tgetnum ("co");
+#endif
+
+ if (width <= 0)
+ width = 80;
+
+ return width;
+}
+
+void
+wipe_line ()
+{
+ if (opt_script_mode)
+ return;
+
+ /* yuck */
+ printf (
+"\r \r"
+ );
+}
+
+
+#ifdef HAVE_LIBREADLINE
+/* returns matching commands for text */
+static char*
+command_generator (char* text, int state)
+{
+ if (!state)
+ readline_state.cur_pos = readline_state.possibilities;
+
+ while (readline_state.cur_pos) {
+ const StrList* cur = readline_state.cur_pos;
+ readline_state.cur_pos = cur->next;
+ if (str_list_match_node (cur, text))
+ return str_list_convert_node (cur);
+ }
+
+ return NULL;
+}
+
+/* completion function for readline() */
+char**
+complete_function (char* text, int start, int end)
+{
+ return rl_completion_matches (text,
+ (rl_compentry_func_t*) command_generator);
+}
+
+static void
+_add_history_unique (const char* line)
+{
+ HIST_ENTRY* last_entry = current_history ();
+ if (!strlen (line))
+ return;
+ if (!last_entry || strcmp (last_entry->line, line))
+ add_history ((char*) line);
+}
+#endif /* HAVE_LIBREADLINE */
+
+#ifndef HAVE_SIGACTION
+static void
+mask_signal()
+{
+ sigset_t curr;
+ sigset_t prev;
+
+ sigfillset(&curr);
+ sigprocmask(SIG_SETMASK, &curr, &prev);
+}
+#endif /* HAVE_SIGACTION */
+
+/* Resets the environment by jumping to the initial state
+ * saved during ui intitialisation.
+ * Pass 1 as the parameter if you want to quit parted,
+ * 0 if you just want to reset to the command prompt.
+ */
+static void
+reset_env (int quit)
+{
+ int in_readline = readline_state.in_readline;
+
+ readline_state.in_readline = 0;
+
+ if (in_readline) {
+ printf ("\n");
+ if (quit)
+ exit (0);
+
+ siglongjmp (readline_state.jmp_state, 1);
+ }
+}
+
+/* Signal handler for SIGINT */
+static void
+sigint_handler (int signum, siginfo_t* info, void *ucontext)
+{
+ got_ctrl_c = 1;
+
+ #ifdef HAVE_SIGACTION
+ sigaction (SIGINT, &sig_int, NULL);
+ #else
+ signal (SIGINT, &sigint_handler);
+ mask_signal();
+ #endif /* HAVE_SIGACTION */
+
+ reset_env (0);
+}
+
+/* Signal handler for SIGSEGV */
+static void
+sigsegv_handler (int signum, siginfo_t* info, void* ucontext)
+{
+ #ifdef HAVE_SIGACTION
+ sigaction (SIGSEGV, &sig_segv, NULL);
+ #else
+ signal (SIGSEGV, &sigsegv_handler);
+ mask_signal();
+ #endif /* HAVE_SIGACTION */
+
+ printf (bug_msg, VERSION);
+
+ switch (info->si_code) {
+
+ case SEGV_MAPERR:
+ printf(_("\nError: SEGV_MAPERR (Address not mapped "
+ "to object)"));
+ break;
+
+ case SEGV_ACCERR:
+ printf(_("\nError: SEGV_ACCERR (Invalid permissions "
+ "for mapped object)"));
+ break;
+
+ default:
+ printf(_("\nError: A general SIGSEGV signal was "
+ "encountered."));
+ break;
+ }
+
+ abort();
+}
+
+/* Signal handler for SIGFPE */
+static void
+sigfpe_handler (int signum, siginfo_t* info, void* ucontext)
+{
+ #ifdef HAVE_SIGACTION
+ sigaction (SIGFPE, &sig_fpe, NULL);
+ #else
+ signal (SIGFPE, &sigfpe_handler);
+ mask_signal();
+ #endif /* HAVE_SIGACTION */
+
+ printf (bug_msg, VERSION);
+
+ switch (info->si_code) {
+
+ case FPE_INTDIV:
+ printf(_("\nError: FPE_INTDIV (Integer: divide by zero)"));
+ break;
+
+ case FPE_INTOVF:
+ printf(_("\nError: FPE_INTOVF (Integer: overflow)"));
+ break;
+
+ case FPE_FLTDIV:
+ printf(_("\nError: FPE_FLTDIV (Float: divide by zero)"));
+ break;
+
+ case FPE_FLTOVF:
+ printf(_("\nError: FPE_FLTOVF (Float: overflow)"));
+ break;
+
+ case FPE_FLTUND:
+ printf(_("\nError: FPE_FLTUND (Float: underflow)"));
+ break;
+
+ case FPE_FLTRES:
+ printf(_("\nError: FPE_FLTRES (Float: inexact result)"));
+ break;
+
+ case FPE_FLTINV:
+ printf(_("\nError: FPE_FLTINV (Float: invalid operation)"));
+ break;
+
+ case FPE_FLTSUB:
+ printf(_("\nError: FPE_FLTSUB (Float: subscript out of "
+ "range)"));
+ break;
+
+ default:
+ printf(_("\nError: A general SIGFPE signal was "
+ "encountered."));
+ break;
+
+ }
+
+ abort();
+}
+
+/* Signal handler for SIGILL */
+static void
+sigill_handler (int signum, siginfo_t* info, void* ucontext)
+{
+ #ifdef HAVE_SIGACTION
+ sigaction (SIGILL, &sig_ill, NULL);
+ #else
+ signal (SIGILL, &sigill_handler);
+ mask_signal();
+ #endif /* HAVE_SIGACTION */
+
+ printf (bug_msg, VERSION);
+
+ switch (info->si_code) {
+
+ case ILL_ILLOPC:
+ printf(_("\nError: ILL_ILLOPC (Illegal Opcode)"));
+ break;
+
+ case ILL_ILLOPN:
+ printf(_("\nError: ILL_ILLOPN (Illegal Operand)"));
+ break;
+
+ case ILL_ILLADR:
+ printf(_("\nError: ILL_ILLADR (Illegal addressing "
+ "mode)"));
+ break;
+
+ case ILL_ILLTRP:
+ printf(_("\nError: ILL_ILLTRP (Illegal Trap)"));
+ break;
+
+ case ILL_PRVOPC:
+ printf(_("\nError: ILL_PRVOPC (Privileged Opcode)"));
+ break;
+
+ case ILL_PRVREG:
+ printf(_("\nError: ILL_PRVREG (Privileged Register)"));
+ break;
+
+ case ILL_COPROC:
+ printf(_("\nError: ILL_COPROC (Coprocessor Error)"));
+ break;
+
+ case ILL_BADSTK:
+ printf(_("\nError: ILL_BADSTK (Internal Stack Error)"));
+ break;
+
+ default:
+ printf(_("\nError: A general SIGILL signal was "
+ "encountered."));
+ break;
+ }
+
+ abort();
+}
+
+
+static char*
+_readline (const char* prompt, const StrList* possibilities)
+{
+ char* line;
+ int val;
+
+ readline_state.possibilities = possibilities;
+ readline_state.cur_pos = NULL;
+ readline_state.in_readline = 1;
+
+ if (sigsetjmp (readline_state.jmp_state,1))
+ return NULL;
+
+ wipe_line ();
+#ifdef HAVE_LIBREADLINE
+ if (!opt_script_mode) {
+ /* XXX: why isn't prompt const? */
+ line = readline ((char*) prompt);
+ if (line)
+ _add_history_unique (line);
+ } else
+#endif
+ {
+ printf ("%s", prompt);
+ fflush (stdout);
+ line = (char*) malloc (256);
+ if (fgets (line, 256, stdin) && strcmp (line, "") != 0) {
+ line [strlen (line) - 1] = 0; /* kill trailing CR */
+ } else {
+ free (line);
+ line = NULL;
+ }
+ }
+
+ readline_state.in_readline = 0;
+ return line;
+}
+
+static PedExceptionOption
+option_get_next (PedExceptionOption options, PedExceptionOption current)
+{
+ PedExceptionOption i;
+
+ if (current == 0)
+ i = PED_EXCEPTION_OPTION_FIRST;
+ else
+ i = current * 2;
+
+ for (; i <= options; i *= 2) {
+ if (options & i)
+ return i;
+ }
+
+ return 0;
+}
+
+static void
+_print_exception_text (PedException* ex)
+{
+ StrList* text;
+
+ wipe_line ();
+
+ if (ex->type == PED_EXCEPTION_BUG) {
+ printf (bug_msg, VERSION);
+ text = str_list_create ("\n", ex->message, "\n\n", NULL);
+ } else {
+ text = str_list_create (
+ _(ped_exception_get_type_string (ex->type)),
+ ": ", ex->message, "\n", NULL);
+ }
+
+ str_list_print_wrap (text, screen_width (), 0, 0);
+ str_list_destroy (text);
+}
+
+static PedExceptionOption
+exception_handler (PedException* ex)
+{
+ PedExceptionOption opt;
+
+ _print_exception_text (ex);
+
+ /* only one choice? Take it ;-) */
+ opt = option_get_next (ex->options, 0);
+ if (!option_get_next (ex->options, opt))
+ return opt;
+
+ /* script-mode: don't handle the exception */
+ if (opt_script_mode)
+ return PED_EXCEPTION_UNHANDLED;
+
+ got_ctrl_c = 0;
+
+ do {
+ opt = command_line_get_ex_opt ("", ex->options);
+ } while (opt == PED_EXCEPTION_UNHANDLED && isatty (0) && !got_ctrl_c);
+
+ if (got_ctrl_c) {
+ got_ctrl_c = 0;
+ opt = PED_EXCEPTION_UNHANDLED;
+ }
+
+ return opt;
+}
+
+
+void
+command_line_push_word (const char* word)
+{
+ command_line = str_list_append (command_line, word);
+}
+
+char*
+command_line_pop_word ()
+{
+ char* result;
+ StrList* next;
+
+ PED_ASSERT (command_line != NULL, return NULL);
+
+ result = str_list_convert_node (command_line);
+ next = command_line->next;
+
+ str_list_destroy_node (command_line);
+ command_line = next;
+ return result;
+}
+
+void
+command_line_flush ()
+{
+ str_list_destroy (command_line);
+ command_line = NULL;
+}
+
+char*
+command_line_peek_word ()
+{
+ if (command_line)
+ return str_list_convert_node (command_line);
+ else
+ return NULL;
+}
+
+int
+command_line_get_word_count ()
+{
+ return str_list_length (command_line);
+}
+
+static int
+_str_is_spaces (const char* str)
+{
+ while (isspace (*str)) str++;
+ return *str == 0;
+}
+
+/* "multi_word mode" is the "normal" mode... many words can be typed,
+ * delimited by spaces, etc.
+ * In single-word mode, only one word is parsed per line.
+ * Leading and trailing spaces are removed. For example: " a b c "
+ * is a single word "a b c". The motivation for this mode is partition
+ * names, etc. In single-word mode, the empty string is a word.
+ * (but not in multi-word mode).
+ */
+void
+command_line_push_line (const char* line, int multi_word)
+{
+ int quoted = 0;
+ char quote_char = 0;
+ char this_word [256];
+ int i;
+
+ do {
+ while (*line == ' ')
+ line++;
+
+ i = 0;
+ for (; *line; line++) {
+ if (*line == ' ' && !quoted) {
+ if (multi_word)
+ break;
+
+ /* single word: check for trailing spaces + eol */
+ if (_str_is_spaces (line))
+ break;
+ }
+
+ if (!quoted && strchr ("'\"", *line)) {
+ quoted = 1;
+ quote_char = *line;
+ continue;
+ }
+ if (quoted && *line == quote_char) {
+ quoted = 0;
+ continue;
+ }
+
+ /* hack: escape characters */
+ if (quoted && line[0] == '\\' && line[1])
+ line++;
+
+ this_word [i++] = *line;
+ }
+ if (i || !multi_word) {
+ this_word [i] = 0;
+ command_line_push_word (this_word);
+ }
+ } while (*line && multi_word);
+}
+
+static char*
+realloc_and_cat (char* str, const char* append)
+{
+ int length = strlen (str) + strlen (append) + 1;
+ char* new_str = realloc (str, length);
+ strcat (new_str, append);
+ return new_str;
+}
+
+static char*
+_construct_prompt (const char* head, const char* def,
+ const StrList* possibilities)
+{
+ char* prompt = strdup (head);
+
+ if (def && possibilities)
+ PED_ASSERT (str_list_match_any (possibilities, def),
+ return NULL);
+
+ if (possibilities && str_list_length (possibilities) < 8) {
+ const StrList* walk;
+ if (strlen (prompt))
+ prompt = realloc_and_cat (prompt, " ");
+
+ for (walk = possibilities; walk; walk = walk->next) {
+ if (walk != possibilities)
+ prompt = realloc_and_cat (prompt, "/");
+
+ if (def && str_list_match_node (walk, def) == 2) {
+ prompt = realloc_and_cat (prompt, "[");
+ prompt = realloc_and_cat (prompt, def);
+ prompt = realloc_and_cat (prompt, "]");
+ } else {
+ char* text = str_list_convert_node (walk);
+ prompt = realloc_and_cat (prompt, text);
+ free (text);
+ }
+ }
+ prompt = realloc_and_cat (prompt, "? ");
+ } else if (def) {
+ if (strlen (prompt))
+ prompt = realloc_and_cat (prompt, " ");
+ prompt = realloc_and_cat (prompt, "[");
+ prompt = realloc_and_cat (prompt, def);
+ prompt = realloc_and_cat (prompt, "]? ");
+ } else {
+ if (strlen (prompt))
+ prompt = realloc_and_cat (prompt, " ");
+ }
+
+ return prompt;
+}
+
+void
+command_line_prompt_words (const char* prompt, const char* def,
+ const StrList* possibilities, int multi_word)
+{
+ char* line;
+ char* real_prompt;
+ char* _def = (char*) def;
+ int _def_needs_free = 0;
+
+ if (!def && str_list_length (possibilities) == 1) {
+ _def = str_list_convert_node (possibilities);
+ _def_needs_free = 1;
+ }
+
+ if (opt_script_mode) {
+ if (_def)
+ command_line_push_line (_def, 0);
+ return;
+ }
+
+ do {
+ real_prompt = _construct_prompt (prompt, _def, possibilities);
+ line = _readline (real_prompt, possibilities);
+ free (real_prompt);
+ if (!line)
+ break;
+
+ if (!strlen (line)) {
+ if (_def)
+ command_line_push_line (_def, 0);
+ } else {
+ command_line_push_line (line, multi_word);
+ }
+ free (line);
+ } while (!command_line_get_word_count () && !_def);
+
+ if (_def_needs_free)
+ free (_def);
+}
+
+/**
+ * Get a word from command line.
+ *
+ * \param possibilities a StrList of valid strings, NULL if all are valid.
+ * \param multi_word whether multiple words are allowed.
+ *
+ * \return The word(s), or NULL if empty.
+ */
+char*
+command_line_get_word (const char* prompt, const char* def,
+ const StrList* possibilities, int multi_word)
+{
+ do {
+ if (command_line_get_word_count ()) {
+ char* result = command_line_pop_word ();
+ StrList* result_node;
+
+ if (!possibilities)
+ return result;
+ result_node = str_list_match (possibilities, result);
+ free (result);
+ if (result_node)
+ return str_list_convert_node (result_node);
+ command_line_flush ();
+ }
+
+ command_line_prompt_words (prompt, def, possibilities,
+ multi_word);
+ } while (command_line_get_word_count ());
+
+ return NULL;
+}
+
+int
+command_line_get_integer (const char* prompt, int* value)
+{
+ char def_str [10];
+ char* input;
+ int valid;
+
+ snprintf (def_str, 10, "%d", *value);
+ input = command_line_get_word (prompt, *value ? def_str : NULL,
+ NULL, 1);
+ if (!input)
+ return 0;
+ valid = sscanf (input, "%d", value);
+ free (input);
+ return valid;
+}
+
+int
+command_line_get_sector (const char* prompt, PedDevice* dev, PedSector* value,
+ PedGeometry** range)
+{
+ char* def_str;
+ char* input;
+ int valid;
+
+ def_str = ped_unit_format (dev, *value);
+ input = command_line_get_word (prompt, *value ? def_str : NULL,
+ NULL, 1);
+
+ /* def_str might have rounded *value a little bit. If the user picked
+ * the default, make sure the selected sector is identical to the
+ * default.
+ */
+ if (input && *value && !strcmp (input, def_str)) {
+ if (range) {
+ *range = ped_geometry_new (dev, *value, 1);
+ ped_free (def_str);
+ return *range != NULL;
+ }
+
+ ped_free (def_str);
+ return 1;
+ }
+
+ ped_free (def_str);
+ if (!input) {
+ *value = 0;
+ if (range)
+ *range = NULL;
+ return 0;
+ }
+
+ valid = ped_unit_parse (input, dev, value, range);
+
+ free (input);
+ return valid;
+}
+
+int
+command_line_get_state (const char* prompt, int* value)
+{
+ char* def_word;
+ char* input;
+
+ if (*value)
+ def_word = str_list_convert_node (on_list);
+ else
+ def_word = str_list_convert_node (off_list);
+ input = command_line_get_word (prompt, def_word, on_off_list, 1);
+ free (def_word);
+ if (!input)
+ return 0;
+ if (str_list_match_any (on_list, input))
+ *value = 1;
+ else
+ *value = 0;
+ free (input);
+ return 1;
+}
+
+int
+command_line_get_device (const char* prompt, PedDevice** value)
+{
+ char* def_dev_name = *value ? (*value)->path : NULL;
+ char* dev_name;
+ PedDevice* dev;
+
+ dev_name = command_line_get_word (prompt, def_dev_name, NULL, 1);
+ if (!dev_name)
+ return 0;
+ dev = ped_device_get (dev_name);
+ free (dev_name);
+ if (!dev)
+ return 0;
+ *value = dev;
+ return 1;
+}
+
+int
+command_line_get_disk (const char* prompt, PedDisk** value)
+{
+ PedDevice* dev = *value ? (*value)->dev : NULL;
+ if (!command_line_get_device (prompt, &dev))
+ return 0;
+ if (dev != (*value)->dev) {
+ PedDisk* new_disk = ped_disk_new (dev);
+ if (!new_disk)
+ return 0;
+ *value = new_disk;
+ }
+ return 1;
+}
+
+int
+command_line_get_partition (const char* prompt, PedDisk* disk,
+ PedPartition** value)
+{
+ PedPartition* part;
+
+ /* Flawed logic, doesn't seem to work?!
+ check = ped_disk_next_partition (disk, part);
+ part = ped_disk_next_partition (disk, check);
+
+ if (part == NULL) {
+
+ *value = check;
+ printf (_("The (only) primary partition has "
+ "been automatically selected\n"));
+ return 1;
+
+ } else {
+ */
+ int num = (*value) ? (*value)->num : 0;
+
+ if (!command_line_get_integer (prompt, &num)) {
+ ped_exception_throw (PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Expecting a partition number."));
+ return 0;
+ }
+
+ part = ped_disk_get_partition (disk, num);
+
+ if (!part) {
+ ped_exception_throw (PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("Partition doesn't exist."));
+ return 0;
+ }
+
+ *value = part;
+ return 1;
+ //}
+}
+
+int
+command_line_get_fs_type (const char* prompt, const PedFileSystemType*(* value))
+{
+ char* fs_type_name;
+ PedFileSystemType* fs_type;
+
+ fs_type_name = command_line_get_word (prompt,
+ *value ? (*value)->name : NULL,
+ fs_type_list, 1);
+ if (!fs_type_name) {
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("Expecting a file system type."));
+ return 0;
+ }
+ fs_type = ped_file_system_type_get (fs_type_name);
+ if (!fs_type) {
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("Unknown file system type \"%s\"."),
+ fs_type_name);
+ return 0;
+ }
+ free (fs_type_name);
+ *value = fs_type;
+ return 1;
+}
+
+int
+command_line_get_disk_type (const char* prompt, const PedDiskType*(* value))
+{
+ char* disk_type_name;
+ PedDiskType* disk_type;
+
+ disk_type_name = command_line_get_word (prompt,
+ *value ? (*value)->name : NULL,
+ disk_type_list, 1);
+ if (!disk_type_name) {
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("Expecting a disk label type."));
+ return 0;
+ }
+ *value = ped_disk_type_get (disk_type_name);
+ free (disk_type_name);
+ PED_ASSERT (*value != NULL, return 0);
+ return 1;
+}
+
+int
+command_line_get_part_flag (const char* prompt, const PedPartition* part,
+ PedPartitionFlag* flag)
+{
+ StrList* opts = NULL;
+ PedPartitionFlag walk = 0;
+ char* flag_name;
+
+ while ( (walk = ped_partition_flag_next (walk)) ) {
+ if (ped_partition_is_flag_available (part, walk)) {
+ const char* walk_name;
+
+ walk_name = ped_partition_flag_get_name (walk);
+ opts = str_list_append (opts, walk_name);
+ opts = str_list_append_unique (opts, _(walk_name));
+ }
+ }
+
+ flag_name = command_line_get_word (prompt, NULL, opts, 1);
+ str_list_destroy (opts);
+
+ if (flag_name) {
+ *flag = ped_partition_flag_get_by_name (flag_name);
+ ped_free (flag_name);
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+static int
+_can_create_primary (const PedDisk* disk)
+{
+ int i;
+
+ for (i = 1; i <= ped_disk_get_max_primary_partition_count (disk); i++) {
+ if (!ped_disk_get_partition (disk, i))
+ return 1;
+ }
+
+ return 0;
+}
+
+static int
+_can_create_extended (const PedDisk* disk)
+{
+ if (!_can_create_primary (disk))
+ return 0;
+ if (!ped_disk_type_check_feature (disk->type, PED_DISK_TYPE_EXTENDED))
+ return 0;
+ if (ped_disk_extended_partition (disk))
+ return 0;
+ return 1;
+}
+
+static int
+_can_create_logical (const PedDisk* disk)
+{
+ if (!ped_disk_type_check_feature (disk->type, PED_DISK_TYPE_EXTENDED))
+ return 0;
+ return ped_disk_extended_partition (disk) != 0;
+}
+
+int
+command_line_get_part_type (const char* prompt, const PedDisk* disk,
+ PedPartitionType* type)
+{
+ StrList* opts = NULL;
+ char* type_name;
+
+ if (_can_create_primary (disk)) {
+ opts = str_list_append_unique (opts, "primary");
+ opts = str_list_append_unique (opts, _("primary"));
+ }
+ if (_can_create_extended (disk)) {
+ opts = str_list_append_unique (opts, "extended");
+ opts = str_list_append_unique (opts, _("extended"));
+ }
+ if (_can_create_logical (disk)) {
+ opts = str_list_append_unique (opts, "logical");
+ opts = str_list_append_unique (opts, _("logical"));
+ }
+ if (!opts) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("Can't create any more partitions."));
+ return 0;
+ }
+
+ type_name = command_line_get_word (prompt, NULL, opts, 1);
+ str_list_destroy (opts);
+
+ if (!type_name) {
+ ped_exception_throw (
+ PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("Expecting a partition type."));
+ return 0;
+ }
+
+ if (!strcmp (type_name, "primary")
+ || !strcmp (type_name, _("primary"))) {
+ *type = 0;
+ }
+ if (!strcmp (type_name, "extended")
+ || !strcmp (type_name, _("extended"))) {
+ *type = PED_PARTITION_EXTENDED;
+ }
+ if (!strcmp (type_name, "logical")
+ || !strcmp (type_name, _("logical"))) {
+ *type = PED_PARTITION_LOGICAL;
+ }
+
+ free (type_name);
+ return 1;
+}
+
+PedExceptionOption
+command_line_get_ex_opt (const char* prompt, PedExceptionOption options)
+{
+ StrList* options_strlist = NULL;
+ PedExceptionOption opt;
+ char* opt_name;
+
+ for (opt = option_get_next (options, 0); opt;
+ opt = option_get_next (options, opt)) {
+ options_strlist = str_list_append_unique (options_strlist,
+ _(ped_exception_get_option_string (opt)));
+ options_strlist = str_list_append_unique (options_strlist,
+ ped_exception_get_option_string (opt));
+ }
+
+ opt_name = command_line_get_word (prompt, NULL, options_strlist, 1);
+ if (!opt_name)
+ return PED_EXCEPTION_UNHANDLED;
+ str_list_destroy (options_strlist);
+
+ opt = PED_EXCEPTION_OPTION_FIRST;
+ while (1) {
+ if (strcmp (opt_name,
+ ped_exception_get_option_string (opt)) == 0)
+ break;
+ if (strcmp (opt_name,
+ _(ped_exception_get_option_string (opt))) == 0)
+ break;
+ opt = option_get_next (options, opt);
+ }
+ free (opt_name);
+ return opt;
+}
+
+int
+command_line_get_unit (const char* prompt, PedUnit* unit)
+{
+ StrList* opts = NULL;
+ PedUnit walk;
+ char* unit_name;
+ const char* default_unit_name;
+
+ for (walk = PED_UNIT_FIRST; walk <= PED_UNIT_LAST; walk++)
+ opts = str_list_append (opts, ped_unit_get_name (walk));
+
+ default_unit_name = ped_unit_get_name (ped_unit_get_default ());
+ unit_name = command_line_get_word (prompt, default_unit_name, opts, 1);
+ str_list_destroy (opts);
+
+ if (unit_name) {
+ *unit = ped_unit_get_by_name (unit_name);
+ free (unit_name);
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+int
+command_line_is_integer ()
+{
+ char* word;
+ int is_integer;
+ int scratch;
+
+ word = command_line_peek_word ();
+ if (!word)
+ return 0;
+
+ is_integer = sscanf (word, "%d", &scratch);
+ free (word);
+ return is_integer;
+}
+
+static int
+init_ex_opt_str ()
+{
+ int i;
+ PedExceptionOption opt;
+
+ for (i = 0; (1 << i) <= PED_EXCEPTION_OPTION_LAST; i++) {
+ opt = (1 << i);
+ ex_opt_str [i]
+ = str_list_create (
+ ped_exception_get_option_string (opt),
+ _(ped_exception_get_option_string (opt)),
+ NULL);
+ if (!ex_opt_str [i])
+ return 0;
+ }
+
+ ex_opt_str [i] = NULL;
+ return 1;
+}
+
+static void
+done_ex_opt_str ()
+{
+ int i;
+
+ for (i=0; ex_opt_str [i]; i++)
+ str_list_destroy (ex_opt_str [i]);
+}
+
+static int
+init_state_str ()
+{
+ on_list = str_list_create_unique (_("on"), "on", NULL);
+ off_list = str_list_create_unique (_("off"), "off", NULL);
+ on_off_list = str_list_join (str_list_duplicate (on_list),
+ str_list_duplicate (off_list));
+ return 1;
+}
+
+static void
+done_state_str ()
+{
+ str_list_destroy (on_list);
+ str_list_destroy (off_list);
+ str_list_destroy (on_off_list);
+}
+
+static int
+init_fs_type_str ()
+{
+ PedFileSystemType* walk;
+
+ fs_type_list = NULL;
+
+ for (walk = ped_file_system_type_get_next (NULL); walk;
+ walk = ped_file_system_type_get_next (walk))
+ {
+ fs_type_list = str_list_insert (fs_type_list, walk->name);
+ if (!fs_type_list)
+ return 0;
+ }
+
+ return 1;
+}
+
+static int
+init_disk_type_str ()
+{
+ PedDiskType* walk;
+
+ disk_type_list = NULL;
+
+ for (walk = ped_disk_type_get_next (NULL); walk;
+ walk = ped_disk_type_get_next (walk))
+ {
+ disk_type_list = str_list_insert (disk_type_list, walk->name);
+ if (!disk_type_list)
+ return 0;
+ }
+
+ return 1;
+}
+
+int
+init_ui ()
+{
+ opt_script_mode = !isatty (0);
+
+ if (!init_ex_opt_str ()
+ || !init_state_str ()
+ || !init_fs_type_str ()
+ || !init_disk_type_str ())
+ return 0;
+ ped_exception_set_handler (exception_handler);
+
+#ifdef HAVE_LIBREADLINE
+ rl_initialize ();
+ rl_attempted_completion_function = (CPPFunction*) complete_function;
+ readline_state.in_readline = 0;
+#endif
+
+#ifdef HAVE_SIGACTION
+ sigset_t curr;
+ sigfillset (&curr);
+
+ sig_segv.sa_sigaction = &sigsegv_handler;
+ sig_int.sa_sigaction = &sigint_handler;
+ sig_fpe.sa_sigaction = &sigfpe_handler;
+ sig_ill.sa_sigaction = &sigill_handler;
+
+ sig_segv.sa_mask =
+ sig_int.sa_mask =
+ sig_fpe.sa_mask =
+ sig_ill.sa_mask = curr;
+
+ sig_segv.sa_flags =
+ sig_int.sa_flags =
+ sig_fpe.sa_flags =
+ sig_ill.sa_flags = SA_SIGINFO;
+
+ sigaction (SIGSEGV, &sig_segv, NULL);
+ sigaction (SIGINT, &sig_int, NULL);
+ sigaction (SIGFPE, &sig_fpe, NULL);
+ sigaction (SIGILL, &sig_ill, NULL);
+#endif /* HAVE_SIGACTION */
+
+ return 1;
+}
+
+void
+done_ui ()
+{
+ ped_exception_set_handler (NULL);
+ done_ex_opt_str ();
+ done_state_str ();
+ str_list_destroy (fs_type_list);
+ str_list_destroy (disk_type_list);
+}
+
+void
+help_msg ()
+{
+ printf (_(usage_msg));
+
+ printf ("\n%s\n", _("OPTIONs:"));
+ print_options_help ();
+
+ printf ("\n%s\n", _("COMMANDs:"));
+ print_commands_help ();
+ exit (0);
+}
+
+void
+print_using_dev (PedDevice* dev)
+{
+ printf (_("Using %s\n"), dev->path);
+}
+
+int
+interactive_mode (PedDevice** dev, Command* cmd_list[])
+{
+ char* line;
+ StrList* list;
+ StrList* command_names = command_get_names (cmd_list);
+
+ commands = cmd_list; /* FIXME yucky, nasty, evil hack */
+
+ printf ("%s", prog_name);
+
+ print_using_dev (*dev);
+
+ list = str_list_create (_(banner_msg), NULL);
+ str_list_print_wrap (list, screen_width (), 0, 0);
+ str_list_destroy (list);
+
+ while (1) {
+ char* word;
+ Command* cmd;
+
+ while (!command_line_get_word_count ()) {
+ if (feof (stdin)) {
+ printf ("\n");
+ return 1;
+ }
+ command_line_prompt_words ("(parted)", NULL,
+ command_names, 1);
+ }
+
+ word = command_line_pop_word ();
+ if (word) {
+ cmd = command_get (commands, word);
+ free (word);
+ if (cmd) {
+ if (!command_run (cmd, dev))
+ command_line_flush ();
+ } else {
+ print_commands_help ();
+ }
+ }
+ }
+
+ return 1;
+}
+
+
+int
+non_interactive_mode (PedDevice** dev, Command* cmd_list[],
+ int argc, char* argv[])
+{
+ int i;
+ Command* cmd;
+
+ commands = cmd_list; /* FIXME yucky, nasty, evil hack */
+
+ for (i = 0; i < argc; i++)
+ command_line_push_line (argv [i], 1);
+
+ while (command_line_get_word_count ()) {
+ char* word;
+
+ word = command_line_pop_word ();
+ if (!word)
+ break;
+ cmd = command_get (commands, word);
+ if (!cmd) {
+ help_msg ();
+ goto error;
+ }
+
+ if (!(cmd->non_interactive)) {
+ printf("This command does not make sense in "
+ "non-interactive mode.\n");
+ exit(1);
+ goto error;
+ }
+
+ if (!command_run (cmd, dev))
+ goto error;
+ }
+ return 1;
+
+error:
+ return 0;
+}
+
diff --git a/parted/ui.h b/parted/ui.h
new file mode 100644
index 0000000..3ea0acb
--- /dev/null
+++ b/parted/ui.h
@@ -0,0 +1,83 @@
+/*
+ parted - a frontend to libparted
+ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#ifndef UI_H_INCLUDED
+#define UI_H_INCLUDED
+
+#include "strlist.h"
+
+extern char* prog_name;
+
+extern int init_ui ();
+extern int non_interactive_mode (PedDevice** dev, Command* cmd_list[],
+ int argc, char* argv[]);
+extern int interactive_mode (PedDevice** dev, Command* cmd_list[]);
+extern void done_ui ();
+
+extern int screen_width ();
+extern void wipe_line ();
+
+extern void command_line_push_word (const char* word);
+extern char* command_line_pop_word ();
+extern char* command_line_peek_word ();
+extern void command_line_flush ();
+extern int command_line_get_word_count ();
+extern void command_line_prompt_words (const char* prompt, const char* def,
+ const StrList* possibilities,
+ int multi_word);
+extern char* command_line_get_word (const char* prompt, const char* def,
+ const StrList* possibilities,
+ int multi_word);
+extern int command_line_get_integer (const char* prompt, int* value);
+extern int command_line_get_sector (const char* prompt, PedDevice* dev,
+ PedSector* value, PedGeometry** range);
+extern int command_line_get_state (const char* prompt, int* value);
+extern int command_line_get_device (const char* prompt, PedDevice** value);
+extern int command_line_get_disk (const char* prompt, PedDisk** value);
+extern int command_line_get_partition (const char* prompt, PedDisk* disk,
+ PedPartition** value);
+extern int command_line_get_fs_type (const char* prompt,
+ const PedFileSystemType*(* value));
+extern int command_line_get_disk_type (const char* prompt,
+ const PedDiskType*(* value));
+extern int command_line_get_part_flag (const char* prompt,
+ const PedPartition* part,
+ PedPartitionFlag* flag);
+extern int command_line_get_part_type (const char* prompt, const PedDisk* disk,
+ PedPartitionType* type);
+extern PedExceptionOption command_line_get_ex_opt (const char* prompt,
+ PedExceptionOption options);
+extern int command_line_get_unit (const char* prompt, PedUnit* unit);
+
+extern int command_line_is_integer ();
+extern int command_line_is_sector ();
+
+extern void help_msg ();
+
+extern void print_using_dev (PedDevice* dev);
+
+/* in parted.c */
+extern int opt_script_mode;
+
+extern void print_options_help ();
+extern void print_commands_help ();
+
+
+#endif /* UI_H_INCLUDED */
+
diff --git a/partprobe/Makefile.am b/partprobe/Makefile.am
new file mode 100644
index 0000000..f83d489
--- /dev/null
+++ b/partprobe/Makefile.am
@@ -0,0 +1,13 @@
+partedincludedir = -I$(top_srcdir)/include
+
+sbin_PROGRAMS = partprobe
+
+partprobe_SOURCES = partprobe.c
+
+partprobe_LDADD = @INTLLIBS@ @LIBS@ \
+ $(top_builddir)/libparted/libparted.la @PARTED_LIBS@
+
+partprobe_LDFLAGS = @PARTEDLDFLAGS@
+
+INCLUDES = $(partedincludedir) @INTLINCS@
+
diff --git a/partprobe/partprobe.c b/partprobe/partprobe.c
new file mode 100644
index 0000000..f86c370
--- /dev/null
+++ b/partprobe/partprobe.c
@@ -0,0 +1,161 @@
+/*
+ partprobe - informs the OS kernel of partition layout
+ Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+/* it's best to compile this with:
+ *
+ * CFLAGS=-Os ./configure --disable-nls --disable-shared --disable-debug
+ * --enable-discover-only
+ *
+ * And strip(1) afterwards!
+ */
+
+#include "config.h"
+
+#include <parted/parted.h>
+
+#include <stdio.h>
+#include <string.h>
+
+/* initialized to 0 according to the language lawyers */
+static int opt_no_probe;
+static int opt_summary;
+
+static void
+summary (PedDisk* disk)
+{
+ PedPartition* walk;
+
+ printf ("%s: %s partitions", disk->dev->path, disk->type->name);
+ for (walk = disk->part_list; walk; walk = walk->next) {
+ if (!ped_partition_is_active (walk))
+ continue;
+
+ printf (" %d", walk->num);
+ if (walk->type & PED_PARTITION_EXTENDED) {
+ PedPartition* log_walk;
+ int is_first = 1;
+
+ printf (" <");
+ for (log_walk = walk->part_list; log_walk;
+ log_walk = log_walk->next) {
+ if (!ped_partition_is_active (log_walk))
+ continue;
+ if (!is_first)
+ printf (" ");
+ printf ("%d", log_walk->num);
+ is_first = 0;
+ }
+ printf (">");
+ }
+ }
+ printf ("\n");
+}
+
+static int
+process_dev (PedDevice* dev)
+{
+ PedDiskType* disk_type;
+ PedDisk* disk;
+
+ disk_type = ped_disk_probe (dev);
+ if (!disk_type || !strcmp (disk_type->name, "loop"))
+ return 1;
+
+ disk = ped_disk_new (dev);
+ if (!disk)
+ goto error;
+ if (!opt_no_probe) {
+ if (!ped_disk_commit_to_os (disk))
+ goto error_destroy_disk;
+ }
+ if (opt_summary)
+ summary (disk);
+ ped_disk_destroy (disk);
+ return 1;
+
+error_destroy_disk:
+ ped_disk_destroy (disk);
+error:
+ return 0;
+}
+
+static void
+help ()
+{
+ printf ("usage: partprobe [-d] [-h] [-s] [-v] [DEVICES...]\n\n"
+ "-d don't update the kernel\n"
+ "-s print a summary of contents\n"
+ "-v version info\n");
+}
+
+static void
+version ()
+{
+ printf ("partprobe (" PACKAGE VERSION ")\n");
+}
+
+int
+main (int argc, char* argv[])
+{
+ int dev_passed = 0;
+ int i;
+ PedDevice* dev;
+ int status = 1;
+
+ for (i = 1; i < argc; i++) {
+ if (argv[i][0] != '-') {
+ dev_passed = 1;
+ continue;
+ }
+ switch (argv[i][1]) {
+ case '?':
+ case 'h':
+ help();
+ return 0;
+
+ case 'd': opt_no_probe = 1; break;
+ case 's': opt_summary = 1; break;
+
+ case 'v':
+ version();
+ return 0;
+ }
+ }
+
+ if (dev_passed) {
+ for (i = 1; i < argc; i++) {
+ if (argv[i][0] == '-')
+ continue;
+
+ dev = ped_device_get (argv[i]);
+ if (dev)
+ status &= process_dev (dev);
+ else
+ status = 0;
+ }
+ } else {
+ ped_device_probe_all ();
+ for (dev = ped_device_get_next (NULL); dev;
+ dev = ped_device_get_next (dev))
+ status &= process_dev (dev);
+ }
+
+ return !status;
+}
+
diff --git a/po/ChangeLog b/po/ChangeLog
new file mode 100644
index 0000000..8237bc0
--- /dev/null
+++ b/po/ChangeLog
@@ -0,0 +1,45 @@
+2004-03-11 gettextize <bug-gnu-gettext@gnu.org>
+
+ * Makefile.in.in: Upgrade to gettext-0.14.1.
+ * boldquot.sed: New file, from gettext-0.14.1.
+ * en@boldquot.header: New file, from gettext-0.14.1.
+ * en@quot.header: New file, from gettext-0.14.1.
+ * insert-header.sin: New file, from gettext-0.14.1.
+ * quot.sed: New file, from gettext-0.14.1.
+ * remove-potcdate.sin: New file, from gettext-0.14.1.
+ * Rules-quot: New file, from gettext-0.14.1.
+
+2003-06-13 gettextize <bug-gnu-utils@gnu.org>
+
+ * Makefile.in.in: Upgrade to gettext-0.10.40.
+
+2002-11-15 gettextize <bug-gnu-utils@gnu.org>
+
+ * Makefile.in.in: Upgrade to gettext-0.10.40.
+
+2001-12-31 gettextize <bug-gnu-utils@gnu.org>
+
+ * Makefile.in.in: Upgrade to gettext-0.10.40.
+
+2001-12-27 gettextize <bug-gnu-utils@gnu.org>
+
+ * Makefile.in.in: Upgrade to gettext-0.10.40.
+
+2001-12-16 gettextize <bug-gnu-utils@gnu.org>
+
+ * Makefile.in.in: Upgrade to gettext-0.10.40.
+
+2001-12-12 gettextize <bug-gnu-utils@gnu.org>
+
+ * Makefile.in.in: Upgrade to gettext-0.10.40.
+
+2001-11-09 gettextize <bug-gnu-utils@gnu.org>
+
+ * Makefile.in.in: Upgrade to gettext-0.10.40.
+
+2001-07-14 gettextize <bug-gnu-utils@gnu.org>
+
+ * Makefile.in.in: Upgrade to gettext-0.10.38.
+ * cat-id-tbl.c: Remove file.
+ * stamp-cat-id: Remove file.
+
diff --git a/po/Makevars b/po/Makevars
new file mode 100644
index 0000000..18dcb6b
--- /dev/null
+++ b/po/Makevars
@@ -0,0 +1,41 @@
+# Makefile variables for PO directory in any package using GNU gettext.
+
+# Usually the message domain is the same as the package name.
+DOMAIN = $(PACKAGE)
+
+# These two variables depend on the location of this directory.
+subdir = po
+top_builddir = ..
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
+
+# This is the copyright holder that gets inserted into the header of the
+# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
+# package. (Note that the msgstr strings, extracted from the package's
+# sources, belong to the copyright holder of the package.) Translators are
+# expected to transfer the copyright for their translations to this person
+# or entity, or to disclaim their copyright. The empty string stands for
+# the public domain; in this case the translators are expected to disclaim
+# their copyright.
+COPYRIGHT_HOLDER = Free Software Foundation, Inc.
+
+# This is the email address or URL to which the translators shall report
+# bugs in the untranslated strings:
+# - Strings which are not entire sentences, see the maintainer guidelines
+# in the GNU gettext documentation, section 'Preparing Strings'.
+# - Strings which use unclear terms or require additional context to be
+# understood.
+# - Strings which make invalid assumptions about notation of date, time or
+# money.
+# - Pluralisation problems.
+# - Incorrect English spelling.
+# - Incorrect formatting.
+# It can be your email address, or a mailing list address where translators
+# can write to without being subscribed, or the URL of a web page through
+# which the translators can contact you.
+MSGID_BUGS_ADDRESS = bug-parted@gnu.org
+
+# This is the list of locale categories, beyond LC_MESSAGES, for which the
+# message catalogs shall be used. It is usually empty.
+EXTRA_LOCALE_CATEGORIES =
diff --git a/po/POTFILES b/po/POTFILES
new file mode 100644
index 0000000..627b372
--- /dev/null
+++ b/po/POTFILES
@@ -0,0 +1,56 @@
+ ../libparted/device.c \
+ ../libparted/arch/linux.c \
+ ../libparted/arch/gnu.c \
+ ../libparted/disk.c \
+ ../libparted/labels/rdb.c \
+ ../libparted/labels/bsd.c \
+ ../libparted/labels/dos.c \
+ ../libparted/labels/dvh.c \
+ ../libparted/labels/gpt.c \
+ ../libparted/labels/loop.c \
+ ../libparted/labels/mac.c \
+ ../libparted/labels/pc98.c \
+ ../libparted/labels/sun.c \
+ ../libparted/filesys.c \
+ ../libparted/exception.c \
+ ../libparted/cs/geom.c \
+ ../libparted/libparted.c \
+ ../libparted/unit.c \
+ ../libparted/fs/ext2/ext2.c \
+ ../libparted/fs/ext2/ext2_inode_relocator.c \
+ ../libparted/fs/ext2/ext2_resize.c \
+ ../libparted/fs/ext2/tune.c \
+ ../libparted/fs/ext2/ext2_block_relocator.c \
+ ../libparted/fs/ext2/ext2_meta.c \
+ ../libparted/fs/ext2/interface.c \
+ ../libparted/fs/ext2/ext2_buffer.c \
+ ../libparted/fs/ext2/ext2_mkfs.c \
+ ../libparted/fs/ext2/parted_io.c \
+ ../libparted/fs/fat/calc.c \
+ ../libparted/fs/fat/context.c \
+ ../libparted/fs/fat/fat.c \
+ ../libparted/fs/fat/resize.c \
+ ../libparted/fs/fat/traverse.c \
+ ../libparted/fs/fat/bootsector.c \
+ ../libparted/fs/fat/clstdup.c \
+ ../libparted/fs/fat/count.c \
+ ../libparted/fs/fat/fatio.c \
+ ../libparted/fs/fat/table.c \
+ ../libparted/fs/linux_swap/linux_swap.c \
+ ../libparted/fs/hfs/advfs.c \
+ ../libparted/fs/hfs/advfs_plus.c \
+ ../libparted/fs/hfs/cache.c \
+ ../libparted/fs/hfs/file.c \
+ ../libparted/fs/hfs/file_plus.c \
+ ../libparted/fs/hfs/hfs.c \
+ ../libparted/fs/hfs/journal.c \
+ ../libparted/fs/hfs/probe.c \
+ ../libparted/fs/hfs/reloc.c \
+ ../libparted/fs/hfs/reloc_plus.c \
+ ../libparted/fs/jfs/jfs.c \
+ ../libparted/fs/ufs/ufs.c \
+ ../libparted/fs/xfs/xfs.c \
+ ../parted/command.c \
+ ../parted/parted.c \
+ ../parted/strlist.c \
+ ../parted/ui.c
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644
index 0000000..e170ccb
--- /dev/null
+++ b/po/POTFILES.in
@@ -0,0 +1,80 @@
+# libparted
+# Copyright (C) 1999, 2000, 2001, 2006 Free Software Foundation, Inc.
+# This file may be modified and/or copied without restriction.
+
+# list of files containing translatable strings
+
+# libparted
+libparted/device.c
+libparted/arch/linux.c
+libparted/arch/gnu.c
+libparted/disk.c
+libparted/labels/rdb.c
+libparted/labels/bsd.c
+libparted/labels/dos.c
+libparted/labels/dvh.c
+libparted/labels/gpt.c
+libparted/labels/loop.c
+libparted/labels/mac.c
+libparted/labels/pc98.c
+libparted/labels/sun.c
+libparted/filesys.c
+libparted/exception.c
+libparted/cs/geom.c
+libparted/libparted.c
+libparted/unit.c
+
+# libparted/fs_ext2
+libparted/fs/ext2/ext2.c
+libparted/fs/ext2/ext2_inode_relocator.c
+libparted/fs/ext2/ext2_resize.c
+libparted/fs/ext2/tune.c
+libparted/fs/ext2/ext2_block_relocator.c
+libparted/fs/ext2/ext2_meta.c
+libparted/fs/ext2/interface.c
+libparted/fs/ext2/ext2_buffer.c
+libparted/fs/ext2/ext2_mkfs.c
+libparted/fs/ext2/parted_io.c
+
+# libparted/fs/fat
+libparted/fs/fat/calc.c
+libparted/fs/fat/context.c
+libparted/fs/fat/fat.c
+libparted/fs/fat/resize.c
+libparted/fs/fat/traverse.c
+libparted/fs/fat/bootsector.c
+libparted/fs/fat/clstdup.c
+libparted/fs/fat/count.c
+libparted/fs/fat/fatio.c
+libparted/fs/fat/table.c
+
+# libparted/fs/linux_swap
+libparted/fs/linux_swap/linux_swap.c
+
+# libparted/fs/hfs
+libparted/fs/hfs/advfs.c
+libparted/fs/hfs/advfs_plus.c
+libparted/fs/hfs/cache.c
+libparted/fs/hfs/file.c
+libparted/fs/hfs/file_plus.c
+libparted/fs/hfs/hfs.c
+libparted/fs/hfs/journal.c
+libparted/fs/hfs/probe.c
+libparted/fs/hfs/reloc.c
+libparted/fs/hfs/reloc_plus.c
+
+# libparted/fs/jfs
+libparted/fs/jfs/jfs.c
+
+# libparted/fs/ufs
+libparted/fs/ufs/ufs.c
+
+# libparted/fs/xfs
+libparted/fs/xfs/xfs.c
+
+# parted
+parted/command.c
+parted/parted.c
+parted/strlist.c
+parted/ui.c
+
diff --git a/po/boldquot.sed b/po/boldquot.sed
new file mode 100644
index 0000000..4b937aa
--- /dev/null
+++ b/po/boldquot.sed
@@ -0,0 +1,10 @@
+s/"\([^"]*\)"/“\1”/g
+s/`\([^`']*\)'/‘\1’/g
+s/ '\([^`']*\)' / ‘\1’ /g
+s/ '\([^`']*\)'$/ ‘\1’/g
+s/^'\([^`']*\)' /‘\1’ /g
+s/“”/""/g
+s/“/“/g
+s/”/”/g
+s/‘/‘/g
+s/’/’/g
diff --git a/po/ca.po b/po/ca.po
new file mode 100644
index 0000000..8780337
--- /dev/null
+++ b/po/ca.po
@@ -0,0 +1,2544 @@
+# GNU Parted en catal
+# Copyright (C) 2002 Free Software Foundation, Inc.
+# Miquel Matas <miquelmatas@wanadoo.es>, 2002.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: parted 1.6.0\n"
+"Report-Msgid-Bugs-To: bug-parted@gnu.org\n"
+"POT-Creation-Date: 2006-04-21 21:20+0200\n"
+"PO-Revision-Date: 2002-05-05 14:47+0100\n"
+"Last-Translator: Miquel Matas <miquelmatas@wanadoo.es>\n"
+"Language-Team: Catalan <ca@dodds.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=iso-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 0.7\n"
+
+#: libparted/arch/linux.c:284
+#, c-format
+msgid "Could not stat device %s - %s."
+msgstr "Impossible d'inicialitzar el dispositiu %s - %s."
+
+#: libparted/arch/linux.c:390
+#, c-format
+msgid ""
+"Could not determine sector size for %s: %s.\n"
+"Using the default sector size (%lld)."
+msgstr ""
+
+#: libparted/arch/linux.c:401
+#, c-format
+msgid ""
+"Device %s has a logical sector size of %lld. Not all parts of GNU Parted "
+"support this at the moment, and the working code is HIGHLY EXPERIMENTAL.\n"
+msgstr ""
+
+#: libparted/arch/linux.c:441
+#, fuzzy, c-format
+msgid "Unable to determine the size of %s (%s)."
+msgstr "No s'ha pogut determinar la mida de %s (%s)"
+
+#: libparted/arch/linux.c:530
+#, c-format
+msgid "Could not get identity of device %s - %s"
+msgstr "No s'ha pogut obtenir la identitat del dispositiu %s - %s"
+
+#: libparted/arch/linux.c:539
+msgid "Generic IDE"
+msgstr ""
+
+#: libparted/arch/linux.c:556
+#, c-format
+msgid ""
+"Device %s has multiple (%d) logical sectors per physical sector.\n"
+"GNU Parted supports this EXPERIMENTALLY for some special disk label/file "
+"system combinations, e.g. GPT and ext2/3.\n"
+"Please consult the web site for up-to-date information."
+msgstr ""
+
+#: libparted/arch/linux.c:726
+#, c-format
+msgid "Error initialising SCSI device %s - %s"
+msgstr "Error inicialitzant el dispositiu SCSI %s - %s"
+
+#: libparted/arch/linux.c:781
+#, c-format
+msgid ""
+"The device %s has zero length, and can't possibly store a file system or "
+"partition table. Perhaps you selected the wrong device?"
+msgstr ""
+
+#: libparted/arch/linux.c:829
+msgid ""
+"Unable to determine geometry of file/device. You should not use Parted "
+"unless you REALLY know what you're doing!"
+msgstr ""
+"No s'ha pogut determinar la geometria del fitxer/dispositiu. No s'hauria de "
+"fer servir Parted EXCEPTE que se spiga el que s'est fent!"
+
+#: libparted/arch/linux.c:903
+msgid "DAC960 RAID controller"
+msgstr "Controlador RAID DAC960"
+
+#: libparted/arch/linux.c:908
+msgid "Compaq Smart Array"
+msgstr "Compaq Smart Array"
+
+#: libparted/arch/linux.c:913
+msgid "ATARAID Controller"
+msgstr "Controlador ATARAID"
+
+#: libparted/arch/linux.c:918
+msgid "I2O Controller"
+msgstr "Controlador I20"
+
+#: libparted/arch/linux.c:923
+msgid "User-Mode Linux UBD"
+msgstr ""
+
+#: libparted/arch/linux.c:933
+msgid "Unknown"
+msgstr "Desconegut"
+
+#: libparted/arch/linux.c:940
+msgid "ped_device_new() Unsupported device type"
+msgstr "ped_device_new() Dispositiu no suportat"
+
+#: libparted/arch/linux.c:1041 libparted/arch/gnu.c:264
+#, c-format
+msgid "Error opening %s: %s"
+msgstr "Error obrint %s: %s"
+
+#: libparted/arch/linux.c:1052 libparted/arch/gnu.c:274
+#, c-format
+msgid "Unable to open %s read-write (%s). %s has been opened read-only."
+msgstr ""
+"No s'ha pogut obrir %s lectura/escritura (%s). %s s'ha obert noms lectura. "
+
+#: libparted/arch/linux.c:1160 libparted/arch/linux.c:1228
+#: libparted/arch/gnu.c:452 libparted/arch/gnu.c:550 libparted/arch/gnu.c:678
+#, c-format
+msgid "%s during read on %s"
+msgstr "%s mentre s'estava llegint a %s"
+
+#: libparted/arch/linux.c:1199
+#, c-format
+msgid "%s during seek for read on %s"
+msgstr "%s mentre es preparava per llegir a %s"
+
+#: libparted/arch/linux.c:1270 libparted/arch/linux.c:1355
+#: libparted/arch/linux.c:1413 libparted/arch/gnu.c:587
+#: libparted/arch/gnu.c:632 libparted/arch/gnu.c:709
+#, c-format
+msgid "%s during write on %s"
+msgstr "%s mentre s'estava escrivint a %s"
+
+#: libparted/arch/linux.c:1297 libparted/arch/gnu.c:512
+#, c-format
+msgid "Can't write to %s, because it is opened read-only."
+msgstr "No s'ha pogut escriure a %s, ja que era obert per noms lectura"
+
+#: libparted/arch/linux.c:1321
+#, c-format
+msgid "%s during seek for write on %s"
+msgstr "%s mentre es preparava per escruire a %s"
+
+#: libparted/arch/linux.c:1798
+#, fuzzy, c-format
+msgid ""
+"Error informing the kernel about modifications to partition %s -- %s. This "
+"means Linux won't know about any changes you made to %s until you reboot -- "
+"so you shouldn't mount it or use it in any way before rebooting."
+msgstr ""
+"Error informant el kernel sobre modificacions a la partici %s - %s. Aix "
+"vol dir que Linux no reconeixer cap canvi que haveu fet a %s fins que no "
+"reinicieu - per tant no podeu muntar-la o utilitzar-la en cap sentit abans "
+"d'inicialitzar la mquina. "
+
+#: libparted/arch/linux.c:1879
+#, fuzzy, c-format
+msgid ""
+"The kernel was unable to re-read the partition table on %s (%s). This means "
+"Linux won't know anything about the modifications you made until you "
+"reboot. You should reboot your computer before doing anything with %s."
+msgstr ""
+"El kernel no ha pogut rellegir la taula de particions a %s (%s).Aix vol dir "
+"que Linux no reconeixer cap de les modificacions fetes. Heu d'arrencar la "
+"mquina abans de fer res amb %s."
+
+#: libparted/arch/gnu.c:97
+#, c-format
+msgid "Unable to open %s."
+msgstr "No s'ha pogut obrir %s"
+
+#: libparted/arch/gnu.c:117
+msgid "Unable to probe store."
+msgstr "No s'ha pogut provar d'emmagatzemar."
+
+#: libparted/arch/gnu.c:355
+#, fuzzy
+msgid ""
+"The partition table cannot be re-read. This means you need to reboot before "
+"mounting any modified partitions. You also need to reinstall your boot "
+"loader before you reboot (which may require mounting modified partitions). "
+"It is impossible do both things! So you'll need to boot off a rescue disk, "
+"and reinstall your boot loader from the rescue disk. Read section 4 of the "
+"Parted User documentation for more information."
+msgstr ""
+"La taula de particions no s'ha pogut rellegir, per tant es necessita fer "
+"reboot abans de muntar una partici modificada. Tamb es necessita "
+"reinstallar el carregador d'arrencada abans de reinicialitzar ( que pot "
+"necessitar el muntatge de les particions modificades ). No s possible fer "
+"les dues coses! Per tant, necessites arrencar amb un disquet de rescat i "
+"reinstallar el carregador d'arrencada des del disc de rescat. Llegeix la "
+"secci 4 de la documentaci de l'Usuari de Parted per ms informaci. "
+
+#: libparted/arch/gnu.c:372
+#, fuzzy, c-format
+msgid ""
+"The partition table on %s cannot be re-read (%s). This means the Hurd knows "
+"nothing about any modifications you made. You should reboot your computer "
+"before doing anything with %s."
+msgstr ""
+"La taula de particions a %s (%s).Aix vol dir que Linux no reconeixer cap "
+"de les modificacions fetes. S'ha de re-arrencar la mquina abans de fer res "
+"amb %s."
+
+#: libparted/arch/gnu.c:383 parted/parted.c:2215
+msgid ""
+"You should reinstall your boot loader before rebooting. Read section 4 of "
+"the Parted User documentation for more information."
+msgstr ""
+"S'ha de reinstallar el carregador d'arrencada abans de rearrencar llegir la "
+"secci 4 de la documentaci de l'Usuari de Parted per ms informaci."
+
+#: libparted/arch/gnu.c:774
+#, c-format
+msgid "%s trying to sync %s to disk"
+msgstr "%s intentant de sincronitzar %s al dics"
+
+#: libparted/disk.c:183
+#, c-format
+msgid "Unable to open %s - unrecognised disk label."
+msgstr "No s'ha pogut obrir %s - etiqueta de disc desconeguda."
+
+#: libparted/disk.c:452
+#, c-format
+msgid ""
+"This libparted doesn't have write support for %s. Perhaps it was compiled "
+"read-only."
+msgstr ""
+"Aquesta libparted no t suport per escriure a %s. Potser va ser compilada "
+"per noms lectura."
+
+#: libparted/disk.c:579
+#, fuzzy, c-format
+msgid "Partition %d is %s, but the file system is %s."
+msgstr "La partici %d s de %.3fMb, per el sistema de fitxers s de %.3fMb."
+
+#: libparted/disk.c:1056
+#, c-format
+msgid "%s disk labels do not support extended partitions."
+msgstr "Les etiquetes de disc de %s no suporten particions exteses."
+
+#: libparted/disk.c:1616
+#, c-format
+msgid "%s disk labels don't support logical or extended partitions."
+msgstr "Les etiquetes de disc de %s no suporten particions lgiques o exteses."
+
+#: libparted/disk.c:1629
+#, fuzzy
+msgid "Too many primary partitions."
+msgstr "Massa particions primries."
+
+#: libparted/disk.c:1638
+#, c-format
+msgid ""
+"Can't add a logical partition to %s, because there is no extended partition."
+msgstr ""
+"No es pot afegir una partici lgica a %s, ja que no hi ha una partici "
+"extesa"
+
+#: libparted/disk.c:1662
+#, fuzzy, c-format
+msgid "Can't have more than one extended partition on %s."
+msgstr "No pot haver ms d'una partici extesa a %s"
+
+#: libparted/disk.c:1672
+msgid "Can't have logical partitions outside of the extended partition."
+msgstr "No poden haver particions lgiques fora de la partici extesa."
+
+#: libparted/disk.c:1697
+#, c-format
+msgid "Can't have a logical partition outside of the extended partition on %s."
+msgstr "No pot haver una partici lgica fora de la partici extesa a %s."
+
+#: libparted/disk.c:1707 libparted/disk.c:1761 libparted/disk.c:1927
+#, fuzzy
+msgid "Can't have overlapping partitions."
+msgstr "No poden haver particions solapades."
+
+#: libparted/disk.c:1715
+msgid "Can't have a primary partition inside an extended partition."
+msgstr "No pot haver una partici primaria dins d'una partici extesa."
+
+#: libparted/disk.c:2123
+msgid "metadata"
+msgstr "metadata"
+
+#: libparted/disk.c:2125
+msgid "free"
+msgstr "lliure"
+
+#: libparted/disk.c:2127 parted/ui.c:968 parted/ui.c:996
+msgid "extended"
+msgstr "extesa"
+
+#: libparted/disk.c:2129 parted/ui.c:972 parted/ui.c:1000
+msgid "logical"
+msgstr "lgica"
+
+#: libparted/disk.c:2131 parted/ui.c:964 parted/ui.c:992
+msgid "primary"
+msgstr "primria"
+
+#: libparted/disk.c:2147
+msgid "boot"
+msgstr "boot"
+
+#: libparted/disk.c:2149
+msgid "root"
+msgstr "root"
+
+#: libparted/disk.c:2151
+msgid "swap"
+msgstr "swap"
+
+#: libparted/disk.c:2153
+msgid "hidden"
+msgstr "oculta"
+
+#: libparted/disk.c:2155
+msgid "raid"
+msgstr "raid"
+
+#: libparted/disk.c:2157
+msgid "lvm"
+msgstr "lvm"
+
+#: libparted/disk.c:2159
+msgid "lba"
+msgstr "lba"
+
+#: libparted/disk.c:2161
+msgid "hp-service"
+msgstr "servei-hp"
+
+#: libparted/disk.c:2163
+msgid "palo"
+msgstr ""
+
+#: libparted/disk.c:2165
+#, fuzzy
+msgid "prep"
+msgstr "boot"
+
+#: libparted/disk.c:2167
+msgid "msftres"
+msgstr ""
+
+#: libparted/disk.c:2173
+#, fuzzy, c-format
+msgid "Unknown partition flag, %d."
+msgstr "Flag desconegut a %d."
+
+#: libparted/labels/rdb.c:177
+#, c-format
+msgid "%s : Bad checksum on block %llu of type %s."
+msgstr ""
+
+#: libparted/labels/rdb.c:510
+#, c-format
+msgid "%s : Didn't find rdb block, should never happen."
+msgstr ""
+
+#: libparted/labels/rdb.c:595
+#, c-format
+msgid "%s : Loop detected at block %d."
+msgstr ""
+
+#: libparted/labels/rdb.c:614
+#, c-format
+msgid "%s : The %s list seems bad at block %s."
+msgstr ""
+
+#: libparted/labels/rdb.c:703
+#, c-format
+msgid "%s : Failed to list bad blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:711
+#, c-format
+msgid "%s : Failed to list partition blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:719
+#, c-format
+msgid "%s : Failed to list file system blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:727
+#, c-format
+msgid "%s : Failed to list boot blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:750
+#, fuzzy, c-format
+msgid "Failed to write partition block at %d."
+msgstr "No s'ha pogut determinar si la partici est muntada."
+
+#: libparted/labels/rdb.c:1053 libparted/labels/bsd.c:505
+#: libparted/labels/dos.c:1942 libparted/labels/dvh.c:772
+#: libparted/labels/gpt.c:1365 libparted/labels/loop.c:251
+#: libparted/labels/mac.c:1318 libparted/labels/pc98.c:764
+#: libparted/labels/sun.c:704
+msgid "Unable to satisfy all constraints on the partition."
+msgstr "No s'ha pogut satisfer les limitacions a la partici"
+
+#: libparted/labels/rdb.c:1081
+#, fuzzy
+msgid "Unable to allocate a partition number."
+msgstr "S'esperava un mmero de partici."
+
+#: libparted/labels/bsd.c:530
+#, fuzzy
+msgid "Unable to allocate a bsd disklabel slot."
+msgstr "No s'ha pogut reservar una etiqueta bsd"
+
+#: libparted/labels/dos.c:812
+#, fuzzy, c-format
+msgid "Invalid partition table on %s -- wrong signature %x."
+msgstr "Taula de particions invlida a %s - signatura dolenta %x."
+
+#: libparted/labels/dos.c:840
+#, c-format
+msgid "Invalid partition table - recursive partition on %s."
+msgstr "Taula de particions invlida - partici recursiva a %s."
+
+#: libparted/labels/dos.c:1300
+msgid "Extended partitions cannot be hidden on msdos disk labels."
+msgstr ""
+
+#: libparted/labels/dos.c:1926
+msgid "Parted can't resize partitions managed by Windows Dynamic Disk."
+msgstr ""
+
+#: libparted/labels/dvh.c:192
+#, fuzzy, c-format
+msgid "%s has no extended partition (volume header partition)."
+msgstr ""
+"%s no t partici extesa (partici de capalera de volum). Si ignoreu, tots "
+"els volums d'arrencada sern esborrats. "
+
+#: libparted/labels/dvh.c:315
+msgid "Checksum is wrong, indicating the partition table is corrupt."
+msgstr ""
+"Checksum incorrecte, la qual cosa indica que la taula de particions s "
+"corrupte."
+
+#: libparted/labels/dvh.c:616
+msgid "Only primary partitions can be root partitions."
+msgstr "Noms les particions primries poden ser particions root."
+
+#: libparted/labels/dvh.c:630
+msgid "Only primary partitions can be swap partitions."
+msgstr "Noms les particions primries poden ser particions swap."
+
+#: libparted/labels/dvh.c:644
+msgid "Only logical partitions can be a boot file."
+msgstr "Noms les particions lgiques poden ser un fitxer d'arrencada."
+
+#: libparted/labels/dvh.c:723
+msgid "Only logical partitions (boot files) have a name."
+msgstr "Noms les particions lgiques (fitxers d'arrencada) tenen nom."
+
+#: libparted/labels/dvh.c:814
+msgid "Too many primary partitions"
+msgstr "Massa particions primries."
+
+#: libparted/labels/gpt.c:433
+#, fuzzy, c-format
+msgid ""
+"%s contains GPT signatures, indicating that it has a GPT table. However, it "
+"does not have a valid fake msdos partition table, as it should. Perhaps it "
+"was corrupted -- possibly by a program that doesn't understand GPT partition "
+"tables. Or perhaps you deleted the GPT table, and are now using an msdos "
+"partition table. Is this a GPT partition table?"
+msgstr ""
+"%s cont signatures GPT, la qual cosa indica que t una taula GPT. No "
+"obstant, no t una taula de particions msdos imitada, com hauria de ser. "
+"Potser s corrupte - possiblement per un programa que no s capa d'entendre "
+"les taules de partici GPT. O potser, tamb, heu esborrat la taula GPT i ara "
+"feu servir una taula de particions msdos. s aquesta una partici GPT? "
+
+#: libparted/labels/gpt.c:625
+#, fuzzy, c-format
+msgid ""
+"The format of the GPT partition table is version %x, which is newer than "
+"what Parted can recognise. Please tell us! bug-parted@gnu.org"
+msgstr ""
+"El format de la taula de particions GPT s ms nou que el que Parted pot "
+"reconeixer. Si-us-plau, diga'ns-ho a bug-parted@gnu.org"
+
+#: libparted/labels/gpt.c:747
+msgid ""
+"The backup GPT table is not at the end of the disk, as it should be. This "
+"might mean that another operating system believes the disk is smaller. Fix, "
+"by moving the backup to the end (and removing the old backup)?"
+msgstr ""
+"La cpia de la taula GPT no s al final del disc com hauriea d'ser. Aix pot "
+"voler dir que un altre sistema operatiu creu que el disc s ms petit. Ho "
+"voleu arreglar novent la cpia al final ( i esborrant la cpia antiga)?"
+
+#: libparted/labels/gpt.c:782
+#, fuzzy
+msgid ""
+"The primary GPT table is corrupt, but the backup appears OK, so that will be "
+"used."
+msgstr ""
+"La taula primria GPT s corrupte, per la cpia sembla correcta, per tant "
+"es far servir aquesta."
+
+#: libparted/labels/gpt.c:790
+#, fuzzy
+msgid ""
+"Both the primary and backup GPT tables are corrupt. Try making a fresh "
+"table, and using Parted's rescue feature to recover partitions."
+msgstr ""
+"Tant la taula primria GPT com la cpia sn corruptes. Intenteu crear una "
+"taula actualitzada, i fent servir la opci de rescat de Parted per "
+"reconstrur les particions."
+
+#: libparted/labels/mac.c:167
+#, c-format
+msgid "Invalid signature %x for Mac disk labels."
+msgstr "Signatura invlida %x per etiquetes de discs Mac."
+
+#: libparted/labels/mac.c:212
+msgid "Partition map has no partition map entry!"
+msgstr "El Mapa de particions no t entrada de mapa de particions!"
+
+#: libparted/labels/mac.c:259
+#, c-format
+msgid "%s is too small for a Mac disk label!"
+msgstr "%s massa petita per una etiqueta d'un disc Mac."
+
+#: libparted/labels/mac.c:490
+#, c-format
+msgid "Partition %d has an invalid signature %x."
+msgstr "La partici %d t una signatura invlida %x."
+
+#: libparted/labels/mac.c:508
+#, c-format
+msgid "Partition %d has an invalid length of 0 bytes!"
+msgstr "La partici %d t una logitud invlida de 0 bytes!"
+
+#: libparted/labels/mac.c:536
+#, fuzzy
+msgid "The data region doesn't start at the start of the partition."
+msgstr "La regi de dades no comena al principi de la partici"
+
+#: libparted/labels/mac.c:553
+#, fuzzy
+msgid "The boot region doesn't start at the start of the partition."
+msgstr "La regi d'arrencada no comema al principi de la partici"
+
+#: libparted/labels/mac.c:567
+msgid "The partition's boot region doesn't occupy the entire partition."
+msgstr "La regi d'arrencada de la partici no ocupa la partici sencera."
+
+#: libparted/labels/mac.c:577
+msgid "The partition's data region doesn't occupy the entire partition."
+msgstr "La regi de dades de la partici no ocupa la partici sencera."
+
+#: libparted/labels/mac.c:631
+#, c-format
+msgid ""
+"Weird block size on device descriptor: %d bytes is not divisible by 512."
+msgstr ""
+"La mida de bloc extrany al dispositiu: %d bytes no s divisible per 512."
+
+#: libparted/labels/mac.c:644
+#, c-format
+msgid ""
+"The driver descriptor says the physical block size is %d bytes, but Linux "
+"says it is %d bytes."
+msgstr ""
+"El controlador diu que el tamany de bloc fsic s de %d bytes, per Linux "
+"troba que s de %d bytes."
+
+#: libparted/labels/mac.c:692
+msgid "No valid partition map found."
+msgstr "No s'ha trobat un mapa de particions vlid."
+
+#: libparted/labels/mac.c:744
+#, fuzzy, c-format
+msgid ""
+"Conflicting partition map entry sizes! Entry 1 says it is %d, but entry %d "
+"says it is %d!"
+msgstr ""
+"Conflicte de mida de entrada del mapa de particions! La entrada 1 diu que s "
+"%d, per la entrada %d diu que s %d!"
+
+#: libparted/labels/mac.c:771
+#, fuzzy
+msgid "Weird! There are 2 partitions map entries!"
+msgstr "Estrany - 2 entrades de mapes de particions!"
+
+#: libparted/labels/mac.c:1257
+msgid ""
+"Changing the name of a root or swap partition will prevent Linux from "
+"recognising it as such."
+msgstr ""
+"Canviar el nom d'una partici root o swap impedir que Linux les reconeixi "
+"com a tals."
+
+#: libparted/labels/mac.c:1353
+#, fuzzy
+msgid "Can't add another partition -- the partition map is too small!"
+msgstr ""
+"No es pot afegir una altra partici - el mapa de particions s massa petit!"
+
+#: libparted/labels/pc98.c:357
+#, fuzzy, c-format
+msgid "Invalid partition table on %s."
+msgstr "Taula de particions invlida a %s"
+
+#: libparted/labels/pc98.c:409 libparted/labels/pc98.c:487
+#, fuzzy, c-format
+msgid ""
+"Partition %d isn't aligned to cylinder boundaries. This is still "
+"unsupported."
+msgstr ""
+"La partici %d no est aliniada als lmits dels cilindres. Cal afegir suport "
+"per aquesta caracterstica."
+
+#: libparted/labels/pc98.c:796
+msgid "Can't add another partition."
+msgstr "No es pot afegir un altra partici."
+
+#: libparted/labels/sun.c:143
+msgid "Corrupted Sun disk label detected."
+msgstr "S'ha detectat una etiqueta Sun corrupte."
+
+#: libparted/labels/sun.c:264
+#, fuzzy, c-format
+msgid ""
+"The disk CHS geometry (%d,%d,%d) reported by the operating system does not "
+"match the geometry stored on the disk label (%d,%d,%d)."
+msgstr ""
+"La geometria del disc CHS (%d,%d,%d) no coincideix amb la geometria "
+"emmagatzemada a la etiqueta del disc (%d,%d,%d)."
+
+#: libparted/labels/sun.c:286
+#, c-format
+msgid "The disk label describes a disk bigger than %s."
+msgstr "La etiqueta del disc descriu un disc ms gran de %s."
+
+#: libparted/labels/sun.c:440
+#, c-format
+msgid "The disk has %d cylinders, which is greater than the maximum of 65536."
+msgstr ""
+
+#: libparted/labels/sun.c:736
+msgid ""
+"The Whole Disk partition is the only available one left. Generally, it is "
+"not a good idea to overwrite this partition with a real one. Solaris may "
+"not be able to boot without it, and SILO (the sparc boot loader) appreciates "
+"it as well."
+msgstr ""
+"La partici sencera de disk s la nica disponible que queda. Generalment, "
+"no s una bona idea sobreescriure aquesta partici amb una d'autntica. "
+"Solaris pot no ser capa d'arrencar sense ella i SILO ( el gestor "
+"d'arrencada d'sparc) tamb la t en compte."
+
+#: libparted/labels/sun.c:751
+msgid "Sun disk label is full."
+msgstr "La etiqueta del disc de Sun est plena."
+
+#: libparted/filesys.c:386
+msgid "Could not detect file system."
+msgstr "No s'ha pogut detectar el sistema de fitxers."
+
+#: libparted/filesys.c:397
+#, fuzzy
+msgid "The file system is bigger than its volume!"
+msgstr "El sistema de fitxers s ms gran que ho s el volum!"
+
+#: libparted/filesys.c:405
+#, c-format
+msgid "Support for opening %s file systems is not implemented yet."
+msgstr ""
+"El suport per obrir sistemes de fitxers de %s encara no est implementat."
+
+#: libparted/filesys.c:447
+#, c-format
+msgid "Support for creating %s file systems is not implemented yet."
+msgstr ""
+"El suport per crear sistemes de fitxers de %s encara no est implementat."
+
+#: libparted/filesys.c:508
+#, c-format
+msgid "Support for checking %s file systems is not implemented yet."
+msgstr ""
+"El suport per comprovar sistemes de fitxers de %s encara no est implementat."
+
+#: libparted/filesys.c:574
+msgid "raw block copying"
+msgstr "copiant bloc raw"
+
+#: libparted/filesys.c:585
+msgid "growing file system"
+msgstr "sistema de fitxers creixent"
+
+#: libparted/filesys.c:625
+msgid "Can't copy onto an overlapping partition."
+msgstr "No es pot copiar a una partici solapada."
+
+#: libparted/filesys.c:647
+#, fuzzy, c-format
+msgid ""
+"Direct support for copying file systems is not yet implemented for %s. "
+"However, support for resizing is implemented. Therefore, the file system "
+"can be copied if the new partition is at least as big as the old one. So, "
+"either shrink the partition you are trying to copy, or copy to a bigger "
+"partition."
+msgstr ""
+"Support directe per copiar sistemes de fitxers encara no ha estat "
+"implementada per %s. No obstant, si que est implementat el suport per el "
+"redimensionament. Per tant, el sistema de fitxers pot ser copiat si la nova "
+"partici s, com a mnim, tant gran com la antiga. Per tant, o es contrau la "
+"partici que es vol copiar o es copia a una partici ms gran."
+
+#: libparted/filesys.c:661
+#, c-format
+msgid "Support for copying %s file systems is not implemented yet."
+msgstr "Suport per copiar sistemes de fitxers %s encara no est implementat."
+
+#: libparted/filesys.c:699
+#, c-format
+msgid "Support for resizing %s file systems is not implemented yet."
+msgstr ""
+"El suport per redimensionar sistemes de fitxers de %s encara no est "
+"implementat."
+
+#: libparted/exception.c:78
+msgid "Information"
+msgstr "Informaci"
+
+#: libparted/exception.c:79
+msgid "Warning"
+msgstr "Perill"
+
+#: libparted/exception.c:80
+msgid "Error"
+msgstr "Error"
+
+#: libparted/exception.c:81
+msgid "Fatal"
+msgstr "Fatal"
+
+#: libparted/exception.c:82
+msgid "Bug"
+msgstr "Bug"
+
+#: libparted/exception.c:83
+msgid "No Implementation"
+msgstr "No Implementat"
+
+#: libparted/exception.c:87
+msgid "Fix"
+msgstr "Fix"
+
+#: libparted/exception.c:88
+msgid "Yes"
+msgstr "S"
+
+#: libparted/exception.c:89
+msgid "No"
+msgstr "No"
+
+#: libparted/exception.c:90
+msgid "OK"
+msgstr "D'accord"
+
+#: libparted/exception.c:91
+msgid "Retry"
+msgstr "Reintentar"
+
+#: libparted/exception.c:92
+msgid "Ignore"
+msgstr "Ignorar"
+
+#: libparted/exception.c:93
+msgid "Cancel"
+msgstr "Cancellar"
+
+#: libparted/exception.c:133
+#, fuzzy, c-format
+msgid ""
+"A bug has been detected in GNU Parted. Refer to the web site of parted "
+"http://www.gnu.org/software/parted/parted.html for more informations of what "
+"could be useful for bug submitting! Please email a bug report to bug-"
+"parted@gnu.org containing at least the version (%s) and the following "
+"message: "
+msgstr ""
+"S'ha detectat un bug a GNU Parted. Si-us-plau, envieu un e-mail a bug-"
+"parted@gnu.org que contingui la versi (%s) i el segent missatge:"
+
+#: libparted/cs/geom.c:162
+msgid "Can't have the end before the start!"
+msgstr "No es pot acabar abans de comenar!"
+
+#: libparted/cs/geom.c:169
+msgid "Can't have a partition outside the disk!"
+msgstr "No es pot fer una partici fora del disc!"
+
+#: libparted/cs/geom.c:303
+#, fuzzy, c-format
+msgid "Attempt to read sectors %ld-%ld outside of partition on %s."
+msgstr "S'ha intentat llegir sectors %ld-%ld fora de la partici a %s"
+
+#: libparted/cs/geom.c:373
+#, fuzzy, c-format
+msgid "Attempt to write sectors %ld-%ld outside of partition on %s."
+msgstr "S'ha intentat escriure sectors %ld-%ld fora de la partici a %s"
+
+#: libparted/cs/geom.c:413 libparted/fs/linux_swap/linux_swap.c:353
+msgid "checking for bad blocks"
+msgstr "comprovant blocs errnis"
+
+#: libparted/libparted.c:286 libparted/libparted.c:306
+msgid "Out of memory."
+msgstr "Sense memria."
+
+#: libparted/unit.c:139
+msgid "Cannot get unit size for special unit 'COMPACT'."
+msgstr ""
+
+#: libparted/unit.c:382
+#, c-format
+msgid "\"%s\" has invalid syntax for locations."
+msgstr ""
+
+#: libparted/unit.c:390
+#, c-format
+msgid "The maximum head value is %d."
+msgstr ""
+
+#: libparted/unit.c:397
+#, c-format
+msgid "The maximum sector value is %d."
+msgstr ""
+
+#: libparted/unit.c:409 libparted/unit.c:540
+#, c-format
+msgid "The location %s is outside of the device %s."
+msgstr ""
+
+#: libparted/unit.c:522
+msgid "Invalid number."
+msgstr ""
+
+#: libparted/fs/ext2/ext2.c:87 libparted/fs/ext2/ext2.c:112
+msgid "Inconsistent group descriptors!"
+msgstr "Grup de descriptors inconsistent!"
+
+#: libparted/fs/ext2/ext2.c:91 libparted/fs/ext2/ext2.c:116
+#, fuzzy
+msgid "File system full!"
+msgstr "Sistema de fitxers ple!"
+
+#: libparted/fs/ext2/ext2.c:750
+#, fuzzy
+msgid "Invalid superblock. Are you sure this is an ext2 file system?"
+msgstr "Superblock invlid. Segur que s un sistema de fitxers ext2?"
+
+#: libparted/fs/ext2/ext2.c:764 libparted/fs/ext2/ext2_resize.c:597
+#, fuzzy
+msgid "File system has errors! You should run e2fsck."
+msgstr "El sistema de fitxers t errors! Has d'executar e2fsck."
+
+#: libparted/fs/ext2/ext2.c:775
+#, fuzzy
+msgid ""
+"File system was not cleanly unmounted! You should run e2fsck. Modifying an "
+"unclean file system could cause severe corruption."
+msgstr ""
+"El sistema de fitxers no ha estat desmuntat correctament! S'ha d'executar "
+"e2fsck."
+
+#: libparted/fs/ext2/ext2.c:795
+#, fuzzy
+msgid "File system has an incompatible feature enabled."
+msgstr "El sistema de fitxers t una caracterstica incompatible activada"
+
+#: libparted/fs/ext2/ext2.c:806
+msgid "Error allocating buffer cache."
+msgstr "Error en la reserva de la memria cau de la memria intermdia"
+
+#: libparted/fs/ext2/ext2.c:848
+msgid ""
+"A resize operation on this file system will use EXPERIMENTAL code that MAY "
+"CORRUPT it (although it hasn't done so yet).You should at least backup your "
+"data and run 'e2fsck -f' afterwards."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:114
+#, fuzzy
+msgid ""
+"Found an inode with a incorrect link count. Better go run e2fsck first!"
+msgstr ""
+"S'ha trobat un inode amb un nmero d'enllaos incorrecte. Millor que primer "
+"s'executi e2fsck."
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:487
+msgid "Not enough free inodes!"
+msgstr "No hi ha suficients inodes lliures!"
+
+#: libparted/fs/ext2/ext2_resize.c:224
+#, fuzzy
+msgid "File system is too full to remove a group!"
+msgstr "El sistema de fitxers est massa ocupat a suprimir un grup!"
+
+#: libparted/fs/ext2/ext2_resize.c:233
+#, fuzzy
+msgid "File system has too many allocated inodes to remove a group!"
+msgstr "El sistema de fitxers t massa inodes reservats per suprimir un grup!"
+
+#: libparted/fs/ext2/ext2_resize.c:493
+msgid "adding groups"
+msgstr "afegint grups"
+
+#: libparted/fs/ext2/ext2_resize.c:530
+#, fuzzy, c-format
+msgid "Your file system is too full to resize it to %i blocks. Sorry."
+msgstr ""
+"El sistema de fitxers est massa ocupat en redimensionar-se a %i blocs.Ho "
+"sento."
+
+#: libparted/fs/ext2/ext2_resize.c:540
+#, fuzzy, c-format
+msgid ""
+"Your file system has too many occupied inodes to resize it to %i blocks. "
+"Sorry."
+msgstr ""
+"El sistema de fitxers t massa inodes ocupats per redimensionar-se a %i "
+"blocs.Ho sento."
+
+#: libparted/fs/ext2/ext2_resize.c:554 libparted/fs/hfs/hfs.c:243
+#: libparted/fs/hfs/hfs.c:624
+msgid "shrinking"
+msgstr "encongint"
+
+#: libparted/fs/ext2/ext2_resize.c:605
+#, fuzzy
+msgid "File system was not cleanly unmounted! You should run e2fsck."
+msgstr ""
+"El sistema de fitxers no ha estat desmuntat correctament! S'ha d'executar "
+"e2fsck."
+
+#: libparted/fs/ext2/ext2_resize.c:614
+msgid ""
+"The file system has the 'dir_index' feature enabled. Parted can only resize "
+"the file system if it disables this feature. You can enable it later by "
+"running 'tune2fs -O dir_index DEVICE' and then 'e2fsck -fD DEVICE'."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_block_relocator.c:198
+#, fuzzy
+msgid "Cross-linked blocks found! Better go run e2fsck first!"
+msgstr ""
+"S'ha trobat blocs amb enllaos creuats! Millor que primer s'executi e2fsck!"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:537
+#, fuzzy, c-format
+msgid "Block %i has no reference? Weird."
+msgstr "El bloc %i no t referncia? Extrany"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:738
+#, c-format
+msgid "Block %i shouldn't have been marked!"
+msgstr "El bloc %i no hauria d'estar marcat!"
+
+#: libparted/fs/ext2/interface.c:188
+#, fuzzy
+msgid ""
+"The ext2 file system passed a basic check. For a more comprehensive check, "
+"use the e2fsck program."
+msgstr ""
+"El sistema de fitxers ext2 ha passat una comprovaci bsica. Per una "
+"comprovaci ms completa utilitzar el programa e2fsck."
+
+#: libparted/fs/ext2/interface.c:205
+msgid "Sorry, can't move the start of ext2 partitions yet!"
+msgstr "Ho sento, no es pot moure encara el comenament de les particions ext2"
+
+#: libparted/fs/ext2/ext2_buffer.c:82
+msgid "Couldn't flush buffer cache!"
+msgstr "No s'ha pogut buidar la memria cau de la memria intermdia!"
+
+#: libparted/fs/ext2/ext2_mkfs.c:162
+msgid "writing per-group metadata"
+msgstr "escribint metadata per-grup"
+
+#: libparted/fs/ext2/ext2_mkfs.c:565
+msgid "File system too small for ext2."
+msgstr "Sistema de fitxers massa petit per ext2."
+
+#: libparted/fs/fat/calc.c:134
+#, fuzzy, c-format
+msgid ""
+"You need %s of free disk space to shrink this partition to this size. "
+"Currently, only %s is free."
+msgstr ""
+"Es necessiten %dM d'espai lliure per contraure aquesta partici a aquesta "
+"mida (actualment noms hi ha %dM lliures)"
+
+#: libparted/fs/fat/context.c:55
+#, c-format
+msgid ""
+"Cluster start delta = %d, which is not a multiple of the cluster size %d."
+msgstr ""
+"El comenament delta de cluster = %d, que no s multiple de la mida de "
+"cluster %d. "
+
+#: libparted/fs/fat/fat.c:312
+#, fuzzy, c-format
+msgid "Partition too big/small for a %s file system."
+msgstr "Partici massa gran/petita per un sistema de fitxers %s"
+
+#: libparted/fs/fat/fat.c:478
+msgid ""
+"The FATs don't match. If you don't know what this means, then select "
+"cancel, run scandisk on the file system, and then come back."
+msgstr ""
+"Les FATs no coincideixen. Si no saps qu vols dir aix, llavors selecciona "
+"cancelar, executa scandisk al sistema de fitxers, i desprs torna."
+
+#: libparted/fs/fat/fat.c:518
+msgid "There are no possible configurations for this FAT type."
+msgstr "No hi ha configuracions possibles per aquest tipus de FAT."
+
+#: libparted/fs/fat/fat.c:530
+#, c-format
+msgid ""
+"File system doesn't have expected sizes for Windows to like it. Cluster "
+"size is %dk (%dk expected); number of clusters is %d (%d expected); size of "
+"FATs is %d sectors (%d expected)."
+msgstr ""
+"El sistema de fitxers no t unes mides que agradin a Windows. La mida de "
+"clster es %dk (hauria de ser de %dk); el nmero de clsters s de %d "
+"(hauria de ser de %d); la mida de FAT s de %d sectors ( hauria de ser de %d "
+"sectors)."
+
+#: libparted/fs/fat/fat.c:553
+#, c-format
+msgid ""
+"File system is reporting the free space as %d clusters, not %d clusters."
+msgstr ""
+"El sistema de fitxers diu que la mida de l'espai lliure en clsters s de %"
+"d, no de %d clsters."
+
+#: libparted/fs/fat/fat.c:878
+#, fuzzy
+msgid ""
+"GNU Parted was miscompiled: the FAT boot sector should be 512 bytes. FAT "
+"support will be disabled."
+msgstr ""
+"GNU Parted va ser mal compilat: el sector boot de FAT ha de ser de 512 "
+"bytes. El suport per FAT ser desactivat."
+
+#: libparted/fs/fat/resize.c:158
+#, fuzzy
+msgid ""
+"There's not enough room in the root directory for all of the files. Either "
+"cancel, or ignore to lose the files."
+msgstr ""
+"No hi ha espai suficient al directori root, per a tots els fitxers. O b, "
+"cancellar, o b, Ignorar perdent els fitxers. "
+
+#: libparted/fs/fat/resize.c:299
+msgid "Error writing to the root directory."
+msgstr "Error escribint al directori root."
+
+#: libparted/fs/fat/resize.c:484
+#, fuzzy
+msgid "If you leave your file system as FAT16, then you will have no problems."
+msgstr ""
+"Si deixes el sistema de fitxers com FAT16, llavors no tindrs problemes"
+
+#: libparted/fs/fat/resize.c:487
+msgid ""
+"If you convert to FAT16, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual)."
+msgstr ""
+"Si converteixes a FAT16, i MS Windows est installat a aquesta partici, "
+"llavors haurs de reinstallar el carregador d'arrencada de MS Windows. Si "
+"vols fer aix, hauries de consultar el manual de Parted ( o el manual de la "
+"teva distribuci)."
+
+#: libparted/fs/fat/resize.c:495
+msgid ""
+"If you leave your file system as FAT32, then you will not introduce any new "
+"problems."
+msgstr ""
+"Si deixes el teu sistema de fitxers com a FAT32, llavors no tindrs ms "
+"problemes."
+
+#: libparted/fs/fat/resize.c:499
+msgid ""
+"If you convert to FAT32, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual). Also, "
+"converting to FAT32 will make the file system unreadable by MS DOS, MS "
+"Windows 95a, and MS Windows NT."
+msgstr ""
+"Si converteixes a FAT32, i MS Windows est installat a aquesta partici, "
+"llavors haurs de reinstallar el carregador d'arrencada de MS Windows. Si "
+"vols fer aix, hauries de consultar el manual de Parted ( o el manual de la "
+"teva distribuci). Tamb, convertint a FAT32 fars que MS DOS, MS Windows "
+"95a i Windows NT no puguin llegir el sistema de fitxers "
+
+#: libparted/fs/fat/resize.c:513
+#, c-format
+msgid "%s %s %s"
+msgstr "%s %s %s"
+
+#: libparted/fs/fat/resize.c:514
+msgid "Would you like to use FAT32?"
+msgstr "Vol fer servir FAT32?"
+
+#: libparted/fs/fat/resize.c:541 libparted/fs/fat/resize.c:557
+#, c-format
+msgid "%s %s"
+msgstr "%s %s"
+
+#: libparted/fs/fat/resize.c:542
+msgid ""
+"The file system can only be resized to this size by converting to FAT16."
+msgstr ""
+"El sistema de fitxers noms pot ser redimensionada a aquesta mida covertint-"
+"la a FAT16."
+
+#: libparted/fs/fat/resize.c:558
+msgid ""
+"The file system can only be resized to this size by converting to FAT32."
+msgstr ""
+"El sistema de fitxers noms pot ser redimensionada a aquesta mida covertint-"
+"la a FAT32."
+
+#: libparted/fs/fat/resize.c:571
+#, fuzzy
+msgid ""
+"GNU Parted cannot resize this partition to this size. We're working on it!"
+msgstr ""
+"GNU Parted no por redimensionar aquesta partici a aquesta mida. Estem "
+"treballant en aix!"
+
+#: libparted/fs/fat/bootsector.c:48 libparted/fs/fat/bootsector.c:55
+msgid "File system has an invalid signature for a FAT file system."
+msgstr ""
+"El sistema de fitxers t una signatura invlida per a un sistema de fitxers "
+"FAT."
+
+#: libparted/fs/fat/bootsector.c:62
+msgid "File system has an invalid sector size for a FAT file system."
+msgstr ""
+"El sistema de fitxers t una mida de sector invlida per a un sistema de "
+"fitxers FAT."
+
+#: libparted/fs/fat/bootsector.c:69
+#, fuzzy
+msgid "File system has an invalid cluster size for a FAT file system."
+msgstr ""
+"El sistema de fitxers t una mida de sector invlida per a un sistema de "
+"fitxers FAT."
+
+#: libparted/fs/fat/bootsector.c:76
+#, fuzzy
+msgid ""
+"File system has an invalid number of reserved sectors for a FAT file system."
+msgstr ""
+"El sistema de fitxers t un nmero de sectors reservats per a un sistema de "
+"fitxers FAT."
+
+#: libparted/fs/fat/bootsector.c:83
+#, fuzzy
+msgid "File system has an invalid number of FATs."
+msgstr "El sistema de fitxers t un nmero de FATS invlid."
+
+#: libparted/fs/fat/bootsector.c:138
+#, c-format
+msgid ""
+"This file system has a logical sector size of %d. GNU Parted is known not "
+"to work properly with sector sizes other than 512 bytes."
+msgstr ""
+"Aquest sistema de fitxers t una mida de sector lgic de %d. GNU Parted no "
+"treballar correctament amb mides de sectors diferents de 512 bytes."
+
+#: libparted/fs/fat/bootsector.c:163
+#, c-format
+msgid ""
+"The file system's CHS geometry is (%d, %d, %d), which is invalid. The "
+"partition table's CHS geometry is (%d, %d, %d). If you select Ignore, the "
+"file system's CHS geometry will be left unchanged. If you select Fix, the "
+"file system's CHS geometry will be set to match the partition table's CHS "
+"geometry."
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:209
+msgid "FAT boot sector says logical sector size is 0. This is weird. "
+msgstr ""
+"El sector boot de la FAT diu que la mida del sector lgic s 0. Aix s "
+"extrany."
+
+#: libparted/fs/fat/bootsector.c:215
+msgid "FAT boot sector says there are no FAT tables. This is weird. "
+msgstr ""
+"El sector boot de la FAT diu que no hi ha taules FAT. Aix s extrany."
+
+#: libparted/fs/fat/bootsector.c:221
+msgid "FAT boot sector says clusters are 0 sectors. This is weird. "
+msgstr ""
+"El sector boot de la FAT diu que els clsters tenen 0 sectors. Aix s "
+"extrany."
+
+#: libparted/fs/fat/bootsector.c:231
+#, fuzzy
+msgid "File system is FAT12, which is unsupported."
+msgstr "El sistema de fitxers s FAT12, que no est suportat."
+
+#: libparted/fs/fat/bootsector.c:407
+#, c-format
+msgid ""
+"The information sector has the wrong signature (%x). Select cancel for now, "
+"and send in a bug report. If you're desperate, it's probably safe to ignore."
+msgstr ""
+"El sector d'informaci t una signatura incorrecta (%x). Selecciona "
+"cancella ara mateix, i envia-ns un informe. Si estas desesperat, el ms "
+"segur s Ignorar."
+
+#: libparted/fs/fat/count.c:149
+#, c-format
+msgid "Bad directory entry for %s: first cluster is the end of file marker."
+msgstr ""
+"Entrada de directori incorrecta per %s: el primer clster s el final de la "
+"marca de fitxer."
+
+#: libparted/fs/fat/count.c:162
+#, c-format
+msgid ""
+"Bad FAT: unterminated chain for %s. You should run dosfsck or scandisk."
+msgstr ""
+"FAT incorrecta: cadena sense acabar per %s. Has de executar dosfsck o "
+"scandisk."
+
+#: libparted/fs/fat/count.c:171
+#, fuzzy, c-format
+msgid ""
+"Bad FAT: cluster %d outside file system in chain for %s. You should run "
+"dosfsck or scandisk."
+msgstr ""
+"FAT incorrecta: clster %d fora del sistema de fitxers a la cadena per %s. "
+"Has de executar dosfsck o scandisk."
+
+#: libparted/fs/fat/count.c:181
+#, c-format
+msgid ""
+"Bad FAT: cluster %d is cross-linked for %s. You should run dosfsck or "
+"scandisk."
+msgstr ""
+"FAT incorrecta: clster %d t un enlla creuat per %s. Has d'executar "
+"dosfsck o scandisk."
+
+#: libparted/fs/fat/count.c:200
+#, fuzzy, c-format
+msgid "%s is %dk, but it has %d clusters (%dk)."
+msgstr "%s s %dk, per t %d clsters (%dk)."
+
+#: libparted/fs/fat/count.c:263
+#, c-format
+msgid ""
+"The file %s is marked as a system file. This means moving it could cause "
+"some programs to stop working."
+msgstr ""
+"El fitxer %s est marcat com un sistema de fitxers. Aix vol dir que si el "
+"moveu por ocasionar que alguns programes no funcionin."
+
+#: libparted/fs/fat/table.c:138
+#, c-format
+msgid ""
+"FAT %d media %x doesn't match the boot sector's media %x. You should "
+"probably run scandisk."
+msgstr ""
+"La FAT %d del medi %x no coincideix amb sector boot del medi %x. Hauries "
+"d'executar scandisk."
+
+#: libparted/fs/fat/table.c:268
+#, fuzzy, c-format
+msgid "fat_table_set: cluster %ld outside file system"
+msgstr "fat_table_set: clster %ld fora del sistema de fitxers"
+
+#: libparted/fs/fat/table.c:296
+#, fuzzy, c-format
+msgid "fat_table_get: cluster %ld outside file system"
+msgstr "fat_table_get: clster %ld fora del sistema de fitxers"
+
+#: libparted/fs/fat/table.c:334
+msgid "fat_table_alloc_cluster: no free clusters"
+msgstr "fat_table_alloc_cluster: no hi ha clsters lliures"
+
+#: libparted/fs/linux_swap/linux_swap.c:236
+#, c-format
+msgid "Unrecognised linux swap signature '%10s'."
+msgstr "Signatura de linux swap '%10s' no reconeguda."
+
+#: libparted/fs/linux_swap/linux_swap.c:312
+msgid "Too many bad pages."
+msgstr "Massa pgines incorrectes."
+
+#: libparted/fs/hfs/advfs.c:123 libparted/fs/hfs/advfs_plus.c:125
+#: libparted/fs/hfs/reloc.c:416 libparted/fs/hfs/reloc.c:510
+#: libparted/fs/hfs/reloc_plus.c:541 libparted/fs/hfs/reloc_plus.c:660
+#: libparted/fs/hfs/reloc_plus.c:774
+msgid "The file system contains errors."
+msgstr ""
+
+#: libparted/fs/hfs/advfs_plus.c:290
+msgid "Bad blocks could not be read."
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:139
+#, c-format
+msgid ""
+"Trying to register an extent starting at block 0x%X, but another one already "
+"exists at this position. You should check the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:216
+#, c-format
+msgid ""
+"Trying to move an extent from block Ox%X to block Ox%X, but another one "
+"already exists at this position. This should not happen!"
+msgstr ""
+
+#: libparted/fs/hfs/file.c:145
+#, c-format
+msgid "Could not update the extent cache for HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:182
+#, c-format
+msgid "Trying to read HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:192 libparted/fs/hfs/file.c:222
+#, c-format
+msgid "Could not find sector %lli of HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:212
+#, c-format
+msgid "Trying to write HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:159
+#, c-format
+msgid "Could not update the extent cache for HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:203
+#, c-format
+msgid "Trying to read HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:214 libparted/fs/hfs/file_plus.c:256
+#, c-format
+msgid "Could not find sector %lli of HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:245
+#, c-format
+msgid "Trying to write HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:225
+msgid "Sorry, HFS cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:255 libparted/fs/hfs/hfs.c:636
+msgid "Data relocation has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:274
+msgid "Data relocation left some data in the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:313
+#, fuzzy
+msgid "writing HFS Master Directory Block"
+msgstr "Error escribint al directori root."
+
+#: libparted/fs/hfs/hfs.c:461
+msgid "No valid HFS[+X] signature has been found while opening."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:471
+#, c-format
+msgid "Version %d of HFS+ isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:482
+#, c-format
+msgid "Version %d of HFSX isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:667
+msgid "Data relocation left some data at the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:715
+#, fuzzy
+msgid "Error while writing the allocation file."
+msgstr "Error escribint al directori root."
+
+#: libparted/fs/hfs/hfs.c:730
+msgid "Error while writing the compatibility part of the allocation file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:745
+msgid "writing HFS+ Volume Header"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:845
+msgid "An error occurred while looking for the mandatory bad blocks file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:899
+msgid ""
+"It seems there is an error in the HFS wrapper: the bad blocks file doesn't "
+"contain the embedded HFS+ volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:930
+msgid "Sorry, HFS+ cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:965
+msgid "shrinking embedded HFS+ volume"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:981
+msgid "Resizing the HFS+ volume has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:988
+#, fuzzy
+msgid "shrinking HFS wrapper"
+msgstr "encongint"
+
+#: libparted/fs/hfs/hfs.c:997
+msgid "Updating the HFS wrapper has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:1099 libparted/fs/hfs/hfs.c:1184
+#, c-format
+msgid ""
+"This is not a real %s check. This is going to extract special low level "
+"files for debugging purposes."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:156
+msgid "Bad block list header checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:169
+#, c-format
+msgid ""
+"Invalid size of a transaction block while replaying the journal (%i bytes)."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:261
+msgid ""
+"Journal stored outside of the volume are not supported. Try to desactivate "
+"the journal and run Parted again."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:272
+#, fuzzy
+msgid "Journal offset or size is not multiple of the sector size."
+msgstr ""
+"El comenament delta de cluster = %d, que no s multiple de la mida de "
+"cluster %d. "
+
+#: libparted/fs/hfs/journal.c:290
+msgid "Incorrect magic values in the journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:299
+msgid "Journal size mismatch between journal info block and journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:311
+#, fuzzy
+msgid "Some header fields are not multiple of the sector size."
+msgstr ""
+"El comenament delta de cluster = %d, que no s multiple de la mida de "
+"cluster %d. "
+
+#: libparted/fs/hfs/journal.c:320
+msgid ""
+"The sector size stored in the journal is not 512 bytes. Parted only "
+"supports 512 bytes length sectors."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:332
+msgid "Bad journal checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:350
+msgid ""
+"The journal is not empty. Parted must replay the transactions before "
+"opening the file system. This will modify the file system."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:378
+msgid ""
+"The volume header or the master directory block has changed while replaying "
+"the journal. You should restart Parted."
+msgstr ""
+
+#: libparted/fs/hfs/probe.c:52
+#, c-format
+msgid ""
+"Parted can't use HFS file systems on disks with a sector size not equal to %"
+"d bytes."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:153 libparted/fs/hfs/reloc_plus.c:157
+msgid "An extent has not been relocated."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:253 libparted/fs/hfs/reloc_plus.c:309
+msgid ""
+"A reference to an extent comes from a place it should not. You should check "
+"the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:383
+msgid "This HFS volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:477
+msgid "This HFS volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:519 libparted/fs/hfs/reloc_plus.c:670
+msgid ""
+"The extents overflow file should not contain its own extents! You should "
+"check the file system."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:576 libparted/fs/hfs/reloc_plus.c:849
+#, fuzzy
+msgid "Could not cache the file system in memory."
+msgstr "No s'ha pogut detectar el sistema de fitxers."
+
+#: libparted/fs/hfs/reloc.c:637 libparted/fs/hfs/reloc_plus.c:910
+msgid "Bad blocks list could not be loaded."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:651 libparted/fs/hfs/reloc_plus.c:926
+msgid "An error occurred during extent relocation."
+msgstr ""
+
+#: libparted/fs/hfs/reloc_plus.c:497
+msgid "This HFS+ volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc_plus.c:621
+msgid "This HFS+ volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: parted/parted.c:76
+msgid "displays this help message"
+msgstr "mostra aquest missatge d'ajuda"
+
+#: parted/parted.c:77
+msgid "where necessary, prompts for user intervention"
+msgstr "quan s necessari, pregunta a l'usuari"
+
+#: parted/parted.c:78
+msgid "never prompts for user intervention"
+msgstr "mai pregunta a l'usuari"
+
+#: parted/parted.c:79
+msgid "displays the version"
+msgstr "mostra la versi"
+
+#: parted/parted.c:87
+#, fuzzy
+msgid ""
+"NUMBER is the partition number used by Linux. On MS-DOS disk labels, the "
+"primary partitions number from 1 to 4, logical partitions from 5 onwards.\n"
+msgstr ""
+"MINOR s el nmero de partici utilitzada per Linux. A etiquetes de disk "
+"msdos, les particions primries sn numeradas de 1 a 4, i les particions "
+"lgiques de la 5 en davant.\n"
+
+#: parted/parted.c:90
+msgid "LABEL-TYPE is one of: "
+msgstr "TIPUS-ETI s una d'aquestes: "
+
+#: parted/parted.c:91
+msgid "FLAG is one of: "
+msgstr "FLAG s una d'aquests:"
+
+#: parted/parted.c:92
+#, fuzzy
+msgid "UNIT is one of: "
+msgstr "FLAG s una d'aquests:"
+
+#: parted/parted.c:93
+msgid "PART-TYPE is one of: primary, logical, extended\n"
+msgstr "TIPUS-PART s una d'aquestes: primria, lgica, extesa\n"
+
+#: parted/parted.c:95
+msgid "FS-TYPE is one of: "
+msgstr "TIPUS-SF s un d'aquests: "
+
+#: parted/parted.c:96
+msgid ""
+"START and END are disk locations, such as 4GB or 10%. Negative values count "
+"from the end of the disk. For example, -1s specifies exactly the last "
+"sector.\n"
+msgstr ""
+
+#: parted/parted.c:99
+msgid "STATE is one of: on, off\n"
+msgstr "ESTAT s un d'aquests: on, off\n"
+
+#: parted/parted.c:100
+msgid "DEVICE is usually /dev/hda or /dev/sda\n"
+msgstr "DISPOS s, normalment, /dev/hda o /dev/sda\n"
+
+#: parted/parted.c:101
+msgid "NAME is any word you want\n"
+msgstr "NOM s qualsevol paraula que vulguis\n"
+
+#: parted/parted.c:102
+msgid "The partition must have one of the following FS-TYPEs: "
+msgstr ""
+
+#: parted/parted.c:105
+msgid "GNU Parted Version information:\n"
+msgstr ""
+
+#: parted/parted.c:107
+#, fuzzy
+msgid ""
+"Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n"
+"This program is free software, covered by the GNU General Public License.\n"
+"\n"
+"This program is distributed in the hope that it will be useful, but WITHOUT "
+"ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
+"FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
+"more details.\n"
+"\n"
+msgstr ""
+"Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.\n"
+"Aquest programa s programari obert sota Llicncia Pblica General GNU.\n"
+"\n"
+"Aquest programa es distribueix en la esperana que sigui til, per SENSE "
+"CAP GARANTIA; sense la garantia implcita de COMERCIALITZACIO ni que "
+"CUMPLEIXI CAP PROPOSIT PARTICULAR. Per ms detalls, vegeu la Llicncia "
+"General Pblica GNU.\n"
+"\n"
+
+#: parted/parted.c:152
+#, c-format
+msgid "%0.f%%\t(time left %.2d:%.2d)"
+msgstr "%0.f%%\t(temps que queda %.2d:%.2d)"
+
+#: parted/parted.c:170
+#, c-format
+msgid ""
+"Partition %s is being used. You must unmount it before you modify it with "
+"Parted."
+msgstr ""
+
+#: parted/parted.c:187
+#, c-format
+msgid "Partition(s) on %s are being used."
+msgstr "La(s) partici(ns) a %s s'est utilitzant."
+
+#: parted/parted.c:413 parted/parted.c:594 parted/parted.c:979
+#: parted/parted.c:1059 parted/parted.c:1586 parted/parted.c:1663
+#: parted/parted.c:1707
+msgid "Partition number?"
+msgstr "Nmero de partici?"
+
+#: parted/parted.c:456
+msgid "Source device?"
+msgstr "Dispositiu d'origen?"
+
+#: parted/parted.c:460
+msgid "Source partition number?"
+msgstr "Nmero de partici d'origen?"
+
+#: parted/parted.c:465
+#, fuzzy
+msgid "Can't copy an extended partition."
+msgstr "No es poden copiar particions exteses."
+
+#: parted/parted.c:471
+msgid "Destination partition number?"
+msgstr "Nmero de partici dest?"
+
+#: parted/parted.c:564
+msgid "New disk label type?"
+msgstr "Nou tipus d'etiqueta?"
+
+#: parted/parted.c:598
+msgid "File system?"
+msgstr "Sistema de fitxers?"
+
+#: parted/parted.c:645 parted/parted.c:815
+msgid "Partition type?"
+msgstr "Tipus de partici?"
+
+#: parted/parted.c:652 parted/parted.c:822 parted/parted.c:1062
+msgid "Partition name?"
+msgstr "Nom de la partici?"
+
+#: parted/parted.c:660 parted/parted.c:832
+msgid "File system type?"
+msgstr "Sistema de fitxers?"
+
+#: parted/parted.c:667 parted/parted.c:834 parted/parted.c:994
+#: parted/parted.c:1544 parted/parted.c:1595
+msgid "Start?"
+msgstr "Inici?"
+
+#: parted/parted.c:669 parted/parted.c:837 parted/parted.c:997
+#: parted/parted.c:1546 parted/parted.c:1597
+msgid "End?"
+msgstr "Fi?"
+
+#: parted/parted.c:707 parted/parted.c:875
+#, fuzzy, c-format
+msgid ""
+"You requested a partition from %s to %s.\n"
+"The closest location we can manage is %s to %s. Is this still acceptable to "
+"you?"
+msgstr ""
+"Has demanat de moure una partici a %.3f-%.3fMb. El ms proper que Parted "
+"pot manegar s %.3f-%.3fMb."
+
+#: parted/parted.c:827
+#, fuzzy
+msgid "An extended partition cannot hold a file system. Did you want mkpart?"
+msgstr ""
+"Les particions exteses no poden tenir sistemes de fitxers. Voleu executar "
+"mkpart?"
+
+#: parted/parted.c:985
+#, fuzzy
+msgid "Can't move an extended partition."
+msgstr "No es poden moure particions exteses"
+
+#: parted/parted.c:1014
+msgid "Can't move a partition onto itself. Try using resize, perhaps?"
+msgstr ""
+"No es por moure una partici a ella mateixa. Vols redimensionar-la, potser?"
+
+#: parted/parted.c:1158
+#, c-format
+msgid "Minor: %d\n"
+msgstr "Minor: %d\n"
+
+#: parted/parted.c:1159
+#, fuzzy, c-format
+msgid "Flags: %s\n"
+msgstr "Flags:"
+
+#: parted/parted.c:1160
+#, c-format
+msgid "File System: %s\n"
+msgstr "Sistema de fitxers:%s\n"
+
+#: parted/parted.c:1161
+#, fuzzy, c-format
+msgid "Size: "
+msgstr "Mida: %10.3fMb (%d%%)\n"
+
+#: parted/parted.c:1166
+#, fuzzy, c-format
+msgid "Minimum size: "
+msgstr "Mida mnima: %10.3fMb (%d%%)\n"
+
+#: parted/parted.c:1169
+#, fuzzy, c-format
+msgid "Maximum size: "
+msgstr "Mida mxima: %10.3fMb (%d%%)\n"
+
+#: parted/parted.c:1255
+#, fuzzy, c-format
+msgid "Disk %s: %s\n"
+msgstr "%s %s %s"
+
+#: parted/parted.c:1256
+#, c-format
+msgid "Sector size (logical/physical): %lldB/%lldB\n"
+msgstr ""
+
+#: parted/parted.c:1267
+#, c-format
+msgid "BIOS cylinder,head,sector geometry: %d,%d,%d. Each cylinder is %s.\n"
+msgstr ""
+
+#: parted/parted.c:1273
+#, fuzzy, c-format
+msgid "Partition Table: %s\n"
+msgstr "Nom de la partici?"
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Number"
+msgstr ""
+
+#: parted/parted.c:1284 parted/parted.c:1287
+#, fuzzy
+msgid "Start"
+msgstr "Inici?"
+
+#: parted/parted.c:1285 parted/parted.c:1288
+#, fuzzy
+msgid "End"
+msgstr "Fi?"
+
+#: parted/parted.c:1288
+#, fuzzy
+msgid "Size"
+msgstr "resize"
+
+#: parted/parted.c:1292
+msgid "Type"
+msgstr ""
+
+#: parted/parted.c:1294
+#, fuzzy
+msgid "File system"
+msgstr "Sistema de fitxers?"
+
+#: parted/parted.c:1297
+#, fuzzy
+msgid "Name"
+msgstr "name"
+
+#: parted/parted.c:1299
+msgid "Flags"
+msgstr "Flags"
+
+#: parted/parted.c:1352
+msgid "Free Space"
+msgstr ""
+
+#: parted/parted.c:1441
+#, fuzzy, c-format
+msgid ""
+"A %s %s partition was found at %s -> %s. Do you want to add it to the "
+"partition table?"
+msgstr ""
+"Una partici %s %s ha estat trobada a %.3fMb -> %.3fMb. Vols afegir-la a la "
+"taula de particions?"
+
+#: parted/parted.c:1479
+#, fuzzy
+msgid "searching for file systems"
+msgstr "sistema de fitxers creixent"
+
+#: parted/parted.c:1684
+msgid "New device?"
+msgstr "Nou dispositiu?"
+
+#: parted/parted.c:1709
+#, fuzzy
+msgid "Flag to Invert?"
+msgstr "Flag a canviar?"
+
+#: parted/parted.c:1714
+msgid "New state?"
+msgstr "Nou estat?"
+
+#: parted/parted.c:1747
+msgid "Unit?"
+msgstr ""
+
+#: parted/parted.c:1896
+msgid "check"
+msgstr "comprova"
+
+#: parted/parted.c:1899
+#, fuzzy
+msgid ""
+"check NUMBER do a simple check on the file system"
+msgstr ""
+"comprova MINOR fa una simple comprovaci al sistema de "
+"fitxers"
+
+#: parted/parted.c:1905
+msgid "cp"
+msgstr "cp"
+
+#: parted/parted.c:1908
+#, fuzzy
+msgid ""
+"cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another "
+"partition"
+msgstr ""
+"cp [DESDE-DISPOS] DE-MINOR A-MINOR copia un sistema de fitxers a una "
+"altra partici"
+
+#: parted/parted.c:1914
+msgid "help"
+msgstr "ajuda"
+
+#: parted/parted.c:1917
+#, fuzzy
+msgid ""
+"help [COMMAND] prints general help, or help on "
+"COMMAND"
+msgstr "Ajuda [ORDRE] imprimeix ajuda general, o ajuda d'ORDRE"
+
+#: parted/parted.c:1923
+msgid "mklabel"
+msgstr "mklabel"
+
+#: parted/parted.c:1926
+#, fuzzy
+msgid ""
+"mklabel LABEL-TYPE create a new disklabel (partition "
+"table)"
+msgstr ""
+"mklabel TIPUS-ETI crea una nova etiqueta de disc (taula de partici)"
+
+#: parted/parted.c:1932
+msgid "mkfs"
+msgstr "mkfs"
+
+#: parted/parted.c:1935
+#, fuzzy
+msgid ""
+"mkfs NUMBER FS-TYPE make a FS-TYPE file system on "
+"partititon NUMBER"
+msgstr ""
+"mkfs MINOR TIPUS-SF crea un sistema de fitxers TIPUS-SF a la partici "
+"MINOR"
+
+#: parted/parted.c:1941
+msgid "mkpart"
+msgstr "mkpart"
+
+#: parted/parted.c:1944
+#, fuzzy
+msgid "mkpart PART-TYPE [FS-TYPE] START END make a partition"
+msgstr "mkpart TIPUS-PART [TIPUS-SF] INICI FI crea una partici"
+
+#: parted/parted.c:1950
+msgid ""
+"mkpart makes a partition without creating a new file system on the "
+"partition. FS-TYPE may be specified to set an appropriate partition ID.\n"
+msgstr ""
+"mkpart crea una partici sense crear cap sistema de fitxers a la partici. "
+"TIPUS-SF ha de ser especificat per assignar una ID de partici.\n"
+
+#: parted/parted.c:1955
+msgid "mkpartfs"
+msgstr "mkpartfs"
+
+#: parted/parted.c:1958
+#, fuzzy
+msgid ""
+"mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system"
+msgstr ""
+"mkpartfs TIPUS-PART TIPUS-SF INICI FI crea una partici amb un sistema "
+"de fitxers"
+
+#: parted/parted.c:1964
+msgid "move"
+msgstr "move"
+
+#: parted/parted.c:1967
+#, fuzzy
+msgid "move NUMBER START END move partition NUMBER"
+msgstr "move MINOR INICI FI mou la partici MINOR"
+
+#: parted/parted.c:1972
+msgid "name"
+msgstr "name"
+
+#: parted/parted.c:1975
+#, fuzzy
+msgid "name NUMBER NAME name partition NUMBER as NAME"
+msgstr "name MINOR NOM anomena la partici MINOR NOM"
+
+#: parted/parted.c:1980
+msgid "print"
+msgstr "print"
+
+#: parted/parted.c:1983
+#, fuzzy
+msgid ""
+"print [free|NUMBER|all] display the partition table, a "
+"partition, or all devices"
+msgstr ""
+"print[MINOR] mostra la taula de particions; o una partici"
+
+#: parted/parted.c:1987
+msgid ""
+"Without arguments, print displays the entire partition table. With 'free'\n"
+"argument, information about free space will be displayed otherwise if a\n"
+"partition number is given, then more detailed information is displayed\n"
+"about that partition. If the 'all' argument is passed instead, partition\n"
+"information for all devices will be displayed."
+msgstr ""
+
+#: parted/parted.c:1995
+msgid "quit"
+msgstr "quit"
+
+#: parted/parted.c:1998
+#, fuzzy
+msgid "quit exit program"
+msgstr "quit surt del programa"
+
+#: parted/parted.c:2003
+msgid "rescue"
+msgstr "rescatar"
+
+#: parted/parted.c:2006
+#, fuzzy
+msgid ""
+"rescue START END rescue a lost partition near START "
+"and END"
+msgstr "rescatar INICI FI rescata particions perdudes entre INICI i FI"
+
+#: parted/parted.c:2012
+msgid "resize"
+msgstr "resize"
+
+#: parted/parted.c:2015
+#, fuzzy
+msgid ""
+"resize NUMBER START END resize partition NUMBER and its "
+"file system"
+msgstr ""
+"resize MINOR INICI FI redimensiona el sistema de fitxers a la "
+"partici MINOR"
+
+#: parted/parted.c:2023
+msgid "rm"
+msgstr "rm"
+
+#: parted/parted.c:2026
+#, fuzzy
+msgid "rm NUMBER delete partition NUMBER"
+msgstr "rm MINOR suprimeix la partici MINOR"
+
+#: parted/parted.c:2031
+msgid "select"
+msgstr "select"
+
+#: parted/parted.c:2034
+#, fuzzy
+msgid "select DEVICE choose the device to edit"
+msgstr "select DISPOSITIU escollir el dispositiu a editar"
+
+#: parted/parted.c:2039
+msgid "set"
+msgstr "set"
+
+#: parted/parted.c:2042
+#, fuzzy
+msgid ""
+"set NUMBER FLAG STATE change the FLAG on partition NUMBER"
+msgstr "rm MINOR suprimeix la partici MINOR"
+
+#: parted/parted.c:2048
+msgid "toggle"
+msgstr ""
+
+#: parted/parted.c:2051
+#, fuzzy
+msgid ""
+"toggle [NUMBER [FLAG]] toggle the state of FLAG on "
+"partition NUMBER"
+msgstr "rm MINOR suprimeix la partici MINOR"
+
+#: parted/parted.c:2057
+#, fuzzy
+msgid "unit"
+msgstr "quit"
+
+#: parted/parted.c:2060
+#, fuzzy
+msgid "unit UNIT set the default unit to UNIT"
+msgstr "quit surt del programa"
+
+#: parted/parted.c:2065
+msgid "version"
+msgstr ""
+
+#: parted/parted.c:2068
+msgid ""
+"version displays the current version of GNU "
+"Parted and copyright information"
+msgstr ""
+
+#: parted/parted.c:2072
+msgid ""
+"version displays copyright and version information corressponding to this "
+"copy of GNU Parted\n"
+msgstr ""
+
+#: parted/parted.c:2158
+msgid "No device found"
+msgstr "No s'ha trobat el dispositiu"
+
+#: parted/parted.c:2222
+msgid "Don't forget to update /etc/fstab, if necessary.\n"
+msgstr "No us oblideu d'actualitzar /etc/fstab si cal.\n"
+
+#: parted/ui.c:68
+msgid "Welcome to GNU Parted! Type 'help' to view a list of commands.\n"
+msgstr ""
+
+#: parted/ui.c:71
+#, fuzzy
+msgid ""
+"Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]\n"
+"Apply COMMANDs with PARAMETERS to DEVICE. If no COMMAND(s) are given, run "
+"in\n"
+"interactive mode.\n"
+msgstr ""
+"s: parted [OPCI]... [DISPOSITIU [ORDRE [PARAMETRES]...]...]\n"
+"Aplica les ORDRES amb PARAMETRES al DISPOSITIU. Si no s'especifiquen "
+"ORDRES, s'executa en\n"
+"mode interactiu.\n"
+
+#: parted/ui.c:76
+#, c-format
+msgid ""
+"\n"
+"\n"
+"You found a bug in GNU Parted! Here's what you have to do:\n"
+"\n"
+"Don't panic! The bug has most likely not affected any of your data.\n"
+"Help us to fix this bug by doing the following:\n"
+"\n"
+"Check whether the bug has already been fixed by checking\n"
+"the last version of GNU Parted that you can find at:\n"
+"\n"
+"\thttp://ftp.gnu.org/gnu/parted/\n"
+"\n"
+"Please check this version prior to bug reporting.\n"
+"\n"
+"If this has not been fixed yet or if you don't know how to check,\n"
+"please visit the GNU Parted website:\n"
+"\n"
+"\thttp://www.gnu.org/software/parted\n"
+"\n"
+"for further information.\n"
+"\n"
+"Your report should contain the version of this release (%s)\n"
+"along with the error message below, the output of\n"
+"\n"
+"\tparted DEVICE unit co print unit s print\n"
+"\n"
+"and additional information about your setup you consider important.\n"
+msgstr ""
+
+#: parted/ui.c:230
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_MAPERR (Address not mapped to object)"
+msgstr ""
+
+#: parted/ui.c:235
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_ACCERR (Invalid permissions for mapped object)"
+msgstr ""
+
+#: parted/ui.c:240
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGSEGV signal was encountered."
+msgstr ""
+
+#: parted/ui.c:258
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTDIV (Integer: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:262
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTOVF (Integer: overflow)"
+msgstr ""
+
+#: parted/ui.c:266
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTDIV (Float: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:270
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTOVF (Float: overflow)"
+msgstr ""
+
+#: parted/ui.c:274
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTUND (Float: underflow)"
+msgstr ""
+
+#: parted/ui.c:278
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTRES (Float: inexact result)"
+msgstr ""
+
+#: parted/ui.c:282
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTINV (Float: invalid operation)"
+msgstr ""
+
+#: parted/ui.c:286
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTSUB (Float: subscript out of range)"
+msgstr ""
+
+#: parted/ui.c:291
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGFPE signal was encountered."
+msgstr ""
+
+#: parted/ui.c:310
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPC (Illegal Opcode)"
+msgstr ""
+
+#: parted/ui.c:314
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPN (Illegal Operand)"
+msgstr ""
+
+#: parted/ui.c:318
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLADR (Illegal addressing mode)"
+msgstr ""
+
+#: parted/ui.c:323
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLTRP (Illegal Trap)"
+msgstr ""
+
+#: parted/ui.c:327
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVOPC (Privileged Opcode)"
+msgstr ""
+
+#: parted/ui.c:331
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVREG (Privileged Register)"
+msgstr ""
+
+#: parted/ui.c:335
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_COPROC (Coprocessor Error)"
+msgstr ""
+
+#: parted/ui.c:339
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_BADSTK (Internal Stack Error)"
+msgstr ""
+
+#: parted/ui.c:343
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGILL signal was encountered."
+msgstr ""
+
+#: parted/ui.c:828
+msgid "Expecting a partition number."
+msgstr "S'esperava un mmero de partici."
+
+#: parted/ui.c:837
+msgid "Partition doesn't exist."
+msgstr "La partici no existeix."
+
+#: parted/ui.c:857
+msgid "Expecting a file system type."
+msgstr "S'esperava un tipus de sistema de fitxers."
+
+#: parted/ui.c:863
+#, c-format
+msgid "Unknown file system type \"%s\"."
+msgstr "Tipus de sistema de fitxers desconegut \"%s\"."
+
+#: parted/ui.c:883
+msgid "Expecting a disk label type."
+msgstr "S'esperava un tipus de etiqueta de dics."
+
+#: parted/ui.c:977
+msgid "Can't create any more partitions."
+msgstr "No es pot crear cap ms partici."
+
+#: parted/ui.c:987
+msgid "Expecting a partition type."
+msgstr "S'esperava un tipus de partici."
+
+#: parted/ui.c:1115
+msgid "on"
+msgstr "on"
+
+#: parted/ui.c:1116
+msgid "off"
+msgstr "off"
+
+#: parted/ui.c:1227
+msgid "OPTIONs:"
+msgstr "OPCIONS:"
+
+#: parted/ui.c:1230
+msgid "COMMANDs:"
+msgstr "ORDRES:"
+
+#: parted/ui.c:1238
+#, c-format
+msgid "Using %s\n"
+msgstr "Utilitzant %s\n"
+
+#, fuzzy
+#~ msgid ""
+#~ "This ext2 file system has a rather strange layout! Parted can't resize "
+#~ "this (yet)."
+#~ msgstr ""
+#~ "Aquest sistema de fitxers ext2 t un disseny bastant extrany! Parted "
+#~ "(encara) no el pot redimensionar."
+
+#~ msgid "IDE"
+#~ msgstr "IDE"
+
+#, fuzzy
+#~ msgid "Disk geometry for %s: %s - %s\n"
+#~ msgstr "La geometria del disc per %s: 0.000-%.3f megabytes\n"
+
+#~ msgid "Disk label type: %s\n"
+#~ msgstr "Tipus d'etiqueta: %s\n"
+
+#, fuzzy
+#~ msgid "set NUMBER FLAG STATE change a flag on partition NUMBER"
+#~ msgstr "set MINOR FLAG ESTAT canvia un flag a la partici MINOR"
+
+#, fuzzy
+#~ msgid ""
+#~ "The sector size on %s is %d bytes. Parted is known not to work properly "
+#~ "with drives with sector sizes other than %d bytes."
+#~ msgstr ""
+#~ "La mida del sector a %s s de %d bytes. Parted no funcionar correctament "
+#~ "amb discs d'una mida de sector diferent de %d bytes"
+
+#~ msgid ""
+#~ "You found a bug in GNU Parted. Please email a bug report to bug-"
+#~ "parted@gnu.org containing the version (%s), and the following message:\n"
+#~ msgstr ""
+#~ "Has trobat un bug a GNU Parted. Si-us-plau, envia-ns un e-mail amb un "
+#~ "informe a bug-parted@gnu.org que inclogui la versi (%s), i el segent "
+#~ "missatge:\n"
+
+#, fuzzy
+#~ msgid ""
+#~ "You requested to create a partition at %s - %s. The closest Parted can "
+#~ "manage is %s - %s."
+#~ msgstr ""
+#~ "Has demanat de crear una partici a %.3f-%.3fMb. El ms proper que Parted "
+#~ "pot manegar s %.3f-%.3fMb."
+
+#, fuzzy
+#~ msgid ""
+#~ "You requested to resize the partition to %s - %s. The closest Parted can "
+#~ "manage is %s - %s."
+#~ msgstr ""
+#~ "Has demanat redimensionar una partici a %.3f-%.3fMb. El ms proper que "
+#~ "Parted pot manegar s %.3f-%.3fMb."
+
+#~ msgid "SCSI"
+#~ msgstr "SCSI"
+
+#~ msgid "File system has an invalid signature for a FAT file systems."
+#~ msgstr ""
+#~ "El sistema de fitxers t una signatura invlida per a un sistema de "
+#~ "fitxers FAT."
+
+#~ msgid "Minor Start End "
+#~ msgstr "Minor Inici Fi "
+
+#~ msgid "Type "
+#~ msgstr "Tipus "
+
+#~ msgid "Filesystem "
+#~ msgstr "Sistema de fitxers "
+
+#~ msgid "Name "
+#~ msgstr "Nom "
+
+#~ msgid "Device %s is neither a SCSI nor IDE drive."
+#~ msgstr "El dispositiu %s no s ni SCSI ni IDE"
+
+#~ msgid "Error reading %s (%s) to determine if partition is mounted."
+#~ msgstr "Error al llegir %s (%s) per determinar si la partici est muntada."
+
+#~ msgid "Could not read geometry of %s - %s."
+#~ msgstr "No s'ha pogut llegir la geometria de %s - %s"
+
+#~ msgid "Device %s has dodgey geometry."
+#~ msgstr "El dispositiu %s t una geometria incorrecte."
+
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. However, the most likely reason is that Linux "
+#~ "detected the BIOS geometry for %s incorrectly. GNU Parted suspects the "
+#~ "real geometry should be %d/%d/%d (not %d/%d/%d). You should check with "
+#~ "your BIOS first, as this may not be correct. You can inform Linux by "
+#~ "adding the parameter %s=%d,%d,%d to the command line. See the LILO or "
+#~ "GRUB documentation for more information. If you think Parted's suggested "
+#~ "geometry is correct, you may select Ignore to continue (and fix Linux "
+#~ "later). Otherwise, select Cancel (and fix Linux and/or the BIOS now)."
+#~ msgstr ""
+#~ "La taula de particions a %s s inconsistent. Hi ha diverses raons per "
+#~ "les quals es pot donar aquest error. Per la ms com sol ser que Linux "
+#~ "ha detectat la geometria de la BIOS de %s incorrectament. GNU Parted creu "
+#~ "que la autntica geometria ha de ser %d/%d/%d ( i no %d/%d/%d). Primer "
+#~ "s'ha de comprovar la BIOS que sigui correcta. Es pot especificar a Linux "
+#~ "afegint el parmetre %s=%d,%d,%d a la lnia de comandes. Veieu la "
+#~ "documentaci de LILO o GRUB per ms informaci. Si es creu que la "
+#~ "geometria que suggereix Parted s correcta, seleccioneu Ignorar per "
+#~ "continuar ( i arregleu Linux desprs). Si no, seleccioneu Cancellar ( i "
+#~ "arregleu Linux i/o la BIOS ara mateix)."
+
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. Often, the reason is that Linux detected the "
+#~ "BIOS geometry incorrectly. However, this does not appear to be the case "
+#~ "here. It is safe to ignore,but ignoring may cause (fixable) problems "
+#~ "with some boot loaders, and may cause problems with FAT file systems. "
+#~ "Using LBA is recommended."
+#~ msgstr ""
+#~ "La taula de particions a %s s inconsistent. Hi ha diverses raons per les "
+#~ "quals es pot donar aquest error. Per la ms com sol ser que Linux ha "
+#~ "detectat la geometria de la BIOS incorrectament. No obstant, no sembla "
+#~ "ser el cas aqui. El ms segur s Ignorar, per ignorant pot causar "
+#~ "problemes (que es podren arreglar) en alguns carregadors d'arrencada i "
+#~ "tamb pot donar problemes amb sistemes de fitxers FAT. Es recomana "
+#~ "utilitzar LBA."
+
+#~ msgid ""
+#~ "Unable to align partition properly. This probably means that another "
+#~ "partitioning tool generated an incorrect partition table, because it "
+#~ "didn't have the correct BIOS geometry. It is safe to ignore,but ignoring "
+#~ "may cause (fixable) problems with some boot loaders."
+#~ msgstr ""
+#~ "No s'ha pogut aliniar la partici correctament. Aix vol dir que, "
+#~ "probablement, que un altre gestor de particions ha generat una taula de "
+#~ "particions incorrecta ja que no t una correcta geometria a la BIOS. El "
+#~ "ms segur s Ignorar, per si s'ignora pot causar problemes (que es "
+#~ "podren arreglar)amb alguns carregadors d'arrencada."
+
+#~ msgid ""
+#~ " You have Windows FAT partition(s) that are not using LBA. If your BIOS "
+#~ "supports LBA, then you should switch to LBA by setting the LBA flag on "
+#~ "all FAT partitions. Otherwise, make sure the operating system and the "
+#~ "BIOS have the same geometry before resizing any FAT partitions."
+#~ msgstr ""
+#~ " Tens particion(s) Windows FAT que no fan servir LBA. Si la teva BIOS "
+#~ "suporta LBA, llavors hauries d'activar el flag LBA a totes les particions "
+#~ "FAT. D'altra manera, assegura't que el sistema operatiu i la BIOS tenen "
+#~ "la mateixa geometria abans de canviar de mida qualservol partici FAT."
+
+#~ msgid ""
+#~ "The operating system thinks the geometry on %s is %d/%d/%d. Therefore, "
+#~ "cylinder 1024 ends at %.3fM.%s"
+#~ msgstr ""
+#~ "El sistema operatiu creu que la geometria a %s s %d/%d/%d. El cilindre "
+#~ "1024 acaba a %.3fM.%s"
+
+#~ msgid "The operating system thinks the geometry on %s is %d/%d/%d.%s"
+#~ msgstr "El sistema operatiu creu que la geometria a %s s %d/%d/%d.%s"
+
+#, fuzzy
+#~ msgid "Partition %s is being used."
+#~ msgstr "La partici s'est utilitzant."
+
+#~ msgid "START and END are in megabytes\n"
+#~ msgstr "INICI i FI sn en megabytes\n"
+
+#~ msgid ""
+#~ "The FATs aren't big enough to describe all clusters! Each FAT is %d "
+#~ "sectors. There are %d clusters, which would require each FAT to be %d "
+#~ "sectors. This is REALLY weird. You might want to write us an email: bug-"
+#~ "parted@gnu.org"
+#~ msgstr ""
+#~ "Les FATs no sn el suficientment grans per descriure tots els clsters! "
+#~ "Cada FAT s de %d sectors. Hi ha %d clsters, que vol dir que cada FAT "
+#~ "tingui %d sectors. Aix s molt extrany. Ens podries escriure un e-mail "
+#~ "a: bug-parted@gnu.org"
diff --git a/po/cs.po b/po/cs.po
new file mode 100644
index 0000000..f634805
--- /dev/null
+++ b/po/cs.po
@@ -0,0 +1,2500 @@
+# Czech translation of parted.
+# Copyright (C) 2003 Miloslav Trmac <mitr@volny.cz>
+# Miloslav Trmac <mitr@volny.cz>, 2003.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: parted 1.6.6-pre2\n"
+"Report-Msgid-Bugs-To: bug-parted@gnu.org\n"
+"POT-Creation-Date: 2006-04-21 21:20+0200\n"
+"PO-Revision-Date: 2003-07-12 14:00+0200\n"
+"Last-Translator: Miloslav Trmac <mitr@volny.cz>\n"
+"Language-Team: Czech <translation-team-cs@lists.sourceforge.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: libparted/arch/linux.c:284
+#, c-format
+msgid "Could not stat device %s - %s."
+msgstr "Nemohu stat zařízení %s - %s."
+
+#: libparted/arch/linux.c:390
+#, c-format
+msgid ""
+"Could not determine sector size for %s: %s.\n"
+"Using the default sector size (%lld)."
+msgstr ""
+
+#: libparted/arch/linux.c:401
+#, c-format
+msgid ""
+"Device %s has a logical sector size of %lld. Not all parts of GNU Parted "
+"support this at the moment, and the working code is HIGHLY EXPERIMENTAL.\n"
+msgstr ""
+
+#: libparted/arch/linux.c:441
+#, fuzzy, c-format
+msgid "Unable to determine the size of %s (%s)."
+msgstr "Nemohu určit velikost %s (%s)"
+
+#: libparted/arch/linux.c:530
+#, c-format
+msgid "Could not get identity of device %s - %s"
+msgstr "Nemohu získat identitu zařízení %s - %s"
+
+#: libparted/arch/linux.c:539
+msgid "Generic IDE"
+msgstr ""
+
+#: libparted/arch/linux.c:556
+#, c-format
+msgid ""
+"Device %s has multiple (%d) logical sectors per physical sector.\n"
+"GNU Parted supports this EXPERIMENTALLY for some special disk label/file "
+"system combinations, e.g. GPT and ext2/3.\n"
+"Please consult the web site for up-to-date information."
+msgstr ""
+
+#: libparted/arch/linux.c:726
+#, c-format
+msgid "Error initialising SCSI device %s - %s"
+msgstr "Chyba při inicializaci zařízení SCSI %s - %s"
+
+#: libparted/arch/linux.c:781
+#, fuzzy, c-format
+msgid ""
+"The device %s has zero length, and can't possibly store a file system or "
+"partition table. Perhaps you selected the wrong device?"
+msgstr ""
+"Zařízení %s má nulovou délku a nemůže obsahovat systém souborů nebo tabulku "
+"oddílů. Možná jste vybrali špatné zařízení?"
+
+#: libparted/arch/linux.c:829
+msgid ""
+"Unable to determine geometry of file/device. You should not use Parted "
+"unless you REALLY know what you're doing!"
+msgstr ""
+"Nemohu určit geometrii souboru/zařízení. Neměli byste používat Parted, pokud "
+"OPRAVDU nevíte, co děláte!"
+
+#: libparted/arch/linux.c:903
+msgid "DAC960 RAID controller"
+msgstr "Řadič RAID DAC960"
+
+#: libparted/arch/linux.c:908
+msgid "Compaq Smart Array"
+msgstr "Compaq Smart Array"
+
+#: libparted/arch/linux.c:913
+msgid "ATARAID Controller"
+msgstr "Řadič ATARAID"
+
+#: libparted/arch/linux.c:918
+msgid "I2O Controller"
+msgstr "Řadič I2O"
+
+#: libparted/arch/linux.c:923
+msgid "User-Mode Linux UBD"
+msgstr ""
+
+#: libparted/arch/linux.c:933
+msgid "Unknown"
+msgstr "Neznámý"
+
+#: libparted/arch/linux.c:940
+msgid "ped_device_new() Unsupported device type"
+msgstr "ped_device_new() Nepodporovaný typ zařízení"
+
+#: libparted/arch/linux.c:1041 libparted/arch/gnu.c:264
+#, c-format
+msgid "Error opening %s: %s"
+msgstr "Chyba při otevírání %s: %s"
+
+#: libparted/arch/linux.c:1052 libparted/arch/gnu.c:274
+#, c-format
+msgid "Unable to open %s read-write (%s). %s has been opened read-only."
+msgstr ""
+"Nemohu otevřít %s pro čtení/zápis (%s). %s bylo otevřeno jen pro čtení."
+
+#: libparted/arch/linux.c:1160 libparted/arch/linux.c:1228
+#: libparted/arch/gnu.c:452 libparted/arch/gnu.c:550 libparted/arch/gnu.c:678
+#, c-format
+msgid "%s during read on %s"
+msgstr "%s při čtení %s"
+
+#: libparted/arch/linux.c:1199
+#, c-format
+msgid "%s during seek for read on %s"
+msgstr "%s při seek pro čtení %s"
+
+#: libparted/arch/linux.c:1270 libparted/arch/linux.c:1355
+#: libparted/arch/linux.c:1413 libparted/arch/gnu.c:587
+#: libparted/arch/gnu.c:632 libparted/arch/gnu.c:709
+#, c-format
+msgid "%s during write on %s"
+msgstr "%s při zápisu na %s"
+
+#: libparted/arch/linux.c:1297 libparted/arch/gnu.c:512
+#, c-format
+msgid "Can't write to %s, because it is opened read-only."
+msgstr "Nemohu zapisovat na %s, protože je otevřen jen pro čtení."
+
+#: libparted/arch/linux.c:1321
+#, c-format
+msgid "%s during seek for write on %s"
+msgstr "%s při seek pro zápis na %s"
+
+#: libparted/arch/linux.c:1798
+#, fuzzy, c-format
+msgid ""
+"Error informing the kernel about modifications to partition %s -- %s. This "
+"means Linux won't know about any changes you made to %s until you reboot -- "
+"so you shouldn't mount it or use it in any way before rebooting."
+msgstr ""
+"Chyba při informování jádra o změnách oddílu %s - %s. To znamená, že Linux "
+"nebude vědět o změnách, které s %s provedete, dokud nerestartujete systém - "
+"takže byste jej neměli připojovat nebo jej před restartem jakkoli používat."
+
+#: libparted/arch/linux.c:1879
+#, fuzzy, c-format
+msgid ""
+"The kernel was unable to re-read the partition table on %s (%s). This means "
+"Linux won't know anything about the modifications you made until you "
+"reboot. You should reboot your computer before doing anything with %s."
+msgstr ""
+"Jádro nemohlo znovu načíst tabulku oddílů na %s (%s). To znamená, že Linux "
+"nebude vědět nic o změnách, které jste provedli, dokud nerestartujete "
+"systém. Měli byste svůj počítač restartovat, než budete s %s něco dělat."
+
+#: libparted/arch/gnu.c:97
+#, c-format
+msgid "Unable to open %s."
+msgstr "Nemohu otevřít %s."
+
+#: libparted/arch/gnu.c:117
+msgid "Unable to probe store."
+msgstr "Nemohu prozkoumat úložný prostor."
+
+#: libparted/arch/gnu.c:355
+#, fuzzy
+msgid ""
+"The partition table cannot be re-read. This means you need to reboot before "
+"mounting any modified partitions. You also need to reinstall your boot "
+"loader before you reboot (which may require mounting modified partitions). "
+"It is impossible do both things! So you'll need to boot off a rescue disk, "
+"and reinstall your boot loader from the rescue disk. Read section 4 of the "
+"Parted User documentation for more information."
+msgstr ""
+"Nebylo možné znovu načíst tabulku oddílů, takže budete muset před připojením "
+"změněných oddílů restartovat počítač. Také musíte před restartem "
+"reinstalovat svůj zavděč systému (což může vyžadovat připojení změněných "
+"oddílů). Nelze provést obojí! Takže budete muset zavést systém ze "
+"záchranného disku a reinstalovat svůj zavaděč systému odtud. Pro více "
+"informací si přečtěte oddíl 4 Uživatelské dokumentace Parted."
+
+#: libparted/arch/gnu.c:372
+#, fuzzy, c-format
+msgid ""
+"The partition table on %s cannot be re-read (%s). This means the Hurd knows "
+"nothing about any modifications you made. You should reboot your computer "
+"before doing anything with %s."
+msgstr ""
+"Tabulka oddílů na %s (%s). To znamená, že Hurd neví nic o změnách, které "
+"jste provedli. Než budete cokoli dělat s %s, měli byste restartovat svůj "
+"počítač."
+
+#: libparted/arch/gnu.c:383 parted/parted.c:2215
+msgid ""
+"You should reinstall your boot loader before rebooting. Read section 4 of "
+"the Parted User documentation for more information."
+msgstr ""
+"Před restartem byste měli reinstalovat svůj zavaděč systému. Pro více "
+"informací si přečtěte oddíl 4 Uživatelské dokumentace Parted."
+
+#: libparted/arch/gnu.c:774
+#, c-format
+msgid "%s trying to sync %s to disk"
+msgstr "%s při pokusu sync %s na disk"
+
+#: libparted/disk.c:183
+#, c-format
+msgid "Unable to open %s - unrecognised disk label."
+msgstr "Nemohu otevřít %s - neznámá jmenovka disku."
+
+#: libparted/disk.c:452
+#, c-format
+msgid ""
+"This libparted doesn't have write support for %s. Perhaps it was compiled "
+"read-only."
+msgstr ""
+"Tato libparted nemá podporu pro zápis pro %s. Možná byla přeložena jen pro "
+"čtení."
+
+#: libparted/disk.c:579
+#, fuzzy, c-format
+msgid "Partition %d is %s, but the file system is %s."
+msgstr "Oddíl %d je %.3fMb, ale systém souborů je %.3fMb."
+
+#: libparted/disk.c:1056
+#, c-format
+msgid "%s disk labels do not support extended partitions."
+msgstr "Jmenovky disku %s nepodporují rozšířené oddíly."
+
+#: libparted/disk.c:1616
+#, c-format
+msgid "%s disk labels don't support logical or extended partitions."
+msgstr "Jmenovky disku %s nepodporují logické nebo rozšířené oddíly."
+
+#: libparted/disk.c:1629
+#, fuzzy
+msgid "Too many primary partitions."
+msgstr "Příliš mnoho primárních oddílů"
+
+#: libparted/disk.c:1638
+#, c-format
+msgid ""
+"Can't add a logical partition to %s, because there is no extended partition."
+msgstr "Nemohu přidat logický oddíl do %s, protože neexistuje rozšířený oddíl."
+
+#: libparted/disk.c:1662
+#, fuzzy, c-format
+msgid "Can't have more than one extended partition on %s."
+msgstr "Nemohu mít více než jeden rozšířený oddíl na %s"
+
+#: libparted/disk.c:1672
+msgid "Can't have logical partitions outside of the extended partition."
+msgstr "Nemohu mít logické oddíly mimo rozšířený oddíl."
+
+#: libparted/disk.c:1697
+#, c-format
+msgid "Can't have a logical partition outside of the extended partition on %s."
+msgstr "Nemohu mít logický oddíl mimo rozšířený oddíl na %s."
+
+#: libparted/disk.c:1707 libparted/disk.c:1761 libparted/disk.c:1927
+#, fuzzy
+msgid "Can't have overlapping partitions."
+msgstr "Nemohu mít překrývající se oddíly"
+
+#: libparted/disk.c:1715
+msgid "Can't have a primary partition inside an extended partition."
+msgstr "Nemohu mít primární oddíl uvnitř rozšířeného oddílu."
+
+#: libparted/disk.c:2123
+msgid "metadata"
+msgstr "metadata"
+
+#: libparted/disk.c:2125
+msgid "free"
+msgstr "volné"
+
+#: libparted/disk.c:2127 parted/ui.c:968 parted/ui.c:996
+msgid "extended"
+msgstr "rozšířený"
+
+#: libparted/disk.c:2129 parted/ui.c:972 parted/ui.c:1000
+msgid "logical"
+msgstr "logický"
+
+#: libparted/disk.c:2131 parted/ui.c:964 parted/ui.c:992
+msgid "primary"
+msgstr "primární"
+
+#: libparted/disk.c:2147
+msgid "boot"
+msgstr "boot"
+
+#: libparted/disk.c:2149
+msgid "root"
+msgstr "root"
+
+#: libparted/disk.c:2151
+msgid "swap"
+msgstr "swap"
+
+#: libparted/disk.c:2153
+msgid "hidden"
+msgstr "skrytý"
+
+#: libparted/disk.c:2155
+msgid "raid"
+msgstr "raid"
+
+#: libparted/disk.c:2157
+msgid "lvm"
+msgstr "lvm"
+
+#: libparted/disk.c:2159
+msgid "lba"
+msgstr "lba"
+
+#: libparted/disk.c:2161
+msgid "hp-service"
+msgstr "hp-service"
+
+#: libparted/disk.c:2163
+msgid "palo"
+msgstr ""
+
+#: libparted/disk.c:2165
+#, fuzzy
+msgid "prep"
+msgstr "boot"
+
+#: libparted/disk.c:2167
+msgid "msftres"
+msgstr ""
+
+#: libparted/disk.c:2173
+#, fuzzy, c-format
+msgid "Unknown partition flag, %d."
+msgstr "Neznámý příznak oddílu, %d."
+
+#: libparted/labels/rdb.c:177
+#, c-format
+msgid "%s : Bad checksum on block %llu of type %s."
+msgstr ""
+
+#: libparted/labels/rdb.c:510
+#, c-format
+msgid "%s : Didn't find rdb block, should never happen."
+msgstr ""
+
+#: libparted/labels/rdb.c:595
+#, c-format
+msgid "%s : Loop detected at block %d."
+msgstr ""
+
+#: libparted/labels/rdb.c:614
+#, c-format
+msgid "%s : The %s list seems bad at block %s."
+msgstr ""
+
+#: libparted/labels/rdb.c:703
+#, c-format
+msgid "%s : Failed to list bad blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:711
+#, c-format
+msgid "%s : Failed to list partition blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:719
+#, c-format
+msgid "%s : Failed to list file system blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:727
+#, c-format
+msgid "%s : Failed to list boot blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:750
+#, c-format
+msgid "Failed to write partition block at %d."
+msgstr ""
+
+#: libparted/labels/rdb.c:1053 libparted/labels/bsd.c:505
+#: libparted/labels/dos.c:1942 libparted/labels/dvh.c:772
+#: libparted/labels/gpt.c:1365 libparted/labels/loop.c:251
+#: libparted/labels/mac.c:1318 libparted/labels/pc98.c:764
+#: libparted/labels/sun.c:704
+msgid "Unable to satisfy all constraints on the partition."
+msgstr "Nemohu splnit všechna omezení na oddíl."
+
+#: libparted/labels/rdb.c:1081
+#, fuzzy
+msgid "Unable to allocate a partition number."
+msgstr "Očekávám číslo oddílu."
+
+#: libparted/labels/bsd.c:530
+#, fuzzy
+msgid "Unable to allocate a bsd disklabel slot."
+msgstr "Nemohu alokovat položku jmenovky disku bsd"
+
+#: libparted/labels/dos.c:812
+#, fuzzy, c-format
+msgid "Invalid partition table on %s -- wrong signature %x."
+msgstr "Neplatná tabulka oddílů na %s - nesprávný podpis %x"
+
+#: libparted/labels/dos.c:840
+#, c-format
+msgid "Invalid partition table - recursive partition on %s."
+msgstr "Neplatná tabulka oddílů - rekurzivní oddíl na %s."
+
+#: libparted/labels/dos.c:1300
+msgid "Extended partitions cannot be hidden on msdos disk labels."
+msgstr ""
+
+#: libparted/labels/dos.c:1926
+msgid "Parted can't resize partitions managed by Windows Dynamic Disk."
+msgstr ""
+
+#: libparted/labels/dvh.c:192
+#, fuzzy, c-format
+msgid "%s has no extended partition (volume header partition)."
+msgstr ""
+"%s nemá rozšířený oddíl (oddíl hlavičky svazku). Pokud to budete ignorovat, "
+"budou odstraněny všechny zaváděcí svazky."
+
+#: libparted/labels/dvh.c:315
+msgid "Checksum is wrong, indicating the partition table is corrupt."
+msgstr ""
+"Kontrolní součet je špatně, což indikuje, že tabulka oddílů je poškozená."
+
+#: libparted/labels/dvh.c:616
+msgid "Only primary partitions can be root partitions."
+msgstr "Jen primární oddíly mohou být kořenové oddíly."
+
+#: libparted/labels/dvh.c:630
+msgid "Only primary partitions can be swap partitions."
+msgstr "Jen primární oddíly mohou být odkládací oddíly."
+
+#: libparted/labels/dvh.c:644
+msgid "Only logical partitions can be a boot file."
+msgstr "Jen logické oddíly mohou být zaváděcí soubor."
+
+#: libparted/labels/dvh.c:723
+msgid "Only logical partitions (boot files) have a name."
+msgstr "Jen logické oddíly (zaváděcí soubory) mají název."
+
+#: libparted/labels/dvh.c:814
+msgid "Too many primary partitions"
+msgstr "Příliš mnoho primárních oddílů"
+
+#: libparted/labels/gpt.c:433
+#, fuzzy, c-format
+msgid ""
+"%s contains GPT signatures, indicating that it has a GPT table. However, it "
+"does not have a valid fake msdos partition table, as it should. Perhaps it "
+"was corrupted -- possibly by a program that doesn't understand GPT partition "
+"tables. Or perhaps you deleted the GPT table, and are now using an msdos "
+"partition table. Is this a GPT partition table?"
+msgstr ""
+"%s obsahuje podpisy GPT, což znamená, že má tabulku GPT. Nemá ale platnou "
+"falešnou tabulku oddílů msdos, kterou by měl mít. Možná byla poškozena - "
+"např. programem, který nerozumí tabulkám oddílů GPT. Nebo jste možná "
+"odstranili tabulku oddílů GPT a nyní používáte tabulku oddílů msdos. Je toto "
+"tabulka oddílů GPT?"
+
+#: libparted/labels/gpt.c:625
+#, c-format
+msgid ""
+"The format of the GPT partition table is version %x, which is newer than "
+"what Parted can recognise. Please tell us! bug-parted@gnu.org"
+msgstr ""
+"Formát tabulky oddílů GPT je verze %x, což je novější, než kterou umí "
+"rozpoznat Parted. Oznamte nám to prosím! bug-parted@gnu.org"
+
+#: libparted/labels/gpt.c:747
+msgid ""
+"The backup GPT table is not at the end of the disk, as it should be. This "
+"might mean that another operating system believes the disk is smaller. Fix, "
+"by moving the backup to the end (and removing the old backup)?"
+msgstr ""
+"Záložní tabulka GPT není na konci disku, jak by měla být. To možná znamená, "
+"že jiný operační systém si myslí, že disk je menší. Mám to opravit "
+"přesunutím zálohy na konec (a odstraněním staré zálohy)?"
+
+#: libparted/labels/gpt.c:782
+#, fuzzy
+msgid ""
+"The primary GPT table is corrupt, but the backup appears OK, so that will be "
+"used."
+msgstr ""
+"Primární tabulka GPT je poškozená, ale záloha se zdá být v pořádku, takže "
+"bude použita záloha."
+
+#: libparted/labels/gpt.c:790
+#, fuzzy
+msgid ""
+"Both the primary and backup GPT tables are corrupt. Try making a fresh "
+"table, and using Parted's rescue feature to recover partitions."
+msgstr ""
+"Primární i záložní tabulka GPT je poškozena. Zkuste vytvořit novou tabulku a "
+"obnovit oddíly pomocí schopnosti Partedu rescue."
+
+#: libparted/labels/mac.c:167
+#, c-format
+msgid "Invalid signature %x for Mac disk labels."
+msgstr "Neplatný podpis %x pro jmenovky disku Mac."
+
+#: libparted/labels/mac.c:212
+msgid "Partition map has no partition map entry!"
+msgstr "Mapa oddílů nemá žádnou položku mapy oddílů!"
+
+#: libparted/labels/mac.c:259
+#, c-format
+msgid "%s is too small for a Mac disk label!"
+msgstr "%s je příliš malý pro jmenovku disku Mac!"
+
+#: libparted/labels/mac.c:490
+#, c-format
+msgid "Partition %d has an invalid signature %x."
+msgstr "Oddíl %d má neplatný podpis %x."
+
+#: libparted/labels/mac.c:508
+#, c-format
+msgid "Partition %d has an invalid length of 0 bytes!"
+msgstr "Oddíl %d má neplatnou délku 0 bajtů."
+
+#: libparted/labels/mac.c:536
+#, fuzzy
+msgid "The data region doesn't start at the start of the partition."
+msgstr "Datový region nezačíná na začátku oddílu"
+
+#: libparted/labels/mac.c:553
+#, fuzzy
+msgid "The boot region doesn't start at the start of the partition."
+msgstr "Zaváděcí region nezačíná na začátku oddílu"
+
+#: libparted/labels/mac.c:567
+msgid "The partition's boot region doesn't occupy the entire partition."
+msgstr "Zaváděcí region oddílu nezabírá celý oddíl."
+
+#: libparted/labels/mac.c:577
+msgid "The partition's data region doesn't occupy the entire partition."
+msgstr "Datový region oddílu nezabírá celý oddíl."
+
+#: libparted/labels/mac.c:631
+#, c-format
+msgid ""
+"Weird block size on device descriptor: %d bytes is not divisible by 512."
+msgstr ""
+"Podivná velikost bloku v deskriptoru zařízení: %d bajtů není dělitelné 512."
+
+#: libparted/labels/mac.c:644
+#, c-format
+msgid ""
+"The driver descriptor says the physical block size is %d bytes, but Linux "
+"says it is %d bytes."
+msgstr ""
+"Deskriptor ovladače říká, že fyzická velikost bloku je %d bajtů ale Linux "
+"říká, že je to %d bajtů."
+
+#: libparted/labels/mac.c:692
+msgid "No valid partition map found."
+msgstr "Nenalezena platná mapa oddílů."
+
+#: libparted/labels/mac.c:744
+#, fuzzy, c-format
+msgid ""
+"Conflicting partition map entry sizes! Entry 1 says it is %d, but entry %d "
+"says it is %d!"
+msgstr ""
+"Kolidující velikosti položek mapy oddílů! Položka 1 říká, že je to %d, ale "
+"položka %d říká, že je to %d!"
+
+#: libparted/labels/mac.c:771
+#, fuzzy
+msgid "Weird! There are 2 partitions map entries!"
+msgstr "Podivné - 2 položky mapy oddílu!"
+
+#: libparted/labels/mac.c:1257
+msgid ""
+"Changing the name of a root or swap partition will prevent Linux from "
+"recognising it as such."
+msgstr ""
+"Změna názvu kořenového nebo odkládacího oddílu zabrání Linuxu v jeho "
+"rozpoznání."
+
+#: libparted/labels/mac.c:1353
+#, fuzzy
+msgid "Can't add another partition -- the partition map is too small!"
+msgstr "Nemohu přidat další oddíl - mapa oddílů je příliš malá!"
+
+#: libparted/labels/pc98.c:357
+#, fuzzy, c-format
+msgid "Invalid partition table on %s."
+msgstr "Neplatná tabulka oddílů na %s"
+
+#: libparted/labels/pc98.c:409 libparted/labels/pc98.c:487
+#, fuzzy, c-format
+msgid ""
+"Partition %d isn't aligned to cylinder boundaries. This is still "
+"unsupported."
+msgstr ""
+"Oddíl %d není zarovnán na hranice cylindru. Je potřeba přidat pro to podporu."
+
+#: libparted/labels/pc98.c:796
+msgid "Can't add another partition."
+msgstr "Nemohu přidat další oddíl."
+
+#: libparted/labels/sun.c:143
+msgid "Corrupted Sun disk label detected."
+msgstr "Detekována poškozená jmenovka disku Sun."
+
+#: libparted/labels/sun.c:264
+#, fuzzy, c-format
+msgid ""
+"The disk CHS geometry (%d,%d,%d) reported by the operating system does not "
+"match the geometry stored on the disk label (%d,%d,%d)."
+msgstr ""
+"Geometrie disku CHS (%d,%d,%d) neodpovídá geometrii uložené v jmenovce disku "
+"(%d,%d,%d)."
+
+#: libparted/labels/sun.c:286
+#, c-format
+msgid "The disk label describes a disk bigger than %s."
+msgstr "Jmenovka disku popisuje disk větší než %s."
+
+#: libparted/labels/sun.c:440
+#, c-format
+msgid "The disk has %d cylinders, which is greater than the maximum of 65536."
+msgstr ""
+
+#: libparted/labels/sun.c:736
+msgid ""
+"The Whole Disk partition is the only available one left. Generally, it is "
+"not a good idea to overwrite this partition with a real one. Solaris may "
+"not be able to boot without it, and SILO (the sparc boot loader) appreciates "
+"it as well."
+msgstr ""
+"Jediný zbývající oddíl je oddíl Celý disk. Obecně není dobrý nápad tento "
+"oddíl přepsat skutečným oddílem. Bez něj možná nebude možné zavést Solaris a "
+"SILO (zavaděč systému pro sparc) jej také ocení."
+
+#: libparted/labels/sun.c:751
+msgid "Sun disk label is full."
+msgstr "Jmenovka disku Sun je plná."
+
+#: libparted/filesys.c:386
+msgid "Could not detect file system."
+msgstr "Nemohu detekovat systém souborů."
+
+#: libparted/filesys.c:397
+#, fuzzy
+msgid "The file system is bigger than its volume!"
+msgstr "Systém souborů je větší než jeho obsah!"
+
+#: libparted/filesys.c:405
+#, c-format
+msgid "Support for opening %s file systems is not implemented yet."
+msgstr ""
+"Podpora pro otevírání souborových systémů %s ještě není implementována."
+
+#: libparted/filesys.c:447
+#, c-format
+msgid "Support for creating %s file systems is not implemented yet."
+msgstr ""
+"Podpora pro vytváření souborových systémů %s ještě není implementována."
+
+#: libparted/filesys.c:508
+#, c-format
+msgid "Support for checking %s file systems is not implemented yet."
+msgstr "Podpora pro kontrolu souborových systémů %s ještě není implementována."
+
+#: libparted/filesys.c:574
+msgid "raw block copying"
+msgstr "přímé kopírování bloků"
+
+#: libparted/filesys.c:585
+msgid "growing file system"
+msgstr "zvětšování systému souborů"
+
+#: libparted/filesys.c:625
+msgid "Can't copy onto an overlapping partition."
+msgstr "Nemohu kopírovat do překrývajícího se oddílu."
+
+#: libparted/filesys.c:647
+#, fuzzy, c-format
+msgid ""
+"Direct support for copying file systems is not yet implemented for %s. "
+"However, support for resizing is implemented. Therefore, the file system "
+"can be copied if the new partition is at least as big as the old one. So, "
+"either shrink the partition you are trying to copy, or copy to a bigger "
+"partition."
+msgstr ""
+"Pro %s není ještě implementována přímá podpora pro kopírování systémů "
+"souborů. Je ale implementována podpora pro změnu velikosti. Systém souborů "
+"tedy může být zkopírován, je-li nový oddíl alespoň tak velký jako starý. "
+"Takže buď zmenšete oddíl, který se pokoušíte zkopírovat, nebo kopírujte do "
+"většího oddílu."
+
+#: libparted/filesys.c:661
+#, c-format
+msgid "Support for copying %s file systems is not implemented yet."
+msgstr ""
+"Podpora pro kopírování souborových systémů %s ještě není implementována."
+
+#: libparted/filesys.c:699
+#, c-format
+msgid "Support for resizing %s file systems is not implemented yet."
+msgstr ""
+"Podpora pro změnu velikosti souborových systémů %s ještě není implementována."
+
+#: libparted/exception.c:78
+msgid "Information"
+msgstr "Informace"
+
+#: libparted/exception.c:79
+msgid "Warning"
+msgstr "Varování"
+
+#: libparted/exception.c:80
+msgid "Error"
+msgstr "Chyba"
+
+#: libparted/exception.c:81
+msgid "Fatal"
+msgstr "Fatální"
+
+#: libparted/exception.c:82
+msgid "Bug"
+msgstr "Chyba"
+
+#: libparted/exception.c:83
+msgid "No Implementation"
+msgstr "Neimplementováno"
+
+#: libparted/exception.c:87
+msgid "Fix"
+msgstr "Opravit"
+
+#: libparted/exception.c:88
+msgid "Yes"
+msgstr "Ano"
+
+#: libparted/exception.c:89
+msgid "No"
+msgstr "Ne"
+
+#: libparted/exception.c:90
+msgid "OK"
+msgstr "OK"
+
+#: libparted/exception.c:91
+msgid "Retry"
+msgstr "Znovu"
+
+#: libparted/exception.c:92
+msgid "Ignore"
+msgstr "Ignorovat"
+
+#: libparted/exception.c:93
+msgid "Cancel"
+msgstr "Zrušit"
+
+#: libparted/exception.c:133
+#, fuzzy, c-format
+msgid ""
+"A bug has been detected in GNU Parted. Refer to the web site of parted "
+"http://www.gnu.org/software/parted/parted.html for more informations of what "
+"could be useful for bug submitting! Please email a bug report to bug-"
+"parted@gnu.org containing at least the version (%s) and the following "
+"message: "
+msgstr ""
+"Byla detekována chyba v GNU parted. Pošlete prosím e-mailem hlášení o chybě "
+"na bug-parted@gnu.org obsahující verzi (%s) a následující zprávu:"
+
+#: libparted/cs/geom.c:162
+msgid "Can't have the end before the start!"
+msgstr "Nemohu mít konec před začátkem!"
+
+#: libparted/cs/geom.c:169
+msgid "Can't have a partition outside the disk!"
+msgstr "Nemohu mít oddíl mimo disk!"
+
+#: libparted/cs/geom.c:303
+#, fuzzy, c-format
+msgid "Attempt to read sectors %ld-%ld outside of partition on %s."
+msgstr "Pokus číst sektory %ld-%ld mimo oddíl na %s"
+
+#: libparted/cs/geom.c:373
+#, fuzzy, c-format
+msgid "Attempt to write sectors %ld-%ld outside of partition on %s."
+msgstr "Pokus zapisovat sektory %ld-%ld mimo oddíl na %s"
+
+#: libparted/cs/geom.c:413 libparted/fs/linux_swap/linux_swap.c:353
+msgid "checking for bad blocks"
+msgstr "hledám špatné bloky"
+
+#: libparted/libparted.c:286 libparted/libparted.c:306
+msgid "Out of memory."
+msgstr "Nedostatek paměti."
+
+#: libparted/unit.c:139
+msgid "Cannot get unit size for special unit 'COMPACT'."
+msgstr ""
+
+#: libparted/unit.c:382
+#, c-format
+msgid "\"%s\" has invalid syntax for locations."
+msgstr ""
+
+#: libparted/unit.c:390
+#, c-format
+msgid "The maximum head value is %d."
+msgstr ""
+
+#: libparted/unit.c:397
+#, c-format
+msgid "The maximum sector value is %d."
+msgstr ""
+
+#: libparted/unit.c:409 libparted/unit.c:540
+#, c-format
+msgid "The location %s is outside of the device %s."
+msgstr ""
+
+#: libparted/unit.c:522
+msgid "Invalid number."
+msgstr ""
+
+#: libparted/fs/ext2/ext2.c:87 libparted/fs/ext2/ext2.c:112
+msgid "Inconsistent group descriptors!"
+msgstr "Nekonzistentní deskriptory skupin!"
+
+#: libparted/fs/ext2/ext2.c:91 libparted/fs/ext2/ext2.c:116
+#, fuzzy
+msgid "File system full!"
+msgstr "Systém souborů plný!"
+
+#: libparted/fs/ext2/ext2.c:750
+#, fuzzy
+msgid "Invalid superblock. Are you sure this is an ext2 file system?"
+msgstr "Neplatný superblok. Jste si jisti, že toto je systém souborů ext2?"
+
+#: libparted/fs/ext2/ext2.c:764 libparted/fs/ext2/ext2_resize.c:597
+#, fuzzy
+msgid "File system has errors! You should run e2fsck."
+msgstr "Systém souborů má chyby! Měli byste spustit e2fsck."
+
+#: libparted/fs/ext2/ext2.c:775
+#, fuzzy
+msgid ""
+"File system was not cleanly unmounted! You should run e2fsck. Modifying an "
+"unclean file system could cause severe corruption."
+msgstr ""
+"Systém souborů nebyl čistě odpojen! Měli byste e2fsck. Úpravy nečistého "
+"systému souborů mohou způsobit vážné poškození dat."
+
+#: libparted/fs/ext2/ext2.c:795
+#, fuzzy
+msgid "File system has an incompatible feature enabled."
+msgstr "Systém souborů má povolenou nekompatibilní vlastnost"
+
+#: libparted/fs/ext2/ext2.c:806
+msgid "Error allocating buffer cache."
+msgstr "Chyba při alokaci buffer cache."
+
+#: libparted/fs/ext2/ext2.c:848
+msgid ""
+"A resize operation on this file system will use EXPERIMENTAL code that MAY "
+"CORRUPT it (although it hasn't done so yet).You should at least backup your "
+"data and run 'e2fsck -f' afterwards."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:114
+#, fuzzy
+msgid ""
+"Found an inode with a incorrect link count. Better go run e2fsck first!"
+msgstr ""
+"Našel jsem inode s nesprávným počtem odkazů. Radši nejdřív spusťte e2fsck."
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:487
+msgid "Not enough free inodes!"
+msgstr "Nedostatek volných inodů!"
+
+#: libparted/fs/ext2/ext2_resize.c:224
+#, fuzzy
+msgid "File system is too full to remove a group!"
+msgstr "Systém souborů je příliš plný na to, abych mohl odstranit skupinu!"
+
+#: libparted/fs/ext2/ext2_resize.c:233
+#, fuzzy
+msgid "File system has too many allocated inodes to remove a group!"
+msgstr ""
+"Systém souborů má příliš mnoho alokovaných inodů na to, abych mohl odstranit "
+"skupinu!"
+
+#: libparted/fs/ext2/ext2_resize.c:493
+msgid "adding groups"
+msgstr "přidávám skupiny"
+
+#: libparted/fs/ext2/ext2_resize.c:530
+#, fuzzy, c-format
+msgid "Your file system is too full to resize it to %i blocks. Sorry."
+msgstr ""
+"Váš systém souborů je příliš plný na to, abych mohl změnit jeho velikost na %"
+"d bloků. Lituji."
+
+#: libparted/fs/ext2/ext2_resize.c:540
+#, fuzzy, c-format
+msgid ""
+"Your file system has too many occupied inodes to resize it to %i blocks. "
+"Sorry."
+msgstr ""
+"Váš systém souborů má příliš mnoho použitých inodů na to, abych mohl změnit "
+"jeho velikost na %i bloků. Lituji."
+
+#: libparted/fs/ext2/ext2_resize.c:554 libparted/fs/hfs/hfs.c:243
+#: libparted/fs/hfs/hfs.c:624
+msgid "shrinking"
+msgstr "zmenšuji"
+
+#: libparted/fs/ext2/ext2_resize.c:605
+#, fuzzy
+msgid "File system was not cleanly unmounted! You should run e2fsck."
+msgstr "Systém souborů nebyl správně odpojen! Měli byste e2fsck."
+
+#: libparted/fs/ext2/ext2_resize.c:614
+msgid ""
+"The file system has the 'dir_index' feature enabled. Parted can only resize "
+"the file system if it disables this feature. You can enable it later by "
+"running 'tune2fs -O dir_index DEVICE' and then 'e2fsck -fD DEVICE'."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_block_relocator.c:198
+#, fuzzy
+msgid "Cross-linked blocks found! Better go run e2fsck first!"
+msgstr "Nalezeny bloky s křížovými odkazy! Radši nejdřív spusťte e2fsck!"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:537
+#, fuzzy, c-format
+msgid "Block %i has no reference? Weird."
+msgstr "Blok %i nemá odkaz? Divné"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:738
+#, c-format
+msgid "Block %i shouldn't have been marked!"
+msgstr "Blok %i by neměl být označen!"
+
+#: libparted/fs/ext2/interface.c:188
+#, fuzzy
+msgid ""
+"The ext2 file system passed a basic check. For a more comprehensive check, "
+"use the e2fsck program."
+msgstr ""
+"Systém souborů ext2 prošel základní kontrolou. Pro podrobnější kontrolu "
+"použijte program e2fsck."
+
+#: libparted/fs/ext2/interface.c:205
+msgid "Sorry, can't move the start of ext2 partitions yet!"
+msgstr "Lituji, ještě neumím přesunout začátek oddílů ext2!"
+
+#: libparted/fs/ext2/ext2_buffer.c:82
+msgid "Couldn't flush buffer cache!"
+msgstr "Nemohu vyprázdnit buffer cache!"
+
+#: libparted/fs/ext2/ext2_mkfs.c:162
+msgid "writing per-group metadata"
+msgstr "zapisuji metadata skupin"
+
+#: libparted/fs/ext2/ext2_mkfs.c:565
+msgid "File system too small for ext2."
+msgstr "Systém souborů příliš malý pro ext2."
+
+#: libparted/fs/fat/calc.c:134
+#, fuzzy, c-format
+msgid ""
+"You need %s of free disk space to shrink this partition to this size. "
+"Currently, only %s is free."
+msgstr ""
+"Pro zmenšení tohoto oddílu na tuto velikost potřebujete %dM volného místa "
+"(momentálně máte volných jen %dM)"
+
+#: libparted/fs/fat/context.c:55
+#, c-format
+msgid ""
+"Cluster start delta = %d, which is not a multiple of the cluster size %d."
+msgstr "Změna začátku clusteru = %d, což není násobek velikosti clusteru %d."
+
+#: libparted/fs/fat/fat.c:312
+#, fuzzy, c-format
+msgid "Partition too big/small for a %s file system."
+msgstr "Oddíl je příliš velký/malý pro systém souborů %s"
+
+#: libparted/fs/fat/fat.c:478
+msgid ""
+"The FATs don't match. If you don't know what this means, then select "
+"cancel, run scandisk on the file system, and then come back."
+msgstr ""
+"Tabulky FAT si neodpovídají. Pokud nevíte, co to znamená, zvolte Zrušit, "
+"spusťte na systému souborů scandisk a pak se vraťte."
+
+#: libparted/fs/fat/fat.c:518
+msgid "There are no possible configurations for this FAT type."
+msgstr "Pro tento typ FAT neexistuje možná konfigurace."
+
+#: libparted/fs/fat/fat.c:530
+#, c-format
+msgid ""
+"File system doesn't have expected sizes for Windows to like it. Cluster "
+"size is %dk (%dk expected); number of clusters is %d (%d expected); size of "
+"FATs is %d sectors (%d expected)."
+msgstr ""
+"Systém souborů nemá očekávané velikosti, aby jej Windows měly rády. Velikost "
+"clusteru je %dk (očekáváno %dk); počet clusterů je %d (očekáváno %d); "
+"velikost FAT je %d sektorů (očekáváno %d)."
+
+#: libparted/fs/fat/fat.c:553
+#, c-format
+msgid ""
+"File system is reporting the free space as %d clusters, not %d clusters."
+msgstr "Systém souborů oznamuje volné místo jako %d clusterů, ne %d clusterů."
+
+#: libparted/fs/fat/fat.c:878
+#, fuzzy
+msgid ""
+"GNU Parted was miscompiled: the FAT boot sector should be 512 bytes. FAT "
+"support will be disabled."
+msgstr ""
+"GNU parted byl nesprávně přeložen; zaváděcí sektor FAT by měl být 512 bajtů. "
+"Podpora FAT bude zakázána."
+
+#: libparted/fs/fat/resize.c:158
+#, fuzzy
+msgid ""
+"There's not enough room in the root directory for all of the files. Either "
+"cancel, or ignore to lose the files."
+msgstr ""
+"V kořenovém adresáři není dostatek místa pro všechny souborů. Zvolte buď "
+"Zrušit, nebo Ignorovat pro ztrátu těchto souborů."
+
+#: libparted/fs/fat/resize.c:299
+msgid "Error writing to the root directory."
+msgstr "Chyba při zapisování do kořenového adresáře."
+
+#: libparted/fs/fat/resize.c:484
+#, fuzzy
+msgid "If you leave your file system as FAT16, then you will have no problems."
+msgstr ""
+"Pokud svůj systém souborů ponecháte jako FAT16, nebudete mít žádné problémy."
+
+#: libparted/fs/fat/resize.c:487
+msgid ""
+"If you convert to FAT16, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual)."
+msgstr ""
+"Pokud převedete na FAT16 a na tomto oddílu jsou nainstalovány MS Windows, "
+"musíte reinstalovat zavaděč systému MS Windows. Pokud to chcete udělat, měli "
+"byste si přečíst manuál Partedu (nebo manuál své distribuce)."
+
+#: libparted/fs/fat/resize.c:495
+msgid ""
+"If you leave your file system as FAT32, then you will not introduce any new "
+"problems."
+msgstr ""
+"Pokud svůj systém souborů ponecháte jako FAT16, nezpůsobíte žádné nové "
+"problémy."
+
+#: libparted/fs/fat/resize.c:499
+msgid ""
+"If you convert to FAT32, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual). Also, "
+"converting to FAT32 will make the file system unreadable by MS DOS, MS "
+"Windows 95a, and MS Windows NT."
+msgstr ""
+"Pokud převedete na FAT32 a na tomto oddílu jsou nainstalovány MS Windows, "
+"musíte reinstalovat zavaděč systému MS Windows. Pokud to chcete udělat, měli "
+"byste si přečíst manuál Partedu (nebo manuál své distribuce). Převedení na "
+"FAT32 také učiní systém souborů nečitelným pro MS DOS, MS Windows 95a a MS "
+"Windows NT."
+
+#: libparted/fs/fat/resize.c:513
+#, c-format
+msgid "%s %s %s"
+msgstr "%s %s %s"
+
+#: libparted/fs/fat/resize.c:514
+msgid "Would you like to use FAT32?"
+msgstr "Chcete použít FAT32?"
+
+#: libparted/fs/fat/resize.c:541 libparted/fs/fat/resize.c:557
+#, c-format
+msgid "%s %s"
+msgstr "%s %s"
+
+#: libparted/fs/fat/resize.c:542
+msgid ""
+"The file system can only be resized to this size by converting to FAT16."
+msgstr ""
+"Velikost systému souborů může být na tuto hodnotu změněna jen převodem na "
+"FAT16."
+
+#: libparted/fs/fat/resize.c:558
+msgid ""
+"The file system can only be resized to this size by converting to FAT32."
+msgstr ""
+"Velikost systému souborů může být na tuto hodnotu změněna jen převodem na "
+"FAT32."
+
+#: libparted/fs/fat/resize.c:571
+#, fuzzy
+msgid ""
+"GNU Parted cannot resize this partition to this size. We're working on it!"
+msgstr ""
+"GNU Parted neumí změnit velikost tohoto oddílu na tuto hodnotu. Pracujeme na "
+"tom!"
+
+#: libparted/fs/fat/bootsector.c:48 libparted/fs/fat/bootsector.c:55
+msgid "File system has an invalid signature for a FAT file system."
+msgstr "Systém souborů má neplatný podpis pro systém souborů FAT."
+
+#: libparted/fs/fat/bootsector.c:62
+msgid "File system has an invalid sector size for a FAT file system."
+msgstr "Systém souborů má neplatnou velikost sektoru pro systém souborů FAT."
+
+#: libparted/fs/fat/bootsector.c:69
+msgid "File system has an invalid cluster size for a FAT file system."
+msgstr "Systém souborů má neplatnou velikost clusteru pro systém souborů FAT."
+
+#: libparted/fs/fat/bootsector.c:76
+#, fuzzy
+msgid ""
+"File system has an invalid number of reserved sectors for a FAT file system."
+msgstr ""
+"Systém souborů má neplatný počet rezervovaných sektorů pro systém souborů "
+"FAT."
+
+#: libparted/fs/fat/bootsector.c:83
+#, fuzzy
+msgid "File system has an invalid number of FATs."
+msgstr "Systém souborů má neplatný počet FAT."
+
+#: libparted/fs/fat/bootsector.c:138
+#, c-format
+msgid ""
+"This file system has a logical sector size of %d. GNU Parted is known not "
+"to work properly with sector sizes other than 512 bytes."
+msgstr ""
+"Systém souborů má logickou velikost sektoru %d. Ví se, že GNU Parted "
+"nepracuje správně s velikostí sektoru jinou než 512 bajtů."
+
+#: libparted/fs/fat/bootsector.c:163
+#, c-format
+msgid ""
+"The file system's CHS geometry is (%d, %d, %d), which is invalid. The "
+"partition table's CHS geometry is (%d, %d, %d). If you select Ignore, the "
+"file system's CHS geometry will be left unchanged. If you select Fix, the "
+"file system's CHS geometry will be set to match the partition table's CHS "
+"geometry."
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:209
+msgid "FAT boot sector says logical sector size is 0. This is weird. "
+msgstr ""
+"Zaváděcí sektor FAT říká, že logická velikost sektoru je 0. To je divné. "
+
+#: libparted/fs/fat/bootsector.c:215
+msgid "FAT boot sector says there are no FAT tables. This is weird. "
+msgstr ""
+"Zaváděcí sektor FAT říká, že neexistuje žádná tabulka FAT. To je divné. "
+
+#: libparted/fs/fat/bootsector.c:221
+msgid "FAT boot sector says clusters are 0 sectors. This is weird. "
+msgstr "Zaváděcí sektor FAT říká, že cluster je 0 sektorů. To je divné. "
+
+#: libparted/fs/fat/bootsector.c:231
+#, fuzzy
+msgid "File system is FAT12, which is unsupported."
+msgstr "Souborový systém je FAT12, což není podporováno."
+
+#: libparted/fs/fat/bootsector.c:407
+#, c-format
+msgid ""
+"The information sector has the wrong signature (%x). Select cancel for now, "
+"and send in a bug report. If you're desperate, it's probably safe to ignore."
+msgstr ""
+"Sektor informací má nesprávný podpis (%x). Zatím zvolte Zrušit a pošlete "
+"hlášení o chybě. Pokud jste v úzkých, můžete to pravděpodobně bez obav "
+"ignorovat."
+
+#: libparted/fs/fat/count.c:149
+#, c-format
+msgid "Bad directory entry for %s: first cluster is the end of file marker."
+msgstr "Špatná položka adresáře pro %s: první cluster je značka konce souboru."
+
+#: libparted/fs/fat/count.c:162
+#, c-format
+msgid ""
+"Bad FAT: unterminated chain for %s. You should run dosfsck or scandisk."
+msgstr ""
+"Špatná FAT: neukončený řetězec pro %s. Měli byste spustit dosfsck nebo "
+"scandisk."
+
+#: libparted/fs/fat/count.c:171
+#, fuzzy, c-format
+msgid ""
+"Bad FAT: cluster %d outside file system in chain for %s. You should run "
+"dosfsck or scandisk."
+msgstr ""
+"Špatná FAT: cluster %d je mimo systém souborů v řetězci pro %s. Měli byste "
+"spustit dosfsck nebo scandisk."
+
+#: libparted/fs/fat/count.c:181
+#, c-format
+msgid ""
+"Bad FAT: cluster %d is cross-linked for %s. You should run dosfsck or "
+"scandisk."
+msgstr ""
+"Špatná FAT: cluster %d pro %s má křížové odkazy. Měli byste spustit dosfsck "
+"nebo scandisk."
+
+#: libparted/fs/fat/count.c:200
+#, c-format
+msgid "%s is %dk, but it has %d clusters (%dk)."
+msgstr "%s je %dk, ale má %d clusterů (%dk)."
+
+#: libparted/fs/fat/count.c:263
+#, c-format
+msgid ""
+"The file %s is marked as a system file. This means moving it could cause "
+"some programs to stop working."
+msgstr ""
+"Soubor %s je označen jako systémový soubor. To znamená, že jeho přesun může "
+"způsobit, že některé programy přestanou fungovat."
+
+#: libparted/fs/fat/table.c:138
+#, c-format
+msgid ""
+"FAT %d media %x doesn't match the boot sector's media %x. You should "
+"probably run scandisk."
+msgstr ""
+"FAT %d media %x neodpovídá media %x zaváděcího sektoru. Pravděpodobně byste "
+"měli spustit scandisk."
+
+#: libparted/fs/fat/table.c:268
+#, fuzzy, c-format
+msgid "fat_table_set: cluster %ld outside file system"
+msgstr "fat_table_set: cluster %ld mimo systém souborů"
+
+#: libparted/fs/fat/table.c:296
+#, fuzzy, c-format
+msgid "fat_table_get: cluster %ld outside file system"
+msgstr "fat_table_get: cluster %ld mimo systém souborů"
+
+#: libparted/fs/fat/table.c:334
+msgid "fat_table_alloc_cluster: no free clusters"
+msgstr "fat_table_alloc_cluster: nejsou volné clustery"
+
+#: libparted/fs/linux_swap/linux_swap.c:236
+#, c-format
+msgid "Unrecognised linux swap signature '%10s'."
+msgstr "Nerozpoznaný podpis odkládacího oddílu linuxu '%10s'."
+
+#: libparted/fs/linux_swap/linux_swap.c:312
+msgid "Too many bad pages."
+msgstr "Příliš mnoho špatných stránek."
+
+#: libparted/fs/hfs/advfs.c:123 libparted/fs/hfs/advfs_plus.c:125
+#: libparted/fs/hfs/reloc.c:416 libparted/fs/hfs/reloc.c:510
+#: libparted/fs/hfs/reloc_plus.c:541 libparted/fs/hfs/reloc_plus.c:660
+#: libparted/fs/hfs/reloc_plus.c:774
+msgid "The file system contains errors."
+msgstr ""
+
+#: libparted/fs/hfs/advfs_plus.c:290
+msgid "Bad blocks could not be read."
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:139
+#, c-format
+msgid ""
+"Trying to register an extent starting at block 0x%X, but another one already "
+"exists at this position. You should check the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:216
+#, c-format
+msgid ""
+"Trying to move an extent from block Ox%X to block Ox%X, but another one "
+"already exists at this position. This should not happen!"
+msgstr ""
+
+#: libparted/fs/hfs/file.c:145
+#, c-format
+msgid "Could not update the extent cache for HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:182
+#, c-format
+msgid "Trying to read HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:192 libparted/fs/hfs/file.c:222
+#, c-format
+msgid "Could not find sector %lli of HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:212
+#, c-format
+msgid "Trying to write HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:159
+#, c-format
+msgid "Could not update the extent cache for HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:203
+#, c-format
+msgid "Trying to read HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:214 libparted/fs/hfs/file_plus.c:256
+#, c-format
+msgid "Could not find sector %lli of HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:245
+#, c-format
+msgid "Trying to write HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:225
+msgid "Sorry, HFS cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:255 libparted/fs/hfs/hfs.c:636
+msgid "Data relocation has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:274
+msgid "Data relocation left some data in the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:313
+#, fuzzy
+msgid "writing HFS Master Directory Block"
+msgstr "Chyba při zapisování do kořenového adresáře."
+
+#: libparted/fs/hfs/hfs.c:461
+msgid "No valid HFS[+X] signature has been found while opening."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:471
+#, c-format
+msgid "Version %d of HFS+ isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:482
+#, c-format
+msgid "Version %d of HFSX isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:667
+msgid "Data relocation left some data at the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:715
+#, fuzzy
+msgid "Error while writing the allocation file."
+msgstr "Chyba při zapisování do kořenového adresáře."
+
+#: libparted/fs/hfs/hfs.c:730
+msgid "Error while writing the compatibility part of the allocation file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:745
+msgid "writing HFS+ Volume Header"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:845
+msgid "An error occurred while looking for the mandatory bad blocks file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:899
+msgid ""
+"It seems there is an error in the HFS wrapper: the bad blocks file doesn't "
+"contain the embedded HFS+ volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:930
+msgid "Sorry, HFS+ cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:965
+msgid "shrinking embedded HFS+ volume"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:981
+msgid "Resizing the HFS+ volume has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:988
+#, fuzzy
+msgid "shrinking HFS wrapper"
+msgstr "zmenšuji"
+
+#: libparted/fs/hfs/hfs.c:997
+msgid "Updating the HFS wrapper has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:1099 libparted/fs/hfs/hfs.c:1184
+#, c-format
+msgid ""
+"This is not a real %s check. This is going to extract special low level "
+"files for debugging purposes."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:156
+msgid "Bad block list header checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:169
+#, c-format
+msgid ""
+"Invalid size of a transaction block while replaying the journal (%i bytes)."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:261
+msgid ""
+"Journal stored outside of the volume are not supported. Try to desactivate "
+"the journal and run Parted again."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:272
+#, fuzzy
+msgid "Journal offset or size is not multiple of the sector size."
+msgstr "Změna začátku clusteru = %d, což není násobek velikosti clusteru %d."
+
+#: libparted/fs/hfs/journal.c:290
+msgid "Incorrect magic values in the journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:299
+msgid "Journal size mismatch between journal info block and journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:311
+#, fuzzy
+msgid "Some header fields are not multiple of the sector size."
+msgstr "Změna začátku clusteru = %d, což není násobek velikosti clusteru %d."
+
+#: libparted/fs/hfs/journal.c:320
+msgid ""
+"The sector size stored in the journal is not 512 bytes. Parted only "
+"supports 512 bytes length sectors."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:332
+msgid "Bad journal checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:350
+msgid ""
+"The journal is not empty. Parted must replay the transactions before "
+"opening the file system. This will modify the file system."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:378
+msgid ""
+"The volume header or the master directory block has changed while replaying "
+"the journal. You should restart Parted."
+msgstr ""
+
+#: libparted/fs/hfs/probe.c:52
+#, c-format
+msgid ""
+"Parted can't use HFS file systems on disks with a sector size not equal to %"
+"d bytes."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:153 libparted/fs/hfs/reloc_plus.c:157
+msgid "An extent has not been relocated."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:253 libparted/fs/hfs/reloc_plus.c:309
+msgid ""
+"A reference to an extent comes from a place it should not. You should check "
+"the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:383
+msgid "This HFS volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:477
+msgid "This HFS volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:519 libparted/fs/hfs/reloc_plus.c:670
+msgid ""
+"The extents overflow file should not contain its own extents! You should "
+"check the file system."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:576 libparted/fs/hfs/reloc_plus.c:849
+#, fuzzy
+msgid "Could not cache the file system in memory."
+msgstr "Nemohu detekovat systém souborů."
+
+#: libparted/fs/hfs/reloc.c:637 libparted/fs/hfs/reloc_plus.c:910
+msgid "Bad blocks list could not be loaded."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:651 libparted/fs/hfs/reloc_plus.c:926
+msgid "An error occurred during extent relocation."
+msgstr ""
+
+#: libparted/fs/hfs/reloc_plus.c:497
+msgid "This HFS+ volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc_plus.c:621
+msgid "This HFS+ volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: parted/parted.c:76
+msgid "displays this help message"
+msgstr "zobrazí tuto zprávu nápovědy"
+
+#: parted/parted.c:77
+msgid "where necessary, prompts for user intervention"
+msgstr "je-li potřeba, požádá o intervenci uživatele"
+
+#: parted/parted.c:78
+msgid "never prompts for user intervention"
+msgstr "nikdy nežádá o intervenci uživatele"
+
+#: parted/parted.c:79
+msgid "displays the version"
+msgstr "zobrazí verzi"
+
+#: parted/parted.c:87
+#, fuzzy
+msgid ""
+"NUMBER is the partition number used by Linux. On MS-DOS disk labels, the "
+"primary partitions number from 1 to 4, logical partitions from 5 onwards.\n"
+msgstr ""
+"MINOR je číslo oddílu používané Linuxem. Na jmenovkách disku msdos mají "
+"primární oddíly čísla 1-4 a logické oddíly jsou od 5 dál.\n"
+
+#: parted/parted.c:90
+msgid "LABEL-TYPE is one of: "
+msgstr "TYP-JMENOVKY je jeden z: "
+
+#: parted/parted.c:91
+msgid "FLAG is one of: "
+msgstr "PŘEPÍNAČ je jeden z: "
+
+#: parted/parted.c:92
+#, fuzzy
+msgid "UNIT is one of: "
+msgstr "PŘEPÍNAČ je jeden z: "
+
+#: parted/parted.c:93
+msgid "PART-TYPE is one of: primary, logical, extended\n"
+msgstr "TYP-ODDÍLU je jeden z: primary, logical, extended\n"
+
+#: parted/parted.c:95
+msgid "FS-TYPE is one of: "
+msgstr "TYP-FS je jeden z: "
+
+#: parted/parted.c:96
+#, fuzzy
+msgid ""
+"START and END are disk locations, such as 4GB or 10%. Negative values count "
+"from the end of the disk. For example, -1s specifies exactly the last "
+"sector.\n"
+msgstr ""
+"ZAČÁTEK a KONEC jsou v megabajtech. Záporné hodnoty se odčítají od konce "
+"disku.\n"
+
+#: parted/parted.c:99
+msgid "STATE is one of: on, off\n"
+msgstr "STAV je jeden z: on, off\n"
+
+#: parted/parted.c:100
+msgid "DEVICE is usually /dev/hda or /dev/sda\n"
+msgstr "ZAŘÍZENÍ je obvykle /dev/hda nebo /dev/sda\n"
+
+#: parted/parted.c:101
+msgid "NAME is any word you want\n"
+msgstr "NÁZEV je libovolné slovo\n"
+
+#: parted/parted.c:102
+msgid "The partition must have one of the following FS-TYPEs: "
+msgstr ""
+
+#: parted/parted.c:105
+msgid "GNU Parted Version information:\n"
+msgstr ""
+
+#: parted/parted.c:107
+#, fuzzy
+msgid ""
+"Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n"
+"This program is free software, covered by the GNU General Public License.\n"
+"\n"
+"This program is distributed in the hope that it will be useful, but WITHOUT "
+"ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
+"FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
+"more details.\n"
+"\n"
+msgstr ""
+"Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, "
+"Inc.\n"
+"Toto je volné programové vybavení podle GNU General Public License.\n"
+"\n"
+"Tento program je rozšiřován v naději, že bude užitečný, ale BEZ JAKÉKOLI "
+"ZÁRUKY; bez i předpokládané záruky PRODEJNOSTI nebo VHODNOSTI PRO KONKRÉTNÍ "
+"ÚČEL. Další podrobnosti najdete v GNU General Public License.\n"
+"\n"
+
+#: parted/parted.c:152
+#, c-format
+msgid "%0.f%%\t(time left %.2d:%.2d)"
+msgstr "%0.f%%\t(zbylý čas %.2d:%.2d)"
+
+#: parted/parted.c:170
+#, c-format
+msgid ""
+"Partition %s is being used. You must unmount it before you modify it with "
+"Parted."
+msgstr ""
+
+#: parted/parted.c:187
+#, c-format
+msgid "Partition(s) on %s are being used."
+msgstr "Oddíl(a) na %s jsou používány."
+
+#: parted/parted.c:413 parted/parted.c:594 parted/parted.c:979
+#: parted/parted.c:1059 parted/parted.c:1586 parted/parted.c:1663
+#: parted/parted.c:1707
+msgid "Partition number?"
+msgstr "Číslo oddílu?"
+
+#: parted/parted.c:456
+msgid "Source device?"
+msgstr "Zdrojové zařízení?"
+
+#: parted/parted.c:460
+msgid "Source partition number?"
+msgstr "Číslo zdrojového oddílu?"
+
+#: parted/parted.c:465
+#, fuzzy
+msgid "Can't copy an extended partition."
+msgstr "Nemohu kopírovat rozšířené oddíly."
+
+#: parted/parted.c:471
+msgid "Destination partition number?"
+msgstr "Číslo cílového oddílu?"
+
+#: parted/parted.c:564
+msgid "New disk label type?"
+msgstr "Typ nové jmenovky disku?"
+
+#: parted/parted.c:598
+msgid "File system?"
+msgstr "Systém souborů?"
+
+#: parted/parted.c:645 parted/parted.c:815
+msgid "Partition type?"
+msgstr "Typ oddílu?"
+
+#: parted/parted.c:652 parted/parted.c:822 parted/parted.c:1062
+msgid "Partition name?"
+msgstr "Název oddílu?"
+
+#: parted/parted.c:660 parted/parted.c:832
+msgid "File system type?"
+msgstr "Typ souborového systému?"
+
+#: parted/parted.c:667 parted/parted.c:834 parted/parted.c:994
+#: parted/parted.c:1544 parted/parted.c:1595
+msgid "Start?"
+msgstr "Začátek?"
+
+#: parted/parted.c:669 parted/parted.c:837 parted/parted.c:997
+#: parted/parted.c:1546 parted/parted.c:1597
+msgid "End?"
+msgstr "Konec?"
+
+#: parted/parted.c:707 parted/parted.c:875
+#, fuzzy, c-format
+msgid ""
+"You requested a partition from %s to %s.\n"
+"The closest location we can manage is %s to %s. Is this still acceptable to "
+"you?"
+msgstr ""
+"Požadovali jste přesun oddílu na %.3f-%.3fMb. Nejbližší, co Parted může "
+"zvládnout, je %.3f-%.3fMb."
+
+#: parted/parted.c:827
+#, fuzzy
+msgid "An extended partition cannot hold a file system. Did you want mkpart?"
+msgstr "Rozšířené oddíly nemohou mít systém souborů. Chtěli jste mkpart?"
+
+#: parted/parted.c:985
+#, fuzzy
+msgid "Can't move an extended partition."
+msgstr "Nemohu přesouvat rozšířené oddíly."
+
+#: parted/parted.c:1014
+msgid "Can't move a partition onto itself. Try using resize, perhaps?"
+msgstr "Nemohu přesunout oddíl na sebe. Možná zkuste použít resize?"
+
+#: parted/parted.c:1158
+#, c-format
+msgid "Minor: %d\n"
+msgstr "Minor: %d\n"
+
+#: parted/parted.c:1159
+#, fuzzy, c-format
+msgid "Flags: %s\n"
+msgstr "Přepínače: "
+
+#: parted/parted.c:1160
+#, c-format
+msgid "File System: %s\n"
+msgstr "Systém souborů: %s\n"
+
+#: parted/parted.c:1161
+#, fuzzy, c-format
+msgid "Size: "
+msgstr "Velikost: %10.3fMb (%d%%)\n"
+
+#: parted/parted.c:1166
+#, fuzzy, c-format
+msgid "Minimum size: "
+msgstr "Minimální velikost: %10.3fMb (%d%%)\n"
+
+#: parted/parted.c:1169
+#, fuzzy, c-format
+msgid "Maximum size: "
+msgstr "Maximální velikost: %10.3fMb (%d%%)\n"
+
+#: parted/parted.c:1255
+#, fuzzy, c-format
+msgid "Disk %s: %s\n"
+msgstr "%s %s %s"
+
+#: parted/parted.c:1256
+#, c-format
+msgid "Sector size (logical/physical): %lldB/%lldB\n"
+msgstr ""
+
+#: parted/parted.c:1267
+#, c-format
+msgid "BIOS cylinder,head,sector geometry: %d,%d,%d. Each cylinder is %s.\n"
+msgstr ""
+
+#: parted/parted.c:1273
+#, fuzzy, c-format
+msgid "Partition Table: %s\n"
+msgstr "Název oddílu?"
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Number"
+msgstr ""
+
+#: parted/parted.c:1284 parted/parted.c:1287
+#, fuzzy
+msgid "Start"
+msgstr "Začátek?"
+
+#: parted/parted.c:1285 parted/parted.c:1288
+#, fuzzy
+msgid "End"
+msgstr "Konec?"
+
+#: parted/parted.c:1288
+#, fuzzy
+msgid "Size"
+msgstr "resize"
+
+#: parted/parted.c:1292
+msgid "Type"
+msgstr ""
+
+#: parted/parted.c:1294
+#, fuzzy
+msgid "File system"
+msgstr "Systém souborů?"
+
+#: parted/parted.c:1297
+#, fuzzy
+msgid "Name"
+msgstr "name"
+
+#: parted/parted.c:1299
+msgid "Flags"
+msgstr "Přepínače"
+
+#: parted/parted.c:1352
+msgid "Free Space"
+msgstr ""
+
+#: parted/parted.c:1441
+#, fuzzy, c-format
+msgid ""
+"A %s %s partition was found at %s -> %s. Do you want to add it to the "
+"partition table?"
+msgstr ""
+"Byl nalezen oddíl %s %s na %.3fMb -> %.3fMb. Chcete jej přidat do tabulky "
+"oddílů?"
+
+#: parted/parted.c:1479
+msgid "searching for file systems"
+msgstr "hledám systémy souborů"
+
+#: parted/parted.c:1684
+msgid "New device?"
+msgstr "Nové zařízení?"
+
+#: parted/parted.c:1709
+#, fuzzy
+msgid "Flag to Invert?"
+msgstr "Přepínač, který změnit?"
+
+#: parted/parted.c:1714
+msgid "New state?"
+msgstr "Nový stav?"
+
+#: parted/parted.c:1747
+msgid "Unit?"
+msgstr ""
+
+#: parted/parted.c:1896
+msgid "check"
+msgstr "check"
+
+#: parted/parted.c:1899
+#, fuzzy
+msgid ""
+"check NUMBER do a simple check on the file system"
+msgstr ""
+"check MINOR provést jednoduchou kontrolu systému souborů"
+
+#: parted/parted.c:1905
+msgid "cp"
+msgstr "cp"
+
+#: parted/parted.c:1908
+#, fuzzy
+msgid ""
+"cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another "
+"partition"
+msgstr ""
+"cp [OD-ZAŘÍZENÍ] OD-MINOR DO-MINOR zkopírovat systém souborů na jiný "
+"oddíl"
+
+#: parted/parted.c:1914
+msgid "help"
+msgstr "help"
+
+#: parted/parted.c:1917
+#, fuzzy
+msgid ""
+"help [COMMAND] prints general help, or help on "
+"COMMAND"
+msgstr ""
+"help [PŘÍKAZ] vypíše obecnou nápovědu nebo nápovědu o PŘÍKAZu"
+
+#: parted/parted.c:1923
+msgid "mklabel"
+msgstr "mklabel"
+
+#: parted/parted.c:1926
+#, fuzzy
+msgid ""
+"mklabel LABEL-TYPE create a new disklabel (partition "
+"table)"
+msgstr ""
+"mklabel TYP-JMENOVKY vytvořit novou jmenovku disku (tabulku oddílů)"
+
+#: parted/parted.c:1932
+msgid "mkfs"
+msgstr "mkfs"
+
+#: parted/parted.c:1935
+#, fuzzy
+msgid ""
+"mkfs NUMBER FS-TYPE make a FS-TYPE file system on "
+"partititon NUMBER"
+msgstr ""
+"mkfs MINOR TYP-FS vytvořit systém souborů FS-TYPE na oddílu MINOR"
+
+#: parted/parted.c:1941
+msgid "mkpart"
+msgstr "mkpart"
+
+#: parted/parted.c:1944
+#, fuzzy
+msgid "mkpart PART-TYPE [FS-TYPE] START END make a partition"
+msgstr "mkpart TYP-ODDÍLU [TYP-FS] ZAČÁTEK KONEC vytvořit oddíl"
+
+#: parted/parted.c:1950
+msgid ""
+"mkpart makes a partition without creating a new file system on the "
+"partition. FS-TYPE may be specified to set an appropriate partition ID.\n"
+msgstr ""
+"mkpart vytvoří oddíl bez vytvoření nového systému souborů na něm. TYP-FS "
+"může být určen pro nastavení odpovídajícího ID oddílu.\n"
+
+#: parted/parted.c:1955
+msgid "mkpartfs"
+msgstr "mkpartfs"
+
+#: parted/parted.c:1958
+#, fuzzy
+msgid ""
+"mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system"
+msgstr ""
+"mkpartfs TYP-ODDÍLU TYP-FS ZAČÁTEK KONEC vytvořit oddíl se systémem souborů"
+
+#: parted/parted.c:1964
+msgid "move"
+msgstr "move"
+
+#: parted/parted.c:1967
+#, fuzzy
+msgid "move NUMBER START END move partition NUMBER"
+msgstr "move MINOR ZAČÁTEK KONEC přesunout oddíl MINOR"
+
+#: parted/parted.c:1972
+msgid "name"
+msgstr "name"
+
+#: parted/parted.c:1975
+#, fuzzy
+msgid "name NUMBER NAME name partition NUMBER as NAME"
+msgstr "name MINOR NÁZEV pojmenovat oddíl MINOR NÁZEV"
+
+#: parted/parted.c:1980
+msgid "print"
+msgstr "print"
+
+#: parted/parted.c:1983
+#, fuzzy
+msgid ""
+"print [free|NUMBER|all] display the partition table, a "
+"partition, or all devices"
+msgstr "print [MINOR] zobrazit tabulku oddílů nebo oddíl"
+
+#: parted/parted.c:1987
+#, fuzzy
+msgid ""
+"Without arguments, print displays the entire partition table. With 'free'\n"
+"argument, information about free space will be displayed otherwise if a\n"
+"partition number is given, then more detailed information is displayed\n"
+"about that partition. If the 'all' argument is passed instead, partition\n"
+"information for all devices will be displayed."
+msgstr ""
+"print bez argumentů zobrazí celou tabulku oddílů. Je-li zadáno číslo oddílu, "
+"zobrazí se o tomto oddílu podrobnější informace.\n"
+
+#: parted/parted.c:1995
+msgid "quit"
+msgstr "quit"
+
+#: parted/parted.c:1998
+#, fuzzy
+msgid "quit exit program"
+msgstr "quit ukončit program"
+
+#: parted/parted.c:2003
+msgid "rescue"
+msgstr "rescue"
+
+#: parted/parted.c:2006
+#, fuzzy
+msgid ""
+"rescue START END rescue a lost partition near START "
+"and END"
+msgstr ""
+"rescue ZAČÁTEK KONEC zachránit ztracený oddíl poblíž ZAČÁTKU a KONCE"
+
+#: parted/parted.c:2012
+msgid "resize"
+msgstr "resize"
+
+#: parted/parted.c:2015
+#, fuzzy
+msgid ""
+"resize NUMBER START END resize partition NUMBER and its "
+"file system"
+msgstr ""
+"resize MINOR ZAČÁTEK KONEC změnit velikost systému souborů na oddílu MINOR"
+
+#: parted/parted.c:2023
+msgid "rm"
+msgstr "rm"
+
+#: parted/parted.c:2026
+#, fuzzy
+msgid "rm NUMBER delete partition NUMBER"
+msgstr "rm MINOR odstranit oddíl MINOR"
+
+#: parted/parted.c:2031
+msgid "select"
+msgstr "select"
+
+#: parted/parted.c:2034
+#, fuzzy
+msgid "select DEVICE choose the device to edit"
+msgstr "select ZAŘÍZENÍ zvolit upravované zařízení"
+
+#: parted/parted.c:2039
+msgid "set"
+msgstr "set"
+
+#: parted/parted.c:2042
+#, fuzzy
+msgid ""
+"set NUMBER FLAG STATE change the FLAG on partition NUMBER"
+msgstr "rm MINOR odstranit oddíl MINOR"
+
+#: parted/parted.c:2048
+msgid "toggle"
+msgstr ""
+
+#: parted/parted.c:2051
+#, fuzzy
+msgid ""
+"toggle [NUMBER [FLAG]] toggle the state of FLAG on "
+"partition NUMBER"
+msgstr "rm MINOR odstranit oddíl MINOR"
+
+#: parted/parted.c:2057
+#, fuzzy
+msgid "unit"
+msgstr "quit"
+
+#: parted/parted.c:2060
+#, fuzzy
+msgid "unit UNIT set the default unit to UNIT"
+msgstr "quit ukončit program"
+
+#: parted/parted.c:2065
+msgid "version"
+msgstr ""
+
+#: parted/parted.c:2068
+msgid ""
+"version displays the current version of GNU "
+"Parted and copyright information"
+msgstr ""
+
+#: parted/parted.c:2072
+msgid ""
+"version displays copyright and version information corressponding to this "
+"copy of GNU Parted\n"
+msgstr ""
+
+#: parted/parted.c:2158
+msgid "No device found"
+msgstr "Nenalezeno žádné zařízení"
+
+#: parted/parted.c:2222
+msgid "Don't forget to update /etc/fstab, if necessary.\n"
+msgstr "Nezapomeňte aktualizovat /etc/fstab, je-li to potřeba.\n"
+
+#: parted/ui.c:68
+msgid "Welcome to GNU Parted! Type 'help' to view a list of commands.\n"
+msgstr ""
+
+#: parted/ui.c:71
+#, fuzzy
+msgid ""
+"Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]\n"
+"Apply COMMANDs with PARAMETERS to DEVICE. If no COMMAND(s) are given, run "
+"in\n"
+"interactive mode.\n"
+msgstr ""
+"Použití: parted [PŘEPÍNAČ]... [ZAŘÍZENÍ [PŘÍKAZ [PARAMETRY]...]...]\n"
+"Provést PŘÍKAZy s PARAMETRY na ZAŘÍZENÍ. Není-li zadán PŘÍKAZ, běží v "
+"interaktivním režimu.\n"
+
+#: parted/ui.c:76
+#, c-format
+msgid ""
+"\n"
+"\n"
+"You found a bug in GNU Parted! Here's what you have to do:\n"
+"\n"
+"Don't panic! The bug has most likely not affected any of your data.\n"
+"Help us to fix this bug by doing the following:\n"
+"\n"
+"Check whether the bug has already been fixed by checking\n"
+"the last version of GNU Parted that you can find at:\n"
+"\n"
+"\thttp://ftp.gnu.org/gnu/parted/\n"
+"\n"
+"Please check this version prior to bug reporting.\n"
+"\n"
+"If this has not been fixed yet or if you don't know how to check,\n"
+"please visit the GNU Parted website:\n"
+"\n"
+"\thttp://www.gnu.org/software/parted\n"
+"\n"
+"for further information.\n"
+"\n"
+"Your report should contain the version of this release (%s)\n"
+"along with the error message below, the output of\n"
+"\n"
+"\tparted DEVICE unit co print unit s print\n"
+"\n"
+"and additional information about your setup you consider important.\n"
+msgstr ""
+
+#: parted/ui.c:230
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_MAPERR (Address not mapped to object)"
+msgstr ""
+
+#: parted/ui.c:235
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_ACCERR (Invalid permissions for mapped object)"
+msgstr ""
+
+#: parted/ui.c:240
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGSEGV signal was encountered."
+msgstr ""
+
+#: parted/ui.c:258
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTDIV (Integer: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:262
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTOVF (Integer: overflow)"
+msgstr ""
+
+#: parted/ui.c:266
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTDIV (Float: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:270
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTOVF (Float: overflow)"
+msgstr ""
+
+#: parted/ui.c:274
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTUND (Float: underflow)"
+msgstr ""
+
+#: parted/ui.c:278
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTRES (Float: inexact result)"
+msgstr ""
+
+#: parted/ui.c:282
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTINV (Float: invalid operation)"
+msgstr ""
+
+#: parted/ui.c:286
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTSUB (Float: subscript out of range)"
+msgstr ""
+
+#: parted/ui.c:291
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGFPE signal was encountered."
+msgstr ""
+
+#: parted/ui.c:310
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPC (Illegal Opcode)"
+msgstr ""
+
+#: parted/ui.c:314
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPN (Illegal Operand)"
+msgstr ""
+
+#: parted/ui.c:318
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLADR (Illegal addressing mode)"
+msgstr ""
+
+#: parted/ui.c:323
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLTRP (Illegal Trap)"
+msgstr ""
+
+#: parted/ui.c:327
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVOPC (Privileged Opcode)"
+msgstr ""
+
+#: parted/ui.c:331
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVREG (Privileged Register)"
+msgstr ""
+
+#: parted/ui.c:335
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_COPROC (Coprocessor Error)"
+msgstr ""
+
+#: parted/ui.c:339
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_BADSTK (Internal Stack Error)"
+msgstr ""
+
+#: parted/ui.c:343
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGILL signal was encountered."
+msgstr ""
+
+#: parted/ui.c:828
+msgid "Expecting a partition number."
+msgstr "Očekávám číslo oddílu."
+
+#: parted/ui.c:837
+msgid "Partition doesn't exist."
+msgstr "Oddíl neexistuje."
+
+#: parted/ui.c:857
+msgid "Expecting a file system type."
+msgstr "Očekávám typ systému souborů."
+
+#: parted/ui.c:863
+#, c-format
+msgid "Unknown file system type \"%s\"."
+msgstr "Neznámý typ systému souborů \"%s\"."
+
+#: parted/ui.c:883
+msgid "Expecting a disk label type."
+msgstr "Očekávám typ jmenovky disku."
+
+#: parted/ui.c:977
+msgid "Can't create any more partitions."
+msgstr "Nemohu vytvářet další oddíly."
+
+#: parted/ui.c:987
+msgid "Expecting a partition type."
+msgstr "Očekávám typ oddílu."
+
+#: parted/ui.c:1115
+msgid "on"
+msgstr "on"
+
+#: parted/ui.c:1116
+msgid "off"
+msgstr "off"
+
+#: parted/ui.c:1227
+msgid "OPTIONs:"
+msgstr "PŘEPÍNAČe:"
+
+#: parted/ui.c:1230
+msgid "COMMANDs:"
+msgstr "PŘÍKAZy:"
+
+#: parted/ui.c:1238
+#, c-format
+msgid "Using %s\n"
+msgstr "Používám %s\n"
+
+#, fuzzy
+#~ msgid ""
+#~ "This ext2 file system has a rather strange layout! Parted can't resize "
+#~ "this (yet)."
+#~ msgstr ""
+#~ "Tento systém souborů ext2 má poněkud zvláštní rozložení! Parted (ještě) "
+#~ "neumí změnit jeho velikost."
+
+#~ msgid "IDE"
+#~ msgstr "IDE"
+
+#, fuzzy
+#~ msgid "Disk geometry for %s: %s - %s\n"
+#~ msgstr "Geometrie disku pro %s: 0.000-%.3f megabajtů\n"
+
+#~ msgid "Disk label type: %s\n"
+#~ msgstr "Typ jmenovky disku: %s\n"
+
+#, fuzzy
+#~ msgid "set NUMBER FLAG STATE change a flag on partition NUMBER"
+#~ msgstr "set MINOR PŘEPÍNAČ STAV změnit přepínač na oddílu MINOR"
+
+#, fuzzy
+#~ msgid ""
+#~ "The sector size on %s is %d bytes. Parted is known not to work properly "
+#~ "with drives with sector sizes other than %d bytes."
+#~ msgstr ""
+#~ "Velikost sektoru na %s je %d bajtů. Ví se, že parted nepracuje správně s "
+#~ "disky s velikostí sektoru jinou než %d bajtů"
+
+#~ msgid ""
+#~ "You found a bug in GNU Parted. Please email a bug report to bug-"
+#~ "parted@gnu.org containing the version (%s), and the following message:\n"
+#~ msgstr ""
+#~ "Našli jste chybu v GNU parted. Pošlete prosím e-mailem hlášení o chybě na "
+#~ "bug-parted@gnu.org obsahující verzi (%s) a následující zprávu:\n"
+
+#, fuzzy
+#~ msgid ""
+#~ "You requested to create a partition at %s - %s. The closest Parted can "
+#~ "manage is %s - %s."
+#~ msgstr ""
+#~ "Požadovali jste vytvoření oddílu na %.3f-%.3fMb. Nejbližší, co Parted "
+#~ "může zvládnout, je %.3f-%.3fMb."
+
+#, fuzzy
+#~ msgid ""
+#~ "You requested to resize the partition to %s - %s. The closest Parted can "
+#~ "manage is %s - %s."
+#~ msgstr ""
+#~ "Požadovali jste změnu velikosti oddílu na %.3f-%.3fMb. Nejbližší, co "
+#~ "Parted může zvládnout, je %.3f-%.3fMb."
+
+#~ msgid "SCSI"
+#~ msgstr "SCSI"
+
+#~ msgid "File system has an invalid signature for a FAT file systems."
+#~ msgstr "Systém souborů má neplatný podpis pro systémy souborů FAT."
+
+#~ msgid "Minor Start End "
+#~ msgstr "Minor Začátek Konec "
+
+#~ msgid "Type "
+#~ msgstr "Typ "
+
+#~ msgid "Filesystem "
+#~ msgstr "Sys souborů "
+
+#~ msgid "Name "
+#~ msgstr "Název "
+
+#~ msgid "Device %s is neither a SCSI nor IDE drive."
+#~ msgstr "Zařízení %s není disk SCSI ani IDE."
+
+#~ msgid "Error reading %s (%s) to determine if partition is mounted."
+#~ msgstr "Chyba při čtení %s (%s) pro určení, jestli je oddíl připojen."
+
+#~ msgid ""
+#~ "Unable to determine if partitions are mounted via /proc/mounts or /etc/"
+#~ "mtab. Make sure you don't attempt to resize or modify mounted file "
+#~ "systems. (Even read-only mounted)"
+#~ msgstr ""
+#~ "Nemohu určit pomocí /proc/mounts nebo /etc/mtab, jestli jsou oddíly "
+#~ "připojeny. Přesvědčte se, že se nepokoušíte změnit velikost nebo měnit "
+#~ "připojené soubory souborů. (I připojené jen pro čtení)"
+
+#~ msgid ""
+#~ "Partition %s is being used. Modifying it while it is in use could cause "
+#~ "severe corruption."
+#~ msgstr ""
+#~ "Oddíl %s je používán. Úpravy oddílu, který je používán, mohou vést k "
+#~ "vážnému poškození dat."
+
+#~ msgid "Could not read geometry of %s - %s."
+#~ msgstr "Nemohu přečíst geometrii %s - %s."
+
+#~ msgid "Device %s has dodgey geometry."
+#~ msgstr "Zařízení %s má riskantní geometrii."
+
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. However, the most likely reason is that Linux "
+#~ "detected the BIOS geometry for %s incorrectly. GNU Parted suspects the "
+#~ "real geometry should be %d/%d/%d (not %d/%d/%d). You should check with "
+#~ "your BIOS first, as this may not be correct. You can inform Linux by "
+#~ "adding the parameter %s=%d,%d,%d to the command line. See the LILO or "
+#~ "GRUB documentation for more information. If you think Parted's suggested "
+#~ "geometry is correct, you may select Ignore to continue (and fix Linux "
+#~ "later). Otherwise, select Cancel (and fix Linux and/or the BIOS now)."
+#~ msgstr ""
+#~ "Tabulka oddílů na %s není konzistentní. To se může stát z mnoha důvodů. "
+#~ "Nejpravděpodobnější důvod je, že Linux nesprávně detekoval geometrii "
+#~ "BIOSu pro %s. GNU Parted má podezření, že skutečná geometrie by měla být %"
+#~ "d/%d/%d (ne %d/%d/%d). Měli byste to nejdřív zkontrolovat ve svém BIOSu, "
+#~ "protože to možná není správně. Linux můžete informovat přidáním parametru "
+#~ "%s=%d,%d%d na příkazovém řádku. Pro více informací viz dokumentaci o LILO "
+#~ "nebo GRUB. Jestliže si myslíte, že geometrie Partedu je správná, můžete "
+#~ "pokračovat zvolením Ignorovat (a opravit Linux později). V opačném "
+#~ "případě zvolte Zrušit (a opravte Linux a/nebo BIOS hned)."
+
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. Often, the reason is that Linux detected the "
+#~ "BIOS geometry incorrectly. However, this does not appear to be the case "
+#~ "here. It is safe to ignore,but ignoring may cause (fixable) problems "
+#~ "with some boot loaders, and may cause problems with FAT file systems. "
+#~ "Using LBA is recommended."
+#~ msgstr ""
+#~ "Tabulka oddílů na %s není konzistentní. To se může stát z mnoha důvodů. "
+#~ "Často se stává, že Linux nesprávně detekuje geometrii BIOSu. To ale není "
+#~ "tento případ. Můžete problém bez obav ignorovat, ale jeho ignorování může "
+#~ "způsobit (opravitelné) problémy s některými zavaděči systému a může "
+#~ "způsobit problémy se systémy souborů FAT. Doporučuje se používat LBA."
+
+#~ msgid ""
+#~ "Unable to align partition properly. This probably means that another "
+#~ "partitioning tool generated an incorrect partition table, because it "
+#~ "didn't have the correct BIOS geometry. It is safe to ignore,but ignoring "
+#~ "may cause (fixable) problems with some boot loaders."
+#~ msgstr ""
+#~ "Nemohu správně zarovnat oddíl. To pravděpodobně znamená, že jiný nástroj "
+#~ "na tvorbu oddílů vygeneroval nesprávnou tabulku oddílů, protože neměl "
+#~ "správnou geometrii BIOSu. Tento problém můžete bez obav ignorovat, ale "
+#~ "jeho ignorování může způsobit (opravitelné) problémy s některými zavaděči "
+#~ "systému."
+
+#~ msgid ""
+#~ " You have Windows FAT partition(s) that are not using LBA. If your BIOS "
+#~ "supports LBA, then you should switch to LBA by setting the LBA flag on "
+#~ "all FAT partitions. Otherwise, make sure the operating system and the "
+#~ "BIOS have the same geometry before resizing any FAT partitions."
+#~ msgstr ""
+#~ "Máte oddíl(y) Windows FAT, které nepoužívají LBA. Pokud váš BIOS "
+#~ "podporuje LBA, měli byste přejít na LBA nastavením přepínače LBA na všech "
+#~ "oddílech FAT. V opačném případě se před změnou velikosti oddílů FAT "
+#~ "přesvědčete, že operační systém a BIOS mají stejnou geometrii."
+
+#~ msgid ""
+#~ "The operating system thinks the geometry on %s is %d/%d/%d. Therefore, "
+#~ "cylinder 1024 ends at %.3fM.%s"
+#~ msgstr ""
+#~ "Operační systém si myslí, že geometrie na %s je %d/%d/%d. Cylindr 1024 "
+#~ "tedy končí na %.3fM.%s"
+
+#~ msgid "The operating system thinks the geometry on %s is %d/%d/%d.%s"
+#~ msgstr "Operační systém si myslí, že geometrie na %s je %d/%d/%d.%s"
diff --git a/po/da.po b/po/da.po
new file mode 100644
index 0000000..f32c505
--- /dev/null
+++ b/po/da.po
@@ -0,0 +1,2737 @@
+# Danish messages for parted
+# Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+# Keld Simonsen <keld@dkuug.dk>, 2001-2002.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: parted 1.6.5-pre1\n"
+"Report-Msgid-Bugs-To: bug-parted@gnu.org\n"
+"POT-Creation-Date: 2006-04-21 21:20+0200\n"
+"PO-Revision-Date: 2003-01-17 17:09+0200\n"
+"Last-Translator: Keld Simonsen <keld@dkuug.dk>\n"
+"Language-Team: Danish <dansk@klid.dk>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=iso-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: libparted/arch/linux.c:284
+#, c-format
+msgid "Could not stat device %s - %s."
+msgstr "Kunne ikke tage status p enheden %s - %s."
+
+#: libparted/arch/linux.c:390
+#, c-format
+msgid ""
+"Could not determine sector size for %s: %s.\n"
+"Using the default sector size (%lld)."
+msgstr ""
+
+#: libparted/arch/linux.c:401
+#, c-format
+msgid ""
+"Device %s has a logical sector size of %lld. Not all parts of GNU Parted "
+"support this at the moment, and the working code is HIGHLY EXPERIMENTAL.\n"
+msgstr ""
+
+#: libparted/arch/linux.c:441
+#, fuzzy, c-format
+msgid "Unable to determine the size of %s (%s)."
+msgstr "Kunne ikke bestemme strrelsen p %s (%s)"
+
+#: libparted/arch/linux.c:530
+#, c-format
+msgid "Could not get identity of device %s - %s"
+msgstr "Kunne ikke finde identitet for enhed %s - %s"
+
+#: libparted/arch/linux.c:539
+msgid "Generic IDE"
+msgstr ""
+
+#: libparted/arch/linux.c:556
+#, c-format
+msgid ""
+"Device %s has multiple (%d) logical sectors per physical sector.\n"
+"GNU Parted supports this EXPERIMENTALLY for some special disk label/file "
+"system combinations, e.g. GPT and ext2/3.\n"
+"Please consult the web site for up-to-date information."
+msgstr ""
+
+#: libparted/arch/linux.c:726
+#, c-format
+msgid "Error initialising SCSI device %s - %s"
+msgstr "En fejl opstod ved initiering af SCSI-enheden %s - %s"
+
+#: libparted/arch/linux.c:781
+#, fuzzy, c-format
+msgid ""
+"The device %s has zero length, and can't possibly store a file system or "
+"partition table. Perhaps you selected the wrong device?"
+msgstr ""
+"Enheden %s har lngden nul, og kan slet ikke indeholde et filsystem eller en "
+"partitionstabel. Mske har du valgt den forkerte enhed?"
+
+#: libparted/arch/linux.c:829
+msgid ""
+"Unable to determine geometry of file/device. You should not use Parted "
+"unless you REALLY know what you're doing!"
+msgstr ""
+"Kunne ikke bestemme geometrien p filen/enheden. Du br ikke bruge Parted "
+"hvis du ikke er RIGTIGT sikker p hvad du gr!"
+
+#: libparted/arch/linux.c:903
+msgid "DAC960 RAID controller"
+msgstr "Styrekort for DAC960 RAID"
+
+#: libparted/arch/linux.c:908
+msgid "Compaq Smart Array"
+msgstr "Compaq Smart Array"
+
+#: libparted/arch/linux.c:913
+msgid "ATARAID Controller"
+msgstr "Styrekort for ATARAID"
+
+#: libparted/arch/linux.c:918
+msgid "I2O Controller"
+msgstr "I2O-styrekort"
+
+#: libparted/arch/linux.c:923
+msgid "User-Mode Linux UBD"
+msgstr ""
+
+#: libparted/arch/linux.c:933
+msgid "Unknown"
+msgstr "Ukendt"
+
+#: libparted/arch/linux.c:940
+msgid "ped_device_new() Unsupported device type"
+msgstr "ped_device_new() Understttelse mangler for denne enhedstype"
+
+#: libparted/arch/linux.c:1041 libparted/arch/gnu.c:264
+#, c-format
+msgid "Error opening %s: %s"
+msgstr "En fejl opstod da %s bnedes: %s"
+
+#: libparted/arch/linux.c:1052 libparted/arch/gnu.c:274
+#, c-format
+msgid "Unable to open %s read-write (%s). %s has been opened read-only."
+msgstr ""
+"Kunne ikke bne %s for bde lsning og skrivning (%s). %s bnedes i "
+"lsetilstand."
+
+#: libparted/arch/linux.c:1160 libparted/arch/linux.c:1228
+#: libparted/arch/gnu.c:452 libparted/arch/gnu.c:550 libparted/arch/gnu.c:678
+#, c-format
+msgid "%s during read on %s"
+msgstr "%s under lsning p %s"
+
+#: libparted/arch/linux.c:1199
+#, c-format
+msgid "%s during seek for read on %s"
+msgstr "%s under positionering for at lse p %s"
+
+#: libparted/arch/linux.c:1270 libparted/arch/linux.c:1355
+#: libparted/arch/linux.c:1413 libparted/arch/gnu.c:587
+#: libparted/arch/gnu.c:632 libparted/arch/gnu.c:709
+#, c-format
+msgid "%s during write on %s"
+msgstr "%s under skrivning p %s"
+
+#: libparted/arch/linux.c:1297 libparted/arch/gnu.c:512
+#, c-format
+msgid "Can't write to %s, because it is opened read-only."
+msgstr "Kan ikke skrive til %s eftersom den kun er bnet i lsetilstand."
+
+#: libparted/arch/linux.c:1321
+#, c-format
+msgid "%s during seek for write on %s"
+msgstr "%s under positionering for at skrive p %s"
+
+#: libparted/arch/linux.c:1798
+#, fuzzy, c-format
+msgid ""
+"Error informing the kernel about modifications to partition %s -- %s. This "
+"means Linux won't know about any changes you made to %s until you reboot -- "
+"so you shouldn't mount it or use it in any way before rebooting."
+msgstr ""
+"Fejl vel underretning af kernen om ndringer p partition %s - %s. Dette "
+"betyder at Linux ikke vd noget som helst om de ndringer du lavede p %s "
+"fr du genopstarter - s du br ikke montere den eller bruge den p nogen "
+"mde fr du har genstartet."
+
+#: libparted/arch/linux.c:1879
+#, fuzzy, c-format
+msgid ""
+"The kernel was unable to re-read the partition table on %s (%s). This means "
+"Linux won't know anything about the modifications you made until you "
+"reboot. You should reboot your computer before doing anything with %s."
+msgstr ""
+"Kernen kunne ikke genindlse partitionstabellen p %s (%s). Det betyder at "
+"Linux ikke vd noget som helst om de ndringer du lavede fr du "
+"genopstarter. Du br genstarte maskinen inden du gr noget som helst med %s."
+
+#: libparted/arch/gnu.c:97
+#, c-format
+msgid "Unable to open %s."
+msgstr "Kunne ikke bne %s."
+
+#: libparted/arch/gnu.c:117
+msgid "Unable to probe store."
+msgstr "Kunne ikke undersge lageret."
+
+#: libparted/arch/gnu.c:355
+#, fuzzy
+msgid ""
+"The partition table cannot be re-read. This means you need to reboot before "
+"mounting any modified partitions. You also need to reinstall your boot "
+"loader before you reboot (which may require mounting modified partitions). "
+"It is impossible do both things! So you'll need to boot off a rescue disk, "
+"and reinstall your boot loader from the rescue disk. Read section 4 of the "
+"Parted User documentation for more information."
+msgstr ""
+"Partitionstabellen kunne ikke genindlses, s derfor skal du starte maskine "
+"op igen inden du kan montere nogen ndrede partitioner. Du skal ogs "
+"geninstallere opstartsprogrammet inden du genstarter (hvilket kan indebre "
+"montering af ndrede partitioner). Det er umuligt at gre begge dele! S du "
+"skal starte fra en redningsdiskette og geninstallere opstartsprogrammet fra "
+"redningsdisketten. Ls kapitel 4 i Parteds brugermanual for mere information."
+
+#: libparted/arch/gnu.c:372
+#, fuzzy, c-format
+msgid ""
+"The partition table on %s cannot be re-read (%s). This means the Hurd knows "
+"nothing about any modifications you made. You should reboot your computer "
+"before doing anything with %s."
+msgstr ""
+"partitionstabellen p %s (%s). Det betyder at Linux ikke vd noget som helst "
+"om de ndringer du lavede. Du br genstarte maskinen inden du gr noget som "
+"helst med %s."
+
+#: libparted/arch/gnu.c:383 parted/parted.c:2215
+msgid ""
+"You should reinstall your boot loader before rebooting. Read section 4 of "
+"the Parted User documentation for more information."
+msgstr ""
+"Du br geninstallere opstartsprogrammet inden du genopstarter. Ls sektion 4 "
+"i Parteds brugermanual for mere information."
+
+#: libparted/arch/gnu.c:774
+#, c-format
+msgid "%s trying to sync %s to disk"
+msgstr "%s prver at synkronisere %s med disk"
+
+#: libparted/disk.c:183
+#, c-format
+msgid "Unable to open %s - unrecognised disk label."
+msgstr "Kan ikke bne %s - ukendt filallokeringstabel."
+
+#: libparted/disk.c:452
+#, c-format
+msgid ""
+"This libparted doesn't have write support for %s. Perhaps it was compiled "
+"read-only."
+msgstr ""
+"Denne libparted har ikke skriveunderstttelse for %s. Mske var den oversat "
+"skrivebeskyttet."
+
+#: libparted/disk.c:579
+#, fuzzy, c-format
+msgid "Partition %d is %s, but the file system is %s."
+msgstr "Partition %d er %.3fMb, men filsystemet er %.3fMb."
+
+#: libparted/disk.c:1056
+#, c-format
+msgid "%s disk labels do not support extended partitions."
+msgstr "Filallokeringstabeller for %s understtter ikke udvidede partitioner."
+
+#: libparted/disk.c:1616
+#, c-format
+msgid "%s disk labels don't support logical or extended partitions."
+msgstr ""
+"Filallokeringstabeller for %s understtter ikke logiske eller udvidede "
+"partitioner."
+
+#: libparted/disk.c:1629
+#, fuzzy
+msgid "Too many primary partitions."
+msgstr "For mange primre partitioner"
+
+#: libparted/disk.c:1638
+#, c-format
+msgid ""
+"Can't add a logical partition to %s, because there is no extended partition."
+msgstr ""
+"Kan ikke tilfje en logisk partition til %s, da der mangler en udvidet "
+"partition."
+
+#: libparted/disk.c:1662
+#, fuzzy, c-format
+msgid "Can't have more than one extended partition on %s."
+msgstr "Kan ikke have mere end n udvidet partition p %s"
+
+#: libparted/disk.c:1672
+msgid "Can't have logical partitions outside of the extended partition."
+msgstr "Kan ikke have logiske partitioner udenfor den udvidede partition."
+
+#: libparted/disk.c:1697
+#, c-format
+msgid "Can't have a logical partition outside of the extended partition on %s."
+msgstr ""
+"Kan ikke have en logisk partition udenfor den udvidede partition p %s."
+
+#: libparted/disk.c:1707 libparted/disk.c:1761 libparted/disk.c:1927
+#, fuzzy
+msgid "Can't have overlapping partitions."
+msgstr "Kan ikke have overlappende partitioner."
+
+#: libparted/disk.c:1715
+msgid "Can't have a primary partition inside an extended partition."
+msgstr "Kan ikke have en primr partition inden i en udvidet partition."
+
+#: libparted/disk.c:2123
+msgid "metadata"
+msgstr "metadata"
+
+#: libparted/disk.c:2125
+msgid "free"
+msgstr "ledigt"
+
+#: libparted/disk.c:2127 parted/ui.c:968 parted/ui.c:996
+msgid "extended"
+msgstr "udvidet"
+
+#: libparted/disk.c:2129 parted/ui.c:972 parted/ui.c:1000
+msgid "logical"
+msgstr "logisk"
+
+#: libparted/disk.c:2131 parted/ui.c:964 parted/ui.c:992
+msgid "primary"
+msgstr "primr"
+
+#: libparted/disk.c:2147
+msgid "boot"
+msgstr "start"
+
+#: libparted/disk.c:2149
+msgid "root"
+msgstr "rod"
+
+#: libparted/disk.c:2151
+msgid "swap"
+msgstr "swapplads"
+
+#: libparted/disk.c:2153
+msgid "hidden"
+msgstr "skjult"
+
+#: libparted/disk.c:2155
+msgid "raid"
+msgstr "raid"
+
+#: libparted/disk.c:2157
+msgid "lvm"
+msgstr "lvm"
+
+#: libparted/disk.c:2159
+msgid "lba"
+msgstr "lba"
+
+#: libparted/disk.c:2161
+msgid "hp-service"
+msgstr "hp-service"
+
+#: libparted/disk.c:2163
+msgid "palo"
+msgstr ""
+
+#: libparted/disk.c:2165
+#, fuzzy
+msgid "prep"
+msgstr "start"
+
+#: libparted/disk.c:2167
+msgid "msftres"
+msgstr ""
+
+#: libparted/disk.c:2173
+#, fuzzy, c-format
+msgid "Unknown partition flag, %d."
+msgstr "Ukendt partitionsflag, %d."
+
+#: libparted/labels/rdb.c:177
+#, c-format
+msgid "%s : Bad checksum on block %llu of type %s."
+msgstr ""
+
+#: libparted/labels/rdb.c:510
+#, c-format
+msgid "%s : Didn't find rdb block, should never happen."
+msgstr ""
+
+#: libparted/labels/rdb.c:595
+#, c-format
+msgid "%s : Loop detected at block %d."
+msgstr ""
+
+#: libparted/labels/rdb.c:614
+#, c-format
+msgid "%s : The %s list seems bad at block %s."
+msgstr ""
+
+#: libparted/labels/rdb.c:703
+#, c-format
+msgid "%s : Failed to list bad blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:711
+#, c-format
+msgid "%s : Failed to list partition blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:719
+#, c-format
+msgid "%s : Failed to list file system blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:727
+#, c-format
+msgid "%s : Failed to list boot blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:750
+#, fuzzy, c-format
+msgid "Failed to write partition block at %d."
+msgstr "Kan ikke bestemme om partitionen er monteret."
+
+#: libparted/labels/rdb.c:1053 libparted/labels/bsd.c:505
+#: libparted/labels/dos.c:1942 libparted/labels/dvh.c:772
+#: libparted/labels/gpt.c:1365 libparted/labels/loop.c:251
+#: libparted/labels/mac.c:1318 libparted/labels/pc98.c:764
+#: libparted/labels/sun.c:704
+msgid "Unable to satisfy all constraints on the partition."
+msgstr "Kunne ikke opfylde alle begrnsninger p partitionen."
+
+#: libparted/labels/rdb.c:1081
+#, fuzzy
+msgid "Unable to allocate a partition number."
+msgstr "Forventer et partitionsnummer."
+
+#: libparted/labels/bsd.c:530
+#, fuzzy
+msgid "Unable to allocate a bsd disklabel slot."
+msgstr "Kan ikke tildele en plads til bsd-disketikette"
+
+#: libparted/labels/dos.c:812
+#, fuzzy, c-format
+msgid "Invalid partition table on %s -- wrong signature %x."
+msgstr "Ugyldig partitionstabel p %s - fejlagtig signatur %x"
+
+#: libparted/labels/dos.c:840
+#, c-format
+msgid "Invalid partition table - recursive partition on %s."
+msgstr "Ugyldig partitionstabel - rekursiv partition p %s."
+
+#: libparted/labels/dos.c:1300
+#, fuzzy
+msgid "Extended partitions cannot be hidden on msdos disk labels."
+msgstr "Ext2-partitioner kan ikke gemmes i filsystemer af typen msdos."
+
+#: libparted/labels/dos.c:1926
+msgid "Parted can't resize partitions managed by Windows Dynamic Disk."
+msgstr ""
+
+#: libparted/labels/dvh.c:192
+#, fuzzy, c-format
+msgid "%s has no extended partition (volume header partition)."
+msgstr ""
+"%s har ingen udvidet partition (bindhoved-partition). Hvis du ignorerer "
+"dette vil alle opstarts-bind blive slettet."
+
+#: libparted/labels/dvh.c:315
+msgid "Checksum is wrong, indicating the partition table is corrupt."
+msgstr ""
+"Tjeksummen er forkert, og det tyder p at partitionstabellen er delagt."
+
+#: libparted/labels/dvh.c:616
+msgid "Only primary partitions can be root partitions."
+msgstr "Kun primre partitioner kan vre rod-partitioner."
+
+#: libparted/labels/dvh.c:630
+msgid "Only primary partitions can be swap partitions."
+msgstr "Kun primre partitioner kan vre swap-partitioner."
+
+#: libparted/labels/dvh.c:644
+msgid "Only logical partitions can be a boot file."
+msgstr "Kun logiske partitioner kan vre en opstatsfil."
+
+#: libparted/labels/dvh.c:723
+msgid "Only logical partitions (boot files) have a name."
+msgstr "Kun logiske partitioner (opstartsfiler) har et navn."
+
+#: libparted/labels/dvh.c:814
+msgid "Too many primary partitions"
+msgstr "For mange primre partitioner"
+
+#: libparted/labels/gpt.c:433
+#, fuzzy, c-format
+msgid ""
+"%s contains GPT signatures, indicating that it has a GPT table. However, it "
+"does not have a valid fake msdos partition table, as it should. Perhaps it "
+"was corrupted -- possibly by a program that doesn't understand GPT partition "
+"tables. Or perhaps you deleted the GPT table, and are now using an msdos "
+"partition table. Is this a GPT partition table?"
+msgstr ""
+"%s indeholder GPT-signaturer, der tyder p at den har en GPT-tabel. "
+"Imidlertid har den ikke en gyldig falsk msdos-partitionstabel som den burde. "
+"Mske er den delagt - muligvis af et program der ikke forstr GPT-"
+"partitionstabeller. Eller mske slettede du GPT-tabellen, og bruger nu en "
+"msdos-partitionstabel. Er dette en GPT-tabel?"
+
+#: libparted/labels/gpt.c:625
+#, fuzzy, c-format
+msgid ""
+"The format of the GPT partition table is version %x, which is newer than "
+"what Parted can recognise. Please tell us! bug-parted@gnu.org"
+msgstr ""
+"Formatet p GPT-partitionstabellen er nyere end hvad Parted kan genkende. "
+"Fortl os om det! bug-parted@gnu.org"
+
+#: libparted/labels/gpt.c:747
+msgid ""
+"The backup GPT table is not at the end of the disk, as it should be. This "
+"might mean that another operating system believes the disk is smaller. Fix, "
+"by moving the backup to the end (and removing the old backup)?"
+msgstr ""
+"Sikkerhedskopien af GPT-tabellen er ikke i slutningen af disken, som den "
+"burde vre. Dette kan betyde at et andet styresystem tror disken er mindre. "
+"Skal det rettes ved at flytte sikkerhedskopien til slutningen (og fjerne den "
+"gamle sikkerhedskopi)?"
+
+#: libparted/labels/gpt.c:782
+#, fuzzy
+msgid ""
+"The primary GPT table is corrupt, but the backup appears OK, so that will be "
+"used."
+msgstr ""
+"Den primre GPT-tabel er delagt, men sikkerhedskopien ser ud til at vre i "
+"orden, s den vil blive brugt."
+
+#: libparted/labels/gpt.c:790
+#, fuzzy
+msgid ""
+"Both the primary and backup GPT tables are corrupt. Try making a fresh "
+"table, and using Parted's rescue feature to recover partitions."
+msgstr ""
+"Bde den primre GPT-tabel og sikkerhedskopien er delagt. Prv at lave en "
+"frisk tabel, og at genskabe partitioner med Parteds redningsfacilitet."
+
+#: libparted/labels/mac.c:167
+#, c-format
+msgid "Invalid signature %x for Mac disk labels."
+msgstr "Ugyldig signatur %x for en filallokeringstabel for Mac."
+
+#: libparted/labels/mac.c:212
+msgid "Partition map has no partition map entry!"
+msgstr "Partitionstabellen mangler oplysninger om sig selv!"
+
+#: libparted/labels/mac.c:259
+#, c-format
+msgid "%s is too small for a Mac disk label!"
+msgstr "%s er for lille for en filallokeringstabel for Mac!"
+
+#: libparted/labels/mac.c:490
+#, c-format
+msgid "Partition %d has an invalid signature %x."
+msgstr "Partition %d har en ugyldig signatur %x."
+
+#: libparted/labels/mac.c:508
+#, c-format
+msgid "Partition %d has an invalid length of 0 bytes!"
+msgstr "Partition %d har en ugyldig lngde, 0 byte!"
+
+#: libparted/labels/mac.c:536
+#, fuzzy
+msgid "The data region doesn't start at the start of the partition."
+msgstr "Dataomrdet begynder ikke ved partitionens begyndelse"
+
+#: libparted/labels/mac.c:553
+#, fuzzy
+msgid "The boot region doesn't start at the start of the partition."
+msgstr "Startomrdet begynder ikke ved partitionens begyndelse"
+
+#: libparted/labels/mac.c:567
+msgid "The partition's boot region doesn't occupy the entire partition."
+msgstr "Partitionens startomrde optager ikke hele partitionens plads."
+
+#: libparted/labels/mac.c:577
+msgid "The partition's data region doesn't occupy the entire partition."
+msgstr "Partitionens dataomrde optager ikke hele partitionens plads."
+
+#: libparted/labels/mac.c:631
+#, c-format
+msgid ""
+"Weird block size on device descriptor: %d bytes is not divisible by 512."
+msgstr ""
+"Mrkelig blokstrrelse p enhedens beskriver: %d byte er ikke helt delbart "
+"med 512."
+
+#: libparted/labels/mac.c:644
+#, c-format
+msgid ""
+"The driver descriptor says the physical block size is %d bytes, but Linux "
+"says it is %d bytes."
+msgstr ""
+"Enhedens beskriver pstr at den fysiske blokstrrelse er %d byte, men Linux "
+"pstr at den er %d byte."
+
+#: libparted/labels/mac.c:692
+msgid "No valid partition map found."
+msgstr "Ingen gyldig partitionstabel kunne findes."
+
+#: libparted/labels/mac.c:744
+#, fuzzy, c-format
+msgid ""
+"Conflicting partition map entry sizes! Entry 1 says it is %d, but entry %d "
+"says it is %d!"
+msgstr ""
+"Konfliktende strrelsesdata i partitionstabellen! Post 1 pstr den er %d, "
+"mens post %d pstr den er %d!"
+
+#: libparted/labels/mac.c:771
+#, fuzzy
+msgid "Weird! There are 2 partitions map entries!"
+msgstr "Mrkeligt - 2 poster i partitionstabellen!"
+
+#: libparted/labels/mac.c:1257
+msgid ""
+"Changing the name of a root or swap partition will prevent Linux from "
+"recognising it as such."
+msgstr ""
+"At ndre navnet p en rod- eller swappartition gr at Linux ikke kan "
+"genkende dem."
+
+#: libparted/labels/mac.c:1353
+#, fuzzy
+msgid "Can't add another partition -- the partition map is too small!"
+msgstr ""
+"Kan ikke tilfje endnu en primr partition - partitionstabellen er for lille."
+
+#: libparted/labels/pc98.c:357
+#, fuzzy, c-format
+msgid "Invalid partition table on %s."
+msgstr "Ugyldig partitionstabel p %s"
+
+#: libparted/labels/pc98.c:409 libparted/labels/pc98.c:487
+#, fuzzy, c-format
+msgid ""
+"Partition %d isn't aligned to cylinder boundaries. This is still "
+"unsupported."
+msgstr ""
+"Partitionen %d ligger ikke p hel cylindergrnse. Skal tilfje "
+"understttelse for dette."
+
+#: libparted/labels/pc98.c:796
+msgid "Can't add another partition."
+msgstr "Kan ikke tilfje endnu en partition."
+
+#: libparted/labels/sun.c:143
+msgid "Corrupted Sun disk label detected."
+msgstr "En beskadiget Sun disk-etikette blev fundet."
+
+#: libparted/labels/sun.c:264
+#, fuzzy, c-format
+msgid ""
+"The disk CHS geometry (%d,%d,%d) reported by the operating system does not "
+"match the geometry stored on the disk label (%d,%d,%d)."
+msgstr ""
+"Disk CHS-geometrien (%d,%d,%d) passer ikke med geometrien gemt p disk-"
+"etiketten (%d,%d,%d)."
+
+#: libparted/labels/sun.c:286
+#, c-format
+msgid "The disk label describes a disk bigger than %s."
+msgstr "Disk-etiketten beskriver en disk strre end %s."
+
+#: libparted/labels/sun.c:440
+#, c-format
+msgid "The disk has %d cylinders, which is greater than the maximum of 65536."
+msgstr ""
+
+#: libparted/labels/sun.c:736
+msgid ""
+"The Whole Disk partition is the only available one left. Generally, it is "
+"not a good idea to overwrite this partition with a real one. Solaris may "
+"not be able to boot without it, and SILO (the sparc boot loader) appreciates "
+"it as well."
+msgstr ""
+"Hele disk-partitionen er den eneste tilbagevrende, der er tilgngelig. "
+"Generelt er det ikke en god id at overskrive denne partition med en rigtig "
+"n. Solaris vil muligvis ikke kunne starte op uden den, og SILO "
+"(opstartsprogrammet for Sparc) stter ogs pris p den."
+
+#: libparted/labels/sun.c:751
+msgid "Sun disk label is full."
+msgstr "Sun disk-etikette er fuld."
+
+#: libparted/filesys.c:386
+msgid "Could not detect file system."
+msgstr "Kunne ikke finde noget filsystem."
+
+#: libparted/filesys.c:397
+#, fuzzy
+msgid "The file system is bigger than its volume!"
+msgstr "Filsystemet er strre end dets plads p diskdrevet!"
+
+#: libparted/filesys.c:405
+#, c-format
+msgid "Support for opening %s file systems is not implemented yet."
+msgstr ""
+"Understttelse for at bne filsystemer af type %s er ikke implementeret "
+"endnu."
+
+#: libparted/filesys.c:447
+#, c-format
+msgid "Support for creating %s file systems is not implemented yet."
+msgstr ""
+"Understttelse for at oprette filsystemer af type %s er ikke implementeret "
+"endnu."
+
+#: libparted/filesys.c:508
+#, c-format
+msgid "Support for checking %s file systems is not implemented yet."
+msgstr ""
+"Understttelse for at kontrollere filsystemer af type %s er ikke "
+"implementeret endnu."
+
+#: libparted/filesys.c:574
+msgid "raw block copying"
+msgstr "kopiering af r blokke"
+
+#: libparted/filesys.c:585
+msgid "growing file system"
+msgstr "udvider filsystem"
+
+#: libparted/filesys.c:625
+msgid "Can't copy onto an overlapping partition."
+msgstr "Kan ikke kopiere til en overlappende partition."
+
+#: libparted/filesys.c:647
+#, fuzzy, c-format
+msgid ""
+"Direct support for copying file systems is not yet implemented for %s. "
+"However, support for resizing is implemented. Therefore, the file system "
+"can be copied if the new partition is at least as big as the old one. So, "
+"either shrink the partition you are trying to copy, or copy to a bigger "
+"partition."
+msgstr ""
+"Direkte understttelse for at kopiere filsystemer af typen %s er ikke "
+"implementeret endnu. Understttelse for at ndre strrelse findes dog. "
+"Derfor kan filsystemet kopieres hvis den nye partition er mindst lige s "
+"stor som den gamle. S enten skal du formindske partitionen som du forsger "
+"kopiere, eller ogs kopierer du til en strre partition."
+
+#: libparted/filesys.c:661
+#, c-format
+msgid "Support for copying %s file systems is not implemented yet."
+msgstr ""
+"Understttelse for at kopiere filsystemer af type %s er ikke implementeret "
+"endnu."
+
+#: libparted/filesys.c:699
+#, c-format
+msgid "Support for resizing %s file systems is not implemented yet."
+msgstr ""
+"Understttelse for at ndre strrelse p filsystem af type %s er ikke "
+"implementeret endnu."
+
+#: libparted/exception.c:78
+msgid "Information"
+msgstr "Information"
+
+#: libparted/exception.c:79
+msgid "Warning"
+msgstr "Advarsel"
+
+#: libparted/exception.c:80
+msgid "Error"
+msgstr "Fejl"
+
+#: libparted/exception.c:81
+msgid "Fatal"
+msgstr "Fatal"
+
+#: libparted/exception.c:82
+msgid "Bug"
+msgstr "Programfejl"
+
+#: libparted/exception.c:83
+msgid "No Implementation"
+msgstr "Ikke implementeret"
+
+#: libparted/exception.c:87
+msgid "Fix"
+msgstr "Reparr"
+
+#: libparted/exception.c:88
+msgid "Yes"
+msgstr "Ja"
+
+#: libparted/exception.c:89
+msgid "No"
+msgstr "Nej"
+
+#: libparted/exception.c:90
+msgid "OK"
+msgstr "OK"
+
+#: libparted/exception.c:91
+msgid "Retry"
+msgstr "Forsg igen"
+
+#: libparted/exception.c:92
+msgid "Ignore"
+msgstr "Ignorr"
+
+#: libparted/exception.c:93
+msgid "Cancel"
+msgstr "Annullr"
+
+#: libparted/exception.c:133
+#, fuzzy, c-format
+msgid ""
+"A bug has been detected in GNU Parted. Refer to the web site of parted "
+"http://www.gnu.org/software/parted/parted.html for more informations of what "
+"could be useful for bug submitting! Please email a bug report to bug-"
+"parted@gnu.org containing at least the version (%s) and the following "
+"message: "
+msgstr ""
+"Send en fejlrapport med e-post til bug-parted@gnu.org, hvor du angiver "
+"versionsnumret (%s) og flgende meddelelse:"
+
+#: libparted/cs/geom.c:162
+msgid "Can't have the end before the start!"
+msgstr "Kan ikke have slutningen fr begyndelsen!"
+
+#: libparted/cs/geom.c:169
+msgid "Can't have a partition outside the disk!"
+msgstr "Kan ikke have en partition udenfor disken!"
+
+#: libparted/cs/geom.c:303
+#, fuzzy, c-format
+msgid "Attempt to read sectors %ld-%ld outside of partition on %s."
+msgstr "Forsgte lse sektorerne %ld-%ld udenfor partitionen p %s"
+
+#: libparted/cs/geom.c:373
+#, fuzzy, c-format
+msgid "Attempt to write sectors %ld-%ld outside of partition on %s."
+msgstr "Forsgte skrive sektorerne %ld-%ld udenfor partitionen p %s"
+
+#: libparted/cs/geom.c:413 libparted/fs/linux_swap/linux_swap.c:353
+msgid "checking for bad blocks"
+msgstr "kontroller for drlige blokke"
+
+#: libparted/libparted.c:286 libparted/libparted.c:306
+msgid "Out of memory."
+msgstr "Ikke mere hukommelse."
+
+#: libparted/unit.c:139
+msgid "Cannot get unit size for special unit 'COMPACT'."
+msgstr ""
+
+#: libparted/unit.c:382
+#, c-format
+msgid "\"%s\" has invalid syntax for locations."
+msgstr ""
+
+#: libparted/unit.c:390
+#, c-format
+msgid "The maximum head value is %d."
+msgstr ""
+
+#: libparted/unit.c:397
+#, c-format
+msgid "The maximum sector value is %d."
+msgstr ""
+
+#: libparted/unit.c:409 libparted/unit.c:540
+#, fuzzy, c-format
+msgid "The location %s is outside of the device %s."
+msgstr "Kan ikke oprette en partition udenfor enheden."
+
+#: libparted/unit.c:522
+msgid "Invalid number."
+msgstr ""
+
+#: libparted/fs/ext2/ext2.c:87 libparted/fs/ext2/ext2.c:112
+msgid "Inconsistent group descriptors!"
+msgstr "Inkonsistente gruppebeskrivere!"
+
+#: libparted/fs/ext2/ext2.c:91 libparted/fs/ext2/ext2.c:116
+#, fuzzy
+msgid "File system full!"
+msgstr "Filsystemet er fuldt!"
+
+#: libparted/fs/ext2/ext2.c:750
+#, fuzzy
+msgid "Invalid superblock. Are you sure this is an ext2 file system?"
+msgstr "Ugyldig superblok. Er du sikker p at dette er et ext2-filsystem?"
+
+#: libparted/fs/ext2/ext2.c:764 libparted/fs/ext2/ext2_resize.c:597
+#, fuzzy
+msgid "File system has errors! You should run e2fsck."
+msgstr "Filsystemet indholder fejl! Kr e2fsck frst."
+
+#: libparted/fs/ext2/ext2.c:775
+#, fuzzy
+msgid ""
+"File system was not cleanly unmounted! You should run e2fsck. Modifying an "
+"unclean file system could cause severe corruption."
+msgstr "Filsystemet er ikke afmonteret p rette mde! Brug e2fsck."
+
+#: libparted/fs/ext2/ext2.c:795
+#, fuzzy
+msgid "File system has an incompatible feature enabled."
+msgstr "Filsystemet har en inkompatibel finesse aktiveret"
+
+#: libparted/fs/ext2/ext2.c:806
+msgid "Error allocating buffer cache."
+msgstr "Kunne ikke reservere buffercache"
+
+#: libparted/fs/ext2/ext2.c:848
+msgid ""
+"A resize operation on this file system will use EXPERIMENTAL code that MAY "
+"CORRUPT it (although it hasn't done so yet).You should at least backup your "
+"data and run 'e2fsck -f' afterwards."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:114
+#, fuzzy
+msgid ""
+"Found an inode with a incorrect link count. Better go run e2fsck first!"
+msgstr "Fandt en inode med fejlagtigt antal lnker. Kr e2fsck frst."
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:487
+msgid "Not enough free inodes!"
+msgstr "Der findes ikke tilstrkkeligt mange frie inoder!"
+
+#: libparted/fs/ext2/ext2_resize.c:224
+#, fuzzy
+msgid "File system is too full to remove a group!"
+msgstr "Filsystemet er for optaget til at fjerne en gruppe!"
+
+#: libparted/fs/ext2/ext2_resize.c:233
+#, fuzzy
+msgid "File system has too many allocated inodes to remove a group!"
+msgstr "Filsystemet har for mange reserverede inoder for at fjerne en gruppe!"
+
+#: libparted/fs/ext2/ext2_resize.c:493
+msgid "adding groups"
+msgstr "tilfjer grupper"
+
+#: libparted/fs/ext2/ext2_resize.c:530
+#, fuzzy, c-format
+msgid "Your file system is too full to resize it to %i blocks. Sorry."
+msgstr "Filsystemet er for optaget til at ndre dets strrelse til %i blokke."
+
+#: libparted/fs/ext2/ext2_resize.c:540
+#, fuzzy, c-format
+msgid ""
+"Your file system has too many occupied inodes to resize it to %i blocks. "
+"Sorry."
+msgstr ""
+"Filsystemet har for mange optagede inoder til at ndre dets strrelse til %i "
+"blokke."
+
+#: libparted/fs/ext2/ext2_resize.c:554 libparted/fs/hfs/hfs.c:243
+#: libparted/fs/hfs/hfs.c:624
+msgid "shrinking"
+msgstr "krymper"
+
+#: libparted/fs/ext2/ext2_resize.c:605
+#, fuzzy
+msgid "File system was not cleanly unmounted! You should run e2fsck."
+msgstr "Filsystemet er ikke afmonteret p rette mde! Brug e2fsck."
+
+#: libparted/fs/ext2/ext2_resize.c:614
+msgid ""
+"The file system has the 'dir_index' feature enabled. Parted can only resize "
+"the file system if it disables this feature. You can enable it later by "
+"running 'tune2fs -O dir_index DEVICE' and then 'e2fsck -fD DEVICE'."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_block_relocator.c:198
+#, fuzzy
+msgid "Cross-linked blocks found! Better go run e2fsck first!"
+msgstr "Krydslnkede blokke fundet! Kr e2fsck frst!"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:537
+#, fuzzy, c-format
+msgid "Block %i has no reference? Weird."
+msgstr "Blok %i har ingen reference? Mrkeligt"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:738
+#, c-format
+msgid "Block %i shouldn't have been marked!"
+msgstr "Blok %i burde ikke vre mrket!"
+
+#: libparted/fs/ext2/interface.c:188
+#, fuzzy
+msgid ""
+"The ext2 file system passed a basic check. For a more comprehensive check, "
+"use the e2fsck program."
+msgstr ""
+"Filsystemet (e2fs) klarede et grundlggende test. For et mere gennemgende "
+"test, brug programmet e2fsck."
+
+#: libparted/fs/ext2/interface.c:205
+msgid "Sorry, can't move the start of ext2 partitions yet!"
+msgstr "Kan ikke flytte en ext2-partitions begyndelse endnu!"
+
+#: libparted/fs/ext2/ext2_buffer.c:82
+msgid "Couldn't flush buffer cache!"
+msgstr "Kunne ikke rense buffercachen!"
+
+#: libparted/fs/ext2/ext2_mkfs.c:162
+msgid "writing per-group metadata"
+msgstr "skriver metadata for hver gruppe"
+
+#: libparted/fs/ext2/ext2_mkfs.c:565
+msgid "File system too small for ext2."
+msgstr "Filsystem for lille til ext2."
+
+#: libparted/fs/fat/calc.c:134
+#, fuzzy, c-format
+msgid ""
+"You need %s of free disk space to shrink this partition to this size. "
+"Currently, only %s is free."
+msgstr ""
+"Du behver %dM ledig plads for at formindske strrelsen p denne partition "
+"til angiven strrelse. (der er kun %dM ledigt)"
+
+#: libparted/fs/fat/context.c:55
+#, c-format
+msgid ""
+"Cluster start delta = %d, which is not a multiple of the cluster size %d."
+msgstr ""
+"Klynge-startforskel er %d, hvilket ikke er en multipel af klyngestrrelsen %d"
+
+#: libparted/fs/fat/fat.c:312
+#, fuzzy, c-format
+msgid "Partition too big/small for a %s file system."
+msgstr "Partitionen for stor eller lille til at indeholde et %s-filsystem"
+
+#: libparted/fs/fat/fat.c:478
+msgid ""
+"The FATs don't match. If you don't know what this means, then select "
+"cancel, run scandisk on the file system, and then come back."
+msgstr ""
+"Filallokeringstabellerne stemmer ikke overens. Hvis du ikke vd hvad dette "
+"betyder, vlg annullr, kr scandisk p filsystemet og forsg igen."
+
+#: libparted/fs/fat/fat.c:518
+msgid "There are no possible configurations for this FAT type."
+msgstr "Det findes ingen mulige kombinationer for denne FAT-type."
+
+#: libparted/fs/fat/fat.c:530
+#, c-format
+msgid ""
+"File system doesn't have expected sizes for Windows to like it. Cluster "
+"size is %dk (%dk expected); number of clusters is %d (%d expected); size of "
+"FATs is %d sectors (%d expected)."
+msgstr ""
+"Filsystemet har ikke en strrelse som Windows kan lide. Klyngestrrelsen er %"
+"dk (%dk forventet); antal klynger er %d (%d forventet); strrelsen p FAT-"
+"erne er %d sektorer (%d forventet)."
+
+#: libparted/fs/fat/fat.c:553
+#, c-format
+msgid ""
+"File system is reporting the free space as %d clusters, not %d clusters."
+msgstr "Filsystemet mener at den frie plads er %d klynger, ikke %d."
+
+#: libparted/fs/fat/fat.c:878
+#, fuzzy
+msgid ""
+"GNU Parted was miscompiled: the FAT boot sector should be 512 bytes. FAT "
+"support will be disabled."
+msgstr ""
+"GNU Parted kompileredes fejlagtigt: FAT's startsektor skal vre 512 byte. "
+"Understttelsen for FAT vil blive blokeret."
+
+#: libparted/fs/fat/resize.c:158
+#, fuzzy
+msgid ""
+"There's not enough room in the root directory for all of the files. Either "
+"cancel, or ignore to lose the files."
+msgstr ""
+"Der er ikke tilstrkkeligt med plads for alle filer i rodkataloget. Vlg "
+"enten at annullere, eller ignorere og tabe filerne."
+
+#: libparted/fs/fat/resize.c:299
+msgid "Error writing to the root directory."
+msgstr "En fejl opstod ved skrivning til rodkataloget."
+
+#: libparted/fs/fat/resize.c:484
+#, fuzzy
+msgid "If you leave your file system as FAT16, then you will have no problems."
+msgstr ""
+"Hvis du lader filsystemet fortstte med at vre FAT16 vil du ikke f nogen "
+"problemer."
+
+#: libparted/fs/fat/resize.c:487
+msgid ""
+"If you convert to FAT16, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual)."
+msgstr ""
+"Hvis du konverterer til FAT16 og MS Windows er installeret p denne "
+"partition s skal du geninstallere MS Windows opstartsprogram. Hvis du gr "
+"det br du studere Parteds manual (eller din distributions manual)."
+
+#: libparted/fs/fat/resize.c:495
+msgid ""
+"If you leave your file system as FAT32, then you will not introduce any new "
+"problems."
+msgstr ""
+"Hvis du lader filsystemet fortstte med at vre FAT32 vil du ikke "
+"introducere nogen nye problemer."
+
+#: libparted/fs/fat/resize.c:499
+msgid ""
+"If you convert to FAT32, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual). Also, "
+"converting to FAT32 will make the file system unreadable by MS DOS, MS "
+"Windows 95a, and MS Windows NT."
+msgstr ""
+"Hvis du konverterer til FAT32, og MS Windows er installeret p denne "
+"partition, skal du geninstallere MS Windows opstartsprogram. Hvis du gr det "
+"br du studere Parteds manual (eller din distributions manual). Bemrk at "
+"ved at konvertere filsystemet til FAT32 vil det ikke kunne lses af MS DOS, "
+"MS Windows 95a og MS Windows NT."
+
+#: libparted/fs/fat/resize.c:513
+#, c-format
+msgid "%s %s %s"
+msgstr "%s %s %s"
+
+#: libparted/fs/fat/resize.c:514
+msgid "Would you like to use FAT32?"
+msgstr "nsker du at bruge FAT32?"
+
+#: libparted/fs/fat/resize.c:541 libparted/fs/fat/resize.c:557
+#, c-format
+msgid "%s %s"
+msgstr "%s %s"
+
+#: libparted/fs/fat/resize.c:542
+msgid ""
+"The file system can only be resized to this size by converting to FAT16."
+msgstr ""
+"Filsystemet kan kun ndres til denne strrelse ved at konvertere til FAT16."
+
+#: libparted/fs/fat/resize.c:558
+msgid ""
+"The file system can only be resized to this size by converting to FAT32."
+msgstr ""
+"Filsystemet kan kun ndres til denne strrelse ved at konvertere til FAT32."
+
+#: libparted/fs/fat/resize.c:571
+#, fuzzy
+msgid ""
+"GNU Parted cannot resize this partition to this size. We're working on it!"
+msgstr ""
+"GNU Parted kan ikke ndre partitionen til denne strrelse. Vi arbejder p en "
+"lsning!"
+
+#: libparted/fs/fat/bootsector.c:48 libparted/fs/fat/bootsector.c:55
+msgid "File system has an invalid signature for a FAT file system."
+msgstr "Filsystemet har en ugyldig signatur for filsystemer af typen FAT."
+
+#: libparted/fs/fat/bootsector.c:62
+msgid "File system has an invalid sector size for a FAT file system."
+msgstr ""
+"Filsystemet har en ugyldig sektorstrrelse for et filsystem af typen FAT."
+
+#: libparted/fs/fat/bootsector.c:69
+msgid "File system has an invalid cluster size for a FAT file system."
+msgstr ""
+"Filsystemet har en ugyldig klyngestrrelse for et filsystem af typen FAT."
+
+#: libparted/fs/fat/bootsector.c:76
+#, fuzzy
+msgid ""
+"File system has an invalid number of reserved sectors for a FAT file system."
+msgstr ""
+"Filsystemet har et ugyldigt antal reserverede sektorer for et filsystem af "
+"typen FAT."
+
+#: libparted/fs/fat/bootsector.c:83
+#, fuzzy
+msgid "File system has an invalid number of FATs."
+msgstr "Filsystemet har et fejlagtigt antal filallokeringstabeller."
+
+#: libparted/fs/fat/bootsector.c:138
+#, c-format
+msgid ""
+"This file system has a logical sector size of %d. GNU Parted is known not "
+"to work properly with sector sizes other than 512 bytes."
+msgstr ""
+"Filsystemet har en logisk sektorstrrelse p %d. Det er kendt at GNU Parted "
+"ikke fungerer godt med andre sektorstrrelser end 512 byte."
+
+#: libparted/fs/fat/bootsector.c:163
+#, c-format
+msgid ""
+"The file system's CHS geometry is (%d, %d, %d), which is invalid. The "
+"partition table's CHS geometry is (%d, %d, %d). If you select Ignore, the "
+"file system's CHS geometry will be left unchanged. If you select Fix, the "
+"file system's CHS geometry will be set to match the partition table's CHS "
+"geometry."
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:209
+msgid "FAT boot sector says logical sector size is 0. This is weird. "
+msgstr ""
+"FAT:s startsektor mener at den logiske sektorstrrelse er 0. Mrkeligt."
+
+#: libparted/fs/fat/bootsector.c:215
+msgid "FAT boot sector says there are no FAT tables. This is weird. "
+msgstr "FAT:s startsektor mener at der mangler FAT-tabeller. Mrkeligt."
+
+#: libparted/fs/fat/bootsector.c:221
+msgid "FAT boot sector says clusters are 0 sectors. This is weird. "
+msgstr "FAT:s startsektor mener at en klynge bestr af 0 sektorer. Mrkeligt."
+
+#: libparted/fs/fat/bootsector.c:231
+#, fuzzy
+msgid "File system is FAT12, which is unsupported."
+msgstr "Filsystemet er FAT12, som ikke understttes."
+
+#: libparted/fs/fat/bootsector.c:407
+#, c-format
+msgid ""
+"The information sector has the wrong signature (%x). Select cancel for now, "
+"and send in a bug report. If you're desperate, it's probably safe to ignore."
+msgstr ""
+"Informationssektoren har forkert signatur (%x). Vlg annullr og indsend en "
+"fejlrapport. Hvis du er desperat s er det formodentlig sikkert at ignorere "
+"fejlen."
+
+#: libparted/fs/fat/count.c:149
+#, c-format
+msgid "Bad directory entry for %s: first cluster is the end of file marker."
+msgstr ""
+"Fejlagtig katalogindgang for %s: frste klynge er en filslutsmarkering."
+
+#: libparted/fs/fat/count.c:162
+#, c-format
+msgid ""
+"Bad FAT: unterminated chain for %s. You should run dosfsck or scandisk."
+msgstr ""
+"Drlig filallokeringstabel: ej afsluttet kde for %s. Du br kre dosfsck "
+"eller scandisk."
+
+#: libparted/fs/fat/count.c:171
+#, fuzzy, c-format
+msgid ""
+"Bad FAT: cluster %d outside file system in chain for %s. You should run "
+"dosfsck or scandisk."
+msgstr ""
+"Drlig filallokeringstabel: klynge %d ligger udenfor filsystemet for %s. Du "
+"br kre dosfsck eller scandisk."
+
+#: libparted/fs/fat/count.c:181
+#, c-format
+msgid ""
+"Bad FAT: cluster %d is cross-linked for %s. You should run dosfsck or "
+"scandisk."
+msgstr ""
+"Drlig filallokeringstabel: klynge %d er krydslnket for %s. Du br kre "
+"dosfsck eller scandisk."
+
+#: libparted/fs/fat/count.c:200
+#, c-format
+msgid "%s is %dk, but it has %d clusters (%dk)."
+msgstr "%s er %dk, men den har %d klynger (%dk)."
+
+#: libparted/fs/fat/count.c:263
+#, c-format
+msgid ""
+"The file %s is marked as a system file. This means moving it could cause "
+"some programs to stop working."
+msgstr ""
+"Filen %s er markeret som en systemfil. Dette betyder at flytning af den kan "
+"bevirke at nogen programmer ikke lngere vil virke."
+
+#: libparted/fs/fat/table.c:138
+#, c-format
+msgid ""
+"FAT %d media %x doesn't match the boot sector's media %x. You should "
+"probably run scandisk."
+msgstr ""
+"FAT %d medie %x passer ikke med startsektorns medie %x. Du br nok kre "
+"scandisk."
+
+#: libparted/fs/fat/table.c:268
+#, fuzzy, c-format
+msgid "fat_table_set: cluster %ld outside file system"
+msgstr "fat_table_set: klynge %ld ligger udenfor filsystemet"
+
+#: libparted/fs/fat/table.c:296
+#, fuzzy, c-format
+msgid "fat_table_get: cluster %ld outside file system"
+msgstr "fat_table_get: klynge %ld ligger udenfor filsystemet"
+
+#: libparted/fs/fat/table.c:334
+msgid "fat_table_alloc_cluster: no free clusters"
+msgstr "fat_table_alloc_cluster: ingen ledige klynger"
+
+#: libparted/fs/linux_swap/linux_swap.c:236
+#, c-format
+msgid "Unrecognised linux swap signature '%10s'."
+msgstr "Ukendt signatur for Linux swapplads \\\"%10s\\\"."
+
+#: libparted/fs/linux_swap/linux_swap.c:312
+msgid "Too many bad pages."
+msgstr "For mange drlige sider."
+
+#: libparted/fs/hfs/advfs.c:123 libparted/fs/hfs/advfs_plus.c:125
+#: libparted/fs/hfs/reloc.c:416 libparted/fs/hfs/reloc.c:510
+#: libparted/fs/hfs/reloc_plus.c:541 libparted/fs/hfs/reloc_plus.c:660
+#: libparted/fs/hfs/reloc_plus.c:774
+msgid "The file system contains errors."
+msgstr ""
+
+#: libparted/fs/hfs/advfs_plus.c:290
+msgid "Bad blocks could not be read."
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:139
+#, c-format
+msgid ""
+"Trying to register an extent starting at block 0x%X, but another one already "
+"exists at this position. You should check the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:216
+#, c-format
+msgid ""
+"Trying to move an extent from block Ox%X to block Ox%X, but another one "
+"already exists at this position. This should not happen!"
+msgstr ""
+
+#: libparted/fs/hfs/file.c:145
+#, c-format
+msgid "Could not update the extent cache for HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:182
+#, c-format
+msgid "Trying to read HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:192 libparted/fs/hfs/file.c:222
+#, c-format
+msgid "Could not find sector %lli of HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:212
+#, c-format
+msgid "Trying to write HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:159
+#, c-format
+msgid "Could not update the extent cache for HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:203
+#, c-format
+msgid "Trying to read HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:214 libparted/fs/hfs/file_plus.c:256
+#, c-format
+msgid "Could not find sector %lli of HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:245
+#, c-format
+msgid "Trying to write HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:225
+msgid "Sorry, HFS cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:255 libparted/fs/hfs/hfs.c:636
+msgid "Data relocation has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:274
+msgid "Data relocation left some data in the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:313
+#, fuzzy
+msgid "writing HFS Master Directory Block"
+msgstr "En fejl opstod ved skrivning til rodkataloget."
+
+#: libparted/fs/hfs/hfs.c:461
+msgid "No valid HFS[+X] signature has been found while opening."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:471
+#, c-format
+msgid "Version %d of HFS+ isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:482
+#, c-format
+msgid "Version %d of HFSX isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:667
+msgid "Data relocation left some data at the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:715
+#, fuzzy
+msgid "Error while writing the allocation file."
+msgstr "En fejl opstod ved skrivning til rodkataloget."
+
+#: libparted/fs/hfs/hfs.c:730
+msgid "Error while writing the compatibility part of the allocation file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:745
+msgid "writing HFS+ Volume Header"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:845
+msgid "An error occurred while looking for the mandatory bad blocks file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:899
+msgid ""
+"It seems there is an error in the HFS wrapper: the bad blocks file doesn't "
+"contain the embedded HFS+ volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:930
+msgid "Sorry, HFS+ cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:965
+msgid "shrinking embedded HFS+ volume"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:981
+msgid "Resizing the HFS+ volume has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:988
+#, fuzzy
+msgid "shrinking HFS wrapper"
+msgstr "krymper"
+
+#: libparted/fs/hfs/hfs.c:997
+msgid "Updating the HFS wrapper has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:1099 libparted/fs/hfs/hfs.c:1184
+#, c-format
+msgid ""
+"This is not a real %s check. This is going to extract special low level "
+"files for debugging purposes."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:156
+msgid "Bad block list header checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:169
+#, c-format
+msgid ""
+"Invalid size of a transaction block while replaying the journal (%i bytes)."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:261
+msgid ""
+"Journal stored outside of the volume are not supported. Try to desactivate "
+"the journal and run Parted again."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:272
+#, fuzzy
+msgid "Journal offset or size is not multiple of the sector size."
+msgstr ""
+"Klynge-startforskel er %d, hvilket ikke er en multipel af klyngestrrelsen %d"
+
+#: libparted/fs/hfs/journal.c:290
+msgid "Incorrect magic values in the journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:299
+msgid "Journal size mismatch between journal info block and journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:311
+#, fuzzy
+msgid "Some header fields are not multiple of the sector size."
+msgstr ""
+"Klynge-startforskel er %d, hvilket ikke er en multipel af klyngestrrelsen %d"
+
+#: libparted/fs/hfs/journal.c:320
+msgid ""
+"The sector size stored in the journal is not 512 bytes. Parted only "
+"supports 512 bytes length sectors."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:332
+msgid "Bad journal checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:350
+msgid ""
+"The journal is not empty. Parted must replay the transactions before "
+"opening the file system. This will modify the file system."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:378
+msgid ""
+"The volume header or the master directory block has changed while replaying "
+"the journal. You should restart Parted."
+msgstr ""
+
+#: libparted/fs/hfs/probe.c:52
+#, c-format
+msgid ""
+"Parted can't use HFS file systems on disks with a sector size not equal to %"
+"d bytes."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:153 libparted/fs/hfs/reloc_plus.c:157
+msgid "An extent has not been relocated."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:253 libparted/fs/hfs/reloc_plus.c:309
+msgid ""
+"A reference to an extent comes from a place it should not. You should check "
+"the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:383
+msgid "This HFS volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:477
+msgid "This HFS volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:519 libparted/fs/hfs/reloc_plus.c:670
+msgid ""
+"The extents overflow file should not contain its own extents! You should "
+"check the file system."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:576 libparted/fs/hfs/reloc_plus.c:849
+#, fuzzy
+msgid "Could not cache the file system in memory."
+msgstr "Kunne ikke finde noget filsystem."
+
+#: libparted/fs/hfs/reloc.c:637 libparted/fs/hfs/reloc_plus.c:910
+msgid "Bad blocks list could not be loaded."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:651 libparted/fs/hfs/reloc_plus.c:926
+msgid "An error occurred during extent relocation."
+msgstr ""
+
+#: libparted/fs/hfs/reloc_plus.c:497
+msgid "This HFS+ volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc_plus.c:621
+msgid "This HFS+ volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: parted/parted.c:76
+msgid "displays this help message"
+msgstr "viser denne hjlpetekst"
+
+#: parted/parted.c:77
+msgid "where necessary, prompts for user intervention"
+msgstr "hvor det er ndvendigt sprges brugeren om alternativer"
+
+#: parted/parted.c:78
+msgid "never prompts for user intervention"
+msgstr "sprger aldrig brugeren om alternativer"
+
+#: parted/parted.c:79
+msgid "displays the version"
+msgstr "viser versionen"
+
+#: parted/parted.c:87
+#, fuzzy
+msgid ""
+"NUMBER is the partition number used by Linux. On MS-DOS disk labels, the "
+"primary partitions number from 1 to 4, logical partitions from 5 onwards.\n"
+msgstr ""
+"LILLE er partitionsnumret som Linux bruger. P filsystemer af type MSDOS er "
+"de primre partitioner numrerede fra 1 til 4, og de logiske partitioner fra "
+"5 og opad.\n"
+
+#: parted/parted.c:90
+msgid "LABEL-TYPE is one of: "
+msgstr "LABEL-TYPE er en af:"
+
+#: parted/parted.c:91
+msgid "FLAG is one of: "
+msgstr "FLAG er et af: "
+
+#: parted/parted.c:92
+#, fuzzy
+msgid "UNIT is one of: "
+msgstr "FLAG er et af: "
+
+#: parted/parted.c:93
+msgid "PART-TYPE is one of: primary, logical, extended\n"
+msgstr "PART-TYPE er en af: primr, logisk, udvidet\n"
+
+#: parted/parted.c:95
+msgid "FS-TYPE is one of: "
+msgstr "FS-TYPE er en af: "
+
+#: parted/parted.c:96
+msgid ""
+"START and END are disk locations, such as 4GB or 10%. Negative values count "
+"from the end of the disk. For example, -1s specifies exactly the last "
+"sector.\n"
+msgstr ""
+
+#: parted/parted.c:99
+msgid "STATE is one of: on, off\n"
+msgstr "TILSTAND er en af: p, af\n"
+
+#: parted/parted.c:100
+msgid "DEVICE is usually /dev/hda or /dev/sda\n"
+msgstr "ENHED er normalt /dev/hda eller /dev/sda\n"
+
+#: parted/parted.c:101
+msgid "NAME is any word you want\n"
+msgstr "NAVN er et vilkrligt ord\n"
+
+#: parted/parted.c:102
+msgid "The partition must have one of the following FS-TYPEs: "
+msgstr ""
+
+#: parted/parted.c:105
+msgid "GNU Parted Version information:\n"
+msgstr ""
+
+#: parted/parted.c:107
+#, fuzzy
+msgid ""
+"Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n"
+"This program is free software, covered by the GNU General Public License.\n"
+"\n"
+"This program is distributed in the hope that it will be useful, but WITHOUT "
+"ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
+"FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
+"more details.\n"
+"\n"
+msgstr ""
+"Ophavsret 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.\n"
+"Dette program er frit programmel, dkket af GNU General Public License.\n"
+"\n"
+"Dette program distribueres i hb om at det vil vre nyttigt, men\n"
+"UDEN NOGEN SOM HELST GARANTI, endog uden underforstet garanti om\n"
+"SALGBARHED eller EGNETHED FOR NOGET SPECIELT FORML. Se GNU General\n"
+"Public License for yderligere information.\n"
+
+#: parted/parted.c:152
+#, c-format
+msgid "%0.f%%\t(time left %.2d:%.2d)"
+msgstr "%0.f%%\t(tid tilbage %.2d:%.2d)"
+
+#: parted/parted.c:170
+#, c-format
+msgid ""
+"Partition %s is being used. You must unmount it before you modify it with "
+"Parted."
+msgstr ""
+
+#: parted/parted.c:187
+#, c-format
+msgid "Partition(s) on %s are being used."
+msgstr "Partitionen p %s er i brug."
+
+#: parted/parted.c:413 parted/parted.c:594 parted/parted.c:979
+#: parted/parted.c:1059 parted/parted.c:1586 parted/parted.c:1663
+#: parted/parted.c:1707
+msgid "Partition number?"
+msgstr "Nummer p partitionen?"
+
+#: parted/parted.c:456
+msgid "Source device?"
+msgstr "Kildeenhed?"
+
+#: parted/parted.c:460
+msgid "Source partition number?"
+msgstr "Nummer p kildepartitionen?"
+
+#: parted/parted.c:465
+#, fuzzy
+msgid "Can't copy an extended partition."
+msgstr "Kan ikke kopiere udvidede partitioner."
+
+#: parted/parted.c:471
+msgid "Destination partition number?"
+msgstr "Nummer p mlpartitionen?"
+
+#: parted/parted.c:564
+msgid "New disk label type?"
+msgstr "Type p ny disketikette?"
+
+#: parted/parted.c:598
+msgid "File system?"
+msgstr "Filsystem?"
+
+#: parted/parted.c:645 parted/parted.c:815
+msgid "Partition type?"
+msgstr "Type p partitionen"
+
+#: parted/parted.c:652 parted/parted.c:822 parted/parted.c:1062
+msgid "Partition name?"
+msgstr "Navn p partitionen?"
+
+#: parted/parted.c:660 parted/parted.c:832
+msgid "File system type?"
+msgstr "Type p filsystemet?"
+
+#: parted/parted.c:667 parted/parted.c:834 parted/parted.c:994
+#: parted/parted.c:1544 parted/parted.c:1595
+msgid "Start?"
+msgstr "Start?"
+
+#: parted/parted.c:669 parted/parted.c:837 parted/parted.c:997
+#: parted/parted.c:1546 parted/parted.c:1597
+msgid "End?"
+msgstr "Slut?"
+
+#: parted/parted.c:707 parted/parted.c:875
+#, fuzzy, c-format
+msgid ""
+"You requested a partition from %s to %s.\n"
+"The closest location we can manage is %s to %s. Is this still acceptable to "
+"you?"
+msgstr ""
+"Du bad om at flytte partitionen til %.3f-%.3fMb. Det nrmeste Parted kan "
+"klare er %.3f-%.3fMb."
+
+#: parted/parted.c:827
+#, fuzzy
+msgid "An extended partition cannot hold a file system. Did you want mkpart?"
+msgstr "Udvidede partitioner kan ikke have filsystemer. nskede du mkpart?"
+
+#: parted/parted.c:985
+#, fuzzy
+msgid "Can't move an extended partition."
+msgstr "Kan ikke flytte udvidede partitioner."
+
+#: parted/parted.c:1014
+msgid "Can't move a partition onto itself. Try using resize, perhaps?"
+msgstr ""
+"Kan ikke flytte en partition til sig selv. Prv at ndre strrelsen i stedet"
+
+#: parted/parted.c:1158
+#, c-format
+msgid "Minor: %d\n"
+msgstr "Lille: %d\n"
+
+#: parted/parted.c:1159
+#, fuzzy, c-format
+msgid "Flags: %s\n"
+msgstr "Flag: "
+
+#: parted/parted.c:1160
+#, c-format
+msgid "File System: %s\n"
+msgstr "Filsystem: %s\n"
+
+#: parted/parted.c:1161
+#, fuzzy, c-format
+msgid "Size: "
+msgstr "Strrelse: %10.3fMb (%d%%)\n"
+
+#: parted/parted.c:1166
+#, fuzzy, c-format
+msgid "Minimum size: "
+msgstr "Mindste strrelse: %10.3fMb (%d%%)\n"
+
+#: parted/parted.c:1169
+#, fuzzy, c-format
+msgid "Maximum size: "
+msgstr "Strste strrelse: %10.3fMb (%d%%)\n"
+
+#: parted/parted.c:1255
+#, fuzzy, c-format
+msgid "Disk %s: %s\n"
+msgstr "%s %s %s"
+
+#: parted/parted.c:1256
+#, c-format
+msgid "Sector size (logical/physical): %lldB/%lldB\n"
+msgstr ""
+
+#: parted/parted.c:1267
+#, c-format
+msgid "BIOS cylinder,head,sector geometry: %d,%d,%d. Each cylinder is %s.\n"
+msgstr ""
+
+#: parted/parted.c:1273
+#, fuzzy, c-format
+msgid "Partition Table: %s\n"
+msgstr "Navn p partitionen?"
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Number"
+msgstr ""
+
+#: parted/parted.c:1284 parted/parted.c:1287
+#, fuzzy
+msgid "Start"
+msgstr "Start?"
+
+#: parted/parted.c:1285 parted/parted.c:1288
+#, fuzzy
+msgid "End"
+msgstr "Slut?"
+
+#: parted/parted.c:1288
+#, fuzzy
+msgid "Size"
+msgstr "ndr_strrelse"
+
+#: parted/parted.c:1292
+msgid "Type"
+msgstr ""
+
+#: parted/parted.c:1294
+#, fuzzy
+msgid "File system"
+msgstr "Filsystem?"
+
+#: parted/parted.c:1297
+#, fuzzy
+msgid "Name"
+msgstr "name"
+
+#: parted/parted.c:1299
+msgid "Flags"
+msgstr "Flag"
+
+#: parted/parted.c:1352
+msgid "Free Space"
+msgstr ""
+
+#: parted/parted.c:1441
+#, fuzzy, c-format
+msgid ""
+"A %s %s partition was found at %s -> %s. Do you want to add it to the "
+"partition table?"
+msgstr ""
+"En %s %s partition blev fundet p %.3fMb -> %.3fMb. nsker du at tilfje "
+"den til partitionstabellen?"
+
+#: parted/parted.c:1479
+msgid "searching for file systems"
+msgstr "leder efter filsystemer"
+
+#: parted/parted.c:1684
+msgid "New device?"
+msgstr "Ny enhed?"
+
+#: parted/parted.c:1709
+#, fuzzy
+msgid "Flag to Invert?"
+msgstr "Flag der skal ndres?"
+
+#: parted/parted.c:1714
+msgid "New state?"
+msgstr "Ny tilstand?"
+
+#: parted/parted.c:1747
+msgid "Unit?"
+msgstr ""
+
+#: parted/parted.c:1896
+msgid "check"
+msgstr "tjek"
+
+#: parted/parted.c:1899
+#, fuzzy
+msgid ""
+"check NUMBER do a simple check on the file system"
+msgstr "tjek LILLE lav en simpel test af filsystemet"
+
+#: parted/parted.c:1905
+msgid "cp"
+msgstr "cp"
+
+#: parted/parted.c:1908
+#, fuzzy
+msgid ""
+"cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another "
+"partition"
+msgstr ""
+"cp [FRA ENHED] FRA-LILLE TIL-LILLE kopir et filsystem til et andet"
+
+#: parted/parted.c:1914
+msgid "help"
+msgstr "hjlp"
+
+#: parted/parted.c:1917
+#, fuzzy
+msgid ""
+"help [COMMAND] prints general help, or help on "
+"COMMAND"
+msgstr ""
+"hjlp [KOMMANDO] udskriver generel hjlp, eller speciel hjlp "
+"for KOMMANDO"
+
+#: parted/parted.c:1923
+msgid "mklabel"
+msgstr "mklabel"
+
+#: parted/parted.c:1926
+#, fuzzy
+msgid ""
+"mklabel LABEL-TYPE create a new disklabel (partition "
+"table)"
+msgstr "mklabel PART-TYPE lav en ny partitionstabel"
+
+#: parted/parted.c:1932
+msgid "mkfs"
+msgstr "mkfs"
+
+#: parted/parted.c:1935
+#, fuzzy
+msgid ""
+"mkfs NUMBER FS-TYPE make a FS-TYPE file system on "
+"partititon NUMBER"
+msgstr ""
+"mkfs LILLE FS-TYPE lav et filsystem af typen TYPE p partition LILLE"
+
+#: parted/parted.c:1941
+msgid "mkpart"
+msgstr "mkpart"
+
+#: parted/parted.c:1944
+#, fuzzy
+msgid "mkpart PART-TYPE [FS-TYPE] START END make a partition"
+msgstr "mkpart PARTITIONSTYPE [FS-TYPE] START SLUT lav en partition"
+
+#: parted/parted.c:1950
+msgid ""
+"mkpart makes a partition without creating a new file system on the "
+"partition. FS-TYPE may be specified to set an appropriate partition ID.\n"
+msgstr ""
+"mkpart laver en partition uden at oprette et nyt filsystem p partitionen. "
+"FS-TYPE kan angives for at stte en passende identitet p partitionen.\n"
+
+#: parted/parted.c:1955
+msgid "mkpartfs"
+msgstr "mkpartfs"
+
+#: parted/parted.c:1958
+#, fuzzy
+msgid ""
+"mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system"
+msgstr ""
+"mkpartfs PARTITIONSTYPE FILSYSTEMSTYPE START SLUT lav en partition med et "
+"filsystem"
+
+#: parted/parted.c:1964
+msgid "move"
+msgstr "move"
+
+#: parted/parted.c:1967
+#, fuzzy
+msgid "move NUMBER START END move partition NUMBER"
+msgstr "move LILLE START SLUT flyt partition LILLE"
+
+#: parted/parted.c:1972
+msgid "name"
+msgstr "name"
+
+#: parted/parted.c:1975
+#, fuzzy
+msgid "name NUMBER NAME name partition NUMBER as NAME"
+msgstr "name LILLE NAVN navngiv partition LILLE NAVN"
+
+#: parted/parted.c:1980
+msgid "print"
+msgstr "skriv"
+
+#: parted/parted.c:1983
+#, fuzzy
+msgid ""
+"print [free|NUMBER|all] display the partition table, a "
+"partition, or all devices"
+msgstr ""
+"skriv [LILLE] vis partitionstabellen, eller en partition"
+
+#: parted/parted.c:1987
+#, fuzzy
+msgid ""
+"Without arguments, print displays the entire partition table. With 'free'\n"
+"argument, information about free space will be displayed otherwise if a\n"
+"partition number is given, then more detailed information is displayed\n"
+"about that partition. If the 'all' argument is passed instead, partition\n"
+"information for all devices will be displayed."
+msgstr ""
+"Uden argumenter udskriver 'skriv' hele partitionstabellen. Hvis et nummer p "
+"en partition er angivet vil mere detaljeret information om denne partition "
+"blive vist.\n"
+
+#: parted/parted.c:1995
+msgid "quit"
+msgstr "afslut"
+
+#: parted/parted.c:1998
+#, fuzzy
+msgid "quit exit program"
+msgstr "afslut afslut programmet"
+
+#: parted/parted.c:2003
+msgid "rescue"
+msgstr "red"
+
+#: parted/parted.c:2006
+#, fuzzy
+msgid ""
+"rescue START END rescue a lost partition near START "
+"and END"
+msgstr ""
+"red START SLUT red tabte partitioner nr ved START og SLUT"
+
+#: parted/parted.c:2012
+msgid "resize"
+msgstr "ndr_strrelse"
+
+#: parted/parted.c:2015
+#, fuzzy
+msgid ""
+"resize NUMBER START END resize partition NUMBER and its "
+"file system"
+msgstr ""
+"ndr_strrelse LILLE START SLUT ndr strrelse p filsystemet p partition "
+"LILLE"
+
+#: parted/parted.c:2023
+msgid "rm"
+msgstr "rm"
+
+#: parted/parted.c:2026
+#, fuzzy
+msgid "rm NUMBER delete partition NUMBER"
+msgstr "rm LILLE slet partition LILLE"
+
+#: parted/parted.c:2031
+msgid "select"
+msgstr "vlg"
+
+#: parted/parted.c:2034
+#, fuzzy
+msgid "select DEVICE choose the device to edit"
+msgstr "vlg ENHED vlg enhed at redigere"
+
+#: parted/parted.c:2039
+msgid "set"
+msgstr "st"
+
+#: parted/parted.c:2042
+#, fuzzy
+msgid ""
+"set NUMBER FLAG STATE change the FLAG on partition NUMBER"
+msgstr "rm LILLE slet partition LILLE"
+
+#: parted/parted.c:2048
+msgid "toggle"
+msgstr ""
+
+#: parted/parted.c:2051
+#, fuzzy
+msgid ""
+"toggle [NUMBER [FLAG]] toggle the state of FLAG on "
+"partition NUMBER"
+msgstr "rm LILLE slet partition LILLE"
+
+#: parted/parted.c:2057
+#, fuzzy
+msgid "unit"
+msgstr "afslut"
+
+#: parted/parted.c:2060
+#, fuzzy
+msgid "unit UNIT set the default unit to UNIT"
+msgstr "afslut afslut programmet"
+
+#: parted/parted.c:2065
+msgid "version"
+msgstr ""
+
+#: parted/parted.c:2068
+msgid ""
+"version displays the current version of GNU "
+"Parted and copyright information"
+msgstr ""
+
+#: parted/parted.c:2072
+msgid ""
+"version displays copyright and version information corressponding to this "
+"copy of GNU Parted\n"
+msgstr ""
+
+#: parted/parted.c:2158
+msgid "No device found"
+msgstr "Ingen enhed fundet"
+
+#: parted/parted.c:2222
+msgid "Don't forget to update /etc/fstab, if necessary.\n"
+msgstr "Glem ikke at opdatere /etc/fstab, om ndvendigt.\n"
+
+#: parted/ui.c:68
+msgid "Welcome to GNU Parted! Type 'help' to view a list of commands.\n"
+msgstr ""
+
+#: parted/ui.c:71
+#, fuzzy
+msgid ""
+"Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]\n"
+"Apply COMMANDs with PARAMETERS to DEVICE. If no COMMAND(s) are given, run "
+"in\n"
+"interactive mode.\n"
+msgstr ""
+"Brug: parted [FLAG]... [ENHED [KOMMANDO [PARAMETRE]...]...]\n"
+"Kr KOMMANDO med PARAMETRE p ENHED. Hvis ingen KOMMANDOER angives kres\n"
+"programmet i interaktiv tilstand.\n"
+
+#: parted/ui.c:76
+#, c-format
+msgid ""
+"\n"
+"\n"
+"You found a bug in GNU Parted! Here's what you have to do:\n"
+"\n"
+"Don't panic! The bug has most likely not affected any of your data.\n"
+"Help us to fix this bug by doing the following:\n"
+"\n"
+"Check whether the bug has already been fixed by checking\n"
+"the last version of GNU Parted that you can find at:\n"
+"\n"
+"\thttp://ftp.gnu.org/gnu/parted/\n"
+"\n"
+"Please check this version prior to bug reporting.\n"
+"\n"
+"If this has not been fixed yet or if you don't know how to check,\n"
+"please visit the GNU Parted website:\n"
+"\n"
+"\thttp://www.gnu.org/software/parted\n"
+"\n"
+"for further information.\n"
+"\n"
+"Your report should contain the version of this release (%s)\n"
+"along with the error message below, the output of\n"
+"\n"
+"\tparted DEVICE unit co print unit s print\n"
+"\n"
+"and additional information about your setup you consider important.\n"
+msgstr ""
+
+#: parted/ui.c:230
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_MAPERR (Address not mapped to object)"
+msgstr ""
+
+#: parted/ui.c:235
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_ACCERR (Invalid permissions for mapped object)"
+msgstr ""
+
+#: parted/ui.c:240
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGSEGV signal was encountered."
+msgstr ""
+
+#: parted/ui.c:258
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTDIV (Integer: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:262
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTOVF (Integer: overflow)"
+msgstr ""
+
+#: parted/ui.c:266
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTDIV (Float: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:270
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTOVF (Float: overflow)"
+msgstr ""
+
+#: parted/ui.c:274
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTUND (Float: underflow)"
+msgstr ""
+
+#: parted/ui.c:278
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTRES (Float: inexact result)"
+msgstr ""
+
+#: parted/ui.c:282
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTINV (Float: invalid operation)"
+msgstr ""
+
+#: parted/ui.c:286
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTSUB (Float: subscript out of range)"
+msgstr ""
+
+#: parted/ui.c:291
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGFPE signal was encountered."
+msgstr ""
+
+#: parted/ui.c:310
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPC (Illegal Opcode)"
+msgstr ""
+
+#: parted/ui.c:314
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPN (Illegal Operand)"
+msgstr ""
+
+#: parted/ui.c:318
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLADR (Illegal addressing mode)"
+msgstr ""
+
+#: parted/ui.c:323
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLTRP (Illegal Trap)"
+msgstr ""
+
+#: parted/ui.c:327
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVOPC (Privileged Opcode)"
+msgstr ""
+
+#: parted/ui.c:331
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVREG (Privileged Register)"
+msgstr ""
+
+#: parted/ui.c:335
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_COPROC (Coprocessor Error)"
+msgstr ""
+
+#: parted/ui.c:339
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_BADSTK (Internal Stack Error)"
+msgstr ""
+
+#: parted/ui.c:343
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGILL signal was encountered."
+msgstr ""
+
+#: parted/ui.c:828
+msgid "Expecting a partition number."
+msgstr "Forventer et partitionsnummer."
+
+#: parted/ui.c:837
+msgid "Partition doesn't exist."
+msgstr "Partitionen findes ikke."
+
+#: parted/ui.c:857
+msgid "Expecting a file system type."
+msgstr "Forventer en filsystemstype."
+
+#: parted/ui.c:863
+#, c-format
+msgid "Unknown file system type \"%s\"."
+msgstr "Ukendt filsystemstype '%s'."
+
+#: parted/ui.c:883
+msgid "Expecting a disk label type."
+msgstr "Forventer en disketikettetype."
+
+#: parted/ui.c:977
+msgid "Can't create any more partitions."
+msgstr "Kan ikke tilfje flere partitioner."
+
+#: parted/ui.c:987
+msgid "Expecting a partition type."
+msgstr "Forventer et partitionstype."
+
+#: parted/ui.c:1115
+msgid "on"
+msgstr "p"
+
+#: parted/ui.c:1116
+msgid "off"
+msgstr "fra"
+
+#: parted/ui.c:1227
+msgid "OPTIONs:"
+msgstr "FLAG:"
+
+#: parted/ui.c:1230
+msgid "COMMANDs:"
+msgstr "KOMMANDOer:"
+
+#: parted/ui.c:1238
+#, c-format
+msgid "Using %s\n"
+msgstr "Bruger %s\n"
+
+#, fuzzy
+#~ msgid ""
+#~ "This ext2 file system has a rather strange layout! Parted can't resize "
+#~ "this (yet)."
+#~ msgstr ""
+#~ "Dette ext2-filsystem har en ganske mrkelig udlgning! Parted kan ikke "
+#~ "ndre strrelse p dette (endnu)."
+
+#~ msgid "IDE"
+#~ msgstr "IDE"
+
+#, fuzzy
+#~ msgid "Disk geometry for %s: %s - %s\n"
+#~ msgstr "Diskgeometri p %s: 0.000-%.3f megabyte\n"
+
+#~ msgid "Disk label type: %s\n"
+#~ msgstr "Type af filsystem: %s\n"
+
+#, fuzzy
+#~ msgid "set NUMBER FLAG STATE change a flag on partition NUMBER"
+#~ msgstr "st LILLE FLAG TILSTAND ndr et flag p partition LILLE"
+
+#, fuzzy
+#~ msgid ""
+#~ "The sector size on %s is %d bytes. Parted is known not to work properly "
+#~ "with drives with sector sizes other than %d bytes."
+#~ msgstr ""
+#~ "Sektorstrrelsen p %s er %d byte. Det er kendt at Parted ikke virker "
+#~ "ordentligt p drev med anden sektorstrrelse end %d byte"
+
+#~ msgid ""
+#~ "You found a bug in GNU Parted. Please email a bug report to bug-"
+#~ "parted@gnu.org containing the version (%s), and the following message:\n"
+#~ msgstr ""
+#~ "Du har fundet en fejl i GNU Parted. Send en fejlrapport til bug-"
+#~ "parted@gnu.org indholdende versionsnummer (%s) og flgende meddelelse:\n"
+
+#, fuzzy
+#~ msgid ""
+#~ "You requested to create a partition at %s - %s. The closest Parted can "
+#~ "manage is %s - %s."
+#~ msgstr ""
+#~ "Du bad om at oprette en partition p %.3f-%.3fMb. Det nrmeste Parted kan "
+#~ "klare er %.3f-%.3fMb."
+
+#, fuzzy
+#~ msgid ""
+#~ "You requested to resize the partition to %s - %s. The closest Parted can "
+#~ "manage is %s - %s."
+#~ msgstr ""
+#~ "Du bad om at ndre strrelse p partitionen til %.3f-%.3fMb. Det nrmeste "
+#~ "Parted kan klare er %.3f-%.3fMb."
+
+#~ msgid "SCSI"
+#~ msgstr "SCSI"
+
+#~ msgid "File system has an invalid signature for a FAT file systems."
+#~ msgstr "Filsystemet har en ugyldig signatur for filsystemer af typen FAT."
+
+#~ msgid "Minor Start End "
+#~ msgstr "Lille Start Slut "
+
+#~ msgid "Type "
+#~ msgstr "Type "
+
+#~ msgid "Filesystem "
+#~ msgstr "Filsystem "
+
+#~ msgid "Name "
+#~ msgstr "Navn "
+
+#~ msgid "Device %s is neither a SCSI nor IDE drive."
+#~ msgstr "Enheden %s er hverken en SCSI- eller IDE-enhed."
+
+#~ msgid "Error reading %s (%s) to determine if partition is mounted."
+#~ msgstr ""
+#~ "En fejl opstod da %s (%s) skulle lses for at bestemme om partitionen er "
+#~ "monteret."
+
+#~ msgid ""
+#~ "Unable to determine if partitions are mounted via /proc/mounts or /etc/"
+#~ "mtab. Make sure you don't attempt to resize or modify mounted file "
+#~ "systems. (Even read-only mounted)"
+#~ msgstr ""
+#~ "Kan ikke afgre om partitioner er monterede via /proc/mounts eller /etc/"
+#~ "mtab. Tjek at du ikke forsger at ndre strrelse eller andre monterede "
+#~ "filsystemer (ogs monteret skrivebeskyttet)."
+
+#~ msgid "Could not read geometry of %s - %s."
+#~ msgstr "Kunne ikke lse geometrien p %s - %s."
+
+#~ msgid "Device %s has dodgey geometry."
+#~ msgstr "Enheden %s har mrkelig geometri."
+
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. However, the most likely reason is that Linux "
+#~ "detected the BIOS geometry for %s incorrectly. GNU Parted suspects the "
+#~ "real geometry should be %d/%d/%d (not %d/%d/%d). You should check with "
+#~ "your BIOS first, as this may not be correct. You can inform Linux by "
+#~ "adding the parameter %s=%d,%d,%d to the command line. See the LILO or "
+#~ "GRUB documentation for more information. If you think Parted's suggested "
+#~ "geometry is correct, you may select Ignore to continue (and fix Linux "
+#~ "later). Otherwise, select Cancel (and fix Linux and/or the BIOS now)."
+#~ msgstr ""
+#~ "Partitionstabellen p %s er ikke konsistent. Der kan vre mange rsager "
+#~ "til dette. Den mest sandsynlige rsag er at Linux lste forkert "
+#~ "geometriinformation for %s i BIOS. GNU Parted mistnker den rigtige "
+#~ "geometri for at vre %d/%d/%d (ikke %d/%d/%d). Du br frst kontrollere "
+#~ "din BIOS eftersom det kan vre forkert. Du kan informere Linux gennem at "
+#~ "tilfje parameteren %s=%d,%d,%d p kommandolinjen. Mere information "
+#~ "findes i manualerne for LILO eller GRUB. Hvis du tror at Parteds "
+#~ "foreslede geometri er rigtig kan du vlge Ignorr for at fortstte (og "
+#~ "rette Linux senere). Ellers, vlg Afbryd (og ret Linux og/eller BIOS nu)."
+
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. Often, the reason is that Linux detected the "
+#~ "BIOS geometry incorrectly. However, this does not appear to be the case "
+#~ "here. It is safe to ignore,but ignoring may cause (fixable) problems "
+#~ "with some boot loaders, and may cause problems with FAT file systems. "
+#~ "Using LBA is recommended."
+#~ msgstr ""
+#~ "Partitionstabellen p %s er ikke konsistent. Det kan vre mange rsager "
+#~ "til dette. Ofte er rsagen at Linux har lst geometriinformationen i BIOS "
+#~ "fejlagtigt. Det synes dog ikke vre problemet her. Du kan ignorere "
+#~ "fejlen, men der kan opst problemer (som kan rettes) med visse "
+#~ "opstartsprogrammer, og problemer med FAT-filsystemer. Brug af LBA "
+#~ "anbefales."
+
+#~ msgid ""
+#~ "Unable to align partition properly. This probably means that another "
+#~ "partitioning tool generated an incorrect partition table, because it "
+#~ "didn't have the correct BIOS geometry. It is safe to ignore,but ignoring "
+#~ "may cause (fixable) problems with some boot loaders."
+#~ msgstr ""
+#~ "Kunne ikke lgge partitionen p hel cylindergrnse. Det betyder ofte at "
+#~ "et andet partitionsvrktj skrev en ugyldig partitionstabel, baseret p "
+#~ "fejlagtig geometriinformation fra din BIOS. Du kan ignorere fejlen, men "
+#~ "der kan opst problemer (som kan rettes) med visse opstartsprogrammer."
+
+#~ msgid ""
+#~ " You have Windows FAT partition(s) that are not using LBA. If your BIOS "
+#~ "supports LBA, then you should switch to LBA by setting the LBA flag on "
+#~ "all FAT partitions. Otherwise, make sure the operating system and the "
+#~ "BIOS have the same geometry before resizing any FAT partitions."
+#~ msgstr ""
+#~ " Du har Windows FAT-partitioner, som ikke bruger LBA. Hvis din BIOS "
+#~ "understtter LBA, s br du skifte til LBA ved at stte LBA-flaget p "
+#~ "alle FAT-partitioner. Ellers forsikr dig at styresystemet og BIOS-en har "
+#~ "den samme geometri fr du laver om p strrelsen af nogen FAT-partitioner."
+
+#~ msgid ""
+#~ "The operating system thinks the geometry on %s is %d/%d/%d. Therefore, "
+#~ "cylinder 1024 ends at %.3fM.%s"
+#~ msgstr ""
+#~ "Operativsystemet tror at geometrien p %s er %d/%d/%d. Derfor slutter "
+#~ "cylinder 1024 p %.3fM.%s"
+
+#~ msgid "The operating system thinks the geometry on %s is %d/%d/%d.%s"
+#~ msgstr "Operativsystemet tror at geometrien p %s er %d/%d/%d.%s"
+
+#~ msgid "START and END are in megabytes\n"
+#~ msgstr "START og SLUT angives i megabyte\n"
+
+#~ msgid "Partition %s is being used."
+#~ msgstr "Partition %s er i brug."
+
+#~ msgid ""
+#~ "The FATs aren't big enough to describe all clusters! Each FAT is %d "
+#~ "sectors. There are %d clusters, which would require each FAT to be %d "
+#~ "sectors. This is REALLY weird. You might want to write us an email: bug-"
+#~ "parted@gnu.org"
+#~ msgstr ""
+#~ "Filallokeringstabellerne er ikke store nok for at beskrive alle klynger! "
+#~ "Hver tabel er %d sektorer. Der findes %d klynger, hvilket indebrer at "
+#~ "hver tabel burde vre %d sektorer. Dette er RIGTIGT mrkeligt. Skriv et "
+#~ "brev til os: bug-parted@gnu.org"
+
+#~ msgid ""
+#~ "This swap partition is not compatible with Linux version 2.1.117 or "
+#~ "earlier. Use a smaller partition (maximum size 128mb) if you want to use "
+#~ "old versions of Linux."
+#~ msgstr ""
+#~ "Denne swappartition er ikke kompatibel med Linux version 2.1.117 og "
+#~ "tidligere. Brug en mindre partition (maksimal strrelse 128 MB) hvis du "
+#~ "bruger ldre versioner af Linux."
+
+#~ msgid "The new partition overlaps with another partition."
+#~ msgstr "Den nye partition overlapper med en anden."
+
+#~ msgid ""
+#~ "Can't resize an extended partition so as to exclude a logical partition."
+#~ msgstr ""
+#~ "Kan ikke ndre strrelse p en udvidet partition for at ekskludere en "
+#~ "logisk partition."
+
+#~ msgid "Can't grow a partition onto used space."
+#~ msgstr "Kan ikke lade en partition vokse ind i brugt plads."
+
+#~ msgid "unknown"
+#~ msgstr "ukendt"
+
+# ??
+#~ msgid "Unknown SCSI"
+#~ msgstr "Ukendt SCSI"
+
+#~ msgid "GUID Partition Table Header Signature is wrong: "
+#~ msgstr "Signatur for GUID partitionstabelhovede er forkert: "
+
+#~ msgid " should be "
+#~ msgstr " skulle vre "
+
+#~ msgid "GPT Header CRC check failed, %x should be %x."
+#~ msgstr "Kontrol af GPT-hoved mislykkedes, %x skulle vre %x."
+
+#~ msgid "GPT Partition Entry Array CRC check failed, %x should be %x."
+#~ msgstr ""
+#~ "CRC-kontrol af GPT-partitionsindgangstabel mislykkedes, %x skulle vre %x."
+
+#~ msgid ""
+#~ "This disk contains a valid Primary and Alternate GUID Partition Table but "
+#~ "the Protective MBR is invalid. This generally means that the disk had "
+#~ "GPT partitions on it, but then a legacy partition editing tool was used "
+#~ "to change the partition table stored in the MBR.\n"
+#~ "Which data is valid, GPT or MBR?\n"
+#~ "Yes will assume that the GPT information is correct, and rewrite the "
+#~ "PMBR.\n"
+#~ "No will assume that the MBR is correct, and erase the GPT information.\n"
+#~ "Ignore will assume that the MBR is correct, but not change the disk."
+#~ msgstr ""
+#~ "Denne disk indeholder en gyldig primr og alternativ GUID-"
+#~ "PartitionsTabel, men den beskyttende MBR er ugyldig. Dette betyder "
+#~ "normalt at disken har GPT-partitioner p den, men s er et gammeldags "
+#~ "partitionsredigeringsvrktj blevet brugt til at ndre partitionstabellen "
+#~ "gemt i MBR.\n"
+#~ "Hvilke data er gyldige, GPT eller MBR?\n"
+#~ "Ja vil formode at GPT-informationen er korrekt, og vil genskrive den "
+#~ "beskyttende MBR.\n"
+#~ "Nej vil formode at MBR er korrekt, og slette GPT-informationen.\n"
+#~ "Ignorr vil formode at MBR er korrekt, men ikke ndre disken."
+
+#~ msgid ""
+#~ "This disk contains a valid Alternate GUID Partition Table but the Primary "
+#~ "GPT and Protective MBR are invalid. This generally means that the disk "
+#~ "had GPT partitions on it, but then a legacy partition editing tool was "
+#~ "used to change the partition table stored in the MBR.\n"
+#~ "Which data is valid, GPT or MBR?\n"
+#~ "Yes will assume that the GPT information is correct, and will rewrite the "
+#~ "PMBR and Primary GPT.\n"
+#~ "No will assume that the MBR is correct, and erase the GPT information.\n"
+#~ "Ignore will assume that the MBR is correct, but not change the disk."
+#~ msgstr ""
+#~ "Denne disk indeholder en gyldig alternativ GUID-PartitionsTabel, men den "
+#~ "primre GPT og beskyttende MBR er ugyldige. Dette betyder normalt at "
+#~ "disken har GPT-partitioner p den, men s er et gammeldags "
+#~ "partitionsredigeringsvrktj blevet brugt til at ndre partitionstabellen "
+#~ "gemt i MBR.\n"
+#~ "Hvilke data er gyldige, GPT eller MBR?\n"
+#~ "Ja vil formode at GPT-informationen er korrekt, og vil genskrive den "
+#~ "beskyttende MBR og den primre GPT.\n"
+#~ "Nej vil formode at MBR er korrekt, og slette GPT-informationen.\n"
+#~ "Ignorr vil formode at MBR er korrekt, men ikke ndre disken."
+
+#~ msgid ""
+#~ "This disk contains a valid Primary GUID Partition Table but the Alternate "
+#~ "GPT and Protective MBR are invalid. This generally means that the disk "
+#~ "had GPT partitions on it, but then a legacy partition editing tool was "
+#~ "used to change the partition table stored in the MBR.\n"
+#~ "Which data is valid, GPT or MBR?\n"
+#~ "Yes will assume that the GPT information is correct, and will rewrite the "
+#~ "PMBR and Alternate GPT.\n"
+#~ "No will assume that the MBR is correct, and erase the GPT information.\n"
+#~ "Ignore will assume that the MBR is correct, but not change the disk.\n"
+#~ msgstr ""
+#~ "Denne disk indeholder en gyldig primr GUID-PartitionsTabel, men den "
+#~ "alternative GPT og beskyttende MBR er ugyldige. Dette betyder normalt at "
+#~ "disken har GPT-partitioner p den, men s er et gammeldags "
+#~ "partitionsredigeringsvrktj blevet brugt til at ndre partitionstabellen "
+#~ "gemt i MBR.\n"
+#~ "Hvilke data er gyldige, GPT eller MBR?\n"
+#~ "Ja vil formode at GPT-informationen er korrekt, og vil genskrive den "
+#~ "beskyttende MBR og den alternative GPT.\n"
+#~ "Nej vil formode at MBR er korrekt, og slette GPT-informationen.\n"
+#~ "Ignorr vil formode at MBR er korrekt, men ikke ndre disken.\n"
+
+#~ msgid "Can't set non-Linux partitions as a root device."
+#~ msgstr "Kan ikke stte andre partitioner end Linux' egne som rodenhed."
+
+#~ msgid "Can't set non-Linux partitions as a swap device."
+#~ msgstr "Kan ikke stte en ikke-Linux partition som swapenhed."
+
+#~ msgid "No get_resize_constraint for %s!"
+#~ msgstr "get_resize_constraint mangler for %s!"
+
+#~ msgid "The %s file system code doesn't support %s disk labels."
+#~ msgstr ""
+#~ "Koden for filsystemet %s understtter ikke filallokeringstabeller for %s."
+
+#~ msgid "Creating new %s disklabels is not implemented yet."
+#~ msgstr ""
+#~ "Understttelse for at oprette nye partitionstabeller af typen %s er ikke "
+#~ "implementeret endnu."
+
+#~ msgid "The code to write the partition table hasn't been written for %s yet"
+#~ msgstr ""
+#~ "Understttelse for at skrive partitionstabel for %s er ikke implementeret "
+#~ "endnu."
+
+#~ msgid "Insane! %d clusters!"
+#~ msgstr "Mrkeligt! %d klynger!"
+
+#~ msgid ""
+#~ "The filesystem is going to be too big for FAT16, so FAT32 will be used. "
+#~ "This is not compatible with MS-DOS, early versions of MS-Windows 95 and "
+#~ "Windows NT. If you use these operating systems, then select cancel, and "
+#~ "create a smaller partition. If you only use Linux, BSD, MS Windows 98 "
+#~ "and/or MS Windows 95 B, then select OK."
+#~ msgstr ""
+#~ "Filsystem bliver for stort for FAT16, s FAT32 vil blive brugt. Det er "
+#~ "ikke kompatibelt med MS-DOS, tidlige versioner af MS-Windows 95 eller "
+#~ "Windows NT. Hvis du bruger disse operativsystemer, vlg annullr og opret "
+#~ "en mindre partition. Hvis du kun anvender Linux, BSD, MS Windows 98 og/"
+#~ "eller MS Windows 95 B, vlg OK."
+
+#~ msgid "Weird: fat_calc_sizes() failed for FAT32!"
+#~ msgstr "Mrkeligt: fat_calc_sizes() mislykkedes for FAT32!"
+
+#~ msgid ""
+#~ "Would you like to use FAT32 for this filesystem? It is much more "
+#~ "efficient with your disk space, but is not compatible with early versions "
+#~ "of Windows 95 and Windows NT. Only select yes if you only use Linux, "
+#~ "BSD, MS Windows 98 and/or MS Windows 95 B."
+#~ msgstr ""
+#~ "Vil du bruge FAT32 som filsystem? Det er meget mere effektivt med "
+#~ "diskpladsen, men det er ikke kompatibelt med tidlige versioner af Windows "
+#~ "95 eller Windows NT. Vlg kun JA hvis du kun anvender Linux, BSD, MS "
+#~ "Windows 98 og/eller MS Windows 95 B."
+
+#~ msgid ""
+#~ "File system doesn't have expected sizes for Windows to like it. Number "
+#~ "of clusters is %d (%d expected); size of FATs is %d sectors (%d expected)."
+#~ msgstr ""
+#~ "Filsystemet har ikke en strrelse som Windows kan lide. Antal klynger er %"
+#~ "d (%d forventet); strrelsen p FAT-erne er %d sektorer (%d forventet)."
+
+#~ msgid ""
+#~ "Partition size (%ld sectors) and filesystem size (%ld sectors) do not "
+#~ "match."
+#~ msgstr ""
+#~ "Partitionens strrelse (%ld sektorer) og filsystemets strrelse (%ld "
+#~ "sektorer) stemmer ikke overens."
+
+#~ msgid "Linux-swap partitions can not be hidden on msdos disk labels."
+#~ msgstr ""
+#~ "Linux swappartitioner kan ikke skjules p et filsystem af typen msdos."
+
+#~ msgid "Linux-swap partitions can not be bootable on pc98 disk labels."
+#~ msgstr "Linux swappartitioner er ikke opstartelige p pc98."
+
+#~ msgid "HFS partitions can't be hidden on msdos disk labels."
+#~ msgstr ""
+#~ "Partitioner af type HFS kan ikke skjules p filsystemer af typen msdos."
+
+#~ msgid "JFS partitions can't be hidden on msdos disk labels."
+#~ msgstr ""
+#~ "Partitioner af type JFS kan ikke skjules p filsystemer af typen msdos."
+
+#~ msgid "Reiserfs partitions can't be hidden on msdos disk labels."
+#~ msgstr ""
+#~ "Partitioner af type Reiserfs kan ikke skjules p filsystemer af typen "
+#~ "msdos."
+
+#~ msgid "Reiserfs partitions must be bootable on pc98 disk labels."
+#~ msgstr "Reiserfs-partitioner skal vre opstartelige p pc98."
+
+#~ msgid "XFS partitions can't be hidden on msdos disk labels."
+#~ msgstr ""
+#~ "Partitioner af type XFS kan ikke skjules p filsystemer af typen msdos."
+
+#~ msgid ""
+#~ "The operating system thinks the geometry on %s is %d/%d/%d. You should "
+#~ "check that this matches the BIOS geometry before using this program."
+#~ msgstr ""
+#~ "Operativsystemet tror at %s geometri er %d/%d/%d. Du br kontrollere at "
+#~ "dette stemmer overens med informationen i BIOS inden du anvender "
+#~ "programmet."
diff --git a/po/de.po b/po/de.po
new file mode 100644
index 0000000..1c7cca6
--- /dev/null
+++ b/po/de.po
@@ -0,0 +1,2546 @@
+# German message for GNU parted.
+# Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+# Martin von Lwis <martin@v.loewis.de>, 1999, 2000, 2001, 2002.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU parted 1.6.4-pre2\n"
+"Report-Msgid-Bugs-To: bug-parted@gnu.org\n"
+"POT-Creation-Date: 2006-04-21 21:20+0200\n"
+"PO-Revision-Date: 2002-12-06 08:55+0100\n"
+"Last-Translator: Martin von Lwis <martin@v.loewis.de>\n"
+"Language-Team: German <de@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+# cformat removed for testing
+#: libparted/arch/linux.c:284
+#, c-format
+msgid "Could not stat device %s - %s."
+msgstr "Ruf von stat fr Gert %s schlug fehl - %s."
+
+#: libparted/arch/linux.c:390
+#, c-format
+msgid ""
+"Could not determine sector size for %s: %s.\n"
+"Using the default sector size (%lld)."
+msgstr ""
+
+#: libparted/arch/linux.c:401
+#, c-format
+msgid ""
+"Device %s has a logical sector size of %lld. Not all parts of GNU Parted "
+"support this at the moment, and the working code is HIGHLY EXPERIMENTAL.\n"
+msgstr ""
+
+#: libparted/arch/linux.c:441
+#, fuzzy, c-format
+msgid "Unable to determine the size of %s (%s)."
+msgstr "Die Gre von %s kann nicht festgestellt werden (%s)."
+
+#: libparted/arch/linux.c:530
+#, c-format
+msgid "Could not get identity of device %s - %s"
+msgstr "Die Identitt von Gert %s konnte nicht ermittelt werden - %s."
+
+#: libparted/arch/linux.c:539
+msgid "Generic IDE"
+msgstr ""
+
+#: libparted/arch/linux.c:556
+#, c-format
+msgid ""
+"Device %s has multiple (%d) logical sectors per physical sector.\n"
+"GNU Parted supports this EXPERIMENTALLY for some special disk label/file "
+"system combinations, e.g. GPT and ext2/3.\n"
+"Please consult the web site for up-to-date information."
+msgstr ""
+
+#: libparted/arch/linux.c:726
+#, c-format
+msgid "Error initialising SCSI device %s - %s"
+msgstr "Fehler in der Initialisierung von SCSI-Gert %s - %s."
+
+#: libparted/arch/linux.c:781
+#, fuzzy, c-format
+msgid ""
+"The device %s has zero length, and can't possibly store a file system or "
+"partition table. Perhaps you selected the wrong device?"
+msgstr ""
+"Das Gert %s hat die Lnge 0, und kann unmglich ein Dateisystem oder eine "
+"Partitionstabelle speichern. Vielleicht haben Sie das falsche Gert "
+"ausgewhlt?"
+
+#: libparted/arch/linux.c:829
+msgid ""
+"Unable to determine geometry of file/device. You should not use Parted "
+"unless you REALLY know what you're doing!"
+msgstr ""
+"Geometrie von Datei/Gert konnte nicht ermittelt werden. Sie sollten Parted "
+"nicht verwenden, wenn sie nicht WIRKLICH wissen was Sie tun!"
+
+#: libparted/arch/linux.c:903
+msgid "DAC960 RAID controller"
+msgstr "DAC960 RAID controller"
+
+#: libparted/arch/linux.c:908
+msgid "Compaq Smart Array"
+msgstr "Compaq Smart Array"
+
+#: libparted/arch/linux.c:913
+msgid "ATARAID Controller"
+msgstr "ATARAID Controller"
+
+#: libparted/arch/linux.c:918
+msgid "I2O Controller"
+msgstr "I20 controller"
+
+#: libparted/arch/linux.c:923
+msgid "User-Mode Linux UBD"
+msgstr ""
+
+#: libparted/arch/linux.c:933
+msgid "Unknown"
+msgstr "Unbekannt"
+
+#: libparted/arch/linux.c:940
+msgid "ped_device_new() Unsupported device type"
+msgstr "ped_device_new() Nichtuntersttzter Gertetyp."
+
+#: libparted/arch/linux.c:1041 libparted/arch/gnu.c:264
+#, c-format
+msgid "Error opening %s: %s"
+msgstr "Fehler beim ffnen von %s: %s."
+
+#: libparted/arch/linux.c:1052 libparted/arch/gnu.c:274
+#, c-format
+msgid "Unable to open %s read-write (%s). %s has been opened read-only."
+msgstr ""
+"Kann %s nicht zum Schreiben ffnen (%s). %s wurde nur zum Lesen geffnet."
+
+#: libparted/arch/linux.c:1160 libparted/arch/linux.c:1228
+#: libparted/arch/gnu.c:452 libparted/arch/gnu.c:550 libparted/arch/gnu.c:678
+#, c-format
+msgid "%s during read on %s"
+msgstr "%s, whrend von %s gelesen wurde."
+
+#: libparted/arch/linux.c:1199
+#, c-format
+msgid "%s during seek for read on %s"
+msgstr "%s, whrend %s zum Lesen positioniert wurde."
+
+#: libparted/arch/linux.c:1270 libparted/arch/linux.c:1355
+#: libparted/arch/linux.c:1413 libparted/arch/gnu.c:587
+#: libparted/arch/gnu.c:632 libparted/arch/gnu.c:709
+#, c-format
+msgid "%s during write on %s"
+msgstr "%s, whrend auf %s geschrieben wurde."
+
+#: libparted/arch/linux.c:1297 libparted/arch/gnu.c:512
+#, c-format
+msgid "Can't write to %s, because it is opened read-only."
+msgstr ""
+"Auf %s kann nicht geschrieben werden, weil es nur-lesend geffnet wurde."
+
+#: libparted/arch/linux.c:1321
+#, c-format
+msgid "%s during seek for write on %s"
+msgstr "%s, whrend %s zum Schreiben positioniert wurde."
+
+#: libparted/arch/linux.c:1798
+#, fuzzy, c-format
+msgid ""
+"Error informing the kernel about modifications to partition %s -- %s. This "
+"means Linux won't know about any changes you made to %s until you reboot -- "
+"so you shouldn't mount it or use it in any way before rebooting."
+msgstr ""
+"Fehler beim Informieren des Kernels ber nderungen der Partition %s - %s. "
+"Das bedeutet, dass Linux Ihre nderungen an %s nicht bis zum Neustart sehen "
+"wird - Sie sollten die Partition nicht einhngen oder irgend sonst benutzen, "
+"bis Sie den Rechner neu gestartet haben."
+
+#: libparted/arch/linux.c:1879
+#, fuzzy, c-format
+msgid ""
+"The kernel was unable to re-read the partition table on %s (%s). This means "
+"Linux won't know anything about the modifications you made until you "
+"reboot. You should reboot your computer before doing anything with %s."
+msgstr ""
+"Der Kernel konnte die Partitionstabelle von %s nicht neu einlesen (%s). Das "
+"bedeutet, da Linux bis zum Neustart nichts ber Ihrer Modifikationen wei. "
+"Sie sollten den Rechner neu starten, bevor Sie %s in irgend einer Art "
+"verwenden."
+
+#: libparted/arch/gnu.c:97
+#, c-format
+msgid "Unable to open %s."
+msgstr "%s kann nicht geffnet werden."
+
+#: libparted/arch/gnu.c:117
+msgid "Unable to probe store."
+msgstr "Der Speicher konnte nicht untersucht werden."
+
+#: libparted/arch/gnu.c:355
+#, fuzzy
+msgid ""
+"The partition table cannot be re-read. This means you need to reboot before "
+"mounting any modified partitions. You also need to reinstall your boot "
+"loader before you reboot (which may require mounting modified partitions). "
+"It is impossible do both things! So you'll need to boot off a rescue disk, "
+"and reinstall your boot loader from the rescue disk. Read section 4 of the "
+"Parted User documentation for more information."
+msgstr ""
+"Ihre Partitionstabelle konnte nicht neu gelesen werden; Sie mssen also neu "
+"booten, bevor Sie genderte Partitionen einhngen. Sie mssen auch Ihren "
+"Bootlader vor dem Booten reinstallieren (was u.U. das Einhngen genderter "
+"Partitionen erfordert). Man kann nicht beides tun! Also mssen Sie von einer "
+"Rettungsdiskette booten und ihren Bootlader von dort reinstallieren. Lesen "
+"Sie Abschnitt 4 der Parted-Nutzerdokumentation fr Details."
+
+# XXX Englischer Text ist Unsinn.
+#: libparted/arch/gnu.c:372
+#, fuzzy, c-format
+msgid ""
+"The partition table on %s cannot be re-read (%s). This means the Hurd knows "
+"nothing about any modifications you made. You should reboot your computer "
+"before doing anything with %s."
+msgstr ""
+"Die Partitionstabelle auf %s (%s). Das bedeutet, dass das Hurd nichts ber "
+"Ihre nderungen weiss. Sie sollten den Computer neu starten, bevor Sie "
+"irgendwas mit %s machen."
+
+#: libparted/arch/gnu.c:383 parted/parted.c:2215
+msgid ""
+"You should reinstall your boot loader before rebooting. Read section 4 of "
+"the Parted User documentation for more information."
+msgstr ""
+"Sie sollten Ihren Bootlader neu installieren vor dem Neubooten. Lesen Sie "
+"Abschnitt 4 der Parted-Nutzerdokumentation fr mehr Information."
+
+#: libparted/arch/gnu.c:774
+#, c-format
+msgid "%s trying to sync %s to disk"
+msgstr "%s beim Versuch, %s auf die Platte zu speichern (sync)."
+
+#: libparted/disk.c:183
+#, c-format
+msgid "Unable to open %s - unrecognised disk label."
+msgstr "%s kann nicht geffnet werden - unerkanntes Disklabel."
+
+#: libparted/disk.c:452
+#, c-format
+msgid ""
+"This libparted doesn't have write support for %s. Perhaps it was compiled "
+"read-only."
+msgstr ""
+"Dieser libparted fehlt die Schreibunterttzung fr %s. Vielleicht wurde sie "
+"nur zum Lesen bersetzt."
+
+#: libparted/disk.c:579
+#, fuzzy, c-format
+msgid "Partition %d is %s, but the file system is %s."
+msgstr "Die Partition %d hat %.3fMb, aber das Dateisystem hat %.3fMb."
+
+#: libparted/disk.c:1056
+#, c-format
+msgid "%s disk labels do not support extended partitions."
+msgstr "%s-Disk-Labels untersttzen keine erweiterten Partitionen."
+
+#: libparted/disk.c:1616
+#, c-format
+msgid "%s disk labels don't support logical or extended partitions."
+msgstr ""
+"%s-Disk-Labels untersttzen keine logischen oder erweiterten Partitionen."
+
+#: libparted/disk.c:1629
+#, fuzzy
+msgid "Too many primary partitions."
+msgstr "Zu viele primre Partitionen."
+
+#: libparted/disk.c:1638
+#, c-format
+msgid ""
+"Can't add a logical partition to %s, because there is no extended partition."
+msgstr ""
+"Zu %s kann keine logische Partition hinzugefgt werden, da es keine "
+"erweiterte Partition gibt."
+
+#: libparted/disk.c:1662
+#, fuzzy, c-format
+msgid "Can't have more than one extended partition on %s."
+msgstr "Auf %s kann es hchstens eine erweiterte Partition geben."
+
+#: libparted/disk.c:1672
+msgid "Can't have logical partitions outside of the extended partition."
+msgstr ""
+"Eine logische Partition kann nicht auerhalb der erweiterten Partition "
+"existieren."
+
+#: libparted/disk.c:1697
+#, c-format
+msgid "Can't have a logical partition outside of the extended partition on %s."
+msgstr ""
+"Auerhalb der erweiterten Partition auf %s knnen keine logischen\n"
+"Partition existieren."
+
+#: libparted/disk.c:1707 libparted/disk.c:1761 libparted/disk.c:1927
+#, fuzzy
+msgid "Can't have overlapping partitions."
+msgstr "berlappende Partitionen knnen nicht existieren."
+
+#: libparted/disk.c:1715
+msgid "Can't have a primary partition inside an extended partition."
+msgstr "Primre Partition knnen nicht in erweiterten Partition existieren."
+
+#: libparted/disk.c:2123
+msgid "metadata"
+msgstr "Metadaten"
+
+#: libparted/disk.c:2125
+msgid "free"
+msgstr "frei"
+
+#: libparted/disk.c:2127 parted/ui.c:968 parted/ui.c:996
+msgid "extended"
+msgstr "erweitert"
+
+#: libparted/disk.c:2129 parted/ui.c:972 parted/ui.c:1000
+msgid "logical"
+msgstr "logisch"
+
+#: libparted/disk.c:2131 parted/ui.c:964 parted/ui.c:992
+msgid "primary"
+msgstr "primr"
+
+#: libparted/disk.c:2147
+msgid "boot"
+msgstr "boot"
+
+#: libparted/disk.c:2149
+msgid "root"
+msgstr "root"
+
+#: libparted/disk.c:2151
+msgid "swap"
+msgstr "swap"
+
+#: libparted/disk.c:2153
+msgid "hidden"
+msgstr "versteckt"
+
+#: libparted/disk.c:2155
+msgid "raid"
+msgstr "raid"
+
+#: libparted/disk.c:2157
+msgid "lvm"
+msgstr "lvm"
+
+#: libparted/disk.c:2159
+msgid "lba"
+msgstr "lba"
+
+#: libparted/disk.c:2161
+msgid "hp-service"
+msgstr "hp-service"
+
+#: libparted/disk.c:2163
+msgid "palo"
+msgstr ""
+
+#: libparted/disk.c:2165
+#, fuzzy
+msgid "prep"
+msgstr "boot"
+
+#: libparted/disk.c:2167
+msgid "msftres"
+msgstr ""
+
+#: libparted/disk.c:2173
+#, fuzzy, c-format
+msgid "Unknown partition flag, %d."
+msgstr "Unbekanntes Partitionsflag %d."
+
+#: libparted/labels/rdb.c:177
+#, c-format
+msgid "%s : Bad checksum on block %llu of type %s."
+msgstr ""
+
+#: libparted/labels/rdb.c:510
+#, c-format
+msgid "%s : Didn't find rdb block, should never happen."
+msgstr ""
+
+#: libparted/labels/rdb.c:595
+#, c-format
+msgid "%s : Loop detected at block %d."
+msgstr ""
+
+#: libparted/labels/rdb.c:614
+#, c-format
+msgid "%s : The %s list seems bad at block %s."
+msgstr ""
+
+#: libparted/labels/rdb.c:703
+#, c-format
+msgid "%s : Failed to list bad blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:711
+#, c-format
+msgid "%s : Failed to list partition blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:719
+#, c-format
+msgid "%s : Failed to list file system blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:727
+#, c-format
+msgid "%s : Failed to list boot blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:750
+#, fuzzy, c-format
+msgid "Failed to write partition block at %d."
+msgstr "Es ist nicht feststellbar, ob die Partition eingehangen (mounted) ist."
+
+#: libparted/labels/rdb.c:1053 libparted/labels/bsd.c:505
+#: libparted/labels/dos.c:1942 libparted/labels/dvh.c:772
+#: libparted/labels/gpt.c:1365 libparted/labels/loop.c:251
+#: libparted/labels/mac.c:1318 libparted/labels/pc98.c:764
+#: libparted/labels/sun.c:704
+msgid "Unable to satisfy all constraints on the partition."
+msgstr "Es knnen nicht alle Anforderungen an die Partition erfllt werden."
+
+#: libparted/labels/rdb.c:1081
+#, fuzzy
+msgid "Unable to allocate a partition number."
+msgstr "Partitionsnummer erwartet."
+
+#: libparted/labels/bsd.c:530
+#, fuzzy
+msgid "Unable to allocate a bsd disklabel slot."
+msgstr "Kann keine BSD-Disklabel-Zeile allozieren."
+
+#: libparted/labels/dos.c:812
+#, fuzzy, c-format
+msgid "Invalid partition table on %s -- wrong signature %x."
+msgstr "Ungltige Partitionstabelle auf %s - falsche Signature %x."
+
+#: libparted/labels/dos.c:840
+#, c-format
+msgid "Invalid partition table - recursive partition on %s."
+msgstr "Ungltige Partitionstabelle - Rekursive Partition auf %s."
+
+#: libparted/labels/dos.c:1300
+msgid "Extended partitions cannot be hidden on msdos disk labels."
+msgstr ""
+
+#: libparted/labels/dos.c:1926
+msgid "Parted can't resize partitions managed by Windows Dynamic Disk."
+msgstr ""
+
+#: libparted/labels/dvh.c:192
+#, fuzzy, c-format
+msgid "%s has no extended partition (volume header partition)."
+msgstr ""
+"%s hat keine erweiterte Partition (volume header partition). Wenn Sie "
+"Ignorieren whlen, werden alle Boot-Volumen gelscht."
+
+#: libparted/labels/dvh.c:315
+msgid "Checksum is wrong, indicating the partition table is corrupt."
+msgstr ""
+"Die Prfsumme ist falsch, was auf eine Korruption der Partitionstabelle "
+"hinweist."
+
+#: libparted/labels/dvh.c:616
+msgid "Only primary partitions can be root partitions."
+msgstr "Nur primre Partitionen knnen Wurzelpartitionen werden."
+
+#: libparted/labels/dvh.c:630
+msgid "Only primary partitions can be swap partitions."
+msgstr "Nur primre Partitionen knnen Swap-Partitionen werden."
+
+#: libparted/labels/dvh.c:644
+msgid "Only logical partitions can be a boot file."
+msgstr "Nur logische Partitionen knnen Boot-Dateien sein."
+
+#: libparted/labels/dvh.c:723
+msgid "Only logical partitions (boot files) have a name."
+msgstr "Nur logiche Partitionen (Boot-Dateien) haben einen Namen."
+
+#: libparted/labels/dvh.c:814
+msgid "Too many primary partitions"
+msgstr "Zu viele primre Partitionen."
+
+#: libparted/labels/gpt.c:433
+#, fuzzy, c-format
+msgid ""
+"%s contains GPT signatures, indicating that it has a GPT table. However, it "
+"does not have a valid fake msdos partition table, as it should. Perhaps it "
+"was corrupted -- possibly by a program that doesn't understand GPT partition "
+"tables. Or perhaps you deleted the GPT table, and are now using an msdos "
+"partition table. Is this a GPT partition table?"
+msgstr ""
+"%s enthlt GPT-Signaturen, die anzeigen, dass es eine GPT-Tabelle hat. Es "
+"ist jedoch keine gltige vorgetuschte MSDOS-Partitionstabelle vorhanden, "
+"die eigentlich erforderlich ist. Vielleicht wurde diese zerstrt - eventuell "
+"durch ein Programm, das GPT-Partitionstabellen nicht versteht. Oder "
+"vielleicht haben Sie die GPT-Tabelle gelscht, und verwenden jetzt die MSDOS-"
+"Partititonstabelle. Ist dieses eine GPT-Partitionstabelle?"
+
+#: libparted/labels/gpt.c:625
+#, fuzzy, c-format
+msgid ""
+"The format of the GPT partition table is version %x, which is newer than "
+"what Parted can recognise. Please tell us! bug-parted@gnu.org"
+msgstr ""
+"Das Format der GPT-Partitionstabelle ist neuer als das von Parted "
+"verstandene. Bitte melden Sie das an bug-parted@gnu.org!"
+
+# XXX: Backup?
+#: libparted/labels/gpt.c:747
+msgid ""
+"The backup GPT table is not at the end of the disk, as it should be. This "
+"might mean that another operating system believes the disk is smaller. Fix, "
+"by moving the backup to the end (and removing the old backup)?"
+msgstr ""
+"Die Backup-GPT-Tabelle ist nicht am Ende der Platte, wie sie eigentlich sein "
+"sollte. Das kann bedeuten, dass ein anderes Betriebssystem glaubt, die "
+"Platte sei kleiner. Soll das korrigiert werden, durch Verschieben des "
+"Backups zum Ende (und lschen des alten Backups)?"
+
+#: libparted/labels/gpt.c:782
+#, fuzzy
+msgid ""
+"The primary GPT table is corrupt, but the backup appears OK, so that will be "
+"used."
+msgstr ""
+"Die primre GPT-Tabelle ist korrupt, aber das Backup scheint in Ordnung zu "
+"sein, also wird dieses verwendet."
+
+# Versucht parted das selbst, oder ist das eine Aufforderung?
+#: libparted/labels/gpt.c:790
+#, fuzzy
+msgid ""
+"Both the primary and backup GPT tables are corrupt. Try making a fresh "
+"table, and using Parted's rescue feature to recover partitions."
+msgstr ""
+"Sowohl die primre als auch die Backup-GPT-Tabelle sind korrupt. Versuchen "
+"Sie, eine neue Tabelle zu erzeugen, und die Partititionen mit Hilfe von "
+"Parted's Rettungsmglichkeiten zu restaurieren."
+
+#: libparted/labels/mac.c:167
+#, c-format
+msgid "Invalid signature %x for Mac disk labels."
+msgstr "Ungltige Signature %x fr Mac-Disklabel."
+
+# XXX: Wie nennt Apple maps?
+#: libparted/labels/mac.c:212
+msgid "Partition map has no partition map entry!"
+msgstr "Partitionskarte (-map) hat keinen Partitionskarteneintrag!"
+
+#: libparted/labels/mac.c:259
+#, c-format
+msgid "%s is too small for a Mac disk label!"
+msgstr "%s ist zu klein fr ein Mac-Disklabel!"
+
+#: libparted/labels/mac.c:490
+#, c-format
+msgid "Partition %d has an invalid signature %x."
+msgstr "Partition %d hat eine ungltige Signatur %x."
+
+#: libparted/labels/mac.c:508
+#, c-format
+msgid "Partition %d has an invalid length of 0 bytes!"
+msgstr "Partition %d hat eine ungltige Lnge von 0 Bytes!"
+
+#: libparted/labels/mac.c:536
+#, fuzzy
+msgid "The data region doesn't start at the start of the partition."
+msgstr "Die Datenregion beginnt nicht mit dem Start einer Partition."
+
+#: libparted/labels/mac.c:553
+#, fuzzy
+msgid "The boot region doesn't start at the start of the partition."
+msgstr "Die Bootregion beginnt nicht mit dem Start einer Partition."
+
+#: libparted/labels/mac.c:567
+msgid "The partition's boot region doesn't occupy the entire partition."
+msgstr "Die Bootregion der Partition belegt nicht die ganze Partition."
+
+#: libparted/labels/mac.c:577
+msgid "The partition's data region doesn't occupy the entire partition."
+msgstr "Die Datenregion der Partition belegt nicht die ganze Partition."
+
+#: libparted/labels/mac.c:631
+#, c-format
+msgid ""
+"Weird block size on device descriptor: %d bytes is not divisible by 512."
+msgstr ""
+"Seltsame Blockgre auf dem Gertedeskriptor: %d Bytes ist nicht durch 512 "
+"teilbar."
+
+#: libparted/labels/mac.c:644
+#, c-format
+msgid ""
+"The driver descriptor says the physical block size is %d bytes, but Linux "
+"says it is %d bytes."
+msgstr ""
+"Die Treiberbeschreibung sagt, dass die physische Blockgre %d Bytes ist; "
+"Linux sagt aber es sind %d Bytes."
+
+#: libparted/labels/mac.c:692
+msgid "No valid partition map found."
+msgstr "Keine gltige Partitionskarte gefunden."
+
+#: libparted/labels/mac.c:744
+#, fuzzy, c-format
+msgid ""
+"Conflicting partition map entry sizes! Entry 1 says it is %d, but entry %d "
+"says it is %d!"
+msgstr ""
+"Widersprchliche Gren in den Partitionskarteneintrgen! Eintrag 1 sagt es "
+"sind %d Bytes, Eintrag %d sagt aber es sind %d!"
+
+#: libparted/labels/mac.c:771
+#, fuzzy
+msgid "Weird! There are 2 partitions map entries!"
+msgstr "Seltsam - 2 Partitionskarteneintrge!"
+
+#: libparted/labels/mac.c:1257
+msgid ""
+"Changing the name of a root or swap partition will prevent Linux from "
+"recognising it as such."
+msgstr ""
+"Eine nderung des Namens der Root- oder Swap-Partition verhindert, dass "
+"Linux sie als solche erkennt."
+
+#: libparted/labels/mac.c:1353
+#, fuzzy
+msgid "Can't add another partition -- the partition map is too small!"
+msgstr ""
+"Eine weitere Partition kann nicht hinzugefgt werden - die Partitionskarte "
+"ist zu klein!"
+
+#: libparted/labels/pc98.c:357
+#, fuzzy, c-format
+msgid "Invalid partition table on %s."
+msgstr "Ungltige Partitionstabelle auf %s."
+
+#: libparted/labels/pc98.c:409 libparted/labels/pc98.c:487
+#, fuzzy, c-format
+msgid ""
+"Partition %d isn't aligned to cylinder boundaries. This is still "
+"unsupported."
+msgstr ""
+"Partition %d ist nicht auf Zylindergrenzen ausgerichtet. Das muss noch "
+"untersttzt werden."
+
+#: libparted/labels/pc98.c:796
+msgid "Can't add another partition."
+msgstr "Kann keine weitere Partition hinzufgen."
+
+#: libparted/labels/sun.c:143
+msgid "Corrupted Sun disk label detected."
+msgstr "Zerstrtes Sun-Disklabel entdeckt."
+
+#: libparted/labels/sun.c:264
+#, fuzzy, c-format
+msgid ""
+"The disk CHS geometry (%d,%d,%d) reported by the operating system does not "
+"match the geometry stored on the disk label (%d,%d,%d)."
+msgstr ""
+"Die CHS-Geometrie der Platte (%d,%d,%d) stimmt nicht mit der Geometrie des "
+"Disklabels (%d,%d,%d) berein."
+
+#: libparted/labels/sun.c:286
+#, c-format
+msgid "The disk label describes a disk bigger than %s."
+msgstr "Das Disklabel beschreibt eine Platte grer als %s."
+
+#: libparted/labels/sun.c:440
+#, c-format
+msgid "The disk has %d cylinders, which is greater than the maximum of 65536."
+msgstr ""
+
+#: libparted/labels/sun.c:736
+msgid ""
+"The Whole Disk partition is the only available one left. Generally, it is "
+"not a good idea to overwrite this partition with a real one. Solaris may "
+"not be able to boot without it, and SILO (the sparc boot loader) appreciates "
+"it as well."
+msgstr ""
+"Die Whole-Disk-Partition ist die einzig verbleibende. Es ist normalerweise "
+"keine gute Idee, diese Partition mit einer echten zu berschreiben. Solaris "
+"bootet ohne vielleicht nicht mehr, und SILO (der Sparc-Bootlader) mag sie "
+"auch."
+
+#: libparted/labels/sun.c:751
+msgid "Sun disk label is full."
+msgstr "Das Sun-Disklabel ist voll."
+
+#: libparted/filesys.c:386
+msgid "Could not detect file system."
+msgstr "Dateisystem wurde nicht erkannt."
+
+# XXX: volume?
+#: libparted/filesys.c:397
+#, fuzzy
+msgid "The file system is bigger than its volume!"
+msgstr "Das Dateisystem ist grer als seine Partition!"
+
+#: libparted/filesys.c:405
+#, c-format
+msgid "Support for opening %s file systems is not implemented yet."
+msgstr ""
+"Untersttzung fr das ffnen von Dateisystemen ist fr %s noch nicht "
+"implementiert."
+
+#: libparted/filesys.c:447
+#, c-format
+msgid "Support for creating %s file systems is not implemented yet."
+msgstr "Erzeugung von Dateisystemen ist fr %s noch nicht implementiert."
+
+#: libparted/filesys.c:508
+#, c-format
+msgid "Support for checking %s file systems is not implemented yet."
+msgstr "berprfung von Dateisystemen ist fr %s noch nicht implementiert."
+
+#: libparted/filesys.c:574
+msgid "raw block copying"
+msgstr "Kopieren \"roher\" Blcke"
+
+#: libparted/filesys.c:585
+msgid "growing file system"
+msgstr "Dateisystem wird vergrert."
+
+#: libparted/filesys.c:625
+msgid "Can't copy onto an overlapping partition."
+msgstr "berlappende Partitionen knnen nicht kopiert werden."
+
+#: libparted/filesys.c:647
+#, fuzzy, c-format
+msgid ""
+"Direct support for copying file systems is not yet implemented for %s. "
+"However, support for resizing is implemented. Therefore, the file system "
+"can be copied if the new partition is at least as big as the old one. So, "
+"either shrink the partition you are trying to copy, or copy to a bigger "
+"partition."
+msgstr ""
+"Direkte Untersttzung fr das Kopieren von Dateisystemen ist noch nicht fr %"
+"s implementiert; Grennderungen sind untersttzt. Deshalb kann das "
+"Dateisystem kopiert werden, wenn die neue Partition mindestens so gross ist "
+"we die alte. Also sollten Sie entweder die Partition, die Sie kopieren "
+"wollen, verkleinern, oder auf eine grere Partition kopieren."
+
+#: libparted/filesys.c:661
+#, c-format
+msgid "Support for copying %s file systems is not implemented yet."
+msgstr "Kopieren von Dateisystemen ist fr %s noch nicht implementiert."
+
+#: libparted/filesys.c:699
+#, c-format
+msgid "Support for resizing %s file systems is not implemented yet."
+msgstr "Grennderung von Dateisystemen ist fr %s noch nicht implementiert."
+
+#: libparted/exception.c:78
+msgid "Information"
+msgstr "Information"
+
+#: libparted/exception.c:79
+msgid "Warning"
+msgstr "Warnung"
+
+#: libparted/exception.c:80
+msgid "Error"
+msgstr "Fehler"
+
+#: libparted/exception.c:81
+msgid "Fatal"
+msgstr "Fataler Fehler"
+
+#: libparted/exception.c:82
+msgid "Bug"
+msgstr "Bug"
+
+#: libparted/exception.c:83
+msgid "No Implementation"
+msgstr "Keine Implementierung"
+
+#: libparted/exception.c:87
+msgid "Fix"
+msgstr "Fix"
+
+#: libparted/exception.c:88
+msgid "Yes"
+msgstr "Ja"
+
+#: libparted/exception.c:89
+msgid "No"
+msgstr "Nein"
+
+#: libparted/exception.c:90
+msgid "OK"
+msgstr "OK"
+
+#: libparted/exception.c:91
+msgid "Retry"
+msgstr "Wiederholen"
+
+#: libparted/exception.c:92
+msgid "Ignore"
+msgstr "Ignorieren"
+
+#: libparted/exception.c:93
+msgid "Cancel"
+msgstr "Abbrechen"
+
+#: libparted/exception.c:133
+#, fuzzy, c-format
+msgid ""
+"A bug has been detected in GNU Parted. Refer to the web site of parted "
+"http://www.gnu.org/software/parted/parted.html for more informations of what "
+"could be useful for bug submitting! Please email a bug report to bug-"
+"parted@gnu.org containing at least the version (%s) and the following "
+"message: "
+msgstr ""
+"Ein Bug in GNU parted wurde entdeckt. Bitte senden Sie einen Bugreport an "
+"bug-parted@gnu.org unter Angabe der Version (%s) und der folgenden Meldung:"
+
+#: libparted/cs/geom.c:162
+msgid "Can't have the end before the start!"
+msgstr "Das Ende kommt nicht vor dem Start!"
+
+#: libparted/cs/geom.c:169
+msgid "Can't have a partition outside the disk!"
+msgstr "Partitionen ausserhalb der Platte sind nicht mglich!"
+
+#: libparted/cs/geom.c:303
+#, fuzzy, c-format
+msgid "Attempt to read sectors %ld-%ld outside of partition on %s."
+msgstr "Versuch, die Sektoren %ld-%ld auerhalb der Partition auf %s zu lesen."
+
+#: libparted/cs/geom.c:373
+#, fuzzy, c-format
+msgid "Attempt to write sectors %ld-%ld outside of partition on %s."
+msgstr ""
+"Versuch, die Sektoren %ld-%ld auerhalb der Partition auf %s zu schreiben."
+
+#: libparted/cs/geom.c:413 libparted/fs/linux_swap/linux_swap.c:353
+msgid "checking for bad blocks"
+msgstr "Test auf schlecte Blcke"
+
+#: libparted/libparted.c:286 libparted/libparted.c:306
+msgid "Out of memory."
+msgstr "Hauptspeicher erschpft."
+
+#: libparted/unit.c:139
+msgid "Cannot get unit size for special unit 'COMPACT'."
+msgstr ""
+
+#: libparted/unit.c:382
+#, c-format
+msgid "\"%s\" has invalid syntax for locations."
+msgstr ""
+
+#: libparted/unit.c:390
+#, c-format
+msgid "The maximum head value is %d."
+msgstr ""
+
+#: libparted/unit.c:397
+#, c-format
+msgid "The maximum sector value is %d."
+msgstr ""
+
+#: libparted/unit.c:409 libparted/unit.c:540
+#, c-format
+msgid "The location %s is outside of the device %s."
+msgstr ""
+
+#: libparted/unit.c:522
+msgid "Invalid number."
+msgstr ""
+
+#: libparted/fs/ext2/ext2.c:87 libparted/fs/ext2/ext2.c:112
+msgid "Inconsistent group descriptors!"
+msgstr "Inkonsistente Gruppendeskriptoren!"
+
+#: libparted/fs/ext2/ext2.c:91 libparted/fs/ext2/ext2.c:116
+#, fuzzy
+msgid "File system full!"
+msgstr "Dateisystem voll!"
+
+#: libparted/fs/ext2/ext2.c:750
+#, fuzzy
+msgid "Invalid superblock. Are you sure this is an ext2 file system?"
+msgstr ""
+"Ungltiger Superblock. Sind Sie sicher, da das ein ext2-Dateisystem ist?"
+
+#: libparted/fs/ext2/ext2.c:764 libparted/fs/ext2/ext2_resize.c:597
+#, fuzzy
+msgid "File system has errors! You should run e2fsck."
+msgstr "Das Dateisystem hat Fehler! Sie sollten e2fsck aufrufen."
+
+#: libparted/fs/ext2/ext2.c:775
+#, fuzzy
+msgid ""
+"File system was not cleanly unmounted! You should run e2fsck. Modifying an "
+"unclean file system could cause severe corruption."
+msgstr ""
+"Dateisystem wurde nicht sauber ausgehangen (unmounted)! Sie sollten e2fsck "
+"ausfhren."
+
+#: libparted/fs/ext2/ext2.c:795
+#, fuzzy
+msgid "File system has an incompatible feature enabled."
+msgstr "Das Dateisystem hat eine inkompatibles Funktion aktiviert."
+
+#: libparted/fs/ext2/ext2.c:806
+msgid "Error allocating buffer cache."
+msgstr "Fehler beim Allozieren des Puffercaches."
+
+#: libparted/fs/ext2/ext2.c:848
+msgid ""
+"A resize operation on this file system will use EXPERIMENTAL code that MAY "
+"CORRUPT it (although it hasn't done so yet).You should at least backup your "
+"data and run 'e2fsck -f' afterwards."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:114
+#, fuzzy
+msgid ""
+"Found an inode with a incorrect link count. Better go run e2fsck first!"
+msgstr ""
+"I-Node mit ungltigem Linkzhler gefunden. Fhren Sie besser erst e2fsck aus!"
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:487
+msgid "Not enough free inodes!"
+msgstr "Nicht gengend freie I-Nodes!"
+
+#: libparted/fs/ext2/ext2_resize.c:224
+#, fuzzy
+msgid "File system is too full to remove a group!"
+msgstr "Dateisystem ist zu belegt, um eine Gruppe zu lschen!"
+
+#: libparted/fs/ext2/ext2_resize.c:233
+#, fuzzy
+msgid "File system has too many allocated inodes to remove a group!"
+msgstr ""
+"Dateisystem hat zu viele allozierte I-Nodes, um eine Gruppe zu lschen!"
+
+#: libparted/fs/ext2/ext2_resize.c:493
+msgid "adding groups"
+msgstr "Hinzufgen von Gruppen"
+
+#: libparted/fs/ext2/ext2_resize.c:530
+#, fuzzy, c-format
+msgid "Your file system is too full to resize it to %i blocks. Sorry."
+msgstr ""
+"Ihr Dateisystem ist zu belegt, um es auf %i Blcke zu reduzieren. Schade."
+
+#: libparted/fs/ext2/ext2_resize.c:540
+#, fuzzy, c-format
+msgid ""
+"Your file system has too many occupied inodes to resize it to %i blocks. "
+"Sorry."
+msgstr ""
+"Ihr Dateisystem hat zu viele belegt I-Nodes, um es auf %i Blcke zu "
+"reduzieren."
+
+#: libparted/fs/ext2/ext2_resize.c:554 libparted/fs/hfs/hfs.c:243
+#: libparted/fs/hfs/hfs.c:624
+msgid "shrinking"
+msgstr "verkleinernd"
+
+#: libparted/fs/ext2/ext2_resize.c:605
+#, fuzzy
+msgid "File system was not cleanly unmounted! You should run e2fsck."
+msgstr ""
+"Dateisystem wurde nicht sauber ausgehangen (unmounted)! Sie sollten e2fsck "
+"ausfhren."
+
+#: libparted/fs/ext2/ext2_resize.c:614
+msgid ""
+"The file system has the 'dir_index' feature enabled. Parted can only resize "
+"the file system if it disables this feature. You can enable it later by "
+"running 'tune2fs -O dir_index DEVICE' and then 'e2fsck -fD DEVICE'."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_block_relocator.c:198
+#, fuzzy
+msgid "Cross-linked blocks found! Better go run e2fsck first!"
+msgstr ""
+"berkreuz-verbundene I-Nodes gefunden! Fhren Sie lieber erst e2fsck aus!"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:537
+#, fuzzy, c-format
+msgid "Block %i has no reference? Weird."
+msgstr "Block %i hat keine Referenz? Komisch."
+
+#: libparted/fs/ext2/ext2_block_relocator.c:738
+#, c-format
+msgid "Block %i shouldn't have been marked!"
+msgstr "Block %i drfte nicht markiert sein!"
+
+#: libparted/fs/ext2/interface.c:188
+#, fuzzy
+msgid ""
+"The ext2 file system passed a basic check. For a more comprehensive check, "
+"use the e2fsck program."
+msgstr ""
+"Das ext2-Dateisystem hat den Basischeck bestanden. Um einen kompletteren "
+"Test auszufhren, benutzen Sie bitte e2fsck."
+
+#: libparted/fs/ext2/interface.c:205
+msgid "Sorry, can't move the start of ext2 partitions yet!"
+msgstr ""
+"Leider kann der Anfang von ext2-Partitionen noch nicht verschoben werden."
+
+#: libparted/fs/ext2/ext2_buffer.c:82
+msgid "Couldn't flush buffer cache!"
+msgstr "Der Puffercache konnte nicht geleert werden."
+
+#: libparted/fs/ext2/ext2_mkfs.c:162
+msgid "writing per-group metadata"
+msgstr "Schreiben der Meta-Daten pro Gruppe"
+
+#: libparted/fs/ext2/ext2_mkfs.c:565
+msgid "File system too small for ext2."
+msgstr "Dateisystem zu klein fr ext2."
+
+#: libparted/fs/fat/calc.c:134
+#, fuzzy, c-format
+msgid ""
+"You need %s of free disk space to shrink this partition to this size. "
+"Currently, only %s is free."
+msgstr ""
+"Sie bentigen %dM freien Plattenplatz, um diese Partition auf diese Gre zu "
+"verkleinern (Sie haben gegenwrtig nur %dM frei)."
+
+#: libparted/fs/fat/context.c:55
+#, c-format
+msgid ""
+"Cluster start delta = %d, which is not a multiple of the cluster size %d."
+msgstr "Clusterstart delta = %d, was kein Vielfaches der Clustergre %d ist."
+
+#: libparted/fs/fat/fat.c:312
+#, fuzzy, c-format
+msgid "Partition too big/small for a %s file system."
+msgstr "Partition ist zu gro/klein fr ein %s-Dateisystem."
+
+#: libparted/fs/fat/fat.c:478
+msgid ""
+"The FATs don't match. If you don't know what this means, then select "
+"cancel, run scandisk on the file system, and then come back."
+msgstr ""
+"Die FATs stimmen nicht berein. Wenn Sie nicht wissen, was das bedeutet, "
+"whlen Sie Abbruch, rufen scandisk auf dem Dateisystem auf, und versuchen es "
+"nochmal."
+
+#: libparted/fs/fat/fat.c:518
+msgid "There are no possible configurations for this FAT type."
+msgstr "Es gibt keine mgliche Konfiguration fr diesen FAT-Typ."
+
+#: libparted/fs/fat/fat.c:530
+#, c-format
+msgid ""
+"File system doesn't have expected sizes for Windows to like it. Cluster "
+"size is %dk (%dk expected); number of clusters is %d (%d expected); size of "
+"FATs is %d sectors (%d expected)."
+msgstr ""
+"Das Dateisystem hat nicht die Gre, die Windows mag. Die Clustergre ist %"
+"dk (%dk erwartet); die Clusterzahl ist %d (%d erwartet); die FAT-Gre ist %"
+"d Sektoren (%d erwartet)."
+
+#: libparted/fs/fat/fat.c:553
+#, c-format
+msgid ""
+"File system is reporting the free space as %d clusters, not %d clusters."
+msgstr "Dateisystem meldet freien Platz als %d Cluster, nicht %d Cluster."
+
+#: libparted/fs/fat/fat.c:878
+#, fuzzy
+msgid ""
+"GNU Parted was miscompiled: the FAT boot sector should be 512 bytes. FAT "
+"support will be disabled."
+msgstr ""
+"GNU parted ist fehlbersetzt: Der FAT-Bootsektor sollte 512 Bytes sein. FAT-"
+"Untersttzung wird deaktiviert."
+
+#: libparted/fs/fat/resize.c:158
+#, fuzzy
+msgid ""
+"There's not enough room in the root directory for all of the files. Either "
+"cancel, or ignore to lose the files."
+msgstr ""
+"Es gibt nicht genug Platz fr das Wurzelverzeichnis, fr all die Dateien. "
+"Entweder abbrechen, oder ignorieren, und Dateien verlieren."
+
+#: libparted/fs/fat/resize.c:299
+msgid "Error writing to the root directory."
+msgstr "Fehler beim Schreiben des Wurzelverzeichnisses."
+
+#: libparted/fs/fat/resize.c:484
+#, fuzzy
+msgid "If you leave your file system as FAT16, then you will have no problems."
+msgstr ""
+"Wenn Sie Ihr Dateisystem als FAT16 lassen, werden Sie keine Probleme haben."
+
+#: libparted/fs/fat/resize.c:487
+msgid ""
+"If you convert to FAT16, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual)."
+msgstr ""
+"Wenn Sie in FAT16 konvertieren und MS-Windows auf dieser Partition "
+"installiert ist, mssen Sie den MS-Windows-Bootlader reinstallieren. Wenn "
+"Sie das tun wollen, sollten Sie das Parted-Handbuch studieren (oder das "
+"Ihrer Distribution)."
+
+#: libparted/fs/fat/resize.c:495
+msgid ""
+"If you leave your file system as FAT32, then you will not introduce any new "
+"problems."
+msgstr ""
+"Wenn Sie Ihr Dateisystem als FAT32 lassen, werden Sie keine neuen Probleme "
+"auslsen."
+
+#: libparted/fs/fat/resize.c:499
+msgid ""
+"If you convert to FAT32, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual). Also, "
+"converting to FAT32 will make the file system unreadable by MS DOS, MS "
+"Windows 95a, and MS Windows NT."
+msgstr ""
+"Wenn Sie zu FAT32 konvertieren und MS-Windows auf dieser Partition "
+"installiert ist, mssen Sie den MS-Windows-Bootlader neu installieren. Wenn "
+"Sie das tun wollen, sollten Sie das Parted-Handbuch lesen (oder das Ihrer "
+"Distribution). Auerdem kann nach einer Konvertierung zu FAT32 das "
+"Dateisystem nicht mehr von MS-DOS, MS-Windows 95a und MS-Windows NT gelesen "
+"werden."
+
+#: libparted/fs/fat/resize.c:513
+#, c-format
+msgid "%s %s %s"
+msgstr "%s %s %s"
+
+#: libparted/fs/fat/resize.c:514
+msgid "Would you like to use FAT32?"
+msgstr "Wollen Sie FAT32 verwenden?"
+
+#: libparted/fs/fat/resize.c:541 libparted/fs/fat/resize.c:557
+#, c-format
+msgid "%s %s"
+msgstr "%s %s"
+
+#: libparted/fs/fat/resize.c:542
+msgid ""
+"The file system can only be resized to this size by converting to FAT16."
+msgstr ""
+"Das Dateisystem kann nur grenverndert werden durch Konvertierung zu FAT16."
+
+#: libparted/fs/fat/resize.c:558
+msgid ""
+"The file system can only be resized to this size by converting to FAT32."
+msgstr ""
+"Das Dateisystem kann nur grenverndert werden durch Konvertierung zu FAT32."
+
+#: libparted/fs/fat/resize.c:571
+#, fuzzy
+msgid ""
+"GNU Parted cannot resize this partition to this size. We're working on it!"
+msgstr ""
+"GNU Parted kann diese Partition nicht auf diese Gre verkleinern. Wir "
+"arbeiten dran!"
+
+#: libparted/fs/fat/bootsector.c:48 libparted/fs/fat/bootsector.c:55
+msgid "File system has an invalid signature for a FAT file system."
+msgstr "Dateisystem hat eine ungltige Signature fr ein FAT-Dateisystem."
+
+#: libparted/fs/fat/bootsector.c:62
+msgid "File system has an invalid sector size for a FAT file system."
+msgstr "Dateisystem hat eine ungltige Sektorgre fr ein FAT-Dateisystem."
+
+#: libparted/fs/fat/bootsector.c:69
+msgid "File system has an invalid cluster size for a FAT file system."
+msgstr "Dateisystem hat eine ungltige Clustergre fr ein FAT-Dateisystem."
+
+#: libparted/fs/fat/bootsector.c:76
+#, fuzzy
+msgid ""
+"File system has an invalid number of reserved sectors for a FAT file system."
+msgstr ""
+"Dateisystem hat eine ungltige Zahl von reservierten Sektoren fr ein FAT-"
+"Dateisystem."
+
+#: libparted/fs/fat/bootsector.c:83
+#, fuzzy
+msgid "File system has an invalid number of FATs."
+msgstr "Dateisystem hat eine ungltige Zahl von FATs."
+
+#: libparted/fs/fat/bootsector.c:138
+#, c-format
+msgid ""
+"This file system has a logical sector size of %d. GNU Parted is known not "
+"to work properly with sector sizes other than 512 bytes."
+msgstr ""
+"Dieses Dateisystem hat eine logische Sektorgre von %d. GNU Parted "
+"funktioniert fr Sektorgren verschieden von 512 Bytes nicht richtig."
+
+#: libparted/fs/fat/bootsector.c:163
+#, c-format
+msgid ""
+"The file system's CHS geometry is (%d, %d, %d), which is invalid. The "
+"partition table's CHS geometry is (%d, %d, %d). If you select Ignore, the "
+"file system's CHS geometry will be left unchanged. If you select Fix, the "
+"file system's CHS geometry will be set to match the partition table's CHS "
+"geometry."
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:209
+msgid "FAT boot sector says logical sector size is 0. This is weird. "
+msgstr ""
+"Der FAT-Bootsektor sagt, die logische Sektorgre sei 0. Das ist komisch."
+
+#: libparted/fs/fat/bootsector.c:215
+msgid "FAT boot sector says there are no FAT tables. This is weird. "
+msgstr "Der FAT-Bootsektor sagt es gibt keine FAT-Tabellen. Das ist komisch."
+
+#: libparted/fs/fat/bootsector.c:221
+msgid "FAT boot sector says clusters are 0 sectors. This is weird. "
+msgstr ""
+"Der FAT-Bootsektor sagt Cluster seien 0 Sektoren gro. Das ist komisch."
+
+#: libparted/fs/fat/bootsector.c:231
+#, fuzzy
+msgid "File system is FAT12, which is unsupported."
+msgstr "Dateisystem ist FAT12, was gegenwrtig nicht untersttzt wird."
+
+#: libparted/fs/fat/bootsector.c:407
+#, c-format
+msgid ""
+"The information sector has the wrong signature (%x). Select cancel for now, "
+"and send in a bug report. If you're desperate, it's probably safe to ignore."
+msgstr ""
+"Der Informationssektor hat die falsche Signatur (%x). Whlen Sie jetzt "
+"Abbrechen, und senden Sie einen Bugreport. Wenn es sein mu, knnen Sie das "
+"auch ignorieren."
+
+#: libparted/fs/fat/count.c:149
+#, c-format
+msgid "Bad directory entry for %s: first cluster is the end of file marker."
+msgstr ""
+"Falscher Verzeichniseintrag fr %s: Erster Cluster ist am Ende des "
+"Dateimarkers."
+
+#: libparted/fs/fat/count.c:162
+#, c-format
+msgid ""
+"Bad FAT: unterminated chain for %s. You should run dosfsck or scandisk."
+msgstr ""
+"Falsche FAT: unbeendete Kette fr %s. Sie sollten dosfsck oder scandisk "
+"ausfhren."
+
+#: libparted/fs/fat/count.c:171
+#, fuzzy, c-format
+msgid ""
+"Bad FAT: cluster %d outside file system in chain for %s. You should run "
+"dosfsck or scandisk."
+msgstr ""
+"FAT-Fehler: Cluster %d ist auerhalb des Dateisystems in Kette fr %s. Sie "
+"sollten dosfsck oder scandisk ausfhren."
+
+#: libparted/fs/fat/count.c:181
+#, c-format
+msgid ""
+"Bad FAT: cluster %d is cross-linked for %s. You should run dosfsck or "
+"scandisk."
+msgstr ""
+"FAT-Fehler: Cluster %d ist berkreuz verbunden fr %s. Sie sollten dosfsck "
+"oder scandisk ausfhren."
+
+#: libparted/fs/fat/count.c:200
+#, c-format
+msgid "%s is %dk, but it has %d clusters (%dk)."
+msgstr "%s ist %dk, hat aber %d Cluster (%dk)."
+
+#: libparted/fs/fat/count.c:263
+#, c-format
+msgid ""
+"The file %s is marked as a system file. This means moving it could cause "
+"some programs to stop working."
+msgstr ""
+"Die Datei %s ist als Systemdatei markiert. Das bedeutet, dass nach dem "
+"Verschieben einige Programme nicht mehr funktionieren."
+
+#: libparted/fs/fat/table.c:138
+#, c-format
+msgid ""
+"FAT %d media %x doesn't match the boot sector's media %x. You should "
+"probably run scandisk."
+msgstr ""
+"FAT %d Medium %x stimmt nicht mit dem Bootsektor von Medium %xberein. Sie "
+"sollten wohl scandisk aufrufen."
+
+#: libparted/fs/fat/table.c:268
+#, fuzzy, c-format
+msgid "fat_table_set: cluster %ld outside file system"
+msgstr "fat_table_set: Cluster %ld ist auerhalb des Dateisystems."
+
+#: libparted/fs/fat/table.c:296
+#, fuzzy, c-format
+msgid "fat_table_get: cluster %ld outside file system"
+msgstr "fat_table_get: Cluster %ld ist auerhalb des Dateisystems."
+
+#: libparted/fs/fat/table.c:334
+msgid "fat_table_alloc_cluster: no free clusters"
+msgstr "fat_table_alloc_cluster: Keine freien Cluster."
+
+#: libparted/fs/linux_swap/linux_swap.c:236
+#, c-format
+msgid "Unrecognised linux swap signature '%10s'."
+msgstr "Unbekannte Linux-Swap-Signatur '%10s'."
+
+#: libparted/fs/linux_swap/linux_swap.c:312
+msgid "Too many bad pages."
+msgstr "Zu viele falsche Seiten."
+
+#: libparted/fs/hfs/advfs.c:123 libparted/fs/hfs/advfs_plus.c:125
+#: libparted/fs/hfs/reloc.c:416 libparted/fs/hfs/reloc.c:510
+#: libparted/fs/hfs/reloc_plus.c:541 libparted/fs/hfs/reloc_plus.c:660
+#: libparted/fs/hfs/reloc_plus.c:774
+msgid "The file system contains errors."
+msgstr ""
+
+#: libparted/fs/hfs/advfs_plus.c:290
+msgid "Bad blocks could not be read."
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:139
+#, c-format
+msgid ""
+"Trying to register an extent starting at block 0x%X, but another one already "
+"exists at this position. You should check the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:216
+#, c-format
+msgid ""
+"Trying to move an extent from block Ox%X to block Ox%X, but another one "
+"already exists at this position. This should not happen!"
+msgstr ""
+
+#: libparted/fs/hfs/file.c:145
+#, c-format
+msgid "Could not update the extent cache for HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:182
+#, c-format
+msgid "Trying to read HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:192 libparted/fs/hfs/file.c:222
+#, c-format
+msgid "Could not find sector %lli of HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:212
+#, c-format
+msgid "Trying to write HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:159
+#, c-format
+msgid "Could not update the extent cache for HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:203
+#, c-format
+msgid "Trying to read HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:214 libparted/fs/hfs/file_plus.c:256
+#, c-format
+msgid "Could not find sector %lli of HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:245
+#, c-format
+msgid "Trying to write HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:225
+msgid "Sorry, HFS cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:255 libparted/fs/hfs/hfs.c:636
+msgid "Data relocation has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:274
+msgid "Data relocation left some data in the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:313
+#, fuzzy
+msgid "writing HFS Master Directory Block"
+msgstr "Fehler beim Schreiben des Wurzelverzeichnisses."
+
+#: libparted/fs/hfs/hfs.c:461
+msgid "No valid HFS[+X] signature has been found while opening."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:471
+#, c-format
+msgid "Version %d of HFS+ isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:482
+#, c-format
+msgid "Version %d of HFSX isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:667
+msgid "Data relocation left some data at the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:715
+#, fuzzy
+msgid "Error while writing the allocation file."
+msgstr "Fehler beim Schreiben des Wurzelverzeichnisses."
+
+#: libparted/fs/hfs/hfs.c:730
+msgid "Error while writing the compatibility part of the allocation file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:745
+msgid "writing HFS+ Volume Header"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:845
+msgid "An error occurred while looking for the mandatory bad blocks file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:899
+msgid ""
+"It seems there is an error in the HFS wrapper: the bad blocks file doesn't "
+"contain the embedded HFS+ volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:930
+msgid "Sorry, HFS+ cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:965
+msgid "shrinking embedded HFS+ volume"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:981
+msgid "Resizing the HFS+ volume has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:988
+#, fuzzy
+msgid "shrinking HFS wrapper"
+msgstr "verkleinernd"
+
+#: libparted/fs/hfs/hfs.c:997
+msgid "Updating the HFS wrapper has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:1099 libparted/fs/hfs/hfs.c:1184
+#, c-format
+msgid ""
+"This is not a real %s check. This is going to extract special low level "
+"files for debugging purposes."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:156
+msgid "Bad block list header checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:169
+#, c-format
+msgid ""
+"Invalid size of a transaction block while replaying the journal (%i bytes)."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:261
+msgid ""
+"Journal stored outside of the volume are not supported. Try to desactivate "
+"the journal and run Parted again."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:272
+#, fuzzy
+msgid "Journal offset or size is not multiple of the sector size."
+msgstr "Clusterstart delta = %d, was kein Vielfaches der Clustergre %d ist."
+
+#: libparted/fs/hfs/journal.c:290
+msgid "Incorrect magic values in the journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:299
+msgid "Journal size mismatch between journal info block and journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:311
+#, fuzzy
+msgid "Some header fields are not multiple of the sector size."
+msgstr "Clusterstart delta = %d, was kein Vielfaches der Clustergre %d ist."
+
+#: libparted/fs/hfs/journal.c:320
+msgid ""
+"The sector size stored in the journal is not 512 bytes. Parted only "
+"supports 512 bytes length sectors."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:332
+msgid "Bad journal checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:350
+msgid ""
+"The journal is not empty. Parted must replay the transactions before "
+"opening the file system. This will modify the file system."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:378
+msgid ""
+"The volume header or the master directory block has changed while replaying "
+"the journal. You should restart Parted."
+msgstr ""
+
+#: libparted/fs/hfs/probe.c:52
+#, c-format
+msgid ""
+"Parted can't use HFS file systems on disks with a sector size not equal to %"
+"d bytes."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:153 libparted/fs/hfs/reloc_plus.c:157
+msgid "An extent has not been relocated."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:253 libparted/fs/hfs/reloc_plus.c:309
+msgid ""
+"A reference to an extent comes from a place it should not. You should check "
+"the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:383
+msgid "This HFS volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:477
+msgid "This HFS volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:519 libparted/fs/hfs/reloc_plus.c:670
+msgid ""
+"The extents overflow file should not contain its own extents! You should "
+"check the file system."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:576 libparted/fs/hfs/reloc_plus.c:849
+#, fuzzy
+msgid "Could not cache the file system in memory."
+msgstr "Dateisystem wurde nicht erkannt."
+
+#: libparted/fs/hfs/reloc.c:637 libparted/fs/hfs/reloc_plus.c:910
+msgid "Bad blocks list could not be loaded."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:651 libparted/fs/hfs/reloc_plus.c:926
+msgid "An error occurred during extent relocation."
+msgstr ""
+
+#: libparted/fs/hfs/reloc_plus.c:497
+msgid "This HFS+ volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc_plus.c:621
+msgid "This HFS+ volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: parted/parted.c:76
+msgid "displays this help message"
+msgstr "zeigt die Hilfe"
+
+#: parted/parted.c:77
+msgid "where necessary, prompts for user intervention"
+msgstr "wenn ntig, bittet um Nutzerintervention"
+
+#: parted/parted.c:78
+msgid "never prompts for user intervention"
+msgstr "bittet nie um Nutzerintervention"
+
+#: parted/parted.c:79
+msgid "displays the version"
+msgstr "zeigt die Version"
+
+#: parted/parted.c:87
+#, fuzzy
+msgid ""
+"NUMBER is the partition number used by Linux. On MS-DOS disk labels, the "
+"primary partitions number from 1 to 4, logical partitions from 5 onwards.\n"
+msgstr ""
+"MINOR ist die von Linux verwendete Partitionsnummer. Auf MS-DOS-Disklabel "
+"haben die primren Partitionen die Nummern 1-4, die logischen Laufwerke "
+"beginnen bei 5.\n"
+
+#: parted/parted.c:90
+msgid "LABEL-TYPE is one of: "
+msgstr "LABEL-TYP ist eines aus: "
+
+#: parted/parted.c:91
+msgid "FLAG is one of: "
+msgstr "FLAG ist eines aus: "
+
+#: parted/parted.c:92
+#, fuzzy
+msgid "UNIT is one of: "
+msgstr "FLAG ist eines aus: "
+
+#: parted/parted.c:93
+msgid "PART-TYPE is one of: primary, logical, extended\n"
+msgstr "PART-TYP ist eines aus: primary, logical, extended\n"
+
+#: parted/parted.c:95
+msgid "FS-TYPE is one of: "
+msgstr "FS-TYP ist eines aus: "
+
+#: parted/parted.c:96
+msgid ""
+"START and END are disk locations, such as 4GB or 10%. Negative values count "
+"from the end of the disk. For example, -1s specifies exactly the last "
+"sector.\n"
+msgstr ""
+
+#: parted/parted.c:99
+msgid "STATE is one of: on, off\n"
+msgstr "STATE ist eines aus: on, off\n"
+
+#: parted/parted.c:100
+msgid "DEVICE is usually /dev/hda or /dev/sda\n"
+msgstr "GERT ist normalerweise /dev/hda oder /dev/sda\n"
+
+#: parted/parted.c:101
+msgid "NAME is any word you want\n"
+msgstr "NAME ist ein beliebiges Wort Ihrer Wahl.\n"
+
+#: parted/parted.c:102
+msgid "The partition must have one of the following FS-TYPEs: "
+msgstr ""
+
+#: parted/parted.c:105
+msgid "GNU Parted Version information:\n"
+msgstr ""
+
+#: parted/parted.c:107
+#, fuzzy
+msgid ""
+"Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n"
+"This program is free software, covered by the GNU General Public License.\n"
+"\n"
+"This program is distributed in the hope that it will be useful, but WITHOUT "
+"ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
+"FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
+"more details.\n"
+"\n"
+msgstr ""
+"Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.\n"
+"bersetzungen sind Copyright (C) 1999-2002 Free Software Foundation, Inc.\n"
+"Dieses Programm ist freie Software unter den Regeln der GNU General\n"
+"Public License.\n"
+"\n"
+"Dieses Programm wird in der Hoffnung verteilt, da es ntzlich ist,\n"
+"jedoch OHNE JEGLICHE GARANTIE; sogar ohne die implizite Garantie der\n"
+"MARKTFHIGKEIT oder der ERFLLUNG EINES BESTIMMTEN ZWECKES. In der\n"
+"\"GNU General Public License\" knnen weitere Einzelheiten nachgelesen\n"
+"werden.\n"
+
+#: parted/parted.c:152
+#, c-format
+msgid "%0.f%%\t(time left %.2d:%.2d)"
+msgstr "%0.f%%\t(Restzeit %.2d:%.2d)"
+
+#: parted/parted.c:170
+#, c-format
+msgid ""
+"Partition %s is being used. You must unmount it before you modify it with "
+"Parted."
+msgstr ""
+
+#: parted/parted.c:187
+#, c-format
+msgid "Partition(s) on %s are being used."
+msgstr "Partition(en) auf %s sind benutzt."
+
+#: parted/parted.c:413 parted/parted.c:594 parted/parted.c:979
+#: parted/parted.c:1059 parted/parted.c:1586 parted/parted.c:1663
+#: parted/parted.c:1707
+msgid "Partition number?"
+msgstr "Partitionsnummer?"
+
+#: parted/parted.c:456
+msgid "Source device?"
+msgstr "Quellgert?"
+
+#: parted/parted.c:460
+msgid "Source partition number?"
+msgstr "Quellpartitionsnummer?"
+
+#: parted/parted.c:465
+#, fuzzy
+msgid "Can't copy an extended partition."
+msgstr "Erweiterte Partitionen knnen nicht kopiert werden."
+
+#: parted/parted.c:471
+msgid "Destination partition number?"
+msgstr "Zielpartitionsnummer?"
+
+#: parted/parted.c:564
+msgid "New disk label type?"
+msgstr "Neuer Disk-Label-Typ?"
+
+#: parted/parted.c:598
+msgid "File system?"
+msgstr "Dateisystem?"
+
+#: parted/parted.c:645 parted/parted.c:815
+msgid "Partition type?"
+msgstr "Partitionstyp?"
+
+#: parted/parted.c:652 parted/parted.c:822 parted/parted.c:1062
+msgid "Partition name?"
+msgstr "Partitionsname?"
+
+#: parted/parted.c:660 parted/parted.c:832
+msgid "File system type?"
+msgstr "Dateisystemtyp?"
+
+#: parted/parted.c:667 parted/parted.c:834 parted/parted.c:994
+#: parted/parted.c:1544 parted/parted.c:1595
+msgid "Start?"
+msgstr "Start?"
+
+#: parted/parted.c:669 parted/parted.c:837 parted/parted.c:997
+#: parted/parted.c:1546 parted/parted.c:1597
+msgid "End?"
+msgstr "Ende?"
+
+#: parted/parted.c:707 parted/parted.c:875
+#, fuzzy, c-format
+msgid ""
+"You requested a partition from %s to %s.\n"
+"The closest location we can manage is %s to %s. Is this still acceptable to "
+"you?"
+msgstr ""
+"Sie haben das Verschieben der Partition zu %.3f-%.3fMb verlangt. Das Beste, "
+"was Parted bieten kann, ist %.3f-%.3fMb."
+
+#: parted/parted.c:827
+#, fuzzy
+msgid "An extended partition cannot hold a file system. Did you want mkpart?"
+msgstr ""
+"Erweiterte Partitionen knnen kein Dateisystem haben. Wollten Sie mkpart?"
+
+#: parted/parted.c:985
+#, fuzzy
+msgid "Can't move an extended partition."
+msgstr "Erweiterte Partition knnen nicht verschoben werden."
+
+#: parted/parted.c:1014
+msgid "Can't move a partition onto itself. Try using resize, perhaps?"
+msgstr ""
+"Die Partition kann nicht auf sich selbst verschoben werden. Vielleicht "
+"wollen Sie Grennderung (resize) versuchen?"
+
+#: parted/parted.c:1158
+#, c-format
+msgid "Minor: %d\n"
+msgstr "Minor: %d\n"
+
+#: parted/parted.c:1159
+#, fuzzy, c-format
+msgid "Flags: %s\n"
+msgstr "Flags: "
+
+#: parted/parted.c:1160
+#, c-format
+msgid "File System: %s\n"
+msgstr "Dateisystem: %s\n"
+
+#: parted/parted.c:1161
+#, fuzzy, c-format
+msgid "Size: "
+msgstr "Gre: %10.3fMb (%d%%)\n"
+
+#: parted/parted.c:1166
+#, fuzzy, c-format
+msgid "Minimum size: "
+msgstr "Minimale Gre: %10.3fMb (%d%%)\n"
+
+#: parted/parted.c:1169
+#, fuzzy, c-format
+msgid "Maximum size: "
+msgstr "Maximale Gre: %10.3fMb (%d%%)\n"
+
+#: parted/parted.c:1255
+#, fuzzy, c-format
+msgid "Disk %s: %s\n"
+msgstr "%s %s %s"
+
+#: parted/parted.c:1256
+#, c-format
+msgid "Sector size (logical/physical): %lldB/%lldB\n"
+msgstr ""
+
+#: parted/parted.c:1267
+#, c-format
+msgid "BIOS cylinder,head,sector geometry: %d,%d,%d. Each cylinder is %s.\n"
+msgstr ""
+
+#: parted/parted.c:1273
+#, fuzzy, c-format
+msgid "Partition Table: %s\n"
+msgstr "Partitionsname?"
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Number"
+msgstr ""
+
+#: parted/parted.c:1284 parted/parted.c:1287
+#, fuzzy
+msgid "Start"
+msgstr "Start?"
+
+#: parted/parted.c:1285 parted/parted.c:1288
+#, fuzzy
+msgid "End"
+msgstr "Ende?"
+
+#: parted/parted.c:1288
+#, fuzzy
+msgid "Size"
+msgstr "resize"
+
+#: parted/parted.c:1292
+msgid "Type"
+msgstr ""
+
+#: parted/parted.c:1294
+#, fuzzy
+msgid "File system"
+msgstr "Dateisystem?"
+
+#: parted/parted.c:1297
+#, fuzzy
+msgid "Name"
+msgstr "name"
+
+#: parted/parted.c:1299
+msgid "Flags"
+msgstr "Flags"
+
+#: parted/parted.c:1352
+msgid "Free Space"
+msgstr ""
+
+#: parted/parted.c:1441
+#, fuzzy, c-format
+msgid ""
+"A %s %s partition was found at %s -> %s. Do you want to add it to the "
+"partition table?"
+msgstr ""
+"Eine %s-%s-Partition wurde bei %.3fMb -> %.3fMb gefunden. Wollen Sie die zur "
+"Partitionstabelle hinzufgen?"
+
+#: parted/parted.c:1479
+msgid "searching for file systems"
+msgstr "es wird nach Dateisystemen gesucht"
+
+#: parted/parted.c:1684
+msgid "New device?"
+msgstr "Neues Gert?"
+
+#: parted/parted.c:1709
+#, fuzzy
+msgid "Flag to Invert?"
+msgstr "Zu nderndes Flag?"
+
+#: parted/parted.c:1714
+msgid "New state?"
+msgstr "Neuer Zustand?"
+
+#: parted/parted.c:1747
+msgid "Unit?"
+msgstr ""
+
+#: parted/parted.c:1896
+msgid "check"
+msgstr "check"
+
+#: parted/parted.c:1899
+#, fuzzy
+msgid ""
+"check NUMBER do a simple check on the file system"
+msgstr ""
+"check MINOR Einen einfachen Test auf den Dateisystemen "
+"ausfhren."
+
+#: parted/parted.c:1905
+msgid "cp"
+msgstr "cp"
+
+#: parted/parted.c:1908
+#, fuzzy
+msgid ""
+"cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another "
+"partition"
+msgstr ""
+"cp [VON-GERT] VON-MINOR AUF-MINOR Dateisystem auf andere Partition "
+"kopieren."
+
+#: parted/parted.c:1914
+msgid "help"
+msgstr "help"
+
+#: parted/parted.c:1917
+#, fuzzy
+msgid ""
+"help [COMMAND] prints general help, or help on "
+"COMMAND"
+msgstr ""
+"help [KOMMANDO] Generelle Hilfe, oder Hilfe fr KOMMANDO ausgeben."
+
+#: parted/parted.c:1923
+msgid "mklabel"
+msgstr "mklabel"
+
+#: parted/parted.c:1926
+#, fuzzy
+msgid ""
+"mklabel LABEL-TYPE create a new disklabel (partition "
+"table)"
+msgstr ""
+"mklabel LABEL-TYP Neues Disklabel (Partitionstabelle) erzeugen."
+
+#: parted/parted.c:1932
+msgid "mkfs"
+msgstr "mkfs"
+
+#: parted/parted.c:1935
+#, fuzzy
+msgid ""
+"mkfs NUMBER FS-TYPE make a FS-TYPE file system on "
+"partititon NUMBER"
+msgstr ""
+"mkfs MINOR FS-TYP Dateisystem FS-TYP auf Partition MINOR erzeugen."
+
+#: parted/parted.c:1941
+msgid "mkpart"
+msgstr "mkpart"
+
+#: parted/parted.c:1944
+#, fuzzy
+msgid "mkpart PART-TYPE [FS-TYPE] START END make a partition"
+msgstr "mkpart PART-TYP [FS-TYP] START END Partition erzeugen."
+
+# XXX to set a partition ID???
+#: parted/parted.c:1950
+msgid ""
+"mkpart makes a partition without creating a new file system on the "
+"partition. FS-TYPE may be specified to set an appropriate partition ID.\n"
+msgstr ""
+"mkpart erzeugt eine Partition ohne ein neues Dateisystem auf der Partition\n"
+"zu erzeugen. FS-TYP kann angegeben werden, um eine geeignete Partitions-ID "
+"zu setzen.\n"
+
+#: parted/parted.c:1955
+msgid "mkpartfs"
+msgstr "mkpartfs"
+
+#: parted/parted.c:1958
+#, fuzzy
+msgid ""
+"mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system"
+msgstr ""
+"mkpartfs PART-TYP FS-TYP START END Partition mit Dateisystem erzeugen."
+
+#: parted/parted.c:1964
+msgid "move"
+msgstr "move"
+
+#: parted/parted.c:1967
+#, fuzzy
+msgid "move NUMBER START END move partition NUMBER"
+msgstr "move MINOR START ENDE Partition MINOR verschieben."
+
+#: parted/parted.c:1972
+msgid "name"
+msgstr "name"
+
+#: parted/parted.c:1975
+#, fuzzy
+msgid "name NUMBER NAME name partition NUMBER as NAME"
+msgstr "name MINOR NAME Partition MINOR mit NAME benennen."
+
+#: parted/parted.c:1980
+msgid "print"
+msgstr "print"
+
+#: parted/parted.c:1983
+#, fuzzy
+msgid ""
+"print [free|NUMBER|all] display the partition table, a "
+"partition, or all devices"
+msgstr "print [MINOR] Partitionstabelle oder Partition anzeigen."
+
+#: parted/parted.c:1987
+#, fuzzy
+msgid ""
+"Without arguments, print displays the entire partition table. With 'free'\n"
+"argument, information about free space will be displayed otherwise if a\n"
+"partition number is given, then more detailed information is displayed\n"
+"about that partition. If the 'all' argument is passed instead, partition\n"
+"information for all devices will be displayed."
+msgstr ""
+"Ohne Argumente zeigt print die gesamte Partitionstabelle an. Wenn eine\n"
+"Partitionsnummer angegeben wurde, werden weitere Details ber diese\n"
+"Partition angezeigt.\n"
+
+#: parted/parted.c:1995
+msgid "quit"
+msgstr "quit"
+
+#: parted/parted.c:1998
+#, fuzzy
+msgid "quit exit program"
+msgstr "quit Programm beenden."
+
+#: parted/parted.c:2003
+msgid "rescue"
+msgstr "rescue"
+
+#: parted/parted.c:2006
+#, fuzzy
+msgid ""
+"rescue START END rescue a lost partition near START "
+"and END"
+msgstr ""
+"rescue START ENDE Eine verlorene Partitionen zwischen START und ENDE "
+"retten."
+
+#: parted/parted.c:2012
+msgid "resize"
+msgstr "resize"
+
+#: parted/parted.c:2015
+#, fuzzy
+msgid ""
+"resize NUMBER START END resize partition NUMBER and its "
+"file system"
+msgstr ""
+"resize MINOR START ENDE Dateisystemgre auf Partition MINOR ndern."
+
+#: parted/parted.c:2023
+msgid "rm"
+msgstr "rm"
+
+#: parted/parted.c:2026
+#, fuzzy
+msgid "rm NUMBER delete partition NUMBER"
+msgstr "rm MINOR Partion MINOR lschen."
+
+#: parted/parted.c:2031
+msgid "select"
+msgstr "select"
+
+#: parted/parted.c:2034
+#, fuzzy
+msgid "select DEVICE choose the device to edit"
+msgstr "select GERT Whlen Sie ein Gert zur Bearbeitung."
+
+#: parted/parted.c:2039
+msgid "set"
+msgstr "set"
+
+#: parted/parted.c:2042
+#, fuzzy
+msgid ""
+"set NUMBER FLAG STATE change the FLAG on partition NUMBER"
+msgstr "rm MINOR Partion MINOR lschen."
+
+#: parted/parted.c:2048
+msgid "toggle"
+msgstr ""
+
+#: parted/parted.c:2051
+#, fuzzy
+msgid ""
+"toggle [NUMBER [FLAG]] toggle the state of FLAG on "
+"partition NUMBER"
+msgstr "rm MINOR Partion MINOR lschen."
+
+#: parted/parted.c:2057
+#, fuzzy
+msgid "unit"
+msgstr "quit"
+
+#: parted/parted.c:2060
+#, fuzzy
+msgid "unit UNIT set the default unit to UNIT"
+msgstr "quit Programm beenden."
+
+#: parted/parted.c:2065
+msgid "version"
+msgstr ""
+
+#: parted/parted.c:2068
+msgid ""
+"version displays the current version of GNU "
+"Parted and copyright information"
+msgstr ""
+
+#: parted/parted.c:2072
+msgid ""
+"version displays copyright and version information corressponding to this "
+"copy of GNU Parted\n"
+msgstr ""
+
+#: parted/parted.c:2158
+msgid "No device found"
+msgstr "Kein Gert gefunden."
+
+#: parted/parted.c:2222
+msgid "Don't forget to update /etc/fstab, if necessary.\n"
+msgstr "Vergessen Sie nicht, gegebenenfalls /etc/fstab zu ndern.\n"
+
+#: parted/ui.c:68
+msgid "Welcome to GNU Parted! Type 'help' to view a list of commands.\n"
+msgstr ""
+
+#: parted/ui.c:71
+#, fuzzy
+msgid ""
+"Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]\n"
+"Apply COMMANDs with PARAMETERS to DEVICE. If no COMMAND(s) are given, run "
+"in\n"
+"interactive mode.\n"
+msgstr ""
+"Aufruf: parted [OPTIONen] [GERT [KOMMANDO [PARAMETER...]...]\n"
+"KOMMANDOs mit PARAMETERn fr GERT ausfhren. Wenn keine KOMMANDOs "
+"angegeben \n"
+"sind, interaktiv arbeiten.\n"
+
+#: parted/ui.c:76
+#, c-format
+msgid ""
+"\n"
+"\n"
+"You found a bug in GNU Parted! Here's what you have to do:\n"
+"\n"
+"Don't panic! The bug has most likely not affected any of your data.\n"
+"Help us to fix this bug by doing the following:\n"
+"\n"
+"Check whether the bug has already been fixed by checking\n"
+"the last version of GNU Parted that you can find at:\n"
+"\n"
+"\thttp://ftp.gnu.org/gnu/parted/\n"
+"\n"
+"Please check this version prior to bug reporting.\n"
+"\n"
+"If this has not been fixed yet or if you don't know how to check,\n"
+"please visit the GNU Parted website:\n"
+"\n"
+"\thttp://www.gnu.org/software/parted\n"
+"\n"
+"for further information.\n"
+"\n"
+"Your report should contain the version of this release (%s)\n"
+"along with the error message below, the output of\n"
+"\n"
+"\tparted DEVICE unit co print unit s print\n"
+"\n"
+"and additional information about your setup you consider important.\n"
+msgstr ""
+
+#: parted/ui.c:230
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_MAPERR (Address not mapped to object)"
+msgstr ""
+
+#: parted/ui.c:235
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_ACCERR (Invalid permissions for mapped object)"
+msgstr ""
+
+#: parted/ui.c:240
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGSEGV signal was encountered."
+msgstr ""
+
+#: parted/ui.c:258
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTDIV (Integer: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:262
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTOVF (Integer: overflow)"
+msgstr ""
+
+#: parted/ui.c:266
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTDIV (Float: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:270
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTOVF (Float: overflow)"
+msgstr ""
+
+#: parted/ui.c:274
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTUND (Float: underflow)"
+msgstr ""
+
+#: parted/ui.c:278
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTRES (Float: inexact result)"
+msgstr ""
+
+#: parted/ui.c:282
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTINV (Float: invalid operation)"
+msgstr ""
+
+#: parted/ui.c:286
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTSUB (Float: subscript out of range)"
+msgstr ""
+
+#: parted/ui.c:291
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGFPE signal was encountered."
+msgstr ""
+
+#: parted/ui.c:310
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPC (Illegal Opcode)"
+msgstr ""
+
+#: parted/ui.c:314
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPN (Illegal Operand)"
+msgstr ""
+
+#: parted/ui.c:318
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLADR (Illegal addressing mode)"
+msgstr ""
+
+#: parted/ui.c:323
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLTRP (Illegal Trap)"
+msgstr ""
+
+#: parted/ui.c:327
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVOPC (Privileged Opcode)"
+msgstr ""
+
+#: parted/ui.c:331
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVREG (Privileged Register)"
+msgstr ""
+
+#: parted/ui.c:335
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_COPROC (Coprocessor Error)"
+msgstr ""
+
+#: parted/ui.c:339
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_BADSTK (Internal Stack Error)"
+msgstr ""
+
+#: parted/ui.c:343
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGILL signal was encountered."
+msgstr ""
+
+#: parted/ui.c:828
+msgid "Expecting a partition number."
+msgstr "Partitionsnummer erwartet."
+
+#: parted/ui.c:837
+msgid "Partition doesn't exist."
+msgstr "Partition existiert nicht."
+
+#: parted/ui.c:857
+msgid "Expecting a file system type."
+msgstr "Dateisystemtyp erwartet."
+
+#: parted/ui.c:863
+#, c-format
+msgid "Unknown file system type \"%s\"."
+msgstr "Unbekannter Dateisystemtyp %s."
+
+#: parted/ui.c:883
+msgid "Expecting a disk label type."
+msgstr "Ein Disklabeltyp wird erwartet."
+
+#: parted/ui.c:977
+msgid "Can't create any more partitions."
+msgstr "Kann keine weitere Partition erzeugen."
+
+#: parted/ui.c:987
+msgid "Expecting a partition type."
+msgstr "Partitionstyp erwartet."
+
+#: parted/ui.c:1115
+msgid "on"
+msgstr "on"
+
+#: parted/ui.c:1116
+msgid "off"
+msgstr "off"
+
+#: parted/ui.c:1227
+msgid "OPTIONs:"
+msgstr "OPTIONen:"
+
+#: parted/ui.c:1230
+msgid "COMMANDs:"
+msgstr "KOMMANDOs:"
+
+#: parted/ui.c:1238
+#, c-format
+msgid "Using %s\n"
+msgstr "Verwende %s\n"
+
+#, fuzzy
+#~ msgid ""
+#~ "This ext2 file system has a rather strange layout! Parted can't resize "
+#~ "this (yet)."
+#~ msgstr ""
+#~ "Dieses ext2-Dateisystem hat ein eher seltsames Layout! Parted kann hier "
+#~ "(noch) nichts tun."
+
+#~ msgid "IDE"
+#~ msgstr "IDE"
+
+#, fuzzy
+#~ msgid "Disk geometry for %s: %s - %s\n"
+#~ msgstr "Plattengeometrie fr %s: 0.000-%.3f Megabytes\n"
+
+#~ msgid "Disk label type: %s\n"
+#~ msgstr "Disk-Label-Typ: %s\n"
+
+#, fuzzy
+#~ msgid "set NUMBER FLAG STATE change a flag on partition NUMBER"
+#~ msgstr "set MINOR FLAG STATE FLAG auf Partition MINOR ndern."
+
+#, fuzzy
+#~ msgid ""
+#~ "The sector size on %s is %d bytes. Parted is known not to work properly "
+#~ "with drives with sector sizes other than %d bytes."
+#~ msgstr ""
+#~ "Die Sektorgre von %s ist %d Bytes. Parted kann auf Laufwerken mit "
+#~ "Sektorgren verschieden von %d Bytes nicht arbeiten."
+
+#~ msgid ""
+#~ "You found a bug in GNU Parted. Please email a bug report to bug-"
+#~ "parted@gnu.org containing the version (%s), and the following message:\n"
+#~ msgstr ""
+#~ "Sie haben ein Bug in GNU Parted gefunden. Bitte senden Sie einen "
+#~ "Bugreport an bug-parted@gnu.org unter Angabe der Version (%s) und der "
+#~ "folgenden Meldung:\n"
+
+#, fuzzy
+#~ msgid ""
+#~ "You requested to create a partition at %s - %s. The closest Parted can "
+#~ "manage is %s - %s."
+#~ msgstr ""
+#~ "Sie haben die Erzeugung einer Partition bei %.3f-%.3fMb verlangt. Das "
+#~ "Beste, was Parted bieten kann, ist %.3f-%.3fMb."
+
+#, fuzzy
+#~ msgid ""
+#~ "You requested to resize the partition to %s - %s. The closest Parted can "
+#~ "manage is %s - %s."
+#~ msgstr ""
+#~ "Sie haben das Verndern der Partition auf %.3f-%.3fMb verlangt. Das "
+#~ "Beste, was Parted bieten kann, ist %.3f-%.3fMb."
+
+#~ msgid "SCSI"
+#~ msgstr "SCSI"
+
+#~ msgid "File system has an invalid signature for a FAT file systems."
+#~ msgstr "Dateisystem hat eine ungltige Signature fr ein FAT-Dateisystem."
+
+#~ msgid "Minor Start End "
+#~ msgstr "Minor Start End "
+
+#~ msgid "Type "
+#~ msgstr "Type "
+
+#~ msgid "Filesystem "
+#~ msgstr "Dateisystem "
+
+#~ msgid "Name "
+#~ msgstr "Name "
+
+#~ msgid "Device %s is neither a SCSI nor IDE drive."
+#~ msgstr "Das Gert %s ist weder ein SCSI- noch ein IDE-Laufwerk."
+
+#~ msgid "Error reading %s (%s) to determine if partition is mounted."
+#~ msgstr ""
+#~ "Fehler beim Lesen von %s (%s) um festzustellen ob die Partition "
+#~ "eingehangen (mounted) ist."
+
+#~ msgid ""
+#~ "Unable to determine if partitions are mounted via /proc/mounts or /etc/"
+#~ "mtab. Make sure you don't attempt to resize or modify mounted file "
+#~ "systems. (Even read-only mounted)"
+#~ msgstr ""
+#~ "Es konnte nicht bestimmt werden, ob Partition ber /proc/mounts oder /etc/"
+#~ "mtab eingehangen (mounted) werden. berprfen Sie, dass Sie nicht "
+#~ "versuchen, ein eingehangenes Dateisystem zu vergrern oder zu verndern "
+#~ "(selbst wenn es nur zum Lesen eingehangen wurde)."
+
+#~ msgid "Could not read geometry of %s - %s."
+#~ msgstr "Die Geometrie von %s konnte nicht gelesen werden - %s."
+
+#~ msgid "Device %s has dodgey geometry."
+#~ msgstr "Gert %s hat eine unglaubwrdige Geometrie."
+
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. However, the most likely reason is that Linux "
+#~ "detected the BIOS geometry for %s incorrectly. GNU Parted suspects the "
+#~ "real geometry should be %d/%d/%d (not %d/%d/%d). You should check with "
+#~ "your BIOS first, as this may not be correct. You can inform Linux by "
+#~ "adding the parameter %s=%d,%d,%d to the command line. See the LILO or "
+#~ "GRUB documentation for more information. If you think Parted's suggested "
+#~ "geometry is correct, you may select Ignore to continue (and fix Linux "
+#~ "later). Otherwise, select Cancel (and fix Linux and/or the BIOS now)."
+#~ msgstr ""
+#~ "Die Partitionstabelle auf %s ist inkonsistent. Es gibt viele mgliche "
+#~ "Grnde dafr. Der wahrscheinlichste Grund ist, dass Linux die BIOS-"
+#~ "Geometrie fr %s falsch erkannt hat. GNU Parted vermutet, dass die wahre "
+#~ "Geometrie %d/%d/%d ist (nicht %d/%d/%d). Sie sollten zunchst Ihr BIOS "
+#~ "berprfen, da das falsch sein knnte. Sie knnen Linux durch Angabe des "
+#~ "Parameters %s=%d,%d,%d informieren. Lesen Sie LILO- oder GRUB-"
+#~ "Dokumentation fr weitere Informationen. Wenn Sie glauben, Parteds "
+#~ "vorgeschlagene Geometrie ist richtig, whlen Sie Ignore um fortzusetzen "
+#~ "(und Linux spter zu korrigieren). Ansonsten whlen Sie Cancel (und "
+#~ "korrigieren Linux und/oder das BIOS jetzt)."
+
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. Often, the reason is that Linux detected the "
+#~ "BIOS geometry incorrectly. However, this does not appear to be the case "
+#~ "here. It is safe to ignore,but ignoring may cause (fixable) problems "
+#~ "with some boot loaders, and may cause problems with FAT file systems. "
+#~ "Using LBA is recommended."
+#~ msgstr ""
+#~ "Die Partitionstabelle auf %s ist inkonsistent. Es gibt viele Grnde, "
+#~ "warum das der Fall sein knnte. Hufig ist der Grund, dass Linux die BIOS-"
+#~ "Geometry falsch erkannt hat. Das scheint jedoch hier nicht der Fall zu "
+#~ "sein. Man kann das getrost ignorieren; das kann aber (lsbare) Probleme "
+#~ "mit einigen Bootladern bewirken, und kann auf FAT-Dateisystemproblem zu "
+#~ "Problemen fhren. Die Verwendung von LBA wird empfohlen."
+
+#~ msgid ""
+#~ "Unable to align partition properly. This probably means that another "
+#~ "partitioning tool generated an incorrect partition table, because it "
+#~ "didn't have the correct BIOS geometry. It is safe to ignore,but ignoring "
+#~ "may cause (fixable) problems with some boot loaders."
+#~ msgstr ""
+#~ "Die Partitionstabelle kann nicht korrekt ausgerichtet (aligned) werden. "
+#~ "Das bedeutet vermutlich, dass ein anderes Partitionswerkzeug eine "
+#~ "inkorrekte Partitionstabelle erzeugt hat, weil es nicht die richtige BIOS-"
+#~ "Geometrie kannte. Das kann man getrost ignorieren, Ignorieren kann aber "
+#~ "(lsbare) Probleme mit anderen Bootladern hervorrufen."
+
+#~ msgid ""
+#~ " You have Windows FAT partition(s) that are not using LBA. If your BIOS "
+#~ "supports LBA, then you should switch to LBA by setting the LBA flag on "
+#~ "all FAT partitions. Otherwise, make sure the operating system and the "
+#~ "BIOS have the same geometry before resizing any FAT partitions."
+#~ msgstr ""
+#~ " Sie haben Windows FAT-Partition(en), die kein LBA verwenden. Wenn Ihr "
+#~ "BIOS LBA untersttzt, sollten Sie auf LBA umschalten, indem Sie das LBA-"
+#~ "Flag bei allen Partitionen setzen. Anderenfalls stellen Sie sicher, dass "
+#~ "das Betriebssystem und das BIOS die gleiche Geometrie verwenden, bevor "
+#~ "Sie die FAT-Partitionen verndern."
+
+#~ msgid ""
+#~ "The operating system thinks the geometry on %s is %d/%d/%d. Therefore, "
+#~ "cylinder 1024 ends at %.3fM.%s"
+#~ msgstr ""
+#~ "Das Betriebssystem glaubt, dass die Geometrie auf %s %d/%d/%d ist. "
+#~ "Deshalb endet Zylinder 1024 bei %.3fM.%s"
+
+#~ msgid "The operating system thinks the geometry on %s is %d/%d/%d.%s"
+#~ msgstr "Das Betriebssystem glaubt, die Geometrie auf %s sei %d/%d/%d.%s"
+
+#~ msgid "Partition %s is being used."
+#~ msgstr "Partition %s ist in Verwendung."
+
+#~ msgid "START and END are in megabytes\n"
+#~ msgstr "START und ENDE sind in Megabytes.\n"
diff --git a/po/en@boldquot.header b/po/en@boldquot.header
new file mode 100644
index 0000000..fedb6a0
--- /dev/null
+++ b/po/en@boldquot.header
@@ -0,0 +1,25 @@
+# All this catalog "translates" are quotation characters.
+# The msgids must be ASCII and therefore cannot contain real quotation
+# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
+# and double quote (0x22). These substitutes look strange; see
+# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
+#
+# This catalog translates grave accent (0x60) and apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019).
+# It also translates pairs of apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019)
+# and pairs of quotation mark (0x22) to
+# left double quotation mark (U+201C) and right double quotation mark (U+201D).
+#
+# When output to an UTF-8 terminal, the quotation characters appear perfectly.
+# When output to an ISO-8859-1 terminal, the single quotation marks are
+# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
+# grave/acute accent (by libiconv), and the double quotation marks are
+# transliterated to 0x22.
+# When output to an ASCII terminal, the single quotation marks are
+# transliterated to apostrophes, and the double quotation marks are
+# transliterated to 0x22.
+#
+# This catalog furthermore displays the text between the quotation marks in
+# bold face, assuming the VT100/XTerm escape sequences.
+#
diff --git a/po/en@quot.header b/po/en@quot.header
new file mode 100644
index 0000000..a9647fc
--- /dev/null
+++ b/po/en@quot.header
@@ -0,0 +1,22 @@
+# All this catalog "translates" are quotation characters.
+# The msgids must be ASCII and therefore cannot contain real quotation
+# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
+# and double quote (0x22). These substitutes look strange; see
+# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
+#
+# This catalog translates grave accent (0x60) and apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019).
+# It also translates pairs of apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019)
+# and pairs of quotation mark (0x22) to
+# left double quotation mark (U+201C) and right double quotation mark (U+201D).
+#
+# When output to an UTF-8 terminal, the quotation characters appear perfectly.
+# When output to an ISO-8859-1 terminal, the single quotation marks are
+# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
+# grave/acute accent (by libiconv), and the double quotation marks are
+# transliterated to 0x22.
+# When output to an ASCII terminal, the single quotation marks are
+# transliterated to apostrophes, and the double quotation marks are
+# transliterated to 0x22.
+#
diff --git a/po/es.po b/po/es.po
new file mode 100644
index 0000000..1fdd397
--- /dev/null
+++ b/po/es.po
@@ -0,0 +1,2573 @@
+# Mensajes en espaol para GNU parted.
+# Copyright (C) 2002 Free Software Foundation, Inc.
+# Vicente E. Llorens <vllorens@mundofree.com>, 2002.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU parted 1.6.23\n"
+"Report-Msgid-Bugs-To: bug-parted@gnu.org\n"
+"POT-Creation-Date: 2006-04-21 21:20+0200\n"
+"PO-Revision-Date: 2005-09-18 20:05+0100\n"
+"Last-Translator: Vicente E. Llorens <vllorens@mundofree.com>\n"
+"Language-Team: Spanish <es@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: libparted/arch/linux.c:284
+#, c-format
+msgid "Could not stat device %s - %s."
+msgstr "No se puede hacer `stat' sobre el dispositivo %s - %s."
+
+#: libparted/arch/linux.c:390
+#, c-format
+msgid ""
+"Could not determine sector size for %s: %s.\n"
+"Using the default sector size (%lld)."
+msgstr ""
+
+#: libparted/arch/linux.c:401
+#, c-format
+msgid ""
+"Device %s has a logical sector size of %lld. Not all parts of GNU Parted "
+"support this at the moment, and the working code is HIGHLY EXPERIMENTAL.\n"
+msgstr ""
+
+#: libparted/arch/linux.c:441
+#, c-format
+msgid "Unable to determine the size of %s (%s)."
+msgstr "No se puede determinar el tamao de %s (%s)."
+
+#: libparted/arch/linux.c:530
+#, c-format
+msgid "Could not get identity of device %s - %s"
+msgstr "No se puede obtener la identidad del dispositivo %s - %s"
+
+#: libparted/arch/linux.c:539
+msgid "Generic IDE"
+msgstr ""
+
+#: libparted/arch/linux.c:556
+#, c-format
+msgid ""
+"Device %s has multiple (%d) logical sectors per physical sector.\n"
+"GNU Parted supports this EXPERIMENTALLY for some special disk label/file "
+"system combinations, e.g. GPT and ext2/3.\n"
+"Please consult the web site for up-to-date information."
+msgstr ""
+
+#: libparted/arch/linux.c:726
+#, c-format
+msgid "Error initialising SCSI device %s - %s"
+msgstr "Error iniciando el dispositivo SCSI %s - %s"
+
+#: libparted/arch/linux.c:781
+#, c-format
+msgid ""
+"The device %s has zero length, and can't possibly store a file system or "
+"partition table. Perhaps you selected the wrong device?"
+msgstr ""
+
+# el Parted -> Parted. No se suelen poner artculos a los nombres de
+# los programas. queda un poco despectivo
+#: libparted/arch/linux.c:829
+msgid ""
+"Unable to determine geometry of file/device. You should not use Parted "
+"unless you REALLY know what you're doing!"
+msgstr ""
+"No se puede determinar la geometra del fichero/dispositivo. No debera "
+"utilizar Parted a no ser que REALMENTE sepa lo que est haciendo!"
+
+#: libparted/arch/linux.c:903
+msgid "DAC960 RAID controller"
+msgstr "Controladora RAID DAC960"
+
+# de Compaq
+#: libparted/arch/linux.c:908
+msgid "Compaq Smart Array"
+msgstr "Estructura Smart de Compaq"
+
+#: libparted/arch/linux.c:913
+msgid "ATARAID Controller"
+msgstr "Controladora ATARAID"
+
+#: libparted/arch/linux.c:918
+msgid "I2O Controller"
+msgstr "Controladora I20"
+
+#: libparted/arch/linux.c:923
+msgid "User-Mode Linux UBD"
+msgstr ""
+
+# Qu, exactamente, es desconocido? No ser desconocida?
+#: libparted/arch/linux.c:933
+msgid "Unknown"
+msgstr "Desconocida"
+
+#: libparted/arch/linux.c:940
+msgid "ped_device_new() Unsupported device type"
+msgstr "ped_device_new() Tipo de dispositivo no soportado"
+
+# o tambin "al abrir"
+#: libparted/arch/linux.c:1041 libparted/arch/gnu.c:264
+#, c-format
+msgid "Error opening %s: %s"
+msgstr "Error al abrir %s: %s"
+
+#: libparted/arch/linux.c:1052 libparted/arch/gnu.c:274
+#, c-format
+msgid "Unable to open %s read-write (%s). %s has been opened read-only."
+msgstr ""
+"No se puede abrir %s en modo lectura-escritura (%s). %s ha sido abierto en "
+"modo de slo lectura."
+
+#: libparted/arch/linux.c:1160 libparted/arch/linux.c:1228
+#: libparted/arch/gnu.c:452 libparted/arch/gnu.c:550 libparted/arch/gnu.c:678
+#, c-format
+msgid "%s during read on %s"
+msgstr "%s durante la lectura en %s"
+
+#: libparted/arch/linux.c:1199
+#, c-format
+msgid "%s during seek for read on %s"
+msgstr "%s durante la preparacin para lectura en %s"
+
+#: libparted/arch/linux.c:1270 libparted/arch/linux.c:1355
+#: libparted/arch/linux.c:1413 libparted/arch/gnu.c:587
+#: libparted/arch/gnu.c:632 libparted/arch/gnu.c:709
+#, c-format
+msgid "%s during write on %s"
+msgstr "%s durante la escritura en %s"
+
+# para slo lectura.
+#: libparted/arch/linux.c:1297 libparted/arch/gnu.c:512
+#, c-format
+msgid "Can't write to %s, because it is opened read-only."
+msgstr "No se puede escribir en %s, porque est abierto para slo lectura."
+
+#: libparted/arch/linux.c:1321
+#, c-format
+msgid "%s during seek for write on %s"
+msgstr "%s durante la preparacin para escribir en %s"
+
+# informing the kernel -> al informar al ncleo
+# in any way -> de ninguna forma
+#: libparted/arch/linux.c:1798
+#, c-format
+msgid ""
+"Error informing the kernel about modifications to partition %s -- %s. This "
+"means Linux won't know about any changes you made to %s until you reboot -- "
+"so you shouldn't mount it or use it in any way before rebooting."
+msgstr ""
+"Error al informar el ncleo sobre las modificaciones en la particin %s -- %"
+"s. Esto significa que Linux no reconocer ningn cambio que haya hecho en %"
+"s hasta que lo reinicie -- por lo tanto no puede montarla o utilizarla antes "
+"de reiniciarla."
+
+#: libparted/arch/linux.c:1879
+#, c-format
+msgid ""
+"The kernel was unable to re-read the partition table on %s (%s). This means "
+"Linux won't know anything about the modifications you made until you "
+"reboot. You should reboot your computer before doing anything with %s."
+msgstr ""
+"El ncleo no pudo releer la tabla de particiones en %s (%s). Esto significa "
+"que Linux no reconocer las modificaciones que hizo. Debe reiniciarlo antes "
+"de hacer cualquier uso con %s."
+
+#: libparted/arch/gnu.c:97
+#, c-format
+msgid "Unable to open %s."
+msgstr "No se puede abrir %s."
+
+# Unable to -> No se puede.
+#: libparted/arch/gnu.c:117
+msgid "Unable to probe store."
+msgstr "No se puede probar el guardar."
+
+# cargador "de" aranque (no del)
+#: libparted/arch/gnu.c:355
+msgid ""
+"The partition table cannot be re-read. This means you need to reboot before "
+"mounting any modified partitions. You also need to reinstall your boot "
+"loader before you reboot (which may require mounting modified partitions). "
+"It is impossible do both things! So you'll need to boot off a rescue disk, "
+"and reinstall your boot loader from the rescue disk. Read section 4 of the "
+"Parted User documentation for more information."
+msgstr ""
+"No se pudo releer la tabla de particiones, por lo tanto es necesario "
+"reiniciar antes de montar alguna particin modificada. Tambin necesita "
+"reinstalar su cargador de arranque antes de reiniciar (que puede requerir "
+"montar las particiones modificadas). Es imposible hacer ambas cosas! As "
+"que necesitar arrancar con un disco de rescate y reinstalar su cargador de "
+"arranque desde el disco de rescate. Lea la seccin 4 de la documentacin "
+"del Usuario de Parted para obtener ms informacin."
+
+#: libparted/arch/gnu.c:372
+#, c-format
+msgid ""
+"The partition table on %s cannot be re-read (%s). This means the Hurd knows "
+"nothing about any modifications you made. You should reboot your computer "
+"before doing anything with %s."
+msgstr ""
+"La tabla de particiones en %s no puede ser releida(%s). Esto significa que "
+"Hurd (o Linux) no reconocer las modificaciones que hizo. Debe reiniciar su "
+"computadora antes de hacer nada con %s."
+
+# boot loader -> cargador de arranque.
+#: libparted/arch/gnu.c:383 parted/parted.c:2215
+msgid ""
+"You should reinstall your boot loader before rebooting. Read section 4 of "
+"the Parted User documentation for more information."
+msgstr ""
+"Debe reinstalar su cargador de arranque antes de reiniciar. Lea la seccin "
+"4 de la documentacin del Usuario de Parted para obtener ms informacin."
+
+#: libparted/arch/gnu.c:774
+#, c-format
+msgid "%s trying to sync %s to disk"
+msgstr "%s intentando sincronizar %s al disco"
+
+#: libparted/disk.c:183
+#, c-format
+msgid "Unable to open %s - unrecognised disk label."
+msgstr "No se puede abrir %s - etiqueta de disco desconocida."
+
+# para slo lectura.
+#: libparted/disk.c:452
+#, c-format
+msgid ""
+"This libparted doesn't have write support for %s. Perhaps it was compiled "
+"read-only."
+msgstr ""
+"Esta libparted no tiene soporte para escritura en %s. Quizs fue compilada "
+"para slo lectura."
+
+#: libparted/disk.c:579
+#, c-format
+msgid "Partition %d is %s, but the file system is %s."
+msgstr "La particin %d es %s, pero el sistema de ficheros es de %s."
+
+#: libparted/disk.c:1056
+#, c-format
+msgid "%s disk labels do not support extended partitions."
+msgstr "Las etiquetas de disco de %s no soportan particiones extendidas."
+
+#: libparted/disk.c:1616
+#, c-format
+msgid "%s disk labels don't support logical or extended partitions."
+msgstr ""
+"Las etiquetas de disco %s no soportan particiones extendidas o lgicas."
+
+#: libparted/disk.c:1629
+msgid "Too many primary partitions."
+msgstr "Demasiadas particiones primarias."
+
+#: libparted/disk.c:1638
+#, c-format
+msgid ""
+"Can't add a logical partition to %s, because there is no extended partition."
+msgstr ""
+"No se puede aadir una particin lgica en %s, porque no hay una particin "
+"extendida."
+
+#: libparted/disk.c:1662
+#, c-format
+msgid "Can't have more than one extended partition on %s."
+msgstr "No se puede tener ms de una particin extendida en %s."
+
+#: libparted/disk.c:1672
+msgid "Can't have logical partitions outside of the extended partition."
+msgstr ""
+"No se puede tener una particin lgica fuera de la particin extendida."
+
+#: libparted/disk.c:1697
+#, c-format
+msgid "Can't have a logical partition outside of the extended partition on %s."
+msgstr ""
+"No se puede tener una particin lgica fuera de la particin extendida en %s."
+
+#: libparted/disk.c:1707 libparted/disk.c:1761 libparted/disk.c:1927
+msgid "Can't have overlapping partitions."
+msgstr "No se puede tener particiones superpuestas."
+
+#: libparted/disk.c:1715
+msgid "Can't have a primary partition inside an extended partition."
+msgstr ""
+"No se puede tener una particin primaria dentro de una particin extendida."
+
+#: libparted/disk.c:2123
+msgid "metadata"
+msgstr "metadata"
+
+#: libparted/disk.c:2125
+msgid "free"
+msgstr "libre"
+
+#: libparted/disk.c:2127 parted/ui.c:968 parted/ui.c:996
+msgid "extended"
+msgstr "extendida"
+
+#: libparted/disk.c:2129 parted/ui.c:972 parted/ui.c:1000
+msgid "logical"
+msgstr "lgica"
+
+#: libparted/disk.c:2131 parted/ui.c:964 parted/ui.c:992
+msgid "primary"
+msgstr "primaria"
+
+#: libparted/disk.c:2147
+msgid "boot"
+msgstr "arranque"
+
+#: libparted/disk.c:2149
+msgid "root"
+msgstr "raz"
+
+#: libparted/disk.c:2151
+msgid "swap"
+msgstr "swap"
+
+#: libparted/disk.c:2153
+msgid "hidden"
+msgstr "oculta"
+
+#: libparted/disk.c:2155
+msgid "raid"
+msgstr "raid"
+
+#: libparted/disk.c:2157
+msgid "lvm"
+msgstr "lvm"
+
+#: libparted/disk.c:2159
+msgid "lba"
+msgstr "lba"
+
+#: libparted/disk.c:2161
+msgid "hp-service"
+msgstr "utilidad-hp"
+
+#: libparted/disk.c:2163
+msgid "palo"
+msgstr "palo"
+
+#: libparted/disk.c:2165
+msgid "prep"
+msgstr "prep"
+
+#: libparted/disk.c:2167
+msgid "msftres"
+msgstr ""
+
+#: libparted/disk.c:2173
+#, c-format
+msgid "Unknown partition flag, %d."
+msgstr "Modificador de particiones desconocido, %d."
+
+#: libparted/labels/rdb.c:177
+#, c-format
+msgid "%s : Bad checksum on block %llu of type %s."
+msgstr "%s : Suma de comprobacin mala en el bloque %llu de tipo %s."
+
+#: libparted/labels/rdb.c:510
+#, c-format
+msgid "%s : Didn't find rdb block, should never happen."
+msgstr "%s : No se encuentra el bloque rdb, nunca debera ocurrir."
+
+#: libparted/labels/rdb.c:595
+#, c-format
+msgid "%s : Loop detected at block %d."
+msgstr "%s : Bucle detectado en el bloque %d."
+
+#: libparted/labels/rdb.c:614
+#, c-format
+msgid "%s : The %s list seems bad at block %s."
+msgstr "%s : La lista %s parece mala en el bloque %s."
+
+#: libparted/labels/rdb.c:703
+#, c-format
+msgid "%s : Failed to list bad blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:711
+#, c-format
+msgid "%s : Failed to list partition blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:719
+#, c-format
+msgid "%s : Failed to list file system blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:727
+#, c-format
+msgid "%s : Failed to list boot blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:750
+#, c-format
+msgid "Failed to write partition block at %d."
+msgstr "Fallo al escribir el bloque de la particin en %d."
+
+# No se pueden, con N.
+# no pongas dos espacios seguidos
+#: libparted/labels/rdb.c:1053 libparted/labels/bsd.c:505
+#: libparted/labels/dos.c:1942 libparted/labels/dvh.c:772
+#: libparted/labels/gpt.c:1365 libparted/labels/loop.c:251
+#: libparted/labels/mac.c:1318 libparted/labels/pc98.c:764
+#: libparted/labels/sun.c:704
+msgid "Unable to satisfy all constraints on the partition."
+msgstr "No se pueden satisfacer todas las restricciones en la particin."
+
+#: libparted/labels/rdb.c:1081
+msgid "Unable to allocate a partition number."
+msgstr "No se puede asignar un nmero de particin."
+
+#: libparted/labels/bsd.c:530
+msgid "Unable to allocate a bsd disklabel slot."
+msgstr "No se puede asignar una ranura de la etiqueta de disco bsd"
+
+# te doy permiso para poner invlida
+#: libparted/labels/dos.c:812
+#, c-format
+msgid "Invalid partition table on %s -- wrong signature %x."
+msgstr "Tabla de particiones invlida en %s -- firma errnea %x."
+
+#: libparted/labels/dos.c:840
+#, c-format
+msgid "Invalid partition table - recursive partition on %s."
+msgstr "Tabla de particiones invlida - particin recursiva en %s."
+
+#: libparted/labels/dos.c:1300
+msgid "Extended partitions cannot be hidden on msdos disk labels."
+msgstr ""
+"No pueden esconderse particiones extendidas en etiquetas de disco msdos."
+
+#: libparted/labels/dos.c:1926
+msgid "Parted can't resize partitions managed by Windows Dynamic Disk."
+msgstr ""
+"Parted no puede redimensionar particiones manejadas por Windows Dynamic Disk."
+
+# to ignore no es ignorar, es descartar, pasar por alto, hacer la vista
+# gorda, etc. ingorar es no saber, y eso se dice "not to know".
+# La segunda acepcin de ignorar (segn el diccionario) tambin es pasar
+# por alto. vll
+# volumenes -> volmenes
+#: libparted/labels/dvh.c:192
+#, fuzzy, c-format
+msgid "%s has no extended partition (volume header partition)."
+msgstr ""
+"%s no tiene particin extendida (particin de cabecera de volumen). Si lo "
+"descarta, todos volmenes de arranque sern borrados."
+
+# suma de comprobacin
+#: libparted/labels/dvh.c:315
+msgid "Checksum is wrong, indicating the partition table is corrupt."
+msgstr ""
+"La suma de comprobacin es incorrecta, lo cual indica que la tabla de "
+"particiones est corrupta."
+
+#: libparted/labels/dvh.c:616
+msgid "Only primary partitions can be root partitions."
+msgstr "Slo las particiones primarias pueden ser particiones raz."
+
+#: libparted/labels/dvh.c:630
+msgid "Only primary partitions can be swap partitions."
+msgstr "Slo las particiones primarias pueden ser particiones de intercambio."
+
+#: libparted/labels/dvh.c:644
+msgid "Only logical partitions can be a boot file."
+msgstr "Slo las particiones lgicas pueden ser un fichero de arranque."
+
+#: libparted/labels/dvh.c:723
+msgid "Only logical partitions (boot files) have a name."
+msgstr "Slo las particiones lgicas (ficheros de arranque) tienen un nombre."
+
+#: libparted/labels/dvh.c:814
+msgid "Too many primary partitions"
+msgstr "Demasiadas particiones primarias"
+
+#: libparted/labels/gpt.c:433
+#, c-format
+msgid ""
+"%s contains GPT signatures, indicating that it has a GPT table. However, it "
+"does not have a valid fake msdos partition table, as it should. Perhaps it "
+"was corrupted -- possibly by a program that doesn't understand GPT partition "
+"tables. Or perhaps you deleted the GPT table, and are now using an msdos "
+"partition table. Is this a GPT partition table?"
+msgstr ""
+"%s contiene firmas GPT, lo cual indica que tiene una tabla GPT. No "
+"obstante, no tiene una tabla de particiones msdos de imitacin vlida, como "
+"habra de ser. Quizs esta corrupta -- posiblemente por un programa que no "
+"es capaz de enterder las tablas de particin GPT. O quizs borr la tabla "
+"GPT y ahora est usando una tabla de particiones msdos. Es esta una tabla "
+"de particin GPT?"
+
+#: libparted/labels/gpt.c:625
+#, c-format
+msgid ""
+"The format of the GPT partition table is version %x, which is newer than "
+"what Parted can recognise. Please tell us! bug-parted@gnu.org"
+msgstr ""
+"El formato de la tabla de particiones GPT es la versin %x, el cual es ms "
+"nuevo que lo que Parted puede reconocer. Por favor, dganoslo a bug-"
+"parted@gnu.org"
+
+#: libparted/labels/gpt.c:747
+msgid ""
+"The backup GPT table is not at the end of the disk, as it should be. This "
+"might mean that another operating system believes the disk is smaller. Fix, "
+"by moving the backup to the end (and removing the old backup)?"
+msgstr ""
+"La copia de la tabla GPT no est al final disco, como debera ser. Esto "
+"quiere decir que otro sistema operativo cree que el disco es ms pequeo. "
+"Lo quiere arreglar moviendo la copia al final (y borrando la copia vieja)?"
+
+#: libparted/labels/gpt.c:782
+msgid ""
+"The primary GPT table is corrupt, but the backup appears OK, so that will be "
+"used."
+msgstr ""
+"La tabla primaria GPT est corrupta, pero la copia de respaldo parece "
+"correcta, por lo tanto se usar esta."
+
+#: libparted/labels/gpt.c:790
+msgid ""
+"Both the primary and backup GPT tables are corrupt. Try making a fresh "
+"table, and using Parted's rescue feature to recover partitions."
+msgstr ""
+"La tabla primaria y la copia de respaldo GPT estn corruptas. Intente crear "
+"una tabla actualizada, y utilice la opcin de rescate de Parted para "
+"reconstruir las particiones."
+
+#: libparted/labels/mac.c:167
+#, c-format
+msgid "Invalid signature %x for Mac disk labels."
+msgstr "Firma invlida %x para etiquetas de discos Mac."
+
+# Map es asignacin o tabla. Mapa es un barbarismo.
+#: libparted/labels/mac.c:212
+msgid "Partition map has no partition map entry!"
+msgstr ""
+"La tabla de particiones no tiene una entrada de la tabla de particiones!"
+
+#: libparted/labels/mac.c:259
+#, c-format
+msgid "%s is too small for a Mac disk label!"
+msgstr "%s es demasiado pequeo para una etiqueta de disco Mac!"
+
+#: libparted/labels/mac.c:490
+#, c-format
+msgid "Partition %d has an invalid signature %x."
+msgstr "La particin %d tiene una firma invlida %x."
+
+#: libparted/labels/mac.c:508
+#, c-format
+msgid "Partition %d has an invalid length of 0 bytes!"
+msgstr "La particin %d tiene una longitud invlida de 0 bytes!"
+
+#: libparted/labels/mac.c:536
+msgid "The data region doesn't start at the start of the partition."
+msgstr "La regin de datos no empieza al principio de la particin."
+
+#: libparted/labels/mac.c:553
+msgid "The boot region doesn't start at the start of the partition."
+msgstr "La regin de arranque no empieza al principio de la particin."
+
+#: libparted/labels/mac.c:567
+msgid "The partition's boot region doesn't occupy the entire partition."
+msgstr "La regin de arranque de la particin no ocupa toda la particin."
+
+#: libparted/labels/mac.c:577
+msgid "The partition's data region doesn't occupy the entire partition."
+msgstr "La regin de datos de la particin no ocupa toda la particin."
+
+#: libparted/labels/mac.c:631
+#, c-format
+msgid ""
+"Weird block size on device descriptor: %d bytes is not divisible by 512."
+msgstr ""
+"Tamao de bloque extrao en el descriptor del dispositivo: %d bytes no es "
+"divisible por 512."
+
+#: libparted/labels/mac.c:644
+#, c-format
+msgid ""
+"The driver descriptor says the physical block size is %d bytes, but Linux "
+"says it is %d bytes."
+msgstr ""
+"El descriptor del controlador dice que el tamao del bloque fsico es de %d "
+"bytes, pero Linux dice que es de %d bytes."
+
+#: libparted/labels/mac.c:692
+msgid "No valid partition map found."
+msgstr "Se encontr una tabla de particiones invlida."
+
+#: libparted/labels/mac.c:744
+#, c-format
+msgid ""
+"Conflicting partition map entry sizes! Entry 1 says it is %d, but entry %d "
+"says it is %d!"
+msgstr ""
+"Conflicto en el tamao de la entrada de la tabla de particiones! La "
+"entrada 1 dice que es %d, pero la entrada %d dice que es %d!"
+
+#: libparted/labels/mac.c:771
+msgid "Weird! There are 2 partitions map entries!"
+msgstr "Extrao! Hay 2 entradas de tabla de particiones!"
+
+#: libparted/labels/mac.c:1257
+msgid ""
+"Changing the name of a root or swap partition will prevent Linux from "
+"recognising it as such."
+msgstr ""
+"Cambiando el nombre de una particin raz o de intercambio impedirn a Linux "
+"de reconocela como tal."
+
+#: libparted/labels/mac.c:1353
+msgid "Can't add another partition -- the partition map is too small!"
+msgstr ""
+"No se puede aadir otra particin -- la tabla de las particiones es "
+"demasiado pequea!"
+
+#: libparted/labels/pc98.c:357
+#, c-format
+msgid "Invalid partition table on %s."
+msgstr "Tabla de particin invlida en %s."
+
+#: libparted/labels/pc98.c:409 libparted/labels/pc98.c:487
+#, c-format
+msgid ""
+"Partition %d isn't aligned to cylinder boundaries. This is still "
+"unsupported."
+msgstr ""
+"La particin %d no est alineada a los lmites del cilindro. Necesita "
+"aadirle soporte."
+
+# No se puede.
+#: libparted/labels/pc98.c:796
+msgid "Can't add another partition."
+msgstr "No se puede aadir otra particin."
+
+#: libparted/labels/sun.c:143
+msgid "Corrupted Sun disk label detected."
+msgstr "Se ha detectado una etiqueta de disco Sun corrupta."
+
+#: libparted/labels/sun.c:264
+#, c-format
+msgid ""
+"The disk CHS geometry (%d,%d,%d) reported by the operating system does not "
+"match the geometry stored on the disk label (%d,%d,%d)."
+msgstr ""
+"La geometra de disco CHS (%d,%d,%d) informado por el sistema operativo no "
+"parece coincidir con la geometra guardada en la etiqueta de disco (%d,%d,%"
+"d)."
+
+#: libparted/labels/sun.c:286
+#, c-format
+msgid "The disk label describes a disk bigger than %s."
+msgstr "La etiqueta de disco describe un disco mayor que %s."
+
+#: libparted/labels/sun.c:440
+#, c-format
+msgid "The disk has %d cylinders, which is greater than the maximum of 65536."
+msgstr "El disco tiene %d cilindros que son mayores que el mximo de 65536."
+
+#: libparted/labels/sun.c:736
+msgid ""
+"The Whole Disk partition is the only available one left. Generally, it is "
+"not a good idea to overwrite this partition with a real one. Solaris may "
+"not be able to boot without it, and SILO (the sparc boot loader) appreciates "
+"it as well."
+msgstr ""
+"La particin Entera del Disco es la nica que queda disponible. "
+"Generalmente, no es una buena idea sobrescribir esta particin con una "
+"verdadera. Solaris no se puede arrancar sin ella, y SILO (el cargador de "
+"arranque de sparc) tambin la agradece."
+
+#: libparted/labels/sun.c:751
+msgid "Sun disk label is full."
+msgstr "La etiqueta de disco Sun est llena."
+
+#: libparted/filesys.c:386
+msgid "Could not detect file system."
+msgstr "No se puede detectar el sistema de ficheros."
+
+#: libparted/filesys.c:397
+msgid "The file system is bigger than its volume!"
+msgstr "El sistema de ficheros es ms grande que su volumen!"
+
+#: libparted/filesys.c:405
+#, c-format
+msgid "Support for opening %s file systems is not implemented yet."
+msgstr ""
+"El soporte para abrir el sistema de ficheros %s an no est implementado."
+
+#: libparted/filesys.c:447
+#, c-format
+msgid "Support for creating %s file systems is not implemented yet."
+msgstr ""
+"El soporte para crear el sistema de ficheros %s an no est implementado."
+
+#: libparted/filesys.c:508
+#, c-format
+msgid "Support for checking %s file systems is not implemented yet."
+msgstr ""
+"El soporte para comprobar el sistema de ficheros %s an no est implementado."
+
+#: libparted/filesys.c:574
+msgid "raw block copying"
+msgstr "copiando los bloque en bruto"
+
+#: libparted/filesys.c:585
+msgid "growing file system"
+msgstr "sistema de ficheros creciendo"
+
+#: libparted/filesys.c:625
+msgid "Can't copy onto an overlapping partition."
+msgstr "No se puede copiar sobre una particin superpuesta."
+
+#: libparted/filesys.c:647
+#, c-format
+msgid ""
+"Direct support for copying file systems is not yet implemented for %s. "
+"However, support for resizing is implemented. Therefore, the file system "
+"can be copied if the new partition is at least as big as the old one. So, "
+"either shrink the partition you are trying to copy, or copy to a bigger "
+"partition."
+msgstr ""
+"El soporte directo para copiar sistemas de ficheros an no est implementado "
+"para %s. Sin embargo, el soporte para redimensionar est implementado. Por "
+"lo tanto, el sistema de ficheros se puede copiar si la nueva particin es "
+"por lo menos tan grande como la vieja. As, o reduce la particin que est "
+"intentando copiar o copie en una particin ms grande."
+
+#: libparted/filesys.c:661
+#, c-format
+msgid "Support for copying %s file systems is not implemented yet."
+msgstr ""
+"El soporte para copiar el sistema de ficheros %s an no est implementado."
+
+#: libparted/filesys.c:699
+#, c-format
+msgid "Support for resizing %s file systems is not implemented yet."
+msgstr ""
+"El soporte para redimensionar el sistema de ficheros %s an no est "
+"implementado."
+
+#: libparted/exception.c:78
+msgid "Information"
+msgstr "Informacin"
+
+#: libparted/exception.c:79
+msgid "Warning"
+msgstr "Aviso"
+
+#: libparted/exception.c:80
+msgid "Error"
+msgstr "Error"
+
+#: libparted/exception.c:81
+msgid "Fatal"
+msgstr "Fatal"
+
+#: libparted/exception.c:82
+msgid "Bug"
+msgstr "Bicho"
+
+#: libparted/exception.c:83
+msgid "No Implementation"
+msgstr "Sin Implementacin"
+
+#: libparted/exception.c:87
+msgid "Fix"
+msgstr "Arreglar"
+
+#: libparted/exception.c:88
+msgid "Yes"
+msgstr "S"
+
+#: libparted/exception.c:89
+msgid "No"
+msgstr "No"
+
+#: libparted/exception.c:90
+msgid "OK"
+msgstr "De acuerdo"
+
+#: libparted/exception.c:91
+msgid "Retry"
+msgstr "Reintentar"
+
+#: libparted/exception.c:92
+msgid "Ignore"
+msgstr "Descartar"
+
+#: libparted/exception.c:93
+msgid "Cancel"
+msgstr "Cancelar"
+
+# bicho :-)
+#: libparted/exception.c:133
+#, fuzzy, c-format
+msgid ""
+"A bug has been detected in GNU Parted. Refer to the web site of parted "
+"http://www.gnu.org/software/parted/parted.html for more informations of what "
+"could be useful for bug submitting! Please email a bug report to bug-"
+"parted@gnu.org containing at least the version (%s) and the following "
+"message: "
+msgstr ""
+"Si detect un bicho en GNU parted. Por favor, enve un informe del bicho a "
+"bug-parted@gnu.org conteniendo la versin (%s) y el mensaje siguiente:"
+
+#: libparted/cs/geom.c:162
+msgid "Can't have the end before the start!"
+msgstr "No se puede tener el final de la particin antes del inicio!"
+
+#: libparted/cs/geom.c:169
+msgid "Can't have a partition outside the disk!"
+msgstr "No se puede hacer una particin fuera del disco!"
+
+#: libparted/cs/geom.c:303
+#, c-format
+msgid "Attempt to read sectors %ld-%ld outside of partition on %s."
+msgstr "Se intentaron leer los sectores %ld-%ld fuera de la particin en %s."
+
+#: libparted/cs/geom.c:373
+#, c-format
+msgid "Attempt to write sectors %ld-%ld outside of partition on %s."
+msgstr ""
+"Se intentaron escribir los sectores %ld-%ld fuera de la particin en %s."
+
+#: libparted/cs/geom.c:413 libparted/fs/linux_swap/linux_swap.c:353
+msgid "checking for bad blocks"
+msgstr "comprobando bloques erroneos"
+
+#: libparted/libparted.c:286 libparted/libparted.c:306
+msgid "Out of memory."
+msgstr "No hay memoria."
+
+#: libparted/unit.c:139
+msgid "Cannot get unit size for special unit 'COMPACT'."
+msgstr ""
+
+#: libparted/unit.c:382
+#, c-format
+msgid "\"%s\" has invalid syntax for locations."
+msgstr ""
+
+#: libparted/unit.c:390
+#, c-format
+msgid "The maximum head value is %d."
+msgstr ""
+
+#: libparted/unit.c:397
+#, c-format
+msgid "The maximum sector value is %d."
+msgstr ""
+
+#: libparted/unit.c:409 libparted/unit.c:540
+#, c-format
+msgid "The location %s is outside of the device %s."
+msgstr ""
+
+#: libparted/unit.c:522
+msgid "Invalid number."
+msgstr ""
+
+#: libparted/fs/ext2/ext2.c:87 libparted/fs/ext2/ext2.c:112
+msgid "Inconsistent group descriptors!"
+msgstr "Descriptores de grupo inconsistentes!"
+
+#: libparted/fs/ext2/ext2.c:91 libparted/fs/ext2/ext2.c:116
+msgid "File system full!"
+msgstr "Sistema de ficheros lleno!"
+
+#: libparted/fs/ext2/ext2.c:750
+msgid "Invalid superblock. Are you sure this is an ext2 file system?"
+msgstr ""
+"Superbloque invlido. Est seguro de que este es un sistema de ficheros "
+"ext2?"
+
+#: libparted/fs/ext2/ext2.c:764 libparted/fs/ext2/ext2_resize.c:597
+msgid "File system has errors! You should run e2fsck."
+msgstr "El sistema de ficheros tiene errores! Debera ejecutar e2fsck."
+
+#: libparted/fs/ext2/ext2.c:775
+msgid ""
+"File system was not cleanly unmounted! You should run e2fsck. Modifying an "
+"unclean file system could cause severe corruption."
+msgstr ""
+"El sistema de ficheros no fue desmontado limpiamente! Debera ejecutar "
+"e2fsck. Modificar un sistema de ficheros sucio podra causar una corrupcin "
+"grave."
+
+#: libparted/fs/ext2/ext2.c:795
+msgid "File system has an incompatible feature enabled."
+msgstr "El sistema de ficheros tiene activada una caracterstica incompatible."
+
+#: libparted/fs/ext2/ext2.c:806
+msgid "Error allocating buffer cache."
+msgstr "Error asignando espacio en la cach del bfer."
+
+#: libparted/fs/ext2/ext2.c:848
+msgid ""
+"A resize operation on this file system will use EXPERIMENTAL code that MAY "
+"CORRUPT it (although it hasn't done so yet).You should at least backup your "
+"data and run 'e2fsck -f' afterwards."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:114
+msgid ""
+"Found an inode with a incorrect link count. Better go run e2fsck first!"
+msgstr ""
+"Encontrado un nodo-i con una cuenta de enlace incorrecta. Mejor ejecutar "
+"primero e2fsck!"
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:487
+msgid "Not enough free inodes!"
+msgstr "No hay suficientes nodos-i libres!"
+
+#: libparted/fs/ext2/ext2_resize.c:224
+msgid "File system is too full to remove a group!"
+msgstr "El sistema de ficheros est demasiado ocupado para borrar un grupo!"
+
+#: libparted/fs/ext2/ext2_resize.c:233
+msgid "File system has too many allocated inodes to remove a group!"
+msgstr ""
+"El sistema de ficheros tiene demasiados nodos-i asignados para borrar un "
+"grupo!"
+
+#: libparted/fs/ext2/ext2_resize.c:493
+msgid "adding groups"
+msgstr "aadiendo grupos"
+
+#: libparted/fs/ext2/ext2_resize.c:530
+#, c-format
+msgid "Your file system is too full to resize it to %i blocks. Sorry."
+msgstr ""
+"Su sistema de ficheros est demasiado lleno para redimensionarlo a %i "
+"bloques. Disculpe."
+
+#: libparted/fs/ext2/ext2_resize.c:540
+#, c-format
+msgid ""
+"Your file system has too many occupied inodes to resize it to %i blocks. "
+"Sorry."
+msgstr ""
+"Su sistema de ficheros tiene demasiados nodos-i ocupados para "
+"redimensionarlo a %i bloques. Disculpe."
+
+#: libparted/fs/ext2/ext2_resize.c:554 libparted/fs/hfs/hfs.c:243
+#: libparted/fs/hfs/hfs.c:624
+msgid "shrinking"
+msgstr "contrayendo"
+
+#: libparted/fs/ext2/ext2_resize.c:605
+msgid "File system was not cleanly unmounted! You should run e2fsck."
+msgstr ""
+"El sistema de ficheros no fue desmontado limpiamente! Debera ejecutar "
+"e2fsck."
+
+#: libparted/fs/ext2/ext2_resize.c:614
+msgid ""
+"The file system has the 'dir_index' feature enabled. Parted can only resize "
+"the file system if it disables this feature. You can enable it later by "
+"running 'tune2fs -O dir_index DEVICE' and then 'e2fsck -fD DEVICE'."
+msgstr ""
+"El sistema de ficheros tiene la opcin 'dir_index' habilitada. Parted slo "
+"pude redimensionar el sistema de ficheros si desactiva esta opcin. Puede "
+"habilitarla despus ejecutando 'tune2fs -O dir_index UNIDAD' y luego 'e2fsck "
+"-fD UNIDAD'."
+
+#: libparted/fs/ext2/ext2_block_relocator.c:198
+msgid "Cross-linked blocks found! Better go run e2fsck first!"
+msgstr ""
+"Se encontraron bloques con referencia cruzada! Mejor ejecutar primero "
+"e2fsck!"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:537
+#, c-format
+msgid "Block %i has no reference? Weird."
+msgstr "El bloque %i no tiene una referencia? Estrao."
+
+#: libparted/fs/ext2/ext2_block_relocator.c:738
+#, c-format
+msgid "Block %i shouldn't have been marked!"
+msgstr "El bloque %i no debera haber sido marcado!"
+
+#: libparted/fs/ext2/interface.c:188
+msgid ""
+"The ext2 file system passed a basic check. For a more comprehensive check, "
+"use the e2fsck program."
+msgstr ""
+"El sistema de ficheros ext2 pas una comprobacin bsica. Para una "
+"comprobacin ms a fondo, utilize el programa e2fsck."
+
+#: libparted/fs/ext2/interface.c:205
+msgid "Sorry, can't move the start of ext2 partitions yet!"
+msgstr "Disculpe, an no se puede mover el principio de las particiones ext2!"
+
+#: libparted/fs/ext2/ext2_buffer.c:82
+msgid "Couldn't flush buffer cache!"
+msgstr "No se pudo vaciar la cach del bfer!"
+
+#: libparted/fs/ext2/ext2_mkfs.c:162
+msgid "writing per-group metadata"
+msgstr "escribiendo metadatos por-grupo"
+
+#: libparted/fs/ext2/ext2_mkfs.c:565
+msgid "File system too small for ext2."
+msgstr "Sistema de ficheros demasiado pequeo para ext2."
+
+#: libparted/fs/fat/calc.c:134
+#, c-format
+msgid ""
+"You need %s of free disk space to shrink this partition to this size. "
+"Currently, only %s is free."
+msgstr ""
+"Necesita %s de espacio disco libre para reducir esta particin a este "
+"tamao. Actualmente, slo %s est libre."
+
+#: libparted/fs/fat/context.c:55
+#, c-format
+msgid ""
+"Cluster start delta = %d, which is not a multiple of the cluster size %d."
+msgstr ""
+"El inicio delta del cluster = %d, que no es un mltiplo del tamao de "
+"cluster %d."
+
+#: libparted/fs/fat/fat.c:312
+#, c-format
+msgid "Partition too big/small for a %s file system."
+msgstr "Particin demasiado grande/pequea para un sistema de ficheros %s."
+
+#: libparted/fs/fat/fat.c:478
+msgid ""
+"The FATs don't match. If you don't know what this means, then select "
+"cancel, run scandisk on the file system, and then come back."
+msgstr ""
+"Las FATs no son iguales. Si no sabe que significa esto, seleccione "
+"cancelar, ejecute scandisk en el sistema de ficheros, y despus vuelva."
+
+#: libparted/fs/fat/fat.c:518
+msgid "There are no possible configurations for this FAT type."
+msgstr "No hay configuraciones posibles para este tipo de FAT."
+
+#: libparted/fs/fat/fat.c:530
+#, c-format
+msgid ""
+"File system doesn't have expected sizes for Windows to like it. Cluster "
+"size is %dk (%dk expected); number of clusters is %d (%d expected); size of "
+"FATs is %d sectors (%d expected)."
+msgstr ""
+"El sistema de ficheros no tiene los tamaos esperados para que los utilize "
+"Windows. El tamao del cluster es %dk (se esperaba %dk); el nmero de "
+"clusters es de %d (se esperaba %d); el tamao de la FAT es de %d sectores "
+"(se esperaba %d)."
+
+#: libparted/fs/fat/fat.c:553
+#, c-format
+msgid ""
+"File system is reporting the free space as %d clusters, not %d clusters."
+msgstr ""
+"El sistema de ficheros est informando que el espacio libre de clusters es "
+"de %d, no de %d clusters."
+
+#: libparted/fs/fat/fat.c:878
+msgid ""
+"GNU Parted was miscompiled: the FAT boot sector should be 512 bytes. FAT "
+"support will be disabled."
+msgstr ""
+"GNU parted fue mal compilado: el sector de arranque FAT debera ser de 512 "
+"bytes. El soporte a FAT ser desabilitado."
+
+#: libparted/fs/fat/resize.c:158
+msgid ""
+"There's not enough room in the root directory for all of the files. Either "
+"cancel, or ignore to lose the files."
+msgstr ""
+"No hay espacio suficiente en el directorio root para todos los ficheros. "
+"Puede cancelar o descartar perdiendo los ficheros."
+
+#: libparted/fs/fat/resize.c:299
+msgid "Error writing to the root directory."
+msgstr "Error al escribir en el directorio root."
+
+#: libparted/fs/fat/resize.c:484
+msgid "If you leave your file system as FAT16, then you will have no problems."
+msgstr ""
+"Si deja su sistema de ficheros como FAT16, entonces no tendr problemas."
+
+#: libparted/fs/fat/resize.c:487
+msgid ""
+"If you convert to FAT16, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual)."
+msgstr ""
+"Si convierte a FAT16, y MS Windows est instalado en esa particin, entonces "
+"debera re-instalar el cargador de arranque de MS Windows. Si quiere hacer "
+"esto, debera consultar el manual de Parted (o el manual de su distribucin)."
+
+#: libparted/fs/fat/resize.c:495
+msgid ""
+"If you leave your file system as FAT32, then you will not introduce any new "
+"problems."
+msgstr ""
+"Si deja su sistema de ficheros como FAT32, entonces no tendr nuevos "
+"problemas."
+
+#: libparted/fs/fat/resize.c:499
+msgid ""
+"If you convert to FAT32, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual). Also, "
+"converting to FAT32 will make the file system unreadable by MS DOS, MS "
+"Windows 95a, and MS Windows NT."
+msgstr ""
+"Si convierte a FAT32, y MS Windows est instalado en la particin, tiene que "
+"re-instalar el cargador de arranque de MS Windows. Si quiere hacerlo, "
+"debera consultar el manual de Parted (o el manual de su distribucin). "
+"Tambin, la conversin a FAT32 har ilegible el sistema de ficheros para MS "
+"DOS, MS Windows 95a y MS Windows NT."
+
+#: libparted/fs/fat/resize.c:513
+#, c-format
+msgid "%s %s %s"
+msgstr "%s %s %s"
+
+#: libparted/fs/fat/resize.c:514
+msgid "Would you like to use FAT32?"
+msgstr "Le gustara usar FAT32?"
+
+#: libparted/fs/fat/resize.c:541 libparted/fs/fat/resize.c:557
+#, c-format
+msgid "%s %s"
+msgstr "%s %s"
+
+#: libparted/fs/fat/resize.c:542
+msgid ""
+"The file system can only be resized to this size by converting to FAT16."
+msgstr ""
+"El sistema de ficheros slo puede ser redimensionado a este tamao para "
+"convertirlo a FAT16."
+
+#: libparted/fs/fat/resize.c:558
+msgid ""
+"The file system can only be resized to this size by converting to FAT32."
+msgstr ""
+"El sistema de ficheros slo puede ser redimensionado a este tamao para "
+"convertirlo a FAT32."
+
+#: libparted/fs/fat/resize.c:571
+msgid ""
+"GNU Parted cannot resize this partition to this size. We're working on it!"
+msgstr ""
+"GNU Parted no puede redimensionar esta particin a ese tamao. Estamos "
+"trabajando en ello!"
+
+#: libparted/fs/fat/bootsector.c:48 libparted/fs/fat/bootsector.c:55
+msgid "File system has an invalid signature for a FAT file system."
+msgstr ""
+"El sistema de ficheros tiene una firma invlida para un sistema de ficheros "
+"FAT."
+
+#: libparted/fs/fat/bootsector.c:62
+msgid "File system has an invalid sector size for a FAT file system."
+msgstr ""
+"El sistema de ficheros tiene un tamao de sector invlido para un sistema de "
+"ficheros FAT."
+
+#: libparted/fs/fat/bootsector.c:69
+msgid "File system has an invalid cluster size for a FAT file system."
+msgstr ""
+"El sistema de ficheros tiene un tamao de cluster invlido para un sistema "
+"de ficheros FAT."
+
+#: libparted/fs/fat/bootsector.c:76
+msgid ""
+"File system has an invalid number of reserved sectors for a FAT file system."
+msgstr ""
+"El sistema de ficheros tiene un nmero invlido de sectores reservados para "
+"un sistema de ficheros FAT."
+
+#: libparted/fs/fat/bootsector.c:83
+msgid "File system has an invalid number of FATs."
+msgstr "El sistema de ficheros tiene un nmero de FATS invlido."
+
+#: libparted/fs/fat/bootsector.c:138
+#, c-format
+msgid ""
+"This file system has a logical sector size of %d. GNU Parted is known not "
+"to work properly with sector sizes other than 512 bytes."
+msgstr ""
+"El sistema de ficheros tiene el tamao del sector lgico de %d. GNU Parted "
+"es conocido por no funcionar adecuadamente con tamaos de sector distintos "
+"de 512 bytes."
+
+#: libparted/fs/fat/bootsector.c:163
+#, c-format
+msgid ""
+"The file system's CHS geometry is (%d, %d, %d), which is invalid. The "
+"partition table's CHS geometry is (%d, %d, %d). If you select Ignore, the "
+"file system's CHS geometry will be left unchanged. If you select Fix, the "
+"file system's CHS geometry will be set to match the partition table's CHS "
+"geometry."
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:209
+msgid "FAT boot sector says logical sector size is 0. This is weird. "
+msgstr ""
+"El sector de arranque de la FAT dice que el tamao lgico del sector es 0. "
+"Esto es extrao. "
+
+#: libparted/fs/fat/bootsector.c:215
+msgid "FAT boot sector says there are no FAT tables. This is weird. "
+msgstr ""
+"El sector de arranque de la FAT dice que no hay tablas FAT. Esto es "
+"extrao. "
+
+#: libparted/fs/fat/bootsector.c:221
+msgid "FAT boot sector says clusters are 0 sectors. This is weird. "
+msgstr ""
+"El sector de arranque de la FAT dice que los clusters tienen 0 sectores. "
+"Esto es extrao. "
+
+#: libparted/fs/fat/bootsector.c:231
+msgid "File system is FAT12, which is unsupported."
+msgstr "El sistema de ficheros es FAT12, el cul no est soportado."
+
+#: libparted/fs/fat/bootsector.c:407
+#, c-format
+msgid ""
+"The information sector has the wrong signature (%x). Select cancel for now, "
+"and send in a bug report. If you're desperate, it's probably safe to ignore."
+msgstr ""
+"El sector de informacin tiene una firma errnea (%x). Seleccione cancelar "
+"por ahora, y mande un informe del fallo. Si est desesperado, es ms seguro "
+"descartar."
+
+#: libparted/fs/fat/count.c:149
+#, c-format
+msgid "Bad directory entry for %s: first cluster is the end of file marker."
+msgstr ""
+"Entrada de directorio incorrecta para %s: el primer cluster es el final de "
+"la marca del fichero."
+
+#: libparted/fs/fat/count.c:162
+#, c-format
+msgid ""
+"Bad FAT: unterminated chain for %s. You should run dosfsck or scandisk."
+msgstr ""
+"FAT incorrecta: cadena no terminada para %s. Debera ejecutar dosfsck o "
+"scandisck."
+
+#: libparted/fs/fat/count.c:171
+#, c-format
+msgid ""
+"Bad FAT: cluster %d outside file system in chain for %s. You should run "
+"dosfsck or scandisk."
+msgstr ""
+"FAT incorrecta: el cluster %d est fuera del sistema de ficheros en la "
+"cadena para %s. Debera ejecutar dosfsck o scandisk."
+
+#: libparted/fs/fat/count.c:181
+#, c-format
+msgid ""
+"Bad FAT: cluster %d is cross-linked for %s. You should run dosfsck or "
+"scandisk."
+msgstr ""
+"FAT incorrecta: el cluster %d tiene enlaces cruzados para %s. Debera "
+"ejecutar dosfsck o scandisck."
+
+#: libparted/fs/fat/count.c:200
+#, c-format
+msgid "%s is %dk, but it has %d clusters (%dk)."
+msgstr "%s es %dk, pero tiene %d clusters (%dk)."
+
+#: libparted/fs/fat/count.c:263
+#, c-format
+msgid ""
+"The file %s is marked as a system file. This means moving it could cause "
+"some programs to stop working."
+msgstr ""
+"El fichero %s est marcado como un fichero del sistema. Esto quiere decir "
+"que si lo mueve puede ocurrir que algunos programas no funcionen."
+
+#: libparted/fs/fat/table.c:138
+#, c-format
+msgid ""
+"FAT %d media %x doesn't match the boot sector's media %x. You should "
+"probably run scandisk."
+msgstr ""
+"La FAT %d del medio %x no coincide con los sectores de arranque del medio %"
+"x. Debera, probablemente, ejecutar scandisk."
+
+#: libparted/fs/fat/table.c:268
+#, fuzzy, c-format
+msgid "fat_table_set: cluster %ld outside file system"
+msgstr "fat_table_set: el cluster %ld est fuera del sistema de ficheros"
+
+#: libparted/fs/fat/table.c:296
+#, fuzzy, c-format
+msgid "fat_table_get: cluster %ld outside file system"
+msgstr "fat_table_get: el cluster %ld est fuera del sistema de ficheros"
+
+#: libparted/fs/fat/table.c:334
+msgid "fat_table_alloc_cluster: no free clusters"
+msgstr "fat_table_alloc_cluster: no quedan clusters libres"
+
+#: libparted/fs/linux_swap/linux_swap.c:236
+#, c-format
+msgid "Unrecognised linux swap signature '%10s'."
+msgstr "Firma de la particin de intercambio de linux '%10s' no reconocida."
+
+#: libparted/fs/linux_swap/linux_swap.c:312
+msgid "Too many bad pages."
+msgstr "Demasiadas pginas incorrectas."
+
+#: libparted/fs/hfs/advfs.c:123 libparted/fs/hfs/advfs_plus.c:125
+#: libparted/fs/hfs/reloc.c:416 libparted/fs/hfs/reloc.c:510
+#: libparted/fs/hfs/reloc_plus.c:541 libparted/fs/hfs/reloc_plus.c:660
+#: libparted/fs/hfs/reloc_plus.c:774
+msgid "The file system contains errors."
+msgstr "El sistema de ficheros contiene errores."
+
+#: libparted/fs/hfs/advfs_plus.c:290
+msgid "Bad blocks could not be read."
+msgstr "No pueden leerse los bloques incorrectos."
+
+#: libparted/fs/hfs/cache.c:139
+#, c-format
+msgid ""
+"Trying to register an extent starting at block 0x%X, but another one already "
+"exists at this position. You should check the file system!"
+msgstr ""
+"Intentando registrar una extensin que empieza en el bloque 0x%X, pero ya "
+"existe otra en esta posicin. Debera verificar el sistema de ficheros!"
+
+#: libparted/fs/hfs/cache.c:216
+#, c-format
+msgid ""
+"Trying to move an extent from block Ox%X to block Ox%X, but another one "
+"already exists at this position. This should not happen!"
+msgstr ""
+"Intentando mover una extensin desde el bloque Ox%X para bloquear Ox%X, pero "
+"ya existe otra en esta posicin. Esto no debera pasar!"
+
+#: libparted/fs/hfs/file.c:145
+#, c-format
+msgid "Could not update the extent cache for HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:182
+#, c-format
+msgid "Trying to read HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:192 libparted/fs/hfs/file.c:222
+#, c-format
+msgid "Could not find sector %lli of HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:212
+#, c-format
+msgid "Trying to write HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:159
+#, c-format
+msgid "Could not update the extent cache for HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:203
+#, c-format
+msgid "Trying to read HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:214 libparted/fs/hfs/file_plus.c:256
+#, c-format
+msgid "Could not find sector %lli of HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:245
+#, c-format
+msgid "Trying to write HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:225
+msgid "Sorry, HFS cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:255 libparted/fs/hfs/hfs.c:636
+msgid "Data relocation has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:274
+msgid "Data relocation left some data in the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:313
+#, fuzzy
+msgid "writing HFS Master Directory Block"
+msgstr "Error al escribir en el directorio raz."
+
+#: libparted/fs/hfs/hfs.c:461
+msgid "No valid HFS[+X] signature has been found while opening."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:471
+#, c-format
+msgid "Version %d of HFS+ isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:482
+#, c-format
+msgid "Version %d of HFSX isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:667
+msgid "Data relocation left some data at the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:715
+#, fuzzy
+msgid "Error while writing the allocation file."
+msgstr "Error al escribir en el directorio raz."
+
+#: libparted/fs/hfs/hfs.c:730
+msgid "Error while writing the compatibility part of the allocation file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:745
+msgid "writing HFS+ Volume Header"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:845
+msgid "An error occurred while looking for the mandatory bad blocks file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:899
+msgid ""
+"It seems there is an error in the HFS wrapper: the bad blocks file doesn't "
+"contain the embedded HFS+ volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:930
+msgid "Sorry, HFS+ cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:965
+msgid "shrinking embedded HFS+ volume"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:981
+msgid "Resizing the HFS+ volume has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:988
+#, fuzzy
+msgid "shrinking HFS wrapper"
+msgstr "contrayendo"
+
+#: libparted/fs/hfs/hfs.c:997
+msgid "Updating the HFS wrapper has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:1099 libparted/fs/hfs/hfs.c:1184
+#, c-format
+msgid ""
+"This is not a real %s check. This is going to extract special low level "
+"files for debugging purposes."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:156
+msgid "Bad block list header checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:169
+#, c-format
+msgid ""
+"Invalid size of a transaction block while replaying the journal (%i bytes)."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:261
+msgid ""
+"Journal stored outside of the volume are not supported. Try to desactivate "
+"the journal and run Parted again."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:272
+#, fuzzy
+msgid "Journal offset or size is not multiple of the sector size."
+msgstr ""
+"El inicio delta del cluster = %d, que no es un mltiplo del tamao de "
+"cluster %d."
+
+#: libparted/fs/hfs/journal.c:290
+msgid "Incorrect magic values in the journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:299
+msgid "Journal size mismatch between journal info block and journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:311
+#, fuzzy
+msgid "Some header fields are not multiple of the sector size."
+msgstr ""
+"El inicio delta del cluster = %d, que no es un mltiplo del tamao de "
+"cluster %d."
+
+#: libparted/fs/hfs/journal.c:320
+msgid ""
+"The sector size stored in the journal is not 512 bytes. Parted only "
+"supports 512 bytes length sectors."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:332
+msgid "Bad journal checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:350
+msgid ""
+"The journal is not empty. Parted must replay the transactions before "
+"opening the file system. This will modify the file system."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:378
+msgid ""
+"The volume header or the master directory block has changed while replaying "
+"the journal. You should restart Parted."
+msgstr ""
+
+#: libparted/fs/hfs/probe.c:52
+#, c-format
+msgid ""
+"Parted can't use HFS file systems on disks with a sector size not equal to %"
+"d bytes."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:153 libparted/fs/hfs/reloc_plus.c:157
+msgid "An extent has not been relocated."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:253 libparted/fs/hfs/reloc_plus.c:309
+msgid ""
+"A reference to an extent comes from a place it should not. You should check "
+"the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:383
+msgid "This HFS volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:477
+msgid "This HFS volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:519 libparted/fs/hfs/reloc_plus.c:670
+msgid ""
+"The extents overflow file should not contain its own extents! You should "
+"check the file system."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:576 libparted/fs/hfs/reloc_plus.c:849
+#, fuzzy
+msgid "Could not cache the file system in memory."
+msgstr "No se puede detectar el sistema de ficheros."
+
+#: libparted/fs/hfs/reloc.c:637 libparted/fs/hfs/reloc_plus.c:910
+msgid "Bad blocks list could not be loaded."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:651 libparted/fs/hfs/reloc_plus.c:926
+msgid "An error occurred during extent relocation."
+msgstr "Ocurri un error durante la relocalizacin de la extensin."
+
+#: libparted/fs/hfs/reloc_plus.c:497
+msgid "This HFS+ volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc_plus.c:621
+msgid "This HFS+ volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: parted/parted.c:76
+msgid "displays this help message"
+msgstr "mostrar este mensaje de ayuda"
+
+#: parted/parted.c:77
+msgid "where necessary, prompts for user intervention"
+msgstr "donde sea necesario, pedir la intervencin del usuario"
+
+#: parted/parted.c:78
+msgid "never prompts for user intervention"
+msgstr "no pedir nunca la intervencin del usuario"
+
+#: parted/parted.c:79
+msgid "displays the version"
+msgstr "mostrar la versin"
+
+#: parted/parted.c:87
+#, fuzzy
+msgid ""
+"NUMBER is the partition number used by Linux. On MS-DOS disk labels, the "
+"primary partitions number from 1 to 4, logical partitions from 5 onwards.\n"
+msgstr ""
+"NUMERO es el nmero de la particin usada por Linux. En las etiquetas de "
+"disco msdos, las particiones primarias van del 1 al 4, y las particiones "
+"lgicas de 5 en adelante.\n"
+
+#: parted/parted.c:90
+msgid "LABEL-TYPE is one of: "
+msgstr "TIPO_ETIQUETA es uno de: "
+
+#: parted/parted.c:91
+msgid "FLAG is one of: "
+msgstr "FLAG es uno de: "
+
+#: parted/parted.c:92
+#, fuzzy
+msgid "UNIT is one of: "
+msgstr "FLAG es uno de: "
+
+#: parted/parted.c:93
+msgid "PART-TYPE is one of: primary, logical, extended\n"
+msgstr "TIPO-PART es uno de: primrio, lgico, extendido\n"
+
+#: parted/parted.c:95
+msgid "FS-TYPE is one of: "
+msgstr "TIPO-SF es uno de: "
+
+#: parted/parted.c:96
+msgid ""
+"START and END are disk locations, such as 4GB or 10%. Negative values count "
+"from the end of the disk. For example, -1s specifies exactly the last "
+"sector.\n"
+msgstr ""
+
+#: parted/parted.c:99
+msgid "STATE is one of: on, off\n"
+msgstr "ESTADO es uno de: on, off\n"
+
+#: parted/parted.c:100
+msgid "DEVICE is usually /dev/hda or /dev/sda\n"
+msgstr "DISPOSITIVO es normalmente /dev/hda o /dev/sda\n"
+
+#: parted/parted.c:101
+msgid "NAME is any word you want\n"
+msgstr "NOMBRE es cualquier palabra que quiera\n"
+
+#: parted/parted.c:102
+msgid "The partition must have one of the following FS-TYPEs: "
+msgstr "La particin debe tener uno de los siguientes TIPOS de SF: "
+
+#: parted/parted.c:105
+msgid "GNU Parted Version information:\n"
+msgstr ""
+
+# Please, busca este mismo texto en el .po de fileutils o textutils e intenta
+# que se parezca en la terminologa,
+# por ejemplo: is distributed -> se distribuye
+#: parted/parted.c:107
+#, fuzzy
+msgid ""
+"Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n"
+"This program is free software, covered by the GNU General Public License.\n"
+"\n"
+"This program is distributed in the hope that it will be useful, but WITHOUT "
+"ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
+"FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
+"more details.\n"
+"\n"
+msgstr ""
+"Copyright (C) 1998 -2005 Free Software Foundation, Inc.\n"
+"Este programa es software libre, cubierto por la Licencia Pblica General de "
+"GNU.\n"
+"\n"
+"Este programa se distribuye con la esperanza de que sea til, pero SIN "
+"NINGUNA GARANTA; ni siquiera la garanta implcita de COMERCIABILIDAD o "
+"IDONEIDAD PARA UN FIN DETERMINADO. Vea la Licencia Pblica General de GNU "
+"para obtener ms detalles.\n"
+"\n"
+
+#: parted/parted.c:152
+#, c-format
+msgid "%0.f%%\t(time left %.2d:%.2d)"
+msgstr "%0.f%%\t(tiempo que queda %.2d:%.2d)"
+
+#: parted/parted.c:170
+#, c-format
+msgid ""
+"Partition %s is being used. You must unmount it before you modify it with "
+"Parted."
+msgstr ""
+"La particin %s est usandose. Debe desmontarla antes de modificarla con "
+"Parted."
+
+#: parted/parted.c:187
+#, c-format
+msgid "Partition(s) on %s are being used."
+msgstr "La(s) particin(es) en %s est(n) siendo usada(s)."
+
+#: parted/parted.c:413 parted/parted.c:594 parted/parted.c:979
+#: parted/parted.c:1059 parted/parted.c:1586 parted/parted.c:1663
+#: parted/parted.c:1707
+msgid "Partition number?"
+msgstr "Nmero de la particin?"
+
+#: parted/parted.c:456
+msgid "Source device?"
+msgstr "Dispositivo de origen?"
+
+#: parted/parted.c:460
+msgid "Source partition number?"
+msgstr "Nmero de la particin de origen?"
+
+#: parted/parted.c:465
+#, fuzzy
+msgid "Can't copy an extended partition."
+msgstr "No es pueden copiar las particiones extendidas."
+
+#: parted/parted.c:471
+msgid "Destination partition number?"
+msgstr "Nmero de la particin de destino?"
+
+#: parted/parted.c:564
+msgid "New disk label type?"
+msgstr "Nuevo tipo de etiqueta de disco?"
+
+#: parted/parted.c:598
+msgid "File system?"
+msgstr "Sistema de ficheros?"
+
+#: parted/parted.c:645 parted/parted.c:815
+msgid "Partition type?"
+msgstr "Tipo de particin?"
+
+#: parted/parted.c:652 parted/parted.c:822 parted/parted.c:1062
+msgid "Partition name?"
+msgstr "Nombre de la particin?"
+
+#: parted/parted.c:660 parted/parted.c:832
+msgid "File system type?"
+msgstr "Tipo de sistema de ficheros?"
+
+#: parted/parted.c:667 parted/parted.c:834 parted/parted.c:994
+#: parted/parted.c:1544 parted/parted.c:1595
+msgid "Start?"
+msgstr "Inicio?"
+
+#: parted/parted.c:669 parted/parted.c:837 parted/parted.c:997
+#: parted/parted.c:1546 parted/parted.c:1597
+msgid "End?"
+msgstr "Fin?"
+
+#: parted/parted.c:707 parted/parted.c:875
+#, fuzzy, c-format
+msgid ""
+"You requested a partition from %s to %s.\n"
+"The closest location we can manage is %s to %s. Is this still acceptable to "
+"you?"
+msgstr ""
+"Pidi mover la particin a %s - %s. Lo ms cerca que Parted puede manejar es "
+"%s - %s."
+
+#: parted/parted.c:827
+#, fuzzy
+msgid "An extended partition cannot hold a file system. Did you want mkpart?"
+msgstr ""
+"La particiones extendidas no puede sostener un sistema de ficheros. Quiere "
+"mkpart?"
+
+#: parted/parted.c:985
+msgid "Can't move an extended partition."
+msgstr "No se pueden mover una particin extendida."
+
+#: parted/parted.c:1014
+msgid "Can't move a partition onto itself. Try using resize, perhaps?"
+msgstr ""
+"No se puede mover una particin sobre s misma. Pruebe a usar "
+"redimensionar, quizs?"
+
+#: parted/parted.c:1158
+#, c-format
+msgid "Minor: %d\n"
+msgstr "Minor: %d\n"
+
+#: parted/parted.c:1159
+#, fuzzy, c-format
+msgid "Flags: %s\n"
+msgstr "Banderas: "
+
+#: parted/parted.c:1160
+#, c-format
+msgid "File System: %s\n"
+msgstr "Sistema de ficheros: %s\n"
+
+#: parted/parted.c:1161
+#, fuzzy, c-format
+msgid "Size: "
+msgstr "Tamao: %10.3fMb (%d%%)\n"
+
+#: parted/parted.c:1166
+#, c-format
+msgid "Minimum size: "
+msgstr "Tamao mnimo: "
+
+#: parted/parted.c:1169
+#, c-format
+msgid "Maximum size: "
+msgstr "Tamao mximo: "
+
+#: parted/parted.c:1255
+#, fuzzy, c-format
+msgid "Disk %s: %s\n"
+msgstr "%s %s %s"
+
+#: parted/parted.c:1256
+#, c-format
+msgid "Sector size (logical/physical): %lldB/%lldB\n"
+msgstr ""
+
+#: parted/parted.c:1267
+#, c-format
+msgid "BIOS cylinder,head,sector geometry: %d,%d,%d. Each cylinder is %s.\n"
+msgstr ""
+
+#: parted/parted.c:1273
+#, fuzzy, c-format
+msgid "Partition Table: %s\n"
+msgstr "Nombre de la particin?"
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Number"
+msgstr "Numero"
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Start"
+msgstr "Inicio"
+
+#: parted/parted.c:1285 parted/parted.c:1288
+msgid "End"
+msgstr "Fin"
+
+#: parted/parted.c:1288
+msgid "Size"
+msgstr "Tamao"
+
+#: parted/parted.c:1292
+msgid "Type"
+msgstr "Typo"
+
+#: parted/parted.c:1294
+msgid "File system"
+msgstr "Sistema de ficheros"
+
+#: parted/parted.c:1297
+msgid "Name"
+msgstr "Nombre"
+
+#: parted/parted.c:1299
+msgid "Flags"
+msgstr "Banderas"
+
+#: parted/parted.c:1352
+msgid "Free Space"
+msgstr ""
+
+#: parted/parted.c:1441
+#, c-format
+msgid ""
+"A %s %s partition was found at %s -> %s. Do you want to add it to the "
+"partition table?"
+msgstr ""
+"Ha sido encontrada una particin %s %s en %s -> %s. Quiere aadirla a la "
+"tabla de particiones?"
+
+#: parted/parted.c:1479
+msgid "searching for file systems"
+msgstr "buscando los sistemas de ficheros"
+
+#: parted/parted.c:1684
+msgid "New device?"
+msgstr "Nuevo dispositivo?"
+
+#: parted/parted.c:1709
+#, fuzzy
+msgid "Flag to Invert?"
+msgstr "Bandera a cambiar?"
+
+#: parted/parted.c:1714
+msgid "New state?"
+msgstr "Nuevo estado?"
+
+#: parted/parted.c:1747
+msgid "Unit?"
+msgstr "Unidad?"
+
+#: parted/parted.c:1896
+msgid "check"
+msgstr "comprobar"
+
+#: parted/parted.c:1899
+#, fuzzy
+msgid ""
+"check NUMBER do a simple check on the file system"
+msgstr ""
+"comprueba NUMERO hace una comprobacin simple del sistema "
+"de ficheros"
+
+#: parted/parted.c:1905
+msgid "cp"
+msgstr "cp"
+
+#: parted/parted.c:1908
+msgid ""
+"cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another "
+"partition"
+msgstr ""
+"cp [DESDE-DISPOSITIVO] DE-NUMERO A-NUMERO copia el sistema de ficheros a "
+"otra particin"
+
+#: parted/parted.c:1914
+msgid "help"
+msgstr "help"
+
+#: parted/parted.c:1917
+#, fuzzy
+msgid ""
+"help [COMMAND] prints general help, or help on "
+"COMMAND"
+msgstr ""
+"help [ORDEN] muestra la ayuda general, o la ayuda sobre la "
+"ORDEN"
+
+#: parted/parted.c:1923
+msgid "mklabel"
+msgstr "mklabel"
+
+#: parted/parted.c:1926
+#, fuzzy
+msgid ""
+"mklabel LABEL-TYPE create a new disklabel (partition "
+"table)"
+msgstr ""
+"mklabel TIPO-ETIQUETA crea una nueva etiqueta de disco (en la tabla "
+"de particin)"
+
+#: parted/parted.c:1932
+msgid "mkfs"
+msgstr "mkfs"
+
+#: parted/parted.c:1935
+#, fuzzy
+msgid ""
+"mkfs NUMBER FS-TYPE make a FS-TYPE file system on "
+"partititon NUMBER"
+msgstr ""
+"mkfs NUMERO TIPO-SF crea un sistema de ficheros TIPO-SF en la "
+"particin NUMERO"
+
+#: parted/parted.c:1941
+msgid "mkpart"
+msgstr "mkpart"
+
+#: parted/parted.c:1944
+msgid "mkpart PART-TYPE [FS-TYPE] START END make a partition"
+msgstr "mkpart TIPO-PART [TIPO-SF] INICIO FIN crea una particin"
+
+#: parted/parted.c:1950
+msgid ""
+"mkpart makes a partition without creating a new file system on the "
+"partition. FS-TYPE may be specified to set an appropriate partition ID.\n"
+msgstr ""
+"mkpart crea una particin sin crear un nuevo sistema de ficheros en la "
+"particin. Debe ser especificado el TIPO-SF para asignar una ID de "
+"particin.\n"
+
+#: parted/parted.c:1955
+msgid "mkpartfs"
+msgstr "mkpartfs"
+
+#: parted/parted.c:1958
+msgid ""
+"mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system"
+msgstr ""
+"mkpartfs TIPO-PART TIPO-SF INICIO FIN crear una particin con un sistema "
+"de ficheros"
+
+#: parted/parted.c:1964
+msgid "move"
+msgstr "move"
+
+#: parted/parted.c:1967
+#, fuzzy
+msgid "move NUMBER START END move partition NUMBER"
+msgstr "move NUMERO INICIO FIN mueve la particin NUMERO"
+
+#: parted/parted.c:1972
+msgid "name"
+msgstr "name"
+
+#: parted/parted.c:1975
+#, fuzzy
+msgid "name NUMBER NAME name partition NUMBER as NAME"
+msgstr "name NUMERO NOMBRE nombra la particin NUMERO como NOMBRE"
+
+#: parted/parted.c:1980
+msgid "print"
+msgstr "print"
+
+#: parted/parted.c:1983
+#, fuzzy
+msgid ""
+"print [free|NUMBER|all] display the partition table, a "
+"partition, or all devices"
+msgstr ""
+"print [NUMERO] muestra la tabla de las particiones, o una "
+"particin"
+
+#: parted/parted.c:1987
+#, fuzzy
+msgid ""
+"Without arguments, print displays the entire partition table. With 'free'\n"
+"argument, information about free space will be displayed otherwise if a\n"
+"partition number is given, then more detailed information is displayed\n"
+"about that partition. If the 'all' argument is passed instead, partition\n"
+"information for all devices will be displayed."
+msgstr ""
+"Sin argumentos, print muestra la tabla de particiones entera. Si se\n"
+"da un nmero de particin, se muestra la informacin ms detallada\n"
+"sobre esa particion.\n"
+
+#: parted/parted.c:1995
+msgid "quit"
+msgstr "quit"
+
+#: parted/parted.c:1998
+#, fuzzy
+msgid "quit exit program"
+msgstr "quit sale del programa"
+
+#: parted/parted.c:2003
+msgid "rescue"
+msgstr "rescue"
+
+#: parted/parted.c:2006
+#, fuzzy
+msgid ""
+"rescue START END rescue a lost partition near START "
+"and END"
+msgstr ""
+"rescue INICIO FIN recupera las particiones perdidas entre INICIO y FIN"
+
+#: parted/parted.c:2012
+msgid "resize"
+msgstr "resize"
+
+#: parted/parted.c:2015
+#, fuzzy
+msgid ""
+"resize NUMBER START END resize partition NUMBER and its "
+"file system"
+msgstr ""
+"resize NUMERO INICIO FIN redimensiona el sistema de ficheros y la "
+"particin NUMERO"
+
+#: parted/parted.c:2023
+msgid "rm"
+msgstr "rm"
+
+#: parted/parted.c:2026
+#, fuzzy
+msgid "rm NUMBER delete partition NUMBER"
+msgstr "rm NUMERO borra la particin NUMERO"
+
+#: parted/parted.c:2031
+msgid "select"
+msgstr "select"
+
+#: parted/parted.c:2034
+#, fuzzy
+msgid "select DEVICE choose the device to edit"
+msgstr "select DISPOSITIVO elegir el dispositivo a editar"
+
+#: parted/parted.c:2039
+msgid "set"
+msgstr "set"
+
+#: parted/parted.c:2042
+#, fuzzy
+msgid ""
+"set NUMBER FLAG STATE change the FLAG on partition NUMBER"
+msgstr "rm NUMERO borra la particin NUMERO"
+
+#: parted/parted.c:2048
+msgid "toggle"
+msgstr ""
+
+#: parted/parted.c:2051
+#, fuzzy
+msgid ""
+"toggle [NUMBER [FLAG]] toggle the state of FLAG on "
+"partition NUMBER"
+msgstr "rm NUMERO borra la particin NUMERO"
+
+#: parted/parted.c:2057
+msgid "unit"
+msgstr "unit"
+
+#: parted/parted.c:2060
+#, fuzzy
+msgid "unit UNIT set the default unit to UNIT"
+msgstr ""
+"unit UNIDAD configura la unidad por defecto para UNIDAD"
+
+#: parted/parted.c:2065
+msgid "version"
+msgstr ""
+
+#: parted/parted.c:2068
+msgid ""
+"version displays the current version of GNU "
+"Parted and copyright information"
+msgstr ""
+
+#: parted/parted.c:2072
+msgid ""
+"version displays copyright and version information corressponding to this "
+"copy of GNU Parted\n"
+msgstr ""
+
+#: parted/parted.c:2158
+msgid "No device found"
+msgstr "No se encontr el dispositivo"
+
+#: parted/parted.c:2222
+msgid "Don't forget to update /etc/fstab, if necessary.\n"
+msgstr "No se olvide de actualizar /etc/fstab, si es necesario.\n"
+
+#: parted/ui.c:68
+msgid "Welcome to GNU Parted! Type 'help' to view a list of commands.\n"
+msgstr ""
+
+# Uso: o Modo de empleo:
+#: parted/ui.c:71
+#, fuzzy
+msgid ""
+"Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]\n"
+"Apply COMMANDs with PARAMETERS to DEVICE. If no COMMAND(s) are given, run "
+"in\n"
+"interactive mode.\n"
+msgstr ""
+"Modo de Empleo: parted [OPCIN]... [DISPOSITIVO [ORDEN [PARMETROS]...]...]\n"
+"Aplica la(s) ORDENes con PARMETROS al DISPOSITIVO. Si no se da ninguna(s) "
+"ORDEN(es), se ejecuta en\n"
+"modo interactivo.\n"
+
+#: parted/ui.c:76
+#, c-format
+msgid ""
+"\n"
+"\n"
+"You found a bug in GNU Parted! Here's what you have to do:\n"
+"\n"
+"Don't panic! The bug has most likely not affected any of your data.\n"
+"Help us to fix this bug by doing the following:\n"
+"\n"
+"Check whether the bug has already been fixed by checking\n"
+"the last version of GNU Parted that you can find at:\n"
+"\n"
+"\thttp://ftp.gnu.org/gnu/parted/\n"
+"\n"
+"Please check this version prior to bug reporting.\n"
+"\n"
+"If this has not been fixed yet or if you don't know how to check,\n"
+"please visit the GNU Parted website:\n"
+"\n"
+"\thttp://www.gnu.org/software/parted\n"
+"\n"
+"for further information.\n"
+"\n"
+"Your report should contain the version of this release (%s)\n"
+"along with the error message below, the output of\n"
+"\n"
+"\tparted DEVICE unit co print unit s print\n"
+"\n"
+"and additional information about your setup you consider important.\n"
+msgstr ""
+
+#: parted/ui.c:230
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_MAPERR (Address not mapped to object)"
+msgstr ""
+
+#: parted/ui.c:235
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_ACCERR (Invalid permissions for mapped object)"
+msgstr ""
+
+#: parted/ui.c:240
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGSEGV signal was encountered."
+msgstr ""
+
+#: parted/ui.c:258
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTDIV (Integer: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:262
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTOVF (Integer: overflow)"
+msgstr ""
+
+#: parted/ui.c:266
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTDIV (Float: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:270
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTOVF (Float: overflow)"
+msgstr ""
+
+#: parted/ui.c:274
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTUND (Float: underflow)"
+msgstr ""
+
+#: parted/ui.c:278
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTRES (Float: inexact result)"
+msgstr ""
+
+#: parted/ui.c:282
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTINV (Float: invalid operation)"
+msgstr ""
+
+#: parted/ui.c:286
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTSUB (Float: subscript out of range)"
+msgstr ""
+
+#: parted/ui.c:291
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGFPE signal was encountered."
+msgstr ""
+
+#: parted/ui.c:310
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPC (Illegal Opcode)"
+msgstr ""
+
+#: parted/ui.c:314
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPN (Illegal Operand)"
+msgstr ""
+
+#: parted/ui.c:318
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLADR (Illegal addressing mode)"
+msgstr ""
+
+#: parted/ui.c:323
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLTRP (Illegal Trap)"
+msgstr ""
+
+#: parted/ui.c:327
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVOPC (Privileged Opcode)"
+msgstr ""
+
+#: parted/ui.c:331
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVREG (Privileged Register)"
+msgstr ""
+
+#: parted/ui.c:335
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_COPROC (Coprocessor Error)"
+msgstr ""
+
+#: parted/ui.c:339
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_BADSTK (Internal Stack Error)"
+msgstr ""
+
+#: parted/ui.c:343
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGILL signal was encountered."
+msgstr ""
+
+#: parted/ui.c:828
+msgid "Expecting a partition number."
+msgstr "Se esperaba un nmero de particin."
+
+#: parted/ui.c:837
+msgid "Partition doesn't exist."
+msgstr "La particin no existe."
+
+#: parted/ui.c:857
+msgid "Expecting a file system type."
+msgstr "Se esperaba un tipo de sistema de ficheros."
+
+#: parted/ui.c:863
+#, c-format
+msgid "Unknown file system type \"%s\"."
+msgstr "Tipo de sistema de ficheros \"%s\" desconocido."
+
+#: parted/ui.c:883
+msgid "Expecting a disk label type."
+msgstr "Se esperaba un tipo de etiqueta de disco."
+
+# No se puede.
+#: parted/ui.c:977
+msgid "Can't create any more partitions."
+msgstr "No se puede crear ms particiones."
+
+#: parted/ui.c:987
+msgid "Expecting a partition type."
+msgstr "Se esperaba un tipo de particin."
+
+#: parted/ui.c:1115
+msgid "on"
+msgstr "on"
+
+#: parted/ui.c:1116
+msgid "off"
+msgstr "off"
+
+#: parted/ui.c:1227
+msgid "OPTIONs:"
+msgstr "OPCINes:"
+
+# Comando es una barbaridad. En es@li.org usamos "orden".
+#: parted/ui.c:1230
+msgid "COMMANDs:"
+msgstr "ORDENes:"
+
+#: parted/ui.c:1238
+#, c-format
+msgid "Using %s\n"
+msgstr "Usando %s\n"
+
+#~ msgid ""
+#~ "This ext2 file system has a rather strange layout! Parted can't resize "
+#~ "this (yet)."
+#~ msgstr ""
+#~ "Este sistema de ficheros ext2 tiene un diseo muy estrao! Parted (an) "
+#~ "no puede redimensionarlo."
+
+#~ msgid "IDE"
+#~ msgstr "IDE"
+
+#~ msgid "Disk geometry for %s: %s - %s\n"
+#~ msgstr "Geometra de disco para %s: %s - %s\n"
+
+#~ msgid "Disk label type: %s\n"
+#~ msgstr "Tipo de etiqueta de disco: %s\n"
+
+#~ msgid "set NUMBER FLAG STATE change a flag on partition NUMBER"
+#~ msgstr ""
+#~ "set NUMERO MODIF ESTADO cambia un modificador de la particin "
+#~ "NUMERO"
+
+# drives -> unidades
+#~ msgid ""
+#~ "The sector size on %s is %d bytes. Parted is known not to work properly "
+#~ "with drives with sector sizes other than %d bytes."
+#~ msgstr ""
+#~ "El tamao del sector en %s es de %d bytes. Parted no funciona "
+#~ "correctamente con unidades que tengan un tamao de sector distinto de %d "
+#~ "bytes"
+
+#~ msgid ""
+#~ "You requested to create a partition at %s - %s. The closest Parted can "
+#~ "manage is %s - %s."
+#~ msgstr ""
+#~ "Pidi crear una particin en %s - %s. Lo ms cerca que Parted puede "
+#~ "manejar es %s - %s."
+
+#~ msgid ""
+#~ "You requested to resize the partition to %s - %s. The closest Parted can "
+#~ "manage is %s - %s."
+#~ msgstr ""
+#~ "Pidi redimensionar la particin para %s - %s. Lo ms cerca que Parted "
+#~ "puede manejar es %s - %s."
+
+#~ msgid ""
+#~ "You found a bug in GNU Parted. Please email a bug report to bug-"
+#~ "parted@gnu.org containing the version (%s), and the following message:\n"
+#~ msgstr ""
+#~ "Encontr un bicho en GNU parted. Por favor, enve un informe del bicho a "
+#~ "bug-parted@gnu.org conteniedo la versin (%s), y el siguiente mensaje:\n"
+
+# No se puede.
+#~ msgid "Could not read geometry of %s - %s."
+#~ msgstr "No se puede leer la geometra de %s - %s."
+
+# Pon `dodgey' entre comitas, por lo menos mientras no se encuentre una
+# traduccin.
+# En otras traducciones definen dodgey como inadmisible o extraa. vll
+#~ msgid "Device %s has dodgey geometry."
+#~ msgstr "El dispositivo %s tiene una geometra incorrecta."
+
+#~ msgid "SCSI"
+#~ msgstr "SCSI"
+
+# ninguna + ni doble negacin
+# Yo lo dejara en "no es una unidad SCSI ni IDE"
+#~ msgid "Device %s is neither a SCSI nor IDE drive."
+#~ msgstr "El dispositivo %s no es una unidad SCSI ni IDE."
+
+#~ msgid "Error reading %s (%s) to determine if partition is mounted."
+#~ msgstr "Error leyendo %s (%s) para determinar si la particin est montada."
+
+# detectara -> detect (se entiende mejor)
+# BIOS es masculino pues se trata del Sistema Bsico de Entrada/Salida
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. However, the most likely reason is that Linux "
+#~ "detected the BIOS geometry for %s incorrectly. GNU Parted suspects the "
+#~ "real geometry should be %d/%d/%d (not %d/%d/%d). You should check with "
+#~ "your BIOS first, as this may not be correct. You can inform Linux by "
+#~ "adding the parameter %s=%d,%d,%d to the command line. See the LILO or "
+#~ "GRUB documentation for more information. If you think Parted's suggested "
+#~ "geometry is correct, you may select Ignore to continue (and fix Linux "
+#~ "later). Otherwise, select Cancel (and fix Linux and/or the BIOS now)."
+#~ msgstr ""
+#~ "La tabla de particiones en %s es inconsistente. Hay varias razones para "
+#~ "que ocurra esto. Sin embargo, la razn ms probable es que Linux detect "
+#~ "la geometra de la BIOS para %s incorrectamente. GNU Parted sospecha que "
+#~ "la geometra real debera ser %d/%d/%d (y no %d/%d/%d). Debera "
+#~ "comprobar su BIOS primero, pues esta puede no ser correcta. Puede "
+#~ "informar a Linux aadiendo el parmetro %s=%d,%d,%d en la lnea de "
+#~ "rdenes. Vea la documentacin de LILO o GRUB para obtener ms "
+#~ "informacin. Si cree que la geometra sugerida por Parted es correcta, "
+#~ "puede seleccionar Ignorar para continuar (y arreglar Linux despus). De "
+#~ "lo contrario, seleccione Cancelar (y repare Linux y/o la BIOS ahora)."
+
+# tabla de particiones
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. Often, the reason is that Linux detected the "
+#~ "BIOS geometry incorrectly. However, this does not appear to be the case "
+#~ "here. It is safe to ignore,but ignoring may cause (fixable) problems "
+#~ "with some boot loaders, and may cause problems with FAT file systems. "
+#~ "Using LBA is recommended."
+#~ msgstr ""
+#~ "La tabla de particiones en %s es inconsistente. Hay varias razones para "
+#~ "que esto ocurra. Muchas veces, la razn es que Linux detecta la geometra "
+#~ "de la BIOS incorrectamente. Sin embargo, este no parece ser el caso aqu. "
+#~ "Puede estar seguro ignorndolo, pero el ignorarlo puede causar problemas "
+#~ "(reparables) con algunos cargadores de arranque, y puede causar problemas "
+#~ "con sistemas de ficheros FAT. Es recomendable usar LBA."
+
+# partitioning tool -> herramienta de particionado.
+#~ msgid ""
+#~ "Unable to align partition properly. This probably means that another "
+#~ "partitioning tool generated an incorrect partition table, because it "
+#~ "didn't have the correct BIOS geometry. It is safe to ignore,but ignoring "
+#~ "may cause (fixable) problems with some boot loaders."
+#~ msgstr ""
+#~ "No se puede alinear correctamente la particin. Esto probablemente "
+#~ "significa que otra herramienta de particionado ha generado una tabla de "
+#~ "la particin incorrecta, porque no tiene correcta la geometra de la "
+#~ "BIOS. Puede estar seguro ignorndolo, pero el ignorarlo puede causar "
+#~ "problemas (reparables) con algunos cargadores de arranque."
+
+#~ msgid "File system has an invalid signature for a FAT file systems."
+#~ msgstr ""
+#~ "El sistema de ficheros tiene una firma invlida para un sistema de "
+#~ "ficheros FAT."
+
+#~ msgid "START and END are in megabytes\n"
+#~ msgstr "INICIO y FIN son en megabytes\n"
+
+#~ msgid "Partition is being used."
+#~ msgstr "La particin est siendo usada."
+
+#~ msgid "Minor Start End "
+#~ msgstr "Minor Inicio Fin "
+
+#~ msgid "Type "
+#~ msgstr "Tipo "
+
+#~ msgid "Filesystem "
+#~ msgstr "Sistema de ficheros "
+
+#~ msgid "Name "
+#~ msgstr "Nombre "
+
+#~ msgid ""
+#~ " You have Windows FAT partition(s) that are not using LBA. If your BIOS "
+#~ "supports LBA, then you should switch to LBA by setting the LBA flag on "
+#~ "all FAT partitions. Otherwise, make sure the operating system and the "
+#~ "BIOS have the same geometry before resizing any FAT partitions."
+#~ msgstr ""
+#~ " Tiene particiones FAT Windows que no estn usando LBA. Si su BIOS "
+#~ "soporta LBA, debera cambiarse a LBA poniendo el modificador LBA en todas "
+#~ "las particiones FAT. De otro modo, asegrese de que el sistema operativo "
+#~ "y la BIOS tienen la misma geometra antes de redimensionar cualquiera de "
+#~ "las particiones FAT."
+
+#~ msgid ""
+#~ "The operating system thinks the geometry on %s is %d/%d/%d. Therefore, "
+#~ "cylinder 1024 ends at %.3fM.%s"
+#~ msgstr ""
+#~ "El sistema operativo opina que la geometra en %s es %d/%d/%d. Por "
+#~ "consiguiente, el cilindro 1024 termina en %.3fM.%s"
+
+# cree, piensa (no s, eso de "opina" no me pega, ya s que los ordenadores
+# no piensan ni tienen creencias, pero me pega menos todava que tengan
+# opiniones).
+#~ msgid "The operating system thinks the geometry on %s is %d/%d/%d.%s"
+#~ msgstr "El sistema operativo cree que la geometra en %s es %d/%d/%d.%s"
diff --git a/po/fr.po b/po/fr.po
new file mode 100644
index 0000000..5d2f044
--- /dev/null
+++ b/po/fr.po
@@ -0,0 +1,2835 @@
+# Messages franais pour GNU concernant findutils.
+# Copyright 2001 Free Software Foundation, Inc.
+# Michel Robitaille <robitail@IRO.UMontreal.CA>, traducteur since/depuis 1996.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU parted 1.6.6-pre2\n"
+"Report-Msgid-Bugs-To: bug-parted@gnu.org\n"
+"POT-Creation-Date: 2006-04-21 21:20+0200\n"
+"PO-Revision-Date: 2003-07-02 08:00-0500\n"
+"Last-Translator: Michel Robitaille <robitail@IRO.UMontreal.CA>\n"
+"Language-Team: French <traduc@traduc.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: libparted/arch/linux.c:284
+#, c-format
+msgid "Could not stat device %s - %s."
+msgstr "Ne peut valuer par stat() le priphrique %s - %s."
+
+#: libparted/arch/linux.c:390
+#, c-format
+msgid ""
+"Could not determine sector size for %s: %s.\n"
+"Using the default sector size (%lld)."
+msgstr ""
+
+#: libparted/arch/linux.c:401
+#, c-format
+msgid ""
+"Device %s has a logical sector size of %lld. Not all parts of GNU Parted "
+"support this at the moment, and the working code is HIGHLY EXPERIMENTAL.\n"
+msgstr ""
+
+#: libparted/arch/linux.c:441
+#, fuzzy, c-format
+msgid "Unable to determine the size of %s (%s)."
+msgstr "Incapable de dterminer la taille de %s (%s)"
+
+#: libparted/arch/linux.c:530
+#, c-format
+msgid "Could not get identity of device %s - %s"
+msgstr "Ne peut obtenir l'identit du priphrique %s - %s"
+
+#: libparted/arch/linux.c:539
+msgid "Generic IDE"
+msgstr ""
+
+#: libparted/arch/linux.c:556
+#, c-format
+msgid ""
+"Device %s has multiple (%d) logical sectors per physical sector.\n"
+"GNU Parted supports this EXPERIMENTALLY for some special disk label/file "
+"system combinations, e.g. GPT and ext2/3.\n"
+"Please consult the web site for up-to-date information."
+msgstr ""
+
+#: libparted/arch/linux.c:726
+#, c-format
+msgid "Error initialising SCSI device %s - %s"
+msgstr "Erreur d'initialisation du priphrique SCSI %s - %s"
+
+#: libparted/arch/linux.c:781
+#, fuzzy, c-format
+msgid ""
+"The device %s has zero length, and can't possibly store a file system or "
+"partition table. Perhaps you selected the wrong device?"
+msgstr ""
+"Le priphrique %s a une taille non nulle et ne peut pas possiblement "
+"stocker un systme de fichier ou une tabble de partition. Peut-tre avez-"
+"vous slectionner le mauvais priphrique?"
+
+#: libparted/arch/linux.c:829
+msgid ""
+"Unable to determine geometry of file/device. You should not use Parted "
+"unless you REALLY know what you're doing!"
+msgstr ""
+"Incapable de dterminer la gomtrie des fichiers/priphriques. Vous ne "
+"devriez pas utiliser Parted si vous ne savez pas rellement vous en servir!"
+
+#: libparted/arch/linux.c:903
+msgid "DAC960 RAID controller"
+msgstr "Contrleur RAID DAC960"
+
+#: libparted/arch/linux.c:908
+msgid "Compaq Smart Array"
+msgstr "Compaq Smart Array"
+
+#: libparted/arch/linux.c:913
+msgid "ATARAID Controller"
+msgstr "Contrleur ATARAID"
+
+#: libparted/arch/linux.c:918
+msgid "I2O Controller"
+msgstr "Contrleur I2O"
+
+#: libparted/arch/linux.c:923
+msgid "User-Mode Linux UBD"
+msgstr ""
+
+#: libparted/arch/linux.c:933
+msgid "Unknown"
+msgstr "Inconnu"
+
+#: libparted/arch/linux.c:940
+msgid "ped_device_new() Unsupported device type"
+msgstr "ped_device_new() type de priphrique non support"
+
+#: libparted/arch/linux.c:1041 libparted/arch/gnu.c:264
+#, c-format
+msgid "Error opening %s: %s"
+msgstr "Erreur d'ouverture %s: %s"
+
+#: libparted/arch/linux.c:1052 libparted/arch/gnu.c:274
+#, c-format
+msgid "Unable to open %s read-write (%s). %s has been opened read-only."
+msgstr ""
+"Incapable d'ouvrir %s en lecture-criture (%s). %s a t ouvert en lecture "
+"seulement."
+
+#: libparted/arch/linux.c:1160 libparted/arch/linux.c:1228
+#: libparted/arch/gnu.c:452 libparted/arch/gnu.c:550 libparted/arch/gnu.c:678
+#, c-format
+msgid "%s during read on %s"
+msgstr "%s lors de la lecture sur %s"
+
+#: libparted/arch/linux.c:1199
+#, c-format
+msgid "%s during seek for read on %s"
+msgstr "%s lors d'un positionnement pour lecture sur %s"
+
+#: libparted/arch/linux.c:1270 libparted/arch/linux.c:1355
+#: libparted/arch/linux.c:1413 libparted/arch/gnu.c:587
+#: libparted/arch/gnu.c:632 libparted/arch/gnu.c:709
+#, c-format
+msgid "%s during write on %s"
+msgstr "%s lors de l'criture sur %s"
+
+#: libparted/arch/linux.c:1297 libparted/arch/gnu.c:512
+#, c-format
+msgid "Can't write to %s, because it is opened read-only."
+msgstr "Ne peut crire sur %s parce qu'il est ouvert en lecture seulement."
+
+#: libparted/arch/linux.c:1321
+#, c-format
+msgid "%s during seek for write on %s"
+msgstr "%s lors d'un positionnement pour criture sur %s"
+
+#: libparted/arch/linux.c:1798
+#, fuzzy, c-format
+msgid ""
+"Error informing the kernel about modifications to partition %s -- %s. This "
+"means Linux won't know about any changes you made to %s until you reboot -- "
+"so you shouldn't mount it or use it in any way before rebooting."
+msgstr ""
+"Erreur d'information au kernel propos des modifications la partition %s "
+"- %s. Cela signifie que Linux ne reconnatra aucun des changements faits %"
+"s moins de ramorcer - aussi vous ne devriez pas le monter ou l'utiliser "
+"avant de ramorcer."
+
+#: libparted/arch/linux.c:1879
+#, fuzzy, c-format
+msgid ""
+"The kernel was unable to re-read the partition table on %s (%s). This means "
+"Linux won't know anything about the modifications you made until you "
+"reboot. You should reboot your computer before doing anything with %s."
+msgstr ""
+"Le kernel a t incapable de relire la table de partition sur %s (%s). Cela "
+"signifie que Linux ne connat rien des modifications effectues moins de "
+"ramorcer. Vous devriez ramorcer votre ordinateur avant de faire quoique ce "
+"soit avec %s."
+
+#: libparted/arch/gnu.c:97
+#, c-format
+msgid "Unable to open %s."
+msgstr "Incapable d'ouvrir %s."
+
+#: libparted/arch/gnu.c:117
+msgid "Unable to probe store."
+msgstr "Incapable de sonder le stockage."
+
+#: libparted/arch/gnu.c:355
+#, fuzzy
+msgid ""
+"The partition table cannot be re-read. This means you need to reboot before "
+"mounting any modified partitions. You also need to reinstall your boot "
+"loader before you reboot (which may require mounting modified partitions). "
+"It is impossible do both things! So you'll need to boot off a rescue disk, "
+"and reinstall your boot loader from the rescue disk. Read section 4 of the "
+"Parted User documentation for more information."
+msgstr ""
+"La table de partition n'a pu tre relue tel quelle, vous avez donc besoin de "
+"ramorcer avant de monter toutes partitions modifies. Vous devez aussi r-"
+"installer le chargeur d'amorce avant de ramorcer (lequel peut ncessiter de "
+"monter les partitions modifies). Il est impossible de faire les choses "
+"ensembles! Aussi c'est pourquoi vous aurez besoin d'amorcer partir d'un "
+"disque de secours et de r-installer le chargeur partir de ce dernier. "
+"Consulter la section 4 de la documentation usagre de Parted pour plus de "
+"dtails."
+
+#: libparted/arch/gnu.c:372
+#, fuzzy, c-format
+msgid ""
+"The partition table on %s cannot be re-read (%s). This means the Hurd knows "
+"nothing about any modifications you made. You should reboot your computer "
+"before doing anything with %s."
+msgstr ""
+"La table de partition sur %s (%s). Cela signifie que Hurd ne connat rien "
+"des modifications effectues. Vous devriez ramorcer l'ordinateur avant de "
+"faire quoique ce soit avec %s."
+
+#: libparted/arch/gnu.c:383 parted/parted.c:2215
+msgid ""
+"You should reinstall your boot loader before rebooting. Read section 4 of "
+"the Parted User documentation for more information."
+msgstr ""
+"Vous devriez r-installer le chargeur d'amorce avant de ramorcer. Lire la "
+"section 4 de la documentation usagre de Parted pour plus d'informations."
+
+#: libparted/arch/gnu.c:774
+#, c-format
+msgid "%s trying to sync %s to disk"
+msgstr "%s essaie de synchroniser %s sur le disque"
+
+#: libparted/disk.c:183
+#, c-format
+msgid "Unable to open %s - unrecognised disk label."
+msgstr "Incapable d'ouvrir %s - tiquette de disque non reconnue."
+
+#: libparted/disk.c:452
+#, c-format
+msgid ""
+"This libparted doesn't have write support for %s. Perhaps it was compiled "
+"read-only."
+msgstr ""
+"Ce libparted n'a pas de support pour l'criture pour %s. Cependant il a t "
+"compil en lecture seulement."
+
+#: libparted/disk.c:579
+#, fuzzy, c-format
+msgid "Partition %d is %s, but the file system is %s."
+msgstr "Partition %d est de %.3fMb mais le systme de fichiers est de %.3fMb."
+
+#: libparted/disk.c:1056
+#, c-format
+msgid "%s disk labels do not support extended partitions."
+msgstr "Les tiquettes de disque %s ne supportent pas les partitions tendues."
+
+#: libparted/disk.c:1616
+#, c-format
+msgid "%s disk labels don't support logical or extended partitions."
+msgstr ""
+"Les tiquettes de disque %s ne supportent pas les partitions logiques ou "
+"tendues."
+
+#: libparted/disk.c:1629
+#, fuzzy
+msgid "Too many primary partitions."
+msgstr "Trop de partitions primaires"
+
+#: libparted/disk.c:1638
+#, c-format
+msgid ""
+"Can't add a logical partition to %s, because there is no extended partition."
+msgstr ""
+"Ne peut ajouter une partition logique sur %s parce qu'il n'y a pas de "
+"partition tendue."
+
+#: libparted/disk.c:1662
+#, fuzzy, c-format
+msgid "Can't have more than one extended partition on %s."
+msgstr "On ne peut avoir plus d'une partition tendue sur %s"
+
+#: libparted/disk.c:1672
+msgid "Can't have logical partitions outside of the extended partition."
+msgstr "Ne peut avoir de partition logique en dehors de la partition tendue."
+
+#: libparted/disk.c:1697
+#, c-format
+msgid "Can't have a logical partition outside of the extended partition on %s."
+msgstr ""
+"Ne peut avoir une partition logique en dehors de la partition tendue sur %s."
+
+#: libparted/disk.c:1707 libparted/disk.c:1761 libparted/disk.c:1927
+#, fuzzy
+msgid "Can't have overlapping partitions."
+msgstr "Ne peut avoir des partitions qui se chevauchent."
+
+#: libparted/disk.c:1715
+msgid "Can't have a primary partition inside an extended partition."
+msgstr ""
+"Ne peut avoir une partition primaire l'intrieur d'une partition tendue."
+
+#: libparted/disk.c:2123
+msgid "metadata"
+msgstr "metadata"
+
+#: libparted/disk.c:2125
+msgid "free"
+msgstr "libre"
+
+#: libparted/disk.c:2127 parted/ui.c:968 parted/ui.c:996
+msgid "extended"
+msgstr "tendue"
+
+#: libparted/disk.c:2129 parted/ui.c:972 parted/ui.c:1000
+msgid "logical"
+msgstr "logique"
+
+#: libparted/disk.c:2131 parted/ui.c:964 parted/ui.c:992
+msgid "primary"
+msgstr "primaire"
+
+#: libparted/disk.c:2147
+msgid "boot"
+msgstr "amorce"
+
+#: libparted/disk.c:2149
+msgid "root"
+msgstr "root"
+
+#: libparted/disk.c:2151
+msgid "swap"
+msgstr "swap"
+
+#: libparted/disk.c:2153
+msgid "hidden"
+msgstr "cach"
+
+#: libparted/disk.c:2155
+msgid "raid"
+msgstr "raid"
+
+#: libparted/disk.c:2157
+msgid "lvm"
+msgstr "lvm"
+
+#: libparted/disk.c:2159
+msgid "lba"
+msgstr "lba"
+
+#: libparted/disk.c:2161
+msgid "hp-service"
+msgstr "hp-service"
+
+#: libparted/disk.c:2163
+msgid "palo"
+msgstr ""
+
+#: libparted/disk.c:2165
+#, fuzzy
+msgid "prep"
+msgstr "amorce"
+
+#: libparted/disk.c:2167
+msgid "msftres"
+msgstr ""
+
+#: libparted/disk.c:2173
+#, fuzzy, c-format
+msgid "Unknown partition flag, %d."
+msgstr "Fanion de partition inconnue %d."
+
+#: libparted/labels/rdb.c:177
+#, c-format
+msgid "%s : Bad checksum on block %llu of type %s."
+msgstr ""
+
+#: libparted/labels/rdb.c:510
+#, c-format
+msgid "%s : Didn't find rdb block, should never happen."
+msgstr ""
+
+#: libparted/labels/rdb.c:595
+#, c-format
+msgid "%s : Loop detected at block %d."
+msgstr ""
+
+#: libparted/labels/rdb.c:614
+#, c-format
+msgid "%s : The %s list seems bad at block %s."
+msgstr ""
+
+#: libparted/labels/rdb.c:703
+#, c-format
+msgid "%s : Failed to list bad blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:711
+#, c-format
+msgid "%s : Failed to list partition blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:719
+#, c-format
+msgid "%s : Failed to list file system blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:727
+#, c-format
+msgid "%s : Failed to list boot blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:750
+#, fuzzy, c-format
+msgid "Failed to write partition block at %d."
+msgstr "Incapable de dterminer si la partition est monte."
+
+#: libparted/labels/rdb.c:1053 libparted/labels/bsd.c:505
+#: libparted/labels/dos.c:1942 libparted/labels/dvh.c:772
+#: libparted/labels/gpt.c:1365 libparted/labels/loop.c:251
+#: libparted/labels/mac.c:1318 libparted/labels/pc98.c:764
+#: libparted/labels/sun.c:704
+msgid "Unable to satisfy all constraints on the partition."
+msgstr "Incapable de satisfaire toutes les contraintes sur la partition"
+
+#: libparted/labels/rdb.c:1081
+#, fuzzy
+msgid "Unable to allocate a partition number."
+msgstr "Numro de partition attendu."
+
+#: libparted/labels/bsd.c:530
+#, fuzzy
+msgid "Unable to allocate a bsd disklabel slot."
+msgstr "Incapable d'allouer une entre pour une tiquette de disque BSD"
+
+#: libparted/labels/dos.c:812
+#, fuzzy, c-format
+msgid "Invalid partition table on %s -- wrong signature %x."
+msgstr "Table de partition invalide sur %s - signature errone %x"
+
+#: libparted/labels/dos.c:840
+#, c-format
+msgid "Invalid partition table - recursive partition on %s."
+msgstr "Table de partition invalide - partition rcursive sur %s"
+
+#: libparted/labels/dos.c:1300
+#, fuzzy
+msgid "Extended partitions cannot be hidden on msdos disk labels."
+msgstr ""
+"Les partitions ext2 ne peuvent tre caches pour les tiquettes de disque MS-"
+"DOS."
+
+#: libparted/labels/dos.c:1926
+msgid "Parted can't resize partitions managed by Windows Dynamic Disk."
+msgstr ""
+
+#: libparted/labels/dvh.c:192
+#, fuzzy, c-format
+msgid "%s has no extended partition (volume header partition)."
+msgstr ""
+"%s n pas de partition tendue (en-tte de partition de volume). Si vous "
+"l'ignorez alors le ramorage de n'importe quel volume le dtruira."
+
+#: libparted/labels/dvh.c:315
+msgid "Checksum is wrong, indicating the partition table is corrupt."
+msgstr ""
+"Total de contrle erron, indiquant que la table de partition est corrompue."
+
+#: libparted/labels/dvh.c:616
+msgid "Only primary partitions can be root partitions."
+msgstr "Seules les partitions primaires peuvent tre des partitions root."
+
+#: libparted/labels/dvh.c:630
+msgid "Only primary partitions can be swap partitions."
+msgstr "Seules les partitions primaires peuvent tre des partitions swap."
+
+#: libparted/labels/dvh.c:644
+msgid "Only logical partitions can be a boot file."
+msgstr "Seules les partitions logiques peuvent tre un fichier d'amorage."
+
+#: libparted/labels/dvh.c:723
+msgid "Only logical partitions (boot files) have a name."
+msgstr "Seules les partitions logiciels (fichiers d'amorage) ont un nom."
+
+#: libparted/labels/dvh.c:814
+msgid "Too many primary partitions"
+msgstr "Trop de partitions primaires"
+
+#: libparted/labels/gpt.c:433
+#, fuzzy, c-format
+msgid ""
+"%s contains GPT signatures, indicating that it has a GPT table. However, it "
+"does not have a valid fake msdos partition table, as it should. Perhaps it "
+"was corrupted -- possibly by a program that doesn't understand GPT partition "
+"tables. Or perhaps you deleted the GPT table, and are now using an msdos "
+"partition table. Is this a GPT partition table?"
+msgstr ""
+"%s contient des signatures GPT, indiquant qu'il a une table GPT. Cependant, "
+"il n'a pas une table de partition factive MSDOS tel qu'il le devrait. Peut-"
+"tre a-t-elle t corrompue - possiblement pas un programme qui ne comprend "
+"les tables de partition GPT. Or peut-tre que vous avez dtruit la table GPT "
+"et que vous utilisez la table de partition MSDOS. Est-ce une table de "
+"partition GPT?"
+
+#: libparted/labels/gpt.c:625
+#, c-format
+msgid ""
+"The format of the GPT partition table is version %x, which is newer than "
+"what Parted can recognise. Please tell us! bug-parted@gnu.org"
+msgstr ""
+"Le format de la table de partitions GPT dont la version est %x est plus "
+"rcent que ce que Parted peut reconnatre. SVP nous aviser bug-parted@gnu.org"
+
+#: libparted/labels/gpt.c:747
+msgid ""
+"The backup GPT table is not at the end of the disk, as it should be. This "
+"might mean that another operating system believes the disk is smaller. Fix, "
+"by moving the backup to the end (and removing the old backup)?"
+msgstr ""
+"La table d'archive GPT n'est pas la fin du disque telle qu'elle devrait se "
+"trouver. Cela peut vouloir dire qu'un autre sytme d'exploitation croit que "
+"le disque est plus petit. Corrifer en dplaant l'archive la fin (et "
+"enlever la vieille archive)?"
+
+#: libparted/labels/gpt.c:782
+#, fuzzy
+msgid ""
+"The primary GPT table is corrupt, but the backup appears OK, so that will be "
+"used."
+msgstr ""
+"La table primaire GPT est corrompue mais l'archive semble ok, aussi elle "
+"sera utilis."
+
+#: libparted/labels/gpt.c:790
+#, fuzzy
+msgid ""
+"Both the primary and backup GPT tables are corrupt. Try making a fresh "
+"table, and using Parted's rescue feature to recover partitions."
+msgstr ""
+"Les deux tables GPT primaire et d'archive sont corrompues. Essayer de btir "
+"une table frache et utiliser le mode de secours de Parted pour recuprer "
+"les partitions."
+
+#: libparted/labels/mac.c:167
+#, c-format
+msgid "Invalid signature %x for Mac disk labels."
+msgstr "Signature invalide %x pour une tiquette de disque Mac"
+
+#: libparted/labels/mac.c:212
+msgid "Partition map has no partition map entry!"
+msgstr "La map de partition n'a pas d'entre de map de partition!"
+
+#: libparted/labels/mac.c:259
+#, c-format
+msgid "%s is too small for a Mac disk label!"
+msgstr "%s est trop petit pour une tiquette de disque Mac!"
+
+#: libparted/labels/mac.c:490
+#, c-format
+msgid "Partition %d has an invalid signature %x."
+msgstr "La partition %d a une signature invalide %x."
+
+#: libparted/labels/mac.c:508
+#, c-format
+msgid "Partition %d has an invalid length of 0 bytes!"
+msgstr "La partition %d a une longueur invalide de 0 octet!"
+
+#: libparted/labels/mac.c:536
+#, fuzzy
+msgid "The data region doesn't start at the start of the partition."
+msgstr "La zone de donnes ne dbute pas la position de dpart."
+
+#: libparted/labels/mac.c:553
+#, fuzzy
+msgid "The boot region doesn't start at the start of the partition."
+msgstr "La zone d'amorce ne dbute pas la position de dpart."
+
+#: libparted/labels/mac.c:567
+msgid "The partition's boot region doesn't occupy the entire partition."
+msgstr ""
+"La partition de la zone d'amorce n'occupe pas entirement la partition."
+
+#: libparted/labels/mac.c:577
+msgid "The partition's data region doesn't occupy the entire partition."
+msgstr ""
+"La zone de donnes de la partition n'occupe pas entirement la partition."
+
+#: libparted/labels/mac.c:631
+#, c-format
+msgid ""
+"Weird block size on device descriptor: %d bytes is not divisible by 512."
+msgstr ""
+"Taille bizarre de bloc d'un descripteur de priphrique: %d octets n'est pas "
+"divisible par 512."
+
+#: libparted/labels/mac.c:644
+#, c-format
+msgid ""
+"The driver descriptor says the physical block size is %d bytes, but Linux "
+"says it is %d bytes."
+msgstr ""
+"Le descripteur de pilote contient une taille physique de bloc de %d octets, "
+"mais Linux lui obtient %d octets."
+
+#: libparted/labels/mac.c:692
+msgid "No valid partition map found."
+msgstr "Pas repr de map de partition valide."
+
+#: libparted/labels/mac.c:744
+#, fuzzy, c-format
+msgid ""
+"Conflicting partition map entry sizes! Entry 1 says it is %d, but entry %d "
+"says it is %d!"
+msgstr ""
+"Tailles conflictuelles des maps de partitions! L'entre 1 indique %d alors "
+"que l'entre %d indique %d!"
+
+#: libparted/labels/mac.c:771
+#, fuzzy
+msgid "Weird! There are 2 partitions map entries!"
+msgstr "Bizarre - 2 entres de map de partitions"
+
+#: libparted/labels/mac.c:1257
+msgid ""
+"Changing the name of a root or swap partition will prevent Linux from "
+"recognising it as such."
+msgstr ""
+"Changer le nom de la partition root ou swap empchera Linux de les "
+"reconnatre par la mme occasion"
+
+#: libparted/labels/mac.c:1353
+#, fuzzy
+msgid "Can't add another partition -- the partition map is too small!"
+msgstr ""
+"Ne peut ajouter une autre parition - la map de partitions est trop petite!"
+
+#: libparted/labels/pc98.c:357
+#, fuzzy, c-format
+msgid "Invalid partition table on %s."
+msgstr "Table de partition invalide sur %s"
+
+#: libparted/labels/pc98.c:409 libparted/labels/pc98.c:487
+#, fuzzy, c-format
+msgid ""
+"Partition %d isn't aligned to cylinder boundaries. This is still "
+"unsupported."
+msgstr ""
+"Partition %d n'est pas align sur une frontire de cylindre. Besoin d'ajout "
+"de soutien pour cela."
+
+#: libparted/labels/pc98.c:796
+msgid "Can't add another partition."
+msgstr "Ne peut ajouter une autre partition."
+
+#: libparted/labels/sun.c:143
+msgid "Corrupted Sun disk label detected."
+msgstr "tiquette de disque Sun corrompue."
+
+#: libparted/labels/sun.c:264
+#, fuzzy, c-format
+msgid ""
+"The disk CHS geometry (%d,%d,%d) reported by the operating system does not "
+"match the geometry stored on the disk label (%d,%d,%d)."
+msgstr ""
+"La gomtrie du disque CHS (%d,%d,%d) ne concorde pas avec la gomtrie "
+"stocke sur l'tiquette de disque (%d,%d,%d)."
+
+#: libparted/labels/sun.c:286
+#, c-format
+msgid "The disk label describes a disk bigger than %s."
+msgstr "L'tiquette de disque dcrit un disque plus gros que %s."
+
+#: libparted/labels/sun.c:440
+#, c-format
+msgid "The disk has %d cylinders, which is greater than the maximum of 65536."
+msgstr ""
+
+#: libparted/labels/sun.c:736
+msgid ""
+"The Whole Disk partition is the only available one left. Generally, it is "
+"not a good idea to overwrite this partition with a real one. Solaris may "
+"not be able to boot without it, and SILO (the sparc boot loader) appreciates "
+"it as well."
+msgstr ""
+"La partition entire du disque est la seule disponible qui reste. "
+"Gnralement, ce n'est pas une bonne ide d'craser cette partition avec une "
+"relle. Solaris ne pourra pas amorcer sans elle et SILO (le chargeur "
+"d'amorce sur Sparc) en a besoin."
+
+#: libparted/labels/sun.c:751
+msgid "Sun disk label is full."
+msgstr "L'tiquette de disque SUN est remplie."
+
+#: libparted/filesys.c:386
+msgid "Could not detect file system."
+msgstr "Ne peut dtecter de systmes de fichiers."
+
+#: libparted/filesys.c:397
+#, fuzzy
+msgid "The file system is bigger than its volume!"
+msgstr "Le systme de fichiers est plus gros que son volume!"
+
+#: libparted/filesys.c:405
+#, c-format
+msgid "Support for opening %s file systems is not implemented yet."
+msgstr ""
+"Le support pour l'ouverture du systme de fichiers %s n'est pas encore "
+"implant."
+
+#: libparted/filesys.c:447
+#, c-format
+msgid "Support for creating %s file systems is not implemented yet."
+msgstr ""
+"Le support pour la cration du systme de fichiers %s n'est pas encore "
+"implant."
+
+#: libparted/filesys.c:508
+#, c-format
+msgid "Support for checking %s file systems is not implemented yet."
+msgstr ""
+"Le support pour la vrification du systme de fichiers %s n'est pas encore "
+"implant."
+
+#: libparted/filesys.c:574
+msgid "raw block copying"
+msgstr "copie brute de blocs"
+
+#: libparted/filesys.c:585
+msgid "growing file system"
+msgstr "systme de fichiers a grossi"
+
+#: libparted/filesys.c:625
+msgid "Can't copy onto an overlapping partition."
+msgstr "Ne peut copier sur une partition qui en chevauche une autre."
+
+#: libparted/filesys.c:647
+#, fuzzy, c-format
+msgid ""
+"Direct support for copying file systems is not yet implemented for %s. "
+"However, support for resizing is implemented. Therefore, the file system "
+"can be copied if the new partition is at least as big as the old one. So, "
+"either shrink the partition you are trying to copy, or copy to a bigger "
+"partition."
+msgstr ""
+"Le support direct pour la copie de systme de fichiers n'est pas encore "
+"implant pour %s. Cependant le support pour modifier les tailles l'est. "
+"Par consquent, le systme de fichiers peut tre copier si la nouvelle "
+"partition est au moins aussi grande que l'ancienne. Aussi, vous pouvez soit "
+"rduire la partition que vous tenter de copier ou soit la copier vers une "
+"partition plus grande."
+
+#: libparted/filesys.c:661
+#, c-format
+msgid "Support for copying %s file systems is not implemented yet."
+msgstr ""
+"Le support pour la copie du systme de fichiers %s n'est pas encore implant."
+
+#: libparted/filesys.c:699
+#, c-format
+msgid "Support for resizing %s file systems is not implemented yet."
+msgstr ""
+"Le support pour la modification de la taille du systme de fichiers %s n'est "
+"pas encore implant."
+
+#: libparted/exception.c:78
+msgid "Information"
+msgstr "Information"
+
+#: libparted/exception.c:79
+msgid "Warning"
+msgstr "AVERTISSEMENT"
+
+#: libparted/exception.c:80
+msgid "Error"
+msgstr "Erreur"
+
+#: libparted/exception.c:81
+msgid "Fatal"
+msgstr "Fatal"
+
+#: libparted/exception.c:82
+msgid "Bug"
+msgstr "Bug"
+
+#: libparted/exception.c:83
+msgid "No Implementation"
+msgstr "Pas d'implantation"
+
+#: libparted/exception.c:87
+msgid "Fix"
+msgstr "Fixe"
+
+#: libparted/exception.c:88
+msgid "Yes"
+msgstr "Yes"
+
+#: libparted/exception.c:89
+msgid "No"
+msgstr "No"
+
+#: libparted/exception.c:90
+msgid "OK"
+msgstr "OK"
+
+#: libparted/exception.c:91
+msgid "Retry"
+msgstr "Nouvel essai"
+
+#: libparted/exception.c:92
+msgid "Ignore"
+msgstr "Ignore"
+
+#: libparted/exception.c:93
+msgid "Cancel"
+msgstr "Cancel"
+
+#: libparted/exception.c:133
+#, fuzzy, c-format
+msgid ""
+"A bug has been detected in GNU Parted. Refer to the web site of parted "
+"http://www.gnu.org/software/parted/parted.html for more informations of what "
+"could be useful for bug submitting! Please email a bug report to bug-"
+"parted@gnu.org containing at least the version (%s) and the following "
+"message: "
+msgstr ""
+"Une anomalie a t dtecte dans GNU Parted. SVP rapportez celle-ci bug-"
+"parted@gnu.org en prcisant la version (%s) et le message suivant:"
+
+#: libparted/cs/geom.c:162
+msgid "Can't have the end before the start!"
+msgstr "Ne peut place la fin avant le dbut!"
+
+#: libparted/cs/geom.c:169
+msgid "Can't have a partition outside the disk!"
+msgstr "Ne peut placer une partition en dehors du disque!"
+
+#: libparted/cs/geom.c:303
+#, fuzzy, c-format
+msgid "Attempt to read sectors %ld-%ld outside of partition on %s."
+msgstr ""
+"Tentative de lecture des secteurs %ld-%ld en dehors de la partition sur %s"
+
+#: libparted/cs/geom.c:373
+#, fuzzy, c-format
+msgid "Attempt to write sectors %ld-%ld outside of partition on %s."
+msgstr ""
+"Tentative d'criture des secteurs %ld-%ld en dehors de la partition sur %s"
+
+#: libparted/cs/geom.c:413 libparted/fs/linux_swap/linux_swap.c:353
+msgid "checking for bad blocks"
+msgstr "vrifications de la prsence de blocs errons"
+
+#: libparted/libparted.c:286 libparted/libparted.c:306
+msgid "Out of memory."
+msgstr "Mmoire puise"
+
+#: libparted/unit.c:139
+msgid "Cannot get unit size for special unit 'COMPACT'."
+msgstr ""
+
+#: libparted/unit.c:382
+#, c-format
+msgid "\"%s\" has invalid syntax for locations."
+msgstr ""
+
+#: libparted/unit.c:390
+#, c-format
+msgid "The maximum head value is %d."
+msgstr ""
+
+#: libparted/unit.c:397
+#, c-format
+msgid "The maximum sector value is %d."
+msgstr ""
+
+#: libparted/unit.c:409 libparted/unit.c:540
+#, fuzzy, c-format
+msgid "The location %s is outside of the device %s."
+msgstr "Ne peut crer une partition en dehors du priphrique."
+
+#: libparted/unit.c:522
+msgid "Invalid number."
+msgstr ""
+
+#: libparted/fs/ext2/ext2.c:87 libparted/fs/ext2/ext2.c:112
+msgid "Inconsistent group descriptors!"
+msgstr "Descripteurs de groupe inconsistent!"
+
+#: libparted/fs/ext2/ext2.c:91 libparted/fs/ext2/ext2.c:116
+#, fuzzy
+msgid "File system full!"
+msgstr "Le systme de fichiers est plein!"
+
+#: libparted/fs/ext2/ext2.c:750
+#, fuzzy
+msgid "Invalid superblock. Are you sure this is an ext2 file system?"
+msgstr ""
+"Super bloc invalide. tes-vous certain qu'il s'agit d'un systme de fichier "
+"ext2"
+
+#: libparted/fs/ext2/ext2.c:764 libparted/fs/ext2/ext2_resize.c:597
+#, fuzzy
+msgid "File system has errors! You should run e2fsck."
+msgstr "Le systme de fichiers a des erreurs! Vous devriez excuter e2fsck."
+
+#: libparted/fs/ext2/ext2.c:775
+#, fuzzy
+msgid ""
+"File system was not cleanly unmounted! You should run e2fsck. Modifying an "
+"unclean file system could cause severe corruption."
+msgstr ""
+"Le systme de fichiers n'a pas t dmont proprement! Vous devriez excuter "
+"e2fsck. Modifier un syst'eme de fichiers incorrect peut provoquer des "
+"problmes srieuxs de corruption."
+
+#: libparted/fs/ext2/ext2.c:795
+#, fuzzy
+msgid "File system has an incompatible feature enabled."
+msgstr "Le systme de fichiers a des options actives qui sont incompatibles"
+
+#: libparted/fs/ext2/ext2.c:806
+msgid "Error allocating buffer cache."
+msgstr "Erreur d'allocation d'un tampon de cache"
+
+#: libparted/fs/ext2/ext2.c:848
+msgid ""
+"A resize operation on this file system will use EXPERIMENTAL code that MAY "
+"CORRUPT it (although it hasn't done so yet).You should at least backup your "
+"data and run 'e2fsck -f' afterwards."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:114
+#, fuzzy
+msgid ""
+"Found an inode with a incorrect link count. Better go run e2fsck first!"
+msgstr ""
+"Inode repr avec un compte incorrect de liens. Il serait prfrable "
+"d'excuter e2fsck d'abord."
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:487
+msgid "Not enough free inodes!"
+msgstr "Pas asssez d'inodes libres!"
+
+#: libparted/fs/ext2/ext2_resize.c:224
+#, fuzzy
+msgid "File system is too full to remove a group!"
+msgstr "Le systme de fichiers est trop occup enlever un groupe!"
+
+#: libparted/fs/ext2/ext2_resize.c:233
+#, fuzzy
+msgid "File system has too many allocated inodes to remove a group!"
+msgstr "Le systme de fichiers a trop d'inodes allous pour enlever un groupe!"
+
+#: libparted/fs/ext2/ext2_resize.c:493
+msgid "adding groups"
+msgstr "ajout de groupes"
+
+#: libparted/fs/ext2/ext2_resize.c:530
+#, fuzzy, c-format
+msgid "Your file system is too full to resize it to %i blocks. Sorry."
+msgstr ""
+"Le systme de fichiers est trop occup pour en changer la taille en %i "
+"blocs. Dsol."
+
+#: libparted/fs/ext2/ext2_resize.c:540
+#, fuzzy, c-format
+msgid ""
+"Your file system has too many occupied inodes to resize it to %i blocks. "
+"Sorry."
+msgstr ""
+"Le systme de fichiers occupe trop d'inodes pour en changer la taille en %i "
+"blocs. Dsol."
+
+#: libparted/fs/ext2/ext2_resize.c:554 libparted/fs/hfs/hfs.c:243
+#: libparted/fs/hfs/hfs.c:624
+msgid "shrinking"
+msgstr "rduction"
+
+#: libparted/fs/ext2/ext2_resize.c:605
+#, fuzzy
+msgid "File system was not cleanly unmounted! You should run e2fsck."
+msgstr ""
+"Le systme de fichiers n'a pas t dmont proprement! Vous devriez excuter "
+"e2fsck."
+
+#: libparted/fs/ext2/ext2_resize.c:614
+msgid ""
+"The file system has the 'dir_index' feature enabled. Parted can only resize "
+"the file system if it disables this feature. You can enable it later by "
+"running 'tune2fs -O dir_index DEVICE' and then 'e2fsck -fD DEVICE'."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_block_relocator.c:198
+#, fuzzy
+msgid "Cross-linked blocks found! Better go run e2fsck first!"
+msgstr ""
+"Blocs lis de faon croise reprs! Il serait prfrable d'excuter e2fsck "
+"d'abord!"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:537
+#, fuzzy, c-format
+msgid "Block %i has no reference? Weird."
+msgstr "BLoc %i n'a pas de rfrence? Bizarre"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:738
+#, c-format
+msgid "Block %i shouldn't have been marked!"
+msgstr "Bloc %i ne devrait pas avoir t marqu!"
+
+#: libparted/fs/ext2/interface.c:188
+#, fuzzy
+msgid ""
+"The ext2 file system passed a basic check. For a more comprehensive check, "
+"use the e2fsck program."
+msgstr ""
+"Le systme de fichiers ext2 a pass la vrification de base. Pour une "
+"vrification plus expressive, utiliser e2fsck."
+
+#: libparted/fs/ext2/interface.c:205
+msgid "Sorry, can't move the start of ext2 partitions yet!"
+msgstr ""
+"Dsol, on ne peut dplacer le dbut d'une partition ext2 (pas encore)!"
+
+#: libparted/fs/ext2/ext2_buffer.c:82
+msgid "Couldn't flush buffer cache!"
+msgstr "Ne peut vider la cache!"
+
+#: libparted/fs/ext2/ext2_mkfs.c:162
+msgid "writing per-group metadata"
+msgstr "criture des mtadonnes per-group"
+
+#: libparted/fs/ext2/ext2_mkfs.c:565
+msgid "File system too small for ext2."
+msgstr "Systme de fichiers trop petit pour ext2."
+
+#: libparted/fs/fat/calc.c:134
+#, fuzzy, c-format
+msgid ""
+"You need %s of free disk space to shrink this partition to this size. "
+"Currently, only %s is free."
+msgstr ""
+"Voius avez besoin de %dM d'espace libre pour rduire cette partition cette "
+"taille (vous ne disposez que de %dM de libre)"
+
+#: libparted/fs/fat/context.c:55
+#, c-format
+msgid ""
+"Cluster start delta = %d, which is not a multiple of the cluster size %d."
+msgstr ""
+"Le delta de dpart du cluster = %d lequel n'est pas un multiple de la taille "
+"d'un cluster %d"
+
+#: libparted/fs/fat/fat.c:312
+#, fuzzy, c-format
+msgid "Partition too big/small for a %s file system."
+msgstr "La partition est trop grande/petite pour un systme de fichiers %s"
+
+#: libparted/fs/fat/fat.c:478
+msgid ""
+"The FATs don't match. If you don't know what this means, then select "
+"cancel, run scandisk on the file system, and then come back."
+msgstr ""
+"Les FAT ne concordent pas. Si vous ne savez pas ce que cela signifie alors "
+"slectionner cancel et excuter sacndisk sur le systme de fichiers et "
+"recommencer."
+
+#: libparted/fs/fat/fat.c:518
+msgid "There are no possible configurations for this FAT type."
+msgstr "Il n'y a pas de configuration possible pour ce type FAT."
+
+#: libparted/fs/fat/fat.c:530
+#, c-format
+msgid ""
+"File system doesn't have expected sizes for Windows to like it. Cluster "
+"size is %dk (%dk expected); number of clusters is %d (%d expected); size of "
+"FATs is %d sectors (%d expected)."
+msgstr ""
+"Le systme de fichiers n'tait pas prvu pour des tailles compatibles pour "
+"Windows. La taille du cluster est %dk (%dk attendu). Le nombre de clusters "
+"est %d (%d attendu). La taille des FAT est de %d secteurs (%d attendu)"
+
+#: libparted/fs/fat/fat.c:553
+#, c-format
+msgid ""
+"File system is reporting the free space as %d clusters, not %d clusters."
+msgstr ""
+"Le systme de fichiers rapporte un espace libre de %d clusters et non pas %d "
+"clusters."
+
+#: libparted/fs/fat/fat.c:878
+#, fuzzy
+msgid ""
+"GNU Parted was miscompiled: the FAT boot sector should be 512 bytes. FAT "
+"support will be disabled."
+msgstr ""
+"GNU Parted a t mal compil: le secteur d'amorce FAT devrait tre de 512 "
+"octets. Le support pour FAT sera dsactiv."
+
+#: libparted/fs/fat/resize.c:158
+#, fuzzy
+msgid ""
+"There's not enough room in the root directory for all of the files. Either "
+"cancel, or ignore to lose the files."
+msgstr ""
+"Il n'y a pas assez d'espace dans le rpertoire roor pour tous les fichiers. "
+"Soit annuler (cancel) ou ignorer (ignore) la perte de fichiers"
+
+#: libparted/fs/fat/resize.c:299
+msgid "Error writing to the root directory."
+msgstr "Erreur d'criture du rpertoire root."
+
+#: libparted/fs/fat/resize.c:484
+#, fuzzy
+msgid "If you leave your file system as FAT16, then you will have no problems."
+msgstr ""
+"Si vous conserver le systme de fichiers comme FAT16, vous n'aurez pas de "
+"problme."
+
+#: libparted/fs/fat/resize.c:487
+msgid ""
+"If you convert to FAT16, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual)."
+msgstr ""
+"Si vous convertissez FAT16 et installez MS WIndows sur cette partition "
+"alors vous devrez r-installer le chargeur d'amorce de MS Windows. Si vous "
+"dsirez faire cela, vous devriez consulter le manuel de Parted (ou votre "
+"manuel de documentation)."
+
+#: libparted/fs/fat/resize.c:495
+msgid ""
+"If you leave your file system as FAT32, then you will not introduce any new "
+"problems."
+msgstr ""
+"Si vous conserver votre systme de fichiers en FAT32 alors vous "
+"n'introduirez pas de nouveaux problmes."
+
+#: libparted/fs/fat/resize.c:499
+msgid ""
+"If you convert to FAT32, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual). Also, "
+"converting to FAT32 will make the file system unreadable by MS DOS, MS "
+"Windows 95a, and MS Windows NT."
+msgstr ""
+"Si vous faites la conversion FAT32 tandis que MS Windows est install sur "
+"cette partition alors vous devrez rinstaller le chargeur d'amorce de MS "
+"Windows. Si vous dsirez faire cela, vous devriez consulter le manuel de "
+"Parted (ou votre manuel de documentation). Noter que la conversion FAT32 "
+"rendra le systme de fichiers illisible pour MS DOS, MS Windows 95a et MS "
+"Windows NT."
+
+#: libparted/fs/fat/resize.c:513
+#, c-format
+msgid "%s %s %s"
+msgstr "%s %s %s"
+
+#: libparted/fs/fat/resize.c:514
+msgid "Would you like to use FAT32?"
+msgstr "Voulez-vous utiliser FAT32?"
+
+#: libparted/fs/fat/resize.c:541 libparted/fs/fat/resize.c:557
+#, c-format
+msgid "%s %s"
+msgstr "%s %s"
+
+#: libparted/fs/fat/resize.c:542
+msgid ""
+"The file system can only be resized to this size by converting to FAT16."
+msgstr ""
+"La taille du systme de fichier peut seulement tre change par une "
+"conversion FAT16."
+
+#: libparted/fs/fat/resize.c:558
+msgid ""
+"The file system can only be resized to this size by converting to FAT32."
+msgstr ""
+"La taille du systme de fichier peut seulement tre change par une "
+"conversion FAT32."
+
+#: libparted/fs/fat/resize.c:571
+#, fuzzy
+msgid ""
+"GNU Parted cannot resize this partition to this size. We're working on it!"
+msgstr ""
+"GNU Parted ne peut modifier la taille de cette partition la taille "
+"demande. Nous y travaillons!"
+
+#: libparted/fs/fat/bootsector.c:48 libparted/fs/fat/bootsector.c:55
+msgid "File system has an invalid signature for a FAT file system."
+msgstr ""
+"Le systme de fichiers a une signature invalide pour un systme de fichiers "
+"FAT."
+
+#: libparted/fs/fat/bootsector.c:62
+msgid "File system has an invalid sector size for a FAT file system."
+msgstr ""
+"Le systme de fichiers a une taille de secteur invalide pour un systme de "
+"fichiers FAT."
+
+#: libparted/fs/fat/bootsector.c:69
+msgid "File system has an invalid cluster size for a FAT file system."
+msgstr ""
+"Le systme de fichiers a une taille de cluster invalide pour un systme de "
+"fichiers FAT."
+
+#: libparted/fs/fat/bootsector.c:76
+#, fuzzy
+msgid ""
+"File system has an invalid number of reserved sectors for a FAT file system."
+msgstr ""
+"Le systme de fichiers a un nombre invalide de secteurs rservs pour un "
+"systme de fichiers FAT."
+
+#: libparted/fs/fat/bootsector.c:83
+#, fuzzy
+msgid "File system has an invalid number of FATs."
+msgstr "Le systme de fichiers a un nombre invalide de FAT."
+
+#: libparted/fs/fat/bootsector.c:138
+#, c-format
+msgid ""
+"This file system has a logical sector size of %d. GNU Parted is known not "
+"to work properly with sector sizes other than 512 bytes."
+msgstr ""
+"Le systme de fichier a une taille de secteur logique de %d. GNU Parted "
+"n'est pas connu pour traiter correctement les tailles de secteurs autres que "
+"de 512 octets."
+
+#: libparted/fs/fat/bootsector.c:163
+#, c-format
+msgid ""
+"The file system's CHS geometry is (%d, %d, %d), which is invalid. The "
+"partition table's CHS geometry is (%d, %d, %d). If you select Ignore, the "
+"file system's CHS geometry will be left unchanged. If you select Fix, the "
+"file system's CHS geometry will be set to match the partition table's CHS "
+"geometry."
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:209
+msgid "FAT boot sector says logical sector size is 0. This is weird. "
+msgstr ""
+"Le secteur d'amorce FAT indique une taille de secteur logique de 0. Cela est "
+"bizarre."
+
+#: libparted/fs/fat/bootsector.c:215
+msgid "FAT boot sector says there are no FAT tables. This is weird. "
+msgstr ""
+"Le secteur d'amorce FAT indique qu'il n'y a pas de tables FAT. Cela est "
+"bizarre."
+
+#: libparted/fs/fat/bootsector.c:221
+msgid "FAT boot sector says clusters are 0 sectors. This is weird. "
+msgstr ""
+"Le secteur d'amorce FAT indique des clusters ayant 0 secteurs. Cela est "
+"bizarre."
+
+#: libparted/fs/fat/bootsector.c:231
+#, fuzzy
+msgid "File system is FAT12, which is unsupported."
+msgstr "Le systme de fichier est FAT12, lequel n'est pas support."
+
+#: libparted/fs/fat/bootsector.c:407
+#, c-format
+msgid ""
+"The information sector has the wrong signature (%x). Select cancel for now, "
+"and send in a bug report. If you're desperate, it's probably safe to ignore."
+msgstr ""
+"L'information de secteur contient une signature errone (%x). Slectionner "
+"cancel pour le moment et transmettre un rapport d'anomalies. Si vous tes "
+"dsespr, il est probablement scuritaire de slectionner ignore ."
+
+#: libparted/fs/fat/count.c:149
+#, c-format
+msgid "Bad directory entry for %s: first cluster is the end of file marker."
+msgstr ""
+"Entre de rpertoire errone pour %s: premier cluster est la fin du "
+"marquer de fichiers."
+
+#: libparted/fs/fat/count.c:162
+#, c-format
+msgid ""
+"Bad FAT: unterminated chain for %s. You should run dosfsck or scandisk."
+msgstr ""
+"FAT erron: chane non termine pour %s. Vous devriez excuter dosfsck ou "
+"sacndisk."
+
+#: libparted/fs/fat/count.c:171
+#, fuzzy, c-format
+msgid ""
+"Bad FAT: cluster %d outside file system in chain for %s. You should run "
+"dosfsck or scandisk."
+msgstr ""
+"FAT erron: cluster %d est en dehors du systme de fichiers dans la chane "
+"pour %s. Vous devriez excuter dosfsck ou scandisk."
+
+#: libparted/fs/fat/count.c:181
+#, c-format
+msgid ""
+"Bad FAT: cluster %d is cross-linked for %s. You should run dosfsck or "
+"scandisk."
+msgstr ""
+"FAT erron: cluster %d a des liens croiss pour %s. Vous devriez excuter "
+"dosfsck ou scandisk."
+
+#: libparted/fs/fat/count.c:200
+#, c-format
+msgid "%s is %dk, but it has %d clusters (%dk)."
+msgstr "%s est %dk, mais il a %d grappes (clusters) (%dk)."
+
+#: libparted/fs/fat/count.c:263
+#, c-format
+msgid ""
+"The file %s is marked as a system file. This means moving it could cause "
+"some programs to stop working."
+msgstr ""
+"Le fichier %s est marqu comme systme de fichiers. Cela signifie que son "
+"dplacement pourrait faire que certains programme pourraient cesser de "
+"fonctionner."
+
+#: libparted/fs/fat/table.c:138
+#, c-format
+msgid ""
+"FAT %d media %x doesn't match the boot sector's media %x. You should "
+"probably run scandisk."
+msgstr ""
+"La FAT %d du mdia %x ne concorde pas avec le secteur d'amorce du mdia %x. "
+"Vous devriez probablement excuter scandisk."
+
+#: libparted/fs/fat/table.c:268
+#, fuzzy, c-format
+msgid "fat_table_set: cluster %ld outside file system"
+msgstr "fat_table_set: cluster %ld en dehors du systme de fichiers"
+
+#: libparted/fs/fat/table.c:296
+#, fuzzy, c-format
+msgid "fat_table_get: cluster %ld outside file system"
+msgstr "fat_table_get: cluster %ld en dehors du systme de fichiers"
+
+#: libparted/fs/fat/table.c:334
+msgid "fat_table_alloc_cluster: no free clusters"
+msgstr "fat_table_alloc_cluster: pas de cluster disponible"
+
+#: libparted/fs/linux_swap/linux_swap.c:236
+#, c-format
+msgid "Unrecognised linux swap signature '%10s'."
+msgstr "Signature Linux de swap non reocnnue %10s ."
+
+#: libparted/fs/linux_swap/linux_swap.c:312
+msgid "Too many bad pages."
+msgstr "Trop de pages errons."
+
+#: libparted/fs/hfs/advfs.c:123 libparted/fs/hfs/advfs_plus.c:125
+#: libparted/fs/hfs/reloc.c:416 libparted/fs/hfs/reloc.c:510
+#: libparted/fs/hfs/reloc_plus.c:541 libparted/fs/hfs/reloc_plus.c:660
+#: libparted/fs/hfs/reloc_plus.c:774
+msgid "The file system contains errors."
+msgstr ""
+
+#: libparted/fs/hfs/advfs_plus.c:290
+msgid "Bad blocks could not be read."
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:139
+#, c-format
+msgid ""
+"Trying to register an extent starting at block 0x%X, but another one already "
+"exists at this position. You should check the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:216
+#, c-format
+msgid ""
+"Trying to move an extent from block Ox%X to block Ox%X, but another one "
+"already exists at this position. This should not happen!"
+msgstr ""
+
+#: libparted/fs/hfs/file.c:145
+#, c-format
+msgid "Could not update the extent cache for HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:182
+#, c-format
+msgid "Trying to read HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:192 libparted/fs/hfs/file.c:222
+#, c-format
+msgid "Could not find sector %lli of HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:212
+#, c-format
+msgid "Trying to write HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:159
+#, c-format
+msgid "Could not update the extent cache for HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:203
+#, c-format
+msgid "Trying to read HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:214 libparted/fs/hfs/file_plus.c:256
+#, c-format
+msgid "Could not find sector %lli of HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:245
+#, c-format
+msgid "Trying to write HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:225
+msgid "Sorry, HFS cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:255 libparted/fs/hfs/hfs.c:636
+msgid "Data relocation has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:274
+msgid "Data relocation left some data in the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:313
+#, fuzzy
+msgid "writing HFS Master Directory Block"
+msgstr "Erreur d'criture du rpertoire root."
+
+#: libparted/fs/hfs/hfs.c:461
+msgid "No valid HFS[+X] signature has been found while opening."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:471
+#, c-format
+msgid "Version %d of HFS+ isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:482
+#, c-format
+msgid "Version %d of HFSX isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:667
+msgid "Data relocation left some data at the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:715
+#, fuzzy
+msgid "Error while writing the allocation file."
+msgstr "Erreur d'criture du rpertoire root."
+
+#: libparted/fs/hfs/hfs.c:730
+msgid "Error while writing the compatibility part of the allocation file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:745
+msgid "writing HFS+ Volume Header"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:845
+msgid "An error occurred while looking for the mandatory bad blocks file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:899
+msgid ""
+"It seems there is an error in the HFS wrapper: the bad blocks file doesn't "
+"contain the embedded HFS+ volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:930
+msgid "Sorry, HFS+ cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:965
+msgid "shrinking embedded HFS+ volume"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:981
+msgid "Resizing the HFS+ volume has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:988
+#, fuzzy
+msgid "shrinking HFS wrapper"
+msgstr "rduction"
+
+#: libparted/fs/hfs/hfs.c:997
+msgid "Updating the HFS wrapper has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:1099 libparted/fs/hfs/hfs.c:1184
+#, c-format
+msgid ""
+"This is not a real %s check. This is going to extract special low level "
+"files for debugging purposes."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:156
+msgid "Bad block list header checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:169
+#, c-format
+msgid ""
+"Invalid size of a transaction block while replaying the journal (%i bytes)."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:261
+msgid ""
+"Journal stored outside of the volume are not supported. Try to desactivate "
+"the journal and run Parted again."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:272
+#, fuzzy
+msgid "Journal offset or size is not multiple of the sector size."
+msgstr ""
+"Le delta de dpart du cluster = %d lequel n'est pas un multiple de la taille "
+"d'un cluster %d"
+
+#: libparted/fs/hfs/journal.c:290
+msgid "Incorrect magic values in the journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:299
+msgid "Journal size mismatch between journal info block and journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:311
+#, fuzzy
+msgid "Some header fields are not multiple of the sector size."
+msgstr ""
+"Le delta de dpart du cluster = %d lequel n'est pas un multiple de la taille "
+"d'un cluster %d"
+
+#: libparted/fs/hfs/journal.c:320
+msgid ""
+"The sector size stored in the journal is not 512 bytes. Parted only "
+"supports 512 bytes length sectors."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:332
+msgid "Bad journal checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:350
+msgid ""
+"The journal is not empty. Parted must replay the transactions before "
+"opening the file system. This will modify the file system."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:378
+msgid ""
+"The volume header or the master directory block has changed while replaying "
+"the journal. You should restart Parted."
+msgstr ""
+
+#: libparted/fs/hfs/probe.c:52
+#, c-format
+msgid ""
+"Parted can't use HFS file systems on disks with a sector size not equal to %"
+"d bytes."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:153 libparted/fs/hfs/reloc_plus.c:157
+msgid "An extent has not been relocated."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:253 libparted/fs/hfs/reloc_plus.c:309
+msgid ""
+"A reference to an extent comes from a place it should not. You should check "
+"the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:383
+msgid "This HFS volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:477
+msgid "This HFS volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:519 libparted/fs/hfs/reloc_plus.c:670
+msgid ""
+"The extents overflow file should not contain its own extents! You should "
+"check the file system."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:576 libparted/fs/hfs/reloc_plus.c:849
+#, fuzzy
+msgid "Could not cache the file system in memory."
+msgstr "Ne peut dtecter de systmes de fichiers."
+
+#: libparted/fs/hfs/reloc.c:637 libparted/fs/hfs/reloc_plus.c:910
+msgid "Bad blocks list could not be loaded."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:651 libparted/fs/hfs/reloc_plus.c:926
+msgid "An error occurred during extent relocation."
+msgstr ""
+
+#: libparted/fs/hfs/reloc_plus.c:497
+msgid "This HFS+ volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc_plus.c:621
+msgid "This HFS+ volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: parted/parted.c:76
+msgid "displays this help message"
+msgstr "afficher l'aide-mmoire"
+
+#: parted/parted.c:77
+msgid "where necessary, prompts for user intervention"
+msgstr "lorsque ncessaire, demander l'intervention de l'usager"
+
+#: parted/parted.c:78
+msgid "never prompts for user intervention"
+msgstr "ne jamais demande l'intervention de l'usager"
+
+#: parted/parted.c:79
+msgid "displays the version"
+msgstr "afficher la version"
+
+#: parted/parted.c:87
+#, fuzzy
+msgid ""
+"NUMBER is the partition number used by Linux. On MS-DOS disk labels, the "
+"primary partitions number from 1 to 4, logical partitions from 5 onwards.\n"
+msgstr ""
+"MINEURE est le numro de partition utilis par Linux. Avec une tiquette de "
+"disque msdos, les partitions primaires sont numrotes de 1 4 et les "
+"partitions logiques de 5 et plus.\n"
+
+#: parted/parted.c:90
+msgid "LABEL-TYPE is one of: "
+msgstr "TYPE-D-TIQUETTE est un parmi: "
+
+#: parted/parted.c:91
+msgid "FLAG is one of: "
+msgstr "FANION est un parmi: "
+
+#: parted/parted.c:92
+#, fuzzy
+msgid "UNIT is one of: "
+msgstr "FANION est un parmi: "
+
+#: parted/parted.c:93
+msgid "PART-TYPE is one of: primary, logical, extended\n"
+msgstr "PART-TYPE est un parmi: primary, logical, extended\n"
+
+#: parted/parted.c:95
+msgid "FS-TYPE is one of: "
+msgstr "FS-TYPE est un parmi: "
+
+#: parted/parted.c:96
+#, fuzzy
+msgid ""
+"START and END are disk locations, such as 4GB or 10%. Negative values count "
+"from the end of the disk. For example, -1s specifies exactly the last "
+"sector.\n"
+msgstr ""
+"DBUT et FIN sont en mgaoctets. Les valeurs ngatives se dcompte depuis la "
+"fin du disque.\n"
+
+#: parted/parted.c:99
+msgid "STATE is one of: on, off\n"
+msgstr "TAT est un parmi: on, off\n"
+
+#: parted/parted.c:100
+msgid "DEVICE is usually /dev/hda or /dev/sda\n"
+msgstr "PRIPHRIQUE est habituellement du genre /dev/hda ou /dev/sda\n"
+
+#: parted/parted.c:101
+msgid "NAME is any word you want\n"
+msgstr "NOM est un mot de votre choix\n"
+
+#: parted/parted.c:102
+msgid "The partition must have one of the following FS-TYPEs: "
+msgstr ""
+
+#: parted/parted.c:105
+msgid "GNU Parted Version information:\n"
+msgstr ""
+
+#: parted/parted.c:107
+#, fuzzy
+msgid ""
+"Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n"
+"This program is free software, covered by the GNU General Public License.\n"
+"\n"
+"This program is distributed in the hope that it will be useful, but WITHOUT "
+"ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
+"FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
+"more details.\n"
+"\n"
+msgstr ""
+"Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, "
+"Inc.\n"
+"Ce logiciel est libre; couvert selon les termes de la licence GNU General "
+"Public License.\n"
+"Ce programme est distribu dans l'espoir qu'il soit utile,\n"
+"mais AUCUNE garantie n'est donne tant pour des raisons COMMERCIALES que\n"
+"pour RPONDRE UN BESOIN PARTICULIER. Consulter la licence\n"
+"GNU General Public License pour plus de dtails.\n"
+
+#: parted/parted.c:152
+#, c-format
+msgid "%0.f%%\t(time left %.2d:%.2d)"
+msgstr "%0.f%%\t(temps restant %.2d:%.2d)"
+
+#: parted/parted.c:170
+#, c-format
+msgid ""
+"Partition %s is being used. You must unmount it before you modify it with "
+"Parted."
+msgstr ""
+
+#: parted/parted.c:187
+#, c-format
+msgid "Partition(s) on %s are being used."
+msgstr "Les partitions sur %s sont utilises prsentement."
+
+#: parted/parted.c:413 parted/parted.c:594 parted/parted.c:979
+#: parted/parted.c:1059 parted/parted.c:1586 parted/parted.c:1663
+#: parted/parted.c:1707
+msgid "Partition number?"
+msgstr "Numro de partition?"
+
+#: parted/parted.c:456
+msgid "Source device?"
+msgstr "Priphrique source?"
+
+#: parted/parted.c:460
+msgid "Source partition number?"
+msgstr "Numro de la partition source?"
+
+#: parted/parted.c:465
+#, fuzzy
+msgid "Can't copy an extended partition."
+msgstr "Ne peut copier des partitions tendues."
+
+#: parted/parted.c:471
+msgid "Destination partition number?"
+msgstr "Numro de la partition de destination?"
+
+#: parted/parted.c:564
+msgid "New disk label type?"
+msgstr "Nouveau type d'tiquette de disque?"
+
+#: parted/parted.c:598
+msgid "File system?"
+msgstr "Systme de fichiers?"
+
+#: parted/parted.c:645 parted/parted.c:815
+msgid "Partition type?"
+msgstr "Type de partition?"
+
+#: parted/parted.c:652 parted/parted.c:822 parted/parted.c:1062
+msgid "Partition name?"
+msgstr "Nom de la partition?"
+
+#: parted/parted.c:660 parted/parted.c:832
+msgid "File system type?"
+msgstr "Type de systme de fichiers?"
+
+#: parted/parted.c:667 parted/parted.c:834 parted/parted.c:994
+#: parted/parted.c:1544 parted/parted.c:1595
+msgid "Start?"
+msgstr "Dbut?"
+
+#: parted/parted.c:669 parted/parted.c:837 parted/parted.c:997
+#: parted/parted.c:1546 parted/parted.c:1597
+msgid "End?"
+msgstr "Fin?"
+
+#: parted/parted.c:707 parted/parted.c:875
+#, fuzzy, c-format
+msgid ""
+"You requested a partition from %s to %s.\n"
+"The closest location we can manage is %s to %s. Is this still acceptable to "
+"you?"
+msgstr ""
+"Vous avez demander de dplacer une partition %.3f-%.3fMo. Le plus prs que "
+"Parted peut traiter est %.3f-%.3fMo."
+
+#: parted/parted.c:827
+#, fuzzy
+msgid "An extended partition cannot hold a file system. Did you want mkpart?"
+msgstr ""
+"Partitions tendues ne peuvent avoir de systme de fichiers. Voulez-vous "
+"mkpart?"
+
+#: parted/parted.c:985
+#, fuzzy
+msgid "Can't move an extended partition."
+msgstr "Ne peut dplacer des partitions tendues."
+
+#: parted/parted.c:1014
+msgid "Can't move a partition onto itself. Try using resize, perhaps?"
+msgstr ""
+"Ne peut dplacer une partition sur elle-mme. Essayer de modifier la taille, "
+"peut-tre?"
+
+#: parted/parted.c:1158
+#, c-format
+msgid "Minor: %d\n"
+msgstr "Mineur: %d\n"
+
+#: parted/parted.c:1159
+#, fuzzy, c-format
+msgid "Flags: %s\n"
+msgstr "Fanions: "
+
+#: parted/parted.c:1160
+#, c-format
+msgid "File System: %s\n"
+msgstr "Systme de fichiers: %s\n"
+
+#: parted/parted.c:1161
+#, fuzzy, c-format
+msgid "Size: "
+msgstr "Taille: %10.3fMo (%d%%)\n"
+
+#: parted/parted.c:1166
+#, fuzzy, c-format
+msgid "Minimum size: "
+msgstr "Taille minimum: %10.3fMo (%d%%)\n"
+
+#: parted/parted.c:1169
+#, fuzzy, c-format
+msgid "Maximum size: "
+msgstr "Taille maximum: %10.3fMo (%d%%)\n"
+
+#: parted/parted.c:1255
+#, fuzzy, c-format
+msgid "Disk %s: %s\n"
+msgstr "%s %s %s"
+
+#: parted/parted.c:1256
+#, c-format
+msgid "Sector size (logical/physical): %lldB/%lldB\n"
+msgstr ""
+
+#: parted/parted.c:1267
+#, c-format
+msgid "BIOS cylinder,head,sector geometry: %d,%d,%d. Each cylinder is %s.\n"
+msgstr ""
+
+#: parted/parted.c:1273
+#, fuzzy, c-format
+msgid "Partition Table: %s\n"
+msgstr "Nom de la partition?"
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Number"
+msgstr ""
+
+#: parted/parted.c:1284 parted/parted.c:1287
+#, fuzzy
+msgid "Start"
+msgstr "Dbut?"
+
+#: parted/parted.c:1285 parted/parted.c:1288
+#, fuzzy
+msgid "End"
+msgstr "Fin?"
+
+#: parted/parted.c:1288
+#, fuzzy
+msgid "Size"
+msgstr "resize"
+
+#: parted/parted.c:1292
+msgid "Type"
+msgstr ""
+
+#: parted/parted.c:1294
+#, fuzzy
+msgid "File system"
+msgstr "Systme de fichiers?"
+
+#: parted/parted.c:1297
+#, fuzzy
+msgid "Name"
+msgstr "nom "
+
+#: parted/parted.c:1299
+msgid "Flags"
+msgstr "Fanions"
+
+#: parted/parted.c:1352
+msgid "Free Space"
+msgstr ""
+
+#: parted/parted.c:1441
+#, fuzzy, c-format
+msgid ""
+"A %s %s partition was found at %s -> %s. Do you want to add it to the "
+"partition table?"
+msgstr ""
+"La partition %s %s a t trouve %.3fMo -> %.3fMo. Voulez-vous l'ajouter "
+"la table de partition?"
+
+#: parted/parted.c:1479
+msgid "searching for file systems"
+msgstr "recherche du systme de fichiers"
+
+#: parted/parted.c:1684
+msgid "New device?"
+msgstr "Nouveau priphrique?"
+
+#: parted/parted.c:1709
+#, fuzzy
+msgid "Flag to Invert?"
+msgstr "Fanion modifier?"
+
+#: parted/parted.c:1714
+msgid "New state?"
+msgstr "Nouvel tat?"
+
+#: parted/parted.c:1747
+msgid "Unit?"
+msgstr ""
+
+#: parted/parted.c:1896
+msgid "check"
+msgstr "check"
+
+#: parted/parted.c:1899
+#, fuzzy
+msgid ""
+"check NUMBER do a simple check on the file system"
+msgstr ""
+"check MINEURE faire une vrification simple du systme de "
+"fichiers"
+
+#: parted/parted.c:1905
+msgid "cp"
+msgstr "cp"
+
+#: parted/parted.c:1908
+#, fuzzy
+msgid ""
+"cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another "
+"partition"
+msgstr ""
+"cp [PRIPHRIQUE-SOURCE] MINEURE-SOURCE MINEURE-DEST\n"
+" copier le systme de fichiers vers une "
+"autre partition"
+
+#: parted/parted.c:1914
+msgid "help"
+msgstr "help"
+
+#: parted/parted.c:1917
+#, fuzzy
+msgid ""
+"help [COMMAND] prints general help, or help on "
+"COMMAND"
+msgstr ""
+"help [COMMANDE] afficher l'aide gnrale ou de l'aide sur la "
+"COMMANDE"
+
+#: parted/parted.c:1923
+msgid "mklabel"
+msgstr "mklabel"
+
+#: parted/parted.c:1926
+#, fuzzy
+msgid ""
+"mklabel LABEL-TYPE create a new disklabel (partition "
+"table)"
+msgstr ""
+"mklabel LABEL-TYPE crer une nouvelle tiquette de disque (table "
+"de partition)"
+
+#: parted/parted.c:1932
+msgid "mkfs"
+msgstr "mkfs"
+
+#: parted/parted.c:1935
+#, fuzzy
+msgid ""
+"mkfs NUMBER FS-TYPE make a FS-TYPE file system on "
+"partititon NUMBER"
+msgstr ""
+"mkfs MINEURE TYPE-SF crer un systme de fichiers de TYPE-SF sur "
+"la partititon MINEURE"
+
+#: parted/parted.c:1941
+msgid "mkpart"
+msgstr "mkpart"
+
+#: parted/parted.c:1944
+#, fuzzy
+msgid "mkpart PART-TYPE [FS-TYPE] START END make a partition"
+msgstr "mkpart TYPE-PAR [TYPE-SF] DPART FIN crer une partition"
+
+#: parted/parted.c:1950
+msgid ""
+"mkpart makes a partition without creating a new file system on the "
+"partition. FS-TYPE may be specified to set an appropriate partition ID.\n"
+msgstr ""
+"mkpart cre une partition sans crer un nouveau systme de fichiers sur la "
+"partition. Le TYPE-SF doit tre spcifi pour initialiser le type de "
+"partition appropri.\n"
+
+#: parted/parted.c:1955
+msgid "mkpartfs"
+msgstr "mkpartfs"
+
+#: parted/parted.c:1958
+#, fuzzy
+msgid ""
+"mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system"
+msgstr ""
+"mkpartfs TYPE-PAR TYPE-SF DPART FIN crer une partition avec un "
+"systme de fichiers"
+
+#: parted/parted.c:1964
+msgid "move"
+msgstr "move"
+
+#: parted/parted.c:1967
+#, fuzzy
+msgid "move NUMBER START END move partition NUMBER"
+msgstr "move MINEURE DPART FIN dplacer une partition MINEURE"
+
+#: parted/parted.c:1972
+msgid "name"
+msgstr "nom "
+
+#: parted/parted.c:1975
+#, fuzzy
+msgid "name NUMBER NAME name partition NUMBER as NAME"
+msgstr "name MINEURE NOM nommer une partition MINEURE NOM"
+
+#: parted/parted.c:1980
+msgid "print"
+msgstr "print"
+
+#: parted/parted.c:1983
+#, fuzzy
+msgid ""
+"print [free|NUMBER|all] display the partition table, a "
+"partition, or all devices"
+msgstr ""
+"print [MINEUR] afficher la table de partitions ou une "
+"partition"
+
+#: parted/parted.c:1987
+#, fuzzy
+msgid ""
+"Without arguments, print displays the entire partition table. With 'free'\n"
+"argument, information about free space will be displayed otherwise if a\n"
+"partition number is given, then more detailed information is displayed\n"
+"about that partition. If the 'all' argument is passed instead, partition\n"
+"information for all devices will be displayed."
+msgstr ""
+"Sasn argument, afficher la table complte de partitions. Si un numro\n"
+"de partition est fourni alors afficher des informations dtailles "
+"supplmantaires\n"
+" propos de cette partition.\n"
+
+#: parted/parted.c:1995
+msgid "quit"
+msgstr "quit"
+
+#: parted/parted.c:1998
+#, fuzzy
+msgid "quit exit program"
+msgstr "quit terminer le programme"
+
+#: parted/parted.c:2003
+msgid "rescue"
+msgstr "rescue"
+
+#: parted/parted.c:2006
+#, fuzzy
+msgid ""
+"rescue START END rescue a lost partition near START "
+"and END"
+msgstr ""
+"rescue DPART FIN restaurer les partitions perdues entre DPART "
+"et FIN"
+
+#: parted/parted.c:2012
+msgid "resize"
+msgstr "resize"
+
+#: parted/parted.c:2015
+#, fuzzy
+msgid ""
+"resize NUMBER START END resize partition NUMBER and its "
+"file system"
+msgstr ""
+"resize MINEURE DPART FIN modifier la taille du systme de fichiers "
+"MINEURE"
+
+#: parted/parted.c:2023
+msgid "rm"
+msgstr "rm"
+
+#: parted/parted.c:2026
+#, fuzzy
+msgid "rm NUMBER delete partition NUMBER"
+msgstr "rm MINEURE dtruire la partition MINEURE"
+
+#: parted/parted.c:2031
+msgid "select"
+msgstr "select"
+
+#: parted/parted.c:2034
+#, fuzzy
+msgid "select DEVICE choose the device to edit"
+msgstr "select PRIPHRIQUE slectionner le priphrique diter"
+
+#: parted/parted.c:2039
+msgid "set"
+msgstr "set"
+
+#: parted/parted.c:2042
+#, fuzzy
+msgid ""
+"set NUMBER FLAG STATE change the FLAG on partition NUMBER"
+msgstr "rm MINEURE dtruire la partition MINEURE"
+
+#: parted/parted.c:2048
+msgid "toggle"
+msgstr ""
+
+#: parted/parted.c:2051
+#, fuzzy
+msgid ""
+"toggle [NUMBER [FLAG]] toggle the state of FLAG on "
+"partition NUMBER"
+msgstr "rm MINEURE dtruire la partition MINEURE"
+
+#: parted/parted.c:2057
+#, fuzzy
+msgid "unit"
+msgstr "quit"
+
+#: parted/parted.c:2060
+#, fuzzy
+msgid "unit UNIT set the default unit to UNIT"
+msgstr "quit terminer le programme"
+
+#: parted/parted.c:2065
+msgid "version"
+msgstr ""
+
+#: parted/parted.c:2068
+msgid ""
+"version displays the current version of GNU "
+"Parted and copyright information"
+msgstr ""
+
+#: parted/parted.c:2072
+msgid ""
+"version displays copyright and version information corressponding to this "
+"copy of GNU Parted\n"
+msgstr ""
+
+#: parted/parted.c:2158
+msgid "No device found"
+msgstr "Aucun priphrique repr"
+
+#: parted/parted.c:2222
+msgid "Don't forget to update /etc/fstab, if necessary.\n"
+msgstr "Ne pas oublier de mettre jour /etc/fstab si ncessaire.\n"
+
+#: parted/ui.c:68
+msgid "Welcome to GNU Parted! Type 'help' to view a list of commands.\n"
+msgstr ""
+
+#: parted/ui.c:71
+#, fuzzy
+msgid ""
+"Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]\n"
+"Apply COMMANDs with PARAMETERS to DEVICE. If no COMMAND(s) are given, run "
+"in\n"
+"interactive mode.\n"
+msgstr ""
+"Usage: parted [OPTION]... [PRIPHRIQUE [COMMANDE [PARAMTRES]...]...]\n"
+"Appliquer les COMMANDES avec les PARAMTRES au PRIPHRIQUE. Si aucune "
+"COMMANDE n'est fournie\n"
+"l'excution se fait en mode intractif.\n"
+
+#: parted/ui.c:76
+#, c-format
+msgid ""
+"\n"
+"\n"
+"You found a bug in GNU Parted! Here's what you have to do:\n"
+"\n"
+"Don't panic! The bug has most likely not affected any of your data.\n"
+"Help us to fix this bug by doing the following:\n"
+"\n"
+"Check whether the bug has already been fixed by checking\n"
+"the last version of GNU Parted that you can find at:\n"
+"\n"
+"\thttp://ftp.gnu.org/gnu/parted/\n"
+"\n"
+"Please check this version prior to bug reporting.\n"
+"\n"
+"If this has not been fixed yet or if you don't know how to check,\n"
+"please visit the GNU Parted website:\n"
+"\n"
+"\thttp://www.gnu.org/software/parted\n"
+"\n"
+"for further information.\n"
+"\n"
+"Your report should contain the version of this release (%s)\n"
+"along with the error message below, the output of\n"
+"\n"
+"\tparted DEVICE unit co print unit s print\n"
+"\n"
+"and additional information about your setup you consider important.\n"
+msgstr ""
+
+#: parted/ui.c:230
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_MAPERR (Address not mapped to object)"
+msgstr ""
+
+#: parted/ui.c:235
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_ACCERR (Invalid permissions for mapped object)"
+msgstr ""
+
+#: parted/ui.c:240
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGSEGV signal was encountered."
+msgstr ""
+
+#: parted/ui.c:258
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTDIV (Integer: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:262
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTOVF (Integer: overflow)"
+msgstr ""
+
+#: parted/ui.c:266
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTDIV (Float: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:270
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTOVF (Float: overflow)"
+msgstr ""
+
+#: parted/ui.c:274
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTUND (Float: underflow)"
+msgstr ""
+
+#: parted/ui.c:278
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTRES (Float: inexact result)"
+msgstr ""
+
+#: parted/ui.c:282
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTINV (Float: invalid operation)"
+msgstr ""
+
+#: parted/ui.c:286
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTSUB (Float: subscript out of range)"
+msgstr ""
+
+#: parted/ui.c:291
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGFPE signal was encountered."
+msgstr ""
+
+#: parted/ui.c:310
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPC (Illegal Opcode)"
+msgstr ""
+
+#: parted/ui.c:314
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPN (Illegal Operand)"
+msgstr ""
+
+#: parted/ui.c:318
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLADR (Illegal addressing mode)"
+msgstr ""
+
+#: parted/ui.c:323
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLTRP (Illegal Trap)"
+msgstr ""
+
+#: parted/ui.c:327
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVOPC (Privileged Opcode)"
+msgstr ""
+
+#: parted/ui.c:331
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVREG (Privileged Register)"
+msgstr ""
+
+#: parted/ui.c:335
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_COPROC (Coprocessor Error)"
+msgstr ""
+
+#: parted/ui.c:339
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_BADSTK (Internal Stack Error)"
+msgstr ""
+
+#: parted/ui.c:343
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGILL signal was encountered."
+msgstr ""
+
+#: parted/ui.c:828
+msgid "Expecting a partition number."
+msgstr "Numro de partition attendu."
+
+#: parted/ui.c:837
+msgid "Partition doesn't exist."
+msgstr "La partition n'existe pas."
+
+#: parted/ui.c:857
+msgid "Expecting a file system type."
+msgstr "Type de systme de fichiers attendu."
+
+#: parted/ui.c:863
+#, c-format
+msgid "Unknown file system type \"%s\"."
+msgstr "Type inconnu de systme de fichiers \"%s\"."
+
+#: parted/ui.c:883
+msgid "Expecting a disk label type."
+msgstr "Type d'tiquette de disque attendu."
+
+#: parted/ui.c:977
+msgid "Can't create any more partitions."
+msgstr "Ne peut ajouter une autre partition de plus."
+
+#: parted/ui.c:987
+msgid "Expecting a partition type."
+msgstr "Type attendu de partition."
+
+#: parted/ui.c:1115
+msgid "on"
+msgstr "on"
+
+#: parted/ui.c:1116
+msgid "off"
+msgstr "off"
+
+#: parted/ui.c:1227
+msgid "OPTIONs:"
+msgstr "OPTIONS:"
+
+#: parted/ui.c:1230
+msgid "COMMANDs:"
+msgstr "COMMANDES:"
+
+#: parted/ui.c:1238
+#, c-format
+msgid "Using %s\n"
+msgstr "On utilise %s\n"
+
+#, fuzzy
+#~ msgid ""
+#~ "This ext2 file system has a rather strange layout! Parted can't resize "
+#~ "this (yet)."
+#~ msgstr ""
+#~ "Le systme de fichiers ext2 a une trange disposition! Parted ne peut "
+#~ "corriger la taille (par encore)."
+
+#~ msgid "IDE"
+#~ msgstr "IDE"
+
+#, fuzzy
+#~ msgid "Disk geometry for %s: %s - %s\n"
+#~ msgstr "Gomtrie du disque pour %s: 0.000-%.3f mgaoctets\n"
+
+#~ msgid "Disk label type: %s\n"
+#~ msgstr "Type d'tiquette de disque: %s\n"
+
+#, fuzzy
+#~ msgid "set NUMBER FLAG STATE change a flag on partition NUMBER"
+#~ msgstr ""
+#~ "set MINEURE FANION TAT modifier le FANION sur la partition MINEURE"
+
+#, fuzzy
+#~ msgid ""
+#~ "The sector size on %s is %d bytes. Parted is known not to work properly "
+#~ "with drives with sector sizes other than %d bytes."
+#~ msgstr ""
+#~ "La taille de secteurs sur %s est de %d octets. Parted est reconnu pour "
+#~ "ne pas fonctionner correctement avec des priphriques dont la taille des "
+#~ "secteurs est diffrente de %d octets."
+
+#~ msgid ""
+#~ "You found a bug in GNU Parted. Please email a bug report to bug-"
+#~ "parted@gnu.org containing the version (%s), and the following message:\n"
+#~ msgstr ""
+#~ "Vous avez trouv une anomalie dans GNU Parted. SVP rapporter celle-ci "
+#~ "bug-parted@gnu.org en donnant la version (%s) et le message qui suit:\n"
+
+#, fuzzy
+#~ msgid ""
+#~ "You requested to create a partition at %s - %s. The closest Parted can "
+#~ "manage is %s - %s."
+#~ msgstr ""
+#~ "Vous avez demander de crer une partition %.3f-%.3fMo. Le plus prs que "
+#~ "Parted peut traiter est %.3f-%.3fMo."
+
+#, fuzzy
+#~ msgid ""
+#~ "You requested to resize the partition to %s - %s. The closest Parted can "
+#~ "manage is %s - %s."
+#~ msgstr ""
+#~ "Vous avez demander de modifier la taille de la partition %.3f-%.3fMo. "
+#~ "Le plus prs que Parted peut traiter est %.3f-%.3fMo."
+
+#~ msgid "SCSI"
+#~ msgstr "SCSI"
+
+#~ msgid "File system has an invalid signature for a FAT file systems."
+#~ msgstr ""
+#~ "Le systme de fichiers a une signature invalide pour des systmes de "
+#~ "fichiers FAT."
+
+#~ msgid "Minor Start End "
+#~ msgstr "Mineur Dpart Fin "
+
+#~ msgid "Type "
+#~ msgstr "Type "
+
+#~ msgid "Filesystem "
+#~ msgstr "Sys.fichiers"
+
+#~ msgid "Name "
+#~ msgstr "Nom "
+
+#~ msgid "Device %s is neither a SCSI nor IDE drive."
+#~ msgstr "Le priphrique %s n'est ni un disque SCSI ni un disque IDE."
+
+#~ msgid "Error reading %s (%s) to determine if partition is mounted."
+#~ msgstr ""
+#~ "Erreur de lecture %s (%s) afin de dterminer si la partition est monte."
+
+#~ msgid ""
+#~ "Unable to determine if partitions are mounted via /proc/mounts or /etc/"
+#~ "mtab. Make sure you don't attempt to resize or modify mounted file "
+#~ "systems. (Even read-only mounted)"
+#~ msgstr ""
+#~ "Incapable de dterminer si des partitions sont montes via /proc/mounts "
+#~ "ou /etc/mtab. Assurez-vous de ne pas tenter de modifier la taille ou de "
+#~ "modifier le systme de fichiers (mme ceux qui sont monts en lecture "
+#~ "seulement)"
+
+#~ msgid ""
+#~ "Partition %s is being used. Modifying it while it is in use could cause "
+#~ "severe corruption."
+#~ msgstr ""
+#~ "Partitiion %s est utilise. La modifier alors qu'elle est en usage peut "
+#~ "provoquer un problme svre de corruption."
+
+#~ msgid "Could not read geometry of %s - %s."
+#~ msgstr "Ne peut lire la gomtrie de %s - %s."
+
+#~ msgid "Device %s has dodgey geometry."
+#~ msgstr "Le priphrique %s une gomtrie douteuse."
+
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. However, the most likely reason is that Linux "
+#~ "detected the BIOS geometry for %s incorrectly. GNU Parted suspects the "
+#~ "real geometry should be %d/%d/%d (not %d/%d/%d). You should check with "
+#~ "your BIOS first, as this may not be correct. You can inform Linux by "
+#~ "adding the parameter %s=%d,%d,%d to the command line. See the LILO or "
+#~ "GRUB documentation for more information. If you think Parted's suggested "
+#~ "geometry is correct, you may select Ignore to continue (and fix Linux "
+#~ "later). Otherwise, select Cancel (and fix Linux and/or the BIOS now)."
+#~ msgstr ""
+#~ "La table de partition sur %s est inconsistente. Il y a plusieurs raisons "
+#~ "pouvant expliquer ce cas. Cependant, la raison la plus probable est que "
+#~ "Linux a dtect incorrectement la gomtrie du BIOS pour %s. GNU parted "
+#~ "suspecte que la vraie gomtrie devrait tre %d/%d/%d (not %d/%d/%d). "
+#~ "Vous devriez vrifier celle du BIOS d'abord puisque celle-ci peut ne pas "
+#~ "tre correcte. Vous pouvez informer Linux en fournissant le paramtre %"
+#~ "s=%d,%d,%d sur la ligne de commande. Consulter la documentation de LILO "
+#~ "ou de GRUB pour plus de dtails. Si vous pensez que la gomtrie suggre "
+#~ "par Parted est correcte, vous pouvez slectionner ignore pour "
+#~ "poursuivre (et corriger plus tard avec Linux). Autrement, slectionner "
+#~ "Cancel (et corriger Linux et/ou le BIOS maintenant)."
+
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. Often, the reason is that Linux detected the "
+#~ "BIOS geometry incorrectly. However, this does not appear to be the case "
+#~ "here. It is safe to ignore,but ignoring may cause (fixable) problems "
+#~ "with some boot loaders, and may cause problems with FAT file systems. "
+#~ "Using LBA is recommended."
+#~ msgstr ""
+#~ "La table de partition sur %s est inconsistente. Il existe plusieurs "
+#~ "raisons expliquant ce cas. Souvent la raison est que Linux a dtect une "
+#~ "gomtrie du BIOS incorrecte. Cependant cela ne semble pas tre le cas "
+#~ "ici. Il est scuritaire de l'ignorer mais l'ignorer pourrait causer "
+#~ "certains problmes (corrigeables) avec certains chargeurs d'amorce et les "
+#~ "systmes de fichiers FAT. L'utilisation de LBA est recommande."
+
+#~ msgid ""
+#~ "Unable to align partition properly. This probably means that another "
+#~ "partitioning tool generated an incorrect partition table, because it "
+#~ "didn't have the correct BIOS geometry. It is safe to ignore,but ignoring "
+#~ "may cause (fixable) problems with some boot loaders."
+#~ msgstr ""
+#~ "Incapablle d'aligner la partition correctement. Ceci indique probablement "
+#~ "qu'un autre outil de partionnage a fabriqu une table de partition "
+#~ "incorrecte, parce qu'il n'utilisait pas la bonne gomtrie du BIOS. Il "
+#~ "est prudent de l'ignorer mais l'ignorer peut causer des problmes "
+#~ "(corrigeables) avec quelques chargeurs d'amorce."
+
+#~ msgid ""
+#~ " You have Windows FAT partition(s) that are not using LBA. If your BIOS "
+#~ "supports LBA, then you should switch to LBA by setting the LBA flag on "
+#~ "all FAT partitions. Otherwise, make sure the operating system and the "
+#~ "BIOS have the same geometry before resizing any FAT partitions."
+#~ msgstr ""
+#~ " Vous avez des partitions FAT Windows qui n'utilise pas LBA. Si le BIOS "
+#~ "supporte LBA alors vous devriez slectionner LBA en l'activant pour "
+#~ "toutes les partitions FAT. Autrement assurez-vous que le systeme "
+#~ "d'exploitation et le BIOS ont la mme gomtrie avant de modifier la "
+#~ "taille de n'importe quelle partition FAT."
+
+#~ msgid ""
+#~ "The operating system thinks the geometry on %s is %d/%d/%d. Therefore, "
+#~ "cylinder 1024 ends at %.3fM.%s"
+#~ msgstr ""
+#~ "Le systme d'exploitation croit que le gomtrie sur %s est %d/%d/%d. "
+#~ "Par consquent le cylindre 1024 se termine %.3fM.%s"
+
+#~ msgid "The operating system thinks the geometry on %s is %d/%d/%d.%s"
+#~ msgstr ""
+#~ "Le systme d'exploitation croit que le gomtrie sur %s est %d/%d/%d.%s"
+
+#~ msgid "START and END are in megabytes\n"
+#~ msgstr "DBUT et FIN sont en mgaoctets\n"
+
+#~ msgid "Partition %s is being used."
+#~ msgstr "La partition %s est dj utilise."
+
+#~ msgid ""
+#~ "The FATs aren't big enough to describe all clusters! Each FAT is %d "
+#~ "sectors. There are %d clusters, which would require each FAT to be %d "
+#~ "sectors. This is REALLY weird. You might want to write us an email: bug-"
+#~ "parted@gnu.org"
+#~ msgstr ""
+#~ "Les FAT ne sont pas assez grandes pour dcrire tous les clusters! Chaque "
+#~ "FAT a %d secteurs. Il y a %d clusters lesquels ncessiteront que chaque "
+#~ "FAT ait %d secteurs. Cela est vraiment bizarre. Vous pouvez nous crire: "
+#~ "bug-parted@gnu.org"
+
+#~ msgid ""
+#~ "This swap partition is not compatible with Linux version 2.1.117 or "
+#~ "earlier. Use a smaller partition (maximum size 128mb) if you want to use "
+#~ "old versions of Linux."
+#~ msgstr ""
+#~ "Cette partition swap n'est pas compatible avec la version 2.1.117 de "
+#~ "Linux (ou prcdente). Utiliser une partition de plus petite taille "
+#~ "(taille maximum 128Mo) si vous dzirez utiliser une version plus "
+#~ "anciennce de LInux"
+
+#~ msgid ""
+#~ "The new partition overlaps with another partition so badly that it isn't "
+#~ "obvious want you want!"
+#~ msgstr ""
+#~ "La nouvelle partition en chevauche une autre tellement qu'il est "
+#~ "difficile de savoir ce que vous dsirez!."
+
+#~ msgid ""
+#~ "Can't resize an extended partition so as to exclude a logical partition."
+#~ msgstr ""
+#~ "Ne peut modifier la taille d'une partition tendue pouvant exclure une "
+#~ "partition logique."
+
+#~ msgid "Can't grow a partition onto used space."
+#~ msgstr "Ne peut accrotre une partition sur de l'espace utilis."
+
+#~ msgid "unknown"
+#~ msgstr "inconnu"
+
+#~ msgid "Unknown SCSI"
+#~ msgstr "SCSI inconnu"
+
+#~ msgid "GUID Partition Table Header Signature is wrong: "
+#~ msgstr "Signature errone de l'en-tte de la table de partition GUID: "
+
+#~ msgid " should be "
+#~ msgstr " devrait tre "
+
+#~ msgid "GPT Header CRC check failed, %x should be %x."
+#~ msgstr "Erreur de vrification du CRC de l'en-tte GPT, %x devrait tre %x."
+
+#~ msgid "GPT Partition Entry Array CRC check failed, %x should be %x."
+#~ msgstr ""
+#~ "Erreur de vrification du CRC de l'entre de la partition GPT, %x devrait "
+#~ "tre %x."
+
+#~ msgid ""
+#~ "This disk contains a valid Primary and Alternate GUID Partition Table but "
+#~ "the Protective MBR is invalid. This generally means that the disk had "
+#~ "GPT partitions on it, but then a legacy partition editing tool was used "
+#~ "to change the partition table stored in the MBR.\n"
+#~ "Which data is valid, GPT or MBR?\n"
+#~ "Yes will assume that the GPT information is correct, and rewrite the "
+#~ "PMBR.\n"
+#~ "No will assume that the MBR is correct, and erase the GPT information.\n"
+#~ "Ignore will assume that the MBR is correct, but not change the disk."
+#~ msgstr ""
+#~ "Ce disque contient une table de partitions Primaire et Alternative GUID "
+#~ "valides mais le MBR Protectif est invalide. Cela signifie gnralement "
+#~ "que le disque contient des partitions GPT mais que le logiciel d'dition "
+#~ "de partitions 'legacy' a t utilis pour modifier la table de partitions "
+#~ "stock dans le MBR.\n"
+#~ "Lequel est valide GPT ou MBR?\n"
+#~ "La rponse Yes (oui) indique que l'on assume que l'information de type "
+#~ "GPT est correcte et rcrira le PMBR.\n"
+#~ "La rponse No (non) indique que l'on assume que l'information de type MBR "
+#~ "est correcte et effacera l'information GPT\n"
+#~ "La rponse Ignore (ignorez) indique que l'on assume que l'information de "
+#~ "type MBR est correcte mais aucun changement ne sera apport au disque."
+
+#~ msgid ""
+#~ "This disk contains a valid Alternate GUID Partition Table but the Primary "
+#~ "GPT and Protective MBR are invalid. This generally means that the disk "
+#~ "had GPT partitions on it, but then a legacy partition editing tool was "
+#~ "used to change the partition table stored in the MBR.\n"
+#~ "Which data is valid, GPT or MBR?\n"
+#~ "Yes will assume that the GPT information is correct, and will rewrite the "
+#~ "PMBR and Primary GPT.\n"
+#~ "No will assume that the MBR is correct, and erase the GPT information.\n"
+#~ "Ignore will assume that the MBR is correct, but not change the disk."
+#~ msgstr ""
+#~ "Ce disque contient une table de partition Alternate GUID valide mais la "
+#~ "partition primaire GPT et Protective MBR sont invalides. Cela signifie "
+#~ "gnralement que le disque contient des partitions GPT mais que le "
+#~ "logiciel d'dition de partitions 'legacy' a t utilis pour modifier la "
+#~ "table de partitions stock dans le MBR.\n"
+#~ "Lequel est valide GPT ou MBR?\n"
+#~ "La rponse Yes (oui) indique que l'on assume que l'information de type "
+#~ "GPT est correcte et rcrira le PMBR et la partition primaire GPT.\n"
+#~ "La rponse No (non) indique que l'on assume que l'information de type MBR "
+#~ "est correcte et effacera l'information GPT\n"
+#~ "La rponse Ignore (ignorez) indique que l'on assume que l'information de "
+#~ "type MBR est correcte mais aucun changement ne sera apport au disque."
+
+#~ msgid ""
+#~ "This disk contains a valid Primary GUID Partition Table but the Alternate "
+#~ "GPT and Protective MBR are invalid. This generally means that the disk "
+#~ "had GPT partitions on it, but then a legacy partition editing tool was "
+#~ "used to change the partition table stored in the MBR.\n"
+#~ "Which data is valid, GPT or MBR?\n"
+#~ "Yes will assume that the GPT information is correct, and will rewrite the "
+#~ "PMBR and Alternate GPT.\n"
+#~ "No will assume that the MBR is correct, and erase the GPT information.\n"
+#~ "Ignore will assume that the MBR is correct, but not change the disk.\n"
+#~ msgstr ""
+#~ "Ce disque contient une table de partition primaire GUID valide mais la "
+#~ "partition alternative GPT et protective MBR sont invalides. Cela signifie "
+#~ "gnralement que le disque contient des partitions GPT mais que le "
+#~ "logiciel d'dition de partitions 'legacy' a t utilis pour modifier la "
+#~ "table de partitions stock dans le MBR.\n"
+#~ "Lequel est valide GPT ou MBR?\n"
+#~ "La rponse Yes (oui) indique que l'on assume que l'information de type "
+#~ "GPT est correcte et rcrira le PMBR et la partition alternative GPT.\n"
+#~ "La rponse No (non) indique que l'on assume que l'information de type MBR "
+#~ "est correcte et effacera l'information GPT\n"
+#~ "La rponse Ignore (ignorez) indique que l'on assume que l'information de "
+#~ "type MBR est correcte mais aucun changement ne sera apport au disque.\n"
+
+#~ msgid "Can't set non-Linux partitions as a root device."
+#~ msgstr "Ne peut dfinir des partitions non-Linux pour un priphrique root"
+
+#~ msgid "Can't set non-Linux partitions as a swap device."
+#~ msgstr ""
+#~ "Ne peut dfinir des partitions non-Linux pour un priphrique pour le swap"
+
+#~ msgid "No get_resize_constraint for %s!"
+#~ msgstr "Aucun get_resize_constraint pour %s!"
+
+#~ msgid "The %s file system code doesn't support %s disk labels."
+#~ msgstr ""
+#~ "Le code du systme de fichier %s ne supporte par les tiquettes de disque "
+#~ "%s"
+
+#~ msgid "Creating new %s disklabels is not implemented yet."
+#~ msgstr ""
+#~ "La cration d'une nouvelle tiquette pour le systme de fichiers %s n'est "
+#~ "pas encore implant."
+
+#~ msgid "The code to write the partition table hasn't been written for %s yet"
+#~ msgstr ""
+#~ "Le code pour crire la table de partition n'a pas encore t crit pour %s"
+
+#~ msgid "Insane! %d clusters!"
+#~ msgstr "Insens! %d clusters!"
+
+#~ msgid ""
+#~ "The filesystem is going to be too big for FAT16, so FAT32 will be used. "
+#~ "This is not compatible with MS-DOS, early versions of MS-Windows 95 and "
+#~ "Windows NT. If you use these operating systems, then select cancel, and "
+#~ "create a smaller partition. If you only use Linux, BSD, MS Windows 98 "
+#~ "and/or MS Windows 95 B, then select OK."
+#~ msgstr ""
+#~ "Le systme de fichiers sera trop gros pour FAT16, aussi FAT32 sera "
+#~ "utilis. Il n'est pas compatible avec MS-DOS et les premires versions de "
+#~ "MS-Windows 95 et Windows NT. Si vous utilisez ces systmes d'exploitation "
+#~ "alors slectionne 'annuler' (cancel) et crer une partition plus petite. "
+#~ "Si vous utilisez seulement Linux, BSD, MS Windows 98 et/ou MS Windows 95 "
+#~ "B alors slectionner 'OK'."
+
+#~ msgid "Weird: fat_calc_sizes() failed for FAT32!"
+#~ msgstr "Bizarre: fat_calc_sizes() a chou pour un FAT32!"
+
+#~ msgid ""
+#~ "Would you like to use FAT32 for this filesystem? It is much more "
+#~ "efficient with your disk space, but is not compatible with early versions "
+#~ "of Windows 95 and Windows NT. Only select yes if you only use Linux, "
+#~ "BSD, MS Windows 98 and/or MS Windows 95 B."
+#~ msgstr ""
+#~ "Prfrez-vous utiliser FAT32 pour ce systme de fichiers? C'est plus "
+#~ "efficient avec votre espace disque mais non compatible avec les premires "
+#~ "version de Windows 95 et Windows NT. Slectionner seulement si vous "
+#~ "utiliser Linux, BSD, MS Windows 98 et/ou MS Windows 95 B."
+
+#~ msgid ""
+#~ "File system doesn't have expected sizes for Windows to like it. Number "
+#~ "of clusters is %d (%d expected); size of FATs is %d sectors (%d expected)."
+#~ msgstr ""
+#~ "Le systme de fichiers n'tait pas prvu pour des tailles compatibles "
+#~ "pour Windows. Le nombre de clusters est %d (%d attendu). La taille des "
+#~ "FAT est de %d secteurs (%d attendu)"
+
+#~ msgid ""
+#~ "Partition size (%ld sectors) and filesystem size (%ld sectors) do not "
+#~ "match."
+#~ msgstr ""
+#~ "La taille de partition (%ld secteurs) et la taille du systme de fichiers "
+#~ "(%ld secteurs) ne concordent pas."
+
+#~ msgid "Linux-swap partitions can not be hidden on msdos disk labels."
+#~ msgstr ""
+#~ "Les partitions Linux-swap ne peuvent tre caches pour une tiquette de "
+#~ "disque msdos."
+
+#~ msgid "Linux-swap partitions can not be bootable on pc98 disk labels."
+#~ msgstr ""
+#~ "Les partitions Linux-swap ne peuvent tre amorables pour une tiquette "
+#~ "de disque pc98."
+
+#~ msgid "HFS partitions can't be hidden on msdos disk labels."
+#~ msgstr ""
+#~ "Les partitions HFS ne peuvent tre caches pour une tiquette de disque "
+#~ "msdos."
+
+#~ msgid "JFS partitions can't be hidden on msdos disk labels."
+#~ msgstr ""
+#~ "Les partitions JFS ne peuvent tre caches pour une tiquette de disque "
+#~ "msdos."
+
+#~ msgid "Reiserfs partitions can't be hidden on msdos disk labels."
+#~ msgstr ""
+#~ "Les partitions Reiserfs ne peuvent tre caches pour une tiquette de "
+#~ "disque msdos."
+
+#~ msgid "Reiserfs partitions must be bootable on pc98 disk labels."
+#~ msgstr ""
+#~ "Les partitions Reiserfs doivent tre amorables pour une tiquette de "
+#~ "disque pc98."
+
+#~ msgid "XFS partitions can't be hidden on msdos disk labels."
+#~ msgstr ""
+#~ "Les partitions XFS ne peuvent tre caches pour une tiquette de disque "
+#~ "msdos."
diff --git a/po/gl.po b/po/gl.po
new file mode 100644
index 0000000..0d12db1
--- /dev/null
+++ b/po/gl.po
@@ -0,0 +1,2901 @@
+# Galician translation of GNU parted
+# Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+# Jacobo Tarro Barreiro <jtarrio@trasno.net>, 2000, 2001, 2002.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: parted 1.6.4-pre2\n"
+"Report-Msgid-Bugs-To: bug-parted@gnu.org\n"
+"POT-Creation-Date: 2006-04-21 21:20+0200\n"
+"PO-Revision-Date: 2002-12-07 01:30+0100\n"
+"Last-Translator: Jacobo Tarro Barreiro <jtarrio@trasno.net>\n"
+"Language-Team: Galician <gpul-traduccion@ceu.fi.udc.es>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=iso-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: libparted/arch/linux.c:284
+#, c-format
+msgid "Could not stat device %s - %s."
+msgstr "Non se puido facer \"stat\" sobre o dispositivo %s - %s."
+
+#: libparted/arch/linux.c:390
+#, c-format
+msgid ""
+"Could not determine sector size for %s: %s.\n"
+"Using the default sector size (%lld)."
+msgstr ""
+
+#: libparted/arch/linux.c:401
+#, c-format
+msgid ""
+"Device %s has a logical sector size of %lld. Not all parts of GNU Parted "
+"support this at the moment, and the working code is HIGHLY EXPERIMENTAL.\n"
+msgstr ""
+
+#: libparted/arch/linux.c:441
+#, fuzzy, c-format
+msgid "Unable to determine the size of %s (%s)."
+msgstr "Non se puido determina-lo tamao de %s (%s)"
+
+#: libparted/arch/linux.c:530
+#, c-format
+msgid "Could not get identity of device %s - %s"
+msgstr "Non se puido obte-la identidade do dispositivo %s - %s"
+
+#: libparted/arch/linux.c:539
+msgid "Generic IDE"
+msgstr ""
+
+#: libparted/arch/linux.c:556
+#, c-format
+msgid ""
+"Device %s has multiple (%d) logical sectors per physical sector.\n"
+"GNU Parted supports this EXPERIMENTALLY for some special disk label/file "
+"system combinations, e.g. GPT and ext2/3.\n"
+"Please consult the web site for up-to-date information."
+msgstr ""
+
+#: libparted/arch/linux.c:726
+#, c-format
+msgid "Error initialising SCSI device %s - %s"
+msgstr "Erro ao inicializa-lo dispositivo SCSI %s - %s"
+
+#: libparted/arch/linux.c:781
+#, fuzzy, c-format
+msgid ""
+"The device %s has zero length, and can't possibly store a file system or "
+"partition table. Perhaps you selected the wrong device?"
+msgstr ""
+"O dispositivo %s ten lonxitude cero, e non pode armacenar un sistema de "
+"ficheiros ou tboa de particins. Non seleccionara un dispositivo "
+"equivocado?"
+
+#: libparted/arch/linux.c:829
+msgid ""
+"Unable to determine geometry of file/device. You should not use Parted "
+"unless you REALLY know what you're doing!"
+msgstr ""
+"Non se puido determina-la xeometra do ficheiro/dispositivo. Non debera "
+"usar Parted se non sabe DE VERDADE o que est a facer!"
+
+#: libparted/arch/linux.c:903
+msgid "DAC960 RAID controller"
+msgstr "Controladora RAID DAC960"
+
+#: libparted/arch/linux.c:908
+msgid "Compaq Smart Array"
+msgstr "Compaq Smart Array"
+
+#: libparted/arch/linux.c:913
+msgid "ATARAID Controller"
+msgstr "Controladora ATARAID"
+
+#: libparted/arch/linux.c:918
+msgid "I2O Controller"
+msgstr "Controladora I2O"
+
+#: libparted/arch/linux.c:923
+msgid "User-Mode Linux UBD"
+msgstr ""
+
+#: libparted/arch/linux.c:933
+msgid "Unknown"
+msgstr "Descoecido"
+
+#: libparted/arch/linux.c:940
+msgid "ped_device_new() Unsupported device type"
+msgstr "ped_device_new() Tipo de dispositivo non soportado"
+
+#: libparted/arch/linux.c:1041 libparted/arch/gnu.c:264
+#, c-format
+msgid "Error opening %s: %s"
+msgstr "Erro ao abrir %s: %s"
+
+#: libparted/arch/linux.c:1052 libparted/arch/gnu.c:274
+#, c-format
+msgid "Unable to open %s read-write (%s). %s has been opened read-only."
+msgstr ""
+"Non se puido abrir %s para lectura-escritura (%s). Abriuse %s para s "
+"lectura."
+
+#: libparted/arch/linux.c:1160 libparted/arch/linux.c:1228
+#: libparted/arch/gnu.c:452 libparted/arch/gnu.c:550 libparted/arch/gnu.c:678
+#, c-format
+msgid "%s during read on %s"
+msgstr "%s durante a lectura en %s"
+
+#: libparted/arch/linux.c:1199
+#, c-format
+msgid "%s during seek for read on %s"
+msgstr "%s mentres se a posicin da que ler en %s"
+
+#: libparted/arch/linux.c:1270 libparted/arch/linux.c:1355
+#: libparted/arch/linux.c:1413 libparted/arch/gnu.c:587
+#: libparted/arch/gnu.c:632 libparted/arch/gnu.c:709
+#, c-format
+msgid "%s during write on %s"
+msgstr "%s durante a escritura en %s"
+
+#: libparted/arch/linux.c:1297 libparted/arch/gnu.c:512
+#, c-format
+msgid "Can't write to %s, because it is opened read-only."
+msgstr "Non se puido escribir en %s, porque est aberto para s lectura."
+
+#: libparted/arch/linux.c:1321
+#, c-format
+msgid "%s during seek for write on %s"
+msgstr "%s mentres se a posicin na que escribir en %s"
+
+#: libparted/arch/linux.c:1798
+#, fuzzy, c-format
+msgid ""
+"Error informing the kernel about modifications to partition %s -- %s. This "
+"means Linux won't know about any changes you made to %s until you reboot -- "
+"so you shouldn't mount it or use it in any way before rebooting."
+msgstr ""
+"Erro ao informar ao ncleo sobre as modificacins feitas na particin %s - %"
+"s. Isto quere dicir que Linux non ha saber nada dos cambios que lle fixo a %"
+"s ata que reinicie - as que non debera montalo ou empregalo de ningn "
+"xeito antes de reiniciar."
+
+#: libparted/arch/linux.c:1879
+#, fuzzy, c-format
+msgid ""
+"The kernel was unable to re-read the partition table on %s (%s). This means "
+"Linux won't know anything about the modifications you made until you "
+"reboot. You should reboot your computer before doing anything with %s."
+msgstr ""
+"O kernel non puido volver le-la tboa de particins de %s (%s). Isto quere "
+"dicir que Linux non sabe nada das modificacins que Vd. fixo, ata que "
+"reinicie. Debera reinicia-lo seu ordenador antes de facer nada con %s."
+
+#: libparted/arch/gnu.c:97
+#, c-format
+msgid "Unable to open %s."
+msgstr "Non se puido abrir %s."
+
+#: libparted/arch/gnu.c:117
+msgid "Unable to probe store."
+msgstr "Non se puido sondea-lo armacn."
+
+#: libparted/arch/gnu.c:355
+#, fuzzy
+msgid ""
+"The partition table cannot be re-read. This means you need to reboot before "
+"mounting any modified partitions. You also need to reinstall your boot "
+"loader before you reboot (which may require mounting modified partitions). "
+"It is impossible do both things! So you'll need to boot off a rescue disk, "
+"and reinstall your boot loader from the rescue disk. Read section 4 of the "
+"Parted User documentation for more information."
+msgstr ""
+"Non se puido volver le-la tboa de particins, as que ten que reiniciar "
+"antes de montar calquera particin modificada. Tamn precisa reinstala-lo "
+"cargador de inicio antes de reiniciar (o que pode precisa-la montaxe de "
+"particins modificadas). imposible facer mbalas das cousas, as que ha "
+"ter que arrincar cun disco de rescate, e reinstala-lo cargador de inicio "
+"dende o disco de rescate. Lea a seccin 4 da documentacin do Usuario de "
+"Parted para obter mis informacin."
+
+#: libparted/arch/gnu.c:372
+#, fuzzy, c-format
+msgid ""
+"The partition table on %s cannot be re-read (%s). This means the Hurd knows "
+"nothing about any modifications you made. You should reboot your computer "
+"before doing anything with %s."
+msgstr ""
+"A tboa de particins de %s (%s). Isto quere dicir que Hurd non sabe nada "
+"das modificacins que Vd. fixo. Debera reinicia-lo seu ordenador antes de "
+"facer nada con %s."
+
+#: libparted/arch/gnu.c:383 parted/parted.c:2215
+msgid ""
+"You should reinstall your boot loader before rebooting. Read section 4 of "
+"the Parted User documentation for more information."
+msgstr ""
+"Debera reinstala-lo cargador de inicio antes de reiniciar. Lea a seccin 4 "
+"da documentacin do Usuario de Parted para obter mis informacin."
+
+#: libparted/arch/gnu.c:774
+#, c-format
+msgid "%s trying to sync %s to disk"
+msgstr "%s tentando sincronizar %s no disco"
+
+#: libparted/disk.c:183
+#, c-format
+msgid "Unable to open %s - unrecognised disk label."
+msgstr "Non se puido abrir %s - etiqueta de disco non recoecida."
+
+#: libparted/disk.c:452
+#, c-format
+msgid ""
+"This libparted doesn't have write support for %s. Perhaps it was compiled "
+"read-only."
+msgstr ""
+"Esta versin de libparted non tn soporte de escritura para %s. Se cadra "
+"est compilado para s lectura."
+
+#: libparted/disk.c:579
+#, fuzzy, c-format
+msgid "Partition %d is %s, but the file system is %s."
+msgstr "A particin %d ten %.3fMb, pero o sistema de ficheiros ten %.3fMb."
+
+#: libparted/disk.c:1056
+#, c-format
+msgid "%s disk labels do not support extended partitions."
+msgstr "As etiquetas de disco %s non soportan particins extendidas."
+
+#: libparted/disk.c:1616
+#, c-format
+msgid "%s disk labels don't support logical or extended partitions."
+msgstr ""
+"As etiquetas de disco %s non soportan particins lxicas ou extendidas."
+
+#: libparted/disk.c:1629
+#, fuzzy
+msgid "Too many primary partitions."
+msgstr "Demasiadas particins primarias."
+
+#: libparted/disk.c:1638
+#, c-format
+msgid ""
+"Can't add a logical partition to %s, because there is no extended partition."
+msgstr ""
+"Non se pode engadir unha particin lxica a %s, porque non hai unha "
+"particin estendida."
+
+#: libparted/disk.c:1662
+#, fuzzy, c-format
+msgid "Can't have more than one extended partition on %s."
+msgstr "Non se pode ter mis de unha particin estendida en %s"
+
+#: libparted/disk.c:1672
+msgid "Can't have logical partitions outside of the extended partition."
+msgstr "Non se poden ter particins lxicas fra da particin estendida."
+
+#: libparted/disk.c:1697
+#, c-format
+msgid "Can't have a logical partition outside of the extended partition on %s."
+msgstr ""
+"Non se pode ter unha particin lxica fra da particin estendida en %s."
+
+#: libparted/disk.c:1707 libparted/disk.c:1761 libparted/disk.c:1927
+#, fuzzy
+msgid "Can't have overlapping partitions."
+msgstr "Non se poden ter particins solapndose."
+
+#: libparted/disk.c:1715
+msgid "Can't have a primary partition inside an extended partition."
+msgstr ""
+"Non se pode ter unha particin primaria dentro dunha particin estendida."
+
+#: libparted/disk.c:2123
+msgid "metadata"
+msgstr "metadatos"
+
+#: libparted/disk.c:2125
+msgid "free"
+msgstr "libre"
+
+#: libparted/disk.c:2127 parted/ui.c:968 parted/ui.c:996
+msgid "extended"
+msgstr "estendida"
+
+#: libparted/disk.c:2129 parted/ui.c:972 parted/ui.c:1000
+msgid "logical"
+msgstr "lxica"
+
+#: libparted/disk.c:2131 parted/ui.c:964 parted/ui.c:992
+msgid "primary"
+msgstr "primaria"
+
+#: libparted/disk.c:2147
+msgid "boot"
+msgstr "inicio"
+
+#: libparted/disk.c:2149
+msgid "root"
+msgstr "raiz"
+
+#: libparted/disk.c:2151
+msgid "swap"
+msgstr "intercambio"
+
+#: libparted/disk.c:2153
+msgid "hidden"
+msgstr "oculta"
+
+#: libparted/disk.c:2155
+msgid "raid"
+msgstr "raid"
+
+#: libparted/disk.c:2157
+msgid "lvm"
+msgstr "lvm"
+
+#: libparted/disk.c:2159
+msgid "lba"
+msgstr "lba"
+
+#: libparted/disk.c:2161
+msgid "hp-service"
+msgstr "hp-service"
+
+#: libparted/disk.c:2163
+msgid "palo"
+msgstr ""
+
+#: libparted/disk.c:2165
+#, fuzzy
+msgid "prep"
+msgstr "inicio"
+
+#: libparted/disk.c:2167
+msgid "msftres"
+msgstr ""
+
+#: libparted/disk.c:2173
+#, fuzzy, c-format
+msgid "Unknown partition flag, %d."
+msgstr "Modificador de particins descoecido, %d."
+
+#: libparted/labels/rdb.c:177
+#, c-format
+msgid "%s : Bad checksum on block %llu of type %s."
+msgstr ""
+
+#: libparted/labels/rdb.c:510
+#, c-format
+msgid "%s : Didn't find rdb block, should never happen."
+msgstr ""
+
+#: libparted/labels/rdb.c:595
+#, fuzzy, c-format
+msgid "%s : Loop detected at block %d."
+msgstr "%s non un dispositivo de bloques."
+
+#: libparted/labels/rdb.c:614
+#, c-format
+msgid "%s : The %s list seems bad at block %s."
+msgstr ""
+
+#: libparted/labels/rdb.c:703
+#, c-format
+msgid "%s : Failed to list bad blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:711
+#, c-format
+msgid "%s : Failed to list partition blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:719
+#, c-format
+msgid "%s : Failed to list file system blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:727
+#, c-format
+msgid "%s : Failed to list boot blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:750
+#, fuzzy, c-format
+msgid "Failed to write partition block at %d."
+msgstr "Non se puido determinar se a particin est montada."
+
+#: libparted/labels/rdb.c:1053 libparted/labels/bsd.c:505
+#: libparted/labels/dos.c:1942 libparted/labels/dvh.c:772
+#: libparted/labels/gpt.c:1365 libparted/labels/loop.c:251
+#: libparted/labels/mac.c:1318 libparted/labels/pc98.c:764
+#: libparted/labels/sun.c:704
+msgid "Unable to satisfy all constraints on the partition."
+msgstr "Non se puideron satisfacer tdalas restriccins da particin."
+
+#: libparted/labels/rdb.c:1081
+#, fuzzy
+msgid "Unable to allocate a partition number."
+msgstr "Esprase un nmero de particin."
+
+#: libparted/labels/bsd.c:530
+#, fuzzy
+msgid "Unable to allocate a bsd disklabel slot."
+msgstr "Non se puido reservar unha raura de etiqueta de disco BSD"
+
+#: libparted/labels/dos.c:812
+#, fuzzy, c-format
+msgid "Invalid partition table on %s -- wrong signature %x."
+msgstr "Tboa de particins incorrecta en %s - sinatura %x incorrecta"
+
+#: libparted/labels/dos.c:840
+#, c-format
+msgid "Invalid partition table - recursive partition on %s."
+msgstr "Tboa de particins incorrecta - particin recursiva en %s."
+
+#: libparted/labels/dos.c:1300
+#, fuzzy
+msgid "Extended partitions cannot be hidden on msdos disk labels."
+msgstr ""
+"As particins ext2 non poden estar ocultas en etiquetas de disco msdos."
+
+#: libparted/labels/dos.c:1926
+msgid "Parted can't resize partitions managed by Windows Dynamic Disk."
+msgstr ""
+
+#: libparted/labels/dvh.c:192
+#, fuzzy, c-format
+msgid "%s has no extended partition (volume header partition)."
+msgstr ""
+"%s non ten unha particin estendida (particin de cabeceira de volume). Se "
+"ignora, hanse borrar os volumes de inicio."
+
+#: libparted/labels/dvh.c:315
+msgid "Checksum is wrong, indicating the partition table is corrupt."
+msgstr ""
+"A suma de comprobacin incorrecta, o que indica que a tboa de particin "
+"est corrompida."
+
+#: libparted/labels/dvh.c:616
+msgid "Only primary partitions can be root partitions."
+msgstr "S as particins primarias poden ser particins raiz."
+
+#: libparted/labels/dvh.c:630
+msgid "Only primary partitions can be swap partitions."
+msgstr "S as particins primarias poden ser particins de intercambio."
+
+#: libparted/labels/dvh.c:644
+msgid "Only logical partitions can be a boot file."
+msgstr "S as particins lxicas poden ser un ficheiro de inicio."
+
+#: libparted/labels/dvh.c:723
+msgid "Only logical partitions (boot files) have a name."
+msgstr "S as particins lxicas (ficheiros de inicio) poden ter un nome."
+
+#: libparted/labels/dvh.c:814
+msgid "Too many primary partitions"
+msgstr "Demasiadas particins primarias."
+
+#: libparted/labels/gpt.c:433
+#, fuzzy, c-format
+msgid ""
+"%s contains GPT signatures, indicating that it has a GPT table. However, it "
+"does not have a valid fake msdos partition table, as it should. Perhaps it "
+"was corrupted -- possibly by a program that doesn't understand GPT partition "
+"tables. Or perhaps you deleted the GPT table, and are now using an msdos "
+"partition table. Is this a GPT partition table?"
+msgstr ""
+"%s contn sinaturas GPT, o que indica que ten unha tboa GPT. Nembargantes, "
+"non ten unha tboa de particin msdos falsa vlida, tal como debera. Se "
+"cadra est corrompida - posiblemente por un programa que non entende as "
+"tboas de particin GPT. Ou se cadra borrou a tboa GPT e agora emprega unha "
+"tboa de particin msdos. esta unha tboa de particin GPT?"
+
+#: libparted/labels/gpt.c:625
+#, fuzzy, c-format
+msgid ""
+"The format of the GPT partition table is version %x, which is newer than "
+"what Parted can recognise. Please tell us! bug-parted@gnu.org"
+msgstr ""
+"O formato da tboa de particin GPT mis recente do que Parted pode "
+"recoecer. Por favor, indquenolo: bug-parted@gnu.org (en ingls)"
+
+#: libparted/labels/gpt.c:747
+msgid ""
+"The backup GPT table is not at the end of the disk, as it should be. This "
+"might mean that another operating system believes the disk is smaller. Fix, "
+"by moving the backup to the end (and removing the old backup)?"
+msgstr ""
+"A copia de seguridade da tboa GPT non est na fin do disco, tal como "
+"debera. Isto pode significar que outro sistema operativo cre que o disco "
+"mis pequeno. Quere arranxalo, movendo a copia de seguridade final (e "
+"eliminando a copia vella)?"
+
+#: libparted/labels/gpt.c:782
+#, fuzzy
+msgid ""
+"The primary GPT table is corrupt, but the backup appears OK, so that will be "
+"used."
+msgstr ""
+"A tboa GPT primaria est corrompida, pero a copia de seguridade semella "
+"estar ben, as que a que se ha empregar."
+
+#: libparted/labels/gpt.c:790
+#, fuzzy
+msgid ""
+"Both the primary and backup GPT tables are corrupt. Try making a fresh "
+"table, and using Parted's rescue feature to recover partitions."
+msgstr ""
+"Ambalas das tboas GPT, primaria e copia, estn corrompidas. Probe a crear "
+"unha tboa nova e a emprega-la caracterstica de rescate (rescue) de Parted "
+"para recupera-las particins."
+
+#: libparted/labels/mac.c:167
+#, c-format
+msgid "Invalid signature %x for Mac disk labels."
+msgstr "Sinatura %x non vlida para etiquetas de disco Mac."
+
+#: libparted/labels/mac.c:212
+msgid "Partition map has no partition map entry!"
+msgstr "O mapa de particins non ten unha entrada do mapa de particins!"
+
+#: libparted/labels/mac.c:259
+#, c-format
+msgid "%s is too small for a Mac disk label!"
+msgstr "%s pequeno de mis para unha etiqueta de disco Mac!"
+
+#: libparted/labels/mac.c:490
+#, c-format
+msgid "Partition %d has an invalid signature %x."
+msgstr "A particin %d ten unha sinatura %x non vlida."
+
+#: libparted/labels/mac.c:508
+#, c-format
+msgid "Partition %d has an invalid length of 0 bytes!"
+msgstr "A particin %d ten unha lonxitude non vlida de 0 bytes!"
+
+#: libparted/labels/mac.c:536
+#, fuzzy
+msgid "The data region doesn't start at the start of the partition."
+msgstr "A rexin de datos non comeza no principio da particin"
+
+#: libparted/labels/mac.c:553
+#, fuzzy
+msgid "The boot region doesn't start at the start of the partition."
+msgstr "A rexin de inicio non comeza no principio da particin"
+
+#: libparted/labels/mac.c:567
+msgid "The partition's boot region doesn't occupy the entire partition."
+msgstr "A rexin de inicio da particin non ocupa toda a particin."
+
+#: libparted/labels/mac.c:577
+msgid "The partition's data region doesn't occupy the entire partition."
+msgstr "A rexin de datos da particin non ocupa toda a particin."
+
+#: libparted/labels/mac.c:631
+#, c-format
+msgid ""
+"Weird block size on device descriptor: %d bytes is not divisible by 512."
+msgstr ""
+"Tamao de bloque estrao no descriptor do dispositivo: %d bytes non "
+"divisible por 512."
+
+#: libparted/labels/mac.c:644
+#, c-format
+msgid ""
+"The driver descriptor says the physical block size is %d bytes, but Linux "
+"says it is %d bytes."
+msgstr ""
+"O descriptor do controlador di que o tamao do bloque fsico %d bytes, "
+"pero Linux di que de %d bytes."
+
+#: libparted/labels/mac.c:692
+msgid "No valid partition map found."
+msgstr "Non se atopou un mapa de particins vlido."
+
+#: libparted/labels/mac.c:744
+#, fuzzy, c-format
+msgid ""
+"Conflicting partition map entry sizes! Entry 1 says it is %d, but entry %d "
+"says it is %d!"
+msgstr ""
+"Tamaos das entradas do mapa de particins conflictivos! A entrada 1 di "
+"que de %d, pero a entrada %d di que %d!"
+
+#: libparted/labels/mac.c:771
+#, fuzzy
+msgid "Weird! There are 2 partitions map entries!"
+msgstr "Estrao - hai das entradas de mapa de particins!"
+
+#: libparted/labels/mac.c:1257
+msgid ""
+"Changing the name of a root or swap partition will prevent Linux from "
+"recognising it as such."
+msgstr ""
+"Cambia-lo nome dunha particin raiz ou de intercambio ha impedir que Linux a "
+"recoeza coma tal."
+
+#: libparted/labels/mac.c:1353
+#, fuzzy
+msgid "Can't add another partition -- the partition map is too small!"
+msgstr ""
+"Non se pode engadir outra particin - o mapa de particins pequeno de mis."
+
+#: libparted/labels/pc98.c:357
+#, fuzzy, c-format
+msgid "Invalid partition table on %s."
+msgstr "Tboa de particins incorrecta en %s"
+
+#: libparted/labels/pc98.c:409 libparted/labels/pc98.c:487
+#, fuzzy, c-format
+msgid ""
+"Partition %d isn't aligned to cylinder boundaries. This is still "
+"unsupported."
+msgstr ""
+"A particin %d non est aliada nos lmites dos cilindros. Hai que engadir "
+"soporte para isto."
+
+#: libparted/labels/pc98.c:796
+msgid "Can't add another partition."
+msgstr "Non se pode engadir mis particins."
+
+#: libparted/labels/sun.c:143
+msgid "Corrupted Sun disk label detected."
+msgstr "Detectouse unha etiqueta de disco Sun corrompida."
+
+#: libparted/labels/sun.c:264
+#, fuzzy, c-format
+msgid ""
+"The disk CHS geometry (%d,%d,%d) reported by the operating system does not "
+"match the geometry stored on the disk label (%d,%d,%d)."
+msgstr ""
+"A xeometra CHS do disco (%d,%d,%d) non encaixa coa xeometra armacenada na "
+"etiqueta de disco (%d,%d,%d)."
+
+#: libparted/labels/sun.c:286
+#, c-format
+msgid "The disk label describes a disk bigger than %s."
+msgstr "A etiqueta de disco describe un disco maior de %s."
+
+#: libparted/labels/sun.c:440
+#, c-format
+msgid "The disk has %d cylinders, which is greater than the maximum of 65536."
+msgstr ""
+
+#: libparted/labels/sun.c:736
+msgid ""
+"The Whole Disk partition is the only available one left. Generally, it is "
+"not a good idea to overwrite this partition with a real one. Solaris may "
+"not be able to boot without it, and SILO (the sparc boot loader) appreciates "
+"it as well."
+msgstr ""
+"A particin de Disco Completo a nica que queda dispoible. Normalmente "
+"non unha boa idea sobrescribir esta particin cunha de verdade. Solaris "
+"pode non arrincar sen ela, e SILO (o cargador de sparc) tamn a aprecia."
+
+#: libparted/labels/sun.c:751
+msgid "Sun disk label is full."
+msgstr "A etiqueta de disco Sun est chea."
+
+#: libparted/filesys.c:386
+msgid "Could not detect file system."
+msgstr "Non se pode detectar un sistema de ficheiros."
+
+#: libparted/filesys.c:397
+#, fuzzy
+msgid "The file system is bigger than its volume!"
+msgstr "O sistema de ficheiros maior c seu volume."
+
+#: libparted/filesys.c:405
+#, c-format
+msgid "Support for opening %s file systems is not implemented yet."
+msgstr ""
+"O soporte de apertura de sistemas de ficheiros %s non est implementado "
+"anda."
+
+#: libparted/filesys.c:447
+#, c-format
+msgid "Support for creating %s file systems is not implemented yet."
+msgstr ""
+"O soporte de creacin de sistemas de ficheiros %s non est implementado "
+"anda."
+
+#: libparted/filesys.c:508
+#, c-format
+msgid "Support for checking %s file systems is not implemented yet."
+msgstr ""
+"O soporte de comprobacin de sistemas de ficheiros %s non est implementado "
+"anda."
+
+#: libparted/filesys.c:574
+msgid "raw block copying"
+msgstr "copiando bloque a bloque"
+
+#: libparted/filesys.c:585
+msgid "growing file system"
+msgstr "aumentando o sistema de ficheiros"
+
+#: libparted/filesys.c:625
+msgid "Can't copy onto an overlapping partition."
+msgstr "Non se pode copiar nunha particin que se solapa."
+
+#: libparted/filesys.c:647
+#, fuzzy, c-format
+msgid ""
+"Direct support for copying file systems is not yet implemented for %s. "
+"However, support for resizing is implemented. Therefore, the file system "
+"can be copied if the new partition is at least as big as the old one. So, "
+"either shrink the partition you are trying to copy, or copy to a bigger "
+"partition."
+msgstr ""
+"O soporte directo de copia de sistemas de ficheiros non est implementado "
+"anda para %s. Nembargantes, o soporte para o cambio de tamao s est. Polo "
+"tanto, pdese copia-lo sistema de ficheiros se a particin nova alomenos "
+"tan grande coma a vella. As que, ou ben reduza a particin que quere "
+"copiar, ou copie nunha particin mis grande."
+
+#: libparted/filesys.c:661
+#, c-format
+msgid "Support for copying %s file systems is not implemented yet."
+msgstr ""
+"O soporte de copia de sistemas de ficheiros %s non est implementado anda."
+
+#: libparted/filesys.c:699
+#, c-format
+msgid "Support for resizing %s file systems is not implemented yet."
+msgstr ""
+"O soporte de modificacin do tamao de sistemas de ficheiros %s non est "
+"implementado anda."
+
+#: libparted/exception.c:78
+msgid "Information"
+msgstr "Informacin"
+
+#: libparted/exception.c:79
+msgid "Warning"
+msgstr "Aviso"
+
+#: libparted/exception.c:80
+msgid "Error"
+msgstr "Erro"
+
+#: libparted/exception.c:81
+msgid "Fatal"
+msgstr "Moi grave"
+
+#: libparted/exception.c:82
+msgid "Bug"
+msgstr "Erro"
+
+#: libparted/exception.c:83
+msgid "No Implementation"
+msgstr "Sen Implementacin"
+
+#: libparted/exception.c:87
+msgid "Fix"
+msgstr "Arranxar"
+
+#: libparted/exception.c:88
+msgid "Yes"
+msgstr "Si"
+
+#: libparted/exception.c:89
+msgid "No"
+msgstr "Non"
+
+#: libparted/exception.c:90
+msgid "OK"
+msgstr "Aceptar"
+
+#: libparted/exception.c:91
+msgid "Retry"
+msgstr "Reintentar"
+
+#: libparted/exception.c:92
+msgid "Ignore"
+msgstr "Ignorar"
+
+#: libparted/exception.c:93
+msgid "Cancel"
+msgstr "Cancelar"
+
+#: libparted/exception.c:133
+#, fuzzy, c-format
+msgid ""
+"A bug has been detected in GNU Parted. Refer to the web site of parted "
+"http://www.gnu.org/software/parted/parted.html for more informations of what "
+"could be useful for bug submitting! Please email a bug report to bug-"
+"parted@gnu.org containing at least the version (%s) and the following "
+"message: "
+msgstr ""
+"Detectouse un erro en GNU parted. Por favor, enve un informe de erro a bug-"
+"parted@gnu.org que contea a versin (%s) e a seguinte mensaxe:"
+
+#: libparted/cs/geom.c:162
+msgid "Can't have the end before the start!"
+msgstr "A fin da particin non pode estar detrs do comezo!"
+
+#: libparted/cs/geom.c:169
+msgid "Can't have a partition outside the disk!"
+msgstr "Non se pode ter unha particin fra do disco!"
+
+#: libparted/cs/geom.c:303
+#, fuzzy, c-format
+msgid "Attempt to read sectors %ld-%ld outside of partition on %s."
+msgstr "Tentronse le-los sectores %ld-%ld fra da particin en %s"
+
+#: libparted/cs/geom.c:373
+#, fuzzy, c-format
+msgid "Attempt to write sectors %ld-%ld outside of partition on %s."
+msgstr "Tentronse escribi-los sectores %ld-%ld fra da particin en %s"
+
+#: libparted/cs/geom.c:413 libparted/fs/linux_swap/linux_swap.c:353
+msgid "checking for bad blocks"
+msgstr "buscando os bloques errneos"
+
+#: libparted/libparted.c:286 libparted/libparted.c:306
+msgid "Out of memory."
+msgstr "Memoria esgotada."
+
+#: libparted/unit.c:139
+msgid "Cannot get unit size for special unit 'COMPACT'."
+msgstr ""
+
+#: libparted/unit.c:382
+#, c-format
+msgid "\"%s\" has invalid syntax for locations."
+msgstr ""
+
+#: libparted/unit.c:390
+#, c-format
+msgid "The maximum head value is %d."
+msgstr ""
+
+#: libparted/unit.c:397
+#, c-format
+msgid "The maximum sector value is %d."
+msgstr ""
+
+#: libparted/unit.c:409 libparted/unit.c:540
+#, fuzzy, c-format
+msgid "The location %s is outside of the device %s."
+msgstr "Non se pode crear unha particin fra do dispositivo."
+
+#: libparted/unit.c:522
+msgid "Invalid number."
+msgstr ""
+
+#: libparted/fs/ext2/ext2.c:87 libparted/fs/ext2/ext2.c:112
+msgid "Inconsistent group descriptors!"
+msgstr "Descriptores de grupo non consistentes!"
+
+#: libparted/fs/ext2/ext2.c:91 libparted/fs/ext2/ext2.c:116
+#, fuzzy
+msgid "File system full!"
+msgstr "Sistema de ficheiros cheo!"
+
+#: libparted/fs/ext2/ext2.c:750
+#, fuzzy
+msgid "Invalid superblock. Are you sure this is an ext2 file system?"
+msgstr ""
+"Superbloque incorrecto. Est seguro de que este un sistema de ficheiros "
+"ext2?"
+
+#: libparted/fs/ext2/ext2.c:764 libparted/fs/ext2/ext2_resize.c:597
+#, fuzzy
+msgid "File system has errors! You should run e2fsck."
+msgstr "O sistema de ficheiros ten erros! Debera executar e2fsck."
+
+#: libparted/fs/ext2/ext2.c:775
+#, fuzzy
+msgid ""
+"File system was not cleanly unmounted! You should run e2fsck. Modifying an "
+"unclean file system could cause severe corruption."
+msgstr ""
+"O sistema de ficheiros non foi desmontado limpamente! Debera executar "
+"e2fsck."
+
+#: libparted/fs/ext2/ext2.c:795
+#, fuzzy
+msgid "File system has an incompatible feature enabled."
+msgstr "O sistema de ficheiros ten unha caracterstica incompatible activada."
+
+#: libparted/fs/ext2/ext2.c:806
+msgid "Error allocating buffer cache."
+msgstr "Erro ao buscar espacio para o buffer cache."
+
+#: libparted/fs/ext2/ext2.c:848
+msgid ""
+"A resize operation on this file system will use EXPERIMENTAL code that MAY "
+"CORRUPT it (although it hasn't done so yet).You should at least backup your "
+"data and run 'e2fsck -f' afterwards."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:114
+#, fuzzy
+msgid ""
+"Found an inode with a incorrect link count. Better go run e2fsck first!"
+msgstr ""
+"Atopei un inode cunha conta de ligazns incorrecta. Mellor ser que empregue "
+"e2fsck antes."
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:487
+msgid "Not enough free inodes!"
+msgstr "Non hai inodes libres dabondo!"
+
+#: libparted/fs/ext2/ext2_resize.c:224
+#, fuzzy
+msgid "File system is too full to remove a group!"
+msgstr "O sistema de ficheiros est demasiado ocupado para eliminar un grupo!"
+
+#: libparted/fs/ext2/ext2_resize.c:233
+#, fuzzy
+msgid "File system has too many allocated inodes to remove a group!"
+msgstr ""
+"O sistema de ficheiros ten demasiados inodes ocupados para eliminar un "
+"grupo!"
+
+#: libparted/fs/ext2/ext2_resize.c:493
+msgid "adding groups"
+msgstr "engadindo grupos"
+
+#: libparted/fs/ext2/ext2_resize.c:530
+#, fuzzy, c-format
+msgid "Your file system is too full to resize it to %i blocks. Sorry."
+msgstr ""
+"O seu sistema de ficheiros est demasiado ocupado para cambiarlle o tamao a "
+"%i bloques. Sntoo."
+
+#: libparted/fs/ext2/ext2_resize.c:540
+#, fuzzy, c-format
+msgid ""
+"Your file system has too many occupied inodes to resize it to %i blocks. "
+"Sorry."
+msgstr ""
+"O seu sistema de ficheiros ten demasiados inodes ocupados para cambiarlle o "
+"tamao a %i bloques. Sntoo."
+
+#: libparted/fs/ext2/ext2_resize.c:554 libparted/fs/hfs/hfs.c:243
+#: libparted/fs/hfs/hfs.c:624
+msgid "shrinking"
+msgstr "encollendo"
+
+#: libparted/fs/ext2/ext2_resize.c:605
+#, fuzzy
+msgid "File system was not cleanly unmounted! You should run e2fsck."
+msgstr ""
+"O sistema de ficheiros non foi desmontado limpamente! Debera executar "
+"e2fsck."
+
+#: libparted/fs/ext2/ext2_resize.c:614
+msgid ""
+"The file system has the 'dir_index' feature enabled. Parted can only resize "
+"the file system if it disables this feature. You can enable it later by "
+"running 'tune2fs -O dir_index DEVICE' and then 'e2fsck -fD DEVICE'."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_block_relocator.c:198
+#, fuzzy
+msgid "Cross-linked blocks found! Better go run e2fsck first!"
+msgstr ""
+"Atopronse bloques ligados entre si! Mellor ser que empregue e2fsck antes!"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:537
+#, fuzzy, c-format
+msgid "Block %i has no reference? Weird."
+msgstr "O bloque %i non ten unha referencia? Moi raro."
+
+#: libparted/fs/ext2/ext2_block_relocator.c:738
+#, c-format
+msgid "Block %i shouldn't have been marked!"
+msgstr "O bloque %i non debera estar marcado!"
+
+#: libparted/fs/ext2/interface.c:188
+#, fuzzy
+msgid ""
+"The ext2 file system passed a basic check. For a more comprehensive check, "
+"use the e2fsck program."
+msgstr ""
+"O sistema de ficheiros ext2 pasou unha comprobacin bsica. Para unha "
+"comprobacin mis a fondo, empregue o programa e2fsck."
+
+#: libparted/fs/ext2/interface.c:205
+msgid "Sorry, can't move the start of ext2 partitions yet!"
+msgstr "Sntoo, ainda non podo move-lo principio das particins ext2!"
+
+#: libparted/fs/ext2/ext2_buffer.c:82
+msgid "Couldn't flush buffer cache!"
+msgstr "Non se puido baleira-lo buffer cache!"
+
+#: libparted/fs/ext2/ext2_mkfs.c:162
+msgid "writing per-group metadata"
+msgstr "gravando os metadatos por grupos"
+
+#: libparted/fs/ext2/ext2_mkfs.c:565
+msgid "File system too small for ext2."
+msgstr "O sistema de ficheiros pequeno de mis para ext2."
+
+#: libparted/fs/fat/calc.c:134
+#, fuzzy, c-format
+msgid ""
+"You need %s of free disk space to shrink this partition to this size. "
+"Currently, only %s is free."
+msgstr ""
+"Precisa %dM de espacio libre para reducir esta particin a este tamao "
+"(actualmente ten s %dM libres)"
+
+#: libparted/fs/fat/context.c:55
+#, c-format
+msgid ""
+"Cluster start delta = %d, which is not a multiple of the cluster size %d."
+msgstr ""
+"Delta do comezo do cluster = %d, que non un mltiplo do tamao do cluster %"
+"d."
+
+#: libparted/fs/fat/fat.c:312
+#, fuzzy, c-format
+msgid "Partition too big/small for a %s file system."
+msgstr "A particin grande/pequena de mis para un sistema de ficheiros %s"
+
+#: libparted/fs/fat/fat.c:478
+msgid ""
+"The FATs don't match. If you don't know what this means, then select "
+"cancel, run scandisk on the file system, and then come back."
+msgstr ""
+"As FATs non coinciden. Se non sabe o que isto significa, escolla \"Cancelar"
+"\", empregue \"scandisk\" no sistema de ficheiros, e logo volte."
+
+#: libparted/fs/fat/fat.c:518
+msgid "There are no possible configurations for this FAT type."
+msgstr "Non hai configuracins posibles para este tipo de FAT."
+
+#: libparted/fs/fat/fat.c:530
+#, c-format
+msgid ""
+"File system doesn't have expected sizes for Windows to like it. Cluster "
+"size is %dk (%dk expected); number of clusters is %d (%d expected); size of "
+"FATs is %d sectors (%d expected)."
+msgstr ""
+"O sistema de ficheiros non ten os tamaos esperados para que a Windows lle "
+"goste. O tamao do cluster %dk (esperbase %dk); o nmero de clusters %d "
+"(esperbanse %d); o tamao das FATs de %d sectores (esperbanse %d)."
+
+#: libparted/fs/fat/fat.c:553
+#, c-format
+msgid ""
+"File system is reporting the free space as %d clusters, not %d clusters."
+msgstr ""
+"O sistema de ficheiros di que o espacio libre de %d clusters, non %d "
+"clusters."
+
+#: libparted/fs/fat/fat.c:878
+#, fuzzy
+msgid ""
+"GNU Parted was miscompiled: the FAT boot sector should be 512 bytes. FAT "
+"support will be disabled."
+msgstr ""
+"GNU parted foi compilado incorrectamente: o sector de inicio FAT debera ter "
+"512 bytes. O soporte FAT ser desactivado."
+
+#: libparted/fs/fat/resize.c:158
+#, fuzzy
+msgid ""
+"There's not enough room in the root directory for all of the files. Either "
+"cancel, or ignore to lose the files."
+msgstr ""
+"Non hai espacio dabondo no directorio raiz para tdolos ficheiros. Pode ou "
+"ben cancelar, ou ben ignorar e perde-los ficheiros."
+
+#: libparted/fs/fat/resize.c:299
+msgid "Error writing to the root directory."
+msgstr "Erro ao escribir no directorio raiz."
+
+#: libparted/fs/fat/resize.c:484
+#, fuzzy
+msgid "If you leave your file system as FAT16, then you will have no problems."
+msgstr "Se deixa o sistema de ficheiros coma FAT16, non ha ter problemas."
+
+#: libparted/fs/fat/resize.c:487
+msgid ""
+"If you convert to FAT16, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual)."
+msgstr ""
+"Se convirte a FAT16, e MS Windows est instalado na particin, ha ter que "
+"reinstala-lo cargador de inicio de MS Windows. Se quere facelo, debera "
+"consulta-lo manual de Parted (ou o manual da sa distribucin)."
+
+#: libparted/fs/fat/resize.c:495
+msgid ""
+"If you leave your file system as FAT32, then you will not introduce any new "
+"problems."
+msgstr ""
+"Se deixa o sistema de ficheiros coma FAT32, non ha introducir novos "
+"problemas."
+
+#: libparted/fs/fat/resize.c:499
+msgid ""
+"If you convert to FAT32, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual). Also, "
+"converting to FAT32 will make the file system unreadable by MS DOS, MS "
+"Windows 95a, and MS Windows NT."
+msgstr ""
+"Se convirte a FAT32, e MS Windows est instalado na particin, ha ter que "
+"reinstala-lo cargador de inicio de MS Windows. Se quere facelo, debera "
+"consulta-lo manual de Parted (ou o manual da sa distribucin). Tamn, a "
+"conversin a FAT32 far o sistema de ficheiros ilexible para MS DOS, MS "
+"Windows 95a e MS Windows NT."
+
+#: libparted/fs/fat/resize.c:513
+#, c-format
+msgid "%s %s %s"
+msgstr "%s %s %s"
+
+#: libparted/fs/fat/resize.c:514
+msgid "Would you like to use FAT32?"
+msgstr "Quere usar FAT32?"
+
+#: libparted/fs/fat/resize.c:541 libparted/fs/fat/resize.c:557
+#, c-format
+msgid "%s %s"
+msgstr "%s %s"
+
+#: libparted/fs/fat/resize.c:542
+msgid ""
+"The file system can only be resized to this size by converting to FAT16."
+msgstr ""
+"O sistema de ficheiros s pode alcanzar este tamao convertindo a FAT16."
+
+#: libparted/fs/fat/resize.c:558
+msgid ""
+"The file system can only be resized to this size by converting to FAT32."
+msgstr ""
+"O sistema de ficheiros s pode alcanzar este tamao convertindo a FAT32."
+
+#: libparted/fs/fat/resize.c:571
+#, fuzzy
+msgid ""
+"GNU Parted cannot resize this partition to this size. We're working on it!"
+msgstr ""
+"GNU Parted non pode cambiar esta particin a este tamao. Estamos "
+"traballando niso!"
+
+#: libparted/fs/fat/bootsector.c:48 libparted/fs/fat/bootsector.c:55
+msgid "File system has an invalid signature for a FAT file system."
+msgstr ""
+"O sistema de ficheiros ten unha sinatura incorrecta para un sistema de "
+"ficheiros FAT."
+
+#: libparted/fs/fat/bootsector.c:62
+msgid "File system has an invalid sector size for a FAT file system."
+msgstr ""
+"O sistema de ficheiros ten un tamao de sector incorrecto para un sistema de "
+"ficheiros FAT."
+
+#: libparted/fs/fat/bootsector.c:69
+msgid "File system has an invalid cluster size for a FAT file system."
+msgstr ""
+"O sistema de ficheiros ten un tamao de bloque non vlido para un sistema de "
+"ficheiros FAT."
+
+#: libparted/fs/fat/bootsector.c:76
+#, fuzzy
+msgid ""
+"File system has an invalid number of reserved sectors for a FAT file system."
+msgstr ""
+"O sistema de ficheiros ten un nmero de sectores reservados incorrecto para "
+"un sistema de ficheiros FAT."
+
+#: libparted/fs/fat/bootsector.c:83
+#, fuzzy
+msgid "File system has an invalid number of FATs."
+msgstr "O sistema de ficheiros ten un nmero de FATs incorrecto."
+
+#: libparted/fs/fat/bootsector.c:138
+#, c-format
+msgid ""
+"This file system has a logical sector size of %d. GNU Parted is known not "
+"to work properly with sector sizes other than 512 bytes."
+msgstr ""
+"Este sistema de ficheiros ten un tamao de sector lxico de %d. Sbese que "
+"GNU Parted non traballa correctamente con tamaos de sector distintos de 512 "
+"bytes."
+
+#: libparted/fs/fat/bootsector.c:163
+#, c-format
+msgid ""
+"The file system's CHS geometry is (%d, %d, %d), which is invalid. The "
+"partition table's CHS geometry is (%d, %d, %d). If you select Ignore, the "
+"file system's CHS geometry will be left unchanged. If you select Fix, the "
+"file system's CHS geometry will be set to match the partition table's CHS "
+"geometry."
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:209
+msgid "FAT boot sector says logical sector size is 0. This is weird. "
+msgstr ""
+"O sector de inicio FAT di que o tamao lxico de sector 0. Isto moi "
+"estrao. "
+
+#: libparted/fs/fat/bootsector.c:215
+msgid "FAT boot sector says there are no FAT tables. This is weird. "
+msgstr "O sector de inicio FAT di que non hai tboas FAT. Isto moi estrao. "
+
+#: libparted/fs/fat/bootsector.c:221
+msgid "FAT boot sector says clusters are 0 sectors. This is weird. "
+msgstr ""
+"O sector de inicio FAT di que os clusters teen 0 sectores. Isto moi "
+"estrao. "
+
+#: libparted/fs/fat/bootsector.c:231
+#, fuzzy
+msgid "File system is FAT12, which is unsupported."
+msgstr "O sistema de ficheiros FAT12, que non est soportado."
+
+#: libparted/fs/fat/bootsector.c:407
+#, c-format
+msgid ""
+"The information sector has the wrong signature (%x). Select cancel for now, "
+"and send in a bug report. If you're desperate, it's probably safe to ignore."
+msgstr ""
+"O sector de informacin ten unha sinatura incorrecta (%x). Escolla \"Cancelar"
+"\" polo de agora, e enve un informe de erro. Se est desesperado, pode que "
+"sexa seguro ignorar."
+
+#: libparted/fs/fat/count.c:149
+#, c-format
+msgid "Bad directory entry for %s: first cluster is the end of file marker."
+msgstr ""
+"Entrada de directorio incorrecta para %s: o primeiro cluster o marcador de "
+"fin de ficheiro."
+
+#: libparted/fs/fat/count.c:162
+#, c-format
+msgid ""
+"Bad FAT: unterminated chain for %s. You should run dosfsck or scandisk."
+msgstr ""
+"FAT incorrecta: cadea non rematada para %s. Debera executar dosfsck ou "
+"scandisk."
+
+#: libparted/fs/fat/count.c:171
+#, fuzzy, c-format
+msgid ""
+"Bad FAT: cluster %d outside file system in chain for %s. You should run "
+"dosfsck or scandisk."
+msgstr ""
+"FAT incorrecta: o cluster %d est fra do sistema de ficheiros na cadea para "
+"%s. Debera executar dosfsck ou scandisk."
+
+#: libparted/fs/fat/count.c:181
+#, c-format
+msgid ""
+"Bad FAT: cluster %d is cross-linked for %s. You should run dosfsck or "
+"scandisk."
+msgstr ""
+"FAT incorrecta: o cluster %d ten ligazns cruzadas para %s. Debera executar "
+"dosfsck ou scandisk."
+
+#: libparted/fs/fat/count.c:200
+#, c-format
+msgid "%s is %dk, but it has %d clusters (%dk)."
+msgstr "%s de %dk, pero ten %d clusters (%dk)."
+
+#: libparted/fs/fat/count.c:263
+#, c-format
+msgid ""
+"The file %s is marked as a system file. This means moving it could cause "
+"some programs to stop working."
+msgstr ""
+"O ficheiro %s est marcado coma ficheiro de sistema. Isto significa que "
+"movelo podera facer que outros programas deixaran de traballar."
+
+#: libparted/fs/fat/table.c:138
+#, c-format
+msgid ""
+"FAT %d media %x doesn't match the boot sector's media %x. You should "
+"probably run scandisk."
+msgstr ""
+"Na FAT %d, o soporte %x non coincide co soporte do sector de inicio, %x. "
+"Seguramente debera executar scandisk."
+
+#: libparted/fs/fat/table.c:268
+#, fuzzy, c-format
+msgid "fat_table_set: cluster %ld outside file system"
+msgstr "fat_table_set: o cluster %ld est fra do sistema de ficheiros"
+
+#: libparted/fs/fat/table.c:296
+#, fuzzy, c-format
+msgid "fat_table_get: cluster %ld outside file system"
+msgstr "fat_table_get: o cluster %ld est fra do sistema de ficheiros"
+
+#: libparted/fs/fat/table.c:334
+msgid "fat_table_alloc_cluster: no free clusters"
+msgstr "fat_table_alloc_cluster: non hai clusters libres"
+
+#: libparted/fs/linux_swap/linux_swap.c:236
+#, c-format
+msgid "Unrecognised linux swap signature '%10s'."
+msgstr "Sinatura \"%10s\" da particin de intercambio de linux non recoecida."
+
+#: libparted/fs/linux_swap/linux_swap.c:312
+msgid "Too many bad pages."
+msgstr "Demasiadas pxinas incorrectas."
+
+#: libparted/fs/hfs/advfs.c:123 libparted/fs/hfs/advfs_plus.c:125
+#: libparted/fs/hfs/reloc.c:416 libparted/fs/hfs/reloc.c:510
+#: libparted/fs/hfs/reloc_plus.c:541 libparted/fs/hfs/reloc_plus.c:660
+#: libparted/fs/hfs/reloc_plus.c:774
+msgid "The file system contains errors."
+msgstr ""
+
+#: libparted/fs/hfs/advfs_plus.c:290
+msgid "Bad blocks could not be read."
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:139
+#, c-format
+msgid ""
+"Trying to register an extent starting at block 0x%X, but another one already "
+"exists at this position. You should check the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:216
+#, c-format
+msgid ""
+"Trying to move an extent from block Ox%X to block Ox%X, but another one "
+"already exists at this position. This should not happen!"
+msgstr ""
+
+#: libparted/fs/hfs/file.c:145
+#, c-format
+msgid "Could not update the extent cache for HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:182
+#, c-format
+msgid "Trying to read HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:192 libparted/fs/hfs/file.c:222
+#, c-format
+msgid "Could not find sector %lli of HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:212
+#, c-format
+msgid "Trying to write HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:159
+#, c-format
+msgid "Could not update the extent cache for HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:203
+#, c-format
+msgid "Trying to read HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:214 libparted/fs/hfs/file_plus.c:256
+#, c-format
+msgid "Could not find sector %lli of HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:245
+#, c-format
+msgid "Trying to write HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:225
+msgid "Sorry, HFS cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:255 libparted/fs/hfs/hfs.c:636
+msgid "Data relocation has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:274
+msgid "Data relocation left some data in the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:313
+#, fuzzy
+msgid "writing HFS Master Directory Block"
+msgstr "Erro ao escribir no directorio raiz."
+
+#: libparted/fs/hfs/hfs.c:461
+msgid "No valid HFS[+X] signature has been found while opening."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:471
+#, c-format
+msgid "Version %d of HFS+ isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:482
+#, c-format
+msgid "Version %d of HFSX isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:667
+msgid "Data relocation left some data at the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:715
+#, fuzzy
+msgid "Error while writing the allocation file."
+msgstr "Erro ao escribir no directorio raiz."
+
+#: libparted/fs/hfs/hfs.c:730
+msgid "Error while writing the compatibility part of the allocation file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:745
+msgid "writing HFS+ Volume Header"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:845
+msgid "An error occurred while looking for the mandatory bad blocks file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:899
+msgid ""
+"It seems there is an error in the HFS wrapper: the bad blocks file doesn't "
+"contain the embedded HFS+ volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:930
+msgid "Sorry, HFS+ cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:965
+msgid "shrinking embedded HFS+ volume"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:981
+msgid "Resizing the HFS+ volume has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:988
+#, fuzzy
+msgid "shrinking HFS wrapper"
+msgstr "encollendo"
+
+#: libparted/fs/hfs/hfs.c:997
+msgid "Updating the HFS wrapper has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:1099 libparted/fs/hfs/hfs.c:1184
+#, c-format
+msgid ""
+"This is not a real %s check. This is going to extract special low level "
+"files for debugging purposes."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:156
+msgid "Bad block list header checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:169
+#, c-format
+msgid ""
+"Invalid size of a transaction block while replaying the journal (%i bytes)."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:261
+msgid ""
+"Journal stored outside of the volume are not supported. Try to desactivate "
+"the journal and run Parted again."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:272
+#, fuzzy
+msgid "Journal offset or size is not multiple of the sector size."
+msgstr ""
+"Delta do comezo do cluster = %d, que non un mltiplo do tamao do cluster %"
+"d."
+
+#: libparted/fs/hfs/journal.c:290
+msgid "Incorrect magic values in the journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:299
+msgid "Journal size mismatch between journal info block and journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:311
+#, fuzzy
+msgid "Some header fields are not multiple of the sector size."
+msgstr ""
+"Delta do comezo do cluster = %d, que non un mltiplo do tamao do cluster %"
+"d."
+
+#: libparted/fs/hfs/journal.c:320
+msgid ""
+"The sector size stored in the journal is not 512 bytes. Parted only "
+"supports 512 bytes length sectors."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:332
+msgid "Bad journal checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:350
+msgid ""
+"The journal is not empty. Parted must replay the transactions before "
+"opening the file system. This will modify the file system."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:378
+msgid ""
+"The volume header or the master directory block has changed while replaying "
+"the journal. You should restart Parted."
+msgstr ""
+
+#: libparted/fs/hfs/probe.c:52
+#, c-format
+msgid ""
+"Parted can't use HFS file systems on disks with a sector size not equal to %"
+"d bytes."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:153 libparted/fs/hfs/reloc_plus.c:157
+msgid "An extent has not been relocated."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:253 libparted/fs/hfs/reloc_plus.c:309
+msgid ""
+"A reference to an extent comes from a place it should not. You should check "
+"the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:383
+msgid "This HFS volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:477
+msgid "This HFS volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:519 libparted/fs/hfs/reloc_plus.c:670
+msgid ""
+"The extents overflow file should not contain its own extents! You should "
+"check the file system."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:576 libparted/fs/hfs/reloc_plus.c:849
+#, fuzzy
+msgid "Could not cache the file system in memory."
+msgstr "Non se pode detectar un sistema de ficheiros."
+
+#: libparted/fs/hfs/reloc.c:637 libparted/fs/hfs/reloc_plus.c:910
+msgid "Bad blocks list could not be loaded."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:651 libparted/fs/hfs/reloc_plus.c:926
+msgid "An error occurred during extent relocation."
+msgstr ""
+
+#: libparted/fs/hfs/reloc_plus.c:497
+msgid "This HFS+ volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc_plus.c:621
+msgid "This HFS+ volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: parted/parted.c:76
+msgid "displays this help message"
+msgstr "amosar esta mensaxe de axuda"
+
+#: parted/parted.c:77
+msgid "where necessary, prompts for user intervention"
+msgstr "onde sexa necesario, pedi-la intervencin do usuario"
+
+#: parted/parted.c:78
+msgid "never prompts for user intervention"
+msgstr "non pedir nunca a intervencin do usuario"
+
+#: parted/parted.c:79
+msgid "displays the version"
+msgstr "amosa-la versin"
+
+#: parted/parted.c:87
+#, fuzzy
+msgid ""
+"NUMBER is the partition number used by Linux. On MS-DOS disk labels, the "
+"primary partitions number from 1 to 4, logical partitions from 5 onwards.\n"
+msgstr ""
+"MENOR o nmero de particin que usa Linux. Nas etiquetas de disco msdos, "
+"as particins primarias teen nmeros de 1 a 4, e as lxicas tenos do 5 en "
+"diante.\n"
+
+#: parted/parted.c:90
+msgid "LABEL-TYPE is one of: "
+msgstr "TIPO-ETIQUETA un destes: "
+
+#: parted/parted.c:91
+msgid "FLAG is one of: "
+msgstr "MODIF un destes: "
+
+#: parted/parted.c:92
+#, fuzzy
+msgid "UNIT is one of: "
+msgstr "MODIF un destes: "
+
+#: parted/parted.c:93
+msgid "PART-TYPE is one of: primary, logical, extended\n"
+msgstr ""
+"TIPO-PARTICION : primary (primaria), logical (lxica), extended "
+"(estendida)\n"
+
+#: parted/parted.c:95
+msgid "FS-TYPE is one of: "
+msgstr "TIPO-SF un destes: "
+
+#: parted/parted.c:96
+msgid ""
+"START and END are disk locations, such as 4GB or 10%. Negative values count "
+"from the end of the disk. For example, -1s specifies exactly the last "
+"sector.\n"
+msgstr ""
+
+#: parted/parted.c:99
+msgid "STATE is one of: on, off\n"
+msgstr "ESTADO un destes: on, off\n"
+
+#: parted/parted.c:100
+msgid "DEVICE is usually /dev/hda or /dev/sda\n"
+msgstr "DISPOSITIVO adoita ser /dev/hda ou /dev/sda\n"
+
+#: parted/parted.c:101
+msgid "NAME is any word you want\n"
+msgstr "NOME calquera palabra que queira\n"
+
+#: parted/parted.c:102
+msgid "The partition must have one of the following FS-TYPEs: "
+msgstr ""
+
+#: parted/parted.c:105
+msgid "GNU Parted Version information:\n"
+msgstr ""
+
+#: parted/parted.c:107
+#, fuzzy
+msgid ""
+"Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n"
+"This program is free software, covered by the GNU General Public License.\n"
+"\n"
+"This program is distributed in the hope that it will be useful, but WITHOUT "
+"ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
+"FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
+"more details.\n"
+"\n"
+msgstr ""
+"Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.\n"
+"Este programa software libre, coberto pola Licencia Pblica Xeral de GNU.\n"
+"\n"
+"Este programa distribudo coa esperanza de que sexa til, pero SEN "
+"NINGUNHA GARANTA; nin sequera a garanta implcita de COMERCIABILIDADE ou "
+"APTITUDE PARA UN FIN EN PARTICULAR. Vexa a Licencia Pblica Xeral de GNU "
+"para ter mis detalles.\n"
+
+#: parted/parted.c:152
+#, c-format
+msgid "%0.f%%\t(time left %.2d:%.2d)"
+msgstr "%0.f%%\t(tempo restante %.2d:%.2d)"
+
+#: parted/parted.c:170
+#, c-format
+msgid ""
+"Partition %s is being used. You must unmount it before you modify it with "
+"Parted."
+msgstr ""
+
+#: parted/parted.c:187
+#, c-format
+msgid "Partition(s) on %s are being used."
+msgstr "Esta(n)se a usa-la(s) particin(s) de %s."
+
+#: parted/parted.c:413 parted/parted.c:594 parted/parted.c:979
+#: parted/parted.c:1059 parted/parted.c:1586 parted/parted.c:1663
+#: parted/parted.c:1707
+msgid "Partition number?"
+msgstr "Nmero de particin?"
+
+#: parted/parted.c:456
+msgid "Source device?"
+msgstr "Dispositivo orixe?"
+
+#: parted/parted.c:460
+msgid "Source partition number?"
+msgstr "Nmero da particin orixe?"
+
+#: parted/parted.c:465
+#, fuzzy
+msgid "Can't copy an extended partition."
+msgstr "Non se poden copiar particins estendidas."
+
+#: parted/parted.c:471
+msgid "Destination partition number?"
+msgstr "Nmero da particin de destino?"
+
+#: parted/parted.c:564
+msgid "New disk label type?"
+msgstr "Novo tipo de etiqueta de disco?"
+
+#: parted/parted.c:598
+msgid "File system?"
+msgstr "Sistema de ficheiros?"
+
+#: parted/parted.c:645 parted/parted.c:815
+msgid "Partition type?"
+msgstr "Tipo de particin?"
+
+#: parted/parted.c:652 parted/parted.c:822 parted/parted.c:1062
+msgid "Partition name?"
+msgstr "Nome da particin?"
+
+#: parted/parted.c:660 parted/parted.c:832
+msgid "File system type?"
+msgstr "Tipo de sistema de ficheiros?"
+
+#: parted/parted.c:667 parted/parted.c:834 parted/parted.c:994
+#: parted/parted.c:1544 parted/parted.c:1595
+msgid "Start?"
+msgstr "Inicio?"
+
+#: parted/parted.c:669 parted/parted.c:837 parted/parted.c:997
+#: parted/parted.c:1546 parted/parted.c:1597
+msgid "End?"
+msgstr "Fin?"
+
+#: parted/parted.c:707 parted/parted.c:875
+#, fuzzy, c-format
+msgid ""
+"You requested a partition from %s to %s.\n"
+"The closest location we can manage is %s to %s. Is this still acceptable to "
+"you?"
+msgstr ""
+"Solicitou move-la particin a %.3f-%.3fMb. O mis semellante que pode "
+"manexar Parted %.3f-%.3fMb."
+
+#: parted/parted.c:827
+#, fuzzy
+msgid "An extended partition cannot hold a file system. Did you want mkpart?"
+msgstr ""
+"As particins estendidass non poden ter sistemas de ficheiros. Quera "
+"executar mkpart?"
+
+#: parted/parted.c:985
+#, fuzzy
+msgid "Can't move an extended partition."
+msgstr "Non se poden move-las particins extendidas."
+
+#: parted/parted.c:1014
+msgid "Can't move a partition onto itself. Try using resize, perhaps?"
+msgstr "Non se pode mover unha particin a si mesma. Non querer usar resize?"
+
+#: parted/parted.c:1158
+#, c-format
+msgid "Minor: %d\n"
+msgstr "Menor: %d\n"
+
+#: parted/parted.c:1159
+#, fuzzy, c-format
+msgid "Flags: %s\n"
+msgstr "Modificadores: "
+
+#: parted/parted.c:1160
+#, c-format
+msgid "File System: %s\n"
+msgstr "Sistema de Ficheiros: %s\n"
+
+#: parted/parted.c:1161
+#, fuzzy, c-format
+msgid "Size: "
+msgstr "Tamao: %10.3fMb (%d%%)\n"
+
+#: parted/parted.c:1166
+#, fuzzy, c-format
+msgid "Minimum size: "
+msgstr "Tam. mnimo: %10.3fMb (%d%%)\n"
+
+#: parted/parted.c:1169
+#, fuzzy, c-format
+msgid "Maximum size: "
+msgstr "Tam. Mximo: %10.3fMb (%d%%)\n"
+
+#: parted/parted.c:1255
+#, fuzzy, c-format
+msgid "Disk %s: %s\n"
+msgstr "%s %s %s"
+
+#: parted/parted.c:1256
+#, c-format
+msgid "Sector size (logical/physical): %lldB/%lldB\n"
+msgstr ""
+
+#: parted/parted.c:1267
+#, c-format
+msgid "BIOS cylinder,head,sector geometry: %d,%d,%d. Each cylinder is %s.\n"
+msgstr ""
+
+#: parted/parted.c:1273
+#, fuzzy, c-format
+msgid "Partition Table: %s\n"
+msgstr "Nome da particin?"
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Number"
+msgstr ""
+
+#: parted/parted.c:1284 parted/parted.c:1287
+#, fuzzy
+msgid "Start"
+msgstr "Inicio?"
+
+#: parted/parted.c:1285 parted/parted.c:1288
+#, fuzzy
+msgid "End"
+msgstr "Fin?"
+
+#: parted/parted.c:1288
+#, fuzzy
+msgid "Size"
+msgstr "resize"
+
+#: parted/parted.c:1292
+msgid "Type"
+msgstr ""
+
+#: parted/parted.c:1294
+#, fuzzy
+msgid "File system"
+msgstr "Sistema de ficheiros?"
+
+#: parted/parted.c:1297
+#, fuzzy
+msgid "Name"
+msgstr "name"
+
+#: parted/parted.c:1299
+msgid "Flags"
+msgstr "Modificadores"
+
+#: parted/parted.c:1352
+msgid "Free Space"
+msgstr ""
+
+#: parted/parted.c:1441
+#, fuzzy, c-format
+msgid ""
+"A %s %s partition was found at %s -> %s. Do you want to add it to the "
+"partition table?"
+msgstr ""
+"Atopouse unha particin %s %s en %.3fMb -> %.3fMb. Quere engadila tboa "
+"de particins?"
+
+#: parted/parted.c:1479
+msgid "searching for file systems"
+msgstr "buscando sistemas de ficheiros"
+
+#: parted/parted.c:1684
+msgid "New device?"
+msgstr "Novo dispositivo?"
+
+#: parted/parted.c:1709
+#, fuzzy
+msgid "Flag to Invert?"
+msgstr "Modificador a cambiar?"
+
+#: parted/parted.c:1714
+msgid "New state?"
+msgstr "Novo estado?"
+
+#: parted/parted.c:1747
+msgid "Unit?"
+msgstr ""
+
+#: parted/parted.c:1896
+msgid "check"
+msgstr "check"
+
+#: parted/parted.c:1899
+#, fuzzy
+msgid ""
+"check NUMBER do a simple check on the file system"
+msgstr ""
+"check MENOR facer unha comprobacin simple no sistema de "
+"ficheiros"
+
+#: parted/parted.c:1905
+msgid "cp"
+msgstr "cp"
+
+#: parted/parted.c:1908
+#, fuzzy
+msgid ""
+"cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another "
+"partition"
+msgstr ""
+"cp [DE-DISPOSITIVO] DE-MENOR A-MENOR copiar sistema de fich. noutra "
+"particin"
+
+#: parted/parted.c:1914
+msgid "help"
+msgstr "help"
+
+#: parted/parted.c:1917
+#, fuzzy
+msgid ""
+"help [COMMAND] prints general help, or help on "
+"COMMAND"
+msgstr "help [COMANDO] amosar axuda xeral, ou axuda sobre o COMANDO"
+
+#: parted/parted.c:1923
+msgid "mklabel"
+msgstr "mklabel"
+
+#: parted/parted.c:1926
+#, fuzzy
+msgid ""
+"mklabel LABEL-TYPE create a new disklabel (partition "
+"table)"
+msgstr ""
+"mklabel TIPO-ETIQUETA crear unha nova etiqueta de disco/tboa de particin"
+
+#: parted/parted.c:1932
+msgid "mkfs"
+msgstr "mkfs"
+
+#: parted/parted.c:1935
+#, fuzzy
+msgid ""
+"mkfs NUMBER FS-TYPE make a FS-TYPE file system on "
+"partititon NUMBER"
+msgstr ""
+"mkfs MENOR TIPO-SF crear un sistema de ficheiros TIPO-SF na particin "
+"MENOR"
+
+#: parted/parted.c:1941
+msgid "mkpart"
+msgstr "mkpart"
+
+#: parted/parted.c:1944
+#, fuzzy
+msgid "mkpart PART-TYPE [FS-TYPE] START END make a partition"
+msgstr "mkpart TIPO-PARTICION [TIPO-FS] INICIO FIN crear unha particin"
+
+#: parted/parted.c:1950
+msgid ""
+"mkpart makes a partition without creating a new file system on the "
+"partition. FS-TYPE may be specified to set an appropriate partition ID.\n"
+msgstr ""
+"mkpart crea unha particin sen crear un novo sistema de ficheiros na "
+"particin. Debe especificarse TIPO-SF para estabrecer un ID de particin "
+"axeitado.\n"
+
+#: parted/parted.c:1955
+msgid "mkpartfs"
+msgstr "mkpartfs"
+
+#: parted/parted.c:1958
+#, fuzzy
+msgid ""
+"mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system"
+msgstr ""
+"mkpartfs TIPO-PARTICION TIPO-SF INICIO FIN\n"
+" crear unha particin cun sistema de "
+"ficheiros"
+
+#: parted/parted.c:1964
+msgid "move"
+msgstr "move"
+
+#: parted/parted.c:1967
+#, fuzzy
+msgid "move NUMBER START END move partition NUMBER"
+msgstr "move MENOR INICIO FIN move-la particin MENOR"
+
+#: parted/parted.c:1972
+msgid "name"
+msgstr "name"
+
+#: parted/parted.c:1975
+#, fuzzy
+msgid "name NUMBER NAME name partition NUMBER as NAME"
+msgstr "name MENOR NOME poe-lo NOME particin MENOR"
+
+#: parted/parted.c:1980
+msgid "print"
+msgstr "print"
+
+#: parted/parted.c:1983
+#, fuzzy
+msgid ""
+"print [free|NUMBER|all] display the partition table, a "
+"partition, or all devices"
+msgstr ""
+"print [MENOR] amosa-la tboa de particins ou unha particin"
+
+#: parted/parted.c:1987
+#, fuzzy
+msgid ""
+"Without arguments, print displays the entire partition table. With 'free'\n"
+"argument, information about free space will be displayed otherwise if a\n"
+"partition number is given, then more detailed information is displayed\n"
+"about that partition. If the 'all' argument is passed instead, partition\n"
+"information for all devices will be displayed."
+msgstr ""
+"Sen argumentos, print amosa toda a tboa de particins. Se se d\n"
+"un nmero de particin, hase amosar informacin mis detallada sobre\n"
+"esa particin.\n"
+
+#: parted/parted.c:1995
+msgid "quit"
+msgstr "quit"
+
+#: parted/parted.c:1998
+#, fuzzy
+msgid "quit exit program"
+msgstr "quit sar do programa"
+
+#: parted/parted.c:2003
+msgid "rescue"
+msgstr "rescue"
+
+#: parted/parted.c:2006
+#, fuzzy
+msgid ""
+"rescue START END rescue a lost partition near START "
+"and END"
+msgstr ""
+"rescue INICIO FIN recupera unha particin perdida entre INICIO e "
+"FIN"
+
+#: parted/parted.c:2012
+msgid "resize"
+msgstr "resize"
+
+#: parted/parted.c:2015
+#, fuzzy
+msgid ""
+"resize NUMBER START END resize partition NUMBER and its "
+"file system"
+msgstr ""
+"resize MENOR INICIO FIN cambia o tamao do sistema de ficheiros da part. "
+"MENOR"
+
+#: parted/parted.c:2023
+msgid "rm"
+msgstr "rm"
+
+#: parted/parted.c:2026
+#, fuzzy
+msgid "rm NUMBER delete partition NUMBER"
+msgstr "rm MENOR borra-la particin MENOR"
+
+#: parted/parted.c:2031
+msgid "select"
+msgstr "select"
+
+#: parted/parted.c:2034
+#, fuzzy
+msgid "select DEVICE choose the device to edit"
+msgstr "select DISPOSITIVO escolle-lo dispositivo a editar"
+
+#: parted/parted.c:2039
+msgid "set"
+msgstr "set"
+
+#: parted/parted.c:2042
+#, fuzzy
+msgid ""
+"set NUMBER FLAG STATE change the FLAG on partition NUMBER"
+msgstr "rm MENOR borra-la particin MENOR"
+
+#: parted/parted.c:2048
+msgid "toggle"
+msgstr ""
+
+#: parted/parted.c:2051
+#, fuzzy
+msgid ""
+"toggle [NUMBER [FLAG]] toggle the state of FLAG on "
+"partition NUMBER"
+msgstr "rm MENOR borra-la particin MENOR"
+
+#: parted/parted.c:2057
+#, fuzzy
+msgid "unit"
+msgstr "quit"
+
+#: parted/parted.c:2060
+#, fuzzy
+msgid "unit UNIT set the default unit to UNIT"
+msgstr "boot MENOR establece-la particin de arrinque a MENOR"
+
+#: parted/parted.c:2065
+msgid "version"
+msgstr ""
+
+#: parted/parted.c:2068
+msgid ""
+"version displays the current version of GNU "
+"Parted and copyright information"
+msgstr ""
+
+#: parted/parted.c:2072
+msgid ""
+"version displays copyright and version information corressponding to this "
+"copy of GNU Parted\n"
+msgstr ""
+
+#: parted/parted.c:2158
+msgid "No device found"
+msgstr "Non se atopou o dispositivo."
+
+#: parted/parted.c:2222
+msgid "Don't forget to update /etc/fstab, if necessary.\n"
+msgstr "Non esqueza actualizar /etc/fstab, se necesario.\n"
+
+#: parted/ui.c:68
+msgid "Welcome to GNU Parted! Type 'help' to view a list of commands.\n"
+msgstr ""
+
+#: parted/ui.c:71
+#, fuzzy
+msgid ""
+"Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]\n"
+"Apply COMMANDs with PARAMETERS to DEVICE. If no COMMAND(s) are given, run "
+"in\n"
+"interactive mode.\n"
+msgstr ""
+"Uso: parted [OPCIN]... [DISPOSITIVO [COMANDO [PARMETROS]...]...]\n"
+"Aplica-lo COMANDO cos PARMETROS ao DISPOSITIVO. Se non se indica ningn\n"
+"COMANDO, funciona en modo interactivo.\n"
+
+#: parted/ui.c:76
+#, c-format
+msgid ""
+"\n"
+"\n"
+"You found a bug in GNU Parted! Here's what you have to do:\n"
+"\n"
+"Don't panic! The bug has most likely not affected any of your data.\n"
+"Help us to fix this bug by doing the following:\n"
+"\n"
+"Check whether the bug has already been fixed by checking\n"
+"the last version of GNU Parted that you can find at:\n"
+"\n"
+"\thttp://ftp.gnu.org/gnu/parted/\n"
+"\n"
+"Please check this version prior to bug reporting.\n"
+"\n"
+"If this has not been fixed yet or if you don't know how to check,\n"
+"please visit the GNU Parted website:\n"
+"\n"
+"\thttp://www.gnu.org/software/parted\n"
+"\n"
+"for further information.\n"
+"\n"
+"Your report should contain the version of this release (%s)\n"
+"along with the error message below, the output of\n"
+"\n"
+"\tparted DEVICE unit co print unit s print\n"
+"\n"
+"and additional information about your setup you consider important.\n"
+msgstr ""
+
+#: parted/ui.c:230
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_MAPERR (Address not mapped to object)"
+msgstr ""
+
+#: parted/ui.c:235
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_ACCERR (Invalid permissions for mapped object)"
+msgstr ""
+
+#: parted/ui.c:240
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGSEGV signal was encountered."
+msgstr ""
+
+#: parted/ui.c:258
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTDIV (Integer: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:262
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTOVF (Integer: overflow)"
+msgstr ""
+
+#: parted/ui.c:266
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTDIV (Float: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:270
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTOVF (Float: overflow)"
+msgstr ""
+
+#: parted/ui.c:274
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTUND (Float: underflow)"
+msgstr ""
+
+#: parted/ui.c:278
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTRES (Float: inexact result)"
+msgstr ""
+
+#: parted/ui.c:282
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTINV (Float: invalid operation)"
+msgstr ""
+
+#: parted/ui.c:286
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTSUB (Float: subscript out of range)"
+msgstr ""
+
+#: parted/ui.c:291
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGFPE signal was encountered."
+msgstr ""
+
+#: parted/ui.c:310
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPC (Illegal Opcode)"
+msgstr ""
+
+#: parted/ui.c:314
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPN (Illegal Operand)"
+msgstr ""
+
+#: parted/ui.c:318
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLADR (Illegal addressing mode)"
+msgstr ""
+
+#: parted/ui.c:323
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLTRP (Illegal Trap)"
+msgstr ""
+
+#: parted/ui.c:327
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVOPC (Privileged Opcode)"
+msgstr ""
+
+#: parted/ui.c:331
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVREG (Privileged Register)"
+msgstr ""
+
+#: parted/ui.c:335
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_COPROC (Coprocessor Error)"
+msgstr ""
+
+#: parted/ui.c:339
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_BADSTK (Internal Stack Error)"
+msgstr ""
+
+#: parted/ui.c:343
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGILL signal was encountered."
+msgstr ""
+
+#: parted/ui.c:828
+msgid "Expecting a partition number."
+msgstr "Esprase un nmero de particin."
+
+#: parted/ui.c:837
+msgid "Partition doesn't exist."
+msgstr "A particin non existe."
+
+#: parted/ui.c:857
+msgid "Expecting a file system type."
+msgstr "Esprase un tipo de sistema de ficheiros."
+
+#: parted/ui.c:863
+#, c-format
+msgid "Unknown file system type \"%s\"."
+msgstr "Tipo de sistema de ficheiros \"%s\" descoecido."
+
+#: parted/ui.c:883
+msgid "Expecting a disk label type."
+msgstr "Esprase un tipo de etiqueta de disco."
+
+#: parted/ui.c:977
+msgid "Can't create any more partitions."
+msgstr "Non se poden crear mis particins."
+
+#: parted/ui.c:987
+msgid "Expecting a partition type."
+msgstr "Esprase un tipo de particin."
+
+#: parted/ui.c:1115
+msgid "on"
+msgstr "on"
+
+#: parted/ui.c:1116
+msgid "off"
+msgstr "off"
+
+#: parted/ui.c:1227
+msgid "OPTIONs:"
+msgstr "OPCINs:"
+
+#: parted/ui.c:1230
+msgid "COMMANDs:"
+msgstr "COMANDOs:"
+
+#: parted/ui.c:1238
+#, c-format
+msgid "Using %s\n"
+msgstr "Usando %s\n"
+
+#, fuzzy
+#~ msgid ""
+#~ "This ext2 file system has a rather strange layout! Parted can't resize "
+#~ "this (yet)."
+#~ msgstr ""
+#~ "Este sistema de ficheiros ten unha organizacin moi estraa! Parted non "
+#~ "lle pode cambia-lo tamao a isto (anda)."
+
+#~ msgid "IDE"
+#~ msgstr "IDE"
+
+#, fuzzy
+#~ msgid "Disk geometry for %s: %s - %s\n"
+#~ msgstr "Xeometra de disco de %s: 0.000-%.3f megabytes\n"
+
+#~ msgid "Disk label type: %s\n"
+#~ msgstr "Tipo de etiqueta de disco: %s\n"
+
+#, fuzzy
+#~ msgid "set NUMBER FLAG STATE change a flag on partition NUMBER"
+#~ msgstr ""
+#~ "set MENOR MODIF ESTADO cambiar un MODIFicador na particin MENOR"
+
+#, fuzzy
+#~ msgid ""
+#~ "The sector size on %s is %d bytes. Parted is known not to work properly "
+#~ "with drives with sector sizes other than %d bytes."
+#~ msgstr ""
+#~ "O tamao dos sectores de %s de %d bytes. Sbese que parted non traballa "
+#~ "correctamente con unidades que tean un tamao de sector distinto de %d "
+#~ "bytes"
+
+#~ msgid ""
+#~ "You found a bug in GNU Parted. Please email a bug report to bug-"
+#~ "parted@gnu.org containing the version (%s), and the following message:\n"
+#~ msgstr ""
+#~ "Atopou un erro en GNU parted. Por favor, enve un informe de erro a bug-"
+#~ "parted@gnu.org que contea a versin (%s) e a seguinte mensaxe:\n"
+
+#, fuzzy
+#~ msgid ""
+#~ "You requested to create a partition at %s - %s. The closest Parted can "
+#~ "manage is %s - %s."
+#~ msgstr ""
+#~ "Solicitou crear unha particin en %.3f-%.3fMb. O mis semellante que pode "
+#~ "manexar Parted %.3f-%.3fMb."
+
+#, fuzzy
+#~ msgid ""
+#~ "You requested to resize the partition to %s - %s. The closest Parted can "
+#~ "manage is %s - %s."
+#~ msgstr ""
+#~ "Solicitou cambia-lo tamao da particin a %.3f-%.3fMb. O mis semellante "
+#~ "que pode manexar Parted %.3f-%.3fMb."
+
+#~ msgid "SCSI"
+#~ msgstr "SCSI"
+
+#~ msgid "File system has an invalid signature for a FAT file systems."
+#~ msgstr ""
+#~ "O sistema de ficheiros ten unha sinatura incorrecta para un sistema de "
+#~ "ficheiros FAT."
+
+#~ msgid "Minor Start End "
+#~ msgstr "Menor Inicio Fin "
+
+#~ msgid "Type "
+#~ msgstr "Tipo "
+
+#~ msgid "Filesystem "
+#~ msgstr "Sistema de ficheiros "
+
+#~ msgid "Name "
+#~ msgstr "Nome "
+
+#~ msgid "Device %s is neither a SCSI nor IDE drive."
+#~ msgstr "O dispositivo %s non unha unidade SCSI nin IDE."
+
+#~ msgid "Error reading %s (%s) to determine if partition is mounted."
+#~ msgstr "Erro ao ler %s (%s) para determinar se a particin est montada."
+
+#~ msgid ""
+#~ "Unable to determine if partitions are mounted via /proc/mounts or /etc/"
+#~ "mtab. Make sure you don't attempt to resize or modify mounted file "
+#~ "systems. (Even read-only mounted)"
+#~ msgstr ""
+#~ "Non se puido determinar se as particins estn montadas mediante /proc/"
+#~ "mounts ou /etc/mtab. Asegrese de que non tenta cambia-lo tamao ou "
+#~ "modificar sistemas de ficheiros montados (incluso se estn montados en s-"
+#~ "lectura)."
+
+#~ msgid "Could not read geometry of %s - %s."
+#~ msgstr "Non se puido le-la xeometra de %s - %s."
+
+#~ msgid "Device %s has dodgey geometry."
+#~ msgstr "O dispositivo %s ten unha xeometra moi estraa."
+
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. However, the most likely reason is that Linux "
+#~ "detected the BIOS geometry for %s incorrectly. GNU Parted suspects the "
+#~ "real geometry should be %d/%d/%d (not %d/%d/%d). You should check with "
+#~ "your BIOS first, as this may not be correct. You can inform Linux by "
+#~ "adding the parameter %s=%d,%d,%d to the command line. See the LILO or "
+#~ "GRUB documentation for more information. If you think Parted's suggested "
+#~ "geometry is correct, you may select Ignore to continue (and fix Linux "
+#~ "later). Otherwise, select Cancel (and fix Linux and/or the BIOS now)."
+#~ msgstr ""
+#~ "A tboa de particins de %s non consistente. Hai moitos motivos polos "
+#~ "que isto puido pasar. Nembargantes, o motivo mis probable que Linux "
+#~ "detectara a xeometra da BIOS de %s incorrectamente. GNU Parted sospeita "
+#~ "que a verdadeira xeometra debera ser %d/%d/%d (e non %d/%d/%d). Debera "
+#~ "comprobar isto coa BIOS primeiro, porque todo isto podera non ser "
+#~ "correcto. Pode informar a Linux engadindo o parmetro %s=%d,%d,%d na lia "
+#~ "de comando. Vexa a documentacin de LILO ou GRUB para obter mis "
+#~ "informacin. Se cre que a xeometra suxerida por Parted correcta, pode "
+#~ "escoller \"Ignorar\" para continuar (e arranxar Linux despois). Noutro "
+#~ "caso, escolla \"Cancelar\" (e arranxe Linux e/ou a BIOS agora)."
+
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. Often, the reason is that Linux detected the "
+#~ "BIOS geometry incorrectly. However, this does not appear to be the case "
+#~ "here. It is safe to ignore,but ignoring may cause (fixable) problems "
+#~ "with some boot loaders, and may cause problems with FAT file systems. "
+#~ "Using LBA is recommended."
+#~ msgstr ""
+#~ "A tboa de particins de %s non consistente. Hai moitos motivos polos "
+#~ "que isto puido pasar. Moitas veces, o motivo que Linux detectou a "
+#~ "xeometra da BIOS incorrectamente. Nembargantes, este non parece se-lo "
+#~ "caso agora. Pdese ignorar isto de xeito seguro pero facelo pode causar "
+#~ "problemas (que se poden arranxar) con algns cargadores de inicio, e "
+#~ "tamn pode causar problemas con sistemas de ficheiros FAT. Recomndase o "
+#~ "emprego de LBA."
+
+#~ msgid ""
+#~ "Unable to align partition properly. This probably means that another "
+#~ "partitioning tool generated an incorrect partition table, because it "
+#~ "didn't have the correct BIOS geometry. It is safe to ignore,but ignoring "
+#~ "may cause (fixable) problems with some boot loaders."
+#~ msgstr ""
+#~ "Non se puido alia-la particin correctamente. Isto, seguramente, "
+#~ "signifique que outra ferramenta de particionamento xerou unha tboa de "
+#~ "particins incorrecta, porque non tia a xeometra da BIOS correcta. "
+#~ "Pdese ignorar de xeito seguro, pero facelo pode provocar problemas (que "
+#~ "se poden arranxar) con algns cargadores de inicio."
+
+#~ msgid ""
+#~ " You have Windows FAT partition(s) that are not using LBA. If your BIOS "
+#~ "supports LBA, then you should switch to LBA by setting the LBA flag on "
+#~ "all FAT partitions. Otherwise, make sure the operating system and the "
+#~ "BIOS have the same geometry before resizing any FAT partitions."
+#~ msgstr ""
+#~ " Ten particins FAT de Windows que non empregan LBA. Se a BIOS soporta "
+#~ "LBA debera cambiar a LBA estabrecendo o modificador LBA en tdalas "
+#~ "particins FAT. Noutro caso, asegrese de que o sistema operativo e a "
+#~ "BIOS teen a mesma xeometra antes de cambia-lo tamao de ningunha "
+#~ "particin FAT."
+
+#~ msgid ""
+#~ "The operating system thinks the geometry on %s is %d/%d/%d. Therefore, "
+#~ "cylinder 1024 ends at %.3fM.%s"
+#~ msgstr ""
+#~ "O sistema operativo cre que a xeometra de %s %d/%d/%d. Polo tanto, o "
+#~ "cilindro 1024 remata en %.3fM.%s"
+
+#~ msgid "The operating system thinks the geometry on %s is %d/%d/%d.%s"
+#~ msgstr "O sistema operativo cre que a xeometra de %s %d/%d/%d.%s"
+
+#~ msgid "Partition %s is being used."
+#~ msgstr "Estase a usa-la particin %s."
+
+#~ msgid "START and END are in megabytes\n"
+#~ msgstr "INICIO e FIN indcanse en megabytes\n"
+
+#~ msgid ""
+#~ "The FATs aren't big enough to describe all clusters! Each FAT is %d "
+#~ "sectors. There are %d clusters, which would require each FAT to be %d "
+#~ "sectors. This is REALLY weird. You might want to write us an email: bug-"
+#~ "parted@gnu.org"
+#~ msgstr ""
+#~ "As FATs non son grandes dabondo para describir tdolos clusters! Cada "
+#~ "FAT ten %d sectores. Hai %d clusters, que precisan que cada FAT tea %d "
+#~ "sectores. Isto SI que estrao. Se cadra debera mandarnos unha mensaxe "
+#~ "electrnica: bug-parted@gnu.org"
+
+# Para que carallo pon este a abreviatura MB en minsculas,
+# cando todo o mundo sabe que en maisculas? - jt
+#~ msgid ""
+#~ "This swap partition is not compatible with Linux version 2.1.117 or "
+#~ "earlier. Use a smaller partition (maximum size 128mb) if you want to use "
+#~ "old versions of Linux."
+#~ msgstr ""
+#~ "Esta particin de intercambio non compatible con Linux versin 2.1.117 "
+#~ "ou anterior. Empregue unha particin mis pequena (tamao mximo 128MB) "
+#~ "se quere usar versins antigas de Linux."
+
+#~ msgid "unknown"
+#~ msgstr "descoecido"
+
+#~ msgid "Unknown SCSI"
+#~ msgstr "SCSI descoecido"
+
+#~ msgid "GUID Partition Table Header Signature is wrong: "
+#~ msgstr "A Sinatura Cabeceira da Tboa de Particins GUID incorrecta: "
+
+#~ msgid " should be "
+#~ msgstr " deba ser "
+
+#~ msgid "GPT Header CRC check failed, %x should be %x."
+#~ msgstr "A comprobacin CRC da Cabeceira GPT, %x deba ser %x."
+
+#~ msgid "GPT Partition Entry Array CRC check failed, %x should be %x."
+#~ msgstr ""
+#~ "A comprobacin CRC do Array de Entradas da Particin GPT fallou, %x deba "
+#~ "ser %x."
+
+#~ msgid ""
+#~ "This disk contains a valid Primary and Alternate GUID Partition Table but "
+#~ "the Protective MBR is invalid. This generally means that the disk had "
+#~ "GPT partitions on it, but then a legacy partition editing tool was used "
+#~ "to change the partition table stored in the MBR.\n"
+#~ "Which data is valid, GPT or MBR?\n"
+#~ "Yes will assume that the GPT information is correct, and rewrite the "
+#~ "PMBR.\n"
+#~ "No will assume that the MBR is correct, and erase the GPT information.\n"
+#~ "Ignore will assume that the MBR is correct, but not change the disk."
+#~ msgstr ""
+#~ "Este disco contn unha Tboa de Particin GUID Primaria e Alternativa, "
+#~ "pero o MBR Protector non vlido. Isto adoita significar que o disco "
+#~ "tia particins GPT, pero despois empregouse unha ferramenta de "
+#~ "particionamento antiga para cambia-la tboa de particins armacenada no "
+#~ "MBR.\n"
+#~ "Que datos son vlidos, GPT ou MBR?\n"
+#~ "Si ha supor que a informacin GPT correcta, e ha regrava-lo PMBR.\n"
+#~ "Non ha supor que o MBR correcto, e ha borra-la informacin GPT.\n"
+#~ "Ignorar ha supor que o MBR correcto, pero non ha cambia-lo disco."
+
+#~ msgid ""
+#~ "This disk contains a valid Alternate GUID Partition Table but the Primary "
+#~ "GPT and Protective MBR are invalid. This generally means that the disk "
+#~ "had GPT partitions on it, but then a legacy partition editing tool was "
+#~ "used to change the partition table stored in the MBR.\n"
+#~ "Which data is valid, GPT or MBR?\n"
+#~ "Yes will assume that the GPT information is correct, and will rewrite the "
+#~ "PMBR and Primary GPT.\n"
+#~ "No will assume that the MBR is correct, and erase the GPT information.\n"
+#~ "Ignore will assume that the MBR is correct, but not change the disk."
+#~ msgstr ""
+#~ "Este disco contn unha Taboa de Particins GUID Alternativa vlida, pero "
+#~ "a GPT Primaria e o MBR Protector non son vlidos. Isto adoita significar "
+#~ "que o disco tivo particins GPT pero despois empregouse unha ferramenta "
+#~ "de particionamento antiga para cambia-la tboa de particins armacenada "
+#~ "no MBR.\n"
+#~ "Que datos son vlidos, GPT ou MBR?\n"
+#~ "Si ha supor que a informacin GPT correcta, e ha regrava-lo PMBR e a "
+#~ "GPT Primaria.\n"
+#~ "Non ha supor que o MBR correcto, e ha borra-la informacin GPT.\n"
+#~ "Ignorar ha supor que o MBR correcto, pero non ha cambia-lo disco."
+
+#~ msgid ""
+#~ "This disk contains a valid Primary GUID Partition Table but the Alternate "
+#~ "GPT and Protective MBR are invalid. This generally means that the disk "
+#~ "had GPT partitions on it, but then a legacy partition editing tool was "
+#~ "used to change the partition table stored in the MBR.\n"
+#~ "Which data is valid, GPT or MBR?\n"
+#~ "Yes will assume that the GPT information is correct, and will rewrite the "
+#~ "PMBR and Alternate GPT.\n"
+#~ "No will assume that the MBR is correct, and erase the GPT information.\n"
+#~ "Ignore will assume that the MBR is correct, but not change the disk.\n"
+#~ msgstr ""
+#~ "Este disco contn unha Taboa de Particins GUID Primaria vlida, pero a "
+#~ "GPT Alternativa e o MBR Protector non son vlidos. Isto adoita significar "
+#~ "que o disco tivo particins GPT pero despois empregouse unha ferramenta "
+#~ "de particionamento antiga para cambia-la tboa de particins armacenada "
+#~ "no MBR.\n"
+#~ "Que datos son vlidos, GPT ou MBR?\n"
+#~ "Si ha supor que a informacin GPT correcta, e ha regrava-lo PMBR e a "
+#~ "GPT Alternativa.\n"
+#~ "Non ha supor que o MBR correcto, e ha borra-la informacin GPT.\n"
+#~ "Ignorar ha supor que o MBR correcto, pero non ha cambia-lo disco.\n"
+
+#~ msgid "The new partition overlaps with another partition."
+#~ msgstr "A nova particin superponse con outra particin."
+
+#~ msgid "Can't set non-Linux partitions as a root device."
+#~ msgstr "Non se poden estabrecer particins non Linux coma dispositivo raiz."
+
+#~ msgid "Can't set non-Linux partitions as a swap device."
+#~ msgstr ""
+#~ "Non se poden estabrecer particins non Linux coma dispositivo de "
+#~ "intercambio."
+
+#~ msgid "No get_resize_constraint for %s!"
+#~ msgstr "%s non ten get_resize_constraint!"
+
+#~ msgid "The %s file system code doesn't support %s disk labels."
+#~ msgstr ""
+#~ "O cdigo do sistema de ficheiros %s non soporta etiquetas de disco %s."
+
+#~ msgid "Creating new %s disklabels is not implemented yet."
+#~ msgstr ""
+#~ "A creacin de novas etiquetas de disco %s non est implementado ainda."
+
+#~ msgid "The code to write the partition table hasn't been written for %s yet"
+#~ msgstr ""
+#~ "Ainda non se escribu o cdigo de escritura de tboas de particins para %"
+#~ "s"
+
+#~ msgid ""
+#~ "Can't resize an extended partition so as to exclude a logical partition."
+#~ msgstr ""
+#~ "Non se pode cambia-lo tamao dunha particin estendida escluindo unha "
+#~ "particin lxica."
+
+#~ msgid "Can't grow a partition onto used space."
+#~ msgstr "Non se pode facer medra-la particin sobre espacio usado."
+
+#~ msgid "Insane! %d clusters!"
+#~ msgstr "Isto unha toleada! %d clusters!"
+
+#~ msgid ""
+#~ "The filesystem is going to be too big for FAT16, so FAT32 will be used. "
+#~ "This is not compatible with MS-DOS, early versions of MS-Windows 95 and "
+#~ "Windows NT. If you use these operating systems, then select cancel, and "
+#~ "create a smaller partition. If you only use Linux, BSD, MS Windows 98 "
+#~ "and/or MS Windows 95 B, then select OK."
+#~ msgstr ""
+#~ "O sistema de ficheiros vai ser grande de mis para FAT16, as que usarase "
+#~ "FAT32. Isto non compatible con MS-DOS, versins antigas de MS-Windows "
+#~ "95 e Windows NT. Se usa eses sistemas operativos, escolla `Cancelar', e "
+#~ "cree unha particin mis pequena. Se s usa Linux, BSD, MS Windows 98 e/"
+#~ "ou MS Windows 95 B, entn escolla `Aceptar'."
+
+#~ msgid "Weird: fat_calc_sizes() failed for FAT32!"
+#~ msgstr "Estrao: fallou a chamada a fat_calc_sizes() para FAT32!"
+
+#~ msgid ""
+#~ "Would you like to use FAT32 for this filesystem? It is much more "
+#~ "efficient with your disk space, but is not compatible with early versions "
+#~ "of Windows 95 and Windows NT. Only select yes if you only use Linux, "
+#~ "BSD, MS Windows 98 and/or MS Windows 95 B."
+#~ msgstr ""
+#~ "Quere usar FAT32 neste sistema de ficheiros? moito mis eficiente co "
+#~ "seu espacio en disco, pero non compatible con versins antigas de "
+#~ "Windows 95 e Windows NT. Escolla `Si' s se s usa Linux, BSD, MS Windows "
+#~ "98 e/ou MS Windows 95 B."
+
+#~ msgid ""
+#~ "File system doesn't have expected sizes for Windows to like it. Number "
+#~ "of clusters is %d (%d expected); size of FATs is %d sectors (%d expected)."
+#~ msgstr ""
+#~ "O sistema de ficheiros non ten os tamaos esperados para que a Windows "
+#~ "lle goste. O nmero de clusters %d (esperbanse %d); o tamao das FATs "
+#~ " de %d sectores (esperbanse %d)."
+
+#~ msgid ""
+#~ "Partition size (%ld sectors) and filesystem size (%ld sectors) do not "
+#~ "match."
+#~ msgstr ""
+#~ "O tamao da particin (%ld sectores) e o do sistema de ficheiros (%ld "
+#~ "sectores) non coinciden."
+
+#~ msgid "Linux-swap partitions can not be hidden on msdos disk labels."
+#~ msgstr ""
+#~ "As particins de intercambio de Linux non poden estar ocultas nas "
+#~ "etiquetas de disco msdos."
+
+#~ msgid "Linux-swap partitions can not be bootable on pc98 disk labels."
+#~ msgstr ""
+#~ "As particins de intercambio de Linux non poden ser de inicio nas "
+#~ "etiquetas de disco msdos."
+
+#~ msgid "HFS partitions can't be hidden on msdos disk labels."
+#~ msgstr ""
+#~ "As particins HFS non poden estar ocultas nas etiquetas de disco msdos."
+
+#~ msgid "JFS partitions can't be hidden on msdos disk labels."
+#~ msgstr ""
+#~ "As particins JFS non poden estar ocultas nas etiquetas de disco msdos."
+
+#~ msgid "Reiserfs partitions can't be hidden on msdos disk labels."
+#~ msgstr ""
+#~ "As particins Reiserfs non poden estar ocultas nas etiquetas de disco "
+#~ "msdos."
+
+#~ msgid "Reiserfs partitions must be bootable on pc98 disk labels."
+#~ msgstr ""
+#~ "As particins Reiserfs deben ser de inicio nas etiquetas de disco pc98."
+
+#~ msgid "XFS partitions can't be hidden on msdos disk labels."
+#~ msgstr ""
+#~ "As particins XFS non poden estar ocultas nas etiquetas de disco msdos."
+
+#~ msgid "Unknown filesystem type."
+#~ msgstr "Tipo de sistema de ficheiros descoecido."
+
+#~ msgid ""
+#~ "The operating system thinks the geometry on %s is %d/%d/%d. You should "
+#~ "check that this matches the BIOS geometry before using this program."
+#~ msgstr ""
+#~ "O sistema operativo cre que a xeometra de %s %d/%d/%d. Debera "
+#~ "comprobar que isto coincide coa xeometra da BIOS antes de usar este "
+#~ "programa."
+
+#~ msgid ""
+#~ "There is no boot code on this disk. Would you like to use GNU parted's "
+#~ "boot loader?"
+#~ msgstr ""
+#~ "Non hai un programa de arrinque neste disco. Quere usa-lo cargador de "
+#~ "GNU parted?"
+
+#~ msgid "No get_system() for %s!"
+#~ msgstr "Non hai unha chamada get_system() para %s!"
+
+#~ msgid "Can't create a partition with the start after the end."
+#~ msgstr "Non se pode crear unha particin co comezo despois da fin."
+
+#~ msgid ""
+#~ "No filesystem found on partition. Can't determine what partition system "
+#~ "to use."
+#~ msgstr ""
+#~ "Non se atopou un sistema de ficheiros na particin. Non se puido "
+#~ "determina-lo sistema de particins a usar."
+
+#~ msgid "FAT filesystems don't have an id for non-msdos partition tables"
+#~ msgstr ""
+#~ "Os sistemas de ficheiros FAT non teen un identificador para tboas de "
+#~ "particins que non son de msdos."
+
+#~ msgid ""
+#~ "Would you like to use FAT32? It is more efficient, but it is not "
+#~ "compatible with MS-DOS, early versions of MS-Windows 95 and Windows NT. "
+#~ "If you use these operating systems, then select No. If you only use "
+#~ "Linux, BSD, MS Windows 98 and/or MS Windows 95 B, then you may select Yes."
+#~ msgstr ""
+#~ "Quere usar FAT32? Moi eficiente, pero non compatible con MS-DOS, "
+#~ "versins antigas de MS-Windows 95 e Windows NT. Se usa eses sistemas "
+#~ "operativos, escolla `Non'. Se s usa Linux, BSD, MS Windows 98 e/ou MS "
+#~ "Windows 95 B, entn pode escoller `Si'."
+
+#~ msgid ""
+#~ "The filesystem is going to be too big for FAT16, so FAT32 must be used. "
+#~ "This is not compatible with MS-DOS, early versions of MS-Windows 95 and "
+#~ "Windows NT. If you use these operating systems, then select Cancel, and "
+#~ "create a smaller partition. If you only use Linux, BSD, MS Windows 98 "
+#~ "and/or MS Windows 95 B, then select OK."
+#~ msgstr ""
+#~ "O sistema de ficheiros vai ser grande de mis para FAT16, as que se ha "
+#~ "usar FAT32. Isto non compatible con MS-DOS, versins antigas de MS-"
+#~ "Windows 95 e Windows NT. Se usa eses sistemas operativos, escolla "
+#~ "`Cancelar', e cree unha particin mis pequena. Se s usa Linux, BSD, MS "
+#~ "Windows 98 e/ou MS Windows 95 B, entn escolla `Aceptar'."
+
+#~ msgid "hide"
+#~ msgstr "hide"
+
+#~ msgid "Disk geometry: 1-%d, %dk cylinders\n"
+#~ msgstr "Xeometra de disco: 1-%d, %dk cilindros\n"
+
+#~ msgid "Minor Start End Type Filesystem Flags\n"
+#~ msgstr ""
+#~ "Menor Inicio Fin Tipo Sist.Ficheiros Modificadores\n"
+
+#~ msgid "unhide"
+#~ msgstr "unhide"
+
+#~ msgid "hide MINOR hides partition MINOR"
+#~ msgstr "hide MENOR agocha-la particin MENOR"
+
+#~ msgid "Partition length of %dk is too small."
+#~ msgstr "A lonxitude da particin de %dk moi pequena."
+
+#~ msgid "There are no possible configurations for this cluster size."
+#~ msgstr "Non hai configuracins posibles para este tamao de cluster."
+
+#~ msgid ""
+#~ "To resize this filesystem to this size, the cluster size must be changed "
+#~ "from %d bytes to %d bytes. This functionality is not yet implemented. "
+#~ "Note that there are many weird different sizes that can be achieved with "
+#~ "the same cluster size - if you keep experimenting with different "
+#~ "partition sizes, you might be lucky!!!"
+#~ msgstr ""
+#~ "Para cambiar este sistema de ficheiros a este tamao, o tamao do cluster "
+#~ "debe ser cambiado de %d bytes a %d bytes. Esta funcionalidade non est "
+#~ "implementada ainda. Tea en conta que hai moitos tamaos diferentes que "
+#~ "se poden conseguir co mesmo tamao de cluster - se segue a experimentar "
+#~ "con diferentes tamaos de particin, podera ter sorte!"
+
+#~ msgid ""
+#~ "The filesystem is going to be too big for FAT16, (with a cluster size of %"
+#~ "dk, anyway) so FAT32 will be used. This is not compatible with MS-DOS, "
+#~ "early versions of MS-Windows 95 and Windows NT. If you use these "
+#~ "operating systems, then select cancel, and create a smaller partition. "
+#~ "If you only use Linux, BSD, MS Windows 98 and/or MS Windows 95 B, then "
+#~ "select OK."
+#~ msgstr ""
+#~ "O sistema de ficheiros ha ser grande de mis para FAT16 (cun tamao de "
+#~ "cluster de %d, de tdolos xeitos), as que se ha usar FAT32. Isto non "
+#~ "compatible con MS-DOS, versins antigas de MS-Windows 95 e Windows NT. Se "
+#~ "usa estes sistemas operativos, escolla `Cancelar' e cree unha particin "
+#~ "mis pequena. Se s usa Linux, BSD, MS Windows 98 e/ou MS Windows 95 B, "
+#~ "escolla `Aceptar'."
+
+#~ msgid "the root directory"
+#~ msgstr "o directorio raiz"
+
+#~ msgid "fat_read_clusters: clusters %ld-%ld outside filesystem"
+#~ msgstr ""
+#~ "fat_read_clusters: os clusters %ld-%ld estn fra do sistema de ficheiros"
+
+#~ msgid "fat_write_clusters: clusters %ld-%ld outside filesystem"
+#~ msgstr ""
+#~ "fat_write_clusters: os clusters %ld-%ld estn fra do sistema de ficheiros"
diff --git a/po/hu.po b/po/hu.po
new file mode 100644
index 0000000..4b65a99
--- /dev/null
+++ b/po/hu.po
@@ -0,0 +1,2047 @@
+# translation of parted-hu2.po to hungary
+# GNU Parted magyar fordítás
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# SZERVÁC Attila &lt;sas-guest@haydn&gt; 2006.
+#
+# Gabor Sari <sari.gabor@gmail.com>, 2006.
+msgid ""
+msgstr ""
+"Project-Id-Version: parted-hu2\n"
+"POT-Creation-Date: \n"
+"PO-Revision-Date: 2006-06-02 10:52+0200\n"
+"Last-Translator: Gabor Sari <sari.gabor@gmail.com>\n"
+"Language-Team: hungary <hu@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.2\n"
+
+#: libparted/arch/linux.c:284
+#, c-format
+msgid "Could not stat device %s - %s."
+msgstr ""
+
+#: libparted/arch/linux.c:390
+#, c-format
+msgid ""
+"Could not determine sector size for %s: %s.\n"
+"Using the default sector size (%lld)."
+msgstr ""
+"Nem látom %s szektorméretét: %s.\n"
+"Az alapértéket (%lld) használom."
+
+#: libparted/arch/linux.c:401
+#, c-format
+msgid "Device %s has a logical sector size of %lld. Not all parts of GNU Parted support this at the moment, and the working code is HIGHLY EXPERIMENTAL.\n"
+msgstr "%s logikai szektormérete: %lld. A GNU Parted nem minden része támogatja ezt még, és a működő kód NAGYON KÍSÉRLETI.\n"
+
+#: libparted/arch/linux.c:441
+#, c-format
+msgid "Unable to determine the size of %s (%s)."
+msgstr "Nem tudom megállapítani %s méretét (%s)."
+
+#: libparted/arch/linux.c:530
+#, c-format
+msgid "Could not get identity of device %s - %s"
+msgstr "Nem tudom azonosítani ezt az eszközt: %s - %s"
+
+#: libparted/arch/linux.c:539
+msgid "Generic IDE"
+msgstr "Általános IDE"
+
+#: libparted/arch/linux.c:556
+#, c-format
+msgid ""
+"Device %s has multiple (%d) logical sectors per physical sector.\n"
+"GNU Parted supports this EXPERIMENTALLY for some special disk label/file system combinations, e.g. GPT and ext2/3.\n"
+"Please consult the web site for up-to-date information."
+msgstr ""
+"%s eszköz fizikai szektorai többszörös (%d) logikai szektorokat tartalmaznak.\n"
+"A GNU Parted ezt most KÍSÉRLETI módon támogatja egyes lemezcímke/fájlrendszer párokhoz, pl.: GPT és ext2/3.\n"
+"Nézd meg a weben elérhető dokumentációt."
+
+#: libparted/arch/linux.c:726
+#, c-format
+msgid "Error initialising SCSI device %s - %s"
+msgstr "Hiba egy SCSI eszköz inicializálásakor: %s - %s"
+
+#: libparted/arch/linux.c:781
+#, c-format
+msgid "The device %s has zero length, and can't possibly store a file system or partition table. Perhaps you selected the wrong device?"
+msgstr "%s eszköz 0 hosszúságú, és valószínűleg nem tárol fájlrendszert vagy partíciós táblát. Talán nem a megfelelő eszközt választottad?"
+
+#: libparted/arch/linux.c:829
+msgid "Unable to determine geometry of file/device. You should not use Parted unless you REALLY know what you're doing!"
+msgstr "Nem látom a fájl/eszköz geometriáját. Ne használd a Parted-et, míg nem tudod VALÓBAN, hogy mit teszel!"
+
+#: libparted/arch/linux.c:903
+msgid "DAC960 RAID controller"
+msgstr "DAC960 RAID vezérlő"
+
+#: libparted/arch/linux.c:908
+msgid "Compaq Smart Array"
+msgstr "Compaq Smart tömb"
+
+#: libparted/arch/linux.c:913
+msgid "ATARAID Controller"
+msgstr "ATARAID vezérlő"
+
+#: libparted/arch/linux.c:918
+msgid "I2O Controller"
+msgstr "I2O vezérlő"
+
+#: libparted/arch/linux.c:923
+msgid "User-Mode Linux UBD"
+msgstr "User-Mode Linux UBD"
+
+#: libparted/arch/linux.c:933
+msgid "Unknown"
+msgstr "Ismeretlen"
+
+#: libparted/arch/linux.c:940
+msgid "ped_device_new() Unsupported device type"
+msgstr "ped_device_new() Nem támogatott eszköz típus"
+
+#: libparted/arch/linux.c:1041
+#: libparted/arch/gnu.c:264
+#, c-format
+msgid "Error opening %s: %s"
+msgstr "Sikertelen megnyitás: %s: %s"
+
+#: libparted/arch/linux.c:1052
+#: libparted/arch/gnu.c:274
+#, c-format
+msgid "Unable to open %s read-write (%s). %s has been opened read-only."
+msgstr "Nem tudom megnyitni írás/olvasásra %s-t (%s). %s most csak olvasható."
+
+#: libparted/arch/linux.c:1160
+#: libparted/arch/linux.c:1228
+#: libparted/arch/gnu.c:452
+#: libparted/arch/gnu.c:550
+#: libparted/arch/gnu.c:678
+#, c-format
+msgid "%s during read on %s"
+msgstr "%s az alábbi olvasásakor: %s"
+
+#: libparted/arch/linux.c:1199
+#, c-format
+msgid "%s during seek for read on %s"
+msgstr "%s a lapozás közben az alábbi olvasásakor: %s"
+
+#: libparted/arch/linux.c:1270
+#: libparted/arch/linux.c:1355
+#: libparted/arch/linux.c:1413
+#: libparted/arch/gnu.c:587
+#: libparted/arch/gnu.c:632
+#: libparted/arch/gnu.c:709
+#, c-format
+msgid "%s during write on %s"
+msgstr "%s az alábbi írásakor %s"
+
+#: libparted/arch/linux.c:1297
+#: libparted/arch/gnu.c:512
+#, c-format
+msgid "Can't write to %s, because it is opened read-only."
+msgstr "Nem tudom írni ezt: %s, mert csak-olvashatóként van megnyitva."
+
+#: libparted/arch/linux.c:1321
+#, c-format
+msgid "%s during seek for write on %s"
+msgstr "%s a lapozás közben az alábbi írásakor: %s"
+
+#: libparted/arch/linux.c:1798
+#, c-format
+msgid "Error informing the kernel about modifications to partition %s -- %s. This means Linux won't know about any changes you made to %s until you reboot -- so you shouldn't mount it or use it in any way before rebooting."
+msgstr "Nem tudtam a rendszermagot értesíteni az alábbi partíció módosításáról: %s -- %s. Ez azt jelenti, hogy a Linux, míg újra nem indítod, nem fog tudni semmit %s változásairól - így semmilyen módon nem fogod tudni használni azt egy újraindítás előtt."
+
+#: libparted/arch/linux.c:1879
+#, c-format
+msgid "The kernel was unable to re-read the partition table on %s (%s). This means Linux won't know anything about the modifications you made until you reboot. You should reboot your computer before doing anything with %s."
+msgstr "A rendszermag nem tudta újraolvasni az alábbi partíciós táblát: %s (%s). Ez azt jelenti, hogy a Linux, míg újra nem indítod, nem fog tudni semmit változásokról. %s bármilyen felhasználása előtt újra kell indítanod a gépet."
+
+#: libparted/arch/gnu.c:97
+#, c-format
+msgid "Unable to open %s."
+msgstr "Nem tudom megnyitni: %s"
+
+#: libparted/arch/gnu.c:117
+msgid "Unable to probe store."
+msgstr ""
+
+#: libparted/arch/gnu.c:355
+msgid "The partition table cannot be re-read. This means you need to reboot before mounting any modified partitions. You also need to reinstall your boot loader before you reboot (which may require mounting modified partitions). It is impossible do both things! So you'll need to boot off a rescue disk, and reinstall your boot loader from the rescue disk. Read section 4 of the Parted User documentation for more information."
+msgstr ""
+
+#: libparted/arch/gnu.c:372
+#, c-format
+msgid "The partition table on %s cannot be re-read (%s). This means the Hurd knows nothing about any modifications you made. You should reboot your computer before doing anything with %s."
+msgstr "Nem tudom újraolvasni %s partíciós tábláját (%s). Tehát a Hurd most nem tud semmit a változásokról. %s bármilyen felhasználása előtt újra kell indítanod a gépet."
+
+#: libparted/arch/gnu.c:383
+#: parted/parted.c:2215
+msgid "You should reinstall your boot loader before rebooting. Read section 4 of the Parted User documentation for more information."
+msgstr "A boot betöltőt újraindítás előtt újra kell telepítened. Ennek érdekében olvasd el Parted felhasználói dokumentáció 4. fejezetét."
+
+#: libparted/arch/gnu.c:774
+#, c-format
+msgid "%s trying to sync %s to disk"
+msgstr ""
+
+#: libparted/disk.c:183
+#, c-format
+msgid "Unable to open %s - unrecognised disk label."
+msgstr "%s nem megnyitható - érthetetlen lemez címke."
+
+#: libparted/disk.c:452
+#, c-format
+msgid "This libparted doesn't have write support for %s. Perhaps it was compiled read-only."
+msgstr "A libparted nem tud írni ide: %s. Lehet, hogy csak-olvasóra fordított."
+
+#: libparted/disk.c:579
+#, c-format
+msgid "Partition %d is %s, but the file system is %s."
+msgstr "A(z) %d. partíció %s, de a fájlrendszer %s."
+
+#: libparted/disk.c:1056
+#, c-format
+msgid "%s disk labels do not support extended partitions."
+msgstr ""
+
+#: libparted/disk.c:1616
+#, c-format
+msgid "%s disk labels don't support logical or extended partitions."
+msgstr ""
+
+#: libparted/disk.c:1629
+msgid "Too many primary partitions."
+msgstr "Túl sok elsődleges partíció."
+
+#: libparted/disk.c:1638
+#, c-format
+msgid "Can't add a logical partition to %s, because there is no extended partition."
+msgstr "Kiterjesztett partíció nélkül nem készíthető logikai partíció ide: %s."
+
+#: libparted/disk.c:1662
+#, c-format
+msgid "Can't have more than one extended partition on %s."
+msgstr "Nem lehet egynél több kiterjesztett partíció itt: %s"
+
+#: libparted/disk.c:1672
+msgid "Can't have logical partitions outside of the extended partition."
+msgstr "Nem lehetnek logikai partíciók a kiterjesztetten kívül."
+
+#: libparted/disk.c:1697
+#, c-format
+msgid "Can't have a logical partition outside of the extended partition on %s."
+msgstr "Nem lehetnek logikai partíciók a kiterjesztetten kívül itt: %s."
+
+#: libparted/disk.c:1707
+#: libparted/disk.c:1761
+#: libparted/disk.c:1927
+msgid "Can't have overlapping partitions."
+msgstr "Nem lehetnek egymást átfedő partíciók."
+
+#: libparted/disk.c:1715
+msgid "Can't have a primary partition inside an extended partition."
+msgstr "Nem lehet elsődleges partíció egy kiterjesztettben."
+
+#: libparted/disk.c:2123
+msgid "metadata"
+msgstr "metaadatok"
+
+#: libparted/disk.c:2125
+msgid "free"
+msgstr "szabad"
+
+#: libparted/disk.c:2127
+#: parted/ui.c:968
+#: parted/ui.c:996
+msgid "extended"
+msgstr "kiterjesztett"
+
+#: libparted/disk.c:2129
+#: parted/ui.c:972
+#: parted/ui.c:1000
+msgid "logical"
+msgstr "logikai"
+
+#: libparted/disk.c:2131
+#: parted/ui.c:964
+#: parted/ui.c:992
+msgid "primary"
+msgstr "elsődleges"
+
+#: libparted/disk.c:2147
+msgid "boot"
+msgstr "boot"
+
+#: libparted/disk.c:2149
+msgid "root"
+msgstr "root"
+
+#: libparted/disk.c:2151
+msgid "swap"
+msgstr "swap"
+
+#: libparted/disk.c:2153
+msgid "hidden"
+msgstr "rejtett"
+
+#: libparted/disk.c:2155
+msgid "raid"
+msgstr "raid"
+
+#: libparted/disk.c:2157
+msgid "lvm"
+msgstr "lvm"
+
+#: libparted/disk.c:2159
+msgid "lba"
+msgstr "lba"
+
+#: libparted/disk.c:2161
+msgid "hp-service"
+msgstr "hp-service"
+
+#: libparted/disk.c:2163
+msgid "palo"
+msgstr "palo"
+
+#: libparted/disk.c:2165
+msgid "prep"
+msgstr "prep"
+
+#: libparted/disk.c:2167
+msgid "msftres"
+msgstr "msftres"
+
+#: libparted/disk.c:2173
+#, c-format
+msgid "Unknown partition flag, %d."
+msgstr "Ismeretlen partíció : %d."
+
+#: libparted/labels/rdb.c:177
+#, c-format
+msgid "%s : Bad checksum on block %llu of type %s."
+msgstr ""
+
+#: libparted/labels/rdb.c:510
+#, c-format
+msgid "%s : Didn't find rdb block, should never happen."
+msgstr ""
+
+#: libparted/labels/rdb.c:595
+#, c-format
+msgid "%s : Loop detected at block %d."
+msgstr ""
+
+#: libparted/labels/rdb.c:614
+#, c-format
+msgid "%s : The %s list seems bad at block %s."
+msgstr "%s : %s lista hibásnak tűnik e blokkon: %s."
+
+#: libparted/labels/rdb.c:703
+#, c-format
+msgid "%s : Failed to list bad blocks."
+msgstr "%s : Hibás blokkok listázása sikertelen."
+
+#: libparted/labels/rdb.c:711
+#, c-format
+msgid "%s : Failed to list partition blocks."
+msgstr "%s : Partíció blokkok listázása sikertelen."
+
+#: libparted/labels/rdb.c:719
+#, c-format
+msgid "%s : Failed to list file system blocks."
+msgstr "%s : Fájlrendszer blokkok listázása sikertelen."
+
+#: libparted/labels/rdb.c:727
+#, c-format
+msgid "%s : Failed to list boot blocks."
+msgstr "%s : Indító blokkok listázása sikertelen."
+
+#: libparted/labels/rdb.c:750
+#, c-format
+msgid "Failed to write partition block at %d."
+msgstr "Partíció blokk írása sikertelen itt: %d."
+
+#: libparted/labels/rdb.c:1053
+#: libparted/labels/bsd.c:505
+#: libparted/labels/dos.c:1942
+#: libparted/labels/dvh.c:772
+#: libparted/labels/gpt.c:1365
+#: libparted/labels/loop.c:251
+#: libparted/labels/mac.c:1318
+#: libparted/labels/pc98.c:764
+#: libparted/labels/sun.c:704
+msgid "Unable to satisfy all constraints on the partition."
+msgstr ""
+
+#: libparted/labels/rdb.c:1081
+msgid "Unable to allocate a partition number."
+msgstr ""
+
+#: libparted/labels/bsd.c:530
+msgid "Unable to allocate a bsd disklabel slot."
+msgstr ""
+
+#: libparted/labels/dos.c:812
+#, c-format
+msgid "Invalid partition table on %s -- wrong signature %x."
+msgstr "Érvénytelen partíciós tábla itt: %s - rossz %x aláírás."
+
+#: libparted/labels/dos.c:840
+#, c-format
+msgid "Invalid partition table - recursive partition on %s."
+msgstr "Érvénytelen partíciós tábla - rekurzív partíció itt: %s."
+
+#: libparted/labels/dos.c:1300
+msgid "Extended partitions cannot be hidden on msdos disk labels."
+msgstr "Kiterjesztett partíciók nem rejthetők msdos lemez címkéken."
+
+#: libparted/labels/dos.c:1926
+msgid "Parted can't resize partitions managed by Windows Dynamic Disk."
+msgstr "A Parted nem tud átméretezni Windows Dynamic Disk által kezelt partíciókat."
+
+#: libparted/labels/dvh.c:192
+#, c-format
+msgid "%s has no extended partition (volume header partition)."
+msgstr ""
+
+#: libparted/labels/dvh.c:315
+msgid "Checksum is wrong, indicating the partition table is corrupt."
+msgstr "Az ellenőrzőösszeg hibás, ez a partíciós tábla hibáját jelzi."
+
+#: libparted/labels/dvh.c:616
+msgid "Only primary partitions can be root partitions."
+msgstr "Csak elsődleges partíciók lehetnek gyökér partíciók."
+
+#: libparted/labels/dvh.c:630
+msgid "Only primary partitions can be swap partitions."
+msgstr "Csak elsődleges partíciók lehetnek csere partíciók."
+
+#: libparted/labels/dvh.c:644
+msgid "Only logical partitions can be a boot file."
+msgstr "Csak elsődleges partíciókból válhat indító fájl."
+
+#: libparted/labels/dvh.c:723
+msgid "Only logical partitions (boot files) have a name."
+msgstr ""
+
+#: libparted/labels/dvh.c:814
+msgid "Too many primary partitions"
+msgstr "Túl sok elsődleges partíció"
+
+#: libparted/labels/gpt.c:433
+#, c-format
+msgid "%s contains GPT signatures, indicating that it has a GPT table. However, it does not have a valid fake msdos partition table, as it should. Perhaps it was corrupted -- possibly by a program that doesn't understand GPT partition tables. Or perhaps you deleted the GPT table, and are now using an msdos partition table. Is this a GPT partition table?"
+msgstr "%s GPT aláírásokat tartalmaz, ez GPT táblát jelez. De nincs érvényes hamis msdos partíciós táblája, ahogy kell. Talán megsérült -- talán egy GPT-hez nem értő program tette ezt. Vagy talán törölted a GPT táblát és most msdos partíciós táblát használsz. Ez egy GPT partíciós tábla?"
+
+#: libparted/labels/gpt.c:625
+#, c-format
+msgid "The format of the GPT partition table is version %x, which is newer than what Parted can recognise. Please tell us! bug-parted@gnu.org"
+msgstr "A GPT partíciós tábla formátumának verziója %x, ami újabb, mint amit a Parted ismer. Kérünk, jelezd nekünk! bug-parted@gnu.org"
+
+#: libparted/labels/gpt.c:747
+msgid "The backup GPT table is not at the end of the disk, as it should be. This might mean that another operating system believes the disk is smaller. Fix, by moving the backup to the end (and removing the old backup)?"
+msgstr "A GPT tábla mentése nem a lemez végén van, ahogy kell. Emiatt más OS a lemezt kisebbnek hiheti. Javítsuk?"
+
+#: libparted/labels/gpt.c:782
+msgid "The primary GPT table is corrupt, but the backup appears OK, so that will be used."
+msgstr "Az elsődleges GPT tábla rossz, de a mentés jónak tűnik, ezért azt használom."
+
+#: libparted/labels/gpt.c:790
+msgid "Both the primary and backup GPT tables are corrupt. Try making a fresh table, and using Parted's rescue feature to recover partitions."
+msgstr "Az elsődleges GPT tábla és mentése is rossz. Próbálj egy újat készíteni, és a Parted-del visszaállítani a partíciókat."
+
+#: libparted/labels/mac.c:167
+#, c-format
+msgid "Invalid signature %x for Mac disk labels."
+msgstr "Érvénytelen %x aláírás Mac lemez címkékhez."
+
+#: libparted/labels/mac.c:212
+msgid "Partition map has no partition map entry!"
+msgstr "A partíciós térkép üres!"
+
+#: libparted/labels/mac.c:259
+#, c-format
+msgid "%s is too small for a Mac disk label!"
+msgstr "%s túl kicsi egy Mac lemez címkéhez!"
+
+#: libparted/labels/mac.c:490
+#, c-format
+msgid "Partition %d has an invalid signature %x."
+msgstr "%d. partíció %x aláírása érvénytelen."
+
+#: libparted/labels/mac.c:508
+#, c-format
+msgid "Partition %d has an invalid length of 0 bytes!"
+msgstr "%d. partíció érvénytelen hosszú 0 bájttal bír!"
+
+#: libparted/labels/mac.c:536
+msgid "The data region doesn't start at the start of the partition."
+msgstr "Az adatterület nem a partíció elején indul."
+
+#: libparted/labels/mac.c:553
+msgid "The boot region doesn't start at the start of the partition."
+msgstr "A boot terület nem a partíció elején indul."
+
+#: libparted/labels/mac.c:567
+msgid "The partition's boot region doesn't occupy the entire partition."
+msgstr "A partíció boot területe nem fedi le az egészet."
+
+#: libparted/labels/mac.c:577
+msgid "The partition's data region doesn't occupy the entire partition."
+msgstr "A partíció adatterülete nem fedi le az egészet."
+
+#: libparted/labels/mac.c:631
+#, c-format
+msgid "Weird block size on device descriptor: %d bytes is not divisible by 512."
+msgstr "Fura blokk méret az eszközleírón: %d bájt nem osztható 512-vel."
+
+#: libparted/labels/mac.c:644
+#, c-format
+msgid "The driver descriptor says the physical block size is %d bytes, but Linux says it is %d bytes."
+msgstr "A meghajtó leíró %d bájt fizikai blokk méretet mond, de a Linux szerint %d bájt."
+
+#: libparted/labels/mac.c:692
+msgid "No valid partition map found."
+msgstr "Nincs érvényes partíció térkép."
+
+#: libparted/labels/mac.c:744
+#, c-format
+msgid "Conflicting partition map entry sizes! Entry 1 says it is %d, but entry %d says it is %d!"
+msgstr "Ütköző partíciós térkép-bejegyzés méretek! Az 1. bejegyzés szerint %d, %d. szerint %d!"
+
+#: libparted/labels/mac.c:771
+msgid "Weird! There are 2 partitions map entries!"
+msgstr "Fura! Dupla partíció térkép bejegyzés!"
+
+#: libparted/labels/mac.c:1257
+msgid "Changing the name of a root or swap partition will prevent Linux from recognising it as such."
+msgstr "Egy gyökér vagy vagy csere partíció nevének cseréje meggátolja a Linuxot, hogy felismerje így."
+
+#: libparted/labels/mac.c:1353
+msgid "Can't add another partition -- the partition map is too small!"
+msgstr "Nem vehető fel más partíció -- a partíció térkép túl kicsi!"
+
+#: libparted/labels/pc98.c:357
+#, c-format
+msgid "Invalid partition table on %s."
+msgstr "Érvénytelen partíciós tábla itt: %s."
+
+#: libparted/labels/pc98.c:409
+#: libparted/labels/pc98.c:487
+#, c-format
+msgid "Partition %d isn't aligned to cylinder boundaries. This is still unsupported."
+msgstr "%d. partíció nem igazodik a cilinderekhez. Ez még nem támogatott."
+
+#: libparted/labels/pc98.c:796
+msgid "Can't add another partition."
+msgstr "Nem vehető fel más partíció."
+
+#: libparted/labels/sun.c:143
+msgid "Corrupted Sun disk label detected."
+msgstr "Rossz Sun lemez címke."
+
+#: libparted/labels/sun.c:264
+#, c-format
+msgid "The disk CHS geometry (%d,%d,%d) reported by the operating system does not match the geometry stored on the disk label (%d,%d,%d)."
+msgstr "Az operációs rendszer által jelzett lemez CHS geometria (%d,%d,%d) nem illik a lemez címkén tárolttal (%d,%d,%d)."
+
+#: libparted/labels/sun.c:286
+#, c-format
+msgid "The disk label describes a disk bigger than %s."
+msgstr "A lemez címke nagyobb lemezt ír le, mint %s."
+
+#: libparted/labels/sun.c:440
+#, c-format
+msgid "The disk has %d cylinders, which is greater than the maximum of 65536."
+msgstr "A lemez %d cilinderű, ami nagyobb, mint a 65536 maximum."
+
+#: libparted/labels/sun.c:736
+msgid "The Whole Disk partition is the only available one left. Generally, it is not a good idea to overwrite this partition with a real one. Solaris may not be able to boot without it, and SILO (the sparc boot loader) appreciates it as well."
+msgstr "Már csak a Teljes Lemez partíció elérhető. Általában nem jó ötlet ez felülírni egy valódival. A Solaris nem indul e nélkül, és a SILO (a sparc boot betöltő) tudja ezt."
+
+#: libparted/labels/sun.c:751
+msgid "Sun disk label is full."
+msgstr "A Sun lemez címke betelt."
+
+#: libparted/filesys.c:386
+msgid "Could not detect file system."
+msgstr "Nincs fájlrendszer."
+
+#: libparted/filesys.c:397
+msgid "The file system is bigger than its volume!"
+msgstr "A fájlrendszer nagyobb, mint a kötet!"
+
+#: libparted/filesys.c:405
+#, c-format
+msgid "Support for opening %s file systems is not implemented yet."
+msgstr "%s fájlrendszerek megnyitása még nem támogatott."
+
+#: libparted/filesys.c:447
+#, c-format
+msgid "Support for creating %s file systems is not implemented yet."
+msgstr "%s fájlrendszerek létrehozása még nem támogatott."
+
+#: libparted/filesys.c:508
+#, c-format
+msgid "Support for checking %s file systems is not implemented yet."
+msgstr "%s fájlrendszerek ellenőrzése még nem támogatott."
+
+#: libparted/filesys.c:574
+msgid "raw block copying"
+msgstr "nyers blokk másolás"
+
+#: libparted/filesys.c:585
+msgid "growing file system"
+msgstr "növekvő fájlrendszer"
+
+#: libparted/filesys.c:625
+msgid "Can't copy onto an overlapping partition."
+msgstr "Nem tudok átfedő partícióra másolni."
+
+#: libparted/filesys.c:647
+#, c-format
+msgid "Direct support for copying file systems is not yet implemented for %s. However, support for resizing is implemented. Therefore, the file system can be copied if the new partition is at least as big as the old one. So, either shrink the partition you are trying to copy, or copy to a bigger partition."
+msgstr ""
+
+#: libparted/filesys.c:661
+#, c-format
+msgid "Support for copying %s file systems is not implemented yet."
+msgstr "%s fájlrendszerek másolása még nem támogatott."
+
+#: libparted/filesys.c:699
+#, c-format
+msgid "Support for resizing %s file systems is not implemented yet."
+msgstr "%s fájlrendszerek átméretezése még nem támogatott."
+
+#: libparted/exception.c:78
+msgid "Information"
+msgstr "Információ"
+
+#: libparted/exception.c:79
+msgid "Warning"
+msgstr "Figyelem"
+
+#: libparted/exception.c:80
+msgid "Error"
+msgstr "Hiba"
+
+#: libparted/exception.c:81
+msgid "Fatal"
+msgstr "Végzetes"
+
+#: libparted/exception.c:82
+msgid "Bug"
+msgstr ""
+
+#: libparted/exception.c:83
+msgid "No Implementation"
+msgstr "Nincs megvalósítva"
+
+#: libparted/exception.c:87
+msgid "Fix"
+msgstr "Javítás"
+
+#: libparted/exception.c:88
+msgid "Yes"
+msgstr "Igen"
+
+#: libparted/exception.c:89
+msgid "No"
+msgstr "Nem"
+
+#: libparted/exception.c:90
+msgid "OK"
+msgstr "OK"
+
+#: libparted/exception.c:91
+msgid "Retry"
+msgstr "Újra"
+
+#: libparted/exception.c:92
+msgid "Ignore"
+msgstr "Kihagy"
+
+#: libparted/exception.c:93
+msgid "Cancel"
+msgstr "Mégse"
+
+#: libparted/exception.c:133
+#, c-format
+msgid "A bug has been detected in GNU Parted. Refer to the web site of parted http://www.gnu.org/software/parted/parted.html for more informations of what could be useful for bug submitting! Please email a bug report to bug-parted@gnu.org containing at least the version (%s) and the following message: "
+msgstr "Egy hibára derült fény a GNU Parted-ban. Nézd meg a http://www.gnu.org/software/parted/parted.html-t a hibajelentésről! Kérlek, küldj egy hibajelentést a bug-parted@gnu.org-ra minimum a verzióval (%s) és ezzel:"
+
+#: libparted/cs/geom.c:162
+msgid "Can't have the end before the start!"
+msgstr "Nem lehet vég a kezdet előtt!"
+
+#: libparted/cs/geom.c:169
+msgid "Can't have a partition outside the disk!"
+msgstr "Nem lehet lemezen kívüli partíció!"
+
+#: libparted/cs/geom.c:303
+#, c-format
+msgid "Attempt to read sectors %ld-%ld outside of partition on %s."
+msgstr "Kísérlet partíción kívüli %ld-%ld szektorok olvasására itt: %s."
+
+#: libparted/cs/geom.c:373
+#, c-format
+msgid "Attempt to write sectors %ld-%ld outside of partition on %s."
+msgstr "Kísérlet partíción kívüli %ld-%ld szektorok írására itt: %s."
+
+#: libparted/cs/geom.c:413
+#: libparted/fs/linux_swap/linux_swap.c:353
+msgid "checking for bad blocks"
+msgstr "hibás blokkok keresése"
+
+#: libparted/libparted.c:286
+#: libparted/libparted.c:306
+msgid "Out of memory."
+msgstr "A memória elfogyott."
+
+#: libparted/unit.c:139
+msgid "Cannot get unit size for special unit 'COMPACT'."
+msgstr ""
+
+#: libparted/unit.c:382
+#, c-format
+msgid "\"%s\" has invalid syntax for locations."
+msgstr ""
+
+#: libparted/unit.c:390
+#, c-format
+msgid "The maximum head value is %d."
+msgstr "A maximum fej érték %d."
+
+#: libparted/unit.c:397
+#, c-format
+msgid "The maximum sector value is %d."
+msgstr "A maximum szektor érték %d."
+
+#: libparted/unit.c:409
+#: libparted/unit.c:540
+#, c-format
+msgid "The location %s is outside of the device %s."
+msgstr "%s hely kívül esik ezen az eszközön: %s."
+
+#: libparted/unit.c:522
+msgid "Invalid number."
+msgstr "Érvénytelen érték."
+
+#: libparted/fs/ext2/ext2.c:87
+#: libparted/fs/ext2/ext2.c:112
+msgid "Inconsistent group descriptors!"
+msgstr "Ellentmondó csoport leírók!"
+
+#: libparted/fs/ext2/ext2.c:91
+#: libparted/fs/ext2/ext2.c:116
+msgid "File system full!"
+msgstr "Betelt a fájlrendszer!"
+
+#: libparted/fs/ext2/ext2.c:750
+msgid "Invalid superblock. Are you sure this is an ext2 file system?"
+msgstr "Érvénytelen szuperblokk. Biztos hogy ez egy ext2 fájlrendszer?"
+
+#: libparted/fs/ext2/ext2.c:764
+#: libparted/fs/ext2/ext2_resize.c:597
+msgid "File system has errors! You should run e2fsck."
+msgstr "Fájlrendszer hibák! Le kell futtatnod az e2fsck-t!"
+
+#: libparted/fs/ext2/ext2.c:775
+msgid "File system was not cleanly unmounted! You should run e2fsck. Modifying an unclean file system could cause severe corruption."
+msgstr ""
+
+#: libparted/fs/ext2/ext2.c:795
+msgid "File system has an incompatible feature enabled."
+msgstr ""
+
+#: libparted/fs/ext2/ext2.c:806
+msgid "Error allocating buffer cache."
+msgstr ""
+
+#: libparted/fs/ext2/ext2.c:848
+msgid "A resize operation on this file system will use EXPERIMENTAL code that MAY CORRUPT it (although it hasn't done so yet).You should at least backup your data and run 'e2fsck -f' afterwards."
+msgstr "Egy átméretezési művelet e fájlrendszeren KÍSÉRLETI kódot fog használni, ami MEGSÉRTHETI (bár még nem volt ilyen). Ajánlott adatot menteni és lefuttatni az 'e2fsck -f'-et utána."
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:114
+msgid "Found an inode with a incorrect link count. Better go run e2fsck first!"
+msgstr "Hibás láncszámú inode-ot találtam. Futtass egy e2fsck-t előbb!"
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:487
+msgid "Not enough free inodes!"
+msgstr "Nincs elég szabad inode!"
+
+#: libparted/fs/ext2/ext2_resize.c:224
+msgid "File system is too full to remove a group!"
+msgstr ""
+
+#: libparted/fs/ext2/ext2_resize.c:233
+msgid "File system has too many allocated inodes to remove a group!"
+msgstr ""
+
+#: libparted/fs/ext2/ext2_resize.c:493
+msgid "adding groups"
+msgstr "csoportok hozzáadása"
+
+#: libparted/fs/ext2/ext2_resize.c:530
+#, c-format
+msgid "Your file system is too full to resize it to %i blocks. Sorry."
+msgstr "A fájlrendszer túlságosan tele van, hogy %i blokkra méretezzem. Bocs."
+
+#: libparted/fs/ext2/ext2_resize.c:540
+#, c-format
+msgid "Your file system has too many occupied inodes to resize it to %i blocks. Sorry."
+msgstr "A fájlrendszer túl sok foglalt inode-ot tartalmaz, hogy %i blokkra méretezzem. Bocs."
+
+#: libparted/fs/ext2/ext2_resize.c:554
+#: libparted/fs/hfs/hfs.c:243
+#: libparted/fs/hfs/hfs.c:624
+msgid "shrinking"
+msgstr "zsugorítás"
+
+#: libparted/fs/ext2/ext2_resize.c:605
+msgid "File system was not cleanly unmounted! You should run e2fsck."
+msgstr "A fájlrendszer leállítása nem történt meg rendesen. Futtass egy e2fsc-t."
+
+#: libparted/fs/ext2/ext2_resize.c:614
+msgid "The file system has the 'dir_index' feature enabled. Parted can only resize the file system if it disables this feature. You can enable it later by running 'tune2fs -O dir_index DEVICE' and then 'e2fsck -fD DEVICE'."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_block_relocator.c:198
+msgid "Cross-linked blocks found! Better go run e2fsck first!"
+msgstr "Kereszt-láncolt blokkokat találtam! Futtass egy e2fsck-t előbb!"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:537
+#, c-format
+msgid "Block %i has no reference? Weird."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_block_relocator.c:738
+#, c-format
+msgid "Block %i shouldn't have been marked!"
+msgstr ""
+
+#: libparted/fs/ext2/interface.c:188
+msgid "The ext2 file system passed a basic check. For a more comprehensive check, use the e2fsck program."
+msgstr "Az ext2 fájlrendszer kapott egy alap ellenőrzést. Teljesebb az e2fsck programmal végezhető."
+
+#: libparted/fs/ext2/interface.c:205
+msgid "Sorry, can't move the start of ext2 partitions yet!"
+msgstr ""
+
+#: libparted/fs/ext2/ext2_buffer.c:82
+msgid "Couldn't flush buffer cache!"
+msgstr ""
+
+#: libparted/fs/ext2/ext2_mkfs.c:162
+msgid "writing per-group metadata"
+msgstr "csoportonkénti metaadatok írása"
+
+#: libparted/fs/ext2/ext2_mkfs.c:565
+msgid "File system too small for ext2."
+msgstr "A fájlrendszer túl kicsi az ext2-höz."
+
+#: libparted/fs/fat/calc.c:134
+#, c-format
+msgid "You need %s of free disk space to shrink this partition to this size. Currently, only %s is free."
+msgstr "%s szabad lemez hely szükséges e partíció átméretezéséhez a megadott méretre. Most csak %s szabad."
+
+#: libparted/fs/fat/context.c:55
+#, c-format
+msgid "Cluster start delta = %d, which is not a multiple of the cluster size %d."
+msgstr ""
+
+#: libparted/fs/fat/fat.c:312
+#, c-format
+msgid "Partition too big/small for a %s file system."
+msgstr "A partíció túl nagy/kicsi egy %s fájlrendszerhez."
+
+#: libparted/fs/fat/fat.c:478
+msgid "The FATs don't match. If you don't know what this means, then select cancel, run scandisk on the file system, and then come back."
+msgstr ""
+
+#: libparted/fs/fat/fat.c:518
+msgid "There are no possible configurations for this FAT type."
+msgstr ""
+
+#: libparted/fs/fat/fat.c:530
+#, c-format
+msgid "File system doesn't have expected sizes for Windows to like it. Cluster size is %dk (%dk expected); number of clusters is %d (%d expected); size of FATs is %d sectors (%d expected)."
+msgstr ""
+
+#: libparted/fs/fat/fat.c:553
+#, c-format
+msgid "File system is reporting the free space as %d clusters, not %d clusters."
+msgstr ""
+
+#: libparted/fs/fat/fat.c:878
+msgid "GNU Parted was miscompiled: the FAT boot sector should be 512 bytes. FAT support will be disabled."
+msgstr ""
+
+#: libparted/fs/fat/resize.c:158
+msgid "There's not enough room in the root directory for all of the files. Either cancel, or ignore to lose the files."
+msgstr ""
+
+#: libparted/fs/fat/resize.c:299
+msgid "Error writing to the root directory."
+msgstr ""
+
+#: libparted/fs/fat/resize.c:484
+msgid "If you leave your file system as FAT16, then you will have no problems."
+msgstr ""
+
+#: libparted/fs/fat/resize.c:487
+msgid "If you convert to FAT16, and MS Windows is installed on this partition, then you must re-install the MS Windows boot loader. If you want to do this, you should consult the Parted manual (or your distribution's manual)."
+msgstr ""
+
+#: libparted/fs/fat/resize.c:495
+msgid "If you leave your file system as FAT32, then you will not introduce any new problems."
+msgstr ""
+
+#: libparted/fs/fat/resize.c:499
+msgid "If you convert to FAT32, and MS Windows is installed on this partition, then you must re-install the MS Windows boot loader. If you want to do this, you should consult the Parted manual (or your distribution's manual). Also, converting to FAT32 will make the file system unreadable by MS DOS, MS Windows 95a, and MS Windows NT."
+msgstr ""
+
+#: libparted/fs/fat/resize.c:513
+#, c-format
+msgid "%s %s %s"
+msgstr "%s %s %s"
+
+#: libparted/fs/fat/resize.c:514
+msgid "Would you like to use FAT32?"
+msgstr "FAT32-t akarsz használni?"
+
+#: libparted/fs/fat/resize.c:541
+#: libparted/fs/fat/resize.c:557
+#, c-format
+msgid "%s %s"
+msgstr "%s %s"
+
+#: libparted/fs/fat/resize.c:542
+msgid "The file system can only be resized to this size by converting to FAT16."
+msgstr ""
+
+#: libparted/fs/fat/resize.c:558
+msgid "The file system can only be resized to this size by converting to FAT32."
+msgstr ""
+
+#: libparted/fs/fat/resize.c:571
+msgid "GNU Parted cannot resize this partition to this size. We're working on it!"
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:48
+#: libparted/fs/fat/bootsector.c:55
+msgid "File system has an invalid signature for a FAT file system."
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:62
+msgid "File system has an invalid sector size for a FAT file system."
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:69
+msgid "File system has an invalid cluster size for a FAT file system."
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:76
+msgid "File system has an invalid number of reserved sectors for a FAT file system."
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:83
+msgid "File system has an invalid number of FATs."
+msgstr "A fájlrendszernek rossz FAT száma van."
+
+#: libparted/fs/fat/bootsector.c:138
+#, c-format
+msgid "This file system has a logical sector size of %d. GNU Parted is known not to work properly with sector sizes other than 512 bytes."
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:163
+#, c-format
+msgid "The file system's CHS geometry is (%d, %d, %d), which is invalid. The partition table's CHS geometry is (%d, %d, %d). If you select Ignore, the file system's CHS geometry will be left unchanged. If you select Fix, the file system's CHS geometry will be set to match the partition table's CHS geometry."
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:209
+msgid "FAT boot sector says logical sector size is 0. This is weird. "
+msgstr "A FAT boot szektor szerint a logikai szektor méret 0. Fura."
+
+#: libparted/fs/fat/bootsector.c:215
+msgid "FAT boot sector says there are no FAT tables. This is weird. "
+msgstr "A FAT boot szektor szerint nincsenek FAT táblák. Fura."
+
+#: libparted/fs/fat/bootsector.c:221
+msgid "FAT boot sector says clusters are 0 sectors. This is weird. "
+msgstr "A FAT boot szektor 0 szektoros klasztereket mond. Fura."
+
+#: libparted/fs/fat/bootsector.c:231
+msgid "File system is FAT12, which is unsupported."
+msgstr "A fájlrendszer FAT12, ami nem támogatott."
+
+#: libparted/fs/fat/bootsector.c:407
+#, c-format
+msgid "The information sector has the wrong signature (%x). Select cancel for now, and send in a bug report. If you're desperate, it's probably safe to ignore."
+msgstr ""
+
+#: libparted/fs/fat/count.c:149
+#, c-format
+msgid "Bad directory entry for %s: first cluster is the end of file marker."
+msgstr ""
+
+#: libparted/fs/fat/count.c:162
+#, c-format
+msgid "Bad FAT: unterminated chain for %s. You should run dosfsck or scandisk."
+msgstr ""
+
+#: libparted/fs/fat/count.c:171
+#, c-format
+msgid "Bad FAT: cluster %d outside file system in chain for %s. You should run dosfsck or scandisk."
+msgstr ""
+
+#: libparted/fs/fat/count.c:181
+#, c-format
+msgid "Bad FAT: cluster %d is cross-linked for %s. You should run dosfsck or scandisk."
+msgstr ""
+
+#: libparted/fs/fat/count.c:200
+#, c-format
+msgid "%s is %dk, but it has %d clusters (%dk)."
+msgstr "%s %dk, de %d klaszteres (%dk)."
+
+#: libparted/fs/fat/count.c:263
+#, c-format
+msgid "The file %s is marked as a system file. This means moving it could cause some programs to stop working."
+msgstr "%s rendszerfájlként jelölt. Elmozdítása után egyes programok talán nem működnek tovább."
+
+#: libparted/fs/fat/table.c:138
+#, c-format
+msgid "FAT %d media %x doesn't match the boot sector's media %x. You should probably run scandisk."
+msgstr ""
+
+#: libparted/fs/fat/table.c:268
+#, c-format
+msgid "fat_table_set: cluster %ld outside file system"
+msgstr "fat_table_set: %ld. klaszter kívül esik a fájlrendszeren"
+
+#: libparted/fs/fat/table.c:296
+#, c-format
+msgid "fat_table_get: cluster %ld outside file system"
+msgstr "fat_table_get: %ld. klaszter kívül esik a fájlrendszeren"
+
+#: libparted/fs/fat/table.c:334
+msgid "fat_table_alloc_cluster: no free clusters"
+msgstr "fat_table_alloc_cluster: nincs szabad klaszter"
+
+#: libparted/fs/linux_swap/linux_swap.c:236
+#, c-format
+msgid "Unrecognised linux swap signature '%10s'."
+msgstr "Ismeretlen '%10s' linux swap aláírás."
+
+#: libparted/fs/linux_swap/linux_swap.c:312
+msgid "Too many bad pages."
+msgstr "Túl sok rossz lap."
+
+#: libparted/fs/hfs/advfs.c:123
+#: libparted/fs/hfs/advfs_plus.c:125
+#: libparted/fs/hfs/reloc.c:416
+#: libparted/fs/hfs/reloc.c:510
+#: libparted/fs/hfs/reloc_plus.c:541
+#: libparted/fs/hfs/reloc_plus.c:660
+#: libparted/fs/hfs/reloc_plus.c:774
+msgid "The file system contains errors."
+msgstr "A fájlrendszeren hibák vannak."
+
+#: libparted/fs/hfs/advfs_plus.c:290
+msgid "Bad blocks could not be read."
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:139
+#, c-format
+msgid "Trying to register an extent starting at block 0x%X, but another one already exists at this position. You should check the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:216
+#, c-format
+msgid "Trying to move an extent from block Ox%X to block Ox%X, but another one already exists at this position. This should not happen!"
+msgstr ""
+
+#: libparted/fs/hfs/file.c:145
+#, c-format
+msgid "Could not update the extent cache for HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:182
+#, c-format
+msgid "Trying to read HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:192
+#: libparted/fs/hfs/file.c:222
+#, c-format
+msgid "Could not find sector %lli of HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:212
+#, c-format
+msgid "Trying to write HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:159
+#, c-format
+msgid "Could not update the extent cache for HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:203
+#, c-format
+msgid "Trying to read HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:214
+#: libparted/fs/hfs/file_plus.c:256
+#, c-format
+msgid "Could not find sector %lli of HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:245
+#, c-format
+msgid "Trying to write HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:225
+msgid "Sorry, HFS cannot be resized that way yet."
+msgstr "Bocs, HFS így még nem méretezhető át."
+
+#: libparted/fs/hfs/hfs.c:255
+#: libparted/fs/hfs/hfs.c:636
+msgid "Data relocation has failed."
+msgstr "Sikertelen adatáthelyezés."
+
+#: libparted/fs/hfs/hfs.c:274
+msgid "Data relocation left some data in the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:313
+msgid "writing HFS Master Directory Block"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:461
+msgid "No valid HFS[+X] signature has been found while opening."
+msgstr "Nem találtam érvényes HFS[+X] aláírást megnyitáskor."
+
+#: libparted/fs/hfs/hfs.c:471
+#, c-format
+msgid "Version %d of HFS+ isn't supported."
+msgstr "A HFS+ %d. verziója nem támogatott."
+
+#: libparted/fs/hfs/hfs.c:482
+#, c-format
+msgid "Version %d of HFSX isn't supported."
+msgstr "A HFSX %d. verziója nem támogatott."
+
+#: libparted/fs/hfs/hfs.c:667
+msgid "Data relocation left some data at the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:715
+msgid "Error while writing the allocation file."
+msgstr "Hiba a lefoglalási fájl írásakor."
+
+#: libparted/fs/hfs/hfs.c:730
+msgid "Error while writing the compatibility part of the allocation file."
+msgstr "Hiba a lefoglalási fájl kompatibilitási részének írásakor."
+
+#: libparted/fs/hfs/hfs.c:745
+msgid "writing HFS+ Volume Header"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:845
+msgid "An error occurred while looking for the mandatory bad blocks file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:899
+msgid "It seems there is an error in the HFS wrapper: the bad blocks file doesn't contain the embedded HFS+ volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:930
+msgid "Sorry, HFS+ cannot be resized that way yet."
+msgstr "Bocs, a HFS+ még nem méretezhető át így."
+
+#: libparted/fs/hfs/hfs.c:965
+msgid "shrinking embedded HFS+ volume"
+msgstr "beágyazott HFS+ kötet zsugorítása"
+
+#: libparted/fs/hfs/hfs.c:981
+msgid "Resizing the HFS+ volume has failed."
+msgstr "A HFS+ kötet átméretezése meghiúsult."
+
+#: libparted/fs/hfs/hfs.c:988
+msgid "shrinking HFS wrapper"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:997
+msgid "Updating the HFS wrapper has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:1099
+#: libparted/fs/hfs/hfs.c:1184
+#, c-format
+msgid "This is not a real %s check. This is going to extract special low level files for debugging purposes."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:156
+msgid "Bad block list header checksum."
+msgstr "Rossz blokk lista fejléc ellenőrzőösszeg."
+
+#: libparted/fs/hfs/journal.c:169
+#, c-format
+msgid "Invalid size of a transaction block while replaying the journal (%i bytes)."
+msgstr "Érvénytelen tranzakció blokk méret a napló visszaolvasásakor (%i bájt)."
+
+#: libparted/fs/hfs/journal.c:261
+msgid "Journal stored outside of the volume are not supported. Try to desactivate the journal and run Parted again."
+msgstr "A köteten kívüli napló nem támogatott. Próbáld meg lezárni a naplót és indítsd el újra a Parted-ed."
+
+#: libparted/fs/hfs/journal.c:272
+msgid "Journal offset or size is not multiple of the sector size."
+msgstr "A napló eltolása vagy mérete nem szektorméret-többszörös."
+
+#: libparted/fs/hfs/journal.c:290
+msgid "Incorrect magic values in the journal header."
+msgstr "Hibás bűvös számok a napló fejlécében."
+
+#: libparted/fs/hfs/journal.c:299
+msgid "Journal size mismatch between journal info block and journal header."
+msgstr "A napló mérete eltér a napló info blokk és a napló fejléce között."
+
+#: libparted/fs/hfs/journal.c:311
+msgid "Some header fields are not multiple of the sector size."
+msgstr "Pár fejlécmező nem szektorméret-többszörös."
+
+#: libparted/fs/hfs/journal.c:320
+msgid "The sector size stored in the journal is not 512 bytes. Parted only supports 512 bytes length sectors."
+msgstr "A napló szektormérete nem 512 bájt. A Parted csak az 512 bájt méretű szektorokat támogatja."
+
+#: libparted/fs/hfs/journal.c:332
+msgid "Bad journal checksum."
+msgstr "Rossz napló ellenőrzőösszeg."
+
+#: libparted/fs/hfs/journal.c:350
+msgid "The journal is not empty. Parted must replay the transactions before opening the file system. This will modify the file system."
+msgstr "A napló nem üres. A Parted-nak vissza kell olvasnia a fájlrendszer megnyitása előtt. Ez módosítja a fájlrendszert."
+
+#: libparted/fs/hfs/journal.c:378
+msgid "The volume header or the master directory block has changed while replaying the journal. You should restart Parted."
+msgstr "A kötet fejléce vagy a mester könyvtár blokk megváltozott a napló olvasásakor. Újra kell indítanod a Parted-et."
+
+#: libparted/fs/hfs/probe.c:52
+#, c-format
+msgid "Parted can't use HFS file systems on disks with a sector size not equal to %d bytes."
+msgstr "A Parted nem tudja a %d bájttól eltérő méretű HFS-eket kezelni."
+
+#: libparted/fs/hfs/reloc.c:153
+#: libparted/fs/hfs/reloc_plus.c:157
+msgid "An extent has not been relocated."
+msgstr "Egy kiterjedés nincs áthelyezve."
+
+#: libparted/fs/hfs/reloc.c:253
+#: libparted/fs/hfs/reloc_plus.c:309
+msgid "A reference to an extent comes from a place it should not. You should check the file system!"
+msgstr "Egy kiterjedés hivatkozás nem létező helyű. Ellenőrizned kell a fájlrendszert!"
+
+#: libparted/fs/hfs/reloc.c:383
+msgid "This HFS volume has no catalog file. This is very unusual!"
+msgstr "E HFS+ kötetnek nincs katalógus fájlja. Ez elég szokatlan!"
+
+#: libparted/fs/hfs/reloc.c:477
+msgid "This HFS volume has no extents overflow file. This is quite unusual!"
+msgstr "E HFS kötetnek nincs kiterjesztési fájlja. Ez elég szokatlan!"
+
+#: libparted/fs/hfs/reloc.c:519
+#: libparted/fs/hfs/reloc_plus.c:670
+msgid "The extents overflow file should not contain its own extents! You should check the file system."
+msgstr "A kiterjesztési fájl nem tartalmazza a saját méretét! Ellenőrizned kell a fájlrendszert."
+
+#: libparted/fs/hfs/reloc.c:576
+#: libparted/fs/hfs/reloc_plus.c:849
+msgid "Could not cache the file system in memory."
+msgstr "Nem tudom a fájlrendszert a memóriába tölteni."
+
+#: libparted/fs/hfs/reloc.c:637
+#: libparted/fs/hfs/reloc_plus.c:910
+msgid "Bad blocks list could not be loaded."
+msgstr "A hibás blokkok listája nem tölthető be."
+
+#: libparted/fs/hfs/reloc.c:651
+#: libparted/fs/hfs/reloc_plus.c:926
+msgid "An error occurred during extent relocation."
+msgstr "Hiba történt a kiterjedés áthelyezéskor."
+
+#: libparted/fs/hfs/reloc_plus.c:497
+msgid "This HFS+ volume has no catalog file. This is very unusual!"
+msgstr "E HFS+ kötetnek nincs katalógus fájlja. Ez elég szokatlan!"
+
+#: libparted/fs/hfs/reloc_plus.c:621
+msgid "This HFS+ volume has no extents overflow file. This is quite unusual!"
+msgstr "E HFS+ kötetnek nincs kiterjesztési fájlja. Ez elég szokatlan!"
+
+#: parted/parted.c:76
+msgid "displays this help message"
+msgstr "kiírja e súgót"
+
+#: parted/parted.c:77
+msgid "where necessary, prompts for user intervention"
+msgstr "ha kell, kérdez"
+
+#: parted/parted.c:78
+msgid "never prompts for user intervention"
+msgstr "sose kérdez"
+
+#: parted/parted.c:79
+msgid "displays the version"
+msgstr "kiírja a verziót"
+
+#: parted/parted.c:87
+msgid "NUMBER is the partition number used by Linux. On MS-DOS disk labels, the primary partitions number from 1 to 4, logical partitions from 5 onwards.\n"
+msgstr "A SZÁM egy a Linux által használt partíció szám. Egy MS-DOS lemezcímkén (partíciós táblán), az elsődleges partíciók 1-től 4-ig, a logikaiak 5-től szerepelnek.\n"
+
+#: parted/parted.c:90
+msgid "LABEL-TYPE is one of: "
+msgstr "A CÍMKE-TÍPUS ezek egyike: "
+
+#: parted/parted.c:91
+msgid "FLAG is one of: "
+msgstr "A ZÁSZLÓ ezek egyike: "
+
+#: parted/parted.c:92
+msgid "UNIT is one of: "
+msgstr "Az EGYSÉG ezek egyike: "
+
+#: parted/parted.c:93
+msgid "PART-TYPE is one of: primary, logical, extended\n"
+msgstr "A PART-TÍPUS ezek egyike: elsődleges, logikai vagy kiterjesztett\n"
+
+#: parted/parted.c:95
+msgid "FS-TYPE is one of: "
+msgstr "Az FS-TÍPUS ezek egyike: "
+
+#: parted/parted.c:96
+msgid "START and END are disk locations, such as 4GB or 10%. Negative values count from the end of the disk. For example, -1s specifies exactly the last sector.\n"
+msgstr "A KEZDET és VÉG lemezhelyek, pl.: 4GB vagy 10%. A negatív értékek hátulról számítanak. Pl. a -1s épp az utolsó szektort adja.\n"
+
+#: parted/parted.c:99
+msgid "STATE is one of: on, off\n"
+msgstr "Az ÁLLAPOT vagy be vagy ki\n"
+
+#: parted/parted.c:100
+msgid "DEVICE is usually /dev/hda or /dev/sda\n"
+msgstr "Az ESZKÖZ általában a /dev/hda vagy /dev/sda\n"
+
+#: parted/parted.c:101
+msgid "NAME is any word you want\n"
+msgstr "A NÉV tetszőleges\n"
+
+#: parted/parted.c:102
+msgid "The partition must have one of the following FS-TYPEs: "
+msgstr "A partíció az alábbi FS-TÍPUSok valamelyikét kell hogy tartalmazza: "
+
+#: parted/parted.c:105
+msgid "GNU Parted Version information:\n"
+msgstr "GNU Parted Verzió információ:\n"
+
+#: parted/parted.c:107
+msgid ""
+"Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n"
+"This program is free software, covered by the GNU General Public License.\n"
+"\n"
+"This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n"
+"\n"
+msgstr ""
+"Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n"
+"Ez a program GNU General Public Lincense alatt álló szabad szoftver.\n"
+"\n"
+"Abban a reményben terjesztjük, hogy hasznodra válik, de NINCS GARANCIA sem az ELADHATÓSÁGRA sem egy BIZONYOS CÉLÚ HASZNÁLATRA. Lásd a GNU General Public License-t a részletekért.\n"
+"\n"
+
+#: parted/parted.c:152
+#, c-format
+msgid "%0.f%%\t(time left %.2d:%.2d)"
+msgstr "%0.f%%\t(hátravan: %.2d:%.2d)"
+
+#: parted/parted.c:170
+#, c-format
+msgid "Partition %s is being used. You must unmount it before you modify it with Parted."
+msgstr "%s partíció használat alatt áll. Le kell csatolnod, mielőtt módosítod a Parted-del."
+
+#: parted/parted.c:187
+#, c-format
+msgid "Partition(s) on %s are being used."
+msgstr "%s partíciói használat alatt vannak."
+
+#: parted/parted.c:413
+#: parted/parted.c:594
+#: parted/parted.c:979
+#: parted/parted.c:1059
+#: parted/parted.c:1586
+#: parted/parted.c:1663
+#: parted/parted.c:1707
+msgid "Partition number?"
+msgstr "Partíció száma?"
+
+#: parted/parted.c:456
+msgid "Source device?"
+msgstr "Forráseszköz?"
+
+#: parted/parted.c:460
+msgid "Source partition number?"
+msgstr "Forráspartíció száma?"
+
+#: parted/parted.c:465
+msgid "Can't copy an extended partition."
+msgstr "Egy kiterjesztett partíciót nem tudok másolni."
+
+#: parted/parted.c:471
+msgid "Destination partition number?"
+msgstr "Célpartíció száma?"
+
+#: parted/parted.c:564
+msgid "New disk label type?"
+msgstr "Új lemez címke típus?"
+
+#: parted/parted.c:598
+msgid "File system?"
+msgstr "Fájlrendszer?"
+
+#: parted/parted.c:645
+#: parted/parted.c:815
+msgid "Partition type?"
+msgstr "Partíció típus?"
+
+#: parted/parted.c:652
+#: parted/parted.c:822
+#: parted/parted.c:1062
+msgid "Partition name?"
+msgstr "Partíció név?"
+
+#: parted/parted.c:660
+#: parted/parted.c:832
+msgid "File system type?"
+msgstr "Fájlrendszer típus?"
+
+#: parted/parted.c:667
+#: parted/parted.c:834
+#: parted/parted.c:994
+#: parted/parted.c:1544
+#: parted/parted.c:1595
+msgid "Start?"
+msgstr "Kezdet?"
+
+#: parted/parted.c:669
+#: parted/parted.c:837
+#: parted/parted.c:997
+#: parted/parted.c:1546
+#: parted/parted.c:1597
+msgid "End?"
+msgstr "Vég?"
+
+#: parted/parted.c:707
+#: parted/parted.c:875
+#, c-format
+msgid ""
+"You requested a partition from %s to %s.\n"
+"The closest location we can manage is %s to %s. Is this still acceptable to you?"
+msgstr ""
+"Egy partíciót kértél innen: %s idáig: %s.\n"
+"A legközelebbi kezelhető végpontok ezek: %s %s. Rendben?"
+
+#: parted/parted.c:827
+msgid "An extended partition cannot hold a file system. Did you want mkpart?"
+msgstr "Egy kiterjesztett partíció nem tartalmaz fájlrendszert. mkpart-ot szeretnél?"
+
+#: parted/parted.c:985
+msgid "Can't move an extended partition."
+msgstr "Nem mozgatható egy kiterjesztett partíció."
+
+#: parted/parted.c:1014
+msgid "Can't move a partition onto itself. Try using resize, perhaps?"
+msgstr "Egy partíció nem mozgatható saját magán belül. Átméretezni szeretnéd?"
+
+#: parted/parted.c:1158
+#, c-format
+msgid "Minor: %d\n"
+msgstr ""
+
+#: parted/parted.c:1159
+#, c-format
+msgid "Flags: %s\n"
+msgstr "Zászlók: %s\n"
+
+#: parted/parted.c:1160
+#, c-format
+msgid "File System: %s\n"
+msgstr "Fájlrendszer: %s\n"
+
+#: parted/parted.c:1161
+#, c-format
+msgid "Size: "
+msgstr "Méret: "
+
+#: parted/parted.c:1166
+#, c-format
+msgid "Minimum size: "
+msgstr "Minimum méret: "
+
+#: parted/parted.c:1169
+#, c-format
+msgid "Maximum size: "
+msgstr "Maximum méret: "
+
+#: parted/parted.c:1255
+#, c-format
+msgid "Disk %s: %s\n"
+msgstr "%s lemez: %s\n"
+
+#: parted/parted.c:1256
+#, c-format
+msgid "Sector size (logical/physical): %lldB/%lldB\n"
+msgstr "Szektorméret (logikai/fizikai): %lldB/%lldB\n"
+
+#: parted/parted.c:1267
+#, c-format
+msgid "BIOS cylinder,head,sector geometry: %d,%d,%d. Each cylinder is %s.\n"
+msgstr "BIOS cilinder,fej,szektor geometria: %d,%d,%d. Egy cilinder %s.\n"
+
+#: parted/parted.c:1273
+#, c-format
+msgid "Partition Table: %s\n"
+msgstr "Partíciós tábla: %s\n"
+
+#: parted/parted.c:1284
+#: parted/parted.c:1287
+msgid "Number"
+msgstr "Szám"
+
+#: parted/parted.c:1284
+#: parted/parted.c:1287
+msgid "Start"
+msgstr "Kezdet"
+
+#: parted/parted.c:1285
+#: parted/parted.c:1288
+msgid "End"
+msgstr "Vég"
+
+#: parted/parted.c:1288
+msgid "Size"
+msgstr "Méret"
+
+#: parted/parted.c:1292
+msgid "Type"
+msgstr "Típus"
+
+#: parted/parted.c:1294
+msgid "File system"
+msgstr "Fájlrendszer"
+
+#: parted/parted.c:1297
+msgid "Name"
+msgstr "Név"
+
+#: parted/parted.c:1299
+msgid "Flags"
+msgstr "Zászlók"
+
+#: parted/parted.c:1352
+msgid "Free Space"
+msgstr "Szabad Hely"
+
+#: parted/parted.c:1441
+#, c-format
+msgid "A %s %s partition was found at %s -&gt; %s. Do you want to add it to the partition table?"
+msgstr "Egy %s %s partíciót találtam itt: %s -&gt; %s. Hozzáadjam a partíciós táblához?"
+
+#: parted/parted.c:1479
+msgid "searching for file systems"
+msgstr "fájlrendszerek keresése"
+
+#: parted/parted.c:1684
+msgid "New device?"
+msgstr "Új eszköz?"
+
+#: parted/parted.c:1709
+msgid "Flag to Invert?"
+msgstr ""
+
+#: parted/parted.c:1714
+msgid "New state?"
+msgstr "Új állapot?"
+
+#: parted/parted.c:1747
+msgid "Unit?"
+msgstr "Egység?"
+
+#: parted/parted.c:1896
+msgid "check"
+msgstr "check"
+
+#: parted/parted.c:1899
+msgid "check NUMBER do a simple check on the file system"
+msgstr "check SZÁM egyszerű ellenőrzés a fájlrendszeren"
+
+#: parted/parted.c:1905
+msgid "cp"
+msgstr "cp"
+
+#: parted/parted.c:1908
+msgid "cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another partition"
+msgstr "cp [ESZKÖZRŐL] SORSZÁMRÓL SORSZÁMRA fájlrendszert másol egy másik partícióra"
+
+#: parted/parted.c:1914
+msgid "help"
+msgstr "help"
+
+#: parted/parted.c:1917
+msgid "help [COMMAND] prints general help, or help on COMMAND"
+msgstr "help [PARANCS] általános vagy PARANCS súgó"
+
+#: parted/parted.c:1923
+msgid "mklabel"
+msgstr "mklabel"
+
+#: parted/parted.c:1926
+msgid "mklabel LABEL-TYPE create a new disklabel (partition table)"
+msgstr "mklabel CÍMKE-TÍPUS új lemezcímkét készít (partíciós tábla)"
+
+#: parted/parted.c:1932
+msgid "mkfs"
+msgstr "mkfs"
+
+#: parted/parted.c:1935
+msgid "mkfs NUMBER FS-TYPE make a FS-TYPE file system on partititon NUMBER"
+msgstr "mkfs SZÁM FS-TÍPUS FS-TÍPUSú fájlrendszert készít a SZÁM. partíción"
+
+#: parted/parted.c:1941
+msgid "mkpart"
+msgstr "mkpart"
+
+#: parted/parted.c:1944
+msgid "mkpart PART-TYPE [FS-TYPE] START END make a partition"
+msgstr "mkpart PART-TÍPUS [FS-TÍPUS] KEZDET VÉG partíciót készít"
+
+#: parted/parted.c:1950
+msgid "mkpart makes a partition without creating a new file system on the partition. FS-TYPE may be specified to set an appropriate partition ID.\n"
+msgstr "az mkpart fájlrendszer nélüli partíciót készít. Az FS-TYPE megfelelő partíció ID-t állíthat be.\n"
+
+#: parted/parted.c:1955
+msgid "mkpartfs"
+msgstr "mkpartfs"
+
+#: parted/parted.c:1958
+msgid "mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system"
+msgstr "mkpartfs PART-TÍPUS FS-TÍPUS KEZDET VÉG partíciót készít fájlrendszerrel"
+
+#: parted/parted.c:1964
+msgid "move"
+msgstr "move"
+
+#: parted/parted.c:1967
+msgid "move NUMBER START END move partition NUMBER"
+msgstr "move SZÁM KEZDET VÉG áthelyezi a SZÁM. partíciót"
+
+#: parted/parted.c:1972
+msgid "name"
+msgstr "name"
+
+#: parted/parted.c:1975
+msgid "name NUMBER NAME name partition NUMBER as NAME"
+msgstr "name SZÁM NÉV a SZÁM. partíciót NÉVvel nevezi"
+
+#: parted/parted.c:1980
+msgid "print"
+msgstr "print"
+
+#: parted/parted.c:1983
+msgid "print [free|NUMBER|all] display the partition table, a partition, or all devices"
+msgstr "print [free|SZÁM|all] kiírja a partíciós táblát, egy partíciót vagy minden eszközt"
+
+#: parted/parted.c:1987
+msgid ""
+"Without arguments, print displays the entire partition table. With 'free'\n"
+"argument, information about free space will be displayed otherwise if a\n"
+"partition number is given, then more detailed information is displayed\n"
+"about that partition. If the 'all' argument is passed instead, partition\n"
+"information for all devices will be displayed."
+msgstr ""
+"Argumentumok nélkül, kiírja a teljes partíciós táblát. A 'free'- argumentummal\n"
+"kiírja a szabad helyet, egy partíció szám megadása esetén arról sokkal\n"
+"részletesebb információkat ad.\n"
+"Az 'all' argumentum megadása esetén\n"
+"minden eszköz partíciós adatait kiírja."
+
+#: parted/parted.c:1995
+msgid "quit"
+msgstr "quit"
+
+#: parted/parted.c:1998
+msgid "quit exit program"
+msgstr "quit kilépés"
+
+#: parted/parted.c:2003
+msgid "rescue"
+msgstr "rescue"
+
+#: parted/parted.c:2006
+msgid "rescue START END rescue a lost partition near START and END"
+msgstr "rescue KEZDET VÉG visszaállítja a KEZDET és VÉG közti partíciót"
+
+#: parted/parted.c:2012
+msgid "resize"
+msgstr "resize"
+
+#: parted/parted.c:2015
+msgid "resize NUMBER START END resize partition NUMBER and its file system"
+msgstr "resize SZÁM KEZDET VÉG átméretezi a SZÁM. partíciót és fájlrendszerét"
+
+#: parted/parted.c:2023
+msgid "rm"
+msgstr "rm"
+
+#: parted/parted.c:2026
+msgid "rm NUMBER delete partition NUMBER"
+msgstr "rm SZÁM törli a SZÁM. partíciót"
+
+#: parted/parted.c:2031
+msgid "select"
+msgstr "select"
+
+#: parted/parted.c:2034
+msgid "select DEVICE choose the device to edit"
+msgstr "select ESZKÖZ megadja a szerkesztésre kerülő eszközt"
+
+#: parted/parted.c:2039
+msgid "set"
+msgstr "set"
+
+#: parted/parted.c:2042
+msgid "set NUMBER FLAG STATE change the FLAG on partition NUMBER"
+msgstr "set SZÁM ZÁSZLÓ ÁLLAPOT váltja a ZÁSZLÓt a SZÁM. partíción"
+
+#: parted/parted.c:2048
+msgid "toggle"
+msgstr ""
+
+#: parted/parted.c:2051
+msgid "toggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBER"
+msgstr "toggle [SZÁM [ZÁSZLÓ]] váltja a ZÁSZLÓt a SZÁM. partíción"
+
+#: parted/parted.c:2057
+msgid "unit"
+msgstr "unit"
+
+#: parted/parted.c:2060
+msgid "unit UNIT set the default unit to UNIT"
+msgstr "unit EGYSÉG beállítja az alap egységet a UNIT-hoz"
+
+#: parted/parted.c:2065
+msgid "version"
+msgstr "verzió"
+
+#: parted/parted.c:2068
+msgid "version displays the current version of GNU Parted and copyright information"
+msgstr "version megjeleníti a GNU Parted jelen verzióját és szerzői jogát"
+
+#: parted/parted.c:2072
+msgid "version displays copyright and version information corressponding to this copy of GNU Parted\n"
+msgstr "a 'version' megjeleníti a GNU Parted másolatának megfelelő verzió-információját és szerzői jogát\n"
+
+#: parted/parted.c:2158
+msgid "No device found"
+msgstr "Nem találok eszközt"
+
+#: parted/parted.c:2222
+msgid "Don't forget to update /etc/fstab, if necessary.\n"
+msgstr "Ne feledd a /etc/fstab frissítését, ha szükséges.\n"
+
+#: parted/ui.c:68
+msgid "Welcome to GNU Parted! Type 'help' to view a list of commands.\n"
+msgstr "Üdv a GNU Parted-ban! Gépeld be a 'help' szót a parancsok listájának megtekintéséhez.\n"
+
+#: parted/ui.c:71
+msgid ""
+"Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]\n"
+"Apply COMMANDs with PARAMETERS to DEVICE. If no COMMAND(s) are given, run in\n"
+"interactive mode.\n"
+msgstr ""
+"Használat: parted [OPCIÓK]... [ESZKÖZ [PARANCS [PARAMÉTEREK]...]...]\n"
+"PARAMÉTEREKKEL rendelkező PARANCSokat alkalmaz az ESZKÖZre. Ha nincs megadott parancs,\n"
+"interaktív módban fut.\n"
+
+#: parted/ui.c:76
+#, c-format
+msgid ""
+"\n"
+"\n"
+"You found a bug in GNU Parted! Here's what you have to do:\n"
+"\n"
+"Don't panic! The bug has most likely not affected any of your data.\n"
+"Help us to fix this bug by doing the following:\n"
+"\n"
+"Check whether the bug has already been fixed by checking\n"
+"the last version of GNU Parted that you can find at:\n"
+"\n"
+"\thttp://ftp.gnu.org/gnu/parted/\n"
+"\n"
+"Please check this version prior to bug reporting.\n"
+"\n"
+"If this has not been fixed yet or if you don't know how to check,\n"
+"please visit the GNU Parted website:\n"
+"\n"
+"\thttp://www.gnu.org/software/parted\n"
+"\n"
+"for further information.\n"
+"\n"
+"Your report should contain the version of this release (%s)\n"
+"along with the error message below, the output of\n"
+"\n"
+"\tparted DEVICE unit co print unit s print\n"
+"\n"
+"and additional information about your setup you consider important.\n"
+msgstr ""
+
+#: parted/ui.c:230
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_MAPERR (Address not mapped to object)"
+msgstr ""
+"\n"
+"Hiba: SEGV_MAPERR (A cím nincs az objektumhoz map-elve)"
+
+#: parted/ui.c:235
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_ACCERR (Invalid permissions for mapped object)"
+msgstr ""
+"\n"
+"Hiba: SEGV_ACCERR (Rossz jogok a mapelt objektumhoz)"
+
+#: parted/ui.c:240
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGSEGV signal was encountered."
+msgstr ""
+"\n"
+"Hiba: Általános SIGSEGV jel jött."
+
+#: parted/ui.c:258
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTDIV (Integer: divide by zero)"
+msgstr ""
+"\n"
+"Hiba: FPE_INTDIV (egész: osztás zéróval)"
+
+#: parted/ui.c:262
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTOVF (Integer: overflow)"
+msgstr ""
+"\n"
+"Hiba: FPE_INTOVF (egész: túlcsordulás)"
+
+#: parted/ui.c:266
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTDIV (Float: divide by zero)"
+msgstr ""
+"\n"
+"Hiba: FPE_FLTDIV (lebegő: osztás zéróval)"
+
+#: parted/ui.c:270
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTOVF (Float: overflow)"
+msgstr ""
+"\n"
+"Hiba: FPE_FLTOVF (lebegő: túlcsordulás)"
+
+#: parted/ui.c:274
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTUND (Float: underflow)"
+msgstr ""
+"\n"
+"Hiba: FPE_FLTUND (lebegő: alulcsordul)"
+
+#: parted/ui.c:278
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTRES (Float: inexact result)"
+msgstr ""
+"\n"
+"Hiba: FPE_FLTRES (lebegő: pontatlan eredmény)"
+
+#: parted/ui.c:282
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTINV (Float: invalid operation)"
+msgstr ""
+"\n"
+"Hiba: FPE_FLTINV (lebegő: rossz művelet)"
+
+#: parted/ui.c:286
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTSUB (Float: subscript out of range)"
+msgstr ""
+
+#: parted/ui.c:291
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGFPE signal was encountered."
+msgstr ""
+"\n"
+"Hiba: Általános SIGFPE jel jött."
+
+#: parted/ui.c:310
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPC (Illegal Opcode)"
+msgstr ""
+"\n"
+"Hiba: ILL_ILLOPC (Rossz opkód)"
+
+#: parted/ui.c:314
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPN (Illegal Operand)"
+msgstr ""
+"\n"
+"Hiba: ILL_ILLOPN (Rossz operandus)"
+
+#: parted/ui.c:318
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLADR (Illegal addressing mode)"
+msgstr ""
+"\n"
+"Hiba: ILL_ILLADR (Rossz címzési mód)"
+
+#: parted/ui.c:323
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLTRP (Illegal Trap)"
+msgstr ""
+"\n"
+"Hiba: ILL_ILLTRP (Hibás trap)"
+
+#: parted/ui.c:327
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVOPC (Privileged Opcode)"
+msgstr ""
+"\n"
+"Hiba: ILL_PRVOPC (Fenntartott opkód)"
+
+#: parted/ui.c:331
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVREG (Privileged Register)"
+msgstr ""
+"\n"
+"Hiba: ILL_PRVREG (Fenntartott regiszter)"
+
+#: parted/ui.c:335
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_COPROC (Coprocessor Error)"
+msgstr ""
+"\n"
+"Hiba: ILL_COPROC (Koprocesszor hiba)"
+
+#: parted/ui.c:339
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_BADSTK (Internal Stack Error)"
+msgstr ""
+"\n"
+"Hiba: ILL_BADSTK (Belső stack hiba)"
+
+#: parted/ui.c:343
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGILL signal was encountered."
+msgstr ""
+"\n"
+"Hiba: Általános SIGILL jel érkezett."
+
+#: parted/ui.c:828
+msgid "Expecting a partition number."
+msgstr "Egy partíció értéket várok."
+
+#: parted/ui.c:837
+msgid "Partition doesn't exist."
+msgstr "A partíció nem létezik."
+
+#: parted/ui.c:857
+msgid "Expecting a file system type."
+msgstr "Egy fájlrendszer típust várok."
+
+#: parted/ui.c:863
+#, c-format
+msgid "Unknown file system type \"%s\"."
+msgstr "Ismeretlen \"%s\" fájlrendszer típus."
+
+#: parted/ui.c:883
+msgid "Expecting a disk label type."
+msgstr "Egy lemez címke típust várok."
+
+#: parted/ui.c:977
+msgid "Can't create any more partitions."
+msgstr "Nem tudok több partíciót létrehozni."
+
+#: parted/ui.c:987
+msgid "Expecting a partition type."
+msgstr "Egy partíció típust várok."
+
+#: parted/ui.c:1115
+msgid "on"
+msgstr "be"
+
+#: parted/ui.c:1116
+msgid "off"
+msgstr "ki"
+
+#: parted/ui.c:1227
+msgid "OPTIONs:"
+msgstr "OPCIÓk:"
+
+#: parted/ui.c:1230
+msgid "COMMANDs:"
+msgstr "PARANCSok:"
+
+#: parted/ui.c:1238
+#, c-format
+msgid "Using %s\n"
+msgstr "%s használata\n"
+
diff --git a/po/id.po b/po/id.po
new file mode 100644
index 0000000..7da42cc
--- /dev/null
+++ b/po/id.po
@@ -0,0 +1,2418 @@
+# Pesan Bahasa Indonesia untuk GNU parted
+# Copyright (C) 2005 Free Software Foundation, Inc.
+# This file is distributed under the same license as the GNU parted package.
+# Arif E. Nugroho <arif_endro@yahoo.com>, 2005.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU parted 1.6.23\n"
+"Report-Msgid-Bugs-To: bug-parted@gnu.org\n"
+"POT-Creation-Date: 2006-04-21 21:20+0200\n"
+"PO-Revision-Date: 2005-09-05 08:28+0700\n"
+"Last-Translator: Arif E. Nugroho <arif_endro@yahoo.com>\n"
+"Language-Team: Indonesian <translation-team-id@lists.sourceforge.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: libparted/arch/linux.c:284
+#, c-format
+msgid "Could not stat device %s - %s."
+msgstr "Tidak dapat memperoleh statistik perangkat %s - %s."
+
+#: libparted/arch/linux.c:390
+#, c-format
+msgid ""
+"Could not determine sector size for %s: %s.\n"
+"Using the default sector size (%lld)."
+msgstr ""
+
+#: libparted/arch/linux.c:401
+#, c-format
+msgid ""
+"Device %s has a logical sector size of %lld. Not all parts of GNU Parted "
+"support this at the moment, and the working code is HIGHLY EXPERIMENTAL.\n"
+msgstr ""
+
+#: libparted/arch/linux.c:441
+#, c-format
+msgid "Unable to determine the size of %s (%s)."
+msgstr "Tidak dapat menentukan ukuran dari %s (%s)."
+
+#: libparted/arch/linux.c:530
+#, c-format
+msgid "Could not get identity of device %s - %s"
+msgstr "Tidak dapat memperoleh identitas dari perangkat %s - %s"
+
+#: libparted/arch/linux.c:539
+msgid "Generic IDE"
+msgstr ""
+
+#: libparted/arch/linux.c:556
+#, c-format
+msgid ""
+"Device %s has multiple (%d) logical sectors per physical sector.\n"
+"GNU Parted supports this EXPERIMENTALLY for some special disk label/file "
+"system combinations, e.g. GPT and ext2/3.\n"
+"Please consult the web site for up-to-date information."
+msgstr ""
+
+#: libparted/arch/linux.c:726
+#, c-format
+msgid "Error initialising SCSI device %s - %s"
+msgstr "Error menginitialisasi perangkat SCSI %s - %s"
+
+#: libparted/arch/linux.c:781
+#, fuzzy, c-format
+msgid ""
+"The device %s has zero length, and can't possibly store a file system or "
+"partition table. Perhaps you selected the wrong device?"
+msgstr ""
+"Perangkat %s memiliki panjang nol, dan tidak mungkin menyimpan file system "
+"tabel partisi. Mungkin anda memilih perangkat yang salah?"
+
+#: libparted/arch/linux.c:829
+msgid ""
+"Unable to determine geometry of file/device. You should not use Parted "
+"unless you REALLY know what you're doing!"
+msgstr ""
+"Tidak dapat menentukan geometri dari file/perangkat. Anda seharusnya tidak "
+"menggunakan Parted kecuali anda BENAR - BENAR tahu apa yang anda lakukan!"
+
+#: libparted/arch/linux.c:903
+msgid "DAC960 RAID controller"
+msgstr "DAC960 RAID controller"
+
+#: libparted/arch/linux.c:908
+msgid "Compaq Smart Array"
+msgstr "Compaq Smart Array"
+
+#: libparted/arch/linux.c:913
+msgid "ATARAID Controller"
+msgstr "ATARAID Controller"
+
+#: libparted/arch/linux.c:918
+msgid "I2O Controller"
+msgstr "I2O Controller"
+
+#: libparted/arch/linux.c:923
+msgid "User-Mode Linux UBD"
+msgstr ""
+
+#: libparted/arch/linux.c:933
+msgid "Unknown"
+msgstr "Tidak diketahui"
+
+#: libparted/arch/linux.c:940
+msgid "ped_device_new() Unsupported device type"
+msgstr "ped_device_new() Tipe perangkat tidak disupport"
+
+#: libparted/arch/linux.c:1041 libparted/arch/gnu.c:264
+#, c-format
+msgid "Error opening %s: %s"
+msgstr "Error membuka %s: %s"
+
+#: libparted/arch/linux.c:1052 libparted/arch/gnu.c:274
+#, c-format
+msgid "Unable to open %s read-write (%s). %s has been opened read-only."
+msgstr "Tidak dapat membuka %s read-write (%s). %s telah dibuka read-only."
+
+#: libparted/arch/linux.c:1160 libparted/arch/linux.c:1228
+#: libparted/arch/gnu.c:452 libparted/arch/gnu.c:550 libparted/arch/gnu.c:678
+#, c-format
+msgid "%s during read on %s"
+msgstr "%s selama pembacaan pada %s"
+
+#: libparted/arch/linux.c:1199
+#, c-format
+msgid "%s during seek for read on %s"
+msgstr "%s selama pencarian untuk dibaca pada %s"
+
+#: libparted/arch/linux.c:1270 libparted/arch/linux.c:1355
+#: libparted/arch/linux.c:1413 libparted/arch/gnu.c:587
+#: libparted/arch/gnu.c:632 libparted/arch/gnu.c:709
+#, c-format
+msgid "%s during write on %s"
+msgstr "%s selama penulisan pada %s"
+
+#: libparted/arch/linux.c:1297 libparted/arch/gnu.c:512
+#, c-format
+msgid "Can't write to %s, because it is opened read-only."
+msgstr "Tidak dapat menulis pada %s, karena ini dibuka secara read-only."
+
+#: libparted/arch/linux.c:1321
+#, c-format
+msgid "%s during seek for write on %s"
+msgstr "%s selama pencarian untuk menulis pada %s"
+
+#: libparted/arch/linux.c:1798
+#, c-format
+msgid ""
+"Error informing the kernel about modifications to partition %s -- %s. This "
+"means Linux won't know about any changes you made to %s until you reboot -- "
+"so you shouldn't mount it or use it in any way before rebooting."
+msgstr ""
+"Error memberitahukan kernel tentang modifikasi pada partisi %s -- %s. Ini "
+"berarti Linux tidak tahu tentang segala perubahan yang anda buat untuk %s "
+"hingga anda reboot -- jadi anda tidak boleh me-mount-nya atau menggunakannya "
+"dalam segala cara sebelum mereboot-nya."
+
+#: libparted/arch/linux.c:1879
+#, c-format
+msgid ""
+"The kernel was unable to re-read the partition table on %s (%s). This means "
+"Linux won't know anything about the modifications you made until you "
+"reboot. You should reboot your computer before doing anything with %s."
+msgstr ""
+"Kernel tidak dapat membaca kembali tabel partisi pada %s (%s). Ini berarti "
+"Linux tidak akan tahu apapun tentang modifikasi yang anda buat sampai anda "
+"reboot. Anda seharusnya mereboot komputer anda sebelum melakukan apapun "
+"dengan %s."
+
+#: libparted/arch/gnu.c:97
+#, c-format
+msgid "Unable to open %s."
+msgstr "Tidak dapat membuka %s."
+
+#: libparted/arch/gnu.c:117
+msgid "Unable to probe store."
+msgstr "Tidak dapat memprobe store."
+
+#: libparted/arch/gnu.c:355
+msgid ""
+"The partition table cannot be re-read. This means you need to reboot before "
+"mounting any modified partitions. You also need to reinstall your boot "
+"loader before you reboot (which may require mounting modified partitions). "
+"It is impossible do both things! So you'll need to boot off a rescue disk, "
+"and reinstall your boot loader from the rescue disk. Read section 4 of the "
+"Parted User documentation for more information."
+msgstr ""
+"Tabel partisi tidak dapat dibaca ulang. Ini berarti anda perlu untuk me-"
+"reboot terlebih dahulu sebelum me-mount semua partisi yang dimodifikasi. "
+"Anda juga perlu menginstall kembali bootloader anda sebelum me-reboot "
+"komputer anda (yang memerlukan untuk me-mount partisi yang dimodifikasi). "
+"Ini tidak mungkin untuk melakukan keduanya secara sekaligus! Jadi anda perlu "
+"membuat sebuah disket penolong (rescue), dan menginstall bootloader anda "
+"dari disket penolong tersebut. Baca bagian 4 dari dokumentasi pengguna "
+"Parted untuk informasi lebih lanjut."
+
+#: libparted/arch/gnu.c:372
+#, c-format
+msgid ""
+"The partition table on %s cannot be re-read (%s). This means the Hurd knows "
+"nothing about any modifications you made. You should reboot your computer "
+"before doing anything with %s."
+msgstr ""
+"Tabel partisi pada %s tidak dapat dibaca kembali (%s). Ini berarti hurd "
+"tidak tahu apa-apa tentang modifikasi yang anda buat. Anda seharusnya "
+"mereboot komputer anda sebelum melakukan apapun dengan %s."
+
+#: libparted/arch/gnu.c:383 parted/parted.c:2215
+msgid ""
+"You should reinstall your boot loader before rebooting. Read section 4 of "
+"the Parted User documentation for more information."
+msgstr ""
+"Anda seharusnya menginstall ulang boot loader anda sebelum merebootnya. Baca "
+"bagian 4 dari Parted dokumentasi pengguna untuk informasi lebih lanjut."
+
+#: libparted/arch/gnu.c:774
+#, c-format
+msgid "%s trying to sync %s to disk"
+msgstr "%s mencoba untuk mensinkronisasi %s pada disk"
+
+#: libparted/disk.c:183
+#, c-format
+msgid "Unable to open %s - unrecognised disk label."
+msgstr "Tidak dapat membuka %s - disk label tidak diketahui"
+
+#: libparted/disk.c:452
+#, c-format
+msgid ""
+"This libparted doesn't have write support for %s. Perhaps it was compiled "
+"read-only."
+msgstr ""
+"libparted ini tidak memiliki write support untuk %s. Mungkin ini dikompile "
+"read-only."
+
+#: libparted/disk.c:579
+#, c-format
+msgid "Partition %d is %s, but the file system is %s."
+msgstr "Partisi %d adalah %s, tetapi file system-nya adalah %s."
+
+#: libparted/disk.c:1056
+#, c-format
+msgid "%s disk labels do not support extended partitions."
+msgstr "%s disk label tidak mensupport partisi extended."
+
+#: libparted/disk.c:1616
+#, c-format
+msgid "%s disk labels don't support logical or extended partitions."
+msgstr "%s disk labels tidak mensupport partisi logical atau extended."
+
+#: libparted/disk.c:1629
+msgid "Too many primary partitions."
+msgstr "Terlalu banyak primary partisi."
+
+#: libparted/disk.c:1638
+#, c-format
+msgid ""
+"Can't add a logical partition to %s, because there is no extended partition."
+msgstr ""
+"Tidak dapat menambahkan sebuah partisi logical pada %s, karena disana tidak "
+"ada partisi extended."
+
+#: libparted/disk.c:1662
+#, c-format
+msgid "Can't have more than one extended partition on %s."
+msgstr "Tidak dapat memiliki lebih dari satu partisi extended pada %s."
+
+#: libparted/disk.c:1672
+msgid "Can't have logical partitions outside of the extended partition."
+msgstr "Tidak dapat memiliki partisi logical diluar dari partisi extended."
+
+#: libparted/disk.c:1697
+#, c-format
+msgid "Can't have a logical partition outside of the extended partition on %s."
+msgstr "Tidak dapat memiliki partisi logical diluar partisi extended pada %s."
+
+#: libparted/disk.c:1707 libparted/disk.c:1761 libparted/disk.c:1927
+msgid "Can't have overlapping partitions."
+msgstr "Tidak dapat memiliki partisi yang beroverlap."
+
+#: libparted/disk.c:1715
+msgid "Can't have a primary partition inside an extended partition."
+msgstr "Tidak dapat memiliki primary partisi didalam sebuah partisi extended."
+
+#: libparted/disk.c:2123
+msgid "metadata"
+msgstr "metadata"
+
+#: libparted/disk.c:2125
+msgid "free"
+msgstr "free"
+
+#: libparted/disk.c:2127 parted/ui.c:968 parted/ui.c:996
+msgid "extended"
+msgstr "extended"
+
+#: libparted/disk.c:2129 parted/ui.c:972 parted/ui.c:1000
+msgid "logical"
+msgstr "logical"
+
+#: libparted/disk.c:2131 parted/ui.c:964 parted/ui.c:992
+msgid "primary"
+msgstr "primary"
+
+#: libparted/disk.c:2147
+msgid "boot"
+msgstr "boot"
+
+#: libparted/disk.c:2149
+msgid "root"
+msgstr "root"
+
+#: libparted/disk.c:2151
+msgid "swap"
+msgstr "swap"
+
+#: libparted/disk.c:2153
+msgid "hidden"
+msgstr "tersembunyi"
+
+#: libparted/disk.c:2155
+msgid "raid"
+msgstr "raid"
+
+#: libparted/disk.c:2157
+msgid "lvm"
+msgstr "lvm"
+
+#: libparted/disk.c:2159
+msgid "lba"
+msgstr "lba"
+
+#: libparted/disk.c:2161
+msgid "hp-service"
+msgstr "hp-service"
+
+#: libparted/disk.c:2163
+msgid "palo"
+msgstr "palo"
+
+#: libparted/disk.c:2165
+msgid "prep"
+msgstr "prep"
+
+#: libparted/disk.c:2167
+msgid "msftres"
+msgstr ""
+
+#: libparted/disk.c:2173
+#, c-format
+msgid "Unknown partition flag, %d."
+msgstr "flag partisi tidak diketahui, %d."
+
+#: libparted/labels/rdb.c:177
+#, c-format
+msgid "%s : Bad checksum on block %llu of type %s."
+msgstr "%s : Checksum pada block %llu dengan tipe %s tidak baik."
+
+#: libparted/labels/rdb.c:510
+#, c-format
+msgid "%s : Didn't find rdb block, should never happen."
+msgstr "%s : Tidak menemukan rdb block, seharusnya tidak pernah terjadi."
+
+#: libparted/labels/rdb.c:595
+#, c-format
+msgid "%s : Loop detected at block %d."
+msgstr "%s : Loop terdeteksi pada block %d."
+
+#: libparted/labels/rdb.c:614
+#, c-format
+msgid "%s : The %s list seems bad at block %s."
+msgstr "%s : List %s kelihatannya tidak baik pada block %s."
+
+#: libparted/labels/rdb.c:703
+#, c-format
+msgid "%s : Failed to list bad blocks."
+msgstr "%s : Gagal untuk men-list bad blocks."
+
+#: libparted/labels/rdb.c:711
+#, c-format
+msgid "%s : Failed to list partition blocks."
+msgstr "%s : Gagal untuk men-list block partisi."
+
+#: libparted/labels/rdb.c:719
+#, c-format
+msgid "%s : Failed to list file system blocks."
+msgstr "%s : Gagal untuk men-list file system blocks."
+
+#: libparted/labels/rdb.c:727
+#, c-format
+msgid "%s : Failed to list boot blocks."
+msgstr "%s : Gagal untuk men-list boot blocks."
+
+#: libparted/labels/rdb.c:750
+#, c-format
+msgid "Failed to write partition block at %d."
+msgstr "Gagal untuk menulis block partisi pada %d."
+
+#: libparted/labels/rdb.c:1053 libparted/labels/bsd.c:505
+#: libparted/labels/dos.c:1942 libparted/labels/dvh.c:772
+#: libparted/labels/gpt.c:1365 libparted/labels/loop.c:251
+#: libparted/labels/mac.c:1318 libparted/labels/pc98.c:764
+#: libparted/labels/sun.c:704
+msgid "Unable to satisfy all constraints on the partition."
+msgstr "Tidak dapat memenuhi semua constraints pada partisi."
+
+#: libparted/labels/rdb.c:1081
+msgid "Unable to allocate a partition number."
+msgstr "Tidak dapat mengalokasikan sebuah nomor partisi."
+
+#: libparted/labels/bsd.c:530
+msgid "Unable to allocate a bsd disklabel slot."
+msgstr "Tidak dapat mengalokasikan sebuah slot untuk bsd disklabel."
+
+#: libparted/labels/dos.c:812
+#, c-format
+msgid "Invalid partition table on %s -- wrong signature %x."
+msgstr "Table partisi tidak valid pada %s -- signature salah %x."
+
+#: libparted/labels/dos.c:840
+#, c-format
+msgid "Invalid partition table - recursive partition on %s."
+msgstr "Table partisi tidak valid - rekursif partisi pada %s."
+
+#: libparted/labels/dos.c:1300
+msgid "Extended partitions cannot be hidden on msdos disk labels."
+msgstr "Partisi extended tidak dapat disembunyikan pada msdos disk labels."
+
+#: libparted/labels/dos.c:1926
+msgid "Parted can't resize partitions managed by Windows Dynamic Disk."
+msgstr ""
+"Parted tidak dapat men-resize partisi yang diatur oleh Windows Dynamic Disk."
+
+#: libparted/labels/dvh.c:192
+#, fuzzy, c-format
+msgid "%s has no extended partition (volume header partition)."
+msgstr ""
+"%s tidak memiliki partisi extended (volume header partisi). Jika anda "
+"menghiraukan ini, maka semua boot volumes akan dihapus."
+
+#: libparted/labels/dvh.c:315
+msgid "Checksum is wrong, indicating the partition table is corrupt."
+msgstr "Checksum salah, mengindikasikan bahwa tabel partisi corrupt."
+
+#: libparted/labels/dvh.c:616
+msgid "Only primary partitions can be root partitions."
+msgstr "Hanya primary partisi yang dapat menjadi partisi root."
+
+#: libparted/labels/dvh.c:630
+msgid "Only primary partitions can be swap partitions."
+msgstr "Hanya primary partisi yang dapat menjadi partisi swap."
+
+#: libparted/labels/dvh.c:644
+msgid "Only logical partitions can be a boot file."
+msgstr "Hanya logical partisi yang dapat menjadi boot file."
+
+#: libparted/labels/dvh.c:723
+msgid "Only logical partitions (boot files) have a name."
+msgstr "Hanya logical partisi (boot files) yang memiliki nama."
+
+#: libparted/labels/dvh.c:814
+msgid "Too many primary partitions"
+msgstr "Terlalu banyak primary partisi"
+
+#: libparted/labels/gpt.c:433
+#, c-format
+msgid ""
+"%s contains GPT signatures, indicating that it has a GPT table. However, it "
+"does not have a valid fake msdos partition table, as it should. Perhaps it "
+"was corrupted -- possibly by a program that doesn't understand GPT partition "
+"tables. Or perhaps you deleted the GPT table, and are now using an msdos "
+"partition table. Is this a GPT partition table?"
+msgstr ""
+"%s berisi GPT signatures, menunjukkan bahwa ini adalah tabel GPT. Akan "
+"tetapi, ini tidak memiliki valid fake msdos tabel partisi, seperti "
+"seharusnya. Mungkin ini sudah terkorupsi -- mungkin oleh program yang tidak "
+"mengerti tabel partisi GPT. Atau mungkin anda menghapus tabel GPT, dan "
+"sekarang menggunakan sebuah tabel partisi msdos. Apakah ini sebuah tabel "
+"partisi GPT?"
+
+#: libparted/labels/gpt.c:625
+#, c-format
+msgid ""
+"The format of the GPT partition table is version %x, which is newer than "
+"what Parted can recognise. Please tell us! bug-parted@gnu.org"
+msgstr ""
+"Format dari tabel partisi GPT adalah dari versi %x, dimana ini lebih baru "
+"dari format yang Parted dapat mengenalnya. Tolong beritahu kami! bug-"
+"parted@gnu.org"
+
+#: libparted/labels/gpt.c:747
+msgid ""
+"The backup GPT table is not at the end of the disk, as it should be. This "
+"might mean that another operating system believes the disk is smaller. Fix, "
+"by moving the backup to the end (and removing the old backup)?"
+msgstr ""
+"Tabel GPT backup tidak ada pada akhir dari disk, seperti seharusnya ada "
+"disana. Ini mungkin berarti sistem operasi lain percaya bahwa ukuran disk "
+"lebih kecil. Betulkan, dengan memindahkan tabel backup ke akhir dari disk "
+"(dan menghapus backup yang lama)?"
+
+#: libparted/labels/gpt.c:782
+msgid ""
+"The primary GPT table is corrupt, but the backup appears OK, so that will be "
+"used."
+msgstr ""
+"Tabel GPT primer telah terkorupsi, tetapi backup-nya kelihatan BAIK, jadi "
+"backup tersebut yang akan digunakan"
+
+#: libparted/labels/gpt.c:790
+msgid ""
+"Both the primary and backup GPT tables are corrupt. Try making a fresh "
+"table, and using Parted's rescue feature to recover partitions."
+msgstr ""
+"Kedua tabel GPT primer dan backup sudah terkorupsi. Coba untuk membuat "
+"sebuah tabel yang baru, dan gunakan Parted's rescue feature untuk merecover "
+"partisi."
+
+#: libparted/labels/mac.c:167
+#, c-format
+msgid "Invalid signature %x for Mac disk labels."
+msgstr "Signature tidak valid %x untuk disklabels Mac."
+
+#: libparted/labels/mac.c:212
+msgid "Partition map has no partition map entry!"
+msgstr "Map partisi tidak memiliki masukan untuk map partisi!"
+
+#: libparted/labels/mac.c:259
+#, c-format
+msgid "%s is too small for a Mac disk label!"
+msgstr "%s terlalu kecil untuk sebuah disklabel Mac!"
+
+#: libparted/labels/mac.c:490
+#, c-format
+msgid "Partition %d has an invalid signature %x."
+msgstr "Partisi %d memiliki signature yang tidak valid %x."
+
+#: libparted/labels/mac.c:508
+#, c-format
+msgid "Partition %d has an invalid length of 0 bytes!"
+msgstr "Partisi %d memiliki panjang 0 bytes yang tidak valid!"
+
+#: libparted/labels/mac.c:536
+msgid "The data region doesn't start at the start of the partition."
+msgstr "Daerah data tidak dimulai pada awal dari partisi."
+
+#: libparted/labels/mac.c:553
+msgid "The boot region doesn't start at the start of the partition."
+msgstr "Daerah boot tidak dimulai pada awal dari partisi."
+
+#: libparted/labels/mac.c:567
+msgid "The partition's boot region doesn't occupy the entire partition."
+msgstr "Daerah boot partisi tidak menggunakan seluruh partisi."
+
+#: libparted/labels/mac.c:577
+msgid "The partition's data region doesn't occupy the entire partition."
+msgstr "Daerah data partisi tidak menggunakan seluruh partisi."
+
+#: libparted/labels/mac.c:631
+#, c-format
+msgid ""
+"Weird block size on device descriptor: %d bytes is not divisible by 512."
+msgstr ""
+"Ukuran block aneh pada deskripsi perangkat: %d bytes tidak terbagi oleh 512."
+
+#: libparted/labels/mac.c:644
+#, c-format
+msgid ""
+"The driver descriptor says the physical block size is %d bytes, but Linux "
+"says it is %d bytes."
+msgstr ""
+"driver descriptor mengatakan bahwa ukuran physical block adalah %d bytes, "
+"tetapi Linux mengatakan ukurannya %d bytes."
+
+#: libparted/labels/mac.c:692
+msgid "No valid partition map found."
+msgstr "Tidak ditemukan map partisi yang valid."
+
+#: libparted/labels/mac.c:744
+#, c-format
+msgid ""
+"Conflicting partition map entry sizes! Entry 1 says it is %d, but entry %d "
+"says it is %d!"
+msgstr ""
+"Konflik masukan ukuran peta partisi! Masukan 1 mengatakan %d, tetapi "
+"masukan %d mengatakan %d!"
+
+#: libparted/labels/mac.c:771
+msgid "Weird! There are 2 partitions map entries!"
+msgstr "Aneh! Ada 2 masukan map partisi!"
+
+#: libparted/labels/mac.c:1257
+msgid ""
+"Changing the name of a root or swap partition will prevent Linux from "
+"recognising it as such."
+msgstr ""
+"Mengubah nama dari root atau partisi swap akan membuat Linux tidak dapat "
+"mengenalinya."
+
+#: libparted/labels/mac.c:1353
+msgid "Can't add another partition -- the partition map is too small!"
+msgstr "Tidak dapat lagi menambah partisi -- peta partisi terlalu kecil!"
+
+#: libparted/labels/pc98.c:357
+#, c-format
+msgid "Invalid partition table on %s."
+msgstr "Tabel partisi tidak valid pada %s."
+
+#: libparted/labels/pc98.c:409 libparted/labels/pc98.c:487
+#, c-format
+msgid ""
+"Partition %d isn't aligned to cylinder boundaries. This is still "
+"unsupported."
+msgstr ""
+"Partisi %d tidak di align ke cylinder boundaries. Ini tetap tidak disupport"
+
+#: libparted/labels/pc98.c:796
+msgid "Can't add another partition."
+msgstr "Tidak dapat menambah partisi yang lain."
+
+#: libparted/labels/sun.c:143
+msgid "Corrupted Sun disk label detected."
+msgstr "Sun disk label terdeteksi terkorupsi."
+
+#: libparted/labels/sun.c:264
+#, c-format
+msgid ""
+"The disk CHS geometry (%d,%d,%d) reported by the operating system does not "
+"match the geometry stored on the disk label (%d,%d,%d)."
+msgstr ""
+"Geometri CHS dari disk (%d,%d,%d) dilaporkan oleh sistem operasi tidak cocok "
+"dengan geometri yang disimpan pada disk label (%d,%d,%d)."
+
+#: libparted/labels/sun.c:286
+#, c-format
+msgid "The disk label describes a disk bigger than %s."
+msgstr "Disk label mendeskripsikan disk lebih besar dari %s."
+
+#: libparted/labels/sun.c:440
+#, c-format
+msgid "The disk has %d cylinders, which is greater than the maximum of 65536."
+msgstr ""
+"Disk memiliki %d cylinders, dimana ini lebih besar dari maksimum 65536."
+
+#: libparted/labels/sun.c:736
+msgid ""
+"The Whole Disk partition is the only available one left. Generally, it is "
+"not a good idea to overwrite this partition with a real one. Solaris may "
+"not be able to boot without it, and SILO (the sparc boot loader) appreciates "
+"it as well."
+msgstr ""
+"Yang tersisa hanya seluruh partisi Disk. Umumnya, ini bukan ide yang baik "
+"untuk menulis kembali partisi ini dengan yang nyata. Solaris mungkin tidak "
+"dapat di-boot tanpanya, dan SILO (boot loader untuk SPARC) menghargainya "
+"dengan baik."
+
+#: libparted/labels/sun.c:751
+msgid "Sun disk label is full."
+msgstr "Sun disk label sudah penuh"
+
+#: libparted/filesys.c:386
+msgid "Could not detect file system."
+msgstr "Tidak dapat mendeteksi filesystem."
+
+#: libparted/filesys.c:397
+msgid "The file system is bigger than its volume!"
+msgstr "File system lebih besar dari volumenya!"
+
+#: libparted/filesys.c:405
+#, c-format
+msgid "Support for opening %s file systems is not implemented yet."
+msgstr "Support untuk membuka file systems %s belum diimplementasikan."
+
+#: libparted/filesys.c:447
+#, c-format
+msgid "Support for creating %s file systems is not implemented yet."
+msgstr "Support untuk membuat file systems %s belum diimplementasikan."
+
+#: libparted/filesys.c:508
+#, c-format
+msgid "Support for checking %s file systems is not implemented yet."
+msgstr "Support untuk mengecheck file systems %s belum diimplementasikan."
+
+#: libparted/filesys.c:574
+msgid "raw block copying"
+msgstr "raw block copying"
+
+#: libparted/filesys.c:585
+msgid "growing file system"
+msgstr "memperbesar file system"
+
+#: libparted/filesys.c:625
+msgid "Can't copy onto an overlapping partition."
+msgstr "Tidak dapat menyalin kedalam partisi yang overlap."
+
+#: libparted/filesys.c:647
+#, c-format
+msgid ""
+"Direct support for copying file systems is not yet implemented for %s. "
+"However, support for resizing is implemented. Therefore, the file system "
+"can be copied if the new partition is at least as big as the old one. So, "
+"either shrink the partition you are trying to copy, or copy to a bigger "
+"partition."
+msgstr ""
+"Layanan langsung untuk menyalin file system belum diimplementasikan untuk %"
+"s. Akan tetapi, layanan untuk me-resize-nya sudah diimplementasikan. Oleh "
+"karena itu, file system dapat disalin jika partisi baru berukuran sama besar "
+"dengan partisi lama. Jadi, bisa dilakukan dengan mengecilkan partisi yang "
+"akan disalin, atau menyalin ke partisi yang lebih besar."
+
+#: libparted/filesys.c:661
+#, c-format
+msgid "Support for copying %s file systems is not implemented yet."
+msgstr "Support untuk menyalin filesystem %s belum diimplementasikan."
+
+#: libparted/filesys.c:699
+#, c-format
+msgid "Support for resizing %s file systems is not implemented yet."
+msgstr "Support untuk men-resize filesystem %s belum diimplementasikan."
+
+#: libparted/exception.c:78
+msgid "Information"
+msgstr "Informasi"
+
+#: libparted/exception.c:79
+msgid "Warning"
+msgstr "Peringatan"
+
+#: libparted/exception.c:80
+msgid "Error"
+msgstr "Error"
+
+#: libparted/exception.c:81
+msgid "Fatal"
+msgstr "Fatal"
+
+#: libparted/exception.c:82
+msgid "Bug"
+msgstr "Bug"
+
+#: libparted/exception.c:83
+msgid "No Implementation"
+msgstr "Tidak ada Implementasi"
+
+#: libparted/exception.c:87
+msgid "Fix"
+msgstr "Fix"
+
+#: libparted/exception.c:88
+msgid "Yes"
+msgstr "Ya"
+
+#: libparted/exception.c:89
+msgid "No"
+msgstr "Tidak"
+
+#: libparted/exception.c:90
+msgid "OK"
+msgstr "OK"
+
+#: libparted/exception.c:91
+msgid "Retry"
+msgstr "Coba"
+
+#: libparted/exception.c:92
+msgid "Ignore"
+msgstr "Hiraukan"
+
+#: libparted/exception.c:93
+msgid "Cancel"
+msgstr "Batal"
+
+#: libparted/exception.c:133
+#, fuzzy, c-format
+msgid ""
+"A bug has been detected in GNU Parted. Refer to the web site of parted "
+"http://www.gnu.org/software/parted/parted.html for more informations of what "
+"could be useful for bug submitting! Please email a bug report to bug-"
+"parted@gnu.org containing at least the version (%s) and the following "
+"message: "
+msgstr ""
+"Sebuah bug telah terdeteksi dalam GNU parted. Tolong email laporan bug ke\n"
+"bug-parted@gnu.org berisi versi (%s) dan pesan berikut ini:"
+
+#: libparted/cs/geom.c:162
+msgid "Can't have the end before the start!"
+msgstr "Tidak dapat memiliki akhir sebelum start!"
+
+#: libparted/cs/geom.c:169
+msgid "Can't have a partition outside the disk!"
+msgstr "Tidak dapat memiliki partisi diluar dari disk!"
+
+#: libparted/cs/geom.c:303
+#, c-format
+msgid "Attempt to read sectors %ld-%ld outside of partition on %s."
+msgstr "Mencoba untuk membaca sektor %ld-%ld diluar dari partisi pada %s."
+
+#: libparted/cs/geom.c:373
+#, c-format
+msgid "Attempt to write sectors %ld-%ld outside of partition on %s."
+msgstr "Mencoba untuk menulis sektor %ld-%ld diluar dari partisi pada %s."
+
+#: libparted/cs/geom.c:413 libparted/fs/linux_swap/linux_swap.c:353
+msgid "checking for bad blocks"
+msgstr "Mengecheck bad blocks"
+
+#: libparted/libparted.c:286 libparted/libparted.c:306
+msgid "Out of memory."
+msgstr "Kehabisan memori"
+
+#: libparted/unit.c:139
+msgid "Cannot get unit size for special unit 'COMPACT'."
+msgstr "Tidak dapat mendapatkan ukuran unit untuk spesial unit 'COMPAT'."
+
+#: libparted/unit.c:382
+#, c-format
+msgid "\"%s\" has invalid syntax for locations."
+msgstr "\"%s\" memiliki syntax yang tidak valid untuk lokasi."
+
+#: libparted/unit.c:390
+#, c-format
+msgid "The maximum head value is %d."
+msgstr "Nilai head maksimum adalah %d."
+
+#: libparted/unit.c:397
+#, c-format
+msgid "The maximum sector value is %d."
+msgstr "Nilai maksimum dari sektor adalah %d."
+
+#: libparted/unit.c:409 libparted/unit.c:540
+#, c-format
+msgid "The location %s is outside of the device %s."
+msgstr "Lokasi %s terletak diluar dari perangkat %s."
+
+#: libparted/unit.c:522
+msgid "Invalid number."
+msgstr "nomor tidak valid."
+
+#: libparted/fs/ext2/ext2.c:87 libparted/fs/ext2/ext2.c:112
+msgid "Inconsistent group descriptors!"
+msgstr "group descriptors tidak konsistent!"
+
+#: libparted/fs/ext2/ext2.c:91 libparted/fs/ext2/ext2.c:116
+msgid "File system full!"
+msgstr "File system full!"
+
+#: libparted/fs/ext2/ext2.c:750
+msgid "Invalid superblock. Are you sure this is an ext2 file system?"
+msgstr ""
+"Superblock tidak valid. Apakah anda yakin ini merupakan sebuah ext2 file "
+"system?"
+
+#: libparted/fs/ext2/ext2.c:764 libparted/fs/ext2/ext2_resize.c:597
+msgid "File system has errors! You should run e2fsck."
+msgstr "File system memiliki errors! Anda seharusnya menjalankan e2fsck."
+
+#: libparted/fs/ext2/ext2.c:775
+msgid ""
+"File system was not cleanly unmounted! You should run e2fsck. Modifying an "
+"unclean file system could cause severe corruption."
+msgstr ""
+"File system tidak di-unmount secara bersih! Anda seharusnya menjalankan "
+"e2fsck. Memodifikasi sebuah file system yang tidak bersih dapat menyebabkan "
+"file system tersebut terkorupsi."
+
+#: libparted/fs/ext2/ext2.c:795
+msgid "File system has an incompatible feature enabled."
+msgstr "File system memiliki sebuah feature aktif yang tidak kompatibel."
+
+#: libparted/fs/ext2/ext2.c:806
+msgid "Error allocating buffer cache."
+msgstr "Error mengalokasikan buffer cache."
+
+#: libparted/fs/ext2/ext2.c:848
+msgid ""
+"A resize operation on this file system will use EXPERIMENTAL code that MAY "
+"CORRUPT it (although it hasn't done so yet).You should at least backup your "
+"data and run 'e2fsck -f' afterwards."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:114
+msgid ""
+"Found an inode with a incorrect link count. Better go run e2fsck first!"
+msgstr ""
+"Ditemukan sebuah inode dengan link count yang tidak benar. Lebih baik "
+"menjalankan e2fsck terlebih dahulu!"
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:487
+msgid "Not enough free inodes!"
+msgstr "Tidak cukup free inodes!"
+
+#: libparted/fs/ext2/ext2_resize.c:224
+msgid "File system is too full to remove a group!"
+msgstr "File system terlalu penuh untuk menghapus sebuah group!"
+
+#: libparted/fs/ext2/ext2_resize.c:233
+msgid "File system has too many allocated inodes to remove a group!"
+msgstr ""
+"File system memiliki terlalu banyak inode yang sudah dialokasikan untuk "
+"menghapus sebuah group!"
+
+#: libparted/fs/ext2/ext2_resize.c:493
+msgid "adding groups"
+msgstr "menambahkan groups"
+
+#: libparted/fs/ext2/ext2_resize.c:530
+#, c-format
+msgid "Your file system is too full to resize it to %i blocks. Sorry."
+msgstr ""
+"File system anda terlalu penuh untuk men-resize-nya menjadi %i blocks. Maaf."
+
+#: libparted/fs/ext2/ext2_resize.c:540
+#, c-format
+msgid ""
+"Your file system has too many occupied inodes to resize it to %i blocks. "
+"Sorry."
+msgstr ""
+"File system anda memiliki terlalu banyak inode yang terisi untuk diresize "
+"menjadi %i block. Maaf"
+
+#: libparted/fs/ext2/ext2_resize.c:554 libparted/fs/hfs/hfs.c:243
+#: libparted/fs/hfs/hfs.c:624
+msgid "shrinking"
+msgstr "mengecilkan"
+
+#: libparted/fs/ext2/ext2_resize.c:605
+msgid "File system was not cleanly unmounted! You should run e2fsck."
+msgstr ""
+"File system tidak di-unmount secara bersih! Anda seharusnya menjalankan "
+"e2fsck."
+
+#: libparted/fs/ext2/ext2_resize.c:614
+msgid ""
+"The file system has the 'dir_index' feature enabled. Parted can only resize "
+"the file system if it disables this feature. You can enable it later by "
+"running 'tune2fs -O dir_index DEVICE' and then 'e2fsck -fD DEVICE'."
+msgstr ""
+"File system memiliki 'dir_index' featur enabled. Parted hanya bisa me-resize "
+"file system jika ini feature ini dimatikan. Anda dapat menghidupkannya "
+"kembali nanti dengan menjalankan 'tune2fs -O dir_index PERANGKAT' dan "
+"kemudian 'e2fsck -fD PERANGKAT'."
+
+#: libparted/fs/ext2/ext2_block_relocator.c:198
+msgid "Cross-linked blocks found! Better go run e2fsck first!"
+msgstr ""
+"Cross-linked blocks ditemukan! Lebih baik menjalankan e2fsck terlebih daulu!"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:537
+#, c-format
+msgid "Block %i has no reference? Weird."
+msgstr "Block %i tidak memiliki reference? Aneh."
+
+#: libparted/fs/ext2/ext2_block_relocator.c:738
+#, c-format
+msgid "Block %i shouldn't have been marked!"
+msgstr "Block %i seharusnya tidak memiliki tanda !"
+
+#: libparted/fs/ext2/interface.c:188
+msgid ""
+"The ext2 file system passed a basic check. For a more comprehensive check, "
+"use the e2fsck program."
+msgstr ""
+"File system ext2 lolos dari pengecheckan dasar. Untuk lebih komprehensif "
+"check, gunakan aplikasi e2fsck."
+
+#: libparted/fs/ext2/interface.c:205
+msgid "Sorry, can't move the start of ext2 partitions yet!"
+msgstr "Maaf, tidak dapat memindahkan awal dari partisi ext2!"
+
+#: libparted/fs/ext2/ext2_buffer.c:82
+msgid "Couldn't flush buffer cache!"
+msgstr "Tidak dapat menflush buffer cache!"
+
+#: libparted/fs/ext2/ext2_mkfs.c:162
+msgid "writing per-group metadata"
+msgstr "menulis per-group metadata"
+
+#: libparted/fs/ext2/ext2_mkfs.c:565
+msgid "File system too small for ext2."
+msgstr "File system terlalu kecil untuk ext2."
+
+#: libparted/fs/fat/calc.c:134
+#, c-format
+msgid ""
+"You need %s of free disk space to shrink this partition to this size. "
+"Currently, only %s is free."
+msgstr ""
+"Anda butuh %s ruang kosong dari disk untuk mengecilkan partisi ini. Saat ini "
+"hanya %s yang kosong."
+
+#: libparted/fs/fat/context.c:55
+#, c-format
+msgid ""
+"Cluster start delta = %d, which is not a multiple of the cluster size %d."
+msgstr ""
+"Cluster awal delta = %d, dimana bukan kelipatan dari ukuran cluster %d."
+
+#: libparted/fs/fat/fat.c:312
+#, c-format
+msgid "Partition too big/small for a %s file system."
+msgstr "Partisi terlalu besar/kecil untuk sebuah file system %s."
+
+#: libparted/fs/fat/fat.c:478
+msgid ""
+"The FATs don't match. If you don't know what this means, then select "
+"cancel, run scandisk on the file system, and then come back."
+msgstr ""
+"FAT tidak cocok. Jika anda tidak tahu apa artinya ini, maka pilih cancel, "
+"jalankan scandisk pada file system, dan coba lagi."
+
+#: libparted/fs/fat/fat.c:518
+msgid "There are no possible configurations for this FAT type."
+msgstr "Tidak ada konfigurasi yang mungkin untuk tipe FAT ini."
+
+#: libparted/fs/fat/fat.c:530
+#, c-format
+msgid ""
+"File system doesn't have expected sizes for Windows to like it. Cluster "
+"size is %dk (%dk expected); number of clusters is %d (%d expected); size of "
+"FATs is %d sectors (%d expected)."
+msgstr ""
+"Ukuran file system tidak berukuran seperti yang diperkirakan oleh Windows. "
+"Ukuran cluster adalah %dk (%dk diperkirakan); jumlah dari cluster adalah %d "
+"(%d diperkirakan); ukuran dari FATs adalah %d sektor (%d diperkirakan)."
+
+#: libparted/fs/fat/fat.c:553
+#, c-format
+msgid ""
+"File system is reporting the free space as %d clusters, not %d clusters."
+msgstr ""
+"File system melaporkan ruang kosong sebagai %d clusters, bukan %d clusters."
+
+#: libparted/fs/fat/fat.c:878
+msgid ""
+"GNU Parted was miscompiled: the FAT boot sector should be 512 bytes. FAT "
+"support will be disabled."
+msgstr ""
+"GNU Parted telah salah dikompile: FAT boot sektor seharusnya 512 bytes. FAT "
+"support akan di nonaktifkan."
+
+#: libparted/fs/fat/resize.c:158
+msgid ""
+"There's not enough room in the root directory for all of the files. Either "
+"cancel, or ignore to lose the files."
+msgstr ""
+"Tidak terdapat ruangan yang cukup untuk direktori root untuk semua file. "
+"Pilih cancel, atau ignore untuk menggagalkan files."
+
+#: libparted/fs/fat/resize.c:299
+msgid "Error writing to the root directory."
+msgstr "Error menulis pada direktori root."
+
+#: libparted/fs/fat/resize.c:484
+msgid "If you leave your file system as FAT16, then you will have no problems."
+msgstr ""
+"Jika anda meninggalkan file system anda sebagai FAT16, maka anda mungkin "
+"tidak akan menemui masalah"
+
+#: libparted/fs/fat/resize.c:487
+msgid ""
+"If you convert to FAT16, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual)."
+msgstr ""
+"Jika anda mengubah ke FAT16, dan MS Windows terinstall pada partisi "
+"tersebut, maka anda harus meninstall kembali MS Windows boot loader. Jika "
+"anda ingin melakukan ini, anda seharusnya berkonsultasi terlebih dahulu pada "
+"manual dari Parted (atau manual dari distribusi anda)."
+
+#: libparted/fs/fat/resize.c:495
+msgid ""
+"If you leave your file system as FAT32, then you will not introduce any new "
+"problems."
+msgstr ""
+"Jika anda meninggalkan file system sebagai FAT32, mungkin anda tidak menemui "
+"masalah baru."
+
+#: libparted/fs/fat/resize.c:499
+msgid ""
+"If you convert to FAT32, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual). Also, "
+"converting to FAT32 will make the file system unreadable by MS DOS, MS "
+"Windows 95a, and MS Windows NT."
+msgstr ""
+"Jika anda mengubah ke FAT32, dan MS Windows terinstall pada partisi "
+"tersebut, maka anda harus meninstall kembali MS Windows boot loader. Jika "
+"anda ingin ingin melakukan ini, anda harus berkonsultasi terlebih dahulu "
+"dengan manual dari Parted (atau manual dari distribusi anda). Juga, mengubah "
+"ke FAT32 akan membuat file system tidak dapat dibaca oleh MS DOS, MS Windows "
+"95a, dan MS Windows NT."
+
+#: libparted/fs/fat/resize.c:513
+#, c-format
+msgid "%s %s %s"
+msgstr "%s %s %s"
+
+#: libparted/fs/fat/resize.c:514
+msgid "Would you like to use FAT32?"
+msgstr "Maukah anda menggunakan FAT32?"
+
+#: libparted/fs/fat/resize.c:541 libparted/fs/fat/resize.c:557
+#, c-format
+msgid "%s %s"
+msgstr "%s %s"
+
+#: libparted/fs/fat/resize.c:542
+msgid ""
+"The file system can only be resized to this size by converting to FAT16."
+msgstr ""
+"File system hanya dapat diresize ke ukuran ini dengan mengubahnya ke FAT16."
+
+#: libparted/fs/fat/resize.c:558
+msgid ""
+"The file system can only be resized to this size by converting to FAT32."
+msgstr ""
+"The file system hanya dapat di-resize untuk ukuran ini hanya dengan "
+"mengubahnya menjadi FAT32."
+
+#: libparted/fs/fat/resize.c:571
+msgid ""
+"GNU Parted cannot resize this partition to this size. We're working on it!"
+msgstr ""
+"GNU Parted tidak dapat men-resize partisi ini untuk ukuran ini. Kita sedang "
+"mengusahkannya untuk bisa!"
+
+#: libparted/fs/fat/bootsector.c:48 libparted/fs/fat/bootsector.c:55
+msgid "File system has an invalid signature for a FAT file system."
+msgstr ""
+"File system memiliki sebuah signature yang tidak valid untuk sebuah FAT file "
+"system."
+
+#: libparted/fs/fat/bootsector.c:62
+msgid "File system has an invalid sector size for a FAT file system."
+msgstr ""
+"File system memiliki ukuran sektor yang tidak valid untuk sebuah FAT file "
+"system."
+
+#: libparted/fs/fat/bootsector.c:69
+msgid "File system has an invalid cluster size for a FAT file system."
+msgstr ""
+"File system memiliki ukuran cluster yang tidak valid untuk file system FAT."
+
+#: libparted/fs/fat/bootsector.c:76
+msgid ""
+"File system has an invalid number of reserved sectors for a FAT file system."
+msgstr ""
+"File system memiliki nomor yang tidak valid untuk reserverd sector dari "
+"sebuah FAT file system."
+
+#: libparted/fs/fat/bootsector.c:83
+msgid "File system has an invalid number of FATs."
+msgstr "File system memiliki nomor yang tidak valid untuk FATs."
+
+#: libparted/fs/fat/bootsector.c:138
+#, c-format
+msgid ""
+"This file system has a logical sector size of %d. GNU Parted is known not "
+"to work properly with sector sizes other than 512 bytes."
+msgstr ""
+"File system ini memiliki sektor logical yang berukuran %d. GNU Parted tidak "
+"bekerja dengan baik dengan ukuran sektor selain 512 bytes."
+
+#: libparted/fs/fat/bootsector.c:163
+#, c-format
+msgid ""
+"The file system's CHS geometry is (%d, %d, %d), which is invalid. The "
+"partition table's CHS geometry is (%d, %d, %d). If you select Ignore, the "
+"file system's CHS geometry will be left unchanged. If you select Fix, the "
+"file system's CHS geometry will be set to match the partition table's CHS "
+"geometry."
+msgstr ""
+"File system's CHS geometry adalah (%d, %d, %d), ini tidak valid. Tabel "
+"partisi dari CHS geometry adalah (%d, %d, %d). Jika anda memilih Ignore, "
+"file system's CHS geometry akan ditinggalkan tanpa diubah. Jika anda memilih "
+"Fix, file system CHS geomtry akan diset sehingga cocok dengan tabel partisi "
+"dari CHS geometry."
+
+#: libparted/fs/fat/bootsector.c:209
+msgid "FAT boot sector says logical sector size is 0. This is weird. "
+msgstr "FAT boot sector mengatakan ukuran sektor logical adalah 0. Ini aneh"
+
+#: libparted/fs/fat/bootsector.c:215
+msgid "FAT boot sector says there are no FAT tables. This is weird. "
+msgstr "FAT boot sector mengatakan disana tidak ada tabel FAT. Ini aneh."
+
+#: libparted/fs/fat/bootsector.c:221
+msgid "FAT boot sector says clusters are 0 sectors. This is weird. "
+msgstr "FAT boot sector mengatakan clusters adalah 0 sectors. Ini aneh."
+
+#: libparted/fs/fat/bootsector.c:231
+msgid "File system is FAT12, which is unsupported."
+msgstr "File system adalah FAT12, dimana file system ini tidak disupport."
+
+#: libparted/fs/fat/bootsector.c:407
+#, c-format
+msgid ""
+"The information sector has the wrong signature (%x). Select cancel for now, "
+"and send in a bug report. If you're desperate, it's probably safe to ignore."
+msgstr ""
+"Informasi sektor memiliki signature (%x) yang salah. Pilih cancel sekarang, "
+"dan kirim dalam laporan bug. Jika anda putus asa, mungkin lebih aman untuk "
+"menghiraukannya."
+
+#: libparted/fs/fat/count.c:149
+#, c-format
+msgid "Bad directory entry for %s: first cluster is the end of file marker."
+msgstr ""
+"Bad directory entry untuk %s: cluster pertama merupakan akhir dari file "
+"marker"
+
+#: libparted/fs/fat/count.c:162
+#, c-format
+msgid ""
+"Bad FAT: unterminated chain for %s. You should run dosfsck or scandisk."
+msgstr ""
+"Bad FAT: unterminated chain untuk %s. Anda seharusnya menjalankan dosfsck "
+"atau scandisk."
+
+#: libparted/fs/fat/count.c:171
+#, c-format
+msgid ""
+"Bad FAT: cluster %d outside file system in chain for %s. You should run "
+"dosfsck or scandisk."
+msgstr ""
+"Bad FAT: cluster %d diluar dari file system dalam rantai untuk %s. Anda "
+"seharusnya menjalankan dosfsck atau scandisk."
+
+#: libparted/fs/fat/count.c:181
+#, c-format
+msgid ""
+"Bad FAT: cluster %d is cross-linked for %s. You should run dosfsck or "
+"scandisk."
+msgstr ""
+"Bad FAT: cluster %d adalah cross-linked untuk %s. Anda seharusnya "
+"menjalankan dosfsck atan scandisk."
+
+#: libparted/fs/fat/count.c:200
+#, c-format
+msgid "%s is %dk, but it has %d clusters (%dk)."
+msgstr "%s adalah %dk, tetapi ini memiliki %d clusters (%dk)."
+
+#: libparted/fs/fat/count.c:263
+#, c-format
+msgid ""
+"The file %s is marked as a system file. This means moving it could cause "
+"some programs to stop working."
+msgstr ""
+"File %s ditandai sebagai sistem file. Ini berarti memindahkannya dapat "
+"menyebabkan beberapa aplikasi untuk tidak dapat bekerja."
+
+#: libparted/fs/fat/table.c:138
+#, c-format
+msgid ""
+"FAT %d media %x doesn't match the boot sector's media %x. You should "
+"probably run scandisk."
+msgstr ""
+"FAT %d media %x tidak cocok dengan boot sector's media %x. Anda seharusnya "
+"menjalankan scandisk."
+
+#: libparted/fs/fat/table.c:268
+#, c-format
+msgid "fat_table_set: cluster %ld outside file system"
+msgstr "fat_table_set: cluster %ld diluar file system"
+
+#: libparted/fs/fat/table.c:296
+#, c-format
+msgid "fat_table_get: cluster %ld outside file system"
+msgstr "fat_table_get: cluster %ld diluar file system"
+
+#: libparted/fs/fat/table.c:334
+msgid "fat_table_alloc_cluster: no free clusters"
+msgstr "fat_table_alloc_cluster: tidak ada cluster yang kosong"
+
+#: libparted/fs/linux_swap/linux_swap.c:236
+#, c-format
+msgid "Unrecognised linux swap signature '%10s'."
+msgstr "Linux swap signature tidak diketahui '%10s'."
+
+#: libparted/fs/linux_swap/linux_swap.c:312
+msgid "Too many bad pages."
+msgstr "Terlalu banyak bad pages."
+
+#: libparted/fs/hfs/advfs.c:123 libparted/fs/hfs/advfs_plus.c:125
+#: libparted/fs/hfs/reloc.c:416 libparted/fs/hfs/reloc.c:510
+#: libparted/fs/hfs/reloc_plus.c:541 libparted/fs/hfs/reloc_plus.c:660
+#: libparted/fs/hfs/reloc_plus.c:774
+msgid "The file system contains errors."
+msgstr "File system memiliki kerusakan."
+
+#: libparted/fs/hfs/advfs_plus.c:290
+msgid "Bad blocks could not be read."
+msgstr "Bad blocks tidak dapat dibaca."
+
+#: libparted/fs/hfs/cache.c:139
+#, c-format
+msgid ""
+"Trying to register an extent starting at block 0x%X, but another one already "
+"exists at this position. You should check the file system!"
+msgstr ""
+"Mencoba untuk menregister sebuah extent dimulai dari block 0x%X, tetapi yang "
+"lain sudah ada di partisi ini. Anda seharusnya mengecheck file system !"
+
+#: libparted/fs/hfs/cache.c:216
+#, c-format
+msgid ""
+"Trying to move an extent from block Ox%X to block Ox%X, but another one "
+"already exists at this position. This should not happen!"
+msgstr ""
+"Mencoba untuk memindahkan sebuah extent dari block 0x%X ke block 0x%X, "
+"tetapi yang lain sudah ada di partisi ini. Ini seharusnya tidak terjadi!"
+
+#: libparted/fs/hfs/file.c:145
+#, fuzzy, c-format
+msgid "Could not update the extent cache for HFS file with CNID %X."
+msgstr "Tidak dapat mengupdate extent cache untuk file %s dengan CNID %X."
+
+#: libparted/fs/hfs/file.c:182
+#, fuzzy, c-format
+msgid "Trying to read HFS file with CNID %X behind EOF."
+msgstr "Mencoba untuk membaca file %s dengan CNID %X dibelakang EOF."
+
+#: libparted/fs/hfs/file.c:192 libparted/fs/hfs/file.c:222
+#, fuzzy, c-format
+msgid "Could not find sector %lli of HFS file with CNID %X."
+msgstr "Tidak dapat menemukan sekto %lli dari file %s dengan CNID %X."
+
+#: libparted/fs/hfs/file.c:212
+#, fuzzy, c-format
+msgid "Trying to write HFS file with CNID %X behind EOF."
+msgstr "Mencoba untuk menulis file %s dengan CNID %X dibelakang EOF."
+
+#: libparted/fs/hfs/file_plus.c:159
+#, fuzzy, c-format
+msgid "Could not update the extent cache for HFS+ file with CNID %X."
+msgstr "Tidak dapat mengupdate extent cache untuk file %s dengan CNID %X."
+
+#: libparted/fs/hfs/file_plus.c:203
+#, fuzzy, c-format
+msgid "Trying to read HFS+ file with CNID %X behind EOF."
+msgstr "Mencoba untuk membaca file %s dengan CNID %X dibelakang EOF."
+
+#: libparted/fs/hfs/file_plus.c:214 libparted/fs/hfs/file_plus.c:256
+#, fuzzy, c-format
+msgid "Could not find sector %lli of HFS+ file with CNID %X."
+msgstr "Tidak dapat menemukan sekto %lli dari file %s dengan CNID %X."
+
+#: libparted/fs/hfs/file_plus.c:245
+#, fuzzy, c-format
+msgid "Trying to write HFS+ file with CNID %X behind EOF."
+msgstr "Mencoba untuk menulis file %s dengan CNID %X dibelakang EOF."
+
+#: libparted/fs/hfs/hfs.c:225
+msgid "Sorry, HFS cannot be resized that way yet."
+msgstr "Maaf, HFS tidak dapat di-resize."
+
+#: libparted/fs/hfs/hfs.c:255 libparted/fs/hfs/hfs.c:636
+msgid "Data relocation has failed."
+msgstr "Data relocation telah gagal."
+
+#: libparted/fs/hfs/hfs.c:274
+msgid "Data relocation left some data in the end of the volume."
+msgstr "Data relocation meninggalkan beberapa data pada akhir dari volume."
+
+#: libparted/fs/hfs/hfs.c:313
+msgid "writing HFS Master Directory Block"
+msgstr "menulis HFS Master Directory Block"
+
+#: libparted/fs/hfs/hfs.c:461
+msgid "No valid HFS[+X] signature has been found while opening."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:471
+#, c-format
+msgid "Version %d of HFS+ isn't supported."
+msgstr "HFS+ versi %d tidak disupport."
+
+#: libparted/fs/hfs/hfs.c:482
+#, fuzzy, c-format
+msgid "Version %d of HFSX isn't supported."
+msgstr "HFS+ versi %d tidak disupport."
+
+#: libparted/fs/hfs/hfs.c:667
+msgid "Data relocation left some data at the end of the volume."
+msgstr "Data relocation meninggalkan beberapa data pada akhir dari volume."
+
+#: libparted/fs/hfs/hfs.c:715
+msgid "Error while writing the allocation file."
+msgstr "Error ketika menulis alokasi file."
+
+#: libparted/fs/hfs/hfs.c:730
+msgid "Error while writing the compatibility part of the allocation file."
+msgstr "Error ketika menulis bagian kompatibilitas dari alokasi file."
+
+#: libparted/fs/hfs/hfs.c:745
+msgid "writing HFS+ Volume Header"
+msgstr "menulis HFS+ Volume Header"
+
+#: libparted/fs/hfs/hfs.c:845
+msgid "An error occurred while looking for the mandatory bad blocks file."
+msgstr "Sebuah error terjadi ketika mencari mandatory bad blocks file."
+
+#: libparted/fs/hfs/hfs.c:899
+msgid ""
+"It seems there is an error in the HFS wrapper: the bad blocks file doesn't "
+"contain the embedded HFS+ volume."
+msgstr ""
+"Kelihatannya terjadi kesalahan dalam HFS wrapper: file bad blocks tidak "
+"berisi embedded HFS+ volume."
+
+#: libparted/fs/hfs/hfs.c:930
+#, fuzzy
+msgid "Sorry, HFS+ cannot be resized that way yet."
+msgstr "Maaf, HFS tidak dapat di-resize."
+
+#: libparted/fs/hfs/hfs.c:965
+msgid "shrinking embedded HFS+ volume"
+msgstr "mengecilkan embedded HFS+ volume"
+
+#: libparted/fs/hfs/hfs.c:981
+msgid "Resizing the HFS+ volume has failed."
+msgstr "Resizing dari HFS+ volume telah gagal."
+
+#: libparted/fs/hfs/hfs.c:988
+msgid "shrinking HFS wrapper"
+msgstr "mengecilkan HFS wrapper"
+
+#: libparted/fs/hfs/hfs.c:997
+msgid "Updating the HFS wrapper has failed."
+msgstr "Update dari HFS wrapper telah gagal."
+
+#: libparted/fs/hfs/hfs.c:1099 libparted/fs/hfs/hfs.c:1184
+#, c-format
+msgid ""
+"This is not a real %s check. This is going to extract special low level "
+"files for debugging purposes."
+msgstr ""
+"Ini bukan sebuah pengecheckan %s nyata. Ini akan mengekstrak files spesial "
+"level bawah untuk tujuan debugging."
+
+#: libparted/fs/hfs/journal.c:156
+msgid "Bad block list header checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:169
+#, c-format
+msgid ""
+"Invalid size of a transaction block while replaying the journal (%i bytes)."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:261
+#, fuzzy
+msgid ""
+"Journal stored outside of the volume are not supported. Try to desactivate "
+"the journal and run Parted again."
+msgstr ""
+"Journaled HFS+ volumes tidak disupport, anda seharusnya men-deactivate "
+"journal sebelum mencoba operasi yang lain padanya."
+
+#: libparted/fs/hfs/journal.c:272
+#, fuzzy
+msgid "Journal offset or size is not multiple of the sector size."
+msgstr ""
+"Cluster awal delta = %d, dimana bukan kelipatan dari ukuran cluster %d."
+
+#: libparted/fs/hfs/journal.c:290
+msgid "Incorrect magic values in the journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:299
+msgid "Journal size mismatch between journal info block and journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:311
+#, fuzzy
+msgid "Some header fields are not multiple of the sector size."
+msgstr ""
+"Cluster awal delta = %d, dimana bukan kelipatan dari ukuran cluster %d."
+
+#: libparted/fs/hfs/journal.c:320
+msgid ""
+"The sector size stored in the journal is not 512 bytes. Parted only "
+"supports 512 bytes length sectors."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:332
+msgid "Bad journal checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:350
+msgid ""
+"The journal is not empty. Parted must replay the transactions before "
+"opening the file system. This will modify the file system."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:378
+msgid ""
+"The volume header or the master directory block has changed while replaying "
+"the journal. You should restart Parted."
+msgstr ""
+
+#: libparted/fs/hfs/probe.c:52
+#, c-format
+msgid ""
+"Parted can't use HFS file systems on disks with a sector size not equal to %"
+"d bytes."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:153 libparted/fs/hfs/reloc_plus.c:157
+msgid "An extent has not been relocated."
+msgstr "Sebuah extent tidak dapat direlokasikan."
+
+#: libparted/fs/hfs/reloc.c:253 libparted/fs/hfs/reloc_plus.c:309
+msgid ""
+"A reference to an extent comes from a place it should not. You should check "
+"the file system!"
+msgstr ""
+"Sebuah referensi untuk sebuah extent datang dari tempat yang tidak "
+"seharusnya. Anda harus mengecheck filesystem!"
+
+#: libparted/fs/hfs/reloc.c:383
+msgid "This HFS volume has no catalog file. This is very unusual!"
+msgstr "HFS volume tidak memiliki catalog file. Ini sangat tidak biasa!"
+
+#: libparted/fs/hfs/reloc.c:477
+#, fuzzy
+msgid "This HFS volume has no extents overflow file. This is quite unusual!"
+msgstr "HFS+ volume tidak memiliki extent overflow file. Ini tidak biasa!"
+
+#: libparted/fs/hfs/reloc.c:519 libparted/fs/hfs/reloc_plus.c:670
+msgid ""
+"The extents overflow file should not contain its own extents! You should "
+"check the file system."
+msgstr ""
+"Extent overflow file seharusnya tidak berisi extentnya sendiri! Anda "
+"seharusnya mengecheck filesystem."
+
+#: libparted/fs/hfs/reloc.c:576 libparted/fs/hfs/reloc_plus.c:849
+msgid "Could not cache the file system in memory."
+msgstr "Tidak dapat men-cache filesystem dalam memori."
+
+#: libparted/fs/hfs/reloc.c:637 libparted/fs/hfs/reloc_plus.c:910
+msgid "Bad blocks list could not be loaded."
+msgstr "Daftar bad blocks tidak dapat diload."
+
+#: libparted/fs/hfs/reloc.c:651 libparted/fs/hfs/reloc_plus.c:926
+msgid "An error occurred during extent relocation."
+msgstr "Terjadi error ketika extent relocation."
+
+#: libparted/fs/hfs/reloc_plus.c:497
+msgid "This HFS+ volume has no catalog file. This is very unusual!"
+msgstr "HFS+ volume tidak memiliki catalog file. Ini sangat tidak biasa!"
+
+#: libparted/fs/hfs/reloc_plus.c:621
+msgid "This HFS+ volume has no extents overflow file. This is quite unusual!"
+msgstr "HFS+ volume tidak memiliki extent overflow file. Ini tidak biasa!"
+
+#: parted/parted.c:76
+msgid "displays this help message"
+msgstr "tampilkan pesan bantuan ini"
+
+#: parted/parted.c:77
+msgid "where necessary, prompts for user intervention"
+msgstr "jika diperlukan, tanyakan intervensi pengguna"
+
+#: parted/parted.c:78
+msgid "never prompts for user intervention"
+msgstr "jangan menanyakan intervensi pengguna"
+
+#: parted/parted.c:79
+msgid "displays the version"
+msgstr "tampilkan versi dari program ini"
+
+#: parted/parted.c:87
+#, fuzzy
+msgid ""
+"NUMBER is the partition number used by Linux. On MS-DOS disk labels, the "
+"primary partitions number from 1 to 4, logical partitions from 5 onwards.\n"
+msgstr ""
+"NOMOR adalah nomor partisi yang digunakan oleh Linux. Pada msdos disk label, "
+"nomor partisi primary dari 1 sampai 4, partisi logical dari 5 keatas.\n"
+
+#: parted/parted.c:90
+msgid "LABEL-TYPE is one of: "
+msgstr "TIPE-LABEL adalah salah satu dari: "
+
+#: parted/parted.c:91
+msgid "FLAG is one of: "
+msgstr "TANDA adalah salah satu dari: "
+
+#: parted/parted.c:92
+msgid "UNIT is one of: "
+msgstr "UNIT adalah salah satu dari: "
+
+#: parted/parted.c:93
+msgid "PART-TYPE is one of: primary, logical, extended\n"
+msgstr "TIPE-PART adalah salah satu dari: primari, logical, extended\n"
+
+#: parted/parted.c:95
+msgid "FS-TYPE is one of: "
+msgstr "TIPE-FS adalah salah satu dari: "
+
+#: parted/parted.c:96
+#, fuzzy
+msgid ""
+"START and END are disk locations, such as 4GB or 10%. Negative values count "
+"from the end of the disk. For example, -1s specifies exactly the last "
+"sector.\n"
+msgstr ""
+"AWAL dan AKHIR adalah lokasi disk, seperti 4GB atau 10%. Sebuah prefix dari "
+"= mengindikasikan sebuah lokasi yang tepat. Nilai negatif dihitung dari "
+"akhir alamat disk. sebagai contoh, =-1s menspesifikasi lokasi sektor "
+"terakhir.\n"
+
+#: parted/parted.c:99
+msgid "STATE is one of: on, off\n"
+msgstr "STATUS adalah salah satu dari: on, off\n"
+
+#: parted/parted.c:100
+msgid "DEVICE is usually /dev/hda or /dev/sda\n"
+msgstr "PERANGKAT biasanya menggunakan /dev/hda atau /dev/sda\n"
+
+#: parted/parted.c:101
+msgid "NAME is any word you want\n"
+msgstr "NAMA adalah kata yang anda inginkan\n"
+
+#: parted/parted.c:102
+msgid "The partition must have one of the following FS-TYPEs: "
+msgstr "Partisi harus memiliki salah satu dari TIPE-FS berikut ini: "
+
+#: parted/parted.c:105
+msgid "GNU Parted Version information:\n"
+msgstr ""
+
+#: parted/parted.c:107
+#, fuzzy
+msgid ""
+"Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n"
+"This program is free software, covered by the GNU General Public License.\n"
+"\n"
+"This program is distributed in the hope that it will be useful, but WITHOUT "
+"ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
+"FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
+"more details.\n"
+"\n"
+msgstr ""
+"Hak Cipta (C) 1998 - 2005 Free Software Foundation, Inc.\n"
+"Aplikasi ini adalah free software, dilindungi oleh GNU General Public "
+"Licence.\n"
+"\n"
+"Aplikasi ini didistribusikan dengan harapan akan berguna, tetapi TANPA "
+"ADANYA GARANSI; bahkan untuk PENJUALAN atau KESESUAIAN UNTUK TUJUAN "
+"TERTENTU. Lihat GNU General Public License untuk lebih detail.\n"
+
+#: parted/parted.c:152
+#, c-format
+msgid "%0.f%%\t(time left %.2d:%.2d)"
+msgstr "%0.f%%\t(waktu tersisa %.2d:%.2d)"
+
+#: parted/parted.c:170
+#, c-format
+msgid ""
+"Partition %s is being used. You must unmount it before you modify it with "
+"Parted."
+msgstr ""
+"Partisi %s sedang digunakan. Anda harus meng-umount terlebih dahulu sebelum "
+"memodifikasinya dengan menggunakan parted."
+
+#: parted/parted.c:187
+#, c-format
+msgid "Partition(s) on %s are being used."
+msgstr "Partisi pada %s sedang digunakan."
+
+#: parted/parted.c:413 parted/parted.c:594 parted/parted.c:979
+#: parted/parted.c:1059 parted/parted.c:1586 parted/parted.c:1663
+#: parted/parted.c:1707
+msgid "Partition number?"
+msgstr "Nomor partisi?"
+
+#: parted/parted.c:456
+msgid "Source device?"
+msgstr "Perangkat asal?"
+
+#: parted/parted.c:460
+msgid "Source partition number?"
+msgstr "Nomor partisi asal?"
+
+#: parted/parted.c:465
+msgid "Can't copy an extended partition."
+msgstr "Tidak dapat mengkopi sebuah partisi extended."
+
+#: parted/parted.c:471
+msgid "Destination partition number?"
+msgstr "Nomor partisi tujuan?"
+
+#: parted/parted.c:564
+msgid "New disk label type?"
+msgstr "Tipe disk label baru?"
+
+#: parted/parted.c:598
+msgid "File system?"
+msgstr "File system?"
+
+#: parted/parted.c:645 parted/parted.c:815
+msgid "Partition type?"
+msgstr "Tipe partisi?"
+
+#: parted/parted.c:652 parted/parted.c:822 parted/parted.c:1062
+msgid "Partition name?"
+msgstr "Nama partisi?"
+
+#: parted/parted.c:660 parted/parted.c:832
+msgid "File system type?"
+msgstr "Tipe file system?"
+
+#: parted/parted.c:667 parted/parted.c:834 parted/parted.c:994
+#: parted/parted.c:1544 parted/parted.c:1595
+msgid "Start?"
+msgstr "Awal?"
+
+#: parted/parted.c:669 parted/parted.c:837 parted/parted.c:997
+#: parted/parted.c:1546 parted/parted.c:1597
+msgid "End?"
+msgstr "Akhir?"
+
+#: parted/parted.c:707 parted/parted.c:875
+#, fuzzy, c-format
+msgid ""
+"You requested a partition from %s to %s.\n"
+"The closest location we can manage is %s to %s. Is this still acceptable to "
+"you?"
+msgstr ""
+"Anda meminta untuk memindahkan partisi ke %s - %s. Pendekatan Parted yang "
+"paling dekat adalah %s - %s."
+
+#: parted/parted.c:827
+msgid "An extended partition cannot hold a file system. Did you want mkpart?"
+msgstr ""
+"Sebuah partisi extended tidak dapat berisi sebuah file system. Anda ingin "
+"melakukan mkpart?"
+
+#: parted/parted.c:985
+msgid "Can't move an extended partition."
+msgstr "Tidak dapat memindahkan sebuah partisi extended."
+
+#: parted/parted.c:1014
+msgid "Can't move a partition onto itself. Try using resize, perhaps?"
+msgstr ""
+"Tidak dapat memindahkan partisi ke partisi itu sendiri. Coba menggunakan "
+"resize, mungkin?"
+
+#: parted/parted.c:1158
+#, c-format
+msgid "Minor: %d\n"
+msgstr "Minor: %d\n"
+
+#: parted/parted.c:1159
+#, fuzzy, c-format
+msgid "Flags: %s\n"
+msgstr "Tanda: "
+
+#: parted/parted.c:1160
+#, c-format
+msgid "File System: %s\n"
+msgstr "File System: %s\n"
+
+#: parted/parted.c:1161
+#, c-format
+msgid "Size: "
+msgstr "Ukuran: "
+
+#: parted/parted.c:1166
+#, c-format
+msgid "Minimum size: "
+msgstr "Ukuran minimal: "
+
+#: parted/parted.c:1169
+#, c-format
+msgid "Maximum size: "
+msgstr "Ukuran maksimal: "
+
+#: parted/parted.c:1255
+#, fuzzy, c-format
+msgid "Disk %s: %s\n"
+msgstr "%s %s %s"
+
+#: parted/parted.c:1256
+#, c-format
+msgid "Sector size (logical/physical): %lldB/%lldB\n"
+msgstr ""
+
+#: parted/parted.c:1267
+#, c-format
+msgid "BIOS cylinder,head,sector geometry: %d,%d,%d. Each cylinder is %s.\n"
+msgstr ""
+"BIOS cylinder,head,sector geometry: %d,%d,%d. Setiap cylinder adalah %s.\n"
+
+#: parted/parted.c:1273
+#, fuzzy, c-format
+msgid "Partition Table: %s\n"
+msgstr "Nama partisi?"
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Number"
+msgstr "Nomor"
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Start"
+msgstr "Awal"
+
+#: parted/parted.c:1285 parted/parted.c:1288
+msgid "End"
+msgstr "Akhir"
+
+#: parted/parted.c:1288
+msgid "Size"
+msgstr "Ukuran"
+
+#: parted/parted.c:1292
+msgid "Type"
+msgstr "Tipe"
+
+#: parted/parted.c:1294
+msgid "File system"
+msgstr "File system"
+
+#: parted/parted.c:1297
+msgid "Name"
+msgstr "Nama"
+
+#: parted/parted.c:1299
+msgid "Flags"
+msgstr "Flags"
+
+#: parted/parted.c:1352
+msgid "Free Space"
+msgstr ""
+
+#: parted/parted.c:1441
+#, c-format
+msgid ""
+"A %s %s partition was found at %s -> %s. Do you want to add it to the "
+"partition table?"
+msgstr ""
+"Sebuah %s %s partisi ditemukan pada %s -> %s. Anda ingin menambahkan ini "
+"pada tabel partisi?"
+
+#: parted/parted.c:1479
+msgid "searching for file systems"
+msgstr "mencari untuk file systems"
+
+#: parted/parted.c:1684
+msgid "New device?"
+msgstr "Perangkat baru?"
+
+#: parted/parted.c:1709
+#, fuzzy
+msgid "Flag to Invert?"
+msgstr "Flag yang dirubah?"
+
+#: parted/parted.c:1714
+msgid "New state?"
+msgstr "Status baru?"
+
+#: parted/parted.c:1747
+msgid "Unit?"
+msgstr "Satuan?"
+
+#: parted/parted.c:1896
+msgid "check"
+msgstr "check"
+
+#: parted/parted.c:1899
+#, fuzzy
+msgid ""
+"check NUMBER do a simple check on the file system"
+msgstr ""
+"check NOMOR lakukan pengecheckan sederhana pada file system"
+
+#: parted/parted.c:1905
+msgid "cp"
+msgstr "cp"
+
+#: parted/parted.c:1908
+msgid ""
+"cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another "
+"partition"
+msgstr ""
+"cp [ASAL-PERANGKAT] ASAL-NOMOR KE-NOMOR salin filesystem ke partisi yang "
+"lain"
+
+#: parted/parted.c:1914
+msgid "help"
+msgstr "help"
+
+#: parted/parted.c:1917
+#, fuzzy
+msgid ""
+"help [COMMAND] prints general help, or help on "
+"COMMAND"
+msgstr ""
+"help [PERINTAH] tampilkan bantuan umum, atau help pada PERINTAH"
+
+#: parted/parted.c:1923
+msgid "mklabel"
+msgstr "mklabel"
+
+#: parted/parted.c:1926
+#, fuzzy
+msgid ""
+"mklabel LABEL-TYPE create a new disklabel (partition "
+"table)"
+msgstr ""
+"mklabel TIPE-LABEL buat sebuah disklabel baru (tabel partisi)"
+
+#: parted/parted.c:1932
+msgid "mkfs"
+msgstr "mkfs"
+
+#: parted/parted.c:1935
+#, fuzzy
+msgid ""
+"mkfs NUMBER FS-TYPE make a FS-TYPE file system on "
+"partititon NUMBER"
+msgstr ""
+"mkfs NOMOR TIPE-FS buat TIPE-FS filesystem pada partisi NOMOR"
+
+#: parted/parted.c:1941
+msgid "mkpart"
+msgstr "mkpart"
+
+#: parted/parted.c:1944
+msgid "mkpart PART-TYPE [FS-TYPE] START END make a partition"
+msgstr "mkpart TIPE-PART [TIPE-FS] AWAL AKHIR buat sebuah partisi"
+
+#: parted/parted.c:1950
+msgid ""
+"mkpart makes a partition without creating a new file system on the "
+"partition. FS-TYPE may be specified to set an appropriate partition ID.\n"
+msgstr ""
+"mkpart membuat sebuah partisi tanpa membuat sebuah file system baru pada "
+"partisi. TIPE-FS mungkin dispesifikasikan untuk menset ID partisi.\n"
+
+#: parted/parted.c:1955
+msgid "mkpartfs"
+msgstr "mkpartfs"
+
+#: parted/parted.c:1958
+msgid ""
+"mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system"
+msgstr ""
+"mkpartfs TIPE-PART TIPE-FS AWAL AKHIR buat sebuah partisi dengan "
+"filesystem"
+
+#: parted/parted.c:1964
+msgid "move"
+msgstr "move"
+
+#: parted/parted.c:1967
+#, fuzzy
+msgid "move NUMBER START END move partition NUMBER"
+msgstr "move NOMOR AWAL AKHIR pindahkan partisi NOMOR"
+
+#: parted/parted.c:1972
+msgid "name"
+msgstr "name"
+
+#: parted/parted.c:1975
+#, fuzzy
+msgid "name NUMBER NAME name partition NUMBER as NAME"
+msgstr "name NOMOR NAMA namai partisi NOMOR dengan NAMA"
+
+#: parted/parted.c:1980
+msgid "print"
+msgstr "print"
+
+#: parted/parted.c:1983
+#, fuzzy
+msgid ""
+"print [free|NUMBER|all] display the partition table, a "
+"partition, or all devices"
+msgstr ""
+"print [NOMOR] tampilkan tabel partisi, atau sebuah partisi"
+
+#: parted/parted.c:1987
+#, fuzzy
+msgid ""
+"Without arguments, print displays the entire partition table. With 'free'\n"
+"argument, information about free space will be displayed otherwise if a\n"
+"partition number is given, then more detailed information is displayed\n"
+"about that partition. If the 'all' argument is passed instead, partition\n"
+"information for all devices will be displayed."
+msgstr ""
+"Tanpa argumen, menampilkan seluruh tabel partisi. Jika sebuah nomor \n"
+"partisi diberikan, maka informasi lebih detail ditampilkan tentan partisi\n"
+"tersebut.\n"
+
+#: parted/parted.c:1995
+msgid "quit"
+msgstr "quit"
+
+#: parted/parted.c:1998
+#, fuzzy
+msgid "quit exit program"
+msgstr "quit keluar dari program"
+
+#: parted/parted.c:2003
+msgid "rescue"
+msgstr "rescue"
+
+#: parted/parted.c:2006
+#, fuzzy
+msgid ""
+"rescue START END rescue a lost partition near START "
+"and END"
+msgstr ""
+"rescue AWAL AKHIR rescue partisi yang hilang dekat AWAL dan AKHIR"
+
+#: parted/parted.c:2012
+msgid "resize"
+msgstr "resize"
+
+#: parted/parted.c:2015
+#, fuzzy
+msgid ""
+"resize NUMBER START END resize partition NUMBER and its "
+"file system"
+msgstr ""
+"resize NOMOR AWAL AKHIR resize partisi NOMOR dan isi filesystemnya"
+
+#: parted/parted.c:2023
+msgid "rm"
+msgstr "rm"
+
+#: parted/parted.c:2026
+#, fuzzy
+msgid "rm NUMBER delete partition NUMBER"
+msgstr "rm NOMOR hapus partisi NOMOR"
+
+#: parted/parted.c:2031
+msgid "select"
+msgstr "select"
+
+#: parted/parted.c:2034
+#, fuzzy
+msgid "select DEVICE choose the device to edit"
+msgstr "select PERANGKAT pilih perangkat yang di edit"
+
+#: parted/parted.c:2039
+msgid "set"
+msgstr "set"
+
+#: parted/parted.c:2042
+#, fuzzy
+msgid ""
+"set NUMBER FLAG STATE change the FLAG on partition NUMBER"
+msgstr "rm NOMOR hapus partisi NOMOR"
+
+#: parted/parted.c:2048
+msgid "toggle"
+msgstr ""
+
+#: parted/parted.c:2051
+#, fuzzy
+msgid ""
+"toggle [NUMBER [FLAG]] toggle the state of FLAG on "
+"partition NUMBER"
+msgstr "rm NOMOR hapus partisi NOMOR"
+
+#: parted/parted.c:2057
+msgid "unit"
+msgstr "unit"
+
+#: parted/parted.c:2060
+#, fuzzy
+msgid "unit UNIT set the default unit to UNIT"
+msgstr "unit UNIT set default unit pada UNIT"
+
+#: parted/parted.c:2065
+msgid "version"
+msgstr ""
+
+#: parted/parted.c:2068
+msgid ""
+"version displays the current version of GNU "
+"Parted and copyright information"
+msgstr ""
+
+#: parted/parted.c:2072
+msgid ""
+"version displays copyright and version information corressponding to this "
+"copy of GNU Parted\n"
+msgstr ""
+
+#: parted/parted.c:2158
+msgid "No device found"
+msgstr "Tidak ditemukan device"
+
+#: parted/parted.c:2222
+msgid "Don't forget to update /etc/fstab, if necessary.\n"
+msgstr "Jangan lupa untuk mengupdate /etc/fstab, jika diperlukan.\n"
+
+#: parted/ui.c:68
+msgid "Welcome to GNU Parted! Type 'help' to view a list of commands.\n"
+msgstr ""
+
+#: parted/ui.c:71
+#, fuzzy
+msgid ""
+"Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]\n"
+"Apply COMMANDs with PARAMETERS to DEVICE. If no COMMAND(s) are given, run "
+"in\n"
+"interactive mode.\n"
+msgstr ""
+"Penggunaan: parted [OPSI]... [PERANGKAT [PERINTAH [PARAMETERS]...]...]\n"
+"Berikan PERINTAH dengan PARAMETER ke PERANGKAT. Jika tidak ada PERINTAH,\n"
+"maka menggunakan mode interaktif.\n"
+
+#: parted/ui.c:76
+#, c-format
+msgid ""
+"\n"
+"\n"
+"You found a bug in GNU Parted! Here's what you have to do:\n"
+"\n"
+"Don't panic! The bug has most likely not affected any of your data.\n"
+"Help us to fix this bug by doing the following:\n"
+"\n"
+"Check whether the bug has already been fixed by checking\n"
+"the last version of GNU Parted that you can find at:\n"
+"\n"
+"\thttp://ftp.gnu.org/gnu/parted/\n"
+"\n"
+"Please check this version prior to bug reporting.\n"
+"\n"
+"If this has not been fixed yet or if you don't know how to check,\n"
+"please visit the GNU Parted website:\n"
+"\n"
+"\thttp://www.gnu.org/software/parted\n"
+"\n"
+"for further information.\n"
+"\n"
+"Your report should contain the version of this release (%s)\n"
+"along with the error message below, the output of\n"
+"\n"
+"\tparted DEVICE unit co print unit s print\n"
+"\n"
+"and additional information about your setup you consider important.\n"
+msgstr ""
+
+#: parted/ui.c:230
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_MAPERR (Address not mapped to object)"
+msgstr ""
+
+#: parted/ui.c:235
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_ACCERR (Invalid permissions for mapped object)"
+msgstr ""
+
+#: parted/ui.c:240
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGSEGV signal was encountered."
+msgstr ""
+
+#: parted/ui.c:258
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTDIV (Integer: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:262
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTOVF (Integer: overflow)"
+msgstr ""
+
+#: parted/ui.c:266
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTDIV (Float: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:270
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTOVF (Float: overflow)"
+msgstr ""
+
+#: parted/ui.c:274
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTUND (Float: underflow)"
+msgstr ""
+
+#: parted/ui.c:278
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTRES (Float: inexact result)"
+msgstr ""
+
+#: parted/ui.c:282
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTINV (Float: invalid operation)"
+msgstr ""
+
+#: parted/ui.c:286
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTSUB (Float: subscript out of range)"
+msgstr ""
+
+#: parted/ui.c:291
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGFPE signal was encountered."
+msgstr ""
+
+#: parted/ui.c:310
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPC (Illegal Opcode)"
+msgstr ""
+
+#: parted/ui.c:314
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPN (Illegal Operand)"
+msgstr ""
+
+#: parted/ui.c:318
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLADR (Illegal addressing mode)"
+msgstr ""
+
+#: parted/ui.c:323
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLTRP (Illegal Trap)"
+msgstr ""
+
+#: parted/ui.c:327
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVOPC (Privileged Opcode)"
+msgstr ""
+
+#: parted/ui.c:331
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVREG (Privileged Register)"
+msgstr ""
+
+#: parted/ui.c:335
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_COPROC (Coprocessor Error)"
+msgstr ""
+
+#: parted/ui.c:339
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_BADSTK (Internal Stack Error)"
+msgstr ""
+
+#: parted/ui.c:343
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGILL signal was encountered."
+msgstr ""
+
+#: parted/ui.c:828
+msgid "Expecting a partition number."
+msgstr "Memperkirakan sebuah nomor partisi."
+
+#: parted/ui.c:837
+msgid "Partition doesn't exist."
+msgstr "Partisi tidak ada."
+
+#: parted/ui.c:857
+msgid "Expecting a file system type."
+msgstr "Memperkirakan sebuah tipe filesystem."
+
+#: parted/ui.c:863
+#, c-format
+msgid "Unknown file system type \"%s\"."
+msgstr "Tipe filesystem tidak diketahui \"%s\"."
+
+#: parted/ui.c:883
+msgid "Expecting a disk label type."
+msgstr "Memperkirakan sebuah tipe disk label."
+
+#: parted/ui.c:977
+msgid "Can't create any more partitions."
+msgstr "Tidak dapat membuat partisi lagi."
+
+#: parted/ui.c:987
+msgid "Expecting a partition type."
+msgstr "Memperkirakan sebuah tipe partisi."
+
+#: parted/ui.c:1115
+msgid "on"
+msgstr "nyala"
+
+#: parted/ui.c:1116
+msgid "off"
+msgstr "mati"
+
+#: parted/ui.c:1227
+msgid "OPTIONs:"
+msgstr "OPSI:"
+
+#: parted/ui.c:1230
+msgid "COMMANDs:"
+msgstr "PERINTAH:"
+
+#: parted/ui.c:1238
+#, c-format
+msgid "Using %s\n"
+msgstr "Menggunakan %s\n"
+
+#~ msgid ""
+#~ "This ext2 file system has a rather strange layout! Parted can't resize "
+#~ "this (yet)."
+#~ msgstr ""
+#~ "File system ext2 ini memiliki sebuah layout yang aneh! Parted tidak dapat "
+#~ "menresize ini"
+
+#~ msgid "IDE"
+#~ msgstr "IDE"
+
+#, fuzzy
+#~ msgid ""
+#~ "You have an HFS+ file system that has a feature that I haven't seen used "
+#~ "anywhere. Parted can theoretically handle it, but the corresponding code "
+#~ "has never been tested, so this might be risky. Please email me so I can "
+#~ "see how it works! <xxx@yyy.zz>"
+#~ msgstr ""
+#~ "Anda memiliki sebuah HFS+ file system yang memiliki feature yang saya "
+#~ "belum pernah lihat sebelumnya dimanapun. Parted secara teori dapat "
+#~ "menanganinya, tetapi kode yang berhubungan dengan itu belum ditest, jadi "
+#~ "ini mungkin beresiko. Tolong email saya sehingga saya bisa tahu jika ini "
+#~ "bekerja! <xilun666@libertysurf.fr>"
+
+#~ msgid ""
+#~ "The extents overflow file should not contain its own extents. You should "
+#~ "check the file system."
+#~ msgstr ""
+#~ "Extent overflow file seharusnya tidak berisi its own extents. Anda "
+#~ "sebaiknya mengecheck file system."
+
+#~ msgid "Disk geometry for %s: %s - %s\n"
+#~ msgstr "Geometri untuk disk %s: %s - %s\n"
+
+#~ msgid "Disk label type: %s\n"
+#~ msgstr "Tipe disk label: %s\n"
+
+#~ msgid "set NUMBER FLAG STATE change a flag on partition NUMBER"
+#~ msgstr "set NOMOR FLAG STATUS rubah flag pada NOMOR partisi"
+
+#~ msgid ""
+#~ "The sector size on %s is %d bytes. Parted is known not to work properly "
+#~ "with drives with sector sizes other than %d bytes."
+#~ msgstr ""
+#~ "Ukuran sektor pada %s adalah %d bytes. Parted tidak dapat bekerja secara "
+#~ "normal dengan drives dengan ukuran sektor selain dari %d bytes."
+
+#~ msgid ""
+#~ "This HFS volume has no extents overflow file. This is quite unusual !"
+#~ msgstr "HFS volume tidak memiliki extents overflow file. Ini tidak biasa !"
+
+#~ msgid ""
+#~ "You requested to create a partition at %s - %s. The closest Parted can "
+#~ "manage is %s - %s."
+#~ msgstr ""
+#~ "Anda meminta untuk membuat sebuah partisi pada %s - %s. Pendekatan Parted "
+#~ "yang paling dekat adalah %s - %s."
+
+#~ msgid ""
+#~ "You requested to resize the partition to %s - %s. The closest Parted can "
+#~ "manage is %s - %s."
+#~ msgstr ""
+#~ "Anda meminta untuk meresize partisi menjadi %s - %s. Parted hanya dapat "
+#~ "mengatasi menjadi yang terdekat adalah %s - %s."
+
+#~ msgid ""
+#~ "You found a bug in GNU Parted. Please email a bug report to bug-"
+#~ "parted@gnu.org containing the version (%s), and the following message:\n"
+#~ msgstr ""
+#~ "Anda menemukan sebuah bug dalam GNU Parted. Tolong email laporan bug ke "
+#~ "bug-parted@gnu.org yang berisi versi (%s), dan pesan berikut ini:\n"
diff --git a/po/insert-header.sin b/po/insert-header.sin
new file mode 100644
index 0000000..b26de01
--- /dev/null
+++ b/po/insert-header.sin
@@ -0,0 +1,23 @@
+# Sed script that inserts the file called HEADER before the header entry.
+#
+# At each occurrence of a line starting with "msgid ", we execute the following
+# commands. At the first occurrence, insert the file. At the following
+# occurrences, do nothing. The distinction between the first and the following
+# occurrences is achieved by looking at the hold space.
+/^msgid /{
+x
+# Test if the hold space is empty.
+s/m/m/
+ta
+# Yes it was empty. First occurrence. Read the file.
+r HEADER
+# Output the file's contents by reading the next line. But don't lose the
+# current line while doing this.
+g
+N
+bb
+:a
+# The hold space was nonempty. Following occurrences. Do nothing.
+x
+:b
+}
diff --git a/po/it.po b/po/it.po
new file mode 100644
index 0000000..59170f3
--- /dev/null
+++ b/po/it.po
@@ -0,0 +1,2461 @@
+# Italian translation for the parted package
+# Copyright (C) 2004 Free Software Foundation, Inc.
+# Giuseppe Sacco <eppesuig@debian.org>, 2004-2006.
+#
+# Thanks to Danilo Piazzalunga and Claudio Gilardoni
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: parted 1.7.0rc5\n"
+"Report-Msgid-Bugs-To: bug-parted@gnu.org\n"
+"POT-Creation-Date: 2006-04-26 13:54+0200\n"
+"PO-Revision-Date: 2006-04-26 13:57+0200\n"
+"Last-Translator: Giuseppe Sacco <eppesuig@debian.org>\n"
+"Language-Team: Italian <tp@lists.linux.it>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: libparted/arch/linux.c:284
+#, c-format
+msgid "Could not stat device %s - %s."
+msgstr "Non posso fare lo «stat» del device %s - %s."
+
+#: libparted/arch/linux.c:390
+#, c-format
+msgid ""
+"Could not determine sector size for %s: %s.\n"
+"Using the default sector size (%lld)."
+msgstr ""
+"Non è stato possibile determinare la dimensione del settore per %s: %s.\n"
+"Verrà utilizzata la dimensione predefinita (%lld)."
+
+#: libparted/arch/linux.c:401
+#, c-format
+msgid ""
+"Device %s has a logical sector size of %lld. Not all parts of GNU Parted "
+"support this at the moment, and the working code is HIGHLY EXPERIMENTAL.\n"
+msgstr ""
+"La dimensione del settore logico per %s è %lld. In questo momento, non tutte "
+"le parti di GNU Parted la supportano e il relativo codice è ALTAMENTE "
+"SPERIMENTALE.\n"
+
+#: libparted/arch/linux.c:441
+#, c-format
+msgid "Unable to determine the size of %s (%s)."
+msgstr "Impossibile determinare la dimensione di %s (%s)."
+
+#: libparted/arch/linux.c:530
+#, c-format
+msgid "Could not get identity of device %s - %s"
+msgstr "Non posso identificare il device %s -%s"
+
+#: libparted/arch/linux.c:539
+msgid "Generic IDE"
+msgstr "IDE generico"
+
+#: libparted/arch/linux.c:556
+#, c-format
+msgid ""
+"Device %s has multiple (%d) logical sectors per physical sector.\n"
+"GNU Parted supports this EXPERIMENTALLY for some special disk label/file "
+"system combinations, e.g. GPT and ext2/3.\n"
+"Please consult the web site for up-to-date information."
+msgstr ""
+"Il device %s ha multipli (%d) settori logici per ogni settore fisico.\n"
+"GNU Parted supporta questa configurazione in maniera SPERIMENTALE per alcune "
+"combinazioni di tipi di etichetta/file system, come GPT e ext2/3.\n"
+"Consultare il sito web per una documentazione aggiornata."
+
+#: libparted/arch/linux.c:726
+#, c-format
+msgid "Error initialising SCSI device %s - %s"
+msgstr "Errore nell'inizializzazione del device SCSI %s - %s"
+
+#: libparted/arch/linux.c:781
+#, c-format
+msgid ""
+"The device %s has zero length, and can't possibly store a file system or "
+"partition table. Perhaps you selected the wrong device?"
+msgstr ""
+"Il device %s ha dimensione zero e probabilmente non può contenere un file "
+"system o una tabella delle partizioni. È stato selezionato il device errato?"
+
+#: libparted/arch/linux.c:829
+msgid ""
+"Unable to determine geometry of file/device. You should not use Parted "
+"unless you REALLY know what you're doing!"
+msgstr ""
+"Non è possibile determinare la geometria del file/device. Non si dovrebbe "
+"utilizzare parted a meno che non si sappia VERAMENTE cosa si sta facendo!"
+
+#: libparted/arch/linux.c:903
+msgid "DAC960 RAID controller"
+msgstr "Controller RAID DAC960"
+
+#: libparted/arch/linux.c:908
+msgid "Compaq Smart Array"
+msgstr "Compaq Smart Array"
+
+#: libparted/arch/linux.c:913
+msgid "ATARAID Controller"
+msgstr "Controller ATARAID"
+
+#: libparted/arch/linux.c:918
+msgid "I2O Controller"
+msgstr "Controller I2O"
+
+#: libparted/arch/linux.c:923
+msgid "User-Mode Linux UBD"
+msgstr "User-Mode Linix UBD"
+
+#: libparted/arch/linux.c:933
+msgid "Unknown"
+msgstr "Sconosciuto"
+
+#: libparted/arch/linux.c:940
+msgid "ped_device_new() Unsupported device type"
+msgstr "ped_device_new() Tipo di device non supportato"
+
+#: libparted/arch/linux.c:1041 libparted/arch/gnu.c:264
+#, c-format
+msgid "Error opening %s: %s"
+msgstr "Errore nell'apertura di %s: %s"
+
+#: libparted/arch/linux.c:1052 libparted/arch/gnu.c:274
+#, c-format
+msgid "Unable to open %s read-write (%s). %s has been opened read-only."
+msgstr ""
+"Non posso aprire %s in lettura/scrittura (%s). %s è stato aperto in sola "
+"lettura."
+
+#: libparted/arch/linux.c:1160 libparted/arch/linux.c:1228
+#: libparted/arch/gnu.c:452 libparted/arch/gnu.c:550 libparted/arch/gnu.c:678
+#, c-format
+msgid "%s during read on %s"
+msgstr "%s durante la lettura su %s"
+
+#: libparted/arch/linux.c:1199
+#, c-format
+msgid "%s during seek for read on %s"
+msgstr "%s durante il posizionamento per la lettura su %s"
+
+#: libparted/arch/linux.c:1270 libparted/arch/linux.c:1355
+#: libparted/arch/linux.c:1413 libparted/arch/gnu.c:587
+#: libparted/arch/gnu.c:632 libparted/arch/gnu.c:709
+#, c-format
+msgid "%s during write on %s"
+msgstr "%s durante la scrittura su %s"
+
+#: libparted/arch/linux.c:1297 libparted/arch/gnu.c:512
+#, c-format
+msgid "Can't write to %s, because it is opened read-only."
+msgstr "Impossibile scrivere su %s poiché è stato aperto in sola lettura."
+
+#: libparted/arch/linux.c:1321
+#, c-format
+msgid "%s during seek for write on %s"
+msgstr "%s durante il posizionamento per la scrittura su %s"
+
+#: libparted/arch/linux.c:1798
+#, c-format
+msgid ""
+"Error informing the kernel about modifications to partition %s -- %s. This "
+"means Linux won't know about any changes you made to %s until you reboot -- "
+"so you shouldn't mount it or use it in any way before rebooting."
+msgstr ""
+"C'è stato un errore nell'informare il kernel delle modifiche alla partizione "
+"%s -- %s. Questo vuol dire che Linux non sarà al corrente dei cambiamenti "
+"fatti a %s fino al prossimo riavvio -- quindi non montare o usare in alcun "
+"modo la partizione fino ad allora."
+
+#: libparted/arch/linux.c:1879
+#, c-format
+msgid ""
+"The kernel was unable to re-read the partition table on %s (%s). This means "
+"Linux won't know anything about the modifications you made until you "
+"reboot. You should reboot your computer before doing anything with %s."
+msgstr ""
+"Il kernel non è stato capace di rileggere la tabella delle partizioni su %s "
+"(%s). Questo vuol dire che Linux non sarà al corrente dei cambiamenti fatti "
+"fino al riavvio. Si dovrebbe riavviare il computer prima di fare qualsiasi "
+"cosa con %s."
+
+#: libparted/arch/gnu.c:97
+#, c-format
+msgid "Unable to open %s."
+msgstr "Impossibile aprire %s."
+
+#: libparted/arch/gnu.c:117
+msgid "Unable to probe store."
+msgstr "Impossibile rilevare il dispositivo di «storage»."
+
+#: libparted/arch/gnu.c:355
+msgid ""
+"The partition table cannot be re-read. This means you need to reboot before "
+"mounting any modified partitions. You also need to reinstall your boot "
+"loader before you reboot (which may require mounting modified partitions). "
+"It is impossible do both things! So you'll need to boot off a rescue disk, "
+"and reinstall your boot loader from the rescue disk. Read section 4 of the "
+"Parted User documentation for more information."
+msgstr ""
+"Non è stato possibile rileggere la tabella delle partizioni, quindi si deve "
+"riavviare il computer prima di montare le partizioni modificate. È anche "
+"necessario installare nuovamente il «boot loader» prima del riavvio (il che "
+"può richiedere di montare le partizioni modificate.) Non è possibile fare "
+"entrambe! Quindi si avvii la macchina da un disco di ripristino e si "
+"reinstalli il «boot loader» da quel disco. Leggere la sezione 4 della "
+"documentazione utente di Parted per ulteriori informazioni."
+
+#: libparted/arch/gnu.c:372
+#, c-format
+msgid ""
+"The partition table on %s cannot be re-read (%s). This means the Hurd knows "
+"nothing about any modifications you made. You should reboot your computer "
+"before doing anything with %s."
+msgstr ""
+"La tabella delle partizioni su %s (%s) non può essere riletta. Questo vuol "
+"dire che Hurd non sa assolutamente nulla delle modifiche fatte. Riavviare il "
+"computer prima di fare qualsiasi cosa con %s."
+
+#: libparted/arch/gnu.c:383 parted/parted.c:2215
+msgid ""
+"You should reinstall your boot loader before rebooting. Read section 4 of "
+"the Parted User documentation for more information."
+msgstr ""
+"Si dovrebbe installare nuovamente il «boot loader» prima di riavviare. "
+"Leggere la sezione 4 della documentazione utente di Parted per ulteriori "
+"informazioni."
+
+#: libparted/arch/gnu.c:774
+#, c-format
+msgid "%s trying to sync %s to disk"
+msgstr "%s tentanto di fare il «sync» di %s sul disco"
+
+#: libparted/disk.c:183
+#, c-format
+msgid "Unable to open %s - unrecognised disk label."
+msgstr "Impossibile aprire %s - etichetta del disco sconosciuta."
+
+#: libparted/disk.c:452
+#, c-format
+msgid ""
+"This libparted doesn't have write support for %s. Perhaps it was compiled "
+"read-only."
+msgstr ""
+"Questo libparted non supporta la scrittura per %s. Forse è stato compilato "
+"per la sola lettura."
+
+#: libparted/disk.c:579
+#, c-format
+msgid "Partition %d is %s, but the file system is %s."
+msgstr "La partizione %d è %s, ma il file system è %s."
+
+#: libparted/disk.c:1056
+#, c-format
+msgid "%s disk labels do not support extended partitions."
+msgstr "Le etichette dei dischi %s non supportano le partizioni estese."
+
+#: libparted/disk.c:1616
+#, c-format
+msgid "%s disk labels don't support logical or extended partitions."
+msgstr ""
+"le etichette dei dischi %s non supportano le partizioni estese o logiche."
+
+#: libparted/disk.c:1629
+msgid "Too many primary partitions."
+msgstr "Troppe partizioni primarie."
+
+#: libparted/disk.c:1638
+#, c-format
+msgid ""
+"Can't add a logical partition to %s, because there is no extended partition."
+msgstr ""
+"Non è possibile aggiungere una partizione logica a %s perché non ci sono "
+"partizioni estese."
+
+#: libparted/disk.c:1662
+#, c-format
+msgid "Can't have more than one extended partition on %s."
+msgstr "Non è possibile avere più di una partizione estesa su %s."
+
+#: libparted/disk.c:1672
+msgid "Can't have logical partitions outside of the extended partition."
+msgstr ""
+"Non è possibile avere partizioni logiche al di fuori della partizione estesa."
+
+#: libparted/disk.c:1697
+#, c-format
+msgid "Can't have a logical partition outside of the extended partition on %s."
+msgstr ""
+"Non è possibile avere una partizione logica esterna alla partizione estesa "
+"su %s."
+
+#: libparted/disk.c:1707 libparted/disk.c:1761 libparted/disk.c:1927
+msgid "Can't have overlapping partitions."
+msgstr "Non è possibile avere partizioni che si sovrappongono."
+
+#: libparted/disk.c:1715
+msgid "Can't have a primary partition inside an extended partition."
+msgstr ""
+"Non è possibile avere una partizione primaria all'interno di una estesa."
+
+#: libparted/disk.c:2123
+msgid "metadata"
+msgstr "metadati"
+
+#: libparted/disk.c:2125
+msgid "free"
+msgstr "libero"
+
+#: libparted/disk.c:2127 parted/ui.c:968 parted/ui.c:996
+msgid "extended"
+msgstr "estesa"
+
+#: libparted/disk.c:2129 parted/ui.c:972 parted/ui.c:1000
+msgid "logical"
+msgstr "logica"
+
+#: libparted/disk.c:2131 parted/ui.c:964 parted/ui.c:992
+msgid "primary"
+msgstr "primaria"
+
+#: libparted/disk.c:2147
+msgid "boot"
+msgstr "avvio"
+
+#: libparted/disk.c:2149
+msgid "root"
+msgstr "root"
+
+#: libparted/disk.c:2151
+msgid "swap"
+msgstr "swap"
+
+#: libparted/disk.c:2153
+msgid "hidden"
+msgstr "nascosta"
+
+#: libparted/disk.c:2155
+msgid "raid"
+msgstr "raid"
+
+#: libparted/disk.c:2157
+msgid "lvm"
+msgstr "lvm"
+
+#: libparted/disk.c:2159
+msgid "lba"
+msgstr "lba"
+
+#: libparted/disk.c:2161
+msgid "hp-service"
+msgstr "hp-service"
+
+#: libparted/disk.c:2163
+msgid "palo"
+msgstr "palo"
+
+#: libparted/disk.c:2165
+msgid "prep"
+msgstr "prep"
+
+#: libparted/disk.c:2167
+msgid "msftres"
+msgstr "msftres"
+
+#: libparted/disk.c:2173
+#, c-format
+msgid "Unknown partition flag, %d."
+msgstr "Flag di partizione %d sconosciuto."
+
+#: libparted/labels/rdb.c:177
+#, c-format
+msgid "%s : Bad checksum on block %llu of type %s."
+msgstr "%s: Somma di controllo errata sul blocco %llu di tipo %s."
+
+#: libparted/labels/rdb.c:510
+#, c-format
+msgid "%s : Didn't find rdb block, should never happen."
+msgstr "%s: Non è stato trovato il blocco «rdb», non deve mai succedere."
+
+#: libparted/labels/rdb.c:595
+#, c-format
+msgid "%s : Loop detected at block %d."
+msgstr "%s: Rilevata iterazione al blocco %d."
+
+#: libparted/labels/rdb.c:614
+#, c-format
+msgid "%s : The %s list seems bad at block %s."
+msgstr "%s: La lista %s sembra corrotta al blocco %s."
+
+#: libparted/labels/rdb.c:703
+#, c-format
+msgid "%s : Failed to list bad blocks."
+msgstr "%s: Errore nell'elencare i blocchi corrotti."
+
+#: libparted/labels/rdb.c:711
+#, c-format
+msgid "%s : Failed to list partition blocks."
+msgstr "%s: Errore nell'elencare i blocchi della partizione."
+
+#: libparted/labels/rdb.c:719
+#, c-format
+msgid "%s : Failed to list file system blocks."
+msgstr "%s: Errore nell'elencare i blocchi del file system."
+
+#: libparted/labels/rdb.c:727
+#, c-format
+msgid "%s : Failed to list boot blocks."
+msgstr "%s: Errore nell'elencare i blocchi di avvio (di boot)."
+
+#: libparted/labels/rdb.c:750
+#, c-format
+msgid "Failed to write partition block at %d."
+msgstr "Errore nella scrittura dei blocchi di partizione nella posizione %d."
+
+#: libparted/labels/rdb.c:1053 libparted/labels/bsd.c:505
+#: libparted/labels/dos.c:1942 libparted/labels/dvh.c:772
+#: libparted/labels/gpt.c:1365 libparted/labels/loop.c:251
+#: libparted/labels/mac.c:1318 libparted/labels/pc98.c:764
+#: libparted/labels/sun.c:704
+msgid "Unable to satisfy all constraints on the partition."
+msgstr "Impossibile soddisfare tutti i vincoli sulla partizione."
+
+#: libparted/labels/rdb.c:1081
+msgid "Unable to allocate a partition number."
+msgstr "Impossibile allocare un numero di partizione."
+
+#: libparted/labels/bsd.c:530
+msgid "Unable to allocate a bsd disklabel slot."
+msgstr "Impossibile allocare uno spazio dell'etichetta bsd."
+
+#: libparted/labels/dos.c:812
+#, c-format
+msgid "Invalid partition table on %s -- wrong signature %x."
+msgstr "Tabella delle partizioni non valida su %s -- firma %x errata."
+
+#: libparted/labels/dos.c:840
+#, c-format
+msgid "Invalid partition table - recursive partition on %s."
+msgstr "Tabella della partizioni non valida - partizione ricorsiva su %s."
+
+#: libparted/labels/dos.c:1300
+msgid "Extended partitions cannot be hidden on msdos disk labels."
+msgstr "Le partizioni estese non possono essere nascoste su etichette msdos."
+
+#: libparted/labels/dos.c:1926
+msgid "Parted can't resize partitions managed by Windows Dynamic Disk."
+msgstr ""
+"Parted non può ridimensionare partizioni gestite da Windows Dynamic Disk."
+
+#: libparted/labels/dvh.c:192
+#, c-format
+msgid "%s has no extended partition (volume header partition)."
+msgstr "%s non ha partizioni estese (volume header partition)."
+
+#: libparted/labels/dvh.c:315
+msgid "Checksum is wrong, indicating the partition table is corrupt."
+msgstr ""
+"La somma di controllo è sbagliata; vale a dire che la tabella delle "
+"partizioni è corrotta."
+
+#: libparted/labels/dvh.c:616
+msgid "Only primary partitions can be root partitions."
+msgstr "Solo le partizioni primarie possono essere partizioni di root."
+
+#: libparted/labels/dvh.c:630
+msgid "Only primary partitions can be swap partitions."
+msgstr "Solo le partizioni primarie possono essere di swap."
+
+#: libparted/labels/dvh.c:644
+msgid "Only logical partitions can be a boot file."
+msgstr "Solo le partizioni logiche possono essere file di avvio."
+
+#: libparted/labels/dvh.c:723
+msgid "Only logical partitions (boot files) have a name."
+msgstr "Solo le partizioni logiche (file di avvio) hanno un nome."
+
+#: libparted/labels/dvh.c:814
+msgid "Too many primary partitions"
+msgstr "Troppe partizioni primarie"
+
+#: libparted/labels/gpt.c:433
+#, c-format
+msgid ""
+"%s contains GPT signatures, indicating that it has a GPT table. However, it "
+"does not have a valid fake msdos partition table, as it should. Perhaps it "
+"was corrupted -- possibly by a program that doesn't understand GPT partition "
+"tables. Or perhaps you deleted the GPT table, and are now using an msdos "
+"partition table. Is this a GPT partition table?"
+msgstr ""
+"%s contiene delle firme GPT, indicando che è una tabella GPT. Ciononostante "
+"non ha una finta tabella delle partizioni valida per msdos, come dovrebbe. "
+"Forse è stata corrotta, magari da un programma che non comprende le tabelle "
+"delle partizioni GPT, oppure è stata cancellata la tabella GPT e ora si sta "
+"usando quella msdos. Questa è una tabella di partizioni GPT?"
+
+#: libparted/labels/gpt.c:625
+#, c-format
+msgid ""
+"The format of the GPT partition table is version %x, which is newer than "
+"what Parted can recognise. Please tell us! bug-parted@gnu.org"
+msgstr ""
+"Il formato della tabella di partizioni GPT ha versione %x, che è successiva "
+"a quelle conosciute da parted. Per favore avvisateci! bug-parted@gnu.org"
+
+#: libparted/labels/gpt.c:747
+msgid ""
+"The backup GPT table is not at the end of the disk, as it should be. This "
+"might mean that another operating system believes the disk is smaller. Fix, "
+"by moving the backup to the end (and removing the old backup)?"
+msgstr ""
+"La copia di scorta della tabella GPT non è presente, come dovrebbe, alla "
+"fine del disco. Questo potrebbe voler dire che un altro sistema operativo "
+"pensa che il disco sia più piccolo. Correggere il problema spostando la "
+"copia alla fine (e rimuovendo la vecchia copia)?"
+
+#: libparted/labels/gpt.c:782
+msgid ""
+"The primary GPT table is corrupt, but the backup appears OK, so that will be "
+"used."
+msgstr ""
+"La tabella GPT principale è corrotta, ma la copia di backup sembra a posto, "
+"quindi la seconda verrà utilizzata."
+
+#: libparted/labels/gpt.c:790
+msgid ""
+"Both the primary and backup GPT tables are corrupt. Try making a fresh "
+"table, and using Parted's rescue feature to recover partitions."
+msgstr ""
+"Sia la tabella GPT principale che la copia sono corrotte. Provare a crearne "
+"una nuova e, tramite le potenzialità di recupero di parted, recuperare le "
+"partizioni."
+
+#: libparted/labels/mac.c:167
+#, c-format
+msgid "Invalid signature %x for Mac disk labels."
+msgstr "Firma %x non valida per le etichette dei dischi Mac."
+
+#: libparted/labels/mac.c:212
+msgid "Partition map has no partition map entry!"
+msgstr "La mappa delle partizioni non ha elementi."
+
+#: libparted/labels/mac.c:259
+#, c-format
+msgid "%s is too small for a Mac disk label!"
+msgstr "%s è troppo piccolo per una etichetta di disco Mac!"
+
+#: libparted/labels/mac.c:490
+#, c-format
+msgid "Partition %d has an invalid signature %x."
+msgstr "La partizione %d ha una firma non valida %x."
+
+#: libparted/labels/mac.c:508
+#, c-format
+msgid "Partition %d has an invalid length of 0 bytes!"
+msgstr "La partizione %d ha una lunghezza non valida di 0 byte!"
+
+#: libparted/labels/mac.c:536
+msgid "The data region doesn't start at the start of the partition."
+msgstr "La regione dei dati non comincia all'inizio della partizione."
+
+#: libparted/labels/mac.c:553
+msgid "The boot region doesn't start at the start of the partition."
+msgstr "La regione di avvio non comincia all'inizio della partizione."
+
+#: libparted/labels/mac.c:567
+msgid "The partition's boot region doesn't occupy the entire partition."
+msgstr "La regione di avvio della partizione non occupa l'intera partizione."
+
+#: libparted/labels/mac.c:577
+msgid "The partition's data region doesn't occupy the entire partition."
+msgstr "La regione dati della partizione non occupa l'intera partizione."
+
+#: libparted/labels/mac.c:631
+#, c-format
+msgid ""
+"Weird block size on device descriptor: %d bytes is not divisible by 512."
+msgstr ""
+"Dimensione sospetta del blocco nel descrittore del device: %d byte non è "
+"divisibile per 512."
+
+#: libparted/labels/mac.c:644
+#, c-format
+msgid ""
+"The driver descriptor says the physical block size is %d bytes, but Linux "
+"says it is %d bytes."
+msgstr ""
+"Il descrittore del driver indica che la dimensione del blocco fisico è di %d "
+"byte, ma Linux lo indica di %d byte."
+
+#: libparted/labels/mac.c:692
+msgid "No valid partition map found."
+msgstr "Non è stata trovata alcuna mappa delle partizioni valida."
+
+#: libparted/labels/mac.c:744
+#, c-format
+msgid ""
+"Conflicting partition map entry sizes! Entry 1 says it is %d, but entry %d "
+"says it is %d!"
+msgstr ""
+"Due elementi della mappa delle partizioni hanno dimensione diversa! "
+"L'elemento 1 dice %d, mentre l'elemento %d dice %d!"
+
+#: libparted/labels/mac.c:771
+msgid "Weird! There are 2 partitions map entries!"
+msgstr "Strano, ci sono 2 mappa delle partizioni."
+
+#: libparted/labels/mac.c:1257
+msgid ""
+"Changing the name of a root or swap partition will prevent Linux from "
+"recognising it as such."
+msgstr ""
+"Cambiare il nome di una partizione di root o swap non permetterà a Linux di "
+"riconoscerle come tali."
+
+#: libparted/labels/mac.c:1353
+msgid "Can't add another partition -- the partition map is too small!"
+msgstr ""
+"Non è possibile aggiungere un'altra partizione: la mappa delle partizioni è "
+"troppo piccola!"
+
+#: libparted/labels/pc98.c:357
+#, c-format
+msgid "Invalid partition table on %s."
+msgstr "Tabella delle partizioni non valida su %s."
+
+#: libparted/labels/pc98.c:409 libparted/labels/pc98.c:487
+#, c-format
+msgid ""
+"Partition %d isn't aligned to cylinder boundaries. This is still "
+"unsupported."
+msgstr ""
+"La partizione %d non è allineata con l'inizio di un cilindro. Il supporto "
+"per questa casistica non è ancora presente."
+
+#: libparted/labels/pc98.c:796
+msgid "Can't add another partition."
+msgstr "Non è possibile aggiungere un'altra partizione."
+
+#: libparted/labels/sun.c:143
+msgid "Corrupted Sun disk label detected."
+msgstr "È stata trovata l'etichetta Sun corrotta."
+
+#: libparted/labels/sun.c:264
+#, c-format
+msgid ""
+"The disk CHS geometry (%d,%d,%d) reported by the operating system does not "
+"match the geometry stored on the disk label (%d,%d,%d)."
+msgstr ""
+"La geometria CHS (%d,%d,%d) del disco non corrisponde a quella riportata "
+"nell'etichetta (%d,%d,%d)."
+
+#: libparted/labels/sun.c:286
+#, c-format
+msgid "The disk label describes a disk bigger than %s."
+msgstr "L'etichetta del disco descrive un disco più grande di %s."
+
+#: libparted/labels/sun.c:440
+#, c-format
+msgid "The disk has %d cylinders, which is greater than the maximum of 65536."
+msgstr "Il disco ha %d cilindri, maggiori del massimo consentito che è 65536."
+
+#: libparted/labels/sun.c:736
+msgid ""
+"The Whole Disk partition is the only available one left. Generally, it is "
+"not a good idea to overwrite this partition with a real one. Solaris may "
+"not be able to boot without it, and SILO (the sparc boot loader) appreciates "
+"it as well."
+msgstr ""
+"La partizione \"Tutto il disco\" è l'unica rimasta disponibile. Normalmente "
+"non è una buona idea sovrascriverla con una partizione reale. Solaris "
+"potrebbe non essere in grado di avviarsi; inoltre anche SILO (il «boot "
+"loader» per sparc) ne fa uso."
+
+#: libparted/labels/sun.c:751
+msgid "Sun disk label is full."
+msgstr "L'etichetta Sun è completa."
+
+#: libparted/filesys.c:386
+msgid "Could not detect file system."
+msgstr "Non è stato possibile rilevare il file system."
+
+#: libparted/filesys.c:397
+msgid "The file system is bigger than its volume!"
+msgstr "Il file system è più ampio del proprio volume!"
+
+#: libparted/filesys.c:405
+#, c-format
+msgid "Support for opening %s file systems is not implemented yet."
+msgstr ""
+"Il supporto per aprire un file system %s non è ancora stato implementato."
+
+#: libparted/filesys.c:447
+#, c-format
+msgid "Support for creating %s file systems is not implemented yet."
+msgstr ""
+"Il supporto per creare il file system %s non è ancora stato implementato."
+
+#: libparted/filesys.c:508
+#, c-format
+msgid "Support for checking %s file systems is not implemented yet."
+msgstr ""
+"Il supporto per controllare il file system %s non è ancora stato "
+"implementato."
+
+#: libparted/filesys.c:574
+msgid "raw block copying"
+msgstr "copia dei blocchi"
+
+#: libparted/filesys.c:585
+msgid "growing file system"
+msgstr "aumento del file system"
+
+#: libparted/filesys.c:625
+msgid "Can't copy onto an overlapping partition."
+msgstr "Non è possibile copiare su una partizione sovrapposta."
+
+#: libparted/filesys.c:647
+#, c-format
+msgid ""
+"Direct support for copying file systems is not yet implemented for %s. "
+"However, support for resizing is implemented. Therefore, the file system "
+"can be copied if the new partition is at least as big as the old one. So, "
+"either shrink the partition you are trying to copy, or copy to a bigger "
+"partition."
+msgstr ""
+"Il supporto per copiare file system %s non è ancora implementato, ma è "
+"presente quello per ridimensionarlo. Quindi il file system è copiabile se la "
+"partizione di destinazione è grande almeno quanto quella di origine. Quindi "
+"si può rimpicciolire la partizione di partenza oppure copiare in una più "
+"grande."
+
+#: libparted/filesys.c:661
+#, c-format
+msgid "Support for copying %s file systems is not implemented yet."
+msgstr ""
+"Il supporto per copiare file system %s non è ancora stato implementato."
+
+#: libparted/filesys.c:699
+#, c-format
+msgid "Support for resizing %s file systems is not implemented yet."
+msgstr ""
+"Il supporto per ridimensionare il file system %s non è stato ancora "
+"implementato."
+
+#: libparted/exception.c:78
+msgid "Information"
+msgstr "Informazione"
+
+#: libparted/exception.c:79
+msgid "Warning"
+msgstr "Avviso"
+
+#: libparted/exception.c:80
+msgid "Error"
+msgstr "Errore"
+
+#: libparted/exception.c:81
+msgid "Fatal"
+msgstr "Irrimediabile"
+
+#: libparted/exception.c:82
+msgid "Bug"
+msgstr "Bug"
+
+#: libparted/exception.c:83
+msgid "No Implementation"
+msgstr "Non implementato"
+
+#: libparted/exception.c:87
+msgid "Fix"
+msgstr "Fix"
+
+#: libparted/exception.c:88
+msgid "Yes"
+msgstr "Sì"
+
+#: libparted/exception.c:89
+msgid "No"
+msgstr "No"
+
+#: libparted/exception.c:90
+msgid "OK"
+msgstr "OK"
+
+#: libparted/exception.c:91
+msgid "Retry"
+msgstr "Riprova"
+
+#: libparted/exception.c:92
+msgid "Ignore"
+msgstr "Ignora"
+
+#: libparted/exception.c:93
+msgid "Cancel"
+msgstr "Annulla"
+
+#: libparted/exception.c:133
+#, c-format
+msgid ""
+"A bug has been detected in GNU Parted. Refer to the web site of parted "
+"http://www.gnu.org/software/parted/parted.html for more informations of what "
+"could be useful for bug submitting! Please email a bug report to bug-"
+"parted@gnu.org containing at least the version (%s) and the following "
+"message: "
+msgstr ""
+"È stato trovato un bug di GNU parted. Controllare il sito web di parted "
+"http://www.gnu.org/software/parted/parted.html per maggiori informazioni su "
+"cosa è utile comunicare nelle segnalazioni. Si segnali un bug a bug-"
+"parted@gnu.org specificando la versione (%s) e il seguente messaggio: "
+
+#: libparted/cs/geom.c:162
+msgid "Can't have the end before the start!"
+msgstr "Non si puè avere la fine prima dell'inizio!"
+
+#: libparted/cs/geom.c:169
+msgid "Can't have a partition outside the disk!"
+msgstr "Non si può avere una partizione al di fuori del disco!"
+
+#: libparted/cs/geom.c:303
+#, c-format
+msgid "Attempt to read sectors %ld-%ld outside of partition on %s."
+msgstr ""
+"Tentativo di leggere i settori %ld-%ld al di fuori della partizione %s."
+
+#: libparted/cs/geom.c:373
+#, c-format
+msgid "Attempt to write sectors %ld-%ld outside of partition on %s."
+msgstr ""
+"Tentativo di scrivere i settori %ld-%ld al di fuori della partizione %s."
+
+#: libparted/cs/geom.c:413 libparted/fs/linux_swap/linux_swap.c:353
+msgid "checking for bad blocks"
+msgstr "controllo dei blocchi difettosi"
+
+#: libparted/libparted.c:286 libparted/libparted.c:306
+msgid "Out of memory."
+msgstr "Memoria non sufficiente."
+
+#: libparted/unit.c:139
+msgid "Cannot get unit size for special unit 'COMPACT'."
+msgstr "È impossibile conoscere la dimensione dell'unità speciale 'COMPACT'"
+
+#: libparted/unit.c:382
+#, c-format
+msgid "\"%s\" has invalid syntax for locations."
+msgstr "\"%s\" usa una sintassi errata per la locazione."
+
+#: libparted/unit.c:390
+#, c-format
+msgid "The maximum head value is %d."
+msgstr "Il massimo valore per la testina è %d."
+
+#: libparted/unit.c:397
+#, c-format
+msgid "The maximum sector value is %d."
+msgstr "Il massimo valore del settore è %d."
+
+#: libparted/unit.c:409 libparted/unit.c:540
+#, c-format
+msgid "The location %s is outside of the device %s."
+msgstr "La locazione %s è esterna al device %s."
+
+#: libparted/unit.c:522
+msgid "Invalid number."
+msgstr "Numero non valido."
+
+#: libparted/fs/ext2/ext2.c:87 libparted/fs/ext2/ext2.c:112
+msgid "Inconsistent group descriptors!"
+msgstr "Descrittori di gruppo inconsistenti!"
+
+#: libparted/fs/ext2/ext2.c:91 libparted/fs/ext2/ext2.c:116
+msgid "File system full!"
+msgstr "File system pieno!"
+
+#: libparted/fs/ext2/ext2.c:750
+msgid "Invalid superblock. Are you sure this is an ext2 file system?"
+msgstr "Superblocco non valido. Si è certi che sia un file system ext2?"
+
+#: libparted/fs/ext2/ext2.c:764 libparted/fs/ext2/ext2_resize.c:597
+msgid "File system has errors! You should run e2fsck."
+msgstr "Il file system contiene errori! Eseguire e2fsck."
+
+#: libparted/fs/ext2/ext2.c:775
+msgid ""
+"File system was not cleanly unmounted! You should run e2fsck. Modifying an "
+"unclean file system could cause severe corruption."
+msgstr ""
+"Il file system non è stato smontato correttamente! Eseguire e2fsck. "
+"Modificare un file system non consistente può causare seri problemi."
+
+#: libparted/fs/ext2/ext2.c:795
+msgid "File system has an incompatible feature enabled."
+msgstr "Il file system ha abilitata una proprietà incompatibile."
+
+#: libparted/fs/ext2/ext2.c:806
+msgid "Error allocating buffer cache."
+msgstr "Errore allocando la cache dei buffer."
+
+#: libparted/fs/ext2/ext2.c:848
+msgid ""
+"A resize operation on this file system will use EXPERIMENTAL code that MAY "
+"CORRUPT it (although it hasn't done so yet).You should at least backup your "
+"data and run 'e2fsck -f' afterwards."
+msgstr ""
+"Un'operazione di ridimensionamento di questo file system utilizzerà un "
+"codice SPERIMENTALE per POTREBBE CORROMPERLO (anche se finora non è mai "
+"successo.) È quindi consigliato di fare un backup dei dati e eseguire subito "
+"dopo \"e2fsck -f\"."
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:114
+msgid ""
+"Found an inode with a incorrect link count. Better go run e2fsck first!"
+msgstr ""
+"Trovato un inode con un contatore di link non corretto. È meglio eseguire "
+"e2fsck prima!"
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:487
+msgid "Not enough free inodes!"
+msgstr "Non ci sono abbastanza inode liberi!"
+
+#: libparted/fs/ext2/ext2_resize.c:224
+msgid "File system is too full to remove a group!"
+msgstr "Il file system è troppo pieno per rimuovere un gruppo!"
+
+#: libparted/fs/ext2/ext2_resize.c:233
+msgid "File system has too many allocated inodes to remove a group!"
+msgstr "Il file system ha troppi inode allocati per rimuove un gruppo!"
+
+#: libparted/fs/ext2/ext2_resize.c:493
+msgid "adding groups"
+msgstr "aggiunta di gruppi"
+
+#: libparted/fs/ext2/ext2_resize.c:530
+#, c-format
+msgid "Your file system is too full to resize it to %i blocks. Sorry."
+msgstr ""
+"Il file system contiene troppi dati perché sia ridotto a %i blocchi. "
+"Spiacente."
+
+#: libparted/fs/ext2/ext2_resize.c:540
+#, c-format
+msgid ""
+"Your file system has too many occupied inodes to resize it to %i blocks. "
+"Sorry."
+msgstr ""
+"Il file system ha troppi inode occupati perché sia ridotto a %i blocchi. "
+"Spiacente."
+
+#: libparted/fs/ext2/ext2_resize.c:554 libparted/fs/hfs/hfs.c:243
+#: libparted/fs/hfs/hfs.c:624
+msgid "shrinking"
+msgstr "riduzione"
+
+#: libparted/fs/ext2/ext2_resize.c:605
+msgid "File system was not cleanly unmounted! You should run e2fsck."
+msgstr "Il file system non è stato smontato correttamente. Eseguire e2fsck."
+
+#: libparted/fs/ext2/ext2_resize.c:614
+msgid ""
+"The file system has the 'dir_index' feature enabled. Parted can only resize "
+"the file system if it disables this feature. You can enable it later by "
+"running 'tune2fs -O dir_index DEVICE' and then 'e2fsck -fD DEVICE'."
+msgstr ""
+"Il file system ha la \"feature\" «dir_index» attiva. Parted può "
+"ridimensionare solo file system disattivando questa \"feature\". Sarà "
+"possibile riattivarla successivamente eseguendo «tune2fs -O dir_index "
+"DEVICE» e poi «e2fsck -fD DEVICE»."
+
+#: libparted/fs/ext2/ext2_block_relocator.c:198
+msgid "Cross-linked blocks found! Better go run e2fsck first!"
+msgstr ""
+"Sono stati trovati dei blocchi collegati in maniera incrociata! Meglio "
+"eseguire e2fsck!"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:537
+#, c-format
+msgid "Block %i has no reference? Weird."
+msgstr "Il blocco %i non è referenziato? Strano"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:738
+#, c-format
+msgid "Block %i shouldn't have been marked!"
+msgstr "Il blocco %i non avrebbe dovuto essere marcato!"
+
+#: libparted/fs/ext2/interface.c:188
+msgid ""
+"The ext2 file system passed a basic check. For a more comprehensive check, "
+"use the e2fsck program."
+msgstr ""
+"Il file system ext2 ha passato i controlli di base. Per un controllo più "
+"approfondito utilizzare il programma e2fsck."
+
+#: libparted/fs/ext2/interface.c:205
+msgid "Sorry, can't move the start of ext2 partitions yet!"
+msgstr ""
+"Spiacente, ma non è ancora possibile spostare l'inizio di una partizione "
+"ext2!"
+
+#: libparted/fs/ext2/ext2_buffer.c:82
+msgid "Couldn't flush buffer cache!"
+msgstr "Non posso svuotare la cache dei buffer!"
+
+#: libparted/fs/ext2/ext2_mkfs.c:162
+msgid "writing per-group metadata"
+msgstr "scrittura dei metadati per ogni gruppo"
+
+#: libparted/fs/ext2/ext2_mkfs.c:565
+msgid "File system too small for ext2."
+msgstr "File system troppo picolo per ext2."
+
+#: libparted/fs/fat/calc.c:134
+#, c-format
+msgid ""
+"You need %s of free disk space to shrink this partition to this size. "
+"Currently, only %s is free."
+msgstr ""
+"Servono %s di spazio libero per ridurre la partizione a questa dimensione. "
+"Attualmente soltanto %s è libero."
+
+#: libparted/fs/fat/context.c:55
+#, c-format
+msgid ""
+"Cluster start delta = %d, which is not a multiple of the cluster size %d."
+msgstr ""
+"Lo spostamento del primo blocco del cluster è %d che non è un multiplo della "
+"dimensione del cluster %d."
+
+#: libparted/fs/fat/fat.c:312
+#, c-format
+msgid "Partition too big/small for a %s file system."
+msgstr "Partizione troppo grande/piccola per il file system %s."
+
+#: libparted/fs/fat/fat.c:478
+msgid ""
+"The FATs don't match. If you don't know what this means, then select "
+"cancel, run scandisk on the file system, and then come back."
+msgstr ""
+"Le FAT non coincidono. Se non si sa cosa questo voglia dire selezionare "
+"\"annulla\" e poi eseguire «scandisk» sul file system; infine si proceda."
+
+#: libparted/fs/fat/fat.c:518
+msgid "There are no possible configurations for this FAT type."
+msgstr "Non ci sono configurazioni possibili per questo tipo di FAT."
+
+#: libparted/fs/fat/fat.c:530
+#, c-format
+msgid ""
+"File system doesn't have expected sizes for Windows to like it. Cluster "
+"size is %dk (%dk expected); number of clusters is %d (%d expected); size of "
+"FATs is %d sectors (%d expected)."
+msgstr ""
+"Il file system non ha una serie di dimensioni attese da Windows. La "
+"dimensione del cluster è %dk (%dk attesa); il numero di cluster è %d (%d "
+"atteso); la dimensione delle FAT è %d settori (%d attesi)."
+
+#: libparted/fs/fat/fat.c:553
+#, c-format
+msgid ""
+"File system is reporting the free space as %d clusters, not %d clusters."
+msgstr "Il file system riporta uno spazio libero di %d cluster anziché %d."
+
+#: libparted/fs/fat/fat.c:878
+msgid ""
+"GNU Parted was miscompiled: the FAT boot sector should be 512 bytes. FAT "
+"support will be disabled."
+msgstr ""
+"GNU parted non è stato compilato correttamente: il settore di avvio dovrebbe "
+"essere di 512 byte. Il supporto per FAT verrà diabilitato."
+
+#: libparted/fs/fat/resize.c:158
+msgid ""
+"There's not enough room in the root directory for all of the files. Either "
+"cancel, or ignore to lose the files."
+msgstr ""
+"Non c'è sufficiente spazio nella directory principale per tutti i file. "
+"Scegliere Annulla, o Ignora per perdere i file."
+
+#: libparted/fs/fat/resize.c:299
+msgid "Error writing to the root directory."
+msgstr "Errore scrivendo nella directory principale."
+
+#: libparted/fs/fat/resize.c:484
+msgid "If you leave your file system as FAT16, then you will have no problems."
+msgstr "Lasciare il file system come FAT16 non causerà alcun problema."
+
+#: libparted/fs/fat/resize.c:487
+msgid ""
+"If you convert to FAT16, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual)."
+msgstr ""
+"Convertire a FAT16 una partizione che contiene MS Windows, richiede che il "
+"«boot loader» di Windows sia reinstallato. Se lo si vuol fare, consultare il "
+"manuale di Parted (o della propria distribuzione.)"
+
+#: libparted/fs/fat/resize.c:495
+msgid ""
+"If you leave your file system as FAT32, then you will not introduce any new "
+"problems."
+msgstr "Lasciare il file system come FAT32 non introdurrà alcun problema."
+
+#: libparted/fs/fat/resize.c:499
+msgid ""
+"If you convert to FAT32, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual). Also, "
+"converting to FAT32 will make the file system unreadable by MS DOS, MS "
+"Windows 95a, and MS Windows NT."
+msgstr ""
+"Convertire a FAT32 una partizione che contiene MS Windows, richiede la "
+"reinstallazione del «boot loader». Se lo si vuol fare è possibile consultare "
+"il manuale Parted (o della propria distribuzione). Inoltre, la conversione a "
+"FAT32, renderà il file system illegibile a MS DOS, MS Windows 95a e MS "
+"Windows NT."
+
+#: libparted/fs/fat/resize.c:513
+#, c-format
+msgid "%s %s %s"
+msgstr "%s %s %s"
+
+#: libparted/fs/fat/resize.c:514
+msgid "Would you like to use FAT32?"
+msgstr "Usare FAT32?"
+
+#: libparted/fs/fat/resize.c:541 libparted/fs/fat/resize.c:557
+#, c-format
+msgid "%s %s"
+msgstr "%s %s"
+
+#: libparted/fs/fat/resize.c:542
+msgid ""
+"The file system can only be resized to this size by converting to FAT16."
+msgstr ""
+"Il file system può solo essere portato a questa dimensione durante la "
+"conversione a FAT16."
+
+#: libparted/fs/fat/resize.c:558
+msgid ""
+"The file system can only be resized to this size by converting to FAT32."
+msgstr ""
+"Il file system può solo essere portato a questa dimensione durante la "
+"conversione a FAT32."
+
+#: libparted/fs/fat/resize.c:571
+msgid ""
+"GNU Parted cannot resize this partition to this size. We're working on it!"
+msgstr ""
+"GNU Parted non può ridimensionare questa partizione a questa dimensione. Ci "
+"stiamo lavorando!"
+
+#: libparted/fs/fat/bootsector.c:48 libparted/fs/fat/bootsector.c:55
+msgid "File system has an invalid signature for a FAT file system."
+msgstr "Il file system ha una firma non valida per un file system FAT."
+
+#: libparted/fs/fat/bootsector.c:62
+msgid "File system has an invalid sector size for a FAT file system."
+msgstr ""
+"Il file system ha una dimensione di settore non valida per un file system "
+"FAT."
+
+#: libparted/fs/fat/bootsector.c:69
+msgid "File system has an invalid cluster size for a FAT file system."
+msgstr ""
+"Il file system ha una dimensione di cluster non valida per un file system "
+"FAT."
+
+#: libparted/fs/fat/bootsector.c:76
+msgid ""
+"File system has an invalid number of reserved sectors for a FAT file system."
+msgstr ""
+"Il file system ha un numero di settori riservati non valido per un file "
+"system FAT."
+
+#: libparted/fs/fat/bootsector.c:83
+msgid "File system has an invalid number of FATs."
+msgstr "Il file system ha un numero non corretto di FAT."
+
+#: libparted/fs/fat/bootsector.c:138
+#, c-format
+msgid ""
+"This file system has a logical sector size of %d. GNU Parted is known not "
+"to work properly with sector sizes other than 512 bytes."
+msgstr ""
+"Il file system ha dei settori logici con dimensione %d. È risaputo che GNU "
+"Parted non funziona bene con settori di dimensione diversa da 512 byte."
+
+#: libparted/fs/fat/bootsector.c:163
+#, c-format
+msgid ""
+"The file system's CHS geometry is (%d, %d, %d), which is invalid. The "
+"partition table's CHS geometry is (%d, %d, %d). If you select Ignore, the "
+"file system's CHS geometry will be left unchanged. If you select Fix, the "
+"file system's CHS geometry will be set to match the partition table's CHS "
+"geometry."
+msgstr ""
+"La geometria CHS del file system è (%d, %d, %d) che non è valida. La "
+"geometria CHS della tabella delle partizioni è (%d, %d, %d). Selezionando "
+"Ignora la geometria CHS del file system non sarà cambiata. Selezionando Fix "
+"la geometria CHS del file system verrà fatta corrispondere alla geometria "
+"CHS della tabella delle partizioni."
+
+#: libparted/fs/fat/bootsector.c:209
+msgid "FAT boot sector says logical sector size is 0. This is weird. "
+msgstr ""
+"Il settore di avvio della FAT sostiene che la dimensione del settore logico "
+"sia 0. Il che è strano. "
+
+#: libparted/fs/fat/bootsector.c:215
+msgid "FAT boot sector says there are no FAT tables. This is weird. "
+msgstr ""
+"Il settore di avvio della FAT sostiene che non ci siano tabelle FAT. Il che "
+"è strano. "
+
+#: libparted/fs/fat/bootsector.c:221
+msgid "FAT boot sector says clusters are 0 sectors. This is weird. "
+msgstr ""
+"Il settore di avvio della FAT sostiene che il cluster sia composto da 0 "
+"settori. Il che è strano. "
+
+#: libparted/fs/fat/bootsector.c:231
+msgid "File system is FAT12, which is unsupported."
+msgstr "Il file system è FAT12, che non è supportato."
+
+#: libparted/fs/fat/bootsector.c:407
+#, c-format
+msgid ""
+"The information sector has the wrong signature (%x). Select cancel for now, "
+"and send in a bug report. If you're desperate, it's probably safe to ignore."
+msgstr ""
+"Il settore di informazioni ha una firma errata (%x). Selezionare Annulla per "
+"ora e inviare un segnalazione di bug. In situazioni disperate è forse "
+"possibile ignorare l'errore."
+
+#: libparted/fs/fat/count.c:149
+#, c-format
+msgid "Bad directory entry for %s: first cluster is the end of file marker."
+msgstr ""
+"Elemento di directory errato per %s: il primo cluster è la fine del "
+"marcatore di file."
+
+#: libparted/fs/fat/count.c:162
+#, c-format
+msgid ""
+"Bad FAT: unterminated chain for %s. You should run dosfsck or scandisk."
+msgstr ""
+"FAT errata: la catena per %s non è stata terminata. Eseguire «dosfsck» "
+"oppure «scandisk»."
+
+#: libparted/fs/fat/count.c:171
+#, c-format
+msgid ""
+"Bad FAT: cluster %d outside file system in chain for %s. You should run "
+"dosfsck or scandisk."
+msgstr ""
+"FAT errata: il cluster %d usato nella catena %s è fuori dal file system. "
+"Eseguire «dosfsck» oppure «scandisk»."
+
+#: libparted/fs/fat/count.c:181
+#, c-format
+msgid ""
+"Bad FAT: cluster %d is cross-linked for %s. You should run dosfsck or "
+"scandisk."
+msgstr ""
+"FAT errata: il cluster %d ha dei collegamenti incrociati per %s. Eseguire "
+"«dosfsck» oppure «scandisk»."
+
+#: libparted/fs/fat/count.c:200
+#, c-format
+msgid "%s is %dk, but it has %d clusters (%dk)."
+msgstr "%s è %dk, ma contiene %d cluster (%dk)."
+
+#: libparted/fs/fat/count.c:263
+#, c-format
+msgid ""
+"The file %s is marked as a system file. This means moving it could cause "
+"some programs to stop working."
+msgstr ""
+"Il file %s è marcato come file di sistema, vale a dire che spostarlo "
+"potrebbe causare il blocco di alcuni programmi."
+
+#: libparted/fs/fat/table.c:138
+#, c-format
+msgid ""
+"FAT %d media %x doesn't match the boot sector's media %x. You should "
+"probably run scandisk."
+msgstr ""
+"FAT %d, il media %x non coincide con quello specificato nel settore di avvio "
+"%x. Sarebbe meglio eseguire «scandisk»."
+
+#: libparted/fs/fat/table.c:268
+#, c-format
+msgid "fat_table_set: cluster %ld outside file system"
+msgstr "fat_table_set: il cluster %ld è al di fuori del file system"
+
+#: libparted/fs/fat/table.c:296
+#, c-format
+msgid "fat_table_get: cluster %ld outside file system"
+msgstr "fat_table_get: il cluster %ld è al di fuori del file system"
+
+#: libparted/fs/fat/table.c:334
+msgid "fat_table_alloc_cluster: no free clusters"
+msgstr "fat_table_alloc_cluster: cluster esauriti"
+
+#: libparted/fs/linux_swap/linux_swap.c:236
+#, c-format
+msgid "Unrecognised linux swap signature '%10s'."
+msgstr "Firma linux di partizione swap non conosciuta: «%10s»."
+
+#: libparted/fs/linux_swap/linux_swap.c:312
+msgid "Too many bad pages."
+msgstr "Troppe pagine inutilizzabili."
+
+#: libparted/fs/hfs/advfs.c:123 libparted/fs/hfs/advfs_plus.c:125
+#: libparted/fs/hfs/reloc.c:416 libparted/fs/hfs/reloc.c:510
+#: libparted/fs/hfs/reloc_plus.c:541 libparted/fs/hfs/reloc_plus.c:660
+#: libparted/fs/hfs/reloc_plus.c:774
+msgid "The file system contains errors."
+msgstr "Il file system contiene errori."
+
+#: libparted/fs/hfs/advfs_plus.c:290
+msgid "Bad blocks could not be read."
+msgstr "I blocchi corrotti non possone essere letti."
+
+#: libparted/fs/hfs/cache.c:139
+#, c-format
+msgid ""
+"Trying to register an extent starting at block 0x%X, but another one already "
+"exists at this position. You should check the file system!"
+msgstr ""
+"Tentativo di registrazione di un «extent» dal bocco 0x%X, ma un altro esiste "
+"già nella medesima posizione. Bisogna controllare il file system!"
+
+#: libparted/fs/hfs/cache.c:216
+#, c-format
+msgid ""
+"Trying to move an extent from block Ox%X to block Ox%X, but another one "
+"already exists at this position. This should not happen!"
+msgstr ""
+"Tentativo di spostamento di un «extent» dal blocco Ox%X al blocco Ox%X, ma "
+"c'è già un altro «extent» nella medesima posizione. Questo non deve "
+"avvenire! "
+
+#: libparted/fs/hfs/file.c:145
+#, c-format
+msgid "Could not update the extent cache for HFS file with CNID %X."
+msgstr ""
+"Impossibile aggiornare la cache degli «extent» per un file HFS con CNID %X."
+
+#: libparted/fs/hfs/file.c:182
+#, c-format
+msgid "Trying to read HFS file with CNID %X behind EOF."
+msgstr "Tentativo di leggere il file HFS con CNID %X oltre EOF."
+
+#: libparted/fs/hfs/file.c:192 libparted/fs/hfs/file.c:222
+#, c-format
+msgid "Could not find sector %lli of HFS file with CNID %X."
+msgstr "Impossibile trovare il settore %lli del file HFS con CNID %X."
+
+#: libparted/fs/hfs/file.c:212
+#, c-format
+msgid "Trying to write HFS file with CNID %X behind EOF."
+msgstr "Tentativo di scrivere un file HFS con CNID %X oltre EOF."
+
+#: libparted/fs/hfs/file_plus.c:159
+#, c-format
+msgid "Could not update the extent cache for HFS+ file with CNID %X."
+msgstr ""
+"Impossibile aggiornare la cache degli «extent» per il file HFS+ con CNID %X. "
+
+#: libparted/fs/hfs/file_plus.c:203
+#, c-format
+msgid "Trying to read HFS+ file with CNID %X behind EOF."
+msgstr "Tentativo di leggere un file HFS+ con CNID %X oltre EOF."
+
+#: libparted/fs/hfs/file_plus.c:214 libparted/fs/hfs/file_plus.c:256
+#, c-format
+msgid "Could not find sector %lli of HFS+ file with CNID %X."
+msgstr "Impossibile trovare il settore %lli del file HFS+ con CNID %X."
+
+#: libparted/fs/hfs/file_plus.c:245
+#, c-format
+msgid "Trying to write HFS+ file with CNID %X behind EOF."
+msgstr "Tentativo di scrittura su file HFS+ con CNID %X oltre EOF."
+
+#: libparted/fs/hfs/hfs.c:225
+msgid "Sorry, HFS cannot be resized that way yet."
+msgstr "Spiacente, ma HFS non può ancora essere ridimensionato in questo modo."
+
+#: libparted/fs/hfs/hfs.c:255 libparted/fs/hfs/hfs.c:636
+msgid "Data relocation has failed."
+msgstr "Fallito il riposizionamento dei dati."
+
+#: libparted/fs/hfs/hfs.c:274
+msgid "Data relocation left some data in the end of the volume."
+msgstr ""
+"Il riposizionamento dei dati ne ha lasciato alcuni alla fine del volume."
+
+#: libparted/fs/hfs/hfs.c:313
+msgid "writing HFS Master Directory Block"
+msgstr "Errore scrivendo nel blocco HFS «Master Directory»."
+
+#: libparted/fs/hfs/hfs.c:461
+msgid "No valid HFS[+X] signature has been found while opening."
+msgstr "Non è stata trovata alcuna firma HFS[+X] valida all'apertura."
+
+#: libparted/fs/hfs/hfs.c:471
+#, c-format
+msgid "Version %d of HFS+ isn't supported."
+msgstr "La versione %d del file HFS+ non è supportata."
+
+#: libparted/fs/hfs/hfs.c:482
+#, c-format
+msgid "Version %d of HFSX isn't supported."
+msgstr "La versione %d del file HFSX non è supportata."
+
+#: libparted/fs/hfs/hfs.c:667
+msgid "Data relocation left some data at the end of the volume."
+msgstr ""
+"Il riposizionamento dei dati ne ha lasciato alcuni alla fine del volume."
+
+#: libparted/fs/hfs/hfs.c:715
+msgid "Error while writing the allocation file."
+msgstr "Errore scrivendo il file di allocazione."
+
+#: libparted/fs/hfs/hfs.c:730
+msgid "Error while writing the compatibility part of the allocation file."
+msgstr ""
+"Errore nella scrittura della parte compatibile ddel file di allocazione."
+
+#: libparted/fs/hfs/hfs.c:745
+msgid "writing HFS+ Volume Header"
+msgstr "Scrittura del «Volume Header» HFS+."
+
+#: libparted/fs/hfs/hfs.c:845
+msgid "An error occurred while looking for the mandatory bad blocks file."
+msgstr "Errore nella ricerca del file obbligatorio dei blocchi corrotti."
+
+#: libparted/fs/hfs/hfs.c:899
+msgid ""
+"It seems there is an error in the HFS wrapper: the bad blocks file doesn't "
+"contain the embedded HFS+ volume."
+msgstr ""
+"Sembra esserci un errore nel wrapper HFS: il file dei blocchi inutilizzabili "
+"non contiene il volume HFS+."
+
+#: libparted/fs/hfs/hfs.c:930
+msgid "Sorry, HFS+ cannot be resized that way yet."
+msgstr "Spiacente, HFS+ non può essere ancora ridimensionato in questo modo."
+
+#: libparted/fs/hfs/hfs.c:965
+msgid "shrinking embedded HFS+ volume"
+msgstr "riduzione del volume HFS+"
+
+#: libparted/fs/hfs/hfs.c:981
+msgid "Resizing the HFS+ volume has failed."
+msgstr "Il ridimensionamento del volume HFS+ non è andato a buon fine."
+
+#: libparted/fs/hfs/hfs.c:988
+msgid "shrinking HFS wrapper"
+msgstr "riduzione del wrapper HFS"
+
+#: libparted/fs/hfs/hfs.c:997
+msgid "Updating the HFS wrapper has failed."
+msgstr "L'aggiornamento del wrapper HFS è fallita."
+
+#: libparted/fs/hfs/hfs.c:1099 libparted/fs/hfs/hfs.c:1184
+#, c-format
+msgid ""
+"This is not a real %s check. This is going to extract special low level "
+"files for debugging purposes."
+msgstr ""
+"Non è un controllo %s reale. Avviamento della speciale procedura a basso "
+"livello d'estrazione dei file per il debug."
+
+#: libparted/fs/hfs/journal.c:156
+msgid "Bad block list header checksum."
+msgstr "Somma di controllo della lista dei blocchi inutilizzabili."
+
+#: libparted/fs/hfs/journal.c:169
+#, c-format
+msgid ""
+"Invalid size of a transaction block while replaying the journal (%i bytes)."
+msgstr ""
+"Errata dimensione di un blocco di transazione durante la riesecuzione del "
+"registro (%i byte)."
+
+#: libparted/fs/hfs/journal.c:261
+msgid ""
+"Journal stored outside of the volume are not supported. Try to desactivate "
+"the journal and run Parted again."
+msgstr ""
+"Registri memorizzati all'esterno del volume non sono supportati. Disattivare "
+"il registro esterno e riavviare Parted."
+
+#: libparted/fs/hfs/journal.c:272
+msgid "Journal offset or size is not multiple of the sector size."
+msgstr ""
+"Lo spostamento o la dimensione del registro non è un multiplo della "
+"dimensione di un settore."
+
+#: libparted/fs/hfs/journal.c:290
+msgid "Incorrect magic values in the journal header."
+msgstr "Valori «magic» errati nell'intestazione del registro."
+
+#: libparted/fs/hfs/journal.c:299
+msgid "Journal size mismatch between journal info block and journal header."
+msgstr ""
+"La dimensione del registro non corrisponde con quelle dell'intestazione del "
+"registro medesimo."
+
+#: libparted/fs/hfs/journal.c:311
+msgid "Some header fields are not multiple of the sector size."
+msgstr ""
+"Alcuni campi dell'intestazione non sono multipli della dimensione di un "
+"settore."
+
+#: libparted/fs/hfs/journal.c:320
+msgid ""
+"The sector size stored in the journal is not 512 bytes. Parted only "
+"supports 512 bytes length sectors."
+msgstr ""
+"La dimensione del settore registrata nel registro non è di 512 byte. Parted "
+"supporta solo settori di lunghezza pari a 512 byte."
+
+#: libparted/fs/hfs/journal.c:332
+msgid "Bad journal checksum."
+msgstr "Somma di controllo del registro inesatta."
+
+#: libparted/fs/hfs/journal.c:350
+msgid ""
+"The journal is not empty. Parted must replay the transactions before "
+"opening the file system. This will modify the file system."
+msgstr ""
+"Il registro non è vuoto. Parted deve ripetere le transazioni prima di "
+"passare all'apertura del file system. Il file system verrà modificato."
+
+#: libparted/fs/hfs/journal.c:378
+msgid ""
+"The volume header or the master directory block has changed while replaying "
+"the journal. You should restart Parted."
+msgstr ""
+"L'intestazione del volume o il blocco della directory master è stata "
+"modificata durante la riesecuzione delle transazioni. Parted deve essere "
+"riavviato."
+
+#: libparted/fs/hfs/probe.c:52
+#, c-format
+msgid ""
+"Parted can't use HFS file systems on disks with a sector size not equal to %"
+"d bytes."
+msgstr ""
+"Parted non può utilizzare file system HFS su dischi con settori di "
+"dimensione diversa da %d byte."
+
+#: libparted/fs/hfs/reloc.c:153 libparted/fs/hfs/reloc_plus.c:157
+msgid "An extent has not been relocated."
+msgstr "Un «extent» non è stato riposizionato."
+
+#: libparted/fs/hfs/reloc.c:253 libparted/fs/hfs/reloc_plus.c:309
+msgid ""
+"A reference to an extent comes from a place it should not. You should check "
+"the file system!"
+msgstr ""
+"Il riferimento ad un'estensione proviene da un'insolita posizione. Il file "
+"system deve essere controllato!."
+
+#: libparted/fs/hfs/reloc.c:383
+msgid "This HFS volume has no catalog file. This is very unusual!"
+msgstr "Questo volume HFS non possiede un catalogo. Questo è inusuale!"
+
+#: libparted/fs/hfs/reloc.c:477
+msgid "This HFS volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+"Questo volume HFS non presenta un file di overflow degli «extent». È molto "
+"strano!."
+
+#: libparted/fs/hfs/reloc.c:519 libparted/fs/hfs/reloc_plus.c:670
+msgid ""
+"The extents overflow file should not contain its own extents! You should "
+"check the file system."
+msgstr ""
+"Il file di overflow degli «extent» non deve contenere i propri «extent». Si "
+"dovrebbe verificare il file system."
+
+#: libparted/fs/hfs/reloc.c:576 libparted/fs/hfs/reloc_plus.c:849
+msgid "Could not cache the file system in memory."
+msgstr "Non è stato possibile caricare il file system in memoria."
+
+#: libparted/fs/hfs/reloc.c:637 libparted/fs/hfs/reloc_plus.c:910
+msgid "Bad blocks list could not be loaded."
+msgstr "Non è stato possibile caricare l'elenco dei blocchi corrotti."
+
+#: libparted/fs/hfs/reloc.c:651 libparted/fs/hfs/reloc_plus.c:926
+msgid "An error occurred during extent relocation."
+msgstr "Un errore è avvenuto durante la rilocazione degli «extent»."
+
+#: libparted/fs/hfs/reloc_plus.c:497
+msgid "This HFS+ volume has no catalog file. This is very unusual!"
+msgstr "Questo volume HFS non ha un file per il catalogo. Ciò è inusuale!"
+
+#: libparted/fs/hfs/reloc_plus.c:621
+msgid "This HFS+ volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+"Questo volume HFS+ non ha un file per l'overflow degli «extent». Questo è "
+"abbastanza inusuale!"
+
+#: parted/parted.c:76
+msgid "displays this help message"
+msgstr "mostra questo messaggio di aiuto"
+
+#: parted/parted.c:77
+msgid "where necessary, prompts for user intervention"
+msgstr "chiede l'intervento dell'utente, quando necessario"
+
+#: parted/parted.c:78
+msgid "never prompts for user intervention"
+msgstr "non chiede mai l'intervento dell'utente"
+
+#: parted/parted.c:79
+msgid "displays the version"
+msgstr "mostra la versione"
+
+#: parted/parted.c:87
+msgid ""
+"NUMBER is the partition number used by Linux. On MS-DOS disk labels, the "
+"primary partitions number from 1 to 4, logical partitions from 5 onwards.\n"
+msgstr ""
+"NUMBER è il numero di partizione usato da Linux. Su etichette MS-DOS le "
+"partizioni primarie hanno numeri da 1 a 4 e le logiche da 5 in poi.\n"
+
+#: parted/parted.c:90
+msgid "LABEL-TYPE is one of: "
+msgstr "LABEL-TYPE è una di: "
+
+#: parted/parted.c:91
+msgid "FLAG is one of: "
+msgstr "FLAG è uno di: "
+
+#: parted/parted.c:92
+msgid "UNIT is one of: "
+msgstr "UNIT è uno di: "
+
+#: parted/parted.c:93
+msgid "PART-TYPE is one of: primary, logical, extended\n"
+msgstr "PART-TYPE è uno di: primaria, logica, estesa\n"
+
+#: parted/parted.c:95
+msgid "FS-TYPE is one of: "
+msgstr "FS-TYPE è uno di: "
+
+#: parted/parted.c:96
+msgid ""
+"START and END are disk locations, such as 4GB or 10%. Negative values count "
+"from the end of the disk. For example, -1s specifies exactly the last "
+"sector.\n"
+msgstr ""
+"START e END sono locazioni sul disco, come 4GB o 10%. I numeri negativi sono "
+"relativi alla fine del disco. Per esempio, -1s indica esattamente l'ultimo "
+"settore.\n"
+
+#: parted/parted.c:99
+msgid "STATE is one of: on, off\n"
+msgstr "STATE è uno di: on, off\n"
+
+#: parted/parted.c:100
+msgid "DEVICE is usually /dev/hda or /dev/sda\n"
+msgstr "DEVICE è normalmente /dev/hda o /dev/sda\n"
+
+#: parted/parted.c:101
+msgid "NAME is any word you want\n"
+msgstr "NAME è qualsiasi parola si voglia\n"
+
+#: parted/parted.c:102
+msgid "The partition must have one of the following FS-TYPEs: "
+msgstr "La partizione deve avere uno dei seguenti FS_TYPE: "
+
+#: parted/parted.c:105
+msgid "GNU Parted Version information:\n"
+msgstr "Informazioni sulla versione di GNU Parted:\n"
+
+#: parted/parted.c:107
+msgid ""
+"Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n"
+"This program is free software, covered by the GNU General Public License.\n"
+"\n"
+"This program is distributed in the hope that it will be useful, but WITHOUT "
+"ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
+"FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
+"more details.\n"
+"\n"
+msgstr ""
+"Copyright (C) 1998-2006 Free Software Foundation, Inc.\n"
+"Questo programma è software libero, protetto dalla licenza GNU General "
+"Public License.\n"
+"\n"
+"Questo programma è distribuito nella speranza che sia utile, ma SENZA ALCUNA "
+"GARANZIA; senza neppure le garanzie derivate dalla COMMERCIABILITÀ o "
+"dall'essere ADATTO AD UN PARTICOLARE SCOPO. Si veda la GNU General Public "
+"License per maggiori dettagli.\n"
+"\n"
+
+#: parted/parted.c:152
+#, c-format
+msgid "%0.f%%\t(time left %.2d:%.2d)"
+msgstr "%0.f%%\t(tempo rimasto %.2d:%.2d)"
+
+#: parted/parted.c:170
+#, c-format
+msgid ""
+"Partition %s is being used. You must unmount it before you modify it with "
+"Parted."
+msgstr ""
+"La partizione %s è in uso. La si deve smontare prima di modificarla con "
+"Parted."
+
+#: parted/parted.c:187
+#, c-format
+msgid "Partition(s) on %s are being used."
+msgstr "La/e partizione/i di %s sono in uso."
+
+#: parted/parted.c:413 parted/parted.c:594 parted/parted.c:979
+#: parted/parted.c:1059 parted/parted.c:1586 parted/parted.c:1663
+#: parted/parted.c:1707
+msgid "Partition number?"
+msgstr "Numero di partizione?"
+
+#: parted/parted.c:456
+msgid "Source device?"
+msgstr "Device di origine?"
+
+#: parted/parted.c:460
+msgid "Source partition number?"
+msgstr "Numero di partizione di origine?"
+
+#: parted/parted.c:465
+msgid "Can't copy an extended partition."
+msgstr "Non è possibile copiare una partizione estesa."
+
+#: parted/parted.c:471
+msgid "Destination partition number?"
+msgstr "Numero della partizione destinazione?"
+
+#: parted/parted.c:564
+msgid "New disk label type?"
+msgstr "Tipo dell'etichetta del nuovo disco?"
+
+#: parted/parted.c:598
+msgid "File system?"
+msgstr "File system?"
+
+#: parted/parted.c:645 parted/parted.c:815
+msgid "Partition type?"
+msgstr "Tipo di partizione?"
+
+#: parted/parted.c:652 parted/parted.c:822 parted/parted.c:1062
+msgid "Partition name?"
+msgstr "Nome della partizione?"
+
+#: parted/parted.c:660 parted/parted.c:832
+msgid "File system type?"
+msgstr "Tipo di file system?"
+
+#: parted/parted.c:667 parted/parted.c:834 parted/parted.c:994
+#: parted/parted.c:1544 parted/parted.c:1595
+msgid "Start?"
+msgstr "Inizio?"
+
+#: parted/parted.c:669 parted/parted.c:837 parted/parted.c:997
+#: parted/parted.c:1546 parted/parted.c:1597
+msgid "End?"
+msgstr "Fine?"
+
+#: parted/parted.c:707 parted/parted.c:875
+#, c-format
+msgid ""
+"You requested a partition from %s to %s.\n"
+"The closest location we can manage is %s to %s. Is this still acceptable to "
+"you?"
+msgstr ""
+"È stata chiesta una partizione da %s a %s.\n"
+"La locazione più prossima disponibile è da %s a %s. Va bene lo stesso?"
+
+#: parted/parted.c:827
+msgid "An extended partition cannot hold a file system. Did you want mkpart?"
+msgstr ""
+"Le partizione estese non possono contenere un file system. Proseguire con "
+"mkpart?"
+
+#: parted/parted.c:985
+msgid "Can't move an extended partition."
+msgstr "Non è possibile spostare una partizione estesa."
+
+#: parted/parted.c:1014
+msgid "Can't move a partition onto itself. Try using resize, perhaps?"
+msgstr ""
+"Non è possibile muovere una partizione in se stessa. Provare con il comando "
+"resize?"
+
+#: parted/parted.c:1158
+#, c-format
+msgid "Minor: %d\n"
+msgstr "Minor: %d\n"
+
+#: parted/parted.c:1159
+#, c-format
+msgid "Flags: %s\n"
+msgstr "Flag: %s\n"
+
+#: parted/parted.c:1160
+#, c-format
+msgid "File System: %s\n"
+msgstr "File system: %s\n"
+
+#: parted/parted.c:1161
+#, c-format
+msgid "Size: "
+msgstr "Dimensione: "
+
+#: parted/parted.c:1166
+#, c-format
+msgid "Minimum size: "
+msgstr "Dimensione minima: "
+
+#: parted/parted.c:1169
+#, c-format
+msgid "Maximum size: "
+msgstr "Dimensione massima: "
+
+#: parted/parted.c:1255
+#, c-format
+msgid "Disk %s: %s\n"
+msgstr "Disco %s: %s\n"
+
+#: parted/parted.c:1256
+#, c-format
+msgid "Sector size (logical/physical): %lldB/%lldB\n"
+msgstr "Dimensione del settore (logica/fisica): %lldB/%lldB\n"
+
+#: parted/parted.c:1267
+#, c-format
+msgid "BIOS cylinder,head,sector geometry: %d,%d,%d. Each cylinder is %s.\n"
+msgstr ""
+"Geometria del BIOS cilindri, testine, settori: %d,%d,%d. Ogni cilindro è %"
+"s.\n"
+
+#: parted/parted.c:1273
+#, c-format
+msgid "Partition Table: %s\n"
+msgstr "Tabella delle partizioni: %s\n"
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Number"
+msgstr "Numero"
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Start"
+msgstr "Inizio"
+
+#: parted/parted.c:1285 parted/parted.c:1288
+msgid "End"
+msgstr "Fine"
+
+#: parted/parted.c:1288
+msgid "Size"
+msgstr "Dimensione"
+
+#: parted/parted.c:1292
+msgid "Type"
+msgstr "Tipo"
+
+#: parted/parted.c:1294
+msgid "File system"
+msgstr "File System"
+
+#: parted/parted.c:1297
+msgid "Name"
+msgstr "Nome"
+
+#: parted/parted.c:1299
+msgid "Flags"
+msgstr "Flag"
+
+#: parted/parted.c:1352
+msgid "Free Space"
+msgstr "Spazio libero"
+
+#: parted/parted.c:1441
+#, c-format
+msgid ""
+"A %s %s partition was found at %s -> %s. Do you want to add it to the "
+"partition table?"
+msgstr ""
+"Una partizione %s %s è stata trovata a %s -> %s. Aggiungerla alla tabella "
+"delle partizioni?"
+
+#: parted/parted.c:1479
+msgid "searching for file systems"
+msgstr "ricerca di file system"
+
+#: parted/parted.c:1684
+msgid "New device?"
+msgstr "Nuovo device?"
+
+#: parted/parted.c:1709
+msgid "Flag to Invert?"
+msgstr "Flag da invertire?"
+
+#: parted/parted.c:1714
+msgid "New state?"
+msgstr "Nuovo stato?"
+
+#: parted/parted.c:1747
+msgid "Unit?"
+msgstr "Unità?"
+
+#: parted/parted.c:1896
+msgid "check"
+msgstr "controllo"
+
+#: parted/parted.c:1899
+msgid ""
+"check NUMBER do a simple check on the file system"
+msgstr ""
+"controllo NUMBER effettua un semplice controllo del file system"
+
+#: parted/parted.c:1905
+msgid "cp"
+msgstr "cp"
+
+#: parted/parted.c:1908
+msgid ""
+"cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another "
+"partition"
+msgstr ""
+"cp [DEVICE-INIZIALE] NUMBER-INIZIALE NUMBER-FINALE copia un file system in "
+"un'altra partizione"
+
+#: parted/parted.c:1914
+msgid "help"
+msgstr "help"
+
+#: parted/parted.c:1917
+msgid ""
+"help [COMMAND] prints general help, or help on "
+"COMMAND"
+msgstr "help [COMANDO] mostra l'aiuto generico o su COMANDO"
+
+#: parted/parted.c:1923
+msgid "mklabel"
+msgstr "mklabel"
+
+#: parted/parted.c:1926
+msgid ""
+"mklabel LABEL-TYPE create a new disklabel (partition "
+"table)"
+msgstr ""
+"mklabel TIPO-ETICHETTA crea una nuova etichetta disco (tabella delle "
+"partizioni)"
+
+#: parted/parted.c:1932
+msgid "mkfs"
+msgstr "mkfs"
+
+#: parted/parted.c:1935
+msgid ""
+"mkfs NUMBER FS-TYPE make a FS-TYPE file system on "
+"partititon NUMBER"
+msgstr ""
+"mkfs NUMBER TIPO-FS crea un file system TIPO-FS sulla partizione "
+"NUMBER"
+
+#: parted/parted.c:1941
+msgid "mkpart"
+msgstr "mkpart"
+
+#: parted/parted.c:1944
+msgid "mkpart PART-TYPE [FS-TYPE] START END make a partition"
+msgstr "mkpart TIPO_PART [TIPO-FS] INIZIO FILE crea una partizione"
+
+#: parted/parted.c:1950
+msgid ""
+"mkpart makes a partition without creating a new file system on the "
+"partition. FS-TYPE may be specified to set an appropriate partition ID.\n"
+msgstr ""
+"mkpart crea un partizione senza crearci un file system. Il TIPO-FS può "
+"essere specificato per creare un ID della partizione appropriato.\n"
+
+#: parted/parted.c:1955
+msgid "mkpartfs"
+msgstr "mkpartfs"
+
+#: parted/parted.c:1958
+msgid ""
+"mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system"
+msgstr ""
+"mkpartfs TIPO_PART TIPO_FS INIZIO FINE crea una partizione e il file system"
+
+#: parted/parted.c:1964
+msgid "move"
+msgstr "move"
+
+#: parted/parted.c:1967
+msgid "move NUMBER START END move partition NUMBER"
+msgstr "move NUMBER START END sposta la partizione NUMBER"
+
+#: parted/parted.c:1972
+msgid "name"
+msgstr "name"
+
+#: parted/parted.c:1975
+msgid "name NUMBER NAME name partition NUMBER as NAME"
+msgstr "name NUMBER NOME chiama la partizione NUMBER \"NOME\""
+
+#: parted/parted.c:1980
+msgid "print"
+msgstr "print"
+
+#: parted/parted.c:1983
+msgid ""
+"print [free|NUMBER|all] display the partition table, a "
+"partition, or all devices"
+msgstr ""
+"print [free|NUMBER|all] mostra la tabella delle partizioni, "
+"una partizione o tutti i device"
+
+#: parted/parted.c:1987
+msgid ""
+"Without arguments, print displays the entire partition table. With 'free'\n"
+"argument, information about free space will be displayed otherwise if a\n"
+"partition number is given, then more detailed information is displayed\n"
+"about that partition. If the 'all' argument is passed instead, partition\n"
+"information for all devices will be displayed."
+msgstr ""
+"Senza argomenti «print» mostra tutta la tabella delle partizioni. Con\n"
+"l'argomento «free» mostra le informazioni sullo spazio disponibile,\n"
+"altrimenti se viene specificato un numero di partizione allora sono\n"
+"mostrate informazioni dettagliate sulla partizione.Se viene passato\n"
+"l'argomento «all» vengono mostrate le informazioni per tutti i device."
+
+#: parted/parted.c:1995
+msgid "quit"
+msgstr "quit"
+
+#: parted/parted.c:1998
+msgid "quit exit program"
+msgstr "quit termina il programma"
+
+#: parted/parted.c:2003
+msgid "rescue"
+msgstr "rescue"
+
+#: parted/parted.c:2006
+msgid ""
+"rescue START END rescue a lost partition near START "
+"and END"
+msgstr ""
+"rescue INIZIO FINE ripristina una partizione persa vicino a "
+"INIZIO e FINE"
+
+#: parted/parted.c:2012
+msgid "resize"
+msgstr "resize"
+
+#: parted/parted.c:2015
+msgid ""
+"resize NUMBER START END resize partition NUMBER and its "
+"file system"
+msgstr ""
+"resize NUMBER START END ridimensiona la partizione NUMBER e il file "
+"system"
+
+#: parted/parted.c:2023
+msgid "rm"
+msgstr "rm"
+
+#: parted/parted.c:2026
+msgid "rm NUMBER delete partition NUMBER"
+msgstr "rm NUMBER cancella la partizione NUMERO"
+
+#: parted/parted.c:2031
+msgid "select"
+msgstr "select"
+
+#: parted/parted.c:2034
+msgid "select DEVICE choose the device to edit"
+msgstr ""
+"select DISPOSITIVO sceglie su quale dispositivo operare"
+
+#: parted/parted.c:2039
+msgid "set"
+msgstr "set"
+
+#: parted/parted.c:2042
+msgid ""
+"set NUMBER FLAG STATE change the FLAG on partition NUMBER"
+msgstr "set NUMBER FLAG STATO cambia un flag nella partizione NUMBER"
+
+#: parted/parted.c:2048
+msgid "toggle"
+msgstr "toggle"
+
+#: parted/parted.c:2051
+msgid ""
+"toggle [NUMBER [FLAG]] toggle the state of FLAG on "
+"partition NUMBER"
+msgstr ""
+"toggle [NUMBER [FLAG]] inverte lo stato del FLAG sulla "
+"partitione NUMBER"
+
+#: parted/parted.c:2057
+msgid "unit"
+msgstr "unit"
+
+#: parted/parted.c:2060
+msgid "unit UNIT set the default unit to UNIT"
+msgstr "unit UNIT impostare l'unità predefinita a UNIT"
+
+#: parted/parted.c:2065
+msgid "version"
+msgstr "version"
+
+#: parted/parted.c:2068
+msgid ""
+"version displays the current version of GNU "
+"Parted and copyright information"
+msgstr ""
+"version mostra il copyright e le "
+"informazioni su GNU Parted"
+
+#: parted/parted.c:2072
+msgid ""
+"version displays copyright and version information corressponding to this "
+"copy of GNU Parted\n"
+msgstr ""
+"version·mostra il copyright e le informazioni sulla versione di questa copia "
+"di GNU·Parted\n"
+
+#: parted/parted.c:2158
+msgid "No device found"
+msgstr "Non è stato trovato alcun dispositivo"
+
+#: parted/parted.c:2222
+msgid "Don't forget to update /etc/fstab, if necessary.\n"
+msgstr "Non dimenticare di aggiornare /etc/fstab, se necessario.\n"
+
+#: parted/ui.c:68
+msgid "Welcome to GNU Parted! Type 'help' to view a list of commands.\n"
+msgstr ""
+"Benvenuto su GNU Parted! Digitare \"help\" per avere la lista dei comandi.\n"
+
+#: parted/ui.c:71
+msgid ""
+"Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]\n"
+"Apply COMMANDs with PARAMETERS to DEVICE. If no COMMAND(s) are given, run "
+"in\n"
+"interactive mode.\n"
+msgstr ""
+"Uso: parted [OPZIONI]... [DEVICE [COMANDO [PARAMETRI]...]...]\n"
+"Esegue COMANDO con i PARAMETRI sul DEVICE. Se non c'è alcun COMANDO\n"
+"parte in modalità interattiva.\n"
+
+#: parted/ui.c:76
+#, c-format
+msgid ""
+"\n"
+"\n"
+"You found a bug in GNU Parted! Here's what you have to do:\n"
+"\n"
+"Don't panic! The bug has most likely not affected any of your data.\n"
+"Help us to fix this bug by doing the following:\n"
+"\n"
+"Check whether the bug has already been fixed by checking\n"
+"the last version of GNU Parted that you can find at:\n"
+"\n"
+"\thttp://ftp.gnu.org/gnu/parted/\n"
+"\n"
+"Please check this version prior to bug reporting.\n"
+"\n"
+"If this has not been fixed yet or if you don't know how to check,\n"
+"please visit the GNU Parted website:\n"
+"\n"
+"\thttp://www.gnu.org/software/parted\n"
+"\n"
+"for further information.\n"
+"\n"
+"Your report should contain the version of this release (%s)\n"
+"along with the error message below, the output of\n"
+"\n"
+"\tparted DEVICE unit co print unit s print\n"
+"\n"
+"and additional information about your setup you consider important.\n"
+msgstr ""
+"\n"
+"\n"
+"Si è trovato un bug in GNU Parted! Ecco cosa fare:\n"
+"\n"
+"Non innervosirsi! Molto probabilmente il bug non ha rovinato i dati.\n"
+"Il modo per aiutarci a correggerlo è il seguente:\n"
+"\n"
+"Verificare che il bug non sia già stato corretto utilizzando\n"
+"la versione più recente di GNU Parted che si trova a:\n"
+"\n"
+"\thttp://ftp.gnu.org/gnu/parted/\n"
+"\n"
+"Usare questa versione prima di segnalre il bug.\n"
+"\n"
+"Se il problema non è ancora stato risolto o se non si sa come verificarlo,\n"
+"visitare il sito web di GNU Parted:\n"
+"\n"
+"\thttp://www.gnu.org/software/parted\n"
+"\n"
+"per ulteriori informazioni.\n"
+"\n"
+"La segnalazione deve contenere la versione di questo programma (%s)\n"
+"con il messaggio d'errore riportato sotto, l'output di\n"
+"\n"
+"\tparted DEVICE unit co print unit s print\n"
+"\n"
+"e ogni altra informazione sulla propria configurazione che si consideti "
+"importante.\n"
+
+#: parted/ui.c:230
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_MAPERR (Address not mapped to object)"
+msgstr ""
+"\n"
+"Errore: SEGV_MAPERR (Indirizzo non corrispondente ad un oggetto)"
+
+#: parted/ui.c:235
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_ACCERR (Invalid permissions for mapped object)"
+msgstr ""
+"\n"
+"Errore: SEGV_ACCERR (Permesso non valido per l'oggetto mappato)"
+
+#: parted/ui.c:240
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGSEGV signal was encountered."
+msgstr ""
+"\n"
+"Errore: Un segnale SIGSEGV generico."
+
+#: parted/ui.c:258
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTDIV (Integer: divide by zero)"
+msgstr ""
+"\n"
+"Errore: FPE_INTDIV (Intero: divisione per zero)"
+
+#: parted/ui.c:262
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTOVF (Integer: overflow)"
+msgstr ""
+"\n"
+"Errore: FPE_INTOVF (Intero: overflow)"
+
+#: parted/ui.c:266
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTDIV (Float: divide by zero)"
+msgstr ""
+"\n"
+"Errore: FPE_FLTDIV (Float: divisione per zero)"
+
+#: parted/ui.c:270
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTOVF (Float: overflow)"
+msgstr ""
+"\n"
+"Errore: FPE_FLTOVF (Float: overflow)"
+
+#: parted/ui.c:274
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTUND (Float: underflow)"
+msgstr ""
+"\n"
+"Errore: FPE_FLTUND (Float: underflow)"
+
+#: parted/ui.c:278
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTRES (Float: inexact result)"
+msgstr ""
+"\n"
+"Errore: FPE_FLTRES (Float: risultato inesatto)"
+
+#: parted/ui.c:282
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTINV (Float: invalid operation)"
+msgstr ""
+"\n"
+"Errore: FPE_FLTINV (Float: operazione non valida)"
+
+#: parted/ui.c:286
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTSUB (Float: subscript out of range)"
+msgstr ""
+"\n"
+"Errore: FPE_FLTSUB (Float: subscript out of range)"
+
+#: parted/ui.c:291
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGFPE signal was encountered."
+msgstr ""
+"\n"
+"Errore: Un generico segnale SIGFPE."
+
+#: parted/ui.c:310
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPC (Illegal Opcode)"
+msgstr ""
+"\n"
+"Errore: ILL_ILLOPC (Opcode non legale)"
+
+#: parted/ui.c:314
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPN (Illegal Operand)"
+msgstr ""
+"\n"
+"Errore: ILL_ILLOPN (Operand non legale)"
+
+#: parted/ui.c:318
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLADR (Illegal addressing mode)"
+msgstr ""
+"\n"
+"Errore: ILL_ILLADR (Modalità di indirizzamento non legale)"
+
+#: parted/ui.c:323
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLTRP (Illegal Trap)"
+msgstr ""
+"\n"
+"Errore: ILL_ILLTRP (Trap non legale)"
+
+#: parted/ui.c:327
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVOPC (Privileged Opcode)"
+msgstr ""
+"\n"
+"Errore: ILL_PRVOPC (Opcode privilegiato)"
+
+#: parted/ui.c:331
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVREG (Privileged Register)"
+msgstr ""
+"\n"
+"Errore: ILL_PRVREG (Registro privilegiato)"
+
+#: parted/ui.c:335
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_COPROC (Coprocessor Error)"
+msgstr ""
+"\n"
+"Errore: ILL_COPROC (Errore del coprocessore)"
+
+#: parted/ui.c:339
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_BADSTK (Internal Stack Error)"
+msgstr ""
+"\n"
+"Errore: ILL_BADSTK (Errore dello stack interno)"
+
+#: parted/ui.c:343
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGILL signal was encountered."
+msgstr ""
+"\n"
+"Errore: Un segnale SIGILL generico."
+
+#: parted/ui.c:828
+msgid "Expecting a partition number."
+msgstr "Fornire un numero di partizione."
+
+#: parted/ui.c:837
+msgid "Partition doesn't exist."
+msgstr "La partizione non esiste."
+
+#: parted/ui.c:857
+msgid "Expecting a file system type."
+msgstr "Fornire un tipo di file system."
+
+#: parted/ui.c:863
+#, c-format
+msgid "Unknown file system type \"%s\"."
+msgstr "Tipo \"%s\" di file system sconosciuto."
+
+#: parted/ui.c:883
+msgid "Expecting a disk label type."
+msgstr "Fornire un tipo di etichetta disco."
+
+#: parted/ui.c:977
+msgid "Can't create any more partitions."
+msgstr "Non è possibile creare altre partizioni."
+
+#: parted/ui.c:987
+msgid "Expecting a partition type."
+msgstr "Fornire un tipo di partizione."
+
+#: parted/ui.c:1115
+msgid "on"
+msgstr "on"
+
+#: parted/ui.c:1116
+msgid "off"
+msgstr "off"
+
+#: parted/ui.c:1227
+msgid "OPTIONs:"
+msgstr "OPZIONI:"
+
+#: parted/ui.c:1230
+msgid "COMMANDs:"
+msgstr "COMANDI:"
+
+#: parted/ui.c:1238
+#, c-format
+msgid "Using %s\n"
+msgstr "Uso %s\n"
diff --git a/po/ja.po b/po/ja.po
new file mode 100644
index 0000000..3b49945
--- /dev/null
+++ b/po/ja.po
@@ -0,0 +1,2415 @@
+# PartedΥåܸ
+# Copyright (C) 1999 Free Software Foundation, Inc.
+# Hiroshi Takekawa <sian@big.or.jp>, 1999-2006.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: parted 1.7.0rc1\n"
+"Report-Msgid-Bugs-To: bug-parted@gnu.org\n"
+"POT-Creation-Date: 2006-04-21 21:20+0200\n"
+"PO-Revision-Date: 2006-04-07 20:37+0900\n"
+"Last-Translator: Hiroshi Takekawa <sian@big.or.jp>\n"
+"Language-Team: Japanese <translation-team-ja@lists.sourceforge.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=EUC-JP\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: libparted/arch/linux.c:284
+#, c-format
+msgid "Could not stat device %s - %s."
+msgstr "ǥХ %s Ĵ٤ޤ: %s"
+
+#: libparted/arch/linux.c:390
+#, fuzzy, c-format
+msgid ""
+"Could not determine sector size for %s: %s.\n"
+"Using the default sector size (%lld)."
+msgstr ""
+"%s ΥǤޤ: %s\n"
+"ǥեȤΥ (%d) Ȥޤ"
+
+#: libparted/arch/linux.c:401
+#, fuzzy, c-format
+msgid ""
+"Device %s has a logical sector size of %lld. Not all parts of GNU Parted "
+"support this at the moment, and the working code is HIGHLY EXPERIMENTAL.\n"
+msgstr ""
+"%s %d ǤޤΤȤ GNU Parted Ƥεǽˤ"
+"ơΥ򥵥ݡȤƤ櫓ǤϤޤ\n"
+
+#: libparted/arch/linux.c:441
+#, c-format
+msgid "Unable to determine the size of %s (%s)."
+msgstr "%s ΥǤޤ(%s)"
+
+#: libparted/arch/linux.c:530
+#, c-format
+msgid "Could not get identity of device %s - %s"
+msgstr "ǥХ %s identity Ǥޤ: %s"
+
+#: libparted/arch/linux.c:539
+msgid "Generic IDE"
+msgstr "Ū IDE"
+
+#: libparted/arch/linux.c:556
+#, c-format
+msgid ""
+"Device %s has multiple (%d) logical sectors per physical sector.\n"
+"GNU Parted supports this EXPERIMENTALLY for some special disk label/file "
+"system combinations, e.g. GPT and ext2/3.\n"
+"Please consult the web site for up-to-date information."
+msgstr ""
+"ǥХ %s ˤϡʪĤˤĤʣ (%d) "
+"\n"
+"GNU Parted ϡΥǥ٥ȥե륷ƥȤ߹碌ˤĤ"
+"ơΤ褦ʾּ¸ŪˡץݡȤƤޤ㤨СGPT ext2/3 "
+"äȤ߹碌Ǥ\n"
+"ǿξ web Ȥ"
+
+#: libparted/arch/linux.c:726
+#, c-format
+msgid "Error initialising SCSI device %s - %s"
+msgstr "SCSI ǥХ %s ν˼Ԥޤ: %s"
+
+#: libparted/arch/linux.c:781
+#, c-format
+msgid ""
+"The device %s has zero length, and can't possibly store a file system or "
+"partition table. Perhaps you selected the wrong device?"
+msgstr ""
+"ǥХ %s Ĺ 0 ʤΤǡե륷ƥѡƥơ֥Ͽ"
+"Ǥޤ󡣥ǥХְäƤʤǧƤ"
+
+#: libparted/arch/linux.c:829
+msgid ""
+"Unable to determine geometry of file/device. You should not use Parted "
+"unless you REALLY know what you're doing!"
+msgstr ""
+"եޤϥǥХ geometry Ǥޤ󡣼ʬDz򤷤Ƥ뤫褯"
+"򤷤Ƥʤ Parted Ȥ٤ǤϤޤ"
+
+#: libparted/arch/linux.c:903
+msgid "DAC960 RAID controller"
+msgstr "DAC960 RAID ȥ"
+
+#: libparted/arch/linux.c:908
+msgid "Compaq Smart Array"
+msgstr "Compaq Smart Array"
+
+#: libparted/arch/linux.c:913
+msgid "ATARAID Controller"
+msgstr "ATA RAID ȥ"
+
+#: libparted/arch/linux.c:918
+msgid "I2O Controller"
+msgstr "I2O ȥ"
+
+#: libparted/arch/linux.c:923
+msgid "User-Mode Linux UBD"
+msgstr "User-Mode Linux UBD"
+
+#: libparted/arch/linux.c:933
+msgid "Unknown"
+msgstr ""
+
+#: libparted/arch/linux.c:940
+msgid "ped_device_new() Unsupported device type"
+msgstr "ped_device_new() ݡȤƤʤΥǥХǤ"
+
+#: libparted/arch/linux.c:1041 libparted/arch/gnu.c:264
+#, c-format
+msgid "Error opening %s: %s"
+msgstr "%s 򥪡ץ˥顼: %s"
+
+#: libparted/arch/linux.c:1052 libparted/arch/gnu.c:274
+#, c-format
+msgid "Unable to open %s read-write (%s). %s has been opened read-only."
+msgstr ""
+"%s ɤ߽񤭲ǽʾ֤˥ץǤޤ(%s)%s ɤ߹ߤΤ߲ǽʾ"
+"ǥץ󤵤ޤ"
+
+#: libparted/arch/linux.c:1160 libparted/arch/linux.c:1228
+#: libparted/arch/gnu.c:452 libparted/arch/gnu.c:550 libparted/arch/gnu.c:678
+#, c-format
+msgid "%s during read on %s"
+msgstr "%s: %s ɤ߹˥顼ȯޤ"
+
+#: libparted/arch/linux.c:1199
+#, c-format
+msgid "%s during seek for read on %s"
+msgstr "%s: %s ɤ߹Υǥ顼ȯޤ"
+
+#: libparted/arch/linux.c:1270 libparted/arch/linux.c:1355
+#: libparted/arch/linux.c:1413 libparted/arch/gnu.c:587
+#: libparted/arch/gnu.c:632 libparted/arch/gnu.c:709
+#, c-format
+msgid "%s during write on %s"
+msgstr "%s: %s ˽񤭤˥顼ȯޤ"
+
+#: libparted/arch/linux.c:1297 libparted/arch/gnu.c:512
+#, c-format
+msgid "Can't write to %s, because it is opened read-only."
+msgstr "ɤ߹ߤΤߤǽʤ褦˥ץ󤵤ƤΤǡ%s˽񤭤ޤ"
+
+#: libparted/arch/linux.c:1321
+#, c-format
+msgid "%s during seek for write on %s"
+msgstr "%s: %s ˽񤭤Υǥ顼ȯޤ"
+
+#: libparted/arch/linux.c:1798
+#, c-format
+msgid ""
+"Error informing the kernel about modifications to partition %s -- %s. This "
+"means Linux won't know about any changes you made to %s until you reboot -- "
+"so you shouldn't mount it or use it in any way before rebooting."
+msgstr ""
+"ѡƥ %s ѹ򥫡ͥݤ˥顼ȯޤ -- %s"
+"ͥ %s ФƤʤ줿ѹƵưޤǴΤޤΤǡΥѡ"
+"ƥ mount 褦Ȥꡢʤ餫򤹤٤ǤϤޤ"
+
+#: libparted/arch/linux.c:1879
+#, c-format
+msgid ""
+"The kernel was unable to re-read the partition table on %s (%s). This means "
+"Linux won't know anything about the modifications you made until you "
+"reboot. You should reboot your computer before doing anything with %s."
+msgstr ""
+"ͥ %s Υѡƥơ֥Ƥɤ߹ߤǤޤ(%s)"
+"ϺƵưޤ Linux ͥϤʤԤäѹΤƤʤȤ̣"
+"Ƥޤ%s ФƲ򤹤˥ԥ塼Ƶư٤Ǥ"
+
+#: libparted/arch/gnu.c:97
+#, c-format
+msgid "Unable to open %s."
+msgstr "%s 򳫤ޤ"
+
+#: libparted/arch/gnu.c:117
+msgid "Unable to probe store."
+msgstr "ǥХΥץ֤˼Ԥޤ"
+
+#: libparted/arch/gnu.c:355
+msgid ""
+"The partition table cannot be re-read. This means you need to reboot before "
+"mounting any modified partitions. You also need to reinstall your boot "
+"loader before you reboot (which may require mounting modified partitions). "
+"It is impossible do both things! So you'll need to boot off a rescue disk, "
+"and reinstall your boot loader from the rescue disk. Read section 4 of the "
+"Parted User documentation for more information."
+msgstr ""
+"ͥϥѡƥơ֥κɤ߹ߤǤޤǤΤǡѹ"
+"ѡƥ mount ˺ƵưɬפޤޤƵư"
+"˥֡ȥƥ󥹥ȡ뤹ɬפޤ(ΤȤϡѹѡ"
+"ƥ mount ɬפȤʤ뤫⤷ޤ)Ǥ⤽ξƱˤϤǤ"
+"ޤ! 쥹塼ǥȤäƥ֡Ȥơ֡ȥ򤤤ʤƤ"
+"ܤȤ Parted Υ桼ɥȤ4ϤɤǤ"
+
+#: libparted/arch/gnu.c:372
+#, c-format
+msgid ""
+"The partition table on %s cannot be re-read (%s). This means the Hurd knows "
+"nothing about any modifications you made. You should reboot your computer "
+"before doing anything with %s."
+msgstr ""
+"ͥ %s Υѡƥơ֥Ƥɤ߹ߤǤޤ(%s)"
+" Hurd ϤʤԤäѹΤƤʤȤ̣Ƥޤ%s Ф"
+"򤹤˥ԥ塼Ƶư٤Ǥ"
+
+#: libparted/arch/gnu.c:383 parted/parted.c:2215
+msgid ""
+"You should reinstall your boot loader before rebooting. Read section 4 of "
+"the Parted User documentation for more information."
+msgstr ""
+"Ƶư˥֡ȥ򤤤ʤ٤Ǥܺ٤ Parted 桼ɥ"
+"Ȥ4ϤɤǤ"
+
+#: libparted/arch/gnu.c:774
+#, c-format
+msgid "%s trying to sync %s to disk"
+msgstr "%s: %s Ʊ˥顼ȯޤ"
+
+#: libparted/disk.c:183
+#, c-format
+msgid "Unable to open %s - unrecognised disk label."
+msgstr "%s 򳫤ޤ󡣥ǥ٥뤬ǧǤޤ"
+
+#: libparted/disk.c:452
+#, c-format
+msgid ""
+"This libparted doesn't have write support for %s. Perhaps it was compiled "
+"read-only."
+msgstr ""
+"ѤƤ libparted %s ν񤭤ߤ򥵥ݡȤƤޤɤ߹Ѥ"
+"ѥ뤵ƤȻפޤ"
+
+#: libparted/disk.c:579
+#, c-format
+msgid "Partition %d is %s, but the file system is %s."
+msgstr "ѡƥ %d %s ǤΤˡե륷ƥ %s Ǥ"
+
+#: libparted/disk.c:1056
+#, c-format
+msgid "%s disk labels do not support extended partitions."
+msgstr "%s Υǥ٥ϳĥѡƥ򥵥ݡȤƤޤ"
+
+#: libparted/disk.c:1616
+#, c-format
+msgid "%s disk labels don't support logical or extended partitions."
+msgstr ""
+"%s Υǥ٥ѡƥĥѡƥ򥵥ݡȤƤޤ"
+""
+
+#: libparted/disk.c:1629
+msgid "Too many primary partitions."
+msgstr "ץ饤ޥѡƥ¿ޤ"
+
+#: libparted/disk.c:1638
+#, c-format
+msgid ""
+"Can't add a logical partition to %s, because there is no extended partition."
+msgstr "ĥѡƥ󤬤ʤΤǡѡƥ %s ˺ޤ"
+
+#: libparted/disk.c:1662
+#, c-format
+msgid "Can't have more than one extended partition on %s."
+msgstr "%s ˤ 1 Ĥĥѡƥޤ"
+
+#: libparted/disk.c:1672
+msgid "Can't have logical partitions outside of the extended partition."
+msgstr "ѡƥĥѡƥγˤϻƤޤ"
+
+#: libparted/disk.c:1697
+#, c-format
+msgid "Can't have a logical partition outside of the extended partition on %s."
+msgstr "%s γĥѡƥγѡƥϺޤ"
+
+#: libparted/disk.c:1707 libparted/disk.c:1761 libparted/disk.c:1927
+msgid "Can't have overlapping partitions."
+msgstr "ŤʤΤѡƥϻƤޤ"
+
+#: libparted/disk.c:1715
+msgid "Can't have a primary partition inside an extended partition."
+msgstr "ĥѡƥ˥ץ饤ޥѡƥϺޤ"
+
+#: libparted/disk.c:2123
+msgid "metadata"
+msgstr "᥿"
+
+#: libparted/disk.c:2125
+msgid "free"
+msgstr ""
+
+#: libparted/disk.c:2127 parted/ui.c:968 parted/ui.c:996
+msgid "extended"
+msgstr "ĥ"
+
+#: libparted/disk.c:2129 parted/ui.c:972 parted/ui.c:1000
+msgid "logical"
+msgstr ""
+
+#: libparted/disk.c:2131 parted/ui.c:964 parted/ui.c:992
+msgid "primary"
+msgstr "ץ饤ޥ"
+
+#: libparted/disk.c:2147
+msgid "boot"
+msgstr "boot"
+
+#: libparted/disk.c:2149
+msgid "root"
+msgstr "root"
+
+#: libparted/disk.c:2151
+msgid "swap"
+msgstr "swap"
+
+#: libparted/disk.c:2153
+msgid "hidden"
+msgstr "hidden"
+
+#: libparted/disk.c:2155
+msgid "raid"
+msgstr "raid"
+
+#: libparted/disk.c:2157
+msgid "lvm"
+msgstr "lvm"
+
+#: libparted/disk.c:2159
+msgid "lba"
+msgstr "lba"
+
+#: libparted/disk.c:2161
+msgid "hp-service"
+msgstr "hp-service"
+
+#: libparted/disk.c:2163
+msgid "palo"
+msgstr "palo"
+
+#: libparted/disk.c:2165
+msgid "prep"
+msgstr "prep"
+
+#: libparted/disk.c:2167
+msgid "msftres"
+msgstr "msftres"
+
+#: libparted/disk.c:2173
+#, c-format
+msgid "Unknown partition flag, %d."
+msgstr "%d ʥѡƥե饰Ǥ"
+
+#: libparted/labels/rdb.c:177
+#, c-format
+msgid "%s : Bad checksum on block %llu of type %s."
+msgstr "%s : ֥å %llu (type %s) ΥåबǤ"
+
+#: libparted/labels/rdb.c:510
+#, c-format
+msgid "%s : Didn't find rdb block, should never happen."
+msgstr ""
+"%s : rdb ֥åĤޤǤϤäƤϤʤʤȤǤ"
+
+#: libparted/labels/rdb.c:595
+#, c-format
+msgid "%s : Loop detected at block %d."
+msgstr "%s : ֥å %d ˥롼פȯޤ"
+
+#: libparted/labels/rdb.c:614
+#, c-format
+msgid "%s : The %s list seems bad at block %s."
+msgstr "%s : %s ꥹȤ褦Ǥ(֥å %s)"
+
+#: libparted/labels/rdb.c:703
+#, c-format
+msgid "%s : Failed to list bad blocks."
+msgstr "%s : ʥ֥åΰޤǤ"
+
+#: libparted/labels/rdb.c:711
+#, c-format
+msgid "%s : Failed to list partition blocks."
+msgstr "%s : ѡƥ֥åΰޤǤ"
+
+#: libparted/labels/rdb.c:719
+#, c-format
+msgid "%s : Failed to list file system blocks."
+msgstr "%s : ե륷ƥ֥åΰޤǤ"
+
+#: libparted/labels/rdb.c:727
+#, c-format
+msgid "%s : Failed to list boot blocks."
+msgstr "%s : ֡ȥ֥åΰޤǤ"
+
+#: libparted/labels/rdb.c:750
+#, c-format
+msgid "Failed to write partition block at %d."
+msgstr "ѡƥ֥å(֥å %d)ν񤭤ߤ˼Ԥޤ"
+
+#: libparted/labels/rdb.c:1053 libparted/labels/bsd.c:505
+#: libparted/labels/dos.c:1942 libparted/labels/dvh.c:772
+#: libparted/labels/gpt.c:1365 libparted/labels/loop.c:251
+#: libparted/labels/mac.c:1318 libparted/labels/pc98.c:764
+#: libparted/labels/sun.c:704
+msgid "Unable to satisfy all constraints on the partition."
+msgstr "ΥѡƥƤޤ"
+
+#: libparted/labels/rdb.c:1081
+msgid "Unable to allocate a partition number."
+msgstr "ѡƥֹƤޤ"
+
+#: libparted/labels/bsd.c:530
+msgid "Unable to allocate a bsd disklabel slot."
+msgstr "BSDǥ٥ΥåȤݤǤޤ"
+
+#: libparted/labels/dos.c:812
+#, c-format
+msgid "Invalid partition table on %s -- wrong signature %x."
+msgstr ""
+"%s Υѡƥơ֥뤬Ǥ%x ȤͥϤޤǤ"
+
+#: libparted/labels/dos.c:840
+#, c-format
+msgid "Invalid partition table - recursive partition on %s."
+msgstr ""
+"ѡƥơ֥뤬ǤƵŪʥѡƥ %s ˤޤ"
+
+#: libparted/labels/dos.c:1300
+msgid "Extended partitions cannot be hidden on msdos disk labels."
+msgstr "MSDOS ǥ٥dzĥѡƥϱޤ"
+
+#: libparted/labels/dos.c:1926
+msgid "Parted can't resize partitions managed by Windows Dynamic Disk."
+msgstr ""
+"ʥߥåǥ˻ȤƤѡƥ Parted ǤϥꥵǤ"
+""
+
+#: libparted/labels/dvh.c:192
+#, c-format
+msgid "%s has no extended partition (volume header partition)."
+msgstr ""
+"%s ϰĤĥѡƥʥܥ塼إåѡƥˤäƤޤ"
+""
+
+#: libparted/labels/dvh.c:315
+msgid "Checksum is wrong, indicating the partition table is corrupt."
+msgstr "åͤ㤤ޤѡƥơ֥뤬Ƥޤ"
+
+#: libparted/labels/dvh.c:616
+msgid "Only primary partitions can be root partitions."
+msgstr "ץ饤ޥѡƥ롼ȥѡƥˤʤޤ"
+
+#: libparted/labels/dvh.c:630
+msgid "Only primary partitions can be swap partitions."
+msgstr "ץ饤ޥѡƥåץѡƥˤʤޤ"
+
+#: libparted/labels/dvh.c:644
+msgid "Only logical partitions can be a boot file."
+msgstr "ѡƥ֡ȥեˤʤޤ"
+
+#: libparted/labels/dvh.c:723
+msgid "Only logical partitions (boot files) have a name."
+msgstr "˥ץ饤ޥѡƥϺޤ<"
+
+#: libparted/labels/dvh.c:814
+msgid "Too many primary partitions"
+msgstr "ץ饤ޥѡƥ¿ޤ"
+
+#: libparted/labels/gpt.c:433
+#, c-format
+msgid ""
+"%s contains GPT signatures, indicating that it has a GPT table. However, it "
+"does not have a valid fake msdos partition table, as it should. Perhaps it "
+"was corrupted -- possibly by a program that doesn't understand GPT partition "
+"tables. Or perhaps you deleted the GPT table, and are now using an msdos "
+"partition table. Is this a GPT partition table?"
+msgstr ""
+"%s GPT ơ֥¸ߤ򼨤 GPT ΥͥޤǤޤäƤ"
+" msdos ѡƥơ֥äƤޤ󡣤餯Ƥ"
+"ΤǤ礦GPT ѡƥơ֥򤷤ʤץबƤޤä"
+"Τ⤷ޤ󡣤뤤ϡGPT ơ֥򼫤äƤơmsdos ѡƥ"
+"ơ֥ȤäƤΤ⤷ޤ󡣤Υơ֥ GPT ѡƥơ"
+"֥Ǥ"
+
+#: libparted/labels/gpt.c:625
+#, c-format
+msgid ""
+"The format of the GPT partition table is version %x, which is newer than "
+"what Parted can recognise. Please tell us! bug-parted@gnu.org"
+msgstr ""
+"GPT ѡƥơ֥ΥեޥåȤΥС %x parted "
+"Τ꿷Ǥ bug-parted@gnu.org ޤ𤷤Ƥ"
+
+#: libparted/labels/gpt.c:747
+msgid ""
+"The backup GPT table is not at the end of the disk, as it should be. This "
+"might mean that another operating system believes the disk is smaller. Fix, "
+"by moving the backup to the end (and removing the old backup)?"
+msgstr ""
+"٤ GPT ơ֥ΥХååפǥκǸˤޤ¾ OS "
+"ǥϤäȾΤȻפäƤΤ⤷ޤ󡣥ХååפǸ"
+"˻äƤơʸŤХååפơ˽ޤ"
+
+#: libparted/labels/gpt.c:782
+msgid ""
+"The primary GPT table is corrupt, but the backup appears OK, so that will be "
+"used."
+msgstr ""
+"Υץ饤ޥ GPT ơ֥ϲƤޤХååפʤ褦ʤ"
+"ǡȤޤ"
+
+#: libparted/labels/gpt.c:790
+msgid ""
+"Both the primary and backup GPT tables are corrupt. Try making a fresh "
+"table, and using Parted's rescue feature to recover partitions."
+msgstr ""
+"ץ饤ޥ GPT ơ֥ȥХååפξƤޤ˥ơ֥"
+"ʤơParted νǽѤƥѡƥνߤޤ"
+
+#: libparted/labels/mac.c:167
+#, c-format
+msgid "Invalid signature %x for Mac disk labels."
+msgstr "Mac ǥ٥Υͥ %x Ǥ"
+
+#: libparted/labels/mac.c:212
+msgid "Partition map has no partition map entry!"
+msgstr "ѡƥޥåפ˥ȥ꤬ޤ"
+
+#: libparted/labels/mac.c:259
+#, c-format
+msgid "%s is too small for a Mac disk label!"
+msgstr "%s Mac ǥ٥ˤϾޤ"
+
+#: libparted/labels/mac.c:490
+#, c-format
+msgid "Partition %d has an invalid signature %x."
+msgstr "ѡƥ %d Υͥ %x Ǥ"
+
+#: libparted/labels/mac.c:508
+#, c-format
+msgid "Partition %d has an invalid length of 0 bytes!"
+msgstr "ѡƥ %d Ĺ 0 ʤΤǤ"
+
+#: libparted/labels/mac.c:536
+msgid "The data region doesn't start at the start of the partition."
+msgstr "ǡΰ褬ѡƥγϰ֤ϤޤäƤޤ"
+
+#: libparted/labels/mac.c:553
+msgid "The boot region doesn't start at the start of the partition."
+msgstr "֡ΰ褬ѡƥγϰ֤ϤޤäƤޤ"
+
+#: libparted/labels/mac.c:567
+msgid "The partition's boot region doesn't occupy the entire partition."
+msgstr "ѡƥΥ֡ΰ褬ѡƥΤͭƤޤ"
+
+#: libparted/labels/mac.c:577
+msgid "The partition's data region doesn't occupy the entire partition."
+msgstr "ѡƥΥǡΰ褬ѡƥΤͭƤޤ"
+
+#: libparted/labels/mac.c:631
+#, c-format
+msgid ""
+"Weird block size on device descriptor: %d bytes is not divisible by 512."
+msgstr ""
+"ǥХǥץ˽񤤤Ƥ֥åϤǤ%d ХȤ "
+"512 dzڤޤ"
+
+#: libparted/labels/mac.c:644
+#, c-format
+msgid ""
+"The driver descriptor says the physical block size is %d bytes, but Linux "
+"says it is %d bytes."
+msgstr ""
+"ɥ饤Фʪ֥å %d ХȤǤȸäƤޤLinux %d "
+"ХȤȸäƤޤ"
+
+#: libparted/labels/mac.c:692
+msgid "No valid partition map found."
+msgstr "ѡƥޥåפĤޤ"
+
+#: libparted/labels/mac.c:744
+#, c-format
+msgid ""
+"Conflicting partition map entry sizes! Entry 1 says it is %d, but entry %d "
+"says it is %d!"
+msgstr ""
+"ѡƥޥåפΥȥΥפޤ󡣥ȥ 1 ˤ %d "
+"Ǥȥ %d ˤ %d Ǥ"
+
+#: libparted/labels/mac.c:771
+msgid "Weird! There are 2 partitions map entries!"
+msgstr "Ǥѡƥޥåץȥ꤬2Ĥޤ"
+
+#: libparted/labels/mac.c:1257
+msgid ""
+"Changing the name of a root or swap partition will prevent Linux from "
+"recognising it as such."
+msgstr ""
+"root ˻ȤƤѡƥ swap ѡƥ̾ѹ "
+"Linux 򤽤ǧǤʤʤޤ"
+
+#: libparted/labels/mac.c:1353
+msgid "Can't add another partition -- the partition map is too small!"
+msgstr "ѡƥɲäǤޤ󡣥ѡƥޥåפޤ"
+
+#: libparted/labels/pc98.c:357
+#, c-format
+msgid "Invalid partition table on %s."
+msgstr "%s Υѡƥơ֥뤬Ǥ"
+
+#: libparted/labels/pc98.c:409 libparted/labels/pc98.c:487
+#, c-format
+msgid ""
+"Partition %d isn't aligned to cylinder boundaries. This is still "
+"unsupported."
+msgstr ""
+"ѡƥ %d ϥˤޤ󡣤ϤޤݡȤƤ"
+""
+
+#: libparted/labels/pc98.c:796
+msgid "Can't add another partition."
+msgstr "ѡƥɲäǤޤ"
+
+#: libparted/labels/sun.c:143
+msgid "Corrupted Sun disk label detected."
+msgstr "Sunǥ٥»򸡽Фޤ"
+
+#: libparted/labels/sun.c:264
+#, c-format
+msgid ""
+"The disk CHS geometry (%d,%d,%d) reported by the operating system does not "
+"match the geometry stored on the disk label (%d,%d,%d)."
+msgstr ""
+"ǥ geometry(CHS) (%d,%d,%d) ǥ٥Τ (%d,%d,%d) Ȱ"
+"פޤ"
+
+#: libparted/labels/sun.c:286
+#, c-format
+msgid "The disk label describes a disk bigger than %s."
+msgstr "ǥ٥ˤȡǥ %s 礭ȤˤʤäƤޤ"
+
+#: libparted/labels/sun.c:440
+#, c-format
+msgid "The disk has %d cylinders, which is greater than the maximum of 65536."
+msgstr ""
+"Υǥ %d ޤϺͤ 65536 ۤƤޤ"
+
+#: libparted/labels/sun.c:736
+msgid ""
+"The Whole Disk partition is the only available one left. Generally, it is "
+"not a good idea to overwrite this partition with a real one. Solaris may "
+"not be able to boot without it, and SILO (the sparc boot loader) appreciates "
+"it as well."
+msgstr ""
+"Whole Disk ѡƥ󤷤ĤƤޤ󡣤ξˤơΥѡ"
+"ƥ񤭤ΤϤ褯ޤSolaris ưʤʤ뤫⤷"
+"󤷡SILO(the sparc boot loader)ˤԹ礬褯ޤ"
+
+#: libparted/labels/sun.c:751
+msgid "Sun disk label is full."
+msgstr "Sunǥ٥뤬äѤǤ"
+
+#: libparted/filesys.c:386
+msgid "Could not detect file system."
+msgstr "ե륷ƥ򸡽ФǤޤ"
+
+#: libparted/filesys.c:397
+msgid "The file system is bigger than its volume!"
+msgstr "ե륷ƥबܥ塼礭Ǥ!"
+
+#: libparted/filesys.c:405
+#, c-format
+msgid "Support for opening %s file systems is not implemented yet."
+msgstr "ե륷ƥ(%s)Υץ̤Ǥ"
+
+#: libparted/filesys.c:447
+#, c-format
+msgid "Support for creating %s file systems is not implemented yet."
+msgstr "ե륷ƥ(%s)κ̤Ǥ"
+
+#: libparted/filesys.c:508
+#, c-format
+msgid "Support for checking %s file systems is not implemented yet."
+msgstr "ե륷ƥ(%s)Фå̤Ǥ"
+
+#: libparted/filesys.c:574
+msgid "raw block copying"
+msgstr "֥å򤽤Τޤޥԡ"
+
+#: libparted/filesys.c:585
+msgid "growing file system"
+msgstr "ե륷ƥ礭Ƥޤ"
+
+#: libparted/filesys.c:625
+msgid "Can't copy onto an overlapping partition."
+msgstr "ŤʤΤѡƥˤϥԡǤޤ"
+
+#: libparted/filesys.c:647
+#, c-format
+msgid ""
+"Direct support for copying file systems is not yet implemented for %s. "
+"However, support for resizing is implemented. Therefore, the file system "
+"can be copied if the new partition is at least as big as the old one. So, "
+"either shrink the partition you are trying to copy, or copy to a bigger "
+"partition."
+msgstr ""
+"%s Υե륷ƥΥԡľŪʼϤޤƤޤ󡣿ѡ"
+"ƥ󤬸ŤΤȾʤȤƱ餤礭ǤХԡǤޤꥵ"
+"ϼƤޤΤǡѡƥ򾮤Ƥ饳ԡƤߤ뤫"
+"ä礭ѡƥ˥ԡƤ"
+
+#: libparted/filesys.c:661
+#, c-format
+msgid "Support for copying %s file systems is not implemented yet."
+msgstr "ե륷ƥ(%s)Υԡ̤Ǥ"
+
+#: libparted/filesys.c:699
+#, c-format
+msgid "Support for resizing %s file systems is not implemented yet."
+msgstr "ե륷ƥ(%s)Υꥵ̤Ǥ"
+
+#: libparted/exception.c:78
+msgid "Information"
+msgstr ""
+
+#: libparted/exception.c:79
+msgid "Warning"
+msgstr "ٹ"
+
+#: libparted/exception.c:80
+msgid "Error"
+msgstr "顼"
+
+#: libparted/exception.c:81
+msgid "Fatal"
+msgstr "̿Ū顼"
+
+#: libparted/exception.c:82
+msgid "Bug"
+msgstr "Х"
+
+#: libparted/exception.c:83
+msgid "No Implementation"
+msgstr "̤"
+
+#: libparted/exception.c:87
+msgid "Fix"
+msgstr ""
+
+#: libparted/exception.c:88
+msgid "Yes"
+msgstr "Ϥ(Y)"
+
+#: libparted/exception.c:89
+msgid "No"
+msgstr "(N)"
+
+#: libparted/exception.c:90
+msgid "OK"
+msgstr "OK"
+
+#: libparted/exception.c:91
+msgid "Retry"
+msgstr "ʤ(R)"
+
+#: libparted/exception.c:92
+msgid "Ignore"
+msgstr "̵(I)"
+
+#: libparted/exception.c:93
+msgid "Cancel"
+msgstr "(C)"
+
+#: libparted/exception.c:133
+#, c-format
+msgid ""
+"A bug has been detected in GNU Parted. Refer to the web site of parted "
+"http://www.gnu.org/software/parted/parted.html for more informations of what "
+"could be useful for bug submitting! Please email a bug report to bug-"
+"parted@gnu.org containing at least the version (%s) and the following "
+"message: "
+msgstr ""
+"GNU parted ˥ХĤޤhttp://www.gnu.org/software/parted/parted."
+"html 򸫤ơХݡȤɬפʾƤbug-parted@gnu.org "
+"version(%s) ȰʲΥåޤƥ᡼äƤ: "
+
+#: libparted/cs/geom.c:162
+msgid "Can't have the end before the start!"
+msgstr "λ֤򳫻ϰ֤ۤưȤϤǤޤ"
+
+#: libparted/cs/geom.c:169
+msgid "Can't have a partition outside the disk!"
+msgstr "ǥγ¦˥ѡƥϺޤ"
+
+#: libparted/cs/geom.c:303
+#, c-format
+msgid "Attempt to read sectors %ld-%ld outside of partition on %s."
+msgstr "ɤ⤦Ȥ (%ld-%ld) %s Υѡƥγˤޤ"
+
+#: libparted/cs/geom.c:373
+#, c-format
+msgid "Attempt to write sectors %ld-%ld outside of partition on %s."
+msgstr ""
+"񤭹⤦Ȥ (%ld-%ld) %s Υѡƥγˤޤ"
+
+#: libparted/cs/geom.c:413 libparted/fs/linux_swap/linux_swap.c:353
+msgid "checking for bad blocks"
+msgstr "ɥ֥åå"
+
+#: libparted/libparted.c:286 libparted/libparted.c:306
+msgid "Out of memory."
+msgstr "­Ǥ"
+
+#: libparted/unit.c:139
+msgid "Cannot get unit size for special unit 'COMPACT'."
+msgstr "̤ñ̤Ǥ 'COMPACT' ñ̤Υޤ"
+
+#: libparted/unit.c:382
+#, c-format
+msgid "\"%s\" has invalid syntax for locations."
+msgstr "\"%s\" ˤϰ֤ˤĤƸ꤬ޤ"
+
+#: libparted/unit.c:390
+#, c-format
+msgid "The maximum head value is %d."
+msgstr "إåͤ %d Ǥ"
+
+#: libparted/unit.c:397
+#, c-format
+msgid "The maximum sector value is %d."
+msgstr "祻ͤ %d Ǥ"
+
+#: libparted/unit.c:409 libparted/unit.c:540
+#, c-format
+msgid "The location %s is outside of the device %s."
+msgstr "%s ϡǥХ %s γǤ"
+
+#: libparted/unit.c:522
+msgid "Invalid number."
+msgstr "ͤǤ"
+
+#: libparted/fs/ext2/ext2.c:87 libparted/fs/ext2/ext2.c:112
+msgid "Inconsistent group descriptors!"
+msgstr "롼׵һҤ̷⤬ޤ!"
+
+#: libparted/fs/ext2/ext2.c:91 libparted/fs/ext2/ext2.c:116
+msgid "File system full!"
+msgstr "ե륷ƥबäѤˤʤޤ!"
+
+#: libparted/fs/ext2/ext2.c:750
+msgid "Invalid superblock. Are you sure this is an ext2 file system?"
+msgstr "ѡ֥åǤΥե륷ƥ ext2 Ǥ"
+
+#: libparted/fs/ext2/ext2.c:764 libparted/fs/ext2/ext2_resize.c:597
+msgid "File system has errors! You should run e2fsck."
+msgstr "ե륷ƥ˥顼ޤ e2fsck ¹ԤƤ"
+
+#: libparted/fs/ext2/ext2.c:775
+msgid ""
+"File system was not cleanly unmounted! You should run e2fsck. Modifying an "
+"unclean file system could cause severe corruption."
+msgstr ""
+"꡼ unmount Ƥޤe2fsck ¹Ԥ٤Ǥ꡼ˤʤäƤ"
+"ʤե륷ƥؤѹ礭»ˤĤʤ꤫ͤޤ"
+
+#: libparted/fs/ext2/ext2.c:795
+msgid "File system has an incompatible feature enabled."
+msgstr "ե륷ƥϸߴΤʤǽͭˤʤäƤޤ"
+
+#: libparted/fs/ext2/ext2.c:806
+msgid "Error allocating buffer cache."
+msgstr "ХåեåݤƤ˥顼ȯޤ"
+
+#: libparted/fs/ext2/ext2.c:848
+msgid ""
+"A resize operation on this file system will use EXPERIMENTAL code that MAY "
+"CORRUPT it (although it hasn't done so yet).You should at least backup your "
+"data and run 'e2fsck -f' afterwards."
+msgstr ""
+"Υե륷ƥؤΥꥵϼ¸ŪʥɤˤäƹԤ졢ե륷"
+"ƥ˲Ƥޤ줬ޤʤޤȤϤޤ󤬡ˡ¡"
+"ХååפäƤԤꥵ 'e2fsck -f' ¹Ԥ٤Ǥ"
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:114
+msgid ""
+"Found an inode with a incorrect link count. Better go run e2fsck first!"
+msgstr ""
+"󥯤οʤinodeĤޤ e2fsck ¹Ԥ"
+"礦"
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:487
+msgid "Not enough free inodes!"
+msgstr "̤Ѥ inode ο­Ƥޤ"
+
+#: libparted/fs/ext2/ext2_resize.c:224
+msgid "File system is too full to remove a group!"
+msgstr "롼פˤ϶ΰ褬­ޤ"
+
+#: libparted/fs/ext2/ext2_resize.c:233
+msgid "File system has too many allocated inodes to remove a group!"
+msgstr "롼פˤ̤Ѥ inode ­ޤ"
+
+#: libparted/fs/ext2/ext2_resize.c:493
+msgid "adding groups"
+msgstr "롼פɲ"
+
+#: libparted/fs/ext2/ext2_resize.c:530
+#, c-format
+msgid "Your file system is too full to resize it to %i blocks. Sorry."
+msgstr "%i ֥å˥ꥵˤΰ褬­Ƥޤ"
+
+#: libparted/fs/ext2/ext2_resize.c:540
+#, c-format
+msgid ""
+"Your file system has too many occupied inodes to resize it to %i blocks. "
+"Sorry."
+msgstr "%i ֥å˥ꥵˤ inode ­Ƥޤ"
+
+#: libparted/fs/ext2/ext2_resize.c:554 libparted/fs/hfs/hfs.c:243
+#: libparted/fs/hfs/hfs.c:624
+msgid "shrinking"
+msgstr "̾"
+
+#: libparted/fs/ext2/ext2_resize.c:605
+msgid "File system was not cleanly unmounted! You should run e2fsck."
+msgstr ""
+"꡼ unmount ƤޤǤޤe2fsck ¹ԤƤ"
+
+#: libparted/fs/ext2/ext2_resize.c:614
+msgid ""
+"The file system has the 'dir_index' feature enabled. Parted can only resize "
+"the file system if it disables this feature. You can enable it later by "
+"running 'tune2fs -O dir_index DEVICE' and then 'e2fsck -fD DEVICE'."
+msgstr ""
+"Υե륷ƥ 'dir_index' ͭˤʤäƤޤ̵ˤʤ"
+" Parted ǤϥꥵǤޤ󡣰ö̵ˤƤ⼡Τ褦ˤ뤳Ȥǡͭ"
+"ˤǤޤ'tune2fs -O dir_index DEVICE' 'e2fsck -fD DEVICE'"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:198
+msgid "Cross-linked blocks found! Better go run e2fsck first!"
+msgstr ""
+"Cross-link Ƥ֥åߤĤޤ e2fsck ¹Ԥ"
+"礦"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:537
+#, c-format
+msgid "Block %i has no reference? Weird."
+msgstr "֥å %i ϲ⻲ȤƤޤ󡣤Ǥ"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:738
+#, c-format
+msgid "Block %i shouldn't have been marked!"
+msgstr "֥å %i ϥޡƤʤϤǤ"
+
+#: libparted/fs/ext2/interface.c:188
+msgid ""
+"The ext2 file system passed a basic check. For a more comprehensive check, "
+"use the e2fsck program."
+msgstr ""
+" ext2 ե륷ƥϴñʥåѥޤ˥å"
+"ˤ e2fsck ȤäƤ"
+
+#: libparted/fs/ext2/interface.c:205
+msgid "Sorry, can't move the start of ext2 partitions yet!"
+msgstr "ǰǤޤ ext2 ѡƥγϰ֤ϰưǤޤ"
+
+#: libparted/fs/ext2/ext2_buffer.c:82
+msgid "Couldn't flush buffer cache!"
+msgstr "ХåեåեåǤޤ"
+
+#: libparted/fs/ext2/ext2_mkfs.c:162
+msgid "writing per-group metadata"
+msgstr "롼Υ᥿"
+
+#: libparted/fs/ext2/ext2_mkfs.c:565
+msgid "File system too small for ext2."
+msgstr "ext2 ˤˤϥե륷ƥबޤ"
+
+#: libparted/fs/fat/calc.c:134
+#, c-format
+msgid ""
+"You need %s of free disk space to shrink this partition to this size. "
+"Currently, only %s is free."
+msgstr ""
+"Υѡƥ򤳤Υ˾ˤ %s ζɬפǤ( %s "
+"ޤ)"
+
+#: libparted/fs/fat/context.c:55
+#, c-format
+msgid ""
+"Cluster start delta = %d, which is not a multiple of the cluster size %d."
+msgstr ""
+"Cluster start delta = %d ϥ饹 %d ܿǤϤޤ"
+
+#: libparted/fs/fat/fat.c:312
+#, c-format
+msgid "Partition too big/small for a %s file system."
+msgstr ""
+"ѡƥ %s ե륷ƥˤϾ뤤礭ޤ"
+
+#: libparted/fs/fat/fat.c:478
+msgid ""
+"The FATs don't match. If you don't know what this means, then select "
+"cancel, run scandisk on the file system, and then come back."
+msgstr ""
+"FAT פޤ󡣤줬̣뤫狼ʤʤ顢(C) ǡ"
+"scandisk ¹ԤƤ顢ޤʤƤ"
+
+#: libparted/fs/fat/fat.c:518
+msgid "There are no possible configurations for this FAT type."
+msgstr " FAT פ˹礦 configuration ޤ"
+
+#: libparted/fs/fat/fat.c:530
+#, c-format
+msgid ""
+"File system doesn't have expected sizes for Windows to like it. Cluster "
+"size is %dk (%dk expected); number of clusters is %d (%d expected); size of "
+"FATs is %d sectors (%d expected)."
+msgstr ""
+"ե륷ƥΥ Windows δԤʥǤϤޤ󡣥饹"
+" %dk (ͽ %dk); 饹ο %d (ͽ %d); FAT Υ %d "
+"(ͽ %d)"
+
+#: libparted/fs/fat/fat.c:553
+#, c-format
+msgid ""
+"File system is reporting the free space as %d clusters, not %d clusters."
+msgstr ""
+"ե륷ƥζ̤ %d 饹 ǡ%d 饹ǤϤޤ"
+
+#: libparted/fs/fat/fat.c:878
+msgid ""
+"GNU Parted was miscompiled: the FAT boot sector should be 512 bytes. FAT "
+"support will be disabled."
+msgstr ""
+"GNU parted ȥѥ뤵ƤޤFAT Υ֡ȥ 512 Х"
+"ȤǤ٤ǤFAT ݡȤ̵ˤޤ"
+
+#: libparted/fs/fat/resize.c:158
+msgid ""
+"There's not enough room in the root directory for all of the files. Either "
+"cancel, or ignore to lose the files."
+msgstr ""
+"롼ȥǥ쥯ȥ˽ʬʶޤ󡣼(C) ե򼺤äƤ"
+"褱 ̵(I) Ǥ"
+
+#: libparted/fs/fat/resize.c:299
+msgid "Error writing to the root directory."
+msgstr "롼ȥǥ쥯ȥ˽񤭤˥顼ȯޤ"
+
+#: libparted/fs/fat/resize.c:484
+msgid "If you leave your file system as FAT16, then you will have no problems."
+msgstr "FAT16 ΤޤޤˤƤʤ顢⤢ޤ"
+
+#: libparted/fs/fat/resize.c:487
+msgid ""
+"If you convert to FAT16, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual)."
+msgstr ""
+"FAT16 Ѵ褦ȤƤơ MS Windows Υѡƥ˥"
+"ȡ뤵Ƥʤ顢MS Windows Υ֡ȥƥ󥹥ȡ뤷ʤФʤ"
+"ޤ󡣤⤷Τʤ顢Parted(뤤 distribution) Υޥ˥奢"
+"ɤǤ"
+
+#: libparted/fs/fat/resize.c:495
+msgid ""
+"If you leave your file system as FAT32, then you will not introduce any new "
+"problems."
+msgstr "FAT32 ΤޤޤˤƤʤ顢ޤ"
+
+#: libparted/fs/fat/resize.c:499
+msgid ""
+"If you convert to FAT32, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual). Also, "
+"converting to FAT32 will make the file system unreadable by MS DOS, MS "
+"Windows 95a, and MS Windows NT."
+msgstr ""
+"FAT32 Ѵ褦ȤƤơ MS Windows Υѡƥ˥"
+"ȡ뤵Ƥʤ顢MS Windows Υ֡ȥƥ󥹥ȡ뤷ʤФʤ"
+"ޤ󡣤⤷Τʤ顢Parted(뤤 distribution) Υޥ˥奢"
+"ɤǤFAT32 ѴȡMS-DOSMS Windows 95aMS Windows NT "
+"ɤʤʤޤ"
+
+#: libparted/fs/fat/resize.c:513
+#, c-format
+msgid "%s %s %s"
+msgstr "%s %s %s"
+
+#: libparted/fs/fat/resize.c:514
+msgid "Would you like to use FAT32?"
+msgstr "FAT32 ȤǤ"
+
+#: libparted/fs/fat/resize.c:541 libparted/fs/fat/resize.c:557
+#, c-format
+msgid "%s %s"
+msgstr "%s %s"
+
+#: libparted/fs/fat/resize.c:542
+msgid ""
+"The file system can only be resized to this size by converting to FAT16."
+msgstr "Υ˥ꥵˤ FAT16 ѴʤФʤޤ"
+
+#: libparted/fs/fat/resize.c:558
+msgid ""
+"The file system can only be resized to this size by converting to FAT32."
+msgstr "Υ˥ꥵˤ FAT32 ѴʤФʤޤ"
+
+#: libparted/fs/fat/resize.c:571
+msgid ""
+"GNU Parted cannot resize this partition to this size. We're working on it!"
+msgstr ""
+"GNU Parted ϤΥѡƥ򤳤Υ˥ꥵ뤳ȤϤǤޤ󡣤"
+"褦ϤƤޤ"
+
+#: libparted/fs/fat/bootsector.c:48 libparted/fs/fat/bootsector.c:55
+msgid "File system has an invalid signature for a FAT file system."
+msgstr ""
+"ե륷ƥΥͥ㤬 FAT ե륷ƥΤΤǤϤޤ"
+
+#: libparted/fs/fat/bootsector.c:62
+msgid "File system has an invalid sector size for a FAT file system."
+msgstr ""
+"ե륷ƥΥ FAT ե륷ƥΤΤǤϤޤ"
+
+#: libparted/fs/fat/bootsector.c:69
+msgid "File system has an invalid cluster size for a FAT file system."
+msgstr ""
+"ե륷ƥΥ饹 FAT ե륷ƥΤΤǤϤޤ"
+
+#: libparted/fs/fat/bootsector.c:76
+msgid ""
+"File system has an invalid number of reserved sectors for a FAT file system."
+msgstr ""
+"ե륷ƥͽ󥻥ο FAT ե륷ƥȤƤǤ"
+
+#: libparted/fs/fat/bootsector.c:83
+msgid "File system has an invalid number of FATs."
+msgstr "ե륷ƥ FAT οǤ"
+
+#: libparted/fs/fat/bootsector.c:138
+#, c-format
+msgid ""
+"This file system has a logical sector size of %d. GNU Parted is known not "
+"to work properly with sector sizes other than 512 bytes."
+msgstr ""
+"Υե륷ƥ %d Ǥ. 512 Х"
+"ʳǤ GNU Parted ϤޤưʤȤΤƤޤ"
+
+#: libparted/fs/fat/bootsector.c:163
+#, c-format
+msgid ""
+"The file system's CHS geometry is (%d, %d, %d), which is invalid. The "
+"partition table's CHS geometry is (%d, %d, %d). If you select Ignore, the "
+"file system's CHS geometry will be left unchanged. If you select Fix, the "
+"file system's CHS geometry will be set to match the partition table's CHS "
+"geometry."
+msgstr ""
+"Υե륷ƥ CHS geometry (%d, %d, %d) Ǥѡƥ"
+"ơ֥ CHS geometry (%d, %d, %d) Ǥ̵(I)٤Хե륷"
+" CHS geometry ϤΤޤޤˤʤޤ(F)٤Сե륷ƥ "
+"CHS geometry ϡѡƥ CHS geometry ȹ礦褦ޤ"
+
+#: libparted/fs/fat/bootsector.c:209
+msgid "FAT boot sector says logical sector size is 0. This is weird. "
+msgstr ""
+"FAT Υ֡ȥˤ 0 Ƚ񤫤ƤޤϤ"
+""
+
+#: libparted/fs/fat/bootsector.c:215
+msgid "FAT boot sector says there are no FAT tables. This is weird. "
+msgstr "FAT Υ֡ȥ FAT ơ֥뤬ޤ󡣤ϤǤ"
+
+#: libparted/fs/fat/bootsector.c:221
+msgid "FAT boot sector says clusters are 0 sectors. This is weird. "
+msgstr ""
+"FAT Υ֡ȥ˥饹 0 ǤȽ񤫤ƤޤϤ"
+"Ǥ"
+
+#: libparted/fs/fat/bootsector.c:231
+msgid "File system is FAT12, which is unsupported."
+msgstr "FAT12 ϥݡȤƤޤ"
+
+#: libparted/fs/fat/bootsector.c:407
+#, c-format
+msgid ""
+"The information sector has the wrong signature (%x). Select cancel for now, "
+"and send in a bug report. If you're desperate, it's probably safe to ignore."
+msgstr ""
+"information Υͥ(%x)ϤޤäƤޤ(C) ƥХݡ"
+"ȤäƤ⤷ɤʤäƤ⤤ΤǤ ̵(I) Ƥ⤤Ǥ"
+""
+
+#: libparted/fs/fat/count.c:149
+#, c-format
+msgid "Bad directory entry for %s: first cluster is the end of file marker."
+msgstr ""
+"%s Υǥ쥯ȥꥨȥ꤬ɤǤ: ǽΥ饹եνλɽ魯"
+"ޡˤʤäƤޤ"
+
+#: libparted/fs/fat/count.c:162
+#, c-format
+msgid ""
+"Bad FAT: unterminated chain for %s. You should run dosfsck or scandisk."
+msgstr ""
+"FAT ˤޤ꤬ޤ%s chain λޤdosfsck scandisk "
+"¹Ԥ٤Ǥ"
+
+#: libparted/fs/fat/count.c:171
+#, c-format
+msgid ""
+"Bad FAT: cluster %d outside file system in chain for %s. You should run "
+"dosfsck or scandisk."
+msgstr ""
+"FAT ˤޤ꤬ޤ饹 %d(%s chain)ϥե륷ƥγˤ"
+"ޤdosfsck scandisk ¹Ԥ٤Ǥ"
+
+#: libparted/fs/fat/count.c:181
+#, c-format
+msgid ""
+"Bad FAT: cluster %d is cross-linked for %s. You should run dosfsck or "
+"scandisk."
+msgstr ""
+"FATˤޤ꤬ޤ饹 %d(%s chain)cross-linkƤޤ"
+"dosfsckscandisk¹Ԥ٤Ǥ"
+
+#: libparted/fs/fat/count.c:200
+#, c-format
+msgid "%s is %dk, but it has %d clusters (%dk)."
+msgstr "%s %dk Ǥ%d 饹(%dk)ޤ"
+
+#: libparted/fs/fat/count.c:263
+#, c-format
+msgid ""
+"The file %s is marked as a system file. This means moving it could cause "
+"some programs to stop working."
+msgstr ""
+"ե %s ϥƥեǤΥեưƤޤưʤ"
+"ץबޤ"
+
+#: libparted/fs/fat/table.c:138
+#, c-format
+msgid ""
+"FAT %d media %x doesn't match the boot sector's media %x. You should "
+"probably run scandisk."
+msgstr ""
+"FAT %d media %x ϥ֡ȥmedia %x Ȱפޤscandisk ¹Ԥ"
+"Ǥ礦"
+
+#: libparted/fs/fat/table.c:268
+#, c-format
+msgid "fat_table_set: cluster %ld outside file system"
+msgstr "fat_table_set: 饹 %ld ϥե륷ƥγˤޤ"
+
+#: libparted/fs/fat/table.c:296
+#, c-format
+msgid "fat_table_get: cluster %ld outside file system"
+msgstr "fat_table_get: 饹 %ld ϥե륷ƥγˤޤ"
+
+#: libparted/fs/fat/table.c:334
+msgid "fat_table_alloc_cluster: no free clusters"
+msgstr "fat_table_alloc_cluster: 饹ޤ"
+
+#: libparted/fs/linux_swap/linux_swap.c:236
+#, c-format
+msgid "Unrecognised linux swap signature '%10s'."
+msgstr "Linux swap signature '%10s' ǧǤޤ"
+
+#: libparted/fs/linux_swap/linux_swap.c:312
+msgid "Too many bad pages."
+msgstr "ɥڡ¿ޤ"
+
+#: libparted/fs/hfs/advfs.c:123 libparted/fs/hfs/advfs_plus.c:125
+#: libparted/fs/hfs/reloc.c:416 libparted/fs/hfs/reloc.c:510
+#: libparted/fs/hfs/reloc_plus.c:541 libparted/fs/hfs/reloc_plus.c:660
+#: libparted/fs/hfs/reloc_plus.c:774
+msgid "The file system contains errors."
+msgstr "ե륷ƥ˥顼ޤ"
+
+#: libparted/fs/hfs/advfs_plus.c:290
+msgid "Bad blocks could not be read."
+msgstr "ʥ֥åɤޤǤ"
+
+#: libparted/fs/hfs/cache.c:139
+#, c-format
+msgid ""
+"Trying to register an extent starting at block 0x%X, but another one already "
+"exists at this position. You should check the file system!"
+msgstr ""
+"֥å 0x%X Ϥޤ extent Ͽ褦Ȥޤ¾ΤΤ"
+"ѡƥ¸ߤޤΥե륷ƥåƤ"
+
+#: libparted/fs/hfs/cache.c:216
+#, c-format
+msgid ""
+"Trying to move an extent from block Ox%X to block Ox%X, but another one "
+"already exists at this position. This should not happen!"
+msgstr ""
+"֥å 0x%X ֥å 0x%X extent ư褦Ȥޤ¾Τ"
+"ΤΥѡƥ¸ߤޤϤꤨޤ"
+
+#: libparted/fs/hfs/file.c:145
+#, c-format
+msgid "Could not update the extent cache for HFS file with CNID %X."
+msgstr "HFS ե(CNID %X) extent cache 򹹿ǤޤǤ"
+
+#: libparted/fs/hfs/file.c:182
+#, c-format
+msgid "Trying to read HFS file with CNID %X behind EOF."
+msgstr "EOF ۤ HFS ե(CNID %X)ɤ⤦Ȥޤ"
+
+#: libparted/fs/hfs/file.c:192 libparted/fs/hfs/file.c:222
+#, c-format
+msgid "Could not find sector %lli of HFS file with CNID %X."
+msgstr " %lli (HFS ե, CNID %X)Ĥޤ"
+
+#: libparted/fs/hfs/file.c:212
+#, c-format
+msgid "Trying to write HFS file with CNID %X behind EOF."
+msgstr "EOF ۤ HFS ե(CNID %X)˽񤭤⤦Ȥޤ"
+
+#: libparted/fs/hfs/file_plus.c:159
+#, c-format
+msgid "Could not update the extent cache for HFS+ file with CNID %X."
+msgstr "HFS+ ե(CNID %X) extent cache 򹹿ǤޤǤ"
+
+#: libparted/fs/hfs/file_plus.c:203
+#, c-format
+msgid "Trying to read HFS+ file with CNID %X behind EOF."
+msgstr "EOF ۤ HFS+ ե(CNID %X)ɤ⤦Ȥޤ"
+
+#: libparted/fs/hfs/file_plus.c:214 libparted/fs/hfs/file_plus.c:256
+#, c-format
+msgid "Could not find sector %lli of HFS+ file with CNID %X."
+msgstr " %lli (HFS+ ե, CNID %X)Ĥޤ"
+
+#: libparted/fs/hfs/file_plus.c:245
+#, c-format
+msgid "Trying to write HFS+ file with CNID %X behind EOF."
+msgstr "EOF ۤ HFS+ ե(CNID %X)˽񤭤⤦Ȥޤ"
+
+#: libparted/fs/hfs/hfs.c:225
+msgid "Sorry, HFS cannot be resized that way yet."
+msgstr "HFS ϤޤΤ褦˥ꥵǤޤ"
+
+#: libparted/fs/hfs/hfs.c:255 libparted/fs/hfs/hfs.c:636
+msgid "Data relocation has failed."
+msgstr "ǡκ֤˼Ԥޤ"
+
+#: libparted/fs/hfs/hfs.c:274
+msgid "Data relocation left some data in the end of the volume."
+msgstr "ǡκ֤򤷤ޤܥ塼κǸ˻Ĥäǡޤ"
+
+#: libparted/fs/hfs/hfs.c:313
+msgid "writing HFS Master Directory Block"
+msgstr "HFS ޥǥ쥯ȥ֥å񤭤Ǥޤ"
+
+#: libparted/fs/hfs/hfs.c:461
+msgid "No valid HFS[+X] signature has been found while opening."
+msgstr "ͭ HFS[+X] ͥ㤬Ĥޤ"
+
+#: libparted/fs/hfs/hfs.c:471
+#, c-format
+msgid "Version %d of HFS+ isn't supported."
+msgstr "HFS+ ΥС %d ϥݡȤƤޤ"
+
+#: libparted/fs/hfs/hfs.c:482
+#, c-format
+msgid "Version %d of HFSX isn't supported."
+msgstr "HFSX ΥС %d ϥݡȤƤޤ"
+
+#: libparted/fs/hfs/hfs.c:667
+msgid "Data relocation left some data at the end of the volume."
+msgstr "ǡκ֤򤷤ޤܥ塼κǸ˻Ĥäǡޤ"
+
+#: libparted/fs/hfs/hfs.c:715
+msgid "Error while writing the allocation file."
+msgstr "allocation file 񤭤˥顼ȯޤ"
+
+#: libparted/fs/hfs/hfs.c:730
+msgid "Error while writing the compatibility part of the allocation file."
+msgstr ""
+"allocation file compatibility part 񤭤˥顼ȯޤ"
+
+#: libparted/fs/hfs/hfs.c:745
+msgid "writing HFS+ Volume Header"
+msgstr "HFS+ ܥ塼إå񤭤Ǥ"
+
+#: libparted/fs/hfs/hfs.c:845
+msgid "An error occurred while looking for the mandatory bad blocks file."
+msgstr "֥åեõƤȤ˥顼ȯޤ"
+
+#: libparted/fs/hfs/hfs.c:899
+msgid ""
+"It seems there is an error in the HFS wrapper: the bad blocks file doesn't "
+"contain the embedded HFS+ volume."
+msgstr ""
+"HFS åѡ˥顼褦Ǥ֥åեˡembedded "
+"HFS+ ܥ塼बޤ"
+
+#: libparted/fs/hfs/hfs.c:930
+msgid "Sorry, HFS+ cannot be resized that way yet."
+msgstr "HFS ϤޤΤ褦˥ꥵǤޤ"
+
+#: libparted/fs/hfs/hfs.c:965
+msgid "shrinking embedded HFS+ volume"
+msgstr "embedded HFS+ ܥ塼̾Ƥޤ"
+
+#: libparted/fs/hfs/hfs.c:981
+msgid "Resizing the HFS+ volume has failed."
+msgstr "HFS+ ܥ塼Υꥵ˼Ԥޤ"
+
+#: libparted/fs/hfs/hfs.c:988
+msgid "shrinking HFS wrapper"
+msgstr "HFS åѡ̾Ƥޤ"
+
+#: libparted/fs/hfs/hfs.c:997
+msgid "Updating the HFS wrapper has failed."
+msgstr "HFS åѡι˼Ԥޤ"
+
+#: libparted/fs/hfs/hfs.c:1099 libparted/fs/hfs/hfs.c:1184
+#, c-format
+msgid ""
+"This is not a real %s check. This is going to extract special low level "
+"files for debugging purposes."
+msgstr ""
+" real %s check ǤϤޤspecial low level file ǥХåΤ"
+"˼Фޤ"
+
+#: libparted/fs/hfs/journal.c:156
+msgid "Bad block list header checksum."
+msgstr "֥åꥹȥإåΥåबǤ"
+
+#: libparted/fs/hfs/journal.c:169
+#, c-format
+msgid ""
+"Invalid size of a transaction block while replaying the journal (%i bytes)."
+msgstr ""
+"㡼ʥΥץ쥤˥ȥ󥶥֥åΥ (%i Х) "
+"ޤ"
+
+#: libparted/fs/hfs/journal.c:261
+msgid ""
+"Journal stored outside of the volume are not supported. Try to desactivate "
+"the journal and run Parted again."
+msgstr ""
+"㡼ʥ뤬̥ܥ塼ˤ HFS+ ϥݡȤƤޤ󡣥㡼ʥ̵"
+"ˤƤԤäƤ"
+
+#: libparted/fs/hfs/journal.c:272
+msgid "Journal offset or size is not multiple of the sector size."
+msgstr "㡼ʥΥեåȤܿǤϤޤ"
+
+#: libparted/fs/hfs/journal.c:290
+msgid "Incorrect magic values in the journal header."
+msgstr "㡼ʥإåΥޥåʥСǤ"
+
+#: libparted/fs/hfs/journal.c:299
+msgid "Journal size mismatch between journal info block and journal header."
+msgstr ""
+"㡼ʥ륵ˤĤơ㡼ʥ륤ե֥åȥ㡼ʥإåȤ"
+"礬ޤ"
+
+#: libparted/fs/hfs/journal.c:311
+msgid "Some header fields are not multiple of the sector size."
+msgstr "إåեɤ˥ܿˤʤäƤʤΤޤ"
+
+#: libparted/fs/hfs/journal.c:320
+msgid ""
+"The sector size stored in the journal is not 512 bytes. Parted only "
+"supports 512 bytes length sectors."
+msgstr ""
+"㡼ʥ뤬¸Ƥ륻Υ 512 ХȤǤϤޤParted "
+"Ǥ 512 ХȤΥݡȤƤޤ"
+
+#: libparted/fs/hfs/journal.c:332
+msgid "Bad journal checksum."
+msgstr "㡼ʥΥåबǤ"
+
+#: libparted/fs/hfs/journal.c:350
+msgid ""
+"The journal is not empty. Parted must replay the transactions before "
+"opening the file system. This will modify the file system."
+msgstr ""
+"㡼ʥ뤬ǤϤޤParted ϥե륷ƥ򥪡ץ󤹤˥ȥ"
+"󥶥Υץ쥤򤷤ʤФʤޤ󡣥ץ쥤ȥե륷ƥ"
+"ѹޤ"
+
+#: libparted/fs/hfs/journal.c:378
+msgid ""
+"The volume header or the master directory block has changed while replaying "
+"the journal. You should restart Parted."
+msgstr ""
+"ܥ塼إåޥǥ쥯ȥ֥å㡼ʥΥץ쥤ѹ"
+"ޤParted ƵưƤ"
+
+#: libparted/fs/hfs/probe.c:52
+#, c-format
+msgid ""
+"Parted can't use HFS file systems on disks with a sector size not equal to %"
+"d bytes."
+msgstr ""
+"Parted ϡ %d ХȤǤʤǥǤ HFS ե륷ƥ"
+"Ȥޤ"
+
+#: libparted/fs/hfs/reloc.c:153 libparted/fs/hfs/reloc_plus.c:157
+msgid "An extent has not been relocated."
+msgstr "extent Ϻ֤ޤǤ"
+
+#: libparted/fs/hfs/reloc.c:253 libparted/fs/hfs/reloc_plus.c:309
+msgid ""
+"A reference to an extent comes from a place it should not. You should check "
+"the file system!"
+msgstr ""
+"extent ؤλȤϤꤨʤȤʤƤޤե륷ƥ"
+"Ƥ"
+
+#: libparted/fs/hfs/reloc.c:383
+msgid "This HFS volume has no catalog file. This is very unusual!"
+msgstr ""
+" HFS ܥ塼ˤ catalog file ޤ󡣤Ϥޤꤢꤨʤ"
+"Ǥ"
+
+#: libparted/fs/hfs/reloc.c:477
+msgid "This HFS volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+" HFS ܥ塼ˤ extents overflow file ޤ󡣤ϤۤȤɤ"
+"ꤨʤȤǤ"
+
+#: libparted/fs/hfs/reloc.c:519 libparted/fs/hfs/reloc_plus.c:670
+msgid ""
+"The extents overflow file should not contain its own extents! You should "
+"check the file system."
+msgstr ""
+"extents overflow file ϼʬȤ extent ޤǤϤޤ󡣥ե륷"
+"ƥåƤ"
+
+#: libparted/fs/hfs/reloc.c:576 libparted/fs/hfs/reloc_plus.c:849
+msgid "Could not cache the file system in memory."
+msgstr "ե륷ƥ˥åǤޤ"
+
+#: libparted/fs/hfs/reloc.c:637 libparted/fs/hfs/reloc_plus.c:910
+msgid "Bad blocks list could not be loaded."
+msgstr "֥åե뤬ɤߤޤǤ"
+
+#: libparted/fs/hfs/reloc.c:651 libparted/fs/hfs/reloc_plus.c:926
+msgid "An error occurred during extent relocation."
+msgstr "extent κ˥顼ȯޤ"
+
+#: libparted/fs/hfs/reloc_plus.c:497
+msgid "This HFS+ volume has no catalog file. This is very unusual!"
+msgstr ""
+" HFS+ ܥ塼ˤ catalog file ޤ󡣤Ϥޤꤢꤨʤ"
+"ȤǤ"
+
+#: libparted/fs/hfs/reloc_plus.c:621
+msgid "This HFS+ volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+" HFS+ ܥ塼ˤ extents overflow file ޤ󡣤ϤۤȤɤ"
+"ꤨʤȤǤ"
+
+#: parted/parted.c:76
+msgid "displays this help message"
+msgstr "Υإפɽ"
+
+#: parted/parted.c:77
+msgid "where necessary, prompts for user intervention"
+msgstr "ɬפǤХץץȤƥ桼˲"
+
+#: parted/parted.c:78
+msgid "never prompts for user intervention"
+msgstr "桼˲ʤ"
+
+#: parted/parted.c:79
+msgid "displays the version"
+msgstr "Сɽ"
+
+#: parted/parted.c:87
+msgid ""
+"NUMBER is the partition number used by Linux. On MS-DOS disk labels, the "
+"primary partitions number from 1 to 4, logical partitions from 5 onwards.\n"
+msgstr ""
+"NUMBER Linux ͥˤäƥѡƥֹȤƻȤޤMS-DOS "
+"ǥ٥Ǥϡܥѡƥֹ 1 4 ޤǤǡѡƥ"
+" 5 ʹߤȤʤޤ\n"
+
+#: parted/parted.c:90
+msgid "LABEL-TYPE is one of: "
+msgstr "٥μϼΤӤޤ: "
+
+#: parted/parted.c:91
+msgid "FLAG is one of: "
+msgstr "ե饰ϼΤӤޤ: "
+
+#: parted/parted.c:92
+msgid "UNIT is one of: "
+msgstr "UNIT ϼΤӤޤ: "
+
+#: parted/parted.c:93
+msgid "PART-TYPE is one of: primary, logical, extended\n"
+msgstr ""
+"ѡƥμϼΤΤɤ줫Ȥʤޤ: ץ饤ޥꡢĥ\n"
+
+#: parted/parted.c:95
+msgid "FS-TYPE is one of: "
+msgstr "ե륷ƥμϼΤӤޤ: "
+
+#: parted/parted.c:96
+msgid ""
+"START and END are disk locations, such as 4GB or 10%. Negative values count "
+"from the end of the disk. For example, -1s specifies exactly the last "
+"sector.\n"
+msgstr ""
+"START END ϡǥΰ֤ 4G 10% ʤɤɽ路ޤͤϥǥ"
+"ν꤫ͤˤʤޤ㤨С-1s ϡǸΥؤޤ\n"
+
+#: parted/parted.c:99
+msgid "STATE is one of: on, off\n"
+msgstr "֤ on off Τɤ餫\n"
+
+#: parted/parted.c:100
+msgid "DEVICE is usually /dev/hda or /dev/sda\n"
+msgstr "ǥХϤƤ /dev/hda /dev/sda Ǥ\n"
+
+#: parted/parted.c:101
+msgid "NAME is any word you want\n"
+msgstr "̾ʬǤդñ\n"
+
+#: parted/parted.c:102
+msgid "The partition must have one of the following FS-TYPEs: "
+msgstr ""
+"ѡƥΥե륷ƥϰʲΤΤ줫ǤʤФʤޤ: "
+
+#: parted/parted.c:105
+msgid "GNU Parted Version information:\n"
+msgstr "GNU Parted С:\n"
+
+#: parted/parted.c:107
+msgid ""
+"Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n"
+"This program is free software, covered by the GNU General Public License.\n"
+"\n"
+"This program is distributed in the hope that it will be useful, but WITHOUT "
+"ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
+"FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
+"more details.\n"
+"\n"
+msgstr ""
+"Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n"
+"Υץ GPL ˴Ťե꡼եȥǤ\n"
+"ܸ˴ؤƤ Hiroshi Takekawa <sian@big.or.jp> ޤǤͤޤ\n"
+"\n"
+"ܥץͭѤȤϻפޤۤˤäƤϡԾڤŪŬ"
+"ˤĤƤΰۤݾڤޤơʤݾڤԤʤޤ󡣾ܺ٤ˤĤƤGNU "
+"̸ͭѵɤߤ\n"
+
+#: parted/parted.c:152
+#, c-format
+msgid "%0.f%%\t(time left %.2d:%.2d)"
+msgstr "%0.f%%\t(Ĥ %.2d:%.2d)"
+
+#: parted/parted.c:170
+#, c-format
+msgid ""
+"Partition %s is being used. You must unmount it before you modify it with "
+"Parted."
+msgstr ""
+"ѡƥ %s ϻǤParted  unmount Ƥ"
+
+#: parted/parted.c:187
+#, c-format
+msgid "Partition(s) on %s are being used."
+msgstr "%s Υѡƥ󤬻Ǥ"
+
+#: parted/parted.c:413 parted/parted.c:594 parted/parted.c:979
+#: parted/parted.c:1059 parted/parted.c:1586 parted/parted.c:1663
+#: parted/parted.c:1707
+msgid "Partition number?"
+msgstr "ѡƥֹ?"
+
+#: parted/parted.c:456
+msgid "Source device?"
+msgstr "žΥǥХ?"
+
+#: parted/parted.c:460
+msgid "Source partition number?"
+msgstr "žΥѡƥֹ?"
+
+#: parted/parted.c:465
+msgid "Can't copy an extended partition."
+msgstr "ĥѡƥϥԡǤޤ"
+
+#: parted/parted.c:471
+msgid "Destination partition number?"
+msgstr "žΥѡƥֹ?"
+
+#: parted/parted.c:564
+msgid "New disk label type?"
+msgstr "ǥ٥?"
+
+#: parted/parted.c:598
+msgid "File system?"
+msgstr "ե륷ƥ?"
+
+#: parted/parted.c:645 parted/parted.c:815
+msgid "Partition type?"
+msgstr "ѡƥμ?"
+
+#: parted/parted.c:652 parted/parted.c:822 parted/parted.c:1062
+msgid "Partition name?"
+msgstr "ѡƥ̾?"
+
+#: parted/parted.c:660 parted/parted.c:832
+msgid "File system type?"
+msgstr "ե륷ƥμ?"
+
+#: parted/parted.c:667 parted/parted.c:834 parted/parted.c:994
+#: parted/parted.c:1544 parted/parted.c:1595
+msgid "Start?"
+msgstr "?"
+
+#: parted/parted.c:669 parted/parted.c:837 parted/parted.c:997
+#: parted/parted.c:1546 parted/parted.c:1597
+msgid "End?"
+msgstr "λ?"
+
+#: parted/parted.c:707 parted/parted.c:875
+#, c-format
+msgid ""
+"You requested a partition from %s to %s.\n"
+"The closest location we can manage is %s to %s. Is this still acceptable to "
+"you?"
+msgstr ""
+"%s %s ޤǤΥѡƥꤵޤ\n"
+"ǽǺǤᤤΤ %s %s ޤǤΥѡƥˤʤޤǤ"
+"ޤޤ󤫡"
+
+#: parted/parted.c:827
+msgid "An extended partition cannot hold a file system. Did you want mkpart?"
+msgstr ""
+"ĥѡƥˤϥե륷ƥϺޤmkpart 򤷤ΤǤ"
+
+#: parted/parted.c:985
+msgid "Can't move an extended partition."
+msgstr "ĥѡƥϰưǤޤ"
+
+#: parted/parted.c:1014
+msgid "Can't move a partition onto itself. Try using resize, perhaps?"
+msgstr "ʬȤξˤϰưǤޤ󡣥ꥵ褦ȤƤΤǤ"
+
+#: parted/parted.c:1158
+#, c-format
+msgid "Minor: %d\n"
+msgstr "ޥʡ: %d\n"
+
+#: parted/parted.c:1159
+#, c-format
+msgid "Flags: %s\n"
+msgstr "ե饰: %s\n"
+
+#: parted/parted.c:1160
+#, c-format
+msgid "File System: %s\n"
+msgstr "ե륷ƥ: %s\n"
+
+#: parted/parted.c:1161
+#, c-format
+msgid "Size: "
+msgstr ": "
+
+#: parted/parted.c:1166
+#, c-format
+msgid "Minimum size: "
+msgstr "Ǿ: "
+
+#: parted/parted.c:1169
+#, c-format
+msgid "Maximum size: "
+msgstr "祵: "
+
+#: parted/parted.c:1255
+#, c-format
+msgid "Disk %s: %s\n"
+msgstr "ǥ %s: %s\n"
+
+#: parted/parted.c:1256
+#, c-format
+msgid "Sector size (logical/physical): %lldB/%lldB\n"
+msgstr " (/ʪ): %lldB/%lldB\n"
+
+#: parted/parted.c:1267
+#, c-format
+msgid "BIOS cylinder,head,sector geometry: %d,%d,%d. Each cylinder is %s.\n"
+msgstr "BIOS إåɡ geometry: %d,%d,%d. 1 %s\n"
+
+#: parted/parted.c:1273
+#, c-format
+msgid "Partition Table: %s\n"
+msgstr "ѡƥơ֥: %s\n"
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Number"
+msgstr "ֹ"
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Start"
+msgstr ""
+
+#: parted/parted.c:1285 parted/parted.c:1288
+msgid "End"
+msgstr "λ"
+
+#: parted/parted.c:1288
+msgid "Size"
+msgstr ""
+
+#: parted/parted.c:1292
+msgid "Type"
+msgstr ""
+
+#: parted/parted.c:1294
+msgid "File system"
+msgstr "ե륷ƥ"
+
+#: parted/parted.c:1297
+msgid "Name"
+msgstr "̾"
+
+#: parted/parted.c:1299
+msgid "Flags"
+msgstr "ե饰"
+
+#: parted/parted.c:1352
+msgid "Free Space"
+msgstr ""
+
+#: parted/parted.c:1441
+#, c-format
+msgid ""
+"A %s %s partition was found at %s -> %s. Do you want to add it to the "
+"partition table?"
+msgstr ""
+"%s %s ѡƥ %s %s ξȯޤΥѡƥ"
+"ѡƥơ֥ɲäޤ"
+
+#: parted/parted.c:1479
+msgid "searching for file systems"
+msgstr "ե륷ƥõƤޤ"
+
+#: parted/parted.c:1684
+msgid "New device?"
+msgstr "ǥХ?"
+
+#: parted/parted.c:1709
+msgid "Flag to Invert?"
+msgstr "ȿžե饰?"
+
+#: parted/parted.c:1714
+msgid "New state?"
+msgstr "?"
+
+#: parted/parted.c:1747
+msgid "Unit?"
+msgstr "ñ̤?"
+
+#: parted/parted.c:1896
+msgid "check"
+msgstr "check"
+
+#: parted/parted.c:1899
+msgid ""
+"check NUMBER do a simple check on the file system"
+msgstr "check NUMBER ե륷ƥδñʥå"
+
+#: parted/parted.c:1905
+msgid "cp"
+msgstr "cp"
+
+#: parted/parted.c:1908
+msgid ""
+"cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another "
+"partition"
+msgstr ""
+"cp [žǥХ] žNUMBER žNUMBER\n"
+"ե륷ƥ¾Υѡƥ˥ԡ"
+
+#: parted/parted.c:1914
+msgid "help"
+msgstr "help"
+
+#: parted/parted.c:1917
+msgid ""
+"help [COMMAND] prints general help, or help on "
+"COMMAND"
+msgstr ""
+"help [ޥ] إɽޥɻǤΥإפɽ"
+
+#: parted/parted.c:1923
+msgid "mklabel"
+msgstr "mklabel"
+
+#: parted/parted.c:1926
+msgid ""
+"mklabel LABEL-TYPE create a new disklabel (partition "
+"table)"
+msgstr ""
+"mklabel ٥μ ٥(ѡƥơ֥)"
+
+#: parted/parted.c:1932
+msgid "mkfs"
+msgstr "mkfs"
+
+#: parted/parted.c:1935
+msgid ""
+"mkfs NUMBER FS-TYPE make a FS-TYPE file system on "
+"partititon NUMBER"
+msgstr ""
+"mkfs NUMBER ե륷ƥμ\n"
+"ꤷΥե륷ƥ"
+
+#: parted/parted.c:1941
+msgid "mkpart"
+msgstr "mkpart"
+
+#: parted/parted.c:1944
+msgid "mkpart PART-TYPE [FS-TYPE] START END make a partition"
+msgstr ""
+"mkpart ѡƥμ [ե륷ƥμ] λ\n"
+"ѡƥ"
+
+#: parted/parted.c:1950
+msgid ""
+"mkpart makes a partition without creating a new file system on the "
+"partition. FS-TYPE may be specified to set an appropriate partition ID.\n"
+msgstr ""
+"mkpart ϥѡƥꡢե륷ƥϺޤ󡣥ե"
+"ƥμꤹȡIDꤵޤ\n"
+
+#: parted/parted.c:1955
+msgid "mkpartfs"
+msgstr "mkpartfs"
+
+#: parted/parted.c:1958
+msgid ""
+"mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system"
+msgstr ""
+"mkpartfs ѡƥμ ե륷ƥμ λ\n"
+"ѡƥȥե륷ƥ"
+
+#: parted/parted.c:1964
+msgid "move"
+msgstr "move"
+
+#: parted/parted.c:1967
+msgid "move NUMBER START END move partition NUMBER"
+msgstr "move NUMBER λ ѡƥư"
+
+#: parted/parted.c:1972
+msgid "name"
+msgstr "name"
+
+#: parted/parted.c:1975
+msgid "name NUMBER NAME name partition NUMBER as NAME"
+msgstr "name NUMBER ̾ ѡƥ̾Ĥ"
+
+#: parted/parted.c:1980
+msgid "print"
+msgstr "print"
+
+#: parted/parted.c:1983
+msgid ""
+"print [free|NUMBER|all] display the partition table, a "
+"partition, or all devices"
+msgstr "print [free|NUMBER|all] ѡƥơ֥ɽ"
+
+#: parted/parted.c:1987
+msgid ""
+"Without arguments, print displays the entire partition table. With 'free'\n"
+"argument, information about free space will be displayed otherwise if a\n"
+"partition number is given, then more detailed information is displayed\n"
+"about that partition. If the 'all' argument is passed instead, partition\n"
+"information for all devices will be displayed."
+msgstr ""
+"ʤξ硢print ϥѡƥơ֥Ƥɽޤ\n"
+"'free'ȤͿȡ̤ˤĤɽ졢\n"
+"ѡƥֹͿȡΥѡƥˤĤƤξܺ٤ɽ"
+"\n"
+"'all'ͿȡƤΥǥХˤĤƤΥѡƥɽޤ"
+
+#: parted/parted.c:1995
+msgid "quit"
+msgstr "quit"
+
+#: parted/parted.c:1998
+msgid "quit exit program"
+msgstr "quit ץλ"
+
+#: parted/parted.c:2003
+msgid "rescue"
+msgstr "rescue"
+
+#: parted/parted.c:2006
+msgid ""
+"rescue START END rescue a lost partition near START "
+"and END"
+msgstr ""
+"rescue λ ϡλǻꤷϰնˤѡƥ"
+"褵"
+
+#: parted/parted.c:2012
+msgid "resize"
+msgstr "resize"
+
+#: parted/parted.c:2015
+msgid ""
+"resize NUMBER START END resize partition NUMBER and its "
+"file system"
+msgstr ""
+"resize NUMBER λ ѡƥȤΥե륷ƥꥵ"
+""
+
+#: parted/parted.c:2023
+msgid "rm"
+msgstr "rm"
+
+#: parted/parted.c:2026
+msgid "rm NUMBER delete partition NUMBER"
+msgstr "rm NUMBER ѡƥ"
+
+#: parted/parted.c:2031
+msgid "select"
+msgstr "select"
+
+#: parted/parted.c:2034
+msgid "select DEVICE choose the device to edit"
+msgstr "select ǥХ ǥХ"
+
+#: parted/parted.c:2039
+msgid "set"
+msgstr "set"
+
+#: parted/parted.c:2042
+msgid ""
+"set NUMBER FLAG STATE change the FLAG on partition NUMBER"
+msgstr "set NUMBER ե饰 ե륷ƥΥե饰Ⱦ֤ꤹ"
+
+#: parted/parted.c:2048
+msgid "toggle"
+msgstr "toggle"
+
+#: parted/parted.c:2051
+msgid ""
+"toggle [NUMBER [FLAG]] toggle the state of FLAG on "
+"partition NUMBER"
+msgstr "toggle [NUMBER [FLAG]] ѡƥΥե饰ξ֤ȿž"
+
+#: parted/parted.c:2057
+msgid "unit"
+msgstr "unit"
+
+#: parted/parted.c:2060
+msgid "unit UNIT set the default unit to UNIT"
+msgstr "unit UNIT ǥեȤñ̤ UNIT ˤ"
+
+#: parted/parted.c:2065
+#, fuzzy
+msgid "version"
+msgstr "verion"
+
+#: parted/parted.c:2068
+msgid ""
+"version displays the current version of GNU "
+"Parted and copyright information"
+msgstr ""
+"version GNU Parted ΥСɽ"
+
+#: parted/parted.c:2072
+msgid ""
+"version displays copyright and version information corressponding to this "
+"copy of GNU Parted\n"
+msgstr ""
+"version ϡ¹ GNU Parted ΥСɽޤ\n"
+
+#: parted/parted.c:2158
+msgid "No device found"
+msgstr "ǥХߤĤޤ"
+
+#: parted/parted.c:2222
+msgid "Don't forget to update /etc/fstab, if necessary.\n"
+msgstr "ɬפǤ /etc/fstab 򹹿Τ˺ʤ褦ˤƤ\n"
+
+#: parted/ui.c:68
+msgid "Welcome to GNU Parted! Type 'help' to view a list of commands.\n"
+msgstr ""
+"GNU Parted ؤ褦 ޥɰ򸫤ˤ 'help' ϤƤ\n"
+
+#: parted/ui.c:71
+msgid ""
+"Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]\n"
+"Apply COMMANDs with PARAMETERS to DEVICE. If no COMMAND(s) are given, run "
+"in\n"
+"interactive mode.\n"
+msgstr ""
+"Ȥ: parted [ץ]... [ǥХ [ޥ [ѥ᡼]...]...]\n"
+"ǥХФƥѥ᡼˽äƥޥɤ¹Ԥޤ⤷ޥɤꤵ"
+"ʤСå⡼ɤޤ\n"
+
+#: parted/ui.c:76
+#, c-format
+msgid ""
+"\n"
+"\n"
+"You found a bug in GNU Parted! Here's what you have to do:\n"
+"\n"
+"Don't panic! The bug has most likely not affected any of your data.\n"
+"Help us to fix this bug by doing the following:\n"
+"\n"
+"Check whether the bug has already been fixed by checking\n"
+"the last version of GNU Parted that you can find at:\n"
+"\n"
+"\thttp://ftp.gnu.org/gnu/parted/\n"
+"\n"
+"Please check this version prior to bug reporting.\n"
+"\n"
+"If this has not been fixed yet or if you don't know how to check,\n"
+"please visit the GNU Parted website:\n"
+"\n"
+"\thttp://www.gnu.org/software/parted\n"
+"\n"
+"for further information.\n"
+"\n"
+"Your report should contain the version of this release (%s)\n"
+"along with the error message below, the output of\n"
+"\n"
+"\tparted DEVICE unit co print unit s print\n"
+"\n"
+"and additional information about your setup you consider important.\n"
+msgstr ""
+"\n"
+"\n"
+"GNU Parted ΥХȯޤ\n"
+"\n"
+"ѥ˥å򵯤ʤǤ ΥХϤ餯ǡˤϱƶޤ"
+"\n"
+"ΤȤ򤷤ƤΥХνˤϤ\n"
+"\n"
+"ΥȤ˺ǿС󤬤ޤ\n"
+"ˤΥХƤʤǧƤ\n"
+"\n"
+"\thttp://ftp.gnu.org/gnu/parted/\n"
+"\n"
+"ХݡȤ򤹤˺ǿСdzǧƤ\n"
+"\n"
+"ޤХƤʤǧλ狼ʤ硢\n"
+"GNU Parted web \n"
+"\n"
+"\thttp://www.gnu.org/software/parted\n"
+"\n"
+"򳫤ơܤĴ٤Ƥ\n"
+"\n"
+"ݡȤˤϡ Parted ΥС (%s) ȡ\n"
+"ɽƤ륨顼åΥޥ\n"
+"\n"
+"\tparted DEVICE unit co print unit s print\n"
+"\n"
+"νϤȡ¾פȻפ򵭽ҤƤ\n"
+
+#: parted/ui.c:230
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_MAPERR (Address not mapped to object)"
+msgstr ""
+"\n"
+"顼: SEGV_MAPERR (ɥ쥹֥ȤѴޤǤ)"
+
+#: parted/ui.c:235
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_ACCERR (Invalid permissions for mapped object)"
+msgstr ""
+"\n"
+"顼: SEGV_ACCERR (ޥåפ줿֥ȤΥѡߥåǤ)"
+
+#: parted/ui.c:240
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGSEGV signal was encountered."
+msgstr ""
+"\n"
+"顼: SIGSEGV ʥȤޤ"
+
+#: parted/ui.c:258
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTDIV (Integer: divide by zero)"
+msgstr ""
+"\n"
+"顼: FPE_INTDIV (: 0ˤ)"
+
+#: parted/ui.c:262
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTOVF (Integer: overflow)"
+msgstr ""
+"\n"
+"顼: FPE_INTOVF (: Сե)"
+
+#: parted/ui.c:266
+#, fuzzy, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTDIV (Float: divide by zero)"
+msgstr ""
+"\n"
+"顼: FPE_INTDIV (ư: 0ˤ)"
+
+#: parted/ui.c:270
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTOVF (Float: overflow)"
+msgstr ""
+"\n"
+"顼: FPE_FLTOVF (ư: Сե)"
+
+#: parted/ui.c:274
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTUND (Float: underflow)"
+msgstr ""
+"\n"
+"顼: FPE_FLTUND (ư: ե)"
+
+#: parted/ui.c:278
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTRES (Float: inexact result)"
+msgstr ""
+"\n"
+"顼: FPE_FLTRES (ư: ʤ)"
+
+#: parted/ui.c:282
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTINV (Float: invalid operation)"
+msgstr ""
+"\n"
+"\n"
+"顼: FPE_FLTINV (ư: )"
+
+#: parted/ui.c:286
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTSUB (Float: subscript out of range)"
+msgstr ""
+"\n"
+"顼: FPE_FLTSUB (ư: źϰϤۤޤ)"
+
+#: parted/ui.c:291
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGFPE signal was encountered."
+msgstr ""
+"\n"
+"顼: SIGFPE ʥȤޤ"
+
+#: parted/ui.c:310
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPC (Illegal Opcode)"
+msgstr ""
+"\n"
+"顼: ILL_ILLOPC (ʥڥ)"
+
+#: parted/ui.c:314
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPN (Illegal Operand)"
+msgstr ""
+"\n"
+"顼: ILL_ILLOPN (ʥڥ)"
+
+#: parted/ui.c:318
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLADR (Illegal addressing mode)"
+msgstr ""
+"\n"
+"顼: ILL_ILLADR (ʥɥ쥹⡼)"
+
+#: parted/ui.c:323
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLTRP (Illegal Trap)"
+msgstr ""
+"\n"
+"顼: ILL_ILLTRP (ʥȥå)"
+
+#: parted/ui.c:327
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVOPC (Privileged Opcode)"
+msgstr ""
+"\n"
+"顼: ILL_PRVOPC (øɬפʥڥ)"
+
+#: parted/ui.c:331
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVREG (Privileged Register)"
+msgstr ""
+"\n"
+"顼: ILL_PRVREG (øɬפʥ쥸)"
+
+#: parted/ui.c:335
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_COPROC (Coprocessor Error)"
+msgstr ""
+"\n"
+"顼: ILL_COPROC (ץå顼)"
+
+#: parted/ui.c:339
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_BADSTK (Internal Stack Error)"
+msgstr ""
+"\n"
+"顼: ILL_BADSTK (󥿡ʥ륹å顼)"
+
+#: parted/ui.c:343
+#, fuzzy, c-format
+msgid ""
+"\n"
+"Error: A general SIGILL signal was encountered."
+msgstr ""
+"\n"
+"顼: SIGILL ʥȤޤ"
+
+#: parted/ui.c:828
+msgid "Expecting a partition number."
+msgstr "ѡƥֹϤƤ"
+
+#: parted/ui.c:837
+msgid "Partition doesn't exist."
+msgstr "ѡƥ󤬤ޤ"
+
+#: parted/ui.c:857
+msgid "Expecting a file system type."
+msgstr "ե륷ƥμϤƤ"
+
+#: parted/ui.c:863
+#, c-format
+msgid "Unknown file system type \"%s\"."
+msgstr "ե륷ƥμ \"%s\" Ǥ"
+
+#: parted/ui.c:883
+msgid "Expecting a disk label type."
+msgstr "ǥ٥μϤƤ"
+
+#: parted/ui.c:977
+msgid "Can't create any more partitions."
+msgstr "ѡƥɲäǤޤ"
+
+#: parted/ui.c:987
+msgid "Expecting a partition type."
+msgstr "ѡƥμϤƤ"
+
+#: parted/ui.c:1115
+msgid "on"
+msgstr "on"
+
+#: parted/ui.c:1116
+msgid "off"
+msgstr "off"
+
+#: parted/ui.c:1227
+msgid "OPTIONs:"
+msgstr "ץ"
+
+#: parted/ui.c:1230
+msgid "COMMANDs:"
+msgstr "ޥ:"
+
+#: parted/ui.c:1238
+#, c-format
+msgid "Using %s\n"
+msgstr "%s \n"
diff --git a/po/nl.po b/po/nl.po
new file mode 100644
index 0000000..f109f6f
--- /dev/null
+++ b/po/nl.po
@@ -0,0 +1,2421 @@
+# Translation of parted-1.7.0rc1 to Dutch.
+# Copyright (C) 2000, 2005, 2006 Free Software Foundation, Inc.
+# Ivo Timmermans <ivo@o2w.nl>, 2000.
+# Benno Schulenberg <benno@nietvergeten.nl>, 2005, 2006.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: parted 1.7.0rc1\n"
+"Report-Msgid-Bugs-To: bug-parted@gnu.org\n"
+"POT-Creation-Date: 2006-04-21 21:20+0200\n"
+"PO-Revision-Date: 2006-04-06 22:58+0200\n"
+"Last-Translator: Benno Schulenberg <benno@nietvergeten.nl>\n"
+"Language-Team: Dutch <vertaling@vrijschrift.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.2\n"
+
+#: libparted/arch/linux.c:284
+#, c-format
+msgid "Could not stat device %s - %s."
+msgstr "Kan de status van apparaat %s niet opvragen -- %s."
+
+#: libparted/arch/linux.c:390
+#, fuzzy, c-format
+msgid ""
+"Could not determine sector size for %s: %s.\n"
+"Using the default sector size (%lld)."
+msgstr ""
+"Kan de sectorgrootte van %s niet bepalen: %s.\n"
+"De standaard sectorgrootte (%d) wordt gebruikt."
+
+#: libparted/arch/linux.c:401
+#, fuzzy, c-format
+msgid ""
+"Device %s has a logical sector size of %lld. Not all parts of GNU Parted "
+"support this at the moment, and the working code is HIGHLY EXPERIMENTAL.\n"
+msgstr ""
+"De logische sectorgrootte van %s is %d. Niet alle onderdelen van GNU Parted "
+"ondersteunen dit momenteel.\n"
+
+#: libparted/arch/linux.c:441
+#, c-format
+msgid "Unable to determine the size of %s (%s)."
+msgstr "Kan de grootte van %s niet achterhalen -- %s."
+
+#: libparted/arch/linux.c:530
+#, c-format
+msgid "Could not get identity of device %s - %s"
+msgstr "Kan de identiteit van apparaat %s niet achterhalen -- %s."
+
+#: libparted/arch/linux.c:539
+msgid "Generic IDE"
+msgstr "Gewone IDE"
+
+#: libparted/arch/linux.c:556
+#, c-format
+msgid ""
+"Device %s has multiple (%d) logical sectors per physical sector.\n"
+"GNU Parted supports this EXPERIMENTALLY for some special disk label/file "
+"system combinations, e.g. GPT and ext2/3.\n"
+"Please consult the web site for up-to-date information."
+msgstr ""
+"Apparaat %s bevat per fysieke sector meerdere (%d) logische sectoren.\n"
+"GNU Parted ondersteunt dit op EXPERIMENTELE basis voor sommige combinaties "
+"van schijflabel en bestandssysteem, bijvoorbeeld GPT met ext2/3.\n"
+"Zie de website van Parted voor de laatste informatie."
+
+#: libparted/arch/linux.c:726
+#, c-format
+msgid "Error initialising SCSI device %s - %s"
+msgstr "Fout tijdens initialiseren van SCSI-apparaat %s -- %s."
+
+#: libparted/arch/linux.c:781
+#, c-format
+msgid ""
+"The device %s has zero length, and can't possibly store a file system or "
+"partition table. Perhaps you selected the wrong device?"
+msgstr ""
+"Apparaat %s heeft lengte nul en kan met geen mogelijkheid een "
+"bestandssysteem of partitietabel bevatten. Heeft u misschien een verkeerd "
+"apparaat gekozen?"
+
+#: libparted/arch/linux.c:829
+msgid ""
+"Unable to determine geometry of file/device. You should not use Parted "
+"unless you REALLY know what you're doing!"
+msgstr ""
+"Kan de logische opbouw van het apparaat niet achterhalen. U kunt Parted "
+"beter niet gebruiken tenzij u ECHT weet wat u doet!"
+
+#: libparted/arch/linux.c:903
+msgid "DAC960 RAID controller"
+msgstr "DAC960 RAID-stuurapparaat"
+
+#: libparted/arch/linux.c:908
+msgid "Compaq Smart Array"
+msgstr "Compaq Smart Array-stuurapparaat"
+
+#: libparted/arch/linux.c:913
+msgid "ATARAID Controller"
+msgstr "ATARAID-stuurapparaat"
+
+#: libparted/arch/linux.c:918
+msgid "I2O Controller"
+msgstr "I2O-stuurapparaat"
+
+#: libparted/arch/linux.c:923
+msgid "User-Mode Linux UBD"
+msgstr "User-Mode Linux-blokapparaat (UBD)"
+
+#: libparted/arch/linux.c:933
+msgid "Unknown"
+msgstr "Onbekend"
+
+#: libparted/arch/linux.c:940
+msgid "ped_device_new() Unsupported device type"
+msgstr "Apparaattype wordt niet ondersteund."
+
+#: libparted/arch/linux.c:1041 libparted/arch/gnu.c:264
+#, c-format
+msgid "Error opening %s: %s"
+msgstr "Fout tijdens openen van %s: %s"
+
+#: libparted/arch/linux.c:1052 libparted/arch/gnu.c:274
+#, c-format
+msgid "Unable to open %s read-write (%s). %s has been opened read-only."
+msgstr ""
+"Kan %s niet openen voor lezen-en-schrijven (%s); %s is geopend voor alleen-"
+"lezen."
+
+#: libparted/arch/linux.c:1160 libparted/arch/linux.c:1228
+#: libparted/arch/gnu.c:452 libparted/arch/gnu.c:550 libparted/arch/gnu.c:678
+#, c-format
+msgid "%s during read on %s"
+msgstr "%s tijdens lezen van %s"
+
+#: libparted/arch/linux.c:1199
+#, c-format
+msgid "%s during seek for read on %s"
+msgstr "%s tijdens een 'seek' bij het lezen van %s"
+
+#: libparted/arch/linux.c:1270 libparted/arch/linux.c:1355
+#: libparted/arch/linux.c:1413 libparted/arch/gnu.c:587
+#: libparted/arch/gnu.c:632 libparted/arch/gnu.c:709
+#, c-format
+msgid "%s during write on %s"
+msgstr "%s tijdens schrijven naar %s"
+
+#: libparted/arch/linux.c:1297 libparted/arch/gnu.c:512
+#, c-format
+msgid "Can't write to %s, because it is opened read-only."
+msgstr "Kan niet naar %s schrijven, omdat het geopend is voor alleen-lezen."
+
+#: libparted/arch/linux.c:1321
+#, c-format
+msgid "%s during seek for write on %s"
+msgstr "%s tijdens een 'seek' bij het schrijven naar %s"
+
+#: libparted/arch/linux.c:1798
+#, c-format
+msgid ""
+"Error informing the kernel about modifications to partition %s -- %s. This "
+"means Linux won't know about any changes you made to %s until you reboot -- "
+"so you shouldn't mount it or use it in any way before rebooting."
+msgstr ""
+"Fout tijdens het inlichten van de kernel over de veranderingen aan partitie %"
+"s (%s). Dit betekent dat Linux geen weet heeft van de veranderingen die u "
+"net heeft gemaakt. U dient uw computer te herstarten alvorens iets met %s "
+"te doen."
+
+#: libparted/arch/linux.c:1879
+#, c-format
+msgid ""
+"The kernel was unable to re-read the partition table on %s (%s). This means "
+"Linux won't know anything about the modifications you made until you "
+"reboot. You should reboot your computer before doing anything with %s."
+msgstr ""
+"De kernel kan de partitietabel op %s niet herlezen (%s). Dit betekent dat "
+"Linux geen weet heeft van de veranderingen die u net heeft gemaakt. U dient "
+"uw computer te herstarten alvorens iets met %s te doen."
+
+#: libparted/arch/gnu.c:97
+#, c-format
+msgid "Unable to open %s."
+msgstr "Kan %s niet openen."
+
+#: libparted/arch/gnu.c:117
+msgid "Unable to probe store."
+msgstr "Kan de logische opbouw van het apparaat niet achterhalen."
+
+#: libparted/arch/gnu.c:355
+msgid ""
+"The partition table cannot be re-read. This means you need to reboot before "
+"mounting any modified partitions. You also need to reinstall your boot "
+"loader before you reboot (which may require mounting modified partitions). "
+"It is impossible do both things! So you'll need to boot off a rescue disk, "
+"and reinstall your boot loader from the rescue disk. Read section 4 of the "
+"Parted User documentation for more information."
+msgstr ""
+"De kernel kan de partitietabel niet herlezen. Dit betekent dat u uw "
+"computer moet herstarten alvorens veranderde partities te gebruiken. Maar "
+"voor het herstarten moet u ook uw opstartprogramma opnieuw installeren, wat "
+"mogelijk het aankoppelen van veranderde partitities vereist. De twee dingen "
+"zijn niet samen mogelijk! U zult dus van een reddingsdiskette of van een CD "
+"moeten herstarten, en vanaf daar uw opstartprogramma moeten herinstalleren. "
+"Lees eventueel sectie 4 van de Parted-gebruikersdocumentatie."
+
+#: libparted/arch/gnu.c:372
+#, c-format
+msgid ""
+"The partition table on %s cannot be re-read (%s). This means the Hurd knows "
+"nothing about any modifications you made. You should reboot your computer "
+"before doing anything with %s."
+msgstr ""
+"De kernel kan de partitietabel op %s niet herlezen (%s). Dit betekent dat "
+"de Hurd geen weet heeft van de veranderingen die u net heeft gemaakt. U "
+"dient uw computer te herstarten alvorens iets met %s te doen."
+
+#: libparted/arch/gnu.c:383 parted/parted.c:2215
+msgid ""
+"You should reinstall your boot loader before rebooting. Read section 4 of "
+"the Parted User documentation for more information."
+msgstr ""
+"Alvorens te herstarten dient u uw opstartprogramma opnieuw te installeren. "
+"Lees sectie 4 van de Parted-gebruikersdocumentatie voor meer informatie."
+
+#: libparted/arch/gnu.c:774
+#, c-format
+msgid "%s trying to sync %s to disk"
+msgstr "%s: bezig met synchroniseren van %s naar schijf"
+
+#: libparted/disk.c:183
+#, c-format
+msgid "Unable to open %s - unrecognised disk label."
+msgstr "Kan %s niet openen -- onbekend schijflabel."
+
+#: libparted/disk.c:452
+#, c-format
+msgid ""
+"This libparted doesn't have write support for %s. Perhaps it was compiled "
+"read-only."
+msgstr ""
+"Deze libparted kan niet naar %s schrijven. Mogelijk werd libparted voor "
+"alleen-lezen gecompileerd."
+
+#: libparted/disk.c:579
+#, c-format
+msgid "Partition %d is %s, but the file system is %s."
+msgstr "Partitie %d is %s, maar het bestandssysteem is %s."
+
+#: libparted/disk.c:1056
+#, c-format
+msgid "%s disk labels do not support extended partitions."
+msgstr "%s-schijflabels kennen geen uitgebreide partities."
+
+#: libparted/disk.c:1616
+#, c-format
+msgid "%s disk labels don't support logical or extended partitions."
+msgstr "%s-schijflabels kennen geen logische of uitgebreide partities."
+
+#: libparted/disk.c:1629
+msgid "Too many primary partitions."
+msgstr "Te veel primaire partities."
+
+#: libparted/disk.c:1638
+#, c-format
+msgid ""
+"Can't add a logical partition to %s, because there is no extended partition."
+msgstr ""
+"Kan geen logische partitie aan %s toevoegen, omdat er geen uitgebreide "
+"partitie is."
+
+#: libparted/disk.c:1662
+#, c-format
+msgid "Can't have more than one extended partition on %s."
+msgstr "Kan niet meer dan één uitgebreide partitie maken op %s."
+
+#: libparted/disk.c:1672
+msgid "Can't have logical partitions outside of the extended partition."
+msgstr "Kan geen logische partitie buiten de uitgebreide partitie maken."
+
+#: libparted/disk.c:1697
+#, c-format
+msgid "Can't have a logical partition outside of the extended partition on %s."
+msgstr "Kan geen logische partitie buiten de uitgebreide partitie op %s maken."
+
+#: libparted/disk.c:1707 libparted/disk.c:1761 libparted/disk.c:1927
+msgid "Can't have overlapping partitions."
+msgstr "Kan geen overlappende partities maken."
+
+#: libparted/disk.c:1715
+msgid "Can't have a primary partition inside an extended partition."
+msgstr "Kan geen primaire partitie binnen een uitgebreide partitie maken."
+
+#: libparted/disk.c:2123
+msgid "metadata"
+msgstr "metagegevens"
+
+#: libparted/disk.c:2125
+msgid "free"
+msgstr "vrij"
+
+#: libparted/disk.c:2127 parted/ui.c:968 parted/ui.c:996
+msgid "extended"
+msgstr "uitgebreid"
+
+#: libparted/disk.c:2129 parted/ui.c:972 parted/ui.c:1000
+msgid "logical"
+msgstr "logisch"
+
+#: libparted/disk.c:2131 parted/ui.c:964 parted/ui.c:992
+msgid "primary"
+msgstr "primair"
+
+#: libparted/disk.c:2147
+msgid "boot"
+msgstr "opstart"
+
+#: libparted/disk.c:2149
+msgid "root"
+msgstr "root"
+
+#: libparted/disk.c:2151
+msgid "swap"
+msgstr "swap"
+
+#: libparted/disk.c:2153
+msgid "hidden"
+msgstr "verborgen"
+
+#: libparted/disk.c:2155
+msgid "raid"
+msgstr "raid"
+
+#: libparted/disk.c:2157
+msgid "lvm"
+msgstr "lvm"
+
+#: libparted/disk.c:2159
+msgid "lba"
+msgstr "lba"
+
+#: libparted/disk.c:2161
+msgid "hp-service"
+msgstr "hp-service"
+
+#: libparted/disk.c:2163
+msgid "palo"
+msgstr "palo"
+
+#: libparted/disk.c:2165
+msgid "prep"
+msgstr "prep"
+
+#: libparted/disk.c:2167
+msgid "msftres"
+msgstr "msftres"
+
+#: libparted/disk.c:2173
+#, c-format
+msgid "Unknown partition flag, %d."
+msgstr "Onbekende partitievlag %d."
+
+#: libparted/labels/rdb.c:177
+#, c-format
+msgid "%s : Bad checksum on block %llu of type %s."
+msgstr "%s : Onjuiste controlesom op blok %llu van type %s."
+
+#: libparted/labels/rdb.c:510
+#, c-format
+msgid "%s : Didn't find rdb block, should never happen."
+msgstr "%s : Geen 'rdb'-blok gevonden -- zou nooit mogen gebeuren."
+
+#: libparted/labels/rdb.c:595
+#, c-format
+msgid "%s : Loop detected at block %d."
+msgstr "%s : Lus gedetecteerd bij blok %d."
+
+#: libparted/labels/rdb.c:614
+#, c-format
+msgid "%s : The %s list seems bad at block %s."
+msgstr "%s : De %s-lijst lijkt verkeerd te zijn bij blok %s."
+
+#: libparted/labels/rdb.c:703
+#, c-format
+msgid "%s : Failed to list bad blocks."
+msgstr "%s : Invullen van slechte blokken is mislukt."
+
+#: libparted/labels/rdb.c:711
+#, c-format
+msgid "%s : Failed to list partition blocks."
+msgstr "%s : Invullen van partitieblokken is mislukt."
+
+#: libparted/labels/rdb.c:719
+#, c-format
+msgid "%s : Failed to list file system blocks."
+msgstr "%s : Invullen van bestandssysteemblokken is mislukt."
+
+#: libparted/labels/rdb.c:727
+#, c-format
+msgid "%s : Failed to list boot blocks."
+msgstr "%s : Invullen van opstartblokken is mislukt."
+
+#: libparted/labels/rdb.c:750
+#, c-format
+msgid "Failed to write partition block at %d."
+msgstr "Schrijven van partitieblok %d is mislukt."
+
+#: libparted/labels/rdb.c:1053 libparted/labels/bsd.c:505
+#: libparted/labels/dos.c:1942 libparted/labels/dvh.c:772
+#: libparted/labels/gpt.c:1365 libparted/labels/loop.c:251
+#: libparted/labels/mac.c:1318 libparted/labels/pc98.c:764
+#: libparted/labels/sun.c:704
+msgid "Unable to satisfy all constraints on the partition."
+msgstr "Kan niet aan alle voorwaarden voor deze partitie voldoen."
+
+#: libparted/labels/rdb.c:1081
+msgid "Unable to allocate a partition number."
+msgstr "Geen partitienummer meer beschikbaar."
+
+#: libparted/labels/bsd.c:530
+msgid "Unable to allocate a bsd disklabel slot."
+msgstr "Kan in het BSD-schijflabel geen plekje meer reserveren."
+
+#: libparted/labels/dos.c:812
+#, c-format
+msgid "Invalid partition table on %s -- wrong signature %x."
+msgstr "Ongeldige partitietabel op %s -- onjuiste vingerafdruk %x."
+
+#: libparted/labels/dos.c:840
+#, c-format
+msgid "Invalid partition table - recursive partition on %s."
+msgstr "Ongeldige partitietabel -- recursieve partitie op %s."
+
+#: libparted/labels/dos.c:1300
+msgid "Extended partitions cannot be hidden on msdos disk labels."
+msgstr ""
+"Uitgebreide partities kunnen op MSDOS-schijflabels niet verborgen zijn."
+
+#: libparted/labels/dos.c:1926
+msgid "Parted can't resize partitions managed by Windows Dynamic Disk."
+msgstr ""
+"Parted kan partitities beheerd door Windows Dynamic Disk niet van grootte "
+"veranderen."
+
+#: libparted/labels/dvh.c:192
+#, c-format
+msgid "%s has no extended partition (volume header partition)."
+msgstr "%s bevat geen uitgebreide partitie (volumenkop-partitie)."
+
+#: libparted/labels/dvh.c:315
+msgid "Checksum is wrong, indicating the partition table is corrupt."
+msgstr "Onjuiste controlesom: de partitietabel is beschadigd."
+
+#: libparted/labels/dvh.c:616
+msgid "Only primary partitions can be root partitions."
+msgstr "Alleen een primaire partitie kan rootpartitie zijn."
+
+#: libparted/labels/dvh.c:630
+msgid "Only primary partitions can be swap partitions."
+msgstr "Alleen een primaire partitie kan swappartitie zijn."
+
+#: libparted/labels/dvh.c:644
+msgid "Only logical partitions can be a boot file."
+msgstr "Alleen een logische partitie kan een opstartbestand zijn."
+
+#: libparted/labels/dvh.c:723
+msgid "Only logical partitions (boot files) have a name."
+msgstr "Alleen logische partities (opstartbestanden) hebben een naam."
+
+#: libparted/labels/dvh.c:814
+msgid "Too many primary partitions"
+msgstr "Te veel primaire partities."
+
+#: libparted/labels/gpt.c:433
+#, c-format
+msgid ""
+"%s contains GPT signatures, indicating that it has a GPT table. However, it "
+"does not have a valid fake msdos partition table, as it should. Perhaps it "
+"was corrupted -- possibly by a program that doesn't understand GPT partition "
+"tables. Or perhaps you deleted the GPT table, and are now using an msdos "
+"partition table. Is this a GPT partition table?"
+msgstr ""
+"%s bevat GPT-vingerafdrukken, die aangeven dat het een GPT-tabel heeft. "
+"Maar het bevat geen geldige nep-MSDOS-partitietabel, zoals zou moeten. "
+"Misschien werd deze beschadigd, mogelijk door een programma dat GPT-"
+"partitietabellen niet begrijpt. Of misschien heeft u de GPT-tabel "
+"verwijderd en gebruikt nu een MSDOS-partitietabel. Is dit echt een GPT-"
+"partitietabel?"
+
+#: libparted/labels/gpt.c:625
+#, c-format
+msgid ""
+"The format of the GPT partition table is version %x, which is newer than "
+"what Parted can recognise. Please tell us! bug-parted@gnu.org"
+msgstr ""
+"De indeling van de GPT-partitietabel is van versie %x. Dit is nieuwer dan "
+"wat deze versie van Parted kent. Vertel het ons: <bug-parted@gnu.org>"
+
+#: libparted/labels/gpt.c:747
+msgid ""
+"The backup GPT table is not at the end of the disk, as it should be. This "
+"might mean that another operating system believes the disk is smaller. Fix, "
+"by moving the backup to the end (and removing the old backup)?"
+msgstr ""
+"De reservekopie van de GPT-tabel staat niet helemaal aan het einde van de "
+"schijf, zoals zou moeten. Dit zou kunnen betekenen dat een ander "
+"besturingssysteem aanneemt dat de schijf kleiner is dan hij is. Dit kan "
+"gerepareerd worden door de reservekopie naar het einde te verplaatsen en de "
+"oude reservekopie te verwijderen. Reparatie uitvoeren?"
+
+#: libparted/labels/gpt.c:782
+msgid ""
+"The primary GPT table is corrupt, but the backup appears OK, so that will be "
+"used."
+msgstr ""
+"De primaire GPT-tabel is beschadigd, maar de reservekopie lijkt goed. Deze "
+"laatste zal worden gebruikt."
+
+#: libparted/labels/gpt.c:790
+msgid ""
+"Both the primary and backup GPT tables are corrupt. Try making a fresh "
+"table, and using Parted's rescue feature to recover partitions."
+msgstr ""
+"Zowel de primaire GPT-tabel als de reservekopie zijn beschadigd. Maak eerst "
+"een nieuw schijflabel aan, en probeer dan met de 'red'-opdracht de "
+"kwijtgeraakte partities te herstellen."
+
+#: libparted/labels/mac.c:167
+#, c-format
+msgid "Invalid signature %x for Mac disk labels."
+msgstr "Ongeldige vingerafdruk %x voor een Mac-schijflabel."
+
+#: libparted/labels/mac.c:212
+msgid "Partition map has no partition map entry!"
+msgstr "Partitietabel bevat geen partitietabelitem!"
+
+#: libparted/labels/mac.c:259
+#, c-format
+msgid "%s is too small for a Mac disk label!"
+msgstr "%s is te klein voor een Mac-schijflabel!"
+
+#: libparted/labels/mac.c:490
+#, c-format
+msgid "Partition %d has an invalid signature %x."
+msgstr "Partitie %d heeft een ongeldige vingerafdruk %x."
+
+#: libparted/labels/mac.c:508
+#, c-format
+msgid "Partition %d has an invalid length of 0 bytes!"
+msgstr "Partitie %d heeft een ongeldige lengte van 0 bytes!"
+
+#: libparted/labels/mac.c:536
+msgid "The data region doesn't start at the start of the partition."
+msgstr "Het gegevensgebied begint niet bij het begin van de partitie."
+
+#: libparted/labels/mac.c:553
+msgid "The boot region doesn't start at the start of the partition."
+msgstr "Het opstartgebied begint niet bij het begin van de partitie."
+
+#: libparted/labels/mac.c:567
+msgid "The partition's boot region doesn't occupy the entire partition."
+msgstr "Het opstartgebied beslaat niet de gehele partitie."
+
+#: libparted/labels/mac.c:577
+msgid "The partition's data region doesn't occupy the entire partition."
+msgstr "Het gegevensgebied beslaat niet de gehele partitie."
+
+#: libparted/labels/mac.c:631
+#, c-format
+msgid ""
+"Weird block size on device descriptor: %d bytes is not divisible by 512."
+msgstr ""
+"Vreemde blokgrootte in apparaatbeschrijving: %d bytes is niet deelbaar door "
+"512."
+
+#: libparted/labels/mac.c:644
+#, c-format
+msgid ""
+"The driver descriptor says the physical block size is %d bytes, but Linux "
+"says it is %d bytes."
+msgstr ""
+"De beschrijving van het stuurprogramma zegt dat de fysieke blokgrootte %d "
+"bytes is, maar Linux zegt dat het %d bytes is."
+
+#: libparted/labels/mac.c:692
+msgid "No valid partition map found."
+msgstr "Geen geldige partitietabel gevonden."
+
+#: libparted/labels/mac.c:744
+#, c-format
+msgid ""
+"Conflicting partition map entry sizes! Entry 1 says it is %d, but entry %d "
+"says it is %d!"
+msgstr ""
+"Tegenstrijdige groottes van partitietabelitems! Item 1 zegt dat het %d is, "
+"maar item %d zegt dat het %d is!"
+
+#: libparted/labels/mac.c:771
+msgid "Weird! There are 2 partitions map entries!"
+msgstr "Vreemd: twee partitietabelitems!"
+
+#: libparted/labels/mac.c:1257
+msgid ""
+"Changing the name of a root or swap partition will prevent Linux from "
+"recognising it as such."
+msgstr ""
+"Het veranderen van de naam van een root- of swappartitie zal verhinderen dat "
+"Linux deze als zodanig herkent."
+
+#: libparted/labels/mac.c:1353
+msgid "Can't add another partition -- the partition map is too small!"
+msgstr ""
+"Kan geen nieuwe primaire partitie toevoegen: de partitietabel is te klein!"
+
+#: libparted/labels/pc98.c:357
+#, c-format
+msgid "Invalid partition table on %s."
+msgstr "Ongeldige partitietabel op %s."
+
+#: libparted/labels/pc98.c:409 libparted/labels/pc98.c:487
+#, c-format
+msgid ""
+"Partition %d isn't aligned to cylinder boundaries. This is still "
+"unsupported."
+msgstr ""
+"Partitie %d is niet uitgelijnd op cilindergrenzen. Dit wordt nog niet "
+"ondersteund."
+
+#: libparted/labels/pc98.c:796
+msgid "Can't add another partition."
+msgstr "Kan niet nog een partitie toevoegen."
+
+#: libparted/labels/sun.c:143
+msgid "Corrupted Sun disk label detected."
+msgstr "Beschadigd Sun-schijflabel gevonden."
+
+#: libparted/labels/sun.c:264
+#, c-format
+msgid ""
+"The disk CHS geometry (%d,%d,%d) reported by the operating system does not "
+"match the geometry stored on the disk label (%d,%d,%d)."
+msgstr ""
+"De logische schijfopbouw (%d,%d,%d) gerapporteerd door het besturingssysteem "
+"komt niet overeen met de opbouw (%d,%d,%d) opgeslagen in het schijflabel."
+
+#: libparted/labels/sun.c:286
+#, c-format
+msgid "The disk label describes a disk bigger than %s."
+msgstr "Het schijflabel beschrijft een schijf groter dan %s."
+
+#: libparted/labels/sun.c:440
+#, c-format
+msgid "The disk has %d cylinders, which is greater than the maximum of 65536."
+msgstr "De schijf heeft %d cilinders, wat groter is dan het maximum van 65536."
+
+#: libparted/labels/sun.c:736
+msgid ""
+"The Whole Disk partition is the only available one left. Generally, it is "
+"not a good idea to overwrite this partition with a real one. Solaris may "
+"not be able to boot without it, and SILO (the sparc boot loader) appreciates "
+"it as well."
+msgstr ""
+"De 'Hele-Schijf'-partitie is de enige die over is. In het algemeen is het "
+"geen goed idee om deze partitie met een echte te overschrijven. Solaris kan "
+"mogelijk niet zonder deze partitie starten, en SILO (het Sparc-"
+"opstartprogramma) waardeert de aanwezigheid ervan ook."
+
+#: libparted/labels/sun.c:751
+msgid "Sun disk label is full."
+msgstr "Sun-schijflabel is vol."
+
+#: libparted/filesys.c:386
+msgid "Could not detect file system."
+msgstr "Kan geen bestandssysteem vinden."
+
+#: libparted/filesys.c:397
+msgid "The file system is bigger than its volume!"
+msgstr "Het bestandssysteem is groter dan de partitie!"
+
+#: libparted/filesys.c:405
+#, c-format
+msgid "Support for opening %s file systems is not implemented yet."
+msgstr ""
+"Ondersteuning voor het openen van %s-bestandssystemen is nog niet "
+"geïmplementeerd."
+
+#: libparted/filesys.c:447
+#, c-format
+msgid "Support for creating %s file systems is not implemented yet."
+msgstr ""
+"Ondersteuning voor het maken van %s-bestandssystemen is nog niet "
+"geïmplementeerd."
+
+#: libparted/filesys.c:508
+#, c-format
+msgid "Support for checking %s file systems is not implemented yet."
+msgstr ""
+"Ondersteuning voor het controleren van %s-bestandssystemen is nog niet "
+"geïmplementeerd."
+
+#: libparted/filesys.c:574
+msgid "raw block copying"
+msgstr "bezig met kopiëren van blokken"
+
+#: libparted/filesys.c:585
+msgid "growing file system"
+msgstr "bezig met vergroten van bestandssysteem"
+
+#: libparted/filesys.c:625
+msgid "Can't copy onto an overlapping partition."
+msgstr "Kan niet naar een overlappende partitie kopiëren."
+
+#: libparted/filesys.c:647
+#, c-format
+msgid ""
+"Direct support for copying file systems is not yet implemented for %s. "
+"However, support for resizing is implemented. Therefore, the file system "
+"can be copied if the new partition is at least as big as the old one. So, "
+"either shrink the partition you are trying to copy, or copy to a bigger "
+"partition."
+msgstr ""
+"Het tegelijkertijd kopiëren en verkleinen van een %s-bestandssysteem is nog "
+"niet geïmplementeerd. Verklein dus eerst de bronpartitie alvorens deze naar "
+"de gekozen partitie te kopiëren, of kies een grotere doelpartitie."
+
+#: libparted/filesys.c:661
+#, c-format
+msgid "Support for copying %s file systems is not implemented yet."
+msgstr ""
+"Ondersteuning voor het kopiëren van %s-bestandssystemen is nog niet "
+"geïmplementeerd."
+
+#: libparted/filesys.c:699
+#, c-format
+msgid "Support for resizing %s file systems is not implemented yet."
+msgstr ""
+"Ondersteuning voor het van grootte veranderen van %s-bestandssystemen is nog "
+"niet geïmplementeerd."
+
+#: libparted/exception.c:78
+msgid "Information"
+msgstr "Informatie"
+
+#: libparted/exception.c:79
+msgid "Warning"
+msgstr "Waarschuwing"
+
+#: libparted/exception.c:80
+msgid "Error"
+msgstr "Fout"
+
+#: libparted/exception.c:81
+msgid "Fatal"
+msgstr "Fataal"
+
+#: libparted/exception.c:82
+msgid "Bug"
+msgstr "Programmeerfout"
+
+#: libparted/exception.c:83
+msgid "No Implementation"
+msgstr "Niet-geïmplementeerd"
+
+#: libparted/exception.c:87
+msgid "Fix"
+msgstr "Repareren"
+
+#: libparted/exception.c:88
+msgid "Yes"
+msgstr "Ja"
+
+#: libparted/exception.c:89
+msgid "No"
+msgstr "Nee"
+
+#: libparted/exception.c:90
+msgid "OK"
+msgstr "OK"
+
+#: libparted/exception.c:91
+msgid "Retry"
+msgstr "Opnieuw proberen"
+
+#: libparted/exception.c:92
+msgid "Ignore"
+msgstr "Negeren"
+
+#: libparted/exception.c:93
+msgid "Cancel"
+msgstr "Annuleren"
+
+#: libparted/exception.c:133
+#, c-format
+msgid ""
+"A bug has been detected in GNU Parted. Refer to the web site of parted "
+"http://www.gnu.org/software/parted/parted.html for more informations of what "
+"could be useful for bug submitting! Please email a bug report to bug-"
+"parted@gnu.org containing at least the version (%s) and the following "
+"message: "
+msgstr ""
+"U bent tegen een programmeerfout in GNU Parted aangelopen. Zie de website "
+"van Parted (http://www.gnu.org/software/parted/parted.html) voor meer "
+"informatie over het nuttig rapporteren van fouten. Stuur de foutrapportage "
+"alstublieft naar <bug-parted@gnu.org> met het versienummer (%s) en de "
+"volgende boodschap:"
+
+#: libparted/cs/geom.c:162
+msgid "Can't have the end before the start!"
+msgstr "Het einde kan niet vóór het begin liggen!"
+
+#: libparted/cs/geom.c:169
+msgid "Can't have a partition outside the disk!"
+msgstr "Kan geen partitie maken buiten de schijf!"
+
+#: libparted/cs/geom.c:303
+#, c-format
+msgid "Attempt to read sectors %ld-%ld outside of partition on %s."
+msgstr "Poging tot het lezen van sectoren %ld-%ld buiten de partitie op %s."
+
+#: libparted/cs/geom.c:373
+#, c-format
+msgid "Attempt to write sectors %ld-%ld outside of partition on %s."
+msgstr ""
+"Poging tot het schrijven van sectoren %ld-%ld buiten de partitie op %s."
+
+#: libparted/cs/geom.c:413 libparted/fs/linux_swap/linux_swap.c:353
+msgid "checking for bad blocks"
+msgstr "bezig met zoeken naar slechte blokken"
+
+#: libparted/libparted.c:286 libparted/libparted.c:306
+msgid "Out of memory."
+msgstr "Onvoldoende geheugen."
+
+#: libparted/unit.c:139
+msgid "Cannot get unit size for special unit 'COMPACT'."
+msgstr "Kan grootte van speciale eenheid 'COMPACT' niet bepalen."
+
+#: libparted/unit.c:382
+#, c-format
+msgid "\"%s\" has invalid syntax for locations."
+msgstr "\"%s\" heeft een voor lokaties ongeldige syntaxis."
+
+#: libparted/unit.c:390
+#, c-format
+msgid "The maximum head value is %d."
+msgstr "De maximum waarde voor de kop is %d."
+
+#: libparted/unit.c:397
+#, c-format
+msgid "The maximum sector value is %d."
+msgstr "De maximum waarde voor de sector is %d."
+
+#: libparted/unit.c:409 libparted/unit.c:540
+#, c-format
+msgid "The location %s is outside of the device %s."
+msgstr "Lokatie %s ligt buiten het apparaat %s."
+
+#: libparted/unit.c:522
+msgid "Invalid number."
+msgstr "Ongeldig nummer."
+
+#: libparted/fs/ext2/ext2.c:87 libparted/fs/ext2/ext2.c:112
+msgid "Inconsistent group descriptors!"
+msgstr "Inconsistente groepsbeschrijvers!"
+
+#: libparted/fs/ext2/ext2.c:91 libparted/fs/ext2/ext2.c:116
+msgid "File system full!"
+msgstr "Bestandssysteem is vol!"
+
+#: libparted/fs/ext2/ext2.c:750
+msgid "Invalid superblock. Are you sure this is an ext2 file system?"
+msgstr "Ongeldig superblok. Weet u zeker dat dit een ext2-bestandssysteem is?"
+
+#: libparted/fs/ext2/ext2.c:764 libparted/fs/ext2/ext2_resize.c:597
+msgid "File system has errors! You should run e2fsck."
+msgstr "Het bestandssysteem bevat fouten! Voer eerst e2fsck uit."
+
+#: libparted/fs/ext2/ext2.c:775
+msgid ""
+"File system was not cleanly unmounted! You should run e2fsck. Modifying an "
+"unclean file system could cause severe corruption."
+msgstr ""
+"Het bestandssysteem werd niet correct ontkoppeld! Voer eerst e2fsck uit. "
+"Het veranderen van een ongeschoond bestandssysteem kan tot zware "
+"beschadigingen leiden."
+
+#: libparted/fs/ext2/ext2.c:795
+msgid "File system has an incompatible feature enabled."
+msgstr "Het bestandssysteem gebruikt een incompatibele functie."
+
+#: libparted/fs/ext2/ext2.c:806
+msgid "Error allocating buffer cache."
+msgstr "Fout tijdens reserveren van buffercache."
+
+#: libparted/fs/ext2/ext2.c:848
+msgid ""
+"A resize operation on this file system will use EXPERIMENTAL code that MAY "
+"CORRUPT it (although it hasn't done so yet).You should at least backup your "
+"data and run 'e2fsck -f' afterwards."
+msgstr ""
+"Het van grootte veranderen van dit bestandssysteem zal EXPERIMENTELE "
+"programmacode gebruiken dat het bestandssysteem ZOU KUNNEN BESCHADIGEN (maar "
+"dit nog niet gedaan heeft). Maak een reservekopie van uw gegevens, en draai "
+"na afloop 'e2fsck -f'."
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:114
+msgid ""
+"Found an inode with a incorrect link count. Better go run e2fsck first!"
+msgstr ""
+"Er is een inode gevonden met een onjuist aantal verwijzingen. U kunt beter "
+"eerst e2fsck uitvoeren."
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:487
+msgid "Not enough free inodes!"
+msgstr "Niet genoeg beschikbare inodes!"
+
+#: libparted/fs/ext2/ext2_resize.c:224
+msgid "File system is too full to remove a group!"
+msgstr "Het bestandssysteem is te vol om een groep te verwijderen!"
+
+#: libparted/fs/ext2/ext2_resize.c:233
+msgid "File system has too many allocated inodes to remove a group!"
+msgstr ""
+"Het bestandssysteem heeft te veel gebruikte inodes om een groep te "
+"verwijderen!"
+
+#: libparted/fs/ext2/ext2_resize.c:493
+msgid "adding groups"
+msgstr "bezig met toevoegen van groepen"
+
+#: libparted/fs/ext2/ext2_resize.c:530
+#, c-format
+msgid "Your file system is too full to resize it to %i blocks. Sorry."
+msgstr ""
+"Uw bestandssysteem is te vol om het naar %i blokken te verkleinen. Sorry."
+
+#: libparted/fs/ext2/ext2_resize.c:540
+#, c-format
+msgid ""
+"Your file system has too many occupied inodes to resize it to %i blocks. "
+"Sorry."
+msgstr ""
+"Uw bestandssysteem heeft te veel bezette inodes om het naar %i blokken te "
+"verkleinen. Sorry."
+
+#: libparted/fs/ext2/ext2_resize.c:554 libparted/fs/hfs/hfs.c:243
+#: libparted/fs/hfs/hfs.c:624
+msgid "shrinking"
+msgstr "bezig met verkleinen"
+
+#: libparted/fs/ext2/ext2_resize.c:605
+msgid "File system was not cleanly unmounted! You should run e2fsck."
+msgstr ""
+"Het bestandssysteem werd niet correct ontkoppeld! Voer eerst e2fsck uit."
+
+#: libparted/fs/ext2/ext2_resize.c:614
+msgid ""
+"The file system has the 'dir_index' feature enabled. Parted can only resize "
+"the file system if it disables this feature. You can enable it later by "
+"running 'tune2fs -O dir_index DEVICE' and then 'e2fsck -fD DEVICE'."
+msgstr ""
+"Het bestandssysteem gebruikt de 'dir_index'-functie. Parted kan het "
+"bestandssysteem alleen van grootte veranderen als het deze functie "
+"uitschakelt. U kunt deze functie later weer aanzetten door middel van "
+"'tune2fs -O dir_index APPARAAT' en dan 'e2fsck -fD APPARAAT'."
+
+#: libparted/fs/ext2/ext2_block_relocator.c:198
+msgid "Cross-linked blocks found! Better go run e2fsck first!"
+msgstr ""
+"Kruiselings gekoppelde blokken gevonden! U kunt beter eerst e2fsck "
+"uitvoeren."
+
+#: libparted/fs/ext2/ext2_block_relocator.c:537
+#, c-format
+msgid "Block %i has no reference? Weird."
+msgstr "Aan blok %i wordt niet gerefereerd! Merkwaardig."
+
+#: libparted/fs/ext2/ext2_block_relocator.c:738
+#, c-format
+msgid "Block %i shouldn't have been marked!"
+msgstr "Blok %i zou niet gemarkeerd moeten zijn!"
+
+#: libparted/fs/ext2/interface.c:188
+msgid ""
+"The ext2 file system passed a basic check. For a more comprehensive check, "
+"use the e2fsck program."
+msgstr ""
+"Het ext2-bestandssysteem heeft deze basistest goed doorstaan. Voor een meer "
+"uitgebreide test kunt u het programma e2fsck gebruiken."
+
+#: libparted/fs/ext2/interface.c:205
+msgid "Sorry, can't move the start of ext2 partitions yet!"
+msgstr "Sorry, het begin van een ext2-partitie kan nog niet verplaatst worden!"
+
+#: libparted/fs/ext2/ext2_buffer.c:82
+msgid "Couldn't flush buffer cache!"
+msgstr "Kan de buffercache niet leegmaken!"
+
+#: libparted/fs/ext2/ext2_mkfs.c:162
+msgid "writing per-group metadata"
+msgstr "bezig met schrijven van groepsmetagegevens"
+
+#: libparted/fs/ext2/ext2_mkfs.c:565
+msgid "File system too small for ext2."
+msgstr "Het bestandssysteem is te klein voor ext2."
+
+#: libparted/fs/fat/calc.c:134
+#, c-format
+msgid ""
+"You need %s of free disk space to shrink this partition to this size. "
+"Currently, only %s is free."
+msgstr ""
+"U heeft minstens %s vrije schijfruimte nodig om deze partitie naar die "
+"grootte te kunnen verkleinen (u heeft nu slechts %s beschikbaar)."
+
+#: libparted/fs/fat/context.c:55
+#, c-format
+msgid ""
+"Cluster start delta = %d, which is not a multiple of the cluster size %d."
+msgstr ""
+"Clusterbegin-delta = %d, en dat is geen veelvoud van de clustergrootte %d."
+
+#: libparted/fs/fat/fat.c:312
+#, c-format
+msgid "Partition too big/small for a %s file system."
+msgstr "Partitie is te klein of te groot voor een %s-bestandssysteem."
+
+#: libparted/fs/fat/fat.c:478
+msgid ""
+"The FATs don't match. If you don't know what this means, then select "
+"cancel, run scandisk on the file system, and then come back."
+msgstr ""
+"De FATs komen niet overeen. Als u niet weet wat dit betekent, selecteer dan "
+"'Annuleren', voer scandisk uit op het bestandssysteem, en kom dan weer terug."
+
+#: libparted/fs/fat/fat.c:518
+msgid "There are no possible configurations for this FAT type."
+msgstr "Er zijn geen mogelijke configuraties voor dit type FAT."
+
+#: libparted/fs/fat/fat.c:530
+#, c-format
+msgid ""
+"File system doesn't have expected sizes for Windows to like it. Cluster "
+"size is %dk (%dk expected); number of clusters is %d (%d expected); size of "
+"FATs is %d sectors (%d expected)."
+msgstr ""
+"Het bestandssysteem heeft andere groottes dan Windows graag wil. De "
+"clustergrootte is %dk (%dk verwacht); het aantal clusters is %d (%d "
+"verwacht); de grootte van de FATs is %d sectoren (%d verwacht)."
+
+#: libparted/fs/fat/fat.c:553
+#, c-format
+msgid ""
+"File system is reporting the free space as %d clusters, not %d clusters."
+msgstr ""
+"Het bestandssysteem geeft de beschikbare ruimte aan als %d clusters, niet %d "
+"clusters."
+
+#: libparted/fs/fat/fat.c:878
+msgid ""
+"GNU Parted was miscompiled: the FAT boot sector should be 512 bytes. FAT "
+"support will be disabled."
+msgstr ""
+"GNU Parted is verkeerd gecompileerd: de FAT-opstartsector zou 512 bytes "
+"moeten zijn. Ondersteuning voor FAT wordt uitgeschakeld."
+
+#: libparted/fs/fat/resize.c:158
+msgid ""
+"There's not enough room in the root directory for all of the files. Either "
+"cancel, or ignore to lose the files."
+msgstr ""
+"Er is niet genoeg ruimte in de hoofdmap voor alle bestanden. Kies 'Negeren' "
+"om de overtallige bestanden te verwijderen."
+
+#: libparted/fs/fat/resize.c:299
+msgid "Error writing to the root directory."
+msgstr "Fout tijdens schrijven naar de hoofdmap."
+
+#: libparted/fs/fat/resize.c:484
+msgid "If you leave your file system as FAT16, then you will have no problems."
+msgstr ""
+"Als u het bestandssysteem als FAT16 laat, zult u geen problemen hebben."
+
+#: libparted/fs/fat/resize.c:487
+msgid ""
+"If you convert to FAT16, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual)."
+msgstr ""
+"Als u converteert naar FAT16, en MS-Windows is op deze partitie "
+"geïnstalleerd, dan dient u het MS-Windows-opstartprogramma opnieuw te "
+"installeren. Als u dit wilt doen, raadpleeg dan de Parted-documentatie (of "
+"de documentatie van uw distributie)."
+
+#: libparted/fs/fat/resize.c:495
+msgid ""
+"If you leave your file system as FAT32, then you will not introduce any new "
+"problems."
+msgstr ""
+"Als u het bestandssysteem als FAT32 laat, zult u geen nieuwe problemen "
+"introduceren."
+
+#: libparted/fs/fat/resize.c:499
+msgid ""
+"If you convert to FAT32, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual). Also, "
+"converting to FAT32 will make the file system unreadable by MS DOS, MS "
+"Windows 95a, and MS Windows NT."
+msgstr ""
+"Als u converteert naar FAT32, en MS-Windows is op deze partitie "
+"geïnstalleerd, dan dient u het MS-Windows-opstartprogramma opnieuw te "
+"installeren. Als u dit wilt doen, raadpleeg dan de Parted-documentatie (of "
+"de documentatie van uw distributie). Maar bedenk: converteren naar FAT32 "
+"maakt het bestandssysteem onleesbaar voor MSDOS, Windows 95a en Windows NT."
+
+#: libparted/fs/fat/resize.c:513
+#, c-format
+msgid "%s %s %s"
+msgstr "%s %s %s"
+
+#: libparted/fs/fat/resize.c:514
+msgid "Would you like to use FAT32?"
+msgstr "Wilt u FAT32 gebruiken?"
+
+#: libparted/fs/fat/resize.c:541 libparted/fs/fat/resize.c:557
+#, c-format
+msgid "%s %s"
+msgstr "%s %s"
+
+#: libparted/fs/fat/resize.c:542
+msgid ""
+"The file system can only be resized to this size by converting to FAT16."
+msgstr ""
+"Het bestandssysteem kan alleen naar deze grootte veranderd worden door te "
+"converteren naar FAT16."
+
+#: libparted/fs/fat/resize.c:558
+msgid ""
+"The file system can only be resized to this size by converting to FAT32."
+msgstr ""
+"Het bestandssysteem kan alleen naar deze grootte veranderd worden door te "
+"converteren naar FAT32."
+
+#: libparted/fs/fat/resize.c:571
+msgid ""
+"GNU Parted cannot resize this partition to this size. We're working on it!"
+msgstr ""
+"GNU Parted kan de partitiegrootte niet naar deze afmetingen veranderen. We "
+"zijn er mee bezig!"
+
+#: libparted/fs/fat/bootsector.c:48 libparted/fs/fat/bootsector.c:55
+msgid "File system has an invalid signature for a FAT file system."
+msgstr "Dit bestandssysteem heeft een voor FAT ongeldige vingerafdruk."
+
+#: libparted/fs/fat/bootsector.c:62
+msgid "File system has an invalid sector size for a FAT file system."
+msgstr "Dit bestandssysteem heeft een voor FAT ongeldige sectorgrootte."
+
+#: libparted/fs/fat/bootsector.c:69
+msgid "File system has an invalid cluster size for a FAT file system."
+msgstr "Dit bestandssysteem heeft een voor FAT ongeldige clustergrootte."
+
+#: libparted/fs/fat/bootsector.c:76
+msgid ""
+"File system has an invalid number of reserved sectors for a FAT file system."
+msgstr ""
+"Dit bestandssysteem heeft een voor FAT ongeldig aantal gereserveerde "
+"sectoren."
+
+#: libparted/fs/fat/bootsector.c:83
+msgid "File system has an invalid number of FATs."
+msgstr "Dit bestandssysteem heeft een ongeldig aantal FATs."
+
+#: libparted/fs/fat/bootsector.c:138
+#, c-format
+msgid ""
+"This file system has a logical sector size of %d. GNU Parted is known not "
+"to work properly with sector sizes other than 512 bytes."
+msgstr ""
+"Dit bestandssysteem heeft een logische sectorgrootte van %d. GNU Parted "
+"werkt niet goed met sectorgroottes anders dan 512 bytes."
+
+#: libparted/fs/fat/bootsector.c:163
+#, c-format
+msgid ""
+"The file system's CHS geometry is (%d, %d, %d), which is invalid. The "
+"partition table's CHS geometry is (%d, %d, %d). If you select Ignore, the "
+"file system's CHS geometry will be left unchanged. If you select Fix, the "
+"file system's CHS geometry will be set to match the partition table's CHS "
+"geometry."
+msgstr ""
+"De logische schijfopbouw (%d,%d,%d) vermeld in het bestandssysteem is "
+"ongeldig. De opbouw opgeslagen in het schijflabel is (%d,%d,%d) (cilinders,"
+"koppen,sectoren). Als u 'Negeren' kiest, wordt de opbouw vermeld in het "
+"bestandssysteem onveranderd gelaten. Als u 'Repareren' kiest, wordt deze "
+"opbouw gelijkgemaakt aan die in de partitietabel."
+
+#: libparted/fs/fat/bootsector.c:209
+msgid "FAT boot sector says logical sector size is 0. This is weird. "
+msgstr ""
+"De FAT-opstartsector zegt dat de logische sectorgrootte 0 is. Dit is heel "
+"vreemd. "
+
+#: libparted/fs/fat/bootsector.c:215
+msgid "FAT boot sector says there are no FAT tables. This is weird. "
+msgstr ""
+"De FAT-opstartsector zegt dat er geen FAT-tabellen zijn. Dit is heel "
+"vreemd. "
+
+#: libparted/fs/fat/bootsector.c:221
+msgid "FAT boot sector says clusters are 0 sectors. This is weird. "
+msgstr ""
+"De FAT-opstartsector zegt dat een cluster nul sectoren heeft. Dit is heel "
+"vreemd. "
+
+#: libparted/fs/fat/bootsector.c:231
+msgid "File system is FAT12, which is unsupported."
+msgstr "Het bestandssysteem is FAT12. Dit wordt niet ondersteund."
+
+#: libparted/fs/fat/bootsector.c:407
+#, c-format
+msgid ""
+"The information sector has the wrong signature (%x). Select cancel for now, "
+"and send in a bug report. If you're desperate, it's probably safe to ignore."
+msgstr ""
+"De informatiesector heeft een onjuiste vingerafdruk (%x). Kies voorlopig "
+"'Annuleren', en stuur een foutrapportage naar <bug-parted@gnu.org>. Indien "
+"u heel wanhopig bent: het is waarschijnlijk wel veilig om voor 'Negeren' "
+"kiezen."
+
+#: libparted/fs/fat/count.c:149
+#, c-format
+msgid "Bad directory entry for %s: first cluster is the end of file marker."
+msgstr ""
+"Foutief mapitem voor %s: de eerste cluster is een bestandseinde-markering."
+
+#: libparted/fs/fat/count.c:162
+#, c-format
+msgid ""
+"Bad FAT: unterminated chain for %s. You should run dosfsck or scandisk."
+msgstr ""
+"Onjuiste FAT: onbeëindigde keten voor %s. Voer eerst dosfsck of scandisk "
+"uit."
+
+#: libparted/fs/fat/count.c:171
+#, c-format
+msgid ""
+"Bad FAT: cluster %d outside file system in chain for %s. You should run "
+"dosfsck or scandisk."
+msgstr ""
+"Onjuiste FAT: cluster %d in de keten voor %s ligt buiten het "
+"bestandssysteem. Voer eerst dosfsck of scandisk uit."
+
+#: libparted/fs/fat/count.c:181
+#, c-format
+msgid ""
+"Bad FAT: cluster %d is cross-linked for %s. You should run dosfsck or "
+"scandisk."
+msgstr ""
+"Onjuiste FAT: cluster %d is voor %s kruiselings gekoppeld. Voer eerst "
+"dosfsck of scandisk uit."
+
+#: libparted/fs/fat/count.c:200
+#, c-format
+msgid "%s is %dk, but it has %d clusters (%dk)."
+msgstr "%s is %dk, maar heeft %d clusters (%dk)."
+
+#: libparted/fs/fat/count.c:263
+#, c-format
+msgid ""
+"The file %s is marked as a system file. This means moving it could cause "
+"some programs to stop working."
+msgstr ""
+"Het bestand %s is gemarkeerd als een systeembestand. Als het verplaatst "
+"wordt, zullen sommige programma's misschien niet meer werken."
+
+#: libparted/fs/fat/table.c:138
+#, c-format
+msgid ""
+"FAT %d media %x doesn't match the boot sector's media %x. You should "
+"probably run scandisk."
+msgstr ""
+"FAT %d medium %x komt niet overeen met medium %x uit de opstartsector. U "
+"kunt beter eerst scandisk uitvoeren."
+
+#: libparted/fs/fat/table.c:268
+#, c-format
+msgid "fat_table_set: cluster %ld outside file system"
+msgstr "fat_table_set(): cluster %ld ligt buiten het bestandssysteem"
+
+#: libparted/fs/fat/table.c:296
+#, c-format
+msgid "fat_table_get: cluster %ld outside file system"
+msgstr "fat_table_get(): cluster %ld ligt buiten het bestandssysteem"
+
+#: libparted/fs/fat/table.c:334
+msgid "fat_table_alloc_cluster: no free clusters"
+msgstr "fat_table_alloc_cluster(): geen beschikbare clusters"
+
+#: libparted/fs/linux_swap/linux_swap.c:236
+#, c-format
+msgid "Unrecognised linux swap signature '%10s'."
+msgstr "Onbekende vingerafdruk '%10s' voor Linux-swappartitie."
+
+#: libparted/fs/linux_swap/linux_swap.c:312
+msgid "Too many bad pages."
+msgstr "Te veel slechte pagina's."
+
+#: libparted/fs/hfs/advfs.c:123 libparted/fs/hfs/advfs_plus.c:125
+#: libparted/fs/hfs/reloc.c:416 libparted/fs/hfs/reloc.c:510
+#: libparted/fs/hfs/reloc_plus.c:541 libparted/fs/hfs/reloc_plus.c:660
+#: libparted/fs/hfs/reloc_plus.c:774
+msgid "The file system contains errors."
+msgstr "Het bestandssysteem bevat fouten."
+
+#: libparted/fs/hfs/advfs_plus.c:290
+msgid "Bad blocks could not be read."
+msgstr "Slechte blokken konden niet gelezen worden."
+
+#: libparted/fs/hfs/cache.c:139
+#, c-format
+msgid ""
+"Trying to register an extent starting at block 0x%X, but another one already "
+"exists at this position. You should check the file system!"
+msgstr ""
+"Poging tot het registreren van een 'extent' beginnend bij blok 0x%X, maar er "
+"bestaat al een 'extent' op die positie. Voer een bestandssysteemcontrole "
+"uit!"
+
+#: libparted/fs/hfs/cache.c:216
+#, c-format
+msgid ""
+"Trying to move an extent from block Ox%X to block Ox%X, but another one "
+"already exists at this position. This should not happen!"
+msgstr ""
+"Poging tot het verplaatsen van een 'extent' van blok 0x%X naar blok Ox%X, "
+"maar er bestaat al een 'extent' op die positie. Dit hoort nooit te gebeuren!"
+
+#: libparted/fs/hfs/file.c:145
+#, c-format
+msgid "Could not update the extent cache for HFS file with CNID %X."
+msgstr "Kan 'extent'-cache voor HFS-bestand met CNID %X niet bijwerken."
+
+#: libparted/fs/hfs/file.c:182
+#, c-format
+msgid "Trying to read HFS file with CNID %X behind EOF."
+msgstr ""
+"Poging tot lezen van HFS-bestand met CNID %X voorbij einde-van-bestand."
+
+#: libparted/fs/hfs/file.c:192 libparted/fs/hfs/file.c:222
+#, c-format
+msgid "Could not find sector %lli of HFS file with CNID %X."
+msgstr "Kan sector %lli van HFS-bestand met CNID %X niet vinden."
+
+#: libparted/fs/hfs/file.c:212
+#, c-format
+msgid "Trying to write HFS file with CNID %X behind EOF."
+msgstr ""
+"Poging tot schrijven van HFS-bestand met CNID %X voorbij einde-van-bestand."
+
+#: libparted/fs/hfs/file_plus.c:159
+#, c-format
+msgid "Could not update the extent cache for HFS+ file with CNID %X."
+msgstr "Kan 'extent'-cache voor HFS+-bestand met CNID %X niet bijwerken."
+
+#: libparted/fs/hfs/file_plus.c:203
+#, c-format
+msgid "Trying to read HFS+ file with CNID %X behind EOF."
+msgstr ""
+"Poging tot lezen van HFS+-bestand met CNID %X voorbij einde-van-bestand."
+
+#: libparted/fs/hfs/file_plus.c:214 libparted/fs/hfs/file_plus.c:256
+#, c-format
+msgid "Could not find sector %lli of HFS+ file with CNID %X."
+msgstr "Kan sector %lli van HFS+-bestand met CNID %X niet vinden."
+
+#: libparted/fs/hfs/file_plus.c:245
+#, c-format
+msgid "Trying to write HFS+ file with CNID %X behind EOF."
+msgstr ""
+"Poging tot schrijven van HFS+-bestand met CNID %X voorbij einde-van-bestand."
+
+#: libparted/fs/hfs/hfs.c:225
+msgid "Sorry, HFS cannot be resized that way yet."
+msgstr "Sorry, HFS kan nog niet op deze manier van grootte veranderd worden."
+
+#: libparted/fs/hfs/hfs.c:255 libparted/fs/hfs/hfs.c:636
+msgid "Data relocation has failed."
+msgstr "De gegevensverplaatsing is mislukt."
+
+#: libparted/fs/hfs/hfs.c:274
+msgid "Data relocation left some data in the end of the volume."
+msgstr ""
+"De gegevensverplaatsing heeft enkele gegevens aan het einde van het volumen "
+"achtergelaten."
+
+#: libparted/fs/hfs/hfs.c:313
+msgid "writing HFS Master Directory Block"
+msgstr "bezig met schrijven van HFS-hoofdmapblok"
+
+#: libparted/fs/hfs/hfs.c:461
+msgid "No valid HFS[+X] signature has been found while opening."
+msgstr "Geen geldige HFS[+X]-vingerafdruk gevonden tijdens openen."
+
+#: libparted/fs/hfs/hfs.c:471
+#, c-format
+msgid "Version %d of HFS+ isn't supported."
+msgstr "Versie %d van HFS+ wordt niet ondersteund."
+
+#: libparted/fs/hfs/hfs.c:482
+#, c-format
+msgid "Version %d of HFSX isn't supported."
+msgstr "Versie %d van HFSX wordt niet ondersteund."
+
+#: libparted/fs/hfs/hfs.c:667
+msgid "Data relocation left some data at the end of the volume."
+msgstr ""
+"De gegevensverplaatsing heeft enkele gegevens aan het einde van het volumen "
+"achtergelaten."
+
+#: libparted/fs/hfs/hfs.c:715
+msgid "Error while writing the allocation file."
+msgstr "Fout tijdens schrijven van het reserveringsbestand."
+
+#: libparted/fs/hfs/hfs.c:730
+msgid "Error while writing the compatibility part of the allocation file."
+msgstr ""
+"Fout tijdens schrijven van het compatibiliteitsdeel van het "
+"reserveringsbestand."
+
+#: libparted/fs/hfs/hfs.c:745
+msgid "writing HFS+ Volume Header"
+msgstr "bezig met schrijven van HFS+-volumenkop"
+
+#: libparted/fs/hfs/hfs.c:845
+msgid "An error occurred while looking for the mandatory bad blocks file."
+msgstr "Fout tijdens zoeken naar het vereiste slechte-blokkenbestand."
+
+#: libparted/fs/hfs/hfs.c:899
+msgid ""
+"It seems there is an error in the HFS wrapper: the bad blocks file doesn't "
+"contain the embedded HFS+ volume."
+msgstr ""
+"Er schijnt een fout in de HFS-wikkel te zitten: het slechte-blokkenbestand "
+"bevat geen ingebed HFS+-volumen."
+
+#: libparted/fs/hfs/hfs.c:930
+msgid "Sorry, HFS+ cannot be resized that way yet."
+msgstr "Sorry, HFS+ kan nog niet op deze manier van grootte veranderd worden."
+
+#: libparted/fs/hfs/hfs.c:965
+msgid "shrinking embedded HFS+ volume"
+msgstr "bezig met verkleinen van een ingebed HFS+-volumen"
+
+#: libparted/fs/hfs/hfs.c:981
+msgid "Resizing the HFS+ volume has failed."
+msgstr "Het van grootte veranderen van het HFS+-volumen is mislukt."
+
+#: libparted/fs/hfs/hfs.c:988
+msgid "shrinking HFS wrapper"
+msgstr "bezig met verkleinen van HFS-wikkel"
+
+#: libparted/fs/hfs/hfs.c:997
+msgid "Updating the HFS wrapper has failed."
+msgstr "Het bijwerken van de HFS-wikkel is mislukt."
+
+#: libparted/fs/hfs/hfs.c:1099 libparted/fs/hfs/hfs.c:1184
+#, c-format
+msgid ""
+"This is not a real %s check. This is going to extract special low level "
+"files for debugging purposes."
+msgstr ""
+"Dit is geen echte %s-controle. Het extraheert slechts enkele speciale "
+"bestanden om bij de foutopsporing te helpen."
+
+#: libparted/fs/hfs/journal.c:156
+msgid "Bad block list header checksum."
+msgstr "Onjuiste controlesom van kop van blokkenlijst."
+
+#: libparted/fs/hfs/journal.c:169
+#, c-format
+msgid ""
+"Invalid size of a transaction block while replaying the journal (%i bytes)."
+msgstr ""
+"Ongeldige grootte (%i bytes) van een transactieblok tijdens herafspelen van "
+"het journal."
+
+#: libparted/fs/hfs/journal.c:261
+msgid ""
+"Journal stored outside of the volume are not supported. Try to desactivate "
+"the journal and run Parted again."
+msgstr ""
+"Een journal opgeslagen buiten het volumen wordt niet ondersteund. Probeer "
+"het journal uit te schakelen en voer dan Parted opnieuw uit."
+
+#: libparted/fs/hfs/journal.c:272
+msgid "Journal offset or size is not multiple of the sector size."
+msgstr ""
+"Grootte of offset van het journal is geen veelvoud van de sectorgrootte."
+
+#: libparted/fs/hfs/journal.c:290
+msgid "Incorrect magic values in the journal header."
+msgstr "Onjuiste magische getallen in de journalkop."
+
+#: libparted/fs/hfs/journal.c:299
+msgid "Journal size mismatch between journal info block and journal header."
+msgstr ""
+"Journalgrootte is verschillend aangegeven in journal-infoblok en journalkop."
+
+#: libparted/fs/hfs/journal.c:311
+msgid "Some header fields are not multiple of the sector size."
+msgstr ""
+"Sommige velden in de journalkop zijn geen veelvoud van de sectorgrootte."
+
+#: libparted/fs/hfs/journal.c:320
+msgid ""
+"The sector size stored in the journal is not 512 bytes. Parted only "
+"supports 512 bytes length sectors."
+msgstr ""
+"De sectorgrootte is volgens het journal niet 512 bytes. Parted ondersteunt "
+"alleen sectoren van 512 bytes."
+
+#: libparted/fs/hfs/journal.c:332
+msgid "Bad journal checksum."
+msgstr "Onjuiste controlesom van journal."
+
+#: libparted/fs/hfs/journal.c:350
+msgid ""
+"The journal is not empty. Parted must replay the transactions before "
+"opening the file system. This will modify the file system."
+msgstr ""
+"Het journal is niet leeg. Parted moet de transacties herafspelen alvorens "
+"het bestandssysteem te openen. Dit zal het bestandssysteem veranderen."
+
+#: libparted/fs/hfs/journal.c:378
+msgid ""
+"The volume header or the master directory block has changed while replaying "
+"the journal. You should restart Parted."
+msgstr ""
+"De volumenkop of het hoofdmappenblok is veranderd tijdens het herafspelen "
+"van het journal. U dient Parted te herstarten."
+
+#: libparted/fs/hfs/probe.c:52
+#, c-format
+msgid ""
+"Parted can't use HFS file systems on disks with a sector size not equal to %"
+"d bytes."
+msgstr ""
+"Parted kan geen HFS-bestandssystemen bewerken op schijven met een andere "
+"sectorgrootte dan %d bytes."
+
+#: libparted/fs/hfs/reloc.c:153 libparted/fs/hfs/reloc_plus.c:157
+msgid "An extent has not been relocated."
+msgstr "Een 'extent' is niet verplaatst."
+
+#: libparted/fs/hfs/reloc.c:253 libparted/fs/hfs/reloc_plus.c:309
+msgid ""
+"A reference to an extent comes from a place it should not. You should check "
+"the file system!"
+msgstr ""
+"Er wordt gerefereerd aan een 'extent' vanuit een onmogelijke plaats. Voer "
+"een bestandssyteemcontrole uit!"
+
+#: libparted/fs/hfs/reloc.c:383
+msgid "This HFS volume has no catalog file. This is very unusual!"
+msgstr ""
+"Dit HFS-volumen heeft geen catalogusbestand. Dit is zeer ongebruikelijk!"
+
+#: libparted/fs/hfs/reloc.c:477
+msgid "This HFS volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+"Dit HFS-volumen heeft geen 'extents-overflow'-bestand. Dit is zeer "
+"ongebruikelijk!"
+
+#: libparted/fs/hfs/reloc.c:519 libparted/fs/hfs/reloc_plus.c:670
+msgid ""
+"The extents overflow file should not contain its own extents! You should "
+"check the file system."
+msgstr ""
+"Het 'extents-overflow'-bestand hoort niet zijn eigen 'extents' te bevatten. "
+"Voer een bestandssyteemcontrole uit!"
+
+#: libparted/fs/hfs/reloc.c:576 libparted/fs/hfs/reloc_plus.c:849
+msgid "Could not cache the file system in memory."
+msgstr "Kan het bestandssysteem niet tijdelijk opslaan in het geheugen."
+
+#: libparted/fs/hfs/reloc.c:637 libparted/fs/hfs/reloc_plus.c:910
+msgid "Bad blocks list could not be loaded."
+msgstr "De lijst met slechte blokken kan niet geladen worden."
+
+#: libparted/fs/hfs/reloc.c:651 libparted/fs/hfs/reloc_plus.c:926
+msgid "An error occurred during extent relocation."
+msgstr "Er is een fout opgetreden tijdens het verplaatsen van een 'extent'."
+
+#: libparted/fs/hfs/reloc_plus.c:497
+msgid "This HFS+ volume has no catalog file. This is very unusual!"
+msgstr ""
+"Dit HFS+-volumen heeft geen catalogusbestand. Dit is zeer ongebruikelijk!"
+
+#: libparted/fs/hfs/reloc_plus.c:621
+msgid "This HFS+ volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+"Dit HFS+-volumen heeft geen 'extents-overflow'-bestand. Dit is zeer "
+"ongebruikelijk!"
+
+#: parted/parted.c:76
+msgid "displays this help message"
+msgstr "deze hulptekst weergeven"
+
+#: parted/parted.c:77
+msgid "where necessary, prompts for user intervention"
+msgstr "om tussenkomst van de gebruiker vragen, indien nodig"
+
+#: parted/parted.c:78
+msgid "never prompts for user intervention"
+msgstr "nooit om tussenkomst van de gebruiker vragen"
+
+#: parted/parted.c:79
+msgid "displays the version"
+msgstr "de programmaversie weergeven"
+
+#: parted/parted.c:87
+msgid ""
+"NUMBER is the partition number used by Linux. On MS-DOS disk labels, the "
+"primary partitions number from 1 to 4, logical partitions from 5 onwards.\n"
+msgstr ""
+"NUMMER is het door Linux gebruikte nummer van de partitie. In MSDOS-"
+"schijflabels zijn de primaire partities genummerd van 1 tot 4, de logische "
+"partities vanaf 5 en hoger.\n"
+
+#: parted/parted.c:90
+msgid "LABEL-TYPE is one of: "
+msgstr "LABEL-TYPE is een van: "
+
+#: parted/parted.c:91
+msgid "FLAG is one of: "
+msgstr "VLAG is een van: "
+
+#: parted/parted.c:92
+msgid "UNIT is one of: "
+msgstr "EENHEID is een van: "
+
+#: parted/parted.c:93
+msgid "PART-TYPE is one of: primary, logical, extended\n"
+msgstr "PART-TYPE is een van: primair, logisch, uitgebreid\n"
+
+#: parted/parted.c:95
+msgid "FS-TYPE is one of: "
+msgstr "BS-SOORT is een van: "
+
+#: parted/parted.c:96
+msgid ""
+"START and END are disk locations, such as 4GB or 10%. Negative values count "
+"from the end of the disk. For example, -1s specifies exactly the last "
+"sector.\n"
+msgstr ""
+"BEGIN en EINDE zijn schijflokaties, zoals 4GB of 10%. Negatieve waarden "
+"tellen vanaf het einde van de schijf. Bijvoorbeeld, -1s geeft precies de "
+"laatste sector aan.\n"
+
+#: parted/parted.c:99
+msgid "STATE is one of: on, off\n"
+msgstr "TOESTAND is één van: aan, uit\n"
+
+#: parted/parted.c:100
+msgid "DEVICE is usually /dev/hda or /dev/sda\n"
+msgstr "APPARAAT is gewoonlijk /dev/hda of /dev/sda\n"
+
+#: parted/parted.c:101
+msgid "NAME is any word you want\n"
+msgstr "NAAM is elk woord dat u wilt\n"
+
+#: parted/parted.c:102
+msgid "The partition must have one of the following FS-TYPEs: "
+msgstr "De partitie dient een van de volgende BS-SOORTen te hebben: "
+
+#: parted/parted.c:105
+msgid "GNU Parted Version information:\n"
+msgstr "GNU Parted versieinformatie:\n"
+
+#: parted/parted.c:107
+msgid ""
+"Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n"
+"This program is free software, covered by the GNU General Public License.\n"
+"\n"
+"This program is distributed in the hope that it will be useful, but WITHOUT "
+"ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
+"FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
+"more details.\n"
+"\n"
+msgstr ""
+"Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n"
+"Dit is vrije programmatuur, vallend onder de GNU General Public License.\n"
+"\n"
+"Dit programma wordt uitgegeven in de hoop dat het nuttig is, maar ZONDER "
+"ENIGE GARANTIE; zelfs zonder de impliciete garantie van VERKOOPBAARHEID of "
+"GESCHIKTHEID VOOR EEN BEPAALD DOEL. Zie de GNU General Public License voor "
+"nadere details.\n"
+
+#: parted/parted.c:152
+#, c-format
+msgid "%0.f%%\t(time left %.2d:%.2d)"
+msgstr "%0.f%%\t(resterende tijd: %.2d:%.2d)"
+
+#: parted/parted.c:170
+#, c-format
+msgid ""
+"Partition %s is being used. You must unmount it before you modify it with "
+"Parted."
+msgstr ""
+"Partitie %s is in gebruik. Deze dient ontkoppeld te worden alvorens hem met "
+"Parted te bewerken."
+
+#: parted/parted.c:187
+#, c-format
+msgid "Partition(s) on %s are being used."
+msgstr "Partitie(s) op %s zijn in gebruik."
+
+#: parted/parted.c:413 parted/parted.c:594 parted/parted.c:979
+#: parted/parted.c:1059 parted/parted.c:1586 parted/parted.c:1663
+#: parted/parted.c:1707
+msgid "Partition number?"
+msgstr "Nummer van partitie?"
+
+#: parted/parted.c:456
+msgid "Source device?"
+msgstr "Bronapparaat?"
+
+#: parted/parted.c:460
+msgid "Source partition number?"
+msgstr "Nummer van bronpartitie?"
+
+#: parted/parted.c:465
+msgid "Can't copy an extended partition."
+msgstr "Kan een uitgebreide partitie niet kopiëren."
+
+#: parted/parted.c:471
+msgid "Destination partition number?"
+msgstr "Nummer van doelpartitie?"
+
+#: parted/parted.c:564
+msgid "New disk label type?"
+msgstr "Type van nieuw schijflabel?"
+
+#: parted/parted.c:598
+msgid "File system?"
+msgstr "Bestandssysteem?"
+
+#: parted/parted.c:645 parted/parted.c:815
+msgid "Partition type?"
+msgstr "Partitietype?"
+
+#: parted/parted.c:652 parted/parted.c:822 parted/parted.c:1062
+msgid "Partition name?"
+msgstr "Naam van partitie?"
+
+#: parted/parted.c:660 parted/parted.c:832
+msgid "File system type?"
+msgstr "Bestandssysteemsoort?"
+
+#: parted/parted.c:667 parted/parted.c:834 parted/parted.c:994
+#: parted/parted.c:1544 parted/parted.c:1595
+msgid "Start?"
+msgstr "Begin?"
+
+#: parted/parted.c:669 parted/parted.c:837 parted/parted.c:997
+#: parted/parted.c:1546 parted/parted.c:1597
+msgid "End?"
+msgstr "Einde?"
+
+#: parted/parted.c:707 parted/parted.c:875
+#, c-format
+msgid ""
+"You requested a partition from %s to %s.\n"
+"The closest location we can manage is %s to %s. Is this still acceptable to "
+"you?"
+msgstr ""
+"U verzocht om een partitie van %s tot %s.\n"
+"De dichtstbijzijnde mogelijkheid is van %s tot %s. Is dit nog acceptabel?"
+
+#: parted/parted.c:827
+msgid "An extended partition cannot hold a file system. Did you want mkpart?"
+msgstr ""
+"Een uitgebreide partitie kan geen bestandssysteem bevatten. Bedoelde u "
+"'maakpart'?"
+
+#: parted/parted.c:985
+msgid "Can't move an extended partition."
+msgstr "Kan een uitgebreide partitie niet verplaatsen."
+
+#: parted/parted.c:1014
+msgid "Can't move a partition onto itself. Try using resize, perhaps?"
+msgstr ""
+"Kan een partitie niet naar zichzelf verplaatsen. Bedoelde u 'grootte'?"
+
+#: parted/parted.c:1158
+#, c-format
+msgid "Minor: %d\n"
+msgstr "Nummer: %d\n"
+
+#: parted/parted.c:1159
+#, c-format
+msgid "Flags: %s\n"
+msgstr "Vlaggen: %s\n"
+
+#: parted/parted.c:1160
+#, c-format
+msgid "File System: %s\n"
+msgstr "Bestandssysteem: %s\n"
+
+#: parted/parted.c:1161
+#, c-format
+msgid "Size: "
+msgstr "Grootte: "
+
+#: parted/parted.c:1166
+#, c-format
+msgid "Minimum size: "
+msgstr "Minimum grootte: "
+
+#: parted/parted.c:1169
+#, c-format
+msgid "Maximum size: "
+msgstr "Maximum grootte: "
+
+#: parted/parted.c:1255
+#, c-format
+msgid "Disk %s: %s\n"
+msgstr "Schijf %s: %s\n"
+
+#: parted/parted.c:1256
+#, c-format
+msgid "Sector size (logical/physical): %lldB/%lldB\n"
+msgstr "Sectorgrootte (logisch/fysiek): %lldB/%lldB\n"
+
+#: parted/parted.c:1267
+#, c-format
+msgid "BIOS cylinder,head,sector geometry: %d,%d,%d. Each cylinder is %s.\n"
+msgstr ""
+"Logische schijfopbouw volgens BIOS: %d,%d,%d (cilinders,koppen,sectoren). "
+"Elke cilinder is %s.\n"
+
+#: parted/parted.c:1273
+#, c-format
+msgid "Partition Table: %s\n"
+msgstr "Partitietabel: %s\n"
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Number"
+msgstr "Nummer"
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Start"
+msgstr "Begin"
+
+#: parted/parted.c:1285 parted/parted.c:1288
+msgid "End"
+msgstr "Einde"
+
+#: parted/parted.c:1288
+msgid "Size"
+msgstr "Grootte"
+
+#: parted/parted.c:1292
+msgid "Type"
+msgstr "Type"
+
+#: parted/parted.c:1294
+msgid "File system"
+msgstr "Bestandssysteem"
+
+#: parted/parted.c:1297
+msgid "Name"
+msgstr "Naam"
+
+#: parted/parted.c:1299
+msgid "Flags"
+msgstr "Vlaggen"
+
+#: parted/parted.c:1352
+msgid "Free Space"
+msgstr "Vrije ruimte"
+
+#: parted/parted.c:1441
+#, c-format
+msgid ""
+"A %s %s partition was found at %s -> %s. Do you want to add it to the "
+"partition table?"
+msgstr ""
+"Er is een %s %s-partitie gevonden van %s tot %s. Wilt u deze aan de "
+"partitietabel toevoegen?"
+
+#: parted/parted.c:1479
+msgid "searching for file systems"
+msgstr "bezig met zoeken naar bestandssystemen"
+
+#: parted/parted.c:1684
+msgid "New device?"
+msgstr "Nieuw apparaat?"
+
+#: parted/parted.c:1709
+msgid "Flag to Invert?"
+msgstr "Om te zetten vlag?"
+
+#: parted/parted.c:1714
+msgid "New state?"
+msgstr "Nieuwe toestand?"
+
+#: parted/parted.c:1747
+msgid "Unit?"
+msgstr "Eenheid?"
+
+#: parted/parted.c:1896
+msgid "check"
+msgstr "controleer"
+
+#: parted/parted.c:1899
+msgid ""
+"check NUMBER do a simple check on the file system"
+msgstr ""
+"controleer NUMMER een simpele controle op het bestandssysteem "
+"uitvoeren"
+
+#: parted/parted.c:1905
+msgid "cp"
+msgstr "kopieer"
+
+#: parted/parted.c:1908
+msgid ""
+"cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another "
+"partition"
+msgstr ""
+"kopieer [APPARAAT] VAN-NUMMER NAAR-NUMMER een bestandssysteem naar een "
+"andere partitie kopiëren"
+
+#: parted/parted.c:1914
+msgid "help"
+msgstr "hulp"
+
+#: parted/parted.c:1917
+msgid ""
+"help [COMMAND] prints general help, or help on "
+"COMMAND"
+msgstr ""
+"help [OPDRACHT] enige algemene hulp geven (of hulp bij OPDRACHT)"
+
+#: parted/parted.c:1923
+msgid "mklabel"
+msgstr "maaklabel"
+
+#: parted/parted.c:1926
+msgid ""
+"mklabel LABEL-TYPE create a new disklabel (partition "
+"table)"
+msgstr ""
+"maaklabel LABEL-TYPE een nieuw schijflabel (met lege partitietabel) "
+"maken"
+
+#: parted/parted.c:1932
+msgid "mkfs"
+msgstr "maakbs"
+
+#: parted/parted.c:1935
+msgid ""
+"mkfs NUMBER FS-TYPE make a FS-TYPE file system on "
+"partititon NUMBER"
+msgstr ""
+"maakbs NUMMER BS-SOORT op partitie NUMMER een bestandssysteem van BS-"
+"SOORT aanmaken"
+
+#: parted/parted.c:1941
+msgid "mkpart"
+msgstr "maakpart"
+
+#: parted/parted.c:1944
+msgid "mkpart PART-TYPE [FS-TYPE] START END make a partition"
+msgstr "maakpart PART-TYPE [BS-SOORT] BEGIN EINDE een partitie aanmaken"
+
+#: parted/parted.c:1950
+msgid ""
+"mkpart makes a partition without creating a new file system on the "
+"partition. FS-TYPE may be specified to set an appropriate partition ID.\n"
+msgstr ""
+"Opdracht 'maakpart' maakt een partitie aan zonder een bestandssysteem aan te "
+"maken. BS-SOORT mag gebruikt worden om het een geschikt partitiekenmerk te "
+"geven.\n"
+
+#: parted/parted.c:1955
+msgid "mkpartfs"
+msgstr "maakpartbs"
+
+#: parted/parted.c:1958
+msgid ""
+"mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system"
+msgstr ""
+"maakpartbs PART-TYPE BS-SOORT BEGIN EINDE een partitie aanmaken met een "
+"bestandssysteem"
+
+#: parted/parted.c:1964
+msgid "move"
+msgstr "schuif"
+
+#: parted/parted.c:1967
+msgid "move NUMBER START END move partition NUMBER"
+msgstr ""
+"schuif NUMMER BEGIN EINDE partitie NUMMER verplaatsen naar nieuw BEGIN en "
+"EINDE"
+
+#: parted/parted.c:1972
+msgid "name"
+msgstr "noem"
+
+#: parted/parted.c:1975
+msgid "name NUMBER NAME name partition NUMBER as NAME"
+msgstr "noem NUMMER NAAM partitie NUMMER deze NAAM geven"
+
+#: parted/parted.c:1980
+msgid "print"
+msgstr "toon"
+
+#: parted/parted.c:1983
+msgid ""
+"print [free|NUMBER|all] display the partition table, a "
+"partition, or all devices"
+msgstr ""
+"toon [free|NUMMER|all] de partitietabel weergeven (of de vrije ruimte, "
+"een specifieke partitie, of alle apparaten)"
+
+#: parted/parted.c:1987
+msgid ""
+"Without arguments, print displays the entire partition table. With 'free'\n"
+"argument, information about free space will be displayed otherwise if a\n"
+"partition number is given, then more detailed information is displayed\n"
+"about that partition. If the 'all' argument is passed instead, partition\n"
+"information for all devices will be displayed."
+msgstr ""
+"Zonder argumenten toont 'toon' de volledige partitietabel. Met 'free'\n"
+"als argument, toont het hoeveel ruimte er nog beschikbaar is. Met een\n"
+" partitienummer als argument, toont het meer gedetailleerde informatie\n"
+"over die partitie. En met 'all' als argument, toont het informatie over\n"
+"alle apparaten."
+
+#: parted/parted.c:1995
+msgid "quit"
+msgstr "einde"
+
+#: parted/parted.c:1998
+msgid "quit exit program"
+msgstr "einde Parted afsluiten"
+
+#: parted/parted.c:2003
+msgid "rescue"
+msgstr "red"
+
+#: parted/parted.c:2006
+msgid ""
+"rescue START END rescue a lost partition near START "
+"and END"
+msgstr ""
+"red BEGIN EINDE een verloren partitie proberen te herstellen"
+
+#: parted/parted.c:2012
+msgid "resize"
+msgstr "grootte"
+
+#: parted/parted.c:2015
+msgid ""
+"resize NUMBER START END resize partition NUMBER and its "
+"file system"
+msgstr ""
+"grootte NUMMER BEGIN EINDE de grootte van het bestandssysteem op partitie "
+"NUMMER veranderen"
+
+#: parted/parted.c:2023
+msgid "rm"
+msgstr "verwijder"
+
+#: parted/parted.c:2026
+msgid "rm NUMBER delete partition NUMBER"
+msgstr "verwijder NUMMER partitie NUMMER verwijderen"
+
+#: parted/parted.c:2031
+msgid "select"
+msgstr "kies"
+
+#: parted/parted.c:2034
+msgid "select DEVICE choose the device to edit"
+msgstr "kies APPARAAT dit APPARAAT kiezen om te bewerken"
+
+#: parted/parted.c:2039
+msgid "set"
+msgstr "zet"
+
+#: parted/parted.c:2042
+msgid ""
+"set NUMBER FLAG STATE change the FLAG on partition NUMBER"
+msgstr ""
+"zet NUMMER VLAG TOESTAND op partitie NUMMER deze VLAG in TOESTAND zetten"
+
+#: parted/parted.c:2048
+msgid "toggle"
+msgstr "zetom"
+
+#: parted/parted.c:2051
+msgid ""
+"toggle [NUMBER [FLAG]] toggle the state of FLAG on "
+"partition NUMBER"
+msgstr ""
+"zetom [NUMMER [VLAG]] op partitie NUMMER de toestand van VLAG omzetten"
+
+#: parted/parted.c:2057
+msgid "unit"
+msgstr "eenheid"
+
+#: parted/parted.c:2060
+msgid "unit UNIT set the default unit to UNIT"
+msgstr "eenheid EENHEID standaard deze EENHEID gebruiken"
+
+#: parted/parted.c:2065
+#, fuzzy
+msgid "version"
+msgstr "versie"
+
+#: parted/parted.c:2068
+msgid ""
+"version displays the current version of GNU "
+"Parted and copyright information"
+msgstr ""
+"versie toon het versienummer van GNU Parted en de "
+"copyrightinformatie"
+
+#: parted/parted.c:2072
+msgid ""
+"version displays copyright and version information corressponding to this "
+"copy of GNU Parted\n"
+msgstr ""
+"'versie' toont informatie over het copyright en de versie van deze GNU "
+"Parted\n"
+
+#: parted/parted.c:2158
+msgid "No device found"
+msgstr "Geen apparaat gevonden"
+
+#: parted/parted.c:2222
+msgid "Don't forget to update /etc/fstab, if necessary.\n"
+msgstr "Vergeet niet, indien nodig, /etc/fstab bij te werken.\n"
+
+#: parted/ui.c:68
+msgid "Welcome to GNU Parted! Type 'help' to view a list of commands.\n"
+msgstr ""
+"Welkom bij GNU Parted! Typ 'help' voor een lijst van beschikbare "
+"opdrachten.\n"
+
+#: parted/ui.c:71
+msgid ""
+"Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]\n"
+"Apply COMMANDs with PARAMETERS to DEVICE. If no COMMAND(s) are given, run "
+"in\n"
+"interactive mode.\n"
+msgstr ""
+"Gebruik: parted [OPTIE]... [APPARAAT [OPDRACHT [ARGUMENTEN]...]...]\n"
+"Dit voert OPDRACHT met ARGUMENTEN uit op APPARAAT.\n"
+"Als er geen OPDRACHT gegeven is, wordt interactieve modus gestart.\n"
+
+#: parted/ui.c:76
+#, c-format
+msgid ""
+"\n"
+"\n"
+"You found a bug in GNU Parted! Here's what you have to do:\n"
+"\n"
+"Don't panic! The bug has most likely not affected any of your data.\n"
+"Help us to fix this bug by doing the following:\n"
+"\n"
+"Check whether the bug has already been fixed by checking\n"
+"the last version of GNU Parted that you can find at:\n"
+"\n"
+"\thttp://ftp.gnu.org/gnu/parted/\n"
+"\n"
+"Please check this version prior to bug reporting.\n"
+"\n"
+"If this has not been fixed yet or if you don't know how to check,\n"
+"please visit the GNU Parted website:\n"
+"\n"
+"\thttp://www.gnu.org/software/parted\n"
+"\n"
+"for further information.\n"
+"\n"
+"Your report should contain the version of this release (%s)\n"
+"along with the error message below, the output of\n"
+"\n"
+"\tparted DEVICE unit co print unit s print\n"
+"\n"
+"and additional information about your setup you consider important.\n"
+msgstr ""
+"\n"
+"\n"
+"U heeft een programmeerfout in GNU Parted gevonden. Raak niet in paniek.\n"
+"De fout heeft zeer waarschijnlijk uw gegevens ongemoeid gelaten.\n"
+"\n"
+"Help ons de fout te verbeteren door het volgende te doen:\n"
+"\n"
+"Controleer of de fout al is verbeterd door de nieuwste versie van GNU "
+"Parted\n"
+"te gebruiken die te vinden is op:\n"
+"\n"
+"\thttp://ftp.gnu.org/gnu/parted/\n"
+"\n"
+"Probeer die versie alvorens een fout te rapporteren.\n"
+"\n"
+"Als de fout nog niet is verbeterd, of als u niet precies weet hoe dit\n"
+"te controleren, kijk dan voor verdere informatie op de Parted-website:\n"
+"\n"
+"\thttp://www.gnu.org/software/parted\n"
+"\n"
+"Uw rapportage dient het versienummer van Parted te bevatten (%s),\n"
+"de onderstaande foutmelding, de uitvoer van\n"
+"\n"
+"\tparted APPARAAT unit co print unit s print\n"
+"\n"
+"en verdere relevante informatie over de configuratie van uw systeem.\n"
+
+#: parted/ui.c:230
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_MAPERR (Address not mapped to object)"
+msgstr ""
+
+#: parted/ui.c:235
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_ACCERR (Invalid permissions for mapped object)"
+msgstr ""
+
+#: parted/ui.c:240
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGSEGV signal was encountered."
+msgstr ""
+
+#: parted/ui.c:258
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTDIV (Integer: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:262
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTOVF (Integer: overflow)"
+msgstr ""
+
+#: parted/ui.c:266
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTDIV (Float: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:270
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTOVF (Float: overflow)"
+msgstr ""
+
+#: parted/ui.c:274
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTUND (Float: underflow)"
+msgstr ""
+
+#: parted/ui.c:278
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTRES (Float: inexact result)"
+msgstr ""
+
+#: parted/ui.c:282
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTINV (Float: invalid operation)"
+msgstr ""
+
+#: parted/ui.c:286
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTSUB (Float: subscript out of range)"
+msgstr ""
+
+#: parted/ui.c:291
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGFPE signal was encountered."
+msgstr ""
+
+#: parted/ui.c:310
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPC (Illegal Opcode)"
+msgstr ""
+
+#: parted/ui.c:314
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPN (Illegal Operand)"
+msgstr ""
+
+#: parted/ui.c:318
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLADR (Illegal addressing mode)"
+msgstr ""
+
+#: parted/ui.c:323
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLTRP (Illegal Trap)"
+msgstr ""
+
+#: parted/ui.c:327
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVOPC (Privileged Opcode)"
+msgstr ""
+
+#: parted/ui.c:331
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVREG (Privileged Register)"
+msgstr ""
+
+#: parted/ui.c:335
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_COPROC (Coprocessor Error)"
+msgstr ""
+
+#: parted/ui.c:339
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_BADSTK (Internal Stack Error)"
+msgstr ""
+
+#: parted/ui.c:343
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGILL signal was encountered."
+msgstr ""
+
+#: parted/ui.c:828
+msgid "Expecting a partition number."
+msgstr "Een partitienummer wordt verwacht."
+
+#: parted/ui.c:837
+msgid "Partition doesn't exist."
+msgstr "Partitie bestaat niet."
+
+#: parted/ui.c:857
+msgid "Expecting a file system type."
+msgstr "Een bestandssysteemsoort wordt verwacht."
+
+#: parted/ui.c:863
+#, c-format
+msgid "Unknown file system type \"%s\"."
+msgstr "Onbekende bestandssysteemsoort '%s'."
+
+#: parted/ui.c:883
+msgid "Expecting a disk label type."
+msgstr "Een schijflabeltype wordt verwacht."
+
+#: parted/ui.c:977
+msgid "Can't create any more partitions."
+msgstr "Kan geen nieuwe partities meer maken."
+
+#: parted/ui.c:987
+msgid "Expecting a partition type."
+msgstr "Een partitietype wordt verwacht."
+
+#: parted/ui.c:1115
+msgid "on"
+msgstr "aan"
+
+#: parted/ui.c:1116
+msgid "off"
+msgstr "uit"
+
+#: parted/ui.c:1227
+msgid "OPTIONs:"
+msgstr "OPTIEs:"
+
+#: parted/ui.c:1230
+msgid "COMMANDs:"
+msgstr "OPDRACHTen:"
+
+#: parted/ui.c:1238
+#, c-format
+msgid "Using %s\n"
+msgstr "%s wordt gebruikt\n"
diff --git a/po/nn.po b/po/nn.po
new file mode 100644
index 0000000..a6cefa5
--- /dev/null
+++ b/po/nn.po
@@ -0,0 +1,2509 @@
+# Norwegian nynorsk messages for GNU parted
+# Copyright (C) 2001 Free Software Foundation, Inc.
+# Kjetil Torgrim Homme <kjetilho@linpro.no>, 2001.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU parted 1.6.0-pre6\n"
+"Report-Msgid-Bugs-To: bug-parted@gnu.org\n"
+"POT-Creation-Date: 2006-04-21 21:20+0200\n"
+"PO-Revision-Date: 2002-04-03 02:36+0200\n"
+"Last-Translator: Kjetil Torgrim Homme <kjetilho@linpro.no>\n"
+"Language-Team: Norwegian nynorsk <i18n-nn@lister.ping.uio.no>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: libparted/arch/linux.c:284
+#, c-format
+msgid "Could not stat device %s - %s."
+msgstr "Kunne ikkje underskja eininga %s - %s."
+
+#: libparted/arch/linux.c:390
+#, c-format
+msgid ""
+"Could not determine sector size for %s: %s.\n"
+"Using the default sector size (%lld)."
+msgstr ""
+
+#: libparted/arch/linux.c:401
+#, c-format
+msgid ""
+"Device %s has a logical sector size of %lld. Not all parts of GNU Parted "
+"support this at the moment, and the working code is HIGHLY EXPERIMENTAL.\n"
+msgstr ""
+
+#: libparted/arch/linux.c:441
+#, fuzzy, c-format
+msgid "Unable to determine the size of %s (%s)."
+msgstr "Klarte ikkje finna storleiken til %s (%s)"
+
+#: libparted/arch/linux.c:530
+#, c-format
+msgid "Could not get identity of device %s - %s"
+msgstr "Kunne ikkje finna identiteten til eininga %s - %s"
+
+#: libparted/arch/linux.c:539
+msgid "Generic IDE"
+msgstr ""
+
+#: libparted/arch/linux.c:556
+#, c-format
+msgid ""
+"Device %s has multiple (%d) logical sectors per physical sector.\n"
+"GNU Parted supports this EXPERIMENTALLY for some special disk label/file "
+"system combinations, e.g. GPT and ext2/3.\n"
+"Please consult the web site for up-to-date information."
+msgstr ""
+
+#: libparted/arch/linux.c:726
+#, c-format
+msgid "Error initialising SCSI device %s - %s"
+msgstr "Initialisering av SCSI-eininga %s gav feil - %s"
+
+#: libparted/arch/linux.c:781
+#, c-format
+msgid ""
+"The device %s has zero length, and can't possibly store a file system or "
+"partition table. Perhaps you selected the wrong device?"
+msgstr ""
+
+#: libparted/arch/linux.c:829
+msgid ""
+"Unable to determine geometry of file/device. You should not use Parted "
+"unless you REALLY know what you're doing!"
+msgstr ""
+"Klarte ikkje finna geometrien til fila/eininga. Du br ikkje bruka Parted "
+"med mindre du VERKELEG veit kva du gjer!"
+
+#: libparted/arch/linux.c:903
+msgid "DAC960 RAID controller"
+msgstr "DAC960 RAID-kontroller"
+
+#: libparted/arch/linux.c:908
+msgid "Compaq Smart Array"
+msgstr "Compaq Smart Array"
+
+#: libparted/arch/linux.c:913
+msgid "ATARAID Controller"
+msgstr "ATARAID-kontroller"
+
+#: libparted/arch/linux.c:918
+msgid "I2O Controller"
+msgstr "I2O-kontroller"
+
+#: libparted/arch/linux.c:923
+msgid "User-Mode Linux UBD"
+msgstr ""
+
+#: libparted/arch/linux.c:933
+msgid "Unknown"
+msgstr "Ukjent"
+
+#: libparted/arch/linux.c:940
+msgid "ped_device_new() Unsupported device type"
+msgstr "ped_device_new() Einingstypen er ikkje sttta"
+
+#: libparted/arch/linux.c:1041 libparted/arch/gnu.c:264
+#, c-format
+msgid "Error opening %s: %s"
+msgstr "Feil ved opning av %s: %s"
+
+#: libparted/arch/linux.c:1052 libparted/arch/gnu.c:274
+#, c-format
+msgid "Unable to open %s read-write (%s). %s has been opened read-only."
+msgstr ""
+"Kunne ikkje opna %s for bde lesing og skriving (%s). %s er berre opna for "
+"lesing."
+
+#: libparted/arch/linux.c:1160 libparted/arch/linux.c:1228
+#: libparted/arch/gnu.c:452 libparted/arch/gnu.c:550 libparted/arch/gnu.c:678
+#, c-format
+msgid "%s during read on %s"
+msgstr "%s under lesing av %s"
+
+#: libparted/arch/linux.c:1199
+#, c-format
+msgid "%s during seek for read on %s"
+msgstr "%s under posisjonering fr lesing av %s"
+
+#: libparted/arch/linux.c:1270 libparted/arch/linux.c:1355
+#: libparted/arch/linux.c:1413 libparted/arch/gnu.c:587
+#: libparted/arch/gnu.c:632 libparted/arch/gnu.c:709
+#, c-format
+msgid "%s during write on %s"
+msgstr "%s under skriving til %s"
+
+#: libparted/arch/linux.c:1297 libparted/arch/gnu.c:512
+#, c-format
+msgid "Can't write to %s, because it is opened read-only."
+msgstr "Kan ikkje skriva til %s, sidan han berre er opna for lesing."
+
+#: libparted/arch/linux.c:1321
+#, c-format
+msgid "%s during seek for write on %s"
+msgstr "%s under posisjonering fr skriving til %s"
+
+#: libparted/arch/linux.c:1798
+#, fuzzy, c-format
+msgid ""
+"Error informing the kernel about modifications to partition %s -- %s. This "
+"means Linux won't know about any changes you made to %s until you reboot -- "
+"so you shouldn't mount it or use it in any way before rebooting."
+msgstr ""
+"Ein feil oppstod ved varsling av kjerna om endringane p partisjon %s - %s. "
+"Dette tyder at Linux ikkje veit om endringar du har gjort p %s fr etter "
+"omstart av maskinen, s du m ikkje montera han eller bruka han p nokon "
+"mte fr omstart."
+
+#: libparted/arch/linux.c:1879
+#, fuzzy, c-format
+msgid ""
+"The kernel was unable to re-read the partition table on %s (%s). This means "
+"Linux won't know anything about the modifications you made until you "
+"reboot. You should reboot your computer before doing anything with %s."
+msgstr ""
+"Kjerna klarte ikkje lesa partisjonstabellen p %s p nytt (%s). Dette "
+"tyder at Linux ikkje veit om endringane du har gjort. Du m ta omstart p "
+"maskinen din fr du gjer noko med %s."
+
+#: libparted/arch/gnu.c:97
+#, c-format
+msgid "Unable to open %s."
+msgstr "Kunne ikkje opna %s."
+
+#: libparted/arch/gnu.c:117
+msgid "Unable to probe store."
+msgstr "Kunne ikkje underskja lagringsmediet."
+
+#: libparted/arch/gnu.c:355
+#, fuzzy
+msgid ""
+"The partition table cannot be re-read. This means you need to reboot before "
+"mounting any modified partitions. You also need to reinstall your boot "
+"loader before you reboot (which may require mounting modified partitions). "
+"It is impossible do both things! So you'll need to boot off a rescue disk, "
+"and reinstall your boot loader from the rescue disk. Read section 4 of the "
+"Parted User documentation for more information."
+msgstr ""
+"Kjerna klarte ikkje lese partisjonstabellen p nytt, s du m starte om "
+"maskina fr du kan montera endra partisjonar. Du m ogs installera boot-"
+"lastaren p nytt fr omstarten (som kanskje krever at du monterer "
+"partisjonane du har endra). Det er umogleg gjere be delar! Start fr "
+"ein redningsdiskett, og reinstallere boot-lastaren fr redningsmiljet. Les "
+"del 4 i brukarhandboka for meir informasjon."
+
+#: libparted/arch/gnu.c:372
+#, fuzzy, c-format
+msgid ""
+"The partition table on %s cannot be re-read (%s). This means the Hurd knows "
+"nothing about any modifications you made. You should reboot your computer "
+"before doing anything with %s."
+msgstr ""
+"Partisjonstabellen p %s (%s). Det tyder at Hurd ikkje veit noko om "
+"endringar du har gjort. Datamaskinen m startast p nytt fr du gjer noko "
+"med %s."
+
+#: libparted/arch/gnu.c:383 parted/parted.c:2215
+msgid ""
+"You should reinstall your boot loader before rebooting. Read section 4 of "
+"the Parted User documentation for more information."
+msgstr ""
+"Du m installera boot-lastaren p nytt fr neste omstart. Les del 4 i "
+"brukarhandboka for meir informasjon."
+
+#: libparted/arch/gnu.c:774
+#, c-format
+msgid "%s trying to sync %s to disk"
+msgstr "Fekk feilmeldinga %s ved forsk p synkronisera %s til disk"
+
+#: libparted/disk.c:183
+#, c-format
+msgid "Unable to open %s - unrecognised disk label."
+msgstr "Kunne ikkje opne %s - ukjent disklabel."
+
+#: libparted/disk.c:452
+#, c-format
+msgid ""
+"This libparted doesn't have write support for %s. Perhaps it was compiled "
+"read-only."
+msgstr ""
+"Dette libparted-biblioteket har ikkje sttte for skriving til %s. Kanskje "
+"vart det kompilert for kun lesing."
+
+#: libparted/disk.c:579
+#, fuzzy, c-format
+msgid "Partition %d is %s, but the file system is %s."
+msgstr "Partisjonen %d er %.3f MiB, men filsystemet er %.3f MiB."
+
+#: libparted/disk.c:1056
+#, c-format
+msgid "%s disk labels do not support extended partitions."
+msgstr "Ein %s-disklabel stttar ikkje utvidingspartisjonar."
+
+#: libparted/disk.c:1616
+#, c-format
+msgid "%s disk labels don't support logical or extended partitions."
+msgstr "%s-disklablar stttar ikkje logiske eller utvidingspartisjonar."
+
+#: libparted/disk.c:1629
+#, fuzzy
+msgid "Too many primary partitions."
+msgstr "For mange primrpartisjonar"
+
+#: libparted/disk.c:1638
+#, c-format
+msgid ""
+"Can't add a logical partition to %s, because there is no extended partition."
+msgstr ""
+"Kan ikkje leggja ein logisk partisjon til %s, sidan der ikkje er nokon "
+"utvidingspartisjon."
+
+#: libparted/disk.c:1662
+#, fuzzy, c-format
+msgid "Can't have more than one extended partition on %s."
+msgstr "Kan ikkje ha meir enn in utvidingspartisjon p %s"
+
+#: libparted/disk.c:1672
+msgid "Can't have logical partitions outside of the extended partition."
+msgstr "Kan ikkje ha logisk partisjonar utanfor utvidingspartisjonen."
+
+#: libparted/disk.c:1697
+#, c-format
+msgid "Can't have a logical partition outside of the extended partition on %s."
+msgstr ""
+"Ein logisk partisjon kan ikkje liggja utanfor utvidingspartisjonen p %s."
+
+#: libparted/disk.c:1707 libparted/disk.c:1761 libparted/disk.c:1927
+#, fuzzy
+msgid "Can't have overlapping partitions."
+msgstr "Partisjonar kan ikkje overlappa kvarandre."
+
+#: libparted/disk.c:1715
+msgid "Can't have a primary partition inside an extended partition."
+msgstr "Ein primrpartisjon kan ikkje liggja inne i ein utvidingspartisjon."
+
+#: libparted/disk.c:2123
+msgid "metadata"
+msgstr "metadata"
+
+#: libparted/disk.c:2125
+msgid "free"
+msgstr "ledig"
+
+#: libparted/disk.c:2127 parted/ui.c:968 parted/ui.c:996
+msgid "extended"
+msgstr "utviding"
+
+#: libparted/disk.c:2129 parted/ui.c:972 parted/ui.c:1000
+msgid "logical"
+msgstr "logisk"
+
+#: libparted/disk.c:2131 parted/ui.c:964 parted/ui.c:992
+msgid "primary"
+msgstr "primr"
+
+#: libparted/disk.c:2147
+msgid "boot"
+msgstr "boot"
+
+#: libparted/disk.c:2149
+msgid "root"
+msgstr "rot"
+
+#: libparted/disk.c:2151
+msgid "swap"
+msgstr "swap"
+
+#: libparted/disk.c:2153
+msgid "hidden"
+msgstr "skjult"
+
+#: libparted/disk.c:2155
+msgid "raid"
+msgstr "raid"
+
+#: libparted/disk.c:2157
+msgid "lvm"
+msgstr "lvm"
+
+#: libparted/disk.c:2159
+msgid "lba"
+msgstr "lba"
+
+#: libparted/disk.c:2161
+msgid "hp-service"
+msgstr ""
+
+#: libparted/disk.c:2163
+msgid "palo"
+msgstr ""
+
+#: libparted/disk.c:2165
+#, fuzzy
+msgid "prep"
+msgstr "boot"
+
+#: libparted/disk.c:2167
+msgid "msftres"
+msgstr ""
+
+#: libparted/disk.c:2173
+#, fuzzy, c-format
+msgid "Unknown partition flag, %d."
+msgstr "Ukjent partisjonsflagg, %d."
+
+#: libparted/labels/rdb.c:177
+#, c-format
+msgid "%s : Bad checksum on block %llu of type %s."
+msgstr ""
+
+#: libparted/labels/rdb.c:510
+#, c-format
+msgid "%s : Didn't find rdb block, should never happen."
+msgstr ""
+
+#: libparted/labels/rdb.c:595
+#, c-format
+msgid "%s : Loop detected at block %d."
+msgstr ""
+
+#: libparted/labels/rdb.c:614
+#, c-format
+msgid "%s : The %s list seems bad at block %s."
+msgstr ""
+
+#: libparted/labels/rdb.c:703
+#, c-format
+msgid "%s : Failed to list bad blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:711
+#, c-format
+msgid "%s : Failed to list partition blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:719
+#, c-format
+msgid "%s : Failed to list file system blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:727
+#, c-format
+msgid "%s : Failed to list boot blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:750
+#, fuzzy, c-format
+msgid "Failed to write partition block at %d."
+msgstr "Kunne ikkje avgjera om partisjonen er montert."
+
+#: libparted/labels/rdb.c:1053 libparted/labels/bsd.c:505
+#: libparted/labels/dos.c:1942 libparted/labels/dvh.c:772
+#: libparted/labels/gpt.c:1365 libparted/labels/loop.c:251
+#: libparted/labels/mac.c:1318 libparted/labels/pc98.c:764
+#: libparted/labels/sun.c:704
+msgid "Unable to satisfy all constraints on the partition."
+msgstr "Kunne ikkje oppfylla alle dei tekniske krava til partisjonen."
+
+#: libparted/labels/rdb.c:1081
+#, fuzzy
+msgid "Unable to allocate a partition number."
+msgstr "Forventa eit partisjonsnummer."
+
+#: libparted/labels/bsd.c:530
+#, fuzzy
+msgid "Unable to allocate a bsd disklabel slot."
+msgstr "Kunne ikkje tilordna plass i BSD-disklabel."
+
+#: libparted/labels/dos.c:812
+#, fuzzy, c-format
+msgid "Invalid partition table on %s -- wrong signature %x."
+msgstr "Ugyldig partisjonstabell p %s - feil signatur %x"
+
+#: libparted/labels/dos.c:840
+#, c-format
+msgid "Invalid partition table - recursive partition on %s."
+msgstr "Ugyldig partisjonstabell - rekursiv partisjon p %s."
+
+#: libparted/labels/dos.c:1300
+msgid "Extended partitions cannot be hidden on msdos disk labels."
+msgstr ""
+
+#: libparted/labels/dos.c:1926
+msgid "Parted can't resize partitions managed by Windows Dynamic Disk."
+msgstr ""
+
+# checkit
+#: libparted/labels/dvh.c:192
+#, fuzzy, c-format
+msgid "%s has no extended partition (volume header partition)."
+msgstr ""
+"%s har ingen utvidingspartisjon (volume header-partisjon). Om du overser "
+"denne meldinga, vil eventuelle bootvolum verta sletta."
+
+#: libparted/labels/dvh.c:315
+msgid "Checksum is wrong, indicating the partition table is corrupt."
+msgstr "Sjekksummen er feil, og det tyder p at partisjonstabellen er korrupt."
+
+#: libparted/labels/dvh.c:616
+msgid "Only primary partitions can be root partitions."
+msgstr "Berre primrpartisjonar kan vere rotpartisjonar."
+
+#: libparted/labels/dvh.c:630
+msgid "Only primary partitions can be swap partitions."
+msgstr "Berre primrpartisjonar kan vere swap-partisjonar."
+
+# checkit
+#: libparted/labels/dvh.c:644
+msgid "Only logical partitions can be a boot file."
+msgstr "Berre logiske partisjonar kan vera ei bootfil."
+
+# checkit
+#: libparted/labels/dvh.c:723
+msgid "Only logical partitions (boot files) have a name."
+msgstr "Berre logiske partisjonar (bootfiler) kan ha namn."
+
+#: libparted/labels/dvh.c:814
+msgid "Too many primary partitions"
+msgstr "For mange primrpartisjonar"
+
+#: libparted/labels/gpt.c:433
+#, fuzzy, c-format
+msgid ""
+"%s contains GPT signatures, indicating that it has a GPT table. However, it "
+"does not have a valid fake msdos partition table, as it should. Perhaps it "
+"was corrupted -- possibly by a program that doesn't understand GPT partition "
+"tables. Or perhaps you deleted the GPT table, and are now using an msdos "
+"partition table. Is this a GPT partition table?"
+msgstr ""
+"%s inneheld GPT-signaturar, som tyder p at han har ein GPT-tabell. Men han "
+"har ikkje ein gyldig falsk MSDOS-partisjonstabell slik han skulle. Kanskje "
+"vart han ydelagt, t.d. av eit program som ikkje forstr GPT-"
+"partisjonstabellar. Eller kanskje du har sletta GPT-tabellen og brukar no "
+"ein MSDOS-partisjonstabell. Er dette ein GPT-partisjonstabell?"
+
+#: libparted/labels/gpt.c:625
+#, fuzzy, c-format
+msgid ""
+"The format of the GPT partition table is version %x, which is newer than "
+"what Parted can recognise. Please tell us! bug-parted@gnu.org"
+msgstr ""
+"Formatet til GPT-partisjonstabellen er nyare enn det Parted kan kjenne att. "
+"Ver venleg seia i fr med ein epost til <bug-parted@gnu.org> (skriv helst "
+"p engelsk)"
+
+#: libparted/labels/gpt.c:747
+msgid ""
+"The backup GPT table is not at the end of the disk, as it should be. This "
+"might mean that another operating system believes the disk is smaller. Fix, "
+"by moving the backup to the end (and removing the old backup)?"
+msgstr ""
+"Sikringskopien av GPT-tabellen er ikkje sist p disken slik han skal vera. "
+"Dette kan tyda at eit anna operativsystem trur at disken er mindre. Skal "
+"dette rettast ved flytta kopien til slutten av disken (og sletta den gamle "
+"kopien)?"
+
+#: libparted/labels/gpt.c:782
+#, fuzzy
+msgid ""
+"The primary GPT table is corrupt, but the backup appears OK, so that will be "
+"used."
+msgstr ""
+"GPT-tabellen er korrupt, men sikringskopien ser frisk ut, s kopien vert "
+"brukt."
+
+#: libparted/labels/gpt.c:790
+#, fuzzy
+msgid ""
+"Both the primary and backup GPT tables are corrupt. Try making a fresh "
+"table, and using Parted's rescue feature to recover partitions."
+msgstr ""
+"Bde originalen og kopien av GPT-tabellen er korrupt. Prv laga ein ny "
+"tom tabell, og bruk Parteds redningsmodus til finna partisjonane."
+
+#: libparted/labels/mac.c:167
+#, c-format
+msgid "Invalid signature %x for Mac disk labels."
+msgstr "Ugyldig signatur %x for ein Mac-disklabel."
+
+#: libparted/labels/mac.c:212
+msgid "Partition map has no partition map entry!"
+msgstr "Partisjonskartet inneheld ingen oppfringar!"
+
+#: libparted/labels/mac.c:259
+#, c-format
+msgid "%s is too small for a Mac disk label!"
+msgstr "%s er for liten for ein Mac-disklabel!"
+
+#: libparted/labels/mac.c:490
+#, c-format
+msgid "Partition %d has an invalid signature %x."
+msgstr "Partisjon %d har ein ugyldig signatur %x."
+
+#: libparted/labels/mac.c:508
+#, c-format
+msgid "Partition %d has an invalid length of 0 bytes!"
+msgstr "Partisjon %d har ei ugyldig lengde p 0 oktettar!"
+
+#: libparted/labels/mac.c:536
+#, fuzzy
+msgid "The data region doesn't start at the start of the partition."
+msgstr "Dataregionen startar ikkje p starten av partisjonen"
+
+#: libparted/labels/mac.c:553
+#, fuzzy
+msgid "The boot region doesn't start at the start of the partition."
+msgstr "Bootregionen startar ikkje p starten av partisjonen"
+
+#: libparted/labels/mac.c:567
+msgid "The partition's boot region doesn't occupy the entire partition."
+msgstr "Bootregionen fyller ikkje heile partisjonen."
+
+#: libparted/labels/mac.c:577
+msgid "The partition's data region doesn't occupy the entire partition."
+msgstr "Dataregionen fyller ikkje heile partisjonen."
+
+#: libparted/labels/mac.c:631
+#, c-format
+msgid ""
+"Weird block size on device descriptor: %d bytes is not divisible by 512."
+msgstr ""
+"Merkeleg blokkstorleik p einingsdeskriptor: %d oktettar er ikkje deleleg p "
+"512."
+
+#: libparted/labels/mac.c:644
+#, c-format
+msgid ""
+"The driver descriptor says the physical block size is %d bytes, but Linux "
+"says it is %d bytes."
+msgstr ""
+"Drivardeskriptoren seier at den fysiske blokkstorleiken er %d oktettar, men "
+"Linux seier at han er %d oktettar."
+
+#: libparted/labels/mac.c:692
+msgid "No valid partition map found."
+msgstr "Fann ikkje noko gyldig partisjonskart."
+
+#: libparted/labels/mac.c:744
+#, fuzzy, c-format
+msgid ""
+"Conflicting partition map entry sizes! Entry 1 says it is %d, but entry %d "
+"says it is %d!"
+msgstr ""
+"Motstridande storleikar i partisjonskartet! Oppfring 1 seier at han er %d, "
+"men oppfring %d seier at han er %d!"
+
+#: libparted/labels/mac.c:771
+#, fuzzy
+msgid "Weird! There are 2 partitions map entries!"
+msgstr "Merkeleg - to partisjonskartoppfringar!"
+
+#: libparted/labels/mac.c:1257
+msgid ""
+"Changing the name of a root or swap partition will prevent Linux from "
+"recognising it as such."
+msgstr ""
+"Endrar du namnet p ein rot- eller swap-partisjon, vil ikkje Linux lenger "
+"kjenna han igjen."
+
+#: libparted/labels/mac.c:1353
+#, fuzzy
+msgid "Can't add another partition -- the partition map is too small!"
+msgstr "Kan ikkje leggja til ein partisjon til - partisjonskartet er for lite!"
+
+#: libparted/labels/pc98.c:357
+#, fuzzy, c-format
+msgid "Invalid partition table on %s."
+msgstr "Ugyldig partisjonstabell p %s"
+
+#: libparted/labels/pc98.c:409 libparted/labels/pc98.c:487
+#, fuzzy, c-format
+msgid ""
+"Partition %d isn't aligned to cylinder boundaries. This is still "
+"unsupported."
+msgstr ""
+"Partisjon %d ligg ikkje nyaktig p grensa mellom to sylinderar. Det "
+"manglar sttte for dette."
+
+#: libparted/labels/pc98.c:796
+msgid "Can't add another partition."
+msgstr "Kan ikkje leggje til ein partisjon til."
+
+#: libparted/labels/sun.c:143
+msgid "Corrupted Sun disk label detected."
+msgstr "ydelagd Sun-disklabel funne."
+
+#: libparted/labels/sun.c:264
+#, fuzzy, c-format
+msgid ""
+"The disk CHS geometry (%d,%d,%d) reported by the operating system does not "
+"match the geometry stored on the disk label (%d,%d,%d)."
+msgstr ""
+"Geometrien til disken (C=%d,H=%d,S=%d) stemmer ikkje med geometrien i "
+"disklabelen (C=%d,H=%d,S=%d)."
+
+#: libparted/labels/sun.c:286
+#, c-format
+msgid "The disk label describes a disk bigger than %s."
+msgstr "Disklabelen skildrar ein disk strre enn %s."
+
+#: libparted/labels/sun.c:440
+#, c-format
+msgid "The disk has %d cylinders, which is greater than the maximum of 65536."
+msgstr ""
+
+#: libparted/labels/sun.c:736
+msgid ""
+"The Whole Disk partition is the only available one left. Generally, it is "
+"not a good idea to overwrite this partition with a real one. Solaris may "
+"not be able to boot without it, and SILO (the sparc boot loader) appreciates "
+"it as well."
+msgstr ""
+"Partisjonen som omfattar heile disken er den einaste som er ledig. Det er "
+"vanlegvis ikkje nokon god id bruka dette som ein vanleg partisjon. "
+"Solaris klarer kanskje ikkje starta utan han, og SILO (boot-lastar for "
+"SPARC) likar det heller ikkje."
+
+#: libparted/labels/sun.c:751
+msgid "Sun disk label is full."
+msgstr "Sun-disklabel er full."
+
+#: libparted/filesys.c:386
+msgid "Could not detect file system."
+msgstr "Kan ikkje kjenna igjen noko filsystem."
+
+#: libparted/filesys.c:397
+#, fuzzy
+msgid "The file system is bigger than its volume!"
+msgstr "Filsystemet er strre enn volumet det ligg p!"
+
+#: libparted/filesys.c:405
+#, c-format
+msgid "Support for opening %s file systems is not implemented yet."
+msgstr "Sttte for opna %s-filsystem er ikkje lagt inn enno."
+
+#: libparted/filesys.c:447
+#, c-format
+msgid "Support for creating %s file systems is not implemented yet."
+msgstr "Sttte for laga %s-filsystem er ikkje lagt inn enno."
+
+#: libparted/filesys.c:508
+#, c-format
+msgid "Support for checking %s file systems is not implemented yet."
+msgstr "Sttte for sjekke %s-filsystem for feil er ikkje lagt inn enno."
+
+#: libparted/filesys.c:574
+msgid "raw block copying"
+msgstr "r blokkopiering"
+
+#: libparted/filesys.c:585
+msgid "growing file system"
+msgstr "aukar storleik p filsystemet"
+
+#: libparted/filesys.c:625
+msgid "Can't copy onto an overlapping partition."
+msgstr "Kan ikkje kopiera inn i ein overlappande partisjon."
+
+#: libparted/filesys.c:647
+#, fuzzy, c-format
+msgid ""
+"Direct support for copying file systems is not yet implemented for %s. "
+"However, support for resizing is implemented. Therefore, the file system "
+"can be copied if the new partition is at least as big as the old one. So, "
+"either shrink the partition you are trying to copy, or copy to a bigger "
+"partition."
+msgstr ""
+" kopiera filsystemet er ikkje direkte sttta for %s. Men, sttte for "
+"endra storleik er med, s filsystemet kan kopierast viss den nye partisjonen "
+"er minst like stor som den gamle. Du m alts anten krympe partisjonen du "
+"prver kopiera, eller kopiera til ein strre partisjon."
+
+#: libparted/filesys.c:661
+#, c-format
+msgid "Support for copying %s file systems is not implemented yet."
+msgstr "Sttte for kopiera %s-filsystem er ikkje lagt inn enno."
+
+#: libparted/filesys.c:699
+#, c-format
+msgid "Support for resizing %s file systems is not implemented yet."
+msgstr "Sttte for endre storleik p %s-filsystem er ikkje lagt inn enno."
+
+#: libparted/exception.c:78
+msgid "Information"
+msgstr "Informasjon"
+
+#: libparted/exception.c:79
+msgid "Warning"
+msgstr "tvaring"
+
+#: libparted/exception.c:80
+msgid "Error"
+msgstr "Feil"
+
+#: libparted/exception.c:81
+msgid "Fatal"
+msgstr "Kritisk"
+
+#: libparted/exception.c:82
+msgid "Bug"
+msgstr "Programfeil"
+
+#: libparted/exception.c:83
+msgid "No Implementation"
+msgstr "Ikkje laga"
+
+#: libparted/exception.c:87
+msgid "Fix"
+msgstr "Rett opp"
+
+#: libparted/exception.c:88
+msgid "Yes"
+msgstr "Ja"
+
+#: libparted/exception.c:89
+msgid "No"
+msgstr "Nei"
+
+#: libparted/exception.c:90
+msgid "OK"
+msgstr "OK"
+
+#: libparted/exception.c:91
+msgid "Retry"
+msgstr "Prv igjen"
+
+#: libparted/exception.c:92
+msgid "Ignore"
+msgstr "Oversj"
+
+#: libparted/exception.c:93
+msgid "Cancel"
+msgstr "Avbryt"
+
+#: libparted/exception.c:133
+#, fuzzy, c-format
+msgid ""
+"A bug has been detected in GNU Parted. Refer to the web site of parted "
+"http://www.gnu.org/software/parted/parted.html for more informations of what "
+"could be useful for bug submitting! Please email a bug report to bug-"
+"parted@gnu.org containing at least the version (%s) and the following "
+"message: "
+msgstr ""
+"Ein programfeil oppstod i GNU Parted. Ver venleg senda ei feilmelding til "
+"bug-parted@gnu.org der du oppgjev versjonsnummeret (%s) og fylgjande melding:"
+
+#: libparted/cs/geom.c:162
+msgid "Can't have the end before the start!"
+msgstr "Kan ikkje ha slutten fr starten!"
+
+#: libparted/cs/geom.c:169
+msgid "Can't have a partition outside the disk!"
+msgstr "Kan ikkje ha ein partisjon utanfor disken!"
+
+#: libparted/cs/geom.c:303
+#, fuzzy, c-format
+msgid "Attempt to read sectors %ld-%ld outside of partition on %s."
+msgstr "Prvde lesa sektorane %ld-%ld utanfor partisjonen p %s"
+
+#: libparted/cs/geom.c:373
+#, fuzzy, c-format
+msgid "Attempt to write sectors %ld-%ld outside of partition on %s."
+msgstr "Prvde skrive sektorane %ld-%ld utanfor partisjonen p %s"
+
+#: libparted/cs/geom.c:413 libparted/fs/linux_swap/linux_swap.c:353
+msgid "checking for bad blocks"
+msgstr "ser etter drlege blokker"
+
+#: libparted/libparted.c:286 libparted/libparted.c:306
+msgid "Out of memory."
+msgstr "Tom for minne."
+
+#: libparted/unit.c:139
+msgid "Cannot get unit size for special unit 'COMPACT'."
+msgstr ""
+
+#: libparted/unit.c:382
+#, c-format
+msgid "\"%s\" has invalid syntax for locations."
+msgstr ""
+
+#: libparted/unit.c:390
+#, c-format
+msgid "The maximum head value is %d."
+msgstr ""
+
+#: libparted/unit.c:397
+#, c-format
+msgid "The maximum sector value is %d."
+msgstr ""
+
+#: libparted/unit.c:409 libparted/unit.c:540
+#, c-format
+msgid "The location %s is outside of the device %s."
+msgstr ""
+
+#: libparted/unit.c:522
+msgid "Invalid number."
+msgstr ""
+
+#: libparted/fs/ext2/ext2.c:87 libparted/fs/ext2/ext2.c:112
+msgid "Inconsistent group descriptors!"
+msgstr "Inkonsistente gruppe-deskriptorar"
+
+#: libparted/fs/ext2/ext2.c:91 libparted/fs/ext2/ext2.c:116
+#, fuzzy
+msgid "File system full!"
+msgstr "Filsystemet er fullt!"
+
+#: libparted/fs/ext2/ext2.c:750
+#, fuzzy
+msgid "Invalid superblock. Are you sure this is an ext2 file system?"
+msgstr "Ugyldig superblokk. Er du sikker p at dette er eit ext2-filsystem?"
+
+#: libparted/fs/ext2/ext2.c:764 libparted/fs/ext2/ext2_resize.c:597
+#, fuzzy
+msgid "File system has errors! You should run e2fsck."
+msgstr "Der er feil p filsystemet! Kyr e2fsck frst."
+
+#: libparted/fs/ext2/ext2.c:775
+#, fuzzy
+msgid ""
+"File system was not cleanly unmounted! You should run e2fsck. Modifying an "
+"unclean file system could cause severe corruption."
+msgstr "Filsystemet vart ikkje avmontert p ein pen mte. Du m kyra e2fsck."
+
+#: libparted/fs/ext2/ext2.c:795
+#, fuzzy
+msgid "File system has an incompatible feature enabled."
+msgstr "Filsystemet brukar finessar GNU parted ikkje stttar"
+
+#: libparted/fs/ext2/ext2.c:806
+msgid "Error allocating buffer cache."
+msgstr "Kunne ikkje allokera buffercache."
+
+#: libparted/fs/ext2/ext2.c:848
+msgid ""
+"A resize operation on this file system will use EXPERIMENTAL code that MAY "
+"CORRUPT it (although it hasn't done so yet).You should at least backup your "
+"data and run 'e2fsck -f' afterwards."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:114
+#, fuzzy
+msgid ""
+"Found an inode with a incorrect link count. Better go run e2fsck first!"
+msgstr "Fann ein inode med feil tal p lenkar. Du br kyra e2fsck frst."
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:487
+msgid "Not enough free inodes!"
+msgstr "For f ledige inodar!"
+
+#: libparted/fs/ext2/ext2_resize.c:224
+#, fuzzy
+msgid "File system is too full to remove a group!"
+msgstr "Filsystemet er for fullt til sletta ei gruppe!"
+
+#: libparted/fs/ext2/ext2_resize.c:233
+#, fuzzy
+msgid "File system has too many allocated inodes to remove a group!"
+msgstr "Filsystemet har for mange inodar i bruk til slette ei gruppe!"
+
+#: libparted/fs/ext2/ext2_resize.c:493
+msgid "adding groups"
+msgstr "legg til grupper"
+
+#: libparted/fs/ext2/ext2_resize.c:530
+#, fuzzy, c-format
+msgid "Your file system is too full to resize it to %i blocks. Sorry."
+msgstr ""
+"Filsystemet er for fullt til at ein kan endre storleiken til %i blokker. "
+"Beklagar."
+
+#: libparted/fs/ext2/ext2_resize.c:540
+#, fuzzy, c-format
+msgid ""
+"Your file system has too many occupied inodes to resize it to %i blocks. "
+"Sorry."
+msgstr ""
+"Filsystemet har for mange inodar i bruk til at ein kan endre storleiken til %"
+"i blokker. Beklagar."
+
+#: libparted/fs/ext2/ext2_resize.c:554 libparted/fs/hfs/hfs.c:243
+#: libparted/fs/hfs/hfs.c:624
+msgid "shrinking"
+msgstr "krympar"
+
+#: libparted/fs/ext2/ext2_resize.c:605
+#, fuzzy
+msgid "File system was not cleanly unmounted! You should run e2fsck."
+msgstr "Filsystemet vart ikkje avmontert p ein pen mte. Du m kyra e2fsck."
+
+#: libparted/fs/ext2/ext2_resize.c:614
+msgid ""
+"The file system has the 'dir_index' feature enabled. Parted can only resize "
+"the file system if it disables this feature. You can enable it later by "
+"running 'tune2fs -O dir_index DEVICE' and then 'e2fsck -fD DEVICE'."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_block_relocator.c:198
+#, fuzzy
+msgid "Cross-linked blocks found! Better go run e2fsck first!"
+msgstr "Krysslenka blokker funne! Kyr e2fsck frst!"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:537
+#, fuzzy, c-format
+msgid "Block %i has no reference? Weird."
+msgstr "Blokk %i har ingen referansar til seg? Rart"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:738
+#, c-format
+msgid "Block %i shouldn't have been marked!"
+msgstr "Blokk %i burde ikkje ha vore merka!"
+
+#: libparted/fs/ext2/interface.c:188
+#, fuzzy
+msgid ""
+"The ext2 file system passed a basic check. For a more comprehensive check, "
+"use the e2fsck program."
+msgstr ""
+"Ext2-filsystemet gjekk gjennom ein enkel sjekk. For ein meir grundig sjekk, "
+"bruk programmet e2fsck."
+
+#: libparted/fs/ext2/interface.c:205
+msgid "Sorry, can't move the start of ext2 partitions yet!"
+msgstr "Beklagar, kan ikkje flytte starten p ein ext2-partisjon enno!"
+
+#: libparted/fs/ext2/ext2_buffer.c:82
+msgid "Couldn't flush buffer cache!"
+msgstr "Kunne ikkje lagra buffercache til disk!"
+
+#: libparted/fs/ext2/ext2_mkfs.c:162
+msgid "writing per-group metadata"
+msgstr "skriv per-gruppe metadata"
+
+#: libparted/fs/ext2/ext2_mkfs.c:565
+msgid "File system too small for ext2."
+msgstr ""
+
+#: libparted/fs/fat/calc.c:134
+#, fuzzy, c-format
+msgid ""
+"You need %s of free disk space to shrink this partition to this size. "
+"Currently, only %s is free."
+msgstr ""
+"Du treng %d MiB med ledig diskplass for krympa partisjonen til denne "
+"storleiken (du har for tida berre %d MiB ledig)"
+
+#: libparted/fs/fat/context.c:55
+#, c-format
+msgid ""
+"Cluster start delta = %d, which is not a multiple of the cluster size %d."
+msgstr ""
+"Allokeringseininga sitt start delta = %d, som ikkje er eit multiplum av "
+"storleiken %d."
+
+#: libparted/fs/fat/fat.c:312
+#, fuzzy, c-format
+msgid "Partition too big/small for a %s file system."
+msgstr "Partisjonen er for liten eller stor for eit %s-filsystem"
+
+#: libparted/fs/fat/fat.c:478
+msgid ""
+"The FATs don't match. If you don't know what this means, then select "
+"cancel, run scandisk on the file system, and then come back."
+msgstr ""
+"FAT-ane stemmer ikkje overeins. Viss du ikkje veit kva dette tyder, vel "
+"avbryt, kyr scandisk p filsystem, og kom attende."
+
+#: libparted/fs/fat/fat.c:518
+msgid "There are no possible configurations for this FAT type."
+msgstr "Der er ingen moglege konfigurasjonar for denne FAT-typen."
+
+#: libparted/fs/fat/fat.c:530
+#, c-format
+msgid ""
+"File system doesn't have expected sizes for Windows to like it. Cluster "
+"size is %dk (%dk expected); number of clusters is %d (%d expected); size of "
+"FATs is %d sectors (%d expected)."
+msgstr ""
+"Filsystemet har ikkje parametrar som Windows vil like. Allokeringseininga "
+"er %d KiB (%d KiB er forventa), talet p allokeringseiningar er %d (%d er "
+"forventa), FAT-ane er p %d sektorar (%d er forventa)."
+
+#: libparted/fs/fat/fat.c:553
+#, c-format
+msgid ""
+"File system is reporting the free space as %d clusters, not %d clusters."
+msgstr ""
+"Filsystemet rapporterer %d allokeringseiningar med ledig plass, ikkje %d."
+
+#: libparted/fs/fat/fat.c:878
+#, fuzzy
+msgid ""
+"GNU Parted was miscompiled: the FAT boot sector should be 512 bytes. FAT "
+"support will be disabled."
+msgstr ""
+"GNU parted er feilkompilert: ein bootsektor i FAT skal vere 512 oktettar. "
+"FAT-sttte er no skrudd av."
+
+#: libparted/fs/fat/resize.c:158
+#, fuzzy
+msgid ""
+"There's not enough room in the root directory for all of the files. Either "
+"cancel, or ignore to lose the files."
+msgstr ""
+"Der er ikkje plass i toppkatalogen til alle filene. Vel anten avbryt,\n"
+"eller oversj feilen for misse alle filene."
+
+#: libparted/fs/fat/resize.c:299
+msgid "Error writing to the root directory."
+msgstr "Feil ved skriving til toppkatalogen."
+
+#: libparted/fs/fat/resize.c:484
+#, fuzzy
+msgid "If you leave your file system as FAT16, then you will have no problems."
+msgstr "Viss du let filsystemet vere FAT16, vil du ikkje ha nokon problem."
+
+#: libparted/fs/fat/resize.c:487
+msgid ""
+"If you convert to FAT16, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual)."
+msgstr ""
+"Viss du konverterer til FAT16, og MS Windows er installert p denne "
+"partisjonen, m du leggje inn boot-lastaren til MS Windows p nytt. Dersom "
+"du vil gjere dette, br du lese Parted-manualen (eller manualen som hyrer "
+"til distribusjonen din)."
+
+#: libparted/fs/fat/resize.c:495
+msgid ""
+"If you leave your file system as FAT32, then you will not introduce any new "
+"problems."
+msgstr "Viss du let filsystemet vere FAT32, vil du ikkje f nokon nye problem."
+
+#: libparted/fs/fat/resize.c:499
+msgid ""
+"If you convert to FAT32, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual). Also, "
+"converting to FAT32 will make the file system unreadable by MS DOS, MS "
+"Windows 95a, and MS Windows NT."
+msgstr ""
+"Viss du konverterer til FAT32, og MS Windows er installert p denne "
+"partisjonen, m du leggje inn boot-lastaren til MS Windows p nytt. Dersom "
+"du vil gjere dette, br du lese Parted-manualen (eller manualen som hyrer "
+"til distribusjonen din). FAT32 er ogs uleseleg for MS-DOS, MS Windows 95a "
+"og NT."
+
+#: libparted/fs/fat/resize.c:513
+#, c-format
+msgid "%s %s %s"
+msgstr "%s %s %s"
+
+#: libparted/fs/fat/resize.c:514
+msgid "Would you like to use FAT32?"
+msgstr "nskjer du bruke FAT32?"
+
+#: libparted/fs/fat/resize.c:541 libparted/fs/fat/resize.c:557
+#, c-format
+msgid "%s %s"
+msgstr "%s %s"
+
+#: libparted/fs/fat/resize.c:542
+msgid ""
+"The file system can only be resized to this size by converting to FAT16."
+msgstr "Filsystemet kan kun f denne storleiken ved konvertere til FAT16."
+
+#: libparted/fs/fat/resize.c:558
+msgid ""
+"The file system can only be resized to this size by converting to FAT32."
+msgstr "Filsystemet kan kun f denne storleiken ved konvertere til FAT32."
+
+#: libparted/fs/fat/resize.c:571
+#, fuzzy
+msgid ""
+"GNU Parted cannot resize this partition to this size. We're working on it!"
+msgstr ""
+"GNU Parted kan ikkje endre storleiken til dette. Vi arbeider med saka!"
+
+#: libparted/fs/fat/bootsector.c:48 libparted/fs/fat/bootsector.c:55
+msgid "File system has an invalid signature for a FAT file system."
+msgstr "Filsystemet har ein ugyldig signatur til vere eit FAT-filsystem."
+
+#: libparted/fs/fat/bootsector.c:62
+msgid "File system has an invalid sector size for a FAT file system."
+msgstr ""
+"Filsystemet har ein ugyldig sektorstorleik til vere eit FAT-filsystem."
+
+#: libparted/fs/fat/bootsector.c:69
+#, fuzzy
+msgid "File system has an invalid cluster size for a FAT file system."
+msgstr ""
+"Filsystemet har ein ugyldig sektorstorleik til vere eit FAT-filsystem."
+
+#: libparted/fs/fat/bootsector.c:76
+#, fuzzy
+msgid ""
+"File system has an invalid number of reserved sectors for a FAT file system."
+msgstr ""
+"Filsystemet har eit ugyldig tal p reserverte sektorar til vere eit FAT-"
+"filsystem"
+
+#: libparted/fs/fat/bootsector.c:83
+#, fuzzy
+msgid "File system has an invalid number of FATs."
+msgstr "Filsystemet har eit ugyldig tal p FAT-ar."
+
+#: libparted/fs/fat/bootsector.c:138
+#, c-format
+msgid ""
+"This file system has a logical sector size of %d. GNU Parted is known not "
+"to work properly with sector sizes other than 512 bytes."
+msgstr ""
+"Dette filsystemet har ein logisk sektorstorleik p %d. GNU Parted fungerer "
+"berre skikkeleg nr sektorstorleiken er 512 oktettar."
+
+#: libparted/fs/fat/bootsector.c:163
+#, c-format
+msgid ""
+"The file system's CHS geometry is (%d, %d, %d), which is invalid. The "
+"partition table's CHS geometry is (%d, %d, %d). If you select Ignore, the "
+"file system's CHS geometry will be left unchanged. If you select Fix, the "
+"file system's CHS geometry will be set to match the partition table's CHS "
+"geometry."
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:209
+msgid "FAT boot sector says logical sector size is 0. This is weird. "
+msgstr ""
+"Bootsektoren i FAT seier at logisk sektorstorleik er 0. Det var rart. "
+
+#: libparted/fs/fat/bootsector.c:215
+msgid "FAT boot sector says there are no FAT tables. This is weird. "
+msgstr ""
+"Bootsektoren i FAT seeier at der ikkje er nokon FAT-tabellar. Det var rart. "
+
+#: libparted/fs/fat/bootsector.c:221
+msgid "FAT boot sector says clusters are 0 sectors. This is weird. "
+msgstr ""
+"Bootsektoren i FAT seier at allokeringseininga er 0 sektorar. Det var rart. "
+
+#: libparted/fs/fat/bootsector.c:231
+#, fuzzy
+msgid "File system is FAT12, which is unsupported."
+msgstr "Filsystemet er FAT12, som er usttta."
+
+#: libparted/fs/fat/bootsector.c:407
+#, c-format
+msgid ""
+"The information sector has the wrong signature (%x). Select cancel for now, "
+"and send in a bug report. If you're desperate, it's probably safe to ignore."
+msgstr ""
+"Informasjonssektoren har feil signatur (%x). Vel avbryt, og send inn ein "
+"feilrapport. Viss du er desperat, er det sannsynlegvis trygt oversj "
+"denne feilen."
+
+#: libparted/fs/fat/count.c:149
+#, c-format
+msgid "Bad directory entry for %s: first cluster is the end of file marker."
+msgstr ""
+"Feil i katalogoppfringa for %s: frste allokeringseininga markerer slutt p "
+"fila."
+
+#: libparted/fs/fat/count.c:162
+#, c-format
+msgid ""
+"Bad FAT: unterminated chain for %s. You should run dosfsck or scandisk."
+msgstr ""
+"Feil p FAT: endelaus kjede for %s. Du br kyre dosfsck eller scandisk."
+
+#: libparted/fs/fat/count.c:171
+#, fuzzy, c-format
+msgid ""
+"Bad FAT: cluster %d outside file system in chain for %s. You should run "
+"dosfsck or scandisk."
+msgstr ""
+"Feil p FAT: allokeringseining %d er utanfor filsystemet i kjeda for %s. Du "
+"br kyre dosfsck eller scandisk."
+
+#: libparted/fs/fat/count.c:181
+#, c-format
+msgid ""
+"Bad FAT: cluster %d is cross-linked for %s. You should run dosfsck or "
+"scandisk."
+msgstr ""
+"Feil p FAT: allokeringseining %d er krysslenka for %s. Du br kyre "
+"dosfsck eller scandisk."
+
+#: libparted/fs/fat/count.c:200
+#, fuzzy, c-format
+msgid "%s is %dk, but it has %d clusters (%dk)."
+msgstr "%s er %d KiB, men har %d allokeringseiningar (%d KiB)."
+
+#: libparted/fs/fat/count.c:263
+#, c-format
+msgid ""
+"The file %s is marked as a system file. This means moving it could cause "
+"some programs to stop working."
+msgstr ""
+"Fila %s er klassifisert som ei systemfil. flytta denne fila kan fra til "
+"at nokon program sluttar fungera."
+
+#: libparted/fs/fat/table.c:138
+#, c-format
+msgid ""
+"FAT %d media %x doesn't match the boot sector's media %x. You should "
+"probably run scandisk."
+msgstr ""
+"FAT %d media %x stemmer ikkje overeins med bootsektorens media %x. Du br "
+"sannsynlegvis kyre scandisk."
+
+#: libparted/fs/fat/table.c:268
+#, fuzzy, c-format
+msgid "fat_table_set: cluster %ld outside file system"
+msgstr "fat_table_set: allokeringseining %ld utanfor filsystemet"
+
+#: libparted/fs/fat/table.c:296
+#, fuzzy, c-format
+msgid "fat_table_get: cluster %ld outside file system"
+msgstr "fat_table_get: allokeringseining %ld utanfor filsystemet"
+
+#: libparted/fs/fat/table.c:334
+msgid "fat_table_alloc_cluster: no free clusters"
+msgstr "fat_table_alloc_cluster: ingen ledige allokeringseiningar"
+
+#: libparted/fs/linux_swap/linux_swap.c:236
+#, c-format
+msgid "Unrecognised linux swap signature '%10s'."
+msgstr "Ukjent swap-signatur for Linux '%10s'."
+
+#: libparted/fs/linux_swap/linux_swap.c:312
+msgid "Too many bad pages."
+msgstr "For mange drlege sider."
+
+#: libparted/fs/hfs/advfs.c:123 libparted/fs/hfs/advfs_plus.c:125
+#: libparted/fs/hfs/reloc.c:416 libparted/fs/hfs/reloc.c:510
+#: libparted/fs/hfs/reloc_plus.c:541 libparted/fs/hfs/reloc_plus.c:660
+#: libparted/fs/hfs/reloc_plus.c:774
+msgid "The file system contains errors."
+msgstr ""
+
+#: libparted/fs/hfs/advfs_plus.c:290
+msgid "Bad blocks could not be read."
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:139
+#, c-format
+msgid ""
+"Trying to register an extent starting at block 0x%X, but another one already "
+"exists at this position. You should check the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:216
+#, c-format
+msgid ""
+"Trying to move an extent from block Ox%X to block Ox%X, but another one "
+"already exists at this position. This should not happen!"
+msgstr ""
+
+#: libparted/fs/hfs/file.c:145
+#, c-format
+msgid "Could not update the extent cache for HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:182
+#, c-format
+msgid "Trying to read HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:192 libparted/fs/hfs/file.c:222
+#, c-format
+msgid "Could not find sector %lli of HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:212
+#, c-format
+msgid "Trying to write HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:159
+#, c-format
+msgid "Could not update the extent cache for HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:203
+#, c-format
+msgid "Trying to read HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:214 libparted/fs/hfs/file_plus.c:256
+#, c-format
+msgid "Could not find sector %lli of HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:245
+#, c-format
+msgid "Trying to write HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:225
+msgid "Sorry, HFS cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:255 libparted/fs/hfs/hfs.c:636
+msgid "Data relocation has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:274
+msgid "Data relocation left some data in the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:313
+#, fuzzy
+msgid "writing HFS Master Directory Block"
+msgstr "Feil ved skriving til toppkatalogen."
+
+#: libparted/fs/hfs/hfs.c:461
+msgid "No valid HFS[+X] signature has been found while opening."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:471
+#, c-format
+msgid "Version %d of HFS+ isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:482
+#, c-format
+msgid "Version %d of HFSX isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:667
+msgid "Data relocation left some data at the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:715
+#, fuzzy
+msgid "Error while writing the allocation file."
+msgstr "Feil ved skriving til toppkatalogen."
+
+#: libparted/fs/hfs/hfs.c:730
+msgid "Error while writing the compatibility part of the allocation file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:745
+msgid "writing HFS+ Volume Header"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:845
+msgid "An error occurred while looking for the mandatory bad blocks file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:899
+msgid ""
+"It seems there is an error in the HFS wrapper: the bad blocks file doesn't "
+"contain the embedded HFS+ volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:930
+msgid "Sorry, HFS+ cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:965
+msgid "shrinking embedded HFS+ volume"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:981
+msgid "Resizing the HFS+ volume has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:988
+#, fuzzy
+msgid "shrinking HFS wrapper"
+msgstr "krympar"
+
+#: libparted/fs/hfs/hfs.c:997
+msgid "Updating the HFS wrapper has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:1099 libparted/fs/hfs/hfs.c:1184
+#, c-format
+msgid ""
+"This is not a real %s check. This is going to extract special low level "
+"files for debugging purposes."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:156
+msgid "Bad block list header checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:169
+#, c-format
+msgid ""
+"Invalid size of a transaction block while replaying the journal (%i bytes)."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:261
+msgid ""
+"Journal stored outside of the volume are not supported. Try to desactivate "
+"the journal and run Parted again."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:272
+#, fuzzy
+msgid "Journal offset or size is not multiple of the sector size."
+msgstr ""
+"Allokeringseininga sitt start delta = %d, som ikkje er eit multiplum av "
+"storleiken %d."
+
+#: libparted/fs/hfs/journal.c:290
+msgid "Incorrect magic values in the journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:299
+msgid "Journal size mismatch between journal info block and journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:311
+#, fuzzy
+msgid "Some header fields are not multiple of the sector size."
+msgstr ""
+"Allokeringseininga sitt start delta = %d, som ikkje er eit multiplum av "
+"storleiken %d."
+
+#: libparted/fs/hfs/journal.c:320
+msgid ""
+"The sector size stored in the journal is not 512 bytes. Parted only "
+"supports 512 bytes length sectors."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:332
+msgid "Bad journal checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:350
+msgid ""
+"The journal is not empty. Parted must replay the transactions before "
+"opening the file system. This will modify the file system."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:378
+msgid ""
+"The volume header or the master directory block has changed while replaying "
+"the journal. You should restart Parted."
+msgstr ""
+
+#: libparted/fs/hfs/probe.c:52
+#, c-format
+msgid ""
+"Parted can't use HFS file systems on disks with a sector size not equal to %"
+"d bytes."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:153 libparted/fs/hfs/reloc_plus.c:157
+msgid "An extent has not been relocated."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:253 libparted/fs/hfs/reloc_plus.c:309
+msgid ""
+"A reference to an extent comes from a place it should not. You should check "
+"the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:383
+msgid "This HFS volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:477
+msgid "This HFS volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:519 libparted/fs/hfs/reloc_plus.c:670
+msgid ""
+"The extents overflow file should not contain its own extents! You should "
+"check the file system."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:576 libparted/fs/hfs/reloc_plus.c:849
+#, fuzzy
+msgid "Could not cache the file system in memory."
+msgstr "Kan ikkje kjenna igjen noko filsystem."
+
+#: libparted/fs/hfs/reloc.c:637 libparted/fs/hfs/reloc_plus.c:910
+msgid "Bad blocks list could not be loaded."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:651 libparted/fs/hfs/reloc_plus.c:926
+msgid "An error occurred during extent relocation."
+msgstr ""
+
+#: libparted/fs/hfs/reloc_plus.c:497
+msgid "This HFS+ volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc_plus.c:621
+msgid "This HFS+ volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: parted/parted.c:76
+msgid "displays this help message"
+msgstr "vis denne hjelpeteksten"
+
+#: parted/parted.c:77
+msgid "where necessary, prompts for user intervention"
+msgstr "der naudsynt, spr brukaren"
+
+#: parted/parted.c:78
+msgid "never prompts for user intervention"
+msgstr "spr aldri brukaren"
+
+#: parted/parted.c:79
+msgid "displays the version"
+msgstr "vis programversjon"
+
+#: parted/parted.c:87
+#, fuzzy
+msgid ""
+"NUMBER is the partition number used by Linux. On MS-DOS disk labels, the "
+"primary partitions number from 1 to 4, logical partitions from 5 onwards.\n"
+msgstr ""
+"NR er partisjonsnummeret brukt av Linux. P MS-DOS-disklabels, er "
+"primrpartisjonar nummerert 1-4, og logiske partisjonar gr fr 5 og "
+"oppover.\n"
+
+#: parted/parted.c:90
+msgid "LABEL-TYPE is one of: "
+msgstr "LABEL-TYPE er ein av: "
+
+#: parted/parted.c:91
+msgid "FLAG is one of: "
+msgstr "FLAGG er eitt av: "
+
+#: parted/parted.c:92
+#, fuzzy
+msgid "UNIT is one of: "
+msgstr "FLAGG er eitt av: "
+
+#: parted/parted.c:93
+msgid "PART-TYPE is one of: primary, logical, extended\n"
+msgstr "PART-TYPE er ein av: primr, logisk, utviding\n"
+
+#: parted/parted.c:95
+msgid "FS-TYPE is one of: "
+msgstr "FS-TYPE er ein av: "
+
+#: parted/parted.c:96
+msgid ""
+"START and END are disk locations, such as 4GB or 10%. Negative values count "
+"from the end of the disk. For example, -1s specifies exactly the last "
+"sector.\n"
+msgstr ""
+
+#: parted/parted.c:99
+msgid "STATE is one of: on, off\n"
+msgstr "STATUS er ein av: av, p\n"
+
+#: parted/parted.c:100
+msgid "DEVICE is usually /dev/hda or /dev/sda\n"
+msgstr "EINING er vanlegvis /dev/hda eller /dev/sda\n"
+
+#: parted/parted.c:101
+msgid "NAME is any word you want\n"
+msgstr "NAMN er eit valfritt ord\n"
+
+#: parted/parted.c:102
+msgid "The partition must have one of the following FS-TYPEs: "
+msgstr ""
+
+#: parted/parted.c:105
+msgid "GNU Parted Version information:\n"
+msgstr ""
+
+#: parted/parted.c:107
+#, fuzzy
+msgid ""
+"Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n"
+"This program is free software, covered by the GNU General Public License.\n"
+"\n"
+"This program is distributed in the hope that it will be useful, but WITHOUT "
+"ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
+"FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
+"more details.\n"
+"\n"
+msgstr ""
+"EKSPERIMENTELL UTGVE - BRUK IKKJE P VERDIFULLE DATA!!!\n"
+"\n"
+"(Fylgjande tekst er ei omsetjing som *kun* vert gitt p informativ basis. "
+"For alle juridiske tolkingar gjeld den engelske originalteksten.)\n"
+"\n"
+"Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.\n"
+"Dette programmet er fri programvare, dekt av GNU General Public License.\n"
+"\n"
+"Dette programmet vert distribuert med von om at det vil vere nyttig, men "
+"utan NOKA FORM FOR garanti; ikkje eingong for at produktet er eigna for SAL "
+"eller BRUK TIL NOKO FORML. Sj GNU General Public License for detaljar.\n"
+"\n"
+
+#: parted/parted.c:152
+#, c-format
+msgid "%0.f%%\t(time left %.2d:%.2d)"
+msgstr "%0.f%%\t(tid att %.2d:%.2d)"
+
+#: parted/parted.c:170
+#, c-format
+msgid ""
+"Partition %s is being used. You must unmount it before you modify it with "
+"Parted."
+msgstr ""
+
+#: parted/parted.c:187
+#, c-format
+msgid "Partition(s) on %s are being used."
+msgstr "Partisjon(ane) p %s er i bruk."
+
+#: parted/parted.c:413 parted/parted.c:594 parted/parted.c:979
+#: parted/parted.c:1059 parted/parted.c:1586 parted/parted.c:1663
+#: parted/parted.c:1707
+msgid "Partition number?"
+msgstr "Partisjonsnummer?"
+
+#: parted/parted.c:456
+msgid "Source device?"
+msgstr "Kva eining skal vere kjelda?"
+
+#: parted/parted.c:460
+msgid "Source partition number?"
+msgstr "Kva partisjonsnummer skal vere kjelda?"
+
+#: parted/parted.c:465
+#, fuzzy
+msgid "Can't copy an extended partition."
+msgstr "Kan ikkje kopiere utvidingspartisjonar."
+
+#: parted/parted.c:471
+msgid "Destination partition number?"
+msgstr "Kva partisjonsnummer er mlet?"
+
+#: parted/parted.c:564
+msgid "New disk label type?"
+msgstr "Ny disklabel-type?"
+
+#: parted/parted.c:598
+msgid "File system?"
+msgstr "Filsystem?"
+
+#: parted/parted.c:645 parted/parted.c:815
+msgid "Partition type?"
+msgstr "Partisjonstype?"
+
+#: parted/parted.c:652 parted/parted.c:822 parted/parted.c:1062
+msgid "Partition name?"
+msgstr "Partisjonsnamn?"
+
+#: parted/parted.c:660 parted/parted.c:832
+msgid "File system type?"
+msgstr "Filsystemtype?"
+
+#: parted/parted.c:667 parted/parted.c:834 parted/parted.c:994
+#: parted/parted.c:1544 parted/parted.c:1595
+msgid "Start?"
+msgstr "Start?"
+
+#: parted/parted.c:669 parted/parted.c:837 parted/parted.c:997
+#: parted/parted.c:1546 parted/parted.c:1597
+msgid "End?"
+msgstr "Slutt?"
+
+#: parted/parted.c:707 parted/parted.c:875
+#, fuzzy, c-format
+msgid ""
+"You requested a partition from %s to %s.\n"
+"The closest location we can manage is %s to %s. Is this still acceptable to "
+"you?"
+msgstr ""
+"Du bad om flytte partisjonen til %.3f-%.3f MiB. Det nrmaste Parted kan "
+"klare er %.3f-%.3f MiB."
+
+#: parted/parted.c:827
+#, fuzzy
+msgid "An extended partition cannot hold a file system. Did you want mkpart?"
+msgstr "Utvidingspartisjonar kan ikkje ha filsystem. Meinte du mkpart?"
+
+#: parted/parted.c:985
+#, fuzzy
+msgid "Can't move an extended partition."
+msgstr "Kan ikkje flytte utvidingspartisjonar."
+
+#: parted/parted.c:1014
+msgid "Can't move a partition onto itself. Try using resize, perhaps?"
+msgstr ""
+"Kan ikkje flytte ein partisjon til seg sjlv. Kanskje du vil prve endre "
+"storleik?"
+
+#: parted/parted.c:1158
+#, c-format
+msgid "Minor: %d\n"
+msgstr "Nummer: %d\n"
+
+#: parted/parted.c:1159
+#, fuzzy, c-format
+msgid "Flags: %s\n"
+msgstr "Flagg: "
+
+#: parted/parted.c:1160
+#, c-format
+msgid "File System: %s\n"
+msgstr "Filsystem: %s\n"
+
+#: parted/parted.c:1161
+#, fuzzy, c-format
+msgid "Size: "
+msgstr "Storleik: %10.3fMiB (%d%%)\n"
+
+#: parted/parted.c:1166
+#, fuzzy, c-format
+msgid "Minimum size: "
+msgstr "Minste storleik: %10.3fMiB (%d%%)\n"
+
+#: parted/parted.c:1169
+#, fuzzy, c-format
+msgid "Maximum size: "
+msgstr "Strste storleik: %10.3fMiB (%d%%)\n"
+
+#: parted/parted.c:1255
+#, fuzzy, c-format
+msgid "Disk %s: %s\n"
+msgstr "%s %s %s"
+
+#: parted/parted.c:1256
+#, c-format
+msgid "Sector size (logical/physical): %lldB/%lldB\n"
+msgstr ""
+
+#: parted/parted.c:1267
+#, c-format
+msgid "BIOS cylinder,head,sector geometry: %d,%d,%d. Each cylinder is %s.\n"
+msgstr ""
+
+#: parted/parted.c:1273
+#, fuzzy, c-format
+msgid "Partition Table: %s\n"
+msgstr "Partisjonsnamn?"
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Number"
+msgstr ""
+
+#: parted/parted.c:1284 parted/parted.c:1287
+#, fuzzy
+msgid "Start"
+msgstr "Start?"
+
+#: parted/parted.c:1285 parted/parted.c:1288
+#, fuzzy
+msgid "End"
+msgstr "Slutt?"
+
+#: parted/parted.c:1288
+#, fuzzy
+msgid "Size"
+msgstr "resize"
+
+#: parted/parted.c:1292
+msgid "Type"
+msgstr ""
+
+#: parted/parted.c:1294
+#, fuzzy
+msgid "File system"
+msgstr "Filsystem?"
+
+#: parted/parted.c:1297
+#, fuzzy
+msgid "Name"
+msgstr "name"
+
+#: parted/parted.c:1299
+msgid "Flags"
+msgstr "Flagg"
+
+#: parted/parted.c:1352
+msgid "Free Space"
+msgstr ""
+
+#: parted/parted.c:1441
+#, fuzzy, c-format
+msgid ""
+"A %s %s partition was found at %s -> %s. Do you want to add it to the "
+"partition table?"
+msgstr ""
+"Ein %s %s-partisjon vart funnen p %.3f MiB -> %.3f MiB. nskjer du "
+"leggje han til i partisjonstabellen?"
+
+#: parted/parted.c:1479
+#, fuzzy
+msgid "searching for file systems"
+msgstr "aukar storleik p filsystemet"
+
+#: parted/parted.c:1684
+msgid "New device?"
+msgstr "Ny eining?"
+
+#: parted/parted.c:1709
+#, fuzzy
+msgid "Flag to Invert?"
+msgstr "Flagg som skal endrast?"
+
+#: parted/parted.c:1714
+msgid "New state?"
+msgstr "Ny status?"
+
+#: parted/parted.c:1747
+msgid "Unit?"
+msgstr ""
+
+#: parted/parted.c:1896
+msgid "check"
+msgstr "check"
+
+#: parted/parted.c:1899
+#, fuzzy
+msgid ""
+"check NUMBER do a simple check on the file system"
+msgstr ""
+"check NR ta ein enkel konsistenssjekk av filsystemet"
+
+#: parted/parted.c:1905
+msgid "cp"
+msgstr "cp"
+
+#: parted/parted.c:1908
+#, fuzzy
+msgid ""
+"cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another "
+"partition"
+msgstr ""
+"cp [FR-EINING] FR-NR TIL-NR kopier filsystem til ein annan "
+"partisjon"
+
+#: parted/parted.c:1914
+msgid "help"
+msgstr "help"
+
+#: parted/parted.c:1917
+#, fuzzy
+msgid ""
+"help [COMMAND] prints general help, or help on "
+"COMMAND"
+msgstr ""
+"help [KOMMANDO] gjev generell hjelp, eller hjelp om KOMMANDO"
+
+#: parted/parted.c:1923
+msgid "mklabel"
+msgstr "mklabel"
+
+#: parted/parted.c:1926
+#, fuzzy
+msgid ""
+"mklabel LABEL-TYPE create a new disklabel (partition "
+"table)"
+msgstr "mklabel LABEL-TYPE lag ny disklabel (partisjonstabell)"
+
+#: parted/parted.c:1932
+msgid "mkfs"
+msgstr "mkfs"
+
+#: parted/parted.c:1935
+#, fuzzy
+msgid ""
+"mkfs NUMBER FS-TYPE make a FS-TYPE file system on "
+"partititon NUMBER"
+msgstr ""
+"mkfs NR FS-TYPE lag eit filsystem av FS-TYPE p partisjon NR"
+
+#: parted/parted.c:1941
+msgid "mkpart"
+msgstr "mkpart"
+
+#: parted/parted.c:1944
+#, fuzzy
+msgid "mkpart PART-TYPE [FS-TYPE] START END make a partition"
+msgstr "mkpart PART-TYPE [FS-TYPE] START SLUTT lag ein partisjon"
+
+#: parted/parted.c:1950
+msgid ""
+"mkpart makes a partition without creating a new file system on the "
+"partition. FS-TYPE may be specified to set an appropriate partition ID.\n"
+msgstr ""
+"mkpart lagar ein partisjon utan laga eit nytt filsystem der. Du kan "
+"spesifisere FS-TYPE for setje ein passande partisjons-id.\n"
+
+#: parted/parted.c:1955
+msgid "mkpartfs"
+msgstr "mkpartfs"
+
+#: parted/parted.c:1958
+#, fuzzy
+msgid ""
+"mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system"
+msgstr ""
+"mkpartfs PART-TYPE FS-TYPE START SLUTT lag ein partition med eit filsystem"
+
+#: parted/parted.c:1964
+msgid "move"
+msgstr "move"
+
+#: parted/parted.c:1967
+#, fuzzy
+msgid "move NUMBER START END move partition NUMBER"
+msgstr "move NR START SLUTT flytt partisjonen NR"
+
+#: parted/parted.c:1972
+msgid "name"
+msgstr "name"
+
+#: parted/parted.c:1975
+#, fuzzy
+msgid "name NUMBER NAME name partition NUMBER as NAME"
+msgstr "name NR NAMN gje partisjonen NR namnet NAMN"
+
+#: parted/parted.c:1980
+msgid "print"
+msgstr "print"
+
+#: parted/parted.c:1983
+#, fuzzy
+msgid ""
+"print [free|NUMBER|all] display the partition table, a "
+"partition, or all devices"
+msgstr ""
+"print [NR] vis partisjonstabellen eller ein partisjon"
+
+#: parted/parted.c:1987
+msgid ""
+"Without arguments, print displays the entire partition table. With 'free'\n"
+"argument, information about free space will be displayed otherwise if a\n"
+"partition number is given, then more detailed information is displayed\n"
+"about that partition. If the 'all' argument is passed instead, partition\n"
+"information for all devices will be displayed."
+msgstr ""
+
+#: parted/parted.c:1995
+msgid "quit"
+msgstr "quit"
+
+#: parted/parted.c:1998
+#, fuzzy
+msgid "quit exit program"
+msgstr "quit avslutt programmet"
+
+#: parted/parted.c:2003
+msgid "rescue"
+msgstr "rescue"
+
+#: parted/parted.c:2006
+#, fuzzy
+msgid ""
+"rescue START END rescue a lost partition near START "
+"and END"
+msgstr ""
+"rescue START SLUTT redd sletta partisjonar mellom START og SLUTT"
+
+#: parted/parted.c:2012
+msgid "resize"
+msgstr "resize"
+
+#: parted/parted.c:2015
+#, fuzzy
+msgid ""
+"resize NUMBER START END resize partition NUMBER and its "
+"file system"
+msgstr ""
+"resize NR START SLUTT endre storleik p filsystemet p partisjonen NR"
+
+#: parted/parted.c:2023
+msgid "rm"
+msgstr "rm"
+
+#: parted/parted.c:2026
+#, fuzzy
+msgid "rm NUMBER delete partition NUMBER"
+msgstr "rm NR slett partisjonen NR"
+
+#: parted/parted.c:2031
+msgid "select"
+msgstr "select"
+
+#: parted/parted.c:2034
+#, fuzzy
+msgid "select DEVICE choose the device to edit"
+msgstr "select EINING vel eininga du vil gjere endringar p"
+
+#: parted/parted.c:2039
+msgid "set"
+msgstr "set"
+
+#: parted/parted.c:2042
+#, fuzzy
+msgid ""
+"set NUMBER FLAG STATE change the FLAG on partition NUMBER"
+msgstr "rm NR slett partisjonen NR"
+
+#: parted/parted.c:2048
+msgid "toggle"
+msgstr ""
+
+#: parted/parted.c:2051
+#, fuzzy
+msgid ""
+"toggle [NUMBER [FLAG]] toggle the state of FLAG on "
+"partition NUMBER"
+msgstr "rm NR slett partisjonen NR"
+
+#: parted/parted.c:2057
+#, fuzzy
+msgid "unit"
+msgstr "quit"
+
+#: parted/parted.c:2060
+#, fuzzy
+msgid "unit UNIT set the default unit to UNIT"
+msgstr "quit avslutt programmet"
+
+#: parted/parted.c:2065
+msgid "version"
+msgstr ""
+
+#: parted/parted.c:2068
+msgid ""
+"version displays the current version of GNU "
+"Parted and copyright information"
+msgstr ""
+
+#: parted/parted.c:2072
+msgid ""
+"version displays copyright and version information corressponding to this "
+"copy of GNU Parted\n"
+msgstr ""
+
+#: parted/parted.c:2158
+msgid "No device found"
+msgstr "Ingen diskar funne"
+
+#: parted/parted.c:2222
+msgid "Don't forget to update /etc/fstab, if necessary.\n"
+msgstr "Glym ikkje oppdatera /etc/fstab, om naudsynt.\n"
+
+#: parted/ui.c:68
+msgid "Welcome to GNU Parted! Type 'help' to view a list of commands.\n"
+msgstr ""
+
+#: parted/ui.c:71
+#, fuzzy
+msgid ""
+"Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]\n"
+"Apply COMMANDs with PARAMETERS to DEVICE. If no COMMAND(s) are given, run "
+"in\n"
+"interactive mode.\n"
+msgstr ""
+"Bruk: parted [FLAGG]... [EINING [KOMMANDO [PARAMETER]...]...]\n"
+"Utfr KOMMANDO med PARAMETER p EINING. Dersom ingen KOMMANDO er gjeven,\n"
+"kyrer GNU Parted i interaktiv modus.\n"
+
+#: parted/ui.c:76
+#, c-format
+msgid ""
+"\n"
+"\n"
+"You found a bug in GNU Parted! Here's what you have to do:\n"
+"\n"
+"Don't panic! The bug has most likely not affected any of your data.\n"
+"Help us to fix this bug by doing the following:\n"
+"\n"
+"Check whether the bug has already been fixed by checking\n"
+"the last version of GNU Parted that you can find at:\n"
+"\n"
+"\thttp://ftp.gnu.org/gnu/parted/\n"
+"\n"
+"Please check this version prior to bug reporting.\n"
+"\n"
+"If this has not been fixed yet or if you don't know how to check,\n"
+"please visit the GNU Parted website:\n"
+"\n"
+"\thttp://www.gnu.org/software/parted\n"
+"\n"
+"for further information.\n"
+"\n"
+"Your report should contain the version of this release (%s)\n"
+"along with the error message below, the output of\n"
+"\n"
+"\tparted DEVICE unit co print unit s print\n"
+"\n"
+"and additional information about your setup you consider important.\n"
+msgstr ""
+
+#: parted/ui.c:230
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_MAPERR (Address not mapped to object)"
+msgstr ""
+
+#: parted/ui.c:235
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_ACCERR (Invalid permissions for mapped object)"
+msgstr ""
+
+#: parted/ui.c:240
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGSEGV signal was encountered."
+msgstr ""
+
+#: parted/ui.c:258
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTDIV (Integer: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:262
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTOVF (Integer: overflow)"
+msgstr ""
+
+#: parted/ui.c:266
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTDIV (Float: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:270
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTOVF (Float: overflow)"
+msgstr ""
+
+#: parted/ui.c:274
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTUND (Float: underflow)"
+msgstr ""
+
+#: parted/ui.c:278
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTRES (Float: inexact result)"
+msgstr ""
+
+#: parted/ui.c:282
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTINV (Float: invalid operation)"
+msgstr ""
+
+#: parted/ui.c:286
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTSUB (Float: subscript out of range)"
+msgstr ""
+
+#: parted/ui.c:291
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGFPE signal was encountered."
+msgstr ""
+
+#: parted/ui.c:310
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPC (Illegal Opcode)"
+msgstr ""
+
+#: parted/ui.c:314
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPN (Illegal Operand)"
+msgstr ""
+
+#: parted/ui.c:318
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLADR (Illegal addressing mode)"
+msgstr ""
+
+#: parted/ui.c:323
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLTRP (Illegal Trap)"
+msgstr ""
+
+#: parted/ui.c:327
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVOPC (Privileged Opcode)"
+msgstr ""
+
+#: parted/ui.c:331
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVREG (Privileged Register)"
+msgstr ""
+
+#: parted/ui.c:335
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_COPROC (Coprocessor Error)"
+msgstr ""
+
+#: parted/ui.c:339
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_BADSTK (Internal Stack Error)"
+msgstr ""
+
+#: parted/ui.c:343
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGILL signal was encountered."
+msgstr ""
+
+#: parted/ui.c:828
+msgid "Expecting a partition number."
+msgstr "Forventa eit partisjonsnummer."
+
+#: parted/ui.c:837
+msgid "Partition doesn't exist."
+msgstr "Partisjonen finst ikkje."
+
+#: parted/ui.c:857
+msgid "Expecting a file system type."
+msgstr "Forventa ei filsystemtype."
+
+#: parted/ui.c:863
+#, c-format
+msgid "Unknown file system type \"%s\"."
+msgstr "Filsystemtypen %s er ukjend."
+
+#: parted/ui.c:883
+msgid "Expecting a disk label type."
+msgstr "Forventa ein disklabel-type."
+
+#: parted/ui.c:977
+msgid "Can't create any more partitions."
+msgstr "Kan ikkje lage fleire partisjonar."
+
+#: parted/ui.c:987
+msgid "Expecting a partition type."
+msgstr "Forventa ein partisjonstype."
+
+#: parted/ui.c:1115
+msgid "on"
+msgstr "p"
+
+#: parted/ui.c:1116
+msgid "off"
+msgstr "av"
+
+#: parted/ui.c:1227
+msgid "OPTIONs:"
+msgstr "FLAGG:"
+
+#: parted/ui.c:1230
+msgid "COMMANDs:"
+msgstr "KOMMANDOar:"
+
+#: parted/ui.c:1238
+#, c-format
+msgid "Using %s\n"
+msgstr "Brukar %s\n"
+
+#, fuzzy
+#~ msgid ""
+#~ "This ext2 file system has a rather strange layout! Parted can't resize "
+#~ "this (yet)."
+#~ msgstr ""
+#~ "Dette ext2-filsystemet har eit ganske rart utlegg. Parted kan ikkje "
+#~ "endra storleiken p det (enno)."
+
+#~ msgid "IDE"
+#~ msgstr "IDE"
+
+#, fuzzy
+#~ msgid "Disk geometry for %s: %s - %s\n"
+#~ msgstr "Diskgeometri for %s: 0.000-%.3f megabytes\n"
+
+#~ msgid "Disk label type: %s\n"
+#~ msgstr "Disklabel-type: %s\n"
+
+#, fuzzy
+#~ msgid "set NUMBER FLAG STATE change a flag on partition NUMBER"
+#~ msgstr "set NR FLAGG STATUS endre eit flagg p partisjonen NR"
+
+#, fuzzy
+#~ msgid ""
+#~ "The sector size on %s is %d bytes. Parted is known not to work properly "
+#~ "with drives with sector sizes other than %d bytes."
+#~ msgstr ""
+#~ "Sektorane p %s er %d oktettar store. Parted fungerer berre skikkeleg p "
+#~ "diskar som har ein sektorstorleik p %d oktettar"
+
+#~ msgid ""
+#~ "You found a bug in GNU Parted. Please email a bug report to bug-"
+#~ "parted@gnu.org containing the version (%s), and the following message:\n"
+#~ msgstr ""
+#~ "Du har funne ein programfeil i GNU Parted. Ver venleg sende ei "
+#~ "feilmelding til bug-parted@gnu.org der du oppgir versjonsnummeret (%s) og "
+#~ "fylgjande melding:\n"
+
+#, fuzzy
+#~ msgid ""
+#~ "You requested to create a partition at %s - %s. The closest Parted can "
+#~ "manage is %s - %s."
+#~ msgstr ""
+#~ "Du bad om ein partisjon p %.3f-%.3f MiB. Det nrmaste Parted kan kome "
+#~ "er %.3f-%.3f MiB."
+
+#, fuzzy
+#~ msgid ""
+#~ "You requested to resize the partition to %s - %s. The closest Parted can "
+#~ "manage is %s - %s."
+#~ msgstr ""
+#~ "Du bad om endre storleik p partisjonen til %.3f-%.3f MiB. Det "
+#~ "nrmaste Parted kan klare er %.3f-%.3f MiB."
+
+#~ msgid "SCSI"
+#~ msgstr "SCSI"
+
+#~ msgid "File system has an invalid signature for a FAT file systems."
+#~ msgstr "Filsystemet har ein ugyldig signatur til vere eit FAT-filsystem."
+
+#~ msgid "Minor Start End "
+#~ msgstr "Nr Start End "
+
+#~ msgid "Type "
+#~ msgstr "Type "
+
+#~ msgid "Filesystem "
+#~ msgstr "Filsystem "
+
+#~ msgid "Name "
+#~ msgstr "Namn "
+
+#~ msgid "Device %s is neither a SCSI nor IDE drive."
+#~ msgstr "Eininga %s er korkje ein SCSI- eller IDE-disk."
+
+#~ msgid "Error reading %s (%s) to determine if partition is mounted."
+#~ msgstr "Feil ved lesing av %s (%s) for avgjera om partisjonen er montert."
+
+#~ msgid "Could not read geometry of %s - %s."
+#~ msgstr "Kunne ikkje lesa geometrien til %s - %s."
+
+#~ msgid "Device %s has dodgey geometry."
+#~ msgstr "Eininga %s har tvilsam geometri."
+
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. However, the most likely reason is that Linux "
+#~ "detected the BIOS geometry for %s incorrectly. GNU Parted suspects the "
+#~ "real geometry should be %d/%d/%d (not %d/%d/%d). You should check with "
+#~ "your BIOS first, as this may not be correct. You can inform Linux by "
+#~ "adding the parameter %s=%d,%d,%d to the command line. See the LILO or "
+#~ "GRUB documentation for more information. If you think Parted's suggested "
+#~ "geometry is correct, you may select Ignore to continue (and fix Linux "
+#~ "later). Otherwise, select Cancel (and fix Linux and/or the BIOS now)."
+#~ msgstr ""
+#~ "Partisjonstabellen p %s er inkonsistent. Det kan koma av mange ting, "
+#~ "men mest sannsynleg har Linux brukt feil BIOS-geometri for %s. GNU "
+#~ "Parted trur den verkelege geometrien er %d/%d/%d (ikkje %d/%d/%d). Sjekk "
+#~ "frst i BIOS om det stemmer. Du kan lra Linux dette ved leggja til "
+#~ "parameteren %s=%d,%d,%d p kjernekommandolinja. Sj dokumentasjonen til "
+#~ "LILO eller GRUB for meir informasjon. Viss du trur geometrien Parted "
+#~ "foreslr er rett, kan du velja Ignorer for halda fram (og fiksa Linux "
+#~ "seinare). Viss ikkje, vel Avbryt (og fiks Linux eller/og BIOS-en no)."
+
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. Often, the reason is that Linux detected the "
+#~ "BIOS geometry incorrectly. However, this does not appear to be the case "
+#~ "here. It is safe to ignore,but ignoring may cause (fixable) problems "
+#~ "with some boot loaders, and may cause problems with FAT file systems. "
+#~ "Using LBA is recommended."
+#~ msgstr ""
+#~ "Partisjonstabellen p %s er inkonsistent. Det kan koma av mange ting, og "
+#~ "ofte er grunnen at Linux har brukt feil BIOS-geometri. I dette tilfellet "
+#~ "ser det ikkje slik ut. Det er trygt oversj denne feilen, men du kan "
+#~ "koma bort i problem med boot-lastaren (som kan rettast opp), og med FAT-"
+#~ "filsystem. Det er tilrdd bruka LBA."
+
+#~ msgid ""
+#~ "Unable to align partition properly. This probably means that another "
+#~ "partitioning tool generated an incorrect partition table, because it "
+#~ "didn't have the correct BIOS geometry. It is safe to ignore,but ignoring "
+#~ "may cause (fixable) problems with some boot loaders."
+#~ msgstr ""
+#~ "Kunne ikkje plassera partisjonen p ei passande skiljelinje. Dette tyder "
+#~ "vanlegvis at eit anna partisjonsprogram har laga ein partisjonstabell med "
+#~ "feil BIOS-geometri. Det er trygt oversj denne feilen, men du kan kome "
+#~ "bort i problem med boot-lastaren (som kan rettast opp)."
+
+#~ msgid ""
+#~ " You have Windows FAT partition(s) that are not using LBA. If your BIOS "
+#~ "supports LBA, then you should switch to LBA by setting the LBA flag on "
+#~ "all FAT partitions. Otherwise, make sure the operating system and the "
+#~ "BIOS have the same geometry before resizing any FAT partitions."
+#~ msgstr ""
+#~ " Du har Windows FAT-partisjon(ar) som ikkje brukar LBA. Viss BIOS "
+#~ "stttar LBA, br du bytte til LBA ved setje LBA-flagget p alle FAT-"
+#~ "partisjonar. Viss ikkje, sjekk at operativsystemet og BIOS har same "
+#~ "formeining om diskgeomtetri fr du endrar storleik p nokon av FAT-"
+#~ "partisjonane."
+
+#~ msgid ""
+#~ "The operating system thinks the geometry on %s is %d/%d/%d. Therefore, "
+#~ "cylinder 1024 ends at %.3fM.%s"
+#~ msgstr ""
+#~ "Operativsystemet trur geometrien p %s er %d/%d/%d. Derfor endar "
+#~ "sylinder 1024 p %.3f MiB.%s"
+
+#~ msgid "The operating system thinks the geometry on %s is %d/%d/%d.%s"
+#~ msgstr "Operativsystemet meiner at geometrien til %s er %d/%d/%d.%s"
+
+#, fuzzy
+#~ msgid "Partition %s is being used."
+#~ msgstr "Partisjonen er i bruk."
+
+#~ msgid "START and END are in megabytes\n"
+#~ msgstr "START og SLUTT er i megabytes\n"
+
+#~ msgid ""
+#~ "The FATs aren't big enough to describe all clusters! Each FAT is %d "
+#~ "sectors. There are %d clusters, which would require each FAT to be %d "
+#~ "sectors. This is REALLY weird. You might want to write us an email: bug-"
+#~ "parted@gnu.org"
+#~ msgstr ""
+#~ "FAT-ane er ikkje store nok til passe p alle allokeringseiningane! "
+#~ "Kvar FAT er %d sektorar. Der er %d allokeringseiningar, som krever at "
+#~ "ein FAT m vere %d sektorar. Dette er VERKELEG merkeleg. Du har kanskje "
+#~ "lyst sende oss ein epost: bug-parted@gnu.org"
diff --git a/po/parted.pot b/po/parted.pot
new file mode 100644
index 0000000..76352f0
--- /dev/null
+++ b/po/parted.pot
@@ -0,0 +1,2109 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: bug-parted@gnu.org\n"
+"POT-Creation-Date: 2006-04-21 21:20+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: libparted/arch/linux.c:284
+#, c-format
+msgid "Could not stat device %s - %s."
+msgstr ""
+
+#: libparted/arch/linux.c:390
+#, c-format
+msgid ""
+"Could not determine sector size for %s: %s.\n"
+"Using the default sector size (%lld)."
+msgstr ""
+
+#: libparted/arch/linux.c:401
+#, c-format
+msgid ""
+"Device %s has a logical sector size of %lld. Not all parts of GNU Parted "
+"support this at the moment, and the working code is HIGHLY EXPERIMENTAL.\n"
+msgstr ""
+
+#: libparted/arch/linux.c:441
+#, c-format
+msgid "Unable to determine the size of %s (%s)."
+msgstr ""
+
+#: libparted/arch/linux.c:530
+#, c-format
+msgid "Could not get identity of device %s - %s"
+msgstr ""
+
+#: libparted/arch/linux.c:539
+msgid "Generic IDE"
+msgstr ""
+
+#: libparted/arch/linux.c:556
+#, c-format
+msgid ""
+"Device %s has multiple (%d) logical sectors per physical sector.\n"
+"GNU Parted supports this EXPERIMENTALLY for some special disk label/file "
+"system combinations, e.g. GPT and ext2/3.\n"
+"Please consult the web site for up-to-date information."
+msgstr ""
+
+#: libparted/arch/linux.c:726
+#, c-format
+msgid "Error initialising SCSI device %s - %s"
+msgstr ""
+
+#: libparted/arch/linux.c:781
+#, c-format
+msgid ""
+"The device %s has zero length, and can't possibly store a file system or "
+"partition table. Perhaps you selected the wrong device?"
+msgstr ""
+
+#: libparted/arch/linux.c:829
+msgid ""
+"Unable to determine geometry of file/device. You should not use Parted "
+"unless you REALLY know what you're doing!"
+msgstr ""
+
+#: libparted/arch/linux.c:903
+msgid "DAC960 RAID controller"
+msgstr ""
+
+#: libparted/arch/linux.c:908
+msgid "Compaq Smart Array"
+msgstr ""
+
+#: libparted/arch/linux.c:913
+msgid "ATARAID Controller"
+msgstr ""
+
+#: libparted/arch/linux.c:918
+msgid "I2O Controller"
+msgstr ""
+
+#: libparted/arch/linux.c:923
+msgid "User-Mode Linux UBD"
+msgstr ""
+
+#: libparted/arch/linux.c:933
+msgid "Unknown"
+msgstr ""
+
+#: libparted/arch/linux.c:940
+msgid "ped_device_new() Unsupported device type"
+msgstr ""
+
+#: libparted/arch/linux.c:1041 libparted/arch/gnu.c:264
+#, c-format
+msgid "Error opening %s: %s"
+msgstr ""
+
+#: libparted/arch/linux.c:1052 libparted/arch/gnu.c:274
+#, c-format
+msgid "Unable to open %s read-write (%s). %s has been opened read-only."
+msgstr ""
+
+#: libparted/arch/linux.c:1160 libparted/arch/linux.c:1228
+#: libparted/arch/gnu.c:452 libparted/arch/gnu.c:550 libparted/arch/gnu.c:678
+#, c-format
+msgid "%s during read on %s"
+msgstr ""
+
+#: libparted/arch/linux.c:1199
+#, c-format
+msgid "%s during seek for read on %s"
+msgstr ""
+
+#: libparted/arch/linux.c:1270 libparted/arch/linux.c:1355
+#: libparted/arch/linux.c:1413 libparted/arch/gnu.c:587
+#: libparted/arch/gnu.c:632 libparted/arch/gnu.c:709
+#, c-format
+msgid "%s during write on %s"
+msgstr ""
+
+#: libparted/arch/linux.c:1297 libparted/arch/gnu.c:512
+#, c-format
+msgid "Can't write to %s, because it is opened read-only."
+msgstr ""
+
+#: libparted/arch/linux.c:1321
+#, c-format
+msgid "%s during seek for write on %s"
+msgstr ""
+
+#: libparted/arch/linux.c:1798
+#, c-format
+msgid ""
+"Error informing the kernel about modifications to partition %s -- %s. This "
+"means Linux won't know about any changes you made to %s until you reboot -- "
+"so you shouldn't mount it or use it in any way before rebooting."
+msgstr ""
+
+#: libparted/arch/linux.c:1879
+#, c-format
+msgid ""
+"The kernel was unable to re-read the partition table on %s (%s). This means "
+"Linux won't know anything about the modifications you made until you "
+"reboot. You should reboot your computer before doing anything with %s."
+msgstr ""
+
+#: libparted/arch/gnu.c:97
+#, c-format
+msgid "Unable to open %s."
+msgstr ""
+
+#: libparted/arch/gnu.c:117
+msgid "Unable to probe store."
+msgstr ""
+
+#: libparted/arch/gnu.c:355
+msgid ""
+"The partition table cannot be re-read. This means you need to reboot before "
+"mounting any modified partitions. You also need to reinstall your boot "
+"loader before you reboot (which may require mounting modified partitions). "
+"It is impossible do both things! So you'll need to boot off a rescue disk, "
+"and reinstall your boot loader from the rescue disk. Read section 4 of the "
+"Parted User documentation for more information."
+msgstr ""
+
+#: libparted/arch/gnu.c:372
+#, c-format
+msgid ""
+"The partition table on %s cannot be re-read (%s). This means the Hurd knows "
+"nothing about any modifications you made. You should reboot your computer "
+"before doing anything with %s."
+msgstr ""
+
+#: libparted/arch/gnu.c:383 parted/parted.c:2215
+msgid ""
+"You should reinstall your boot loader before rebooting. Read section 4 of "
+"the Parted User documentation for more information."
+msgstr ""
+
+#: libparted/arch/gnu.c:774
+#, c-format
+msgid "%s trying to sync %s to disk"
+msgstr ""
+
+#: libparted/disk.c:183
+#, c-format
+msgid "Unable to open %s - unrecognised disk label."
+msgstr ""
+
+#: libparted/disk.c:452
+#, c-format
+msgid ""
+"This libparted doesn't have write support for %s. Perhaps it was compiled "
+"read-only."
+msgstr ""
+
+#: libparted/disk.c:579
+#, c-format
+msgid "Partition %d is %s, but the file system is %s."
+msgstr ""
+
+#: libparted/disk.c:1056
+#, c-format
+msgid "%s disk labels do not support extended partitions."
+msgstr ""
+
+#: libparted/disk.c:1616
+#, c-format
+msgid "%s disk labels don't support logical or extended partitions."
+msgstr ""
+
+#: libparted/disk.c:1629
+msgid "Too many primary partitions."
+msgstr ""
+
+#: libparted/disk.c:1638
+#, c-format
+msgid ""
+"Can't add a logical partition to %s, because there is no extended partition."
+msgstr ""
+
+#: libparted/disk.c:1662
+#, c-format
+msgid "Can't have more than one extended partition on %s."
+msgstr ""
+
+#: libparted/disk.c:1672
+msgid "Can't have logical partitions outside of the extended partition."
+msgstr ""
+
+#: libparted/disk.c:1697
+#, c-format
+msgid "Can't have a logical partition outside of the extended partition on %s."
+msgstr ""
+
+#: libparted/disk.c:1707 libparted/disk.c:1761 libparted/disk.c:1927
+msgid "Can't have overlapping partitions."
+msgstr ""
+
+#: libparted/disk.c:1715
+msgid "Can't have a primary partition inside an extended partition."
+msgstr ""
+
+#: libparted/disk.c:2123
+msgid "metadata"
+msgstr ""
+
+#: libparted/disk.c:2125
+msgid "free"
+msgstr ""
+
+#: libparted/disk.c:2127 parted/ui.c:968 parted/ui.c:996
+msgid "extended"
+msgstr ""
+
+#: libparted/disk.c:2129 parted/ui.c:972 parted/ui.c:1000
+msgid "logical"
+msgstr ""
+
+#: libparted/disk.c:2131 parted/ui.c:964 parted/ui.c:992
+msgid "primary"
+msgstr ""
+
+#: libparted/disk.c:2147
+msgid "boot"
+msgstr ""
+
+#: libparted/disk.c:2149
+msgid "root"
+msgstr ""
+
+#: libparted/disk.c:2151
+msgid "swap"
+msgstr ""
+
+#: libparted/disk.c:2153
+msgid "hidden"
+msgstr ""
+
+#: libparted/disk.c:2155
+msgid "raid"
+msgstr ""
+
+#: libparted/disk.c:2157
+msgid "lvm"
+msgstr ""
+
+#: libparted/disk.c:2159
+msgid "lba"
+msgstr ""
+
+#: libparted/disk.c:2161
+msgid "hp-service"
+msgstr ""
+
+#: libparted/disk.c:2163
+msgid "palo"
+msgstr ""
+
+#: libparted/disk.c:2165
+msgid "prep"
+msgstr ""
+
+#: libparted/disk.c:2167
+msgid "msftres"
+msgstr ""
+
+#: libparted/disk.c:2173
+#, c-format
+msgid "Unknown partition flag, %d."
+msgstr ""
+
+#: libparted/labels/rdb.c:177
+#, c-format
+msgid "%s : Bad checksum on block %llu of type %s."
+msgstr ""
+
+#: libparted/labels/rdb.c:510
+#, c-format
+msgid "%s : Didn't find rdb block, should never happen."
+msgstr ""
+
+#: libparted/labels/rdb.c:595
+#, c-format
+msgid "%s : Loop detected at block %d."
+msgstr ""
+
+#: libparted/labels/rdb.c:614
+#, c-format
+msgid "%s : The %s list seems bad at block %s."
+msgstr ""
+
+#: libparted/labels/rdb.c:703
+#, c-format
+msgid "%s : Failed to list bad blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:711
+#, c-format
+msgid "%s : Failed to list partition blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:719
+#, c-format
+msgid "%s : Failed to list file system blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:727
+#, c-format
+msgid "%s : Failed to list boot blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:750
+#, c-format
+msgid "Failed to write partition block at %d."
+msgstr ""
+
+#: libparted/labels/rdb.c:1053 libparted/labels/bsd.c:505
+#: libparted/labels/dos.c:1942 libparted/labels/dvh.c:772
+#: libparted/labels/gpt.c:1365 libparted/labels/loop.c:251
+#: libparted/labels/mac.c:1318 libparted/labels/pc98.c:764
+#: libparted/labels/sun.c:704
+msgid "Unable to satisfy all constraints on the partition."
+msgstr ""
+
+#: libparted/labels/rdb.c:1081
+msgid "Unable to allocate a partition number."
+msgstr ""
+
+#: libparted/labels/bsd.c:530
+msgid "Unable to allocate a bsd disklabel slot."
+msgstr ""
+
+#: libparted/labels/dos.c:812
+#, c-format
+msgid "Invalid partition table on %s -- wrong signature %x."
+msgstr ""
+
+#: libparted/labels/dos.c:840
+#, c-format
+msgid "Invalid partition table - recursive partition on %s."
+msgstr ""
+
+#: libparted/labels/dos.c:1300
+msgid "Extended partitions cannot be hidden on msdos disk labels."
+msgstr ""
+
+#: libparted/labels/dos.c:1926
+msgid "Parted can't resize partitions managed by Windows Dynamic Disk."
+msgstr ""
+
+#: libparted/labels/dvh.c:192
+#, c-format
+msgid "%s has no extended partition (volume header partition)."
+msgstr ""
+
+#: libparted/labels/dvh.c:315
+msgid "Checksum is wrong, indicating the partition table is corrupt."
+msgstr ""
+
+#: libparted/labels/dvh.c:616
+msgid "Only primary partitions can be root partitions."
+msgstr ""
+
+#: libparted/labels/dvh.c:630
+msgid "Only primary partitions can be swap partitions."
+msgstr ""
+
+#: libparted/labels/dvh.c:644
+msgid "Only logical partitions can be a boot file."
+msgstr ""
+
+#: libparted/labels/dvh.c:723
+msgid "Only logical partitions (boot files) have a name."
+msgstr ""
+
+#: libparted/labels/dvh.c:814
+msgid "Too many primary partitions"
+msgstr ""
+
+#: libparted/labels/gpt.c:433
+#, c-format
+msgid ""
+"%s contains GPT signatures, indicating that it has a GPT table. However, it "
+"does not have a valid fake msdos partition table, as it should. Perhaps it "
+"was corrupted -- possibly by a program that doesn't understand GPT partition "
+"tables. Or perhaps you deleted the GPT table, and are now using an msdos "
+"partition table. Is this a GPT partition table?"
+msgstr ""
+
+#: libparted/labels/gpt.c:625
+#, c-format
+msgid ""
+"The format of the GPT partition table is version %x, which is newer than "
+"what Parted can recognise. Please tell us! bug-parted@gnu.org"
+msgstr ""
+
+#: libparted/labels/gpt.c:747
+msgid ""
+"The backup GPT table is not at the end of the disk, as it should be. This "
+"might mean that another operating system believes the disk is smaller. Fix, "
+"by moving the backup to the end (and removing the old backup)?"
+msgstr ""
+
+#: libparted/labels/gpt.c:782
+msgid ""
+"The primary GPT table is corrupt, but the backup appears OK, so that will be "
+"used."
+msgstr ""
+
+#: libparted/labels/gpt.c:790
+msgid ""
+"Both the primary and backup GPT tables are corrupt. Try making a fresh "
+"table, and using Parted's rescue feature to recover partitions."
+msgstr ""
+
+#: libparted/labels/mac.c:167
+#, c-format
+msgid "Invalid signature %x for Mac disk labels."
+msgstr ""
+
+#: libparted/labels/mac.c:212
+msgid "Partition map has no partition map entry!"
+msgstr ""
+
+#: libparted/labels/mac.c:259
+#, c-format
+msgid "%s is too small for a Mac disk label!"
+msgstr ""
+
+#: libparted/labels/mac.c:490
+#, c-format
+msgid "Partition %d has an invalid signature %x."
+msgstr ""
+
+#: libparted/labels/mac.c:508
+#, c-format
+msgid "Partition %d has an invalid length of 0 bytes!"
+msgstr ""
+
+#: libparted/labels/mac.c:536
+msgid "The data region doesn't start at the start of the partition."
+msgstr ""
+
+#: libparted/labels/mac.c:553
+msgid "The boot region doesn't start at the start of the partition."
+msgstr ""
+
+#: libparted/labels/mac.c:567
+msgid "The partition's boot region doesn't occupy the entire partition."
+msgstr ""
+
+#: libparted/labels/mac.c:577
+msgid "The partition's data region doesn't occupy the entire partition."
+msgstr ""
+
+#: libparted/labels/mac.c:631
+#, c-format
+msgid ""
+"Weird block size on device descriptor: %d bytes is not divisible by 512."
+msgstr ""
+
+#: libparted/labels/mac.c:644
+#, c-format
+msgid ""
+"The driver descriptor says the physical block size is %d bytes, but Linux "
+"says it is %d bytes."
+msgstr ""
+
+#: libparted/labels/mac.c:692
+msgid "No valid partition map found."
+msgstr ""
+
+#: libparted/labels/mac.c:744
+#, c-format
+msgid ""
+"Conflicting partition map entry sizes! Entry 1 says it is %d, but entry %d "
+"says it is %d!"
+msgstr ""
+
+#: libparted/labels/mac.c:771
+msgid "Weird! There are 2 partitions map entries!"
+msgstr ""
+
+#: libparted/labels/mac.c:1257
+msgid ""
+"Changing the name of a root or swap partition will prevent Linux from "
+"recognising it as such."
+msgstr ""
+
+#: libparted/labels/mac.c:1353
+msgid "Can't add another partition -- the partition map is too small!"
+msgstr ""
+
+#: libparted/labels/pc98.c:357
+#, c-format
+msgid "Invalid partition table on %s."
+msgstr ""
+
+#: libparted/labels/pc98.c:409 libparted/labels/pc98.c:487
+#, c-format
+msgid ""
+"Partition %d isn't aligned to cylinder boundaries. This is still "
+"unsupported."
+msgstr ""
+
+#: libparted/labels/pc98.c:796
+msgid "Can't add another partition."
+msgstr ""
+
+#: libparted/labels/sun.c:143
+msgid "Corrupted Sun disk label detected."
+msgstr ""
+
+#: libparted/labels/sun.c:264
+#, c-format
+msgid ""
+"The disk CHS geometry (%d,%d,%d) reported by the operating system does not "
+"match the geometry stored on the disk label (%d,%d,%d)."
+msgstr ""
+
+#: libparted/labels/sun.c:286
+#, c-format
+msgid "The disk label describes a disk bigger than %s."
+msgstr ""
+
+#: libparted/labels/sun.c:440
+#, c-format
+msgid "The disk has %d cylinders, which is greater than the maximum of 65536."
+msgstr ""
+
+#: libparted/labels/sun.c:736
+msgid ""
+"The Whole Disk partition is the only available one left. Generally, it is "
+"not a good idea to overwrite this partition with a real one. Solaris may "
+"not be able to boot without it, and SILO (the sparc boot loader) appreciates "
+"it as well."
+msgstr ""
+
+#: libparted/labels/sun.c:751
+msgid "Sun disk label is full."
+msgstr ""
+
+#: libparted/filesys.c:386
+msgid "Could not detect file system."
+msgstr ""
+
+#: libparted/filesys.c:397
+msgid "The file system is bigger than its volume!"
+msgstr ""
+
+#: libparted/filesys.c:405
+#, c-format
+msgid "Support for opening %s file systems is not implemented yet."
+msgstr ""
+
+#: libparted/filesys.c:447
+#, c-format
+msgid "Support for creating %s file systems is not implemented yet."
+msgstr ""
+
+#: libparted/filesys.c:508
+#, c-format
+msgid "Support for checking %s file systems is not implemented yet."
+msgstr ""
+
+#: libparted/filesys.c:574
+msgid "raw block copying"
+msgstr ""
+
+#: libparted/filesys.c:585
+msgid "growing file system"
+msgstr ""
+
+#: libparted/filesys.c:625
+msgid "Can't copy onto an overlapping partition."
+msgstr ""
+
+#: libparted/filesys.c:647
+#, c-format
+msgid ""
+"Direct support for copying file systems is not yet implemented for %s. "
+"However, support for resizing is implemented. Therefore, the file system "
+"can be copied if the new partition is at least as big as the old one. So, "
+"either shrink the partition you are trying to copy, or copy to a bigger "
+"partition."
+msgstr ""
+
+#: libparted/filesys.c:661
+#, c-format
+msgid "Support for copying %s file systems is not implemented yet."
+msgstr ""
+
+#: libparted/filesys.c:699
+#, c-format
+msgid "Support for resizing %s file systems is not implemented yet."
+msgstr ""
+
+#: libparted/exception.c:78
+msgid "Information"
+msgstr ""
+
+#: libparted/exception.c:79
+msgid "Warning"
+msgstr ""
+
+#: libparted/exception.c:80
+msgid "Error"
+msgstr ""
+
+#: libparted/exception.c:81
+msgid "Fatal"
+msgstr ""
+
+#: libparted/exception.c:82
+msgid "Bug"
+msgstr ""
+
+#: libparted/exception.c:83
+msgid "No Implementation"
+msgstr ""
+
+#: libparted/exception.c:87
+msgid "Fix"
+msgstr ""
+
+#: libparted/exception.c:88
+msgid "Yes"
+msgstr ""
+
+#: libparted/exception.c:89
+msgid "No"
+msgstr ""
+
+#: libparted/exception.c:90
+msgid "OK"
+msgstr ""
+
+#: libparted/exception.c:91
+msgid "Retry"
+msgstr ""
+
+#: libparted/exception.c:92
+msgid "Ignore"
+msgstr ""
+
+#: libparted/exception.c:93
+msgid "Cancel"
+msgstr ""
+
+#: libparted/exception.c:133
+#, c-format
+msgid ""
+"A bug has been detected in GNU Parted. Refer to the web site of parted "
+"http://www.gnu.org/software/parted/parted.html for more informations of what "
+"could be useful for bug submitting! Please email a bug report to bug-"
+"parted@gnu.org containing at least the version (%s) and the following "
+"message: "
+msgstr ""
+
+#: libparted/cs/geom.c:162
+msgid "Can't have the end before the start!"
+msgstr ""
+
+#: libparted/cs/geom.c:169
+msgid "Can't have a partition outside the disk!"
+msgstr ""
+
+#: libparted/cs/geom.c:303
+#, c-format
+msgid "Attempt to read sectors %ld-%ld outside of partition on %s."
+msgstr ""
+
+#: libparted/cs/geom.c:373
+#, c-format
+msgid "Attempt to write sectors %ld-%ld outside of partition on %s."
+msgstr ""
+
+#: libparted/cs/geom.c:413 libparted/fs/linux_swap/linux_swap.c:353
+msgid "checking for bad blocks"
+msgstr ""
+
+#: libparted/libparted.c:286 libparted/libparted.c:306
+msgid "Out of memory."
+msgstr ""
+
+#: libparted/unit.c:139
+msgid "Cannot get unit size for special unit 'COMPACT'."
+msgstr ""
+
+#: libparted/unit.c:382
+#, c-format
+msgid "\"%s\" has invalid syntax for locations."
+msgstr ""
+
+#: libparted/unit.c:390
+#, c-format
+msgid "The maximum head value is %d."
+msgstr ""
+
+#: libparted/unit.c:397
+#, c-format
+msgid "The maximum sector value is %d."
+msgstr ""
+
+#: libparted/unit.c:409 libparted/unit.c:540
+#, c-format
+msgid "The location %s is outside of the device %s."
+msgstr ""
+
+#: libparted/unit.c:522
+msgid "Invalid number."
+msgstr ""
+
+#: libparted/fs/ext2/ext2.c:87 libparted/fs/ext2/ext2.c:112
+msgid "Inconsistent group descriptors!"
+msgstr ""
+
+#: libparted/fs/ext2/ext2.c:91 libparted/fs/ext2/ext2.c:116
+msgid "File system full!"
+msgstr ""
+
+#: libparted/fs/ext2/ext2.c:750
+msgid "Invalid superblock. Are you sure this is an ext2 file system?"
+msgstr ""
+
+#: libparted/fs/ext2/ext2.c:764 libparted/fs/ext2/ext2_resize.c:597
+msgid "File system has errors! You should run e2fsck."
+msgstr ""
+
+#: libparted/fs/ext2/ext2.c:775
+msgid ""
+"File system was not cleanly unmounted! You should run e2fsck. Modifying an "
+"unclean file system could cause severe corruption."
+msgstr ""
+
+#: libparted/fs/ext2/ext2.c:795
+msgid "File system has an incompatible feature enabled."
+msgstr ""
+
+#: libparted/fs/ext2/ext2.c:806
+msgid "Error allocating buffer cache."
+msgstr ""
+
+#: libparted/fs/ext2/ext2.c:848
+msgid ""
+"A resize operation on this file system will use EXPERIMENTAL code that MAY "
+"CORRUPT it (although it hasn't done so yet).You should at least backup your "
+"data and run 'e2fsck -f' afterwards."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:114
+msgid ""
+"Found an inode with a incorrect link count. Better go run e2fsck first!"
+msgstr ""
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:487
+msgid "Not enough free inodes!"
+msgstr ""
+
+#: libparted/fs/ext2/ext2_resize.c:224
+msgid "File system is too full to remove a group!"
+msgstr ""
+
+#: libparted/fs/ext2/ext2_resize.c:233
+msgid "File system has too many allocated inodes to remove a group!"
+msgstr ""
+
+#: libparted/fs/ext2/ext2_resize.c:493
+msgid "adding groups"
+msgstr ""
+
+#: libparted/fs/ext2/ext2_resize.c:530
+#, c-format
+msgid "Your file system is too full to resize it to %i blocks. Sorry."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_resize.c:540
+#, c-format
+msgid ""
+"Your file system has too many occupied inodes to resize it to %i blocks. "
+"Sorry."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_resize.c:554 libparted/fs/hfs/hfs.c:243
+#: libparted/fs/hfs/hfs.c:624
+msgid "shrinking"
+msgstr ""
+
+#: libparted/fs/ext2/ext2_resize.c:605
+msgid "File system was not cleanly unmounted! You should run e2fsck."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_resize.c:614
+msgid ""
+"The file system has the 'dir_index' feature enabled. Parted can only resize "
+"the file system if it disables this feature. You can enable it later by "
+"running 'tune2fs -O dir_index DEVICE' and then 'e2fsck -fD DEVICE'."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_block_relocator.c:198
+msgid "Cross-linked blocks found! Better go run e2fsck first!"
+msgstr ""
+
+#: libparted/fs/ext2/ext2_block_relocator.c:537
+#, c-format
+msgid "Block %i has no reference? Weird."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_block_relocator.c:738
+#, c-format
+msgid "Block %i shouldn't have been marked!"
+msgstr ""
+
+#: libparted/fs/ext2/interface.c:188
+msgid ""
+"The ext2 file system passed a basic check. For a more comprehensive check, "
+"use the e2fsck program."
+msgstr ""
+
+#: libparted/fs/ext2/interface.c:205
+msgid "Sorry, can't move the start of ext2 partitions yet!"
+msgstr ""
+
+#: libparted/fs/ext2/ext2_buffer.c:82
+msgid "Couldn't flush buffer cache!"
+msgstr ""
+
+#: libparted/fs/ext2/ext2_mkfs.c:162
+msgid "writing per-group metadata"
+msgstr ""
+
+#: libparted/fs/ext2/ext2_mkfs.c:565
+msgid "File system too small for ext2."
+msgstr ""
+
+#: libparted/fs/fat/calc.c:134
+#, c-format
+msgid ""
+"You need %s of free disk space to shrink this partition to this size. "
+"Currently, only %s is free."
+msgstr ""
+
+#: libparted/fs/fat/context.c:55
+#, c-format
+msgid ""
+"Cluster start delta = %d, which is not a multiple of the cluster size %d."
+msgstr ""
+
+#: libparted/fs/fat/fat.c:312
+#, c-format
+msgid "Partition too big/small for a %s file system."
+msgstr ""
+
+#: libparted/fs/fat/fat.c:478
+msgid ""
+"The FATs don't match. If you don't know what this means, then select "
+"cancel, run scandisk on the file system, and then come back."
+msgstr ""
+
+#: libparted/fs/fat/fat.c:518
+msgid "There are no possible configurations for this FAT type."
+msgstr ""
+
+#: libparted/fs/fat/fat.c:530
+#, c-format
+msgid ""
+"File system doesn't have expected sizes for Windows to like it. Cluster "
+"size is %dk (%dk expected); number of clusters is %d (%d expected); size of "
+"FATs is %d sectors (%d expected)."
+msgstr ""
+
+#: libparted/fs/fat/fat.c:553
+#, c-format
+msgid ""
+"File system is reporting the free space as %d clusters, not %d clusters."
+msgstr ""
+
+#: libparted/fs/fat/fat.c:878
+msgid ""
+"GNU Parted was miscompiled: the FAT boot sector should be 512 bytes. FAT "
+"support will be disabled."
+msgstr ""
+
+#: libparted/fs/fat/resize.c:158
+msgid ""
+"There's not enough room in the root directory for all of the files. Either "
+"cancel, or ignore to lose the files."
+msgstr ""
+
+#: libparted/fs/fat/resize.c:299
+msgid "Error writing to the root directory."
+msgstr ""
+
+#: libparted/fs/fat/resize.c:484
+msgid "If you leave your file system as FAT16, then you will have no problems."
+msgstr ""
+
+#: libparted/fs/fat/resize.c:487
+msgid ""
+"If you convert to FAT16, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual)."
+msgstr ""
+
+#: libparted/fs/fat/resize.c:495
+msgid ""
+"If you leave your file system as FAT32, then you will not introduce any new "
+"problems."
+msgstr ""
+
+#: libparted/fs/fat/resize.c:499
+msgid ""
+"If you convert to FAT32, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual). Also, "
+"converting to FAT32 will make the file system unreadable by MS DOS, MS "
+"Windows 95a, and MS Windows NT."
+msgstr ""
+
+#: libparted/fs/fat/resize.c:513
+#, c-format
+msgid "%s %s %s"
+msgstr ""
+
+#: libparted/fs/fat/resize.c:514
+msgid "Would you like to use FAT32?"
+msgstr ""
+
+#: libparted/fs/fat/resize.c:541 libparted/fs/fat/resize.c:557
+#, c-format
+msgid "%s %s"
+msgstr ""
+
+#: libparted/fs/fat/resize.c:542
+msgid ""
+"The file system can only be resized to this size by converting to FAT16."
+msgstr ""
+
+#: libparted/fs/fat/resize.c:558
+msgid ""
+"The file system can only be resized to this size by converting to FAT32."
+msgstr ""
+
+#: libparted/fs/fat/resize.c:571
+msgid ""
+"GNU Parted cannot resize this partition to this size. We're working on it!"
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:48 libparted/fs/fat/bootsector.c:55
+msgid "File system has an invalid signature for a FAT file system."
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:62
+msgid "File system has an invalid sector size for a FAT file system."
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:69
+msgid "File system has an invalid cluster size for a FAT file system."
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:76
+msgid ""
+"File system has an invalid number of reserved sectors for a FAT file system."
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:83
+msgid "File system has an invalid number of FATs."
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:138
+#, c-format
+msgid ""
+"This file system has a logical sector size of %d. GNU Parted is known not "
+"to work properly with sector sizes other than 512 bytes."
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:163
+#, c-format
+msgid ""
+"The file system's CHS geometry is (%d, %d, %d), which is invalid. The "
+"partition table's CHS geometry is (%d, %d, %d). If you select Ignore, the "
+"file system's CHS geometry will be left unchanged. If you select Fix, the "
+"file system's CHS geometry will be set to match the partition table's CHS "
+"geometry."
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:209
+msgid "FAT boot sector says logical sector size is 0. This is weird. "
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:215
+msgid "FAT boot sector says there are no FAT tables. This is weird. "
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:221
+msgid "FAT boot sector says clusters are 0 sectors. This is weird. "
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:231
+msgid "File system is FAT12, which is unsupported."
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:407
+#, c-format
+msgid ""
+"The information sector has the wrong signature (%x). Select cancel for now, "
+"and send in a bug report. If you're desperate, it's probably safe to ignore."
+msgstr ""
+
+#: libparted/fs/fat/count.c:149
+#, c-format
+msgid "Bad directory entry for %s: first cluster is the end of file marker."
+msgstr ""
+
+#: libparted/fs/fat/count.c:162
+#, c-format
+msgid ""
+"Bad FAT: unterminated chain for %s. You should run dosfsck or scandisk."
+msgstr ""
+
+#: libparted/fs/fat/count.c:171
+#, c-format
+msgid ""
+"Bad FAT: cluster %d outside file system in chain for %s. You should run "
+"dosfsck or scandisk."
+msgstr ""
+
+#: libparted/fs/fat/count.c:181
+#, c-format
+msgid ""
+"Bad FAT: cluster %d is cross-linked for %s. You should run dosfsck or "
+"scandisk."
+msgstr ""
+
+#: libparted/fs/fat/count.c:200
+#, c-format
+msgid "%s is %dk, but it has %d clusters (%dk)."
+msgstr ""
+
+#: libparted/fs/fat/count.c:263
+#, c-format
+msgid ""
+"The file %s is marked as a system file. This means moving it could cause "
+"some programs to stop working."
+msgstr ""
+
+#: libparted/fs/fat/table.c:138
+#, c-format
+msgid ""
+"FAT %d media %x doesn't match the boot sector's media %x. You should "
+"probably run scandisk."
+msgstr ""
+
+#: libparted/fs/fat/table.c:268
+#, c-format
+msgid "fat_table_set: cluster %ld outside file system"
+msgstr ""
+
+#: libparted/fs/fat/table.c:296
+#, c-format
+msgid "fat_table_get: cluster %ld outside file system"
+msgstr ""
+
+#: libparted/fs/fat/table.c:334
+msgid "fat_table_alloc_cluster: no free clusters"
+msgstr ""
+
+#: libparted/fs/linux_swap/linux_swap.c:236
+#, c-format
+msgid "Unrecognised linux swap signature '%10s'."
+msgstr ""
+
+#: libparted/fs/linux_swap/linux_swap.c:312
+msgid "Too many bad pages."
+msgstr ""
+
+#: libparted/fs/hfs/advfs.c:123 libparted/fs/hfs/advfs_plus.c:125
+#: libparted/fs/hfs/reloc.c:416 libparted/fs/hfs/reloc.c:510
+#: libparted/fs/hfs/reloc_plus.c:541 libparted/fs/hfs/reloc_plus.c:660
+#: libparted/fs/hfs/reloc_plus.c:774
+msgid "The file system contains errors."
+msgstr ""
+
+#: libparted/fs/hfs/advfs_plus.c:290
+msgid "Bad blocks could not be read."
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:139
+#, c-format
+msgid ""
+"Trying to register an extent starting at block 0x%X, but another one already "
+"exists at this position. You should check the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:216
+#, c-format
+msgid ""
+"Trying to move an extent from block Ox%X to block Ox%X, but another one "
+"already exists at this position. This should not happen!"
+msgstr ""
+
+#: libparted/fs/hfs/file.c:145
+#, c-format
+msgid "Could not update the extent cache for HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:182
+#, c-format
+msgid "Trying to read HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:192 libparted/fs/hfs/file.c:222
+#, c-format
+msgid "Could not find sector %lli of HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:212
+#, c-format
+msgid "Trying to write HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:159
+#, c-format
+msgid "Could not update the extent cache for HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:203
+#, c-format
+msgid "Trying to read HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:214 libparted/fs/hfs/file_plus.c:256
+#, c-format
+msgid "Could not find sector %lli of HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:245
+#, c-format
+msgid "Trying to write HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:225
+msgid "Sorry, HFS cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:255 libparted/fs/hfs/hfs.c:636
+msgid "Data relocation has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:274
+msgid "Data relocation left some data in the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:313
+msgid "writing HFS Master Directory Block"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:461
+msgid "No valid HFS[+X] signature has been found while opening."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:471
+#, c-format
+msgid "Version %d of HFS+ isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:482
+#, c-format
+msgid "Version %d of HFSX isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:667
+msgid "Data relocation left some data at the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:715
+msgid "Error while writing the allocation file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:730
+msgid "Error while writing the compatibility part of the allocation file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:745
+msgid "writing HFS+ Volume Header"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:845
+msgid "An error occurred while looking for the mandatory bad blocks file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:899
+msgid ""
+"It seems there is an error in the HFS wrapper: the bad blocks file doesn't "
+"contain the embedded HFS+ volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:930
+msgid "Sorry, HFS+ cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:965
+msgid "shrinking embedded HFS+ volume"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:981
+msgid "Resizing the HFS+ volume has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:988
+msgid "shrinking HFS wrapper"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:997
+msgid "Updating the HFS wrapper has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:1099 libparted/fs/hfs/hfs.c:1184
+#, c-format
+msgid ""
+"This is not a real %s check. This is going to extract special low level "
+"files for debugging purposes."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:156
+msgid "Bad block list header checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:169
+#, c-format
+msgid ""
+"Invalid size of a transaction block while replaying the journal (%i bytes)."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:261
+msgid ""
+"Journal stored outside of the volume are not supported. Try to desactivate "
+"the journal and run Parted again."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:272
+msgid "Journal offset or size is not multiple of the sector size."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:290
+msgid "Incorrect magic values in the journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:299
+msgid "Journal size mismatch between journal info block and journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:311
+msgid "Some header fields are not multiple of the sector size."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:320
+msgid ""
+"The sector size stored in the journal is not 512 bytes. Parted only "
+"supports 512 bytes length sectors."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:332
+msgid "Bad journal checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:350
+msgid ""
+"The journal is not empty. Parted must replay the transactions before "
+"opening the file system. This will modify the file system."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:378
+msgid ""
+"The volume header or the master directory block has changed while replaying "
+"the journal. You should restart Parted."
+msgstr ""
+
+#: libparted/fs/hfs/probe.c:52
+#, c-format
+msgid ""
+"Parted can't use HFS file systems on disks with a sector size not equal to %"
+"d bytes."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:153 libparted/fs/hfs/reloc_plus.c:157
+msgid "An extent has not been relocated."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:253 libparted/fs/hfs/reloc_plus.c:309
+msgid ""
+"A reference to an extent comes from a place it should not. You should check "
+"the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:383
+msgid "This HFS volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:477
+msgid "This HFS volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:519 libparted/fs/hfs/reloc_plus.c:670
+msgid ""
+"The extents overflow file should not contain its own extents! You should "
+"check the file system."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:576 libparted/fs/hfs/reloc_plus.c:849
+msgid "Could not cache the file system in memory."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:637 libparted/fs/hfs/reloc_plus.c:910
+msgid "Bad blocks list could not be loaded."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:651 libparted/fs/hfs/reloc_plus.c:926
+msgid "An error occurred during extent relocation."
+msgstr ""
+
+#: libparted/fs/hfs/reloc_plus.c:497
+msgid "This HFS+ volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc_plus.c:621
+msgid "This HFS+ volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: parted/parted.c:76
+msgid "displays this help message"
+msgstr ""
+
+#: parted/parted.c:77
+msgid "where necessary, prompts for user intervention"
+msgstr ""
+
+#: parted/parted.c:78
+msgid "never prompts for user intervention"
+msgstr ""
+
+#: parted/parted.c:79
+msgid "displays the version"
+msgstr ""
+
+#: parted/parted.c:87
+msgid ""
+"NUMBER is the partition number used by Linux. On MS-DOS disk labels, the "
+"primary partitions number from 1 to 4, logical partitions from 5 onwards.\n"
+msgstr ""
+
+#: parted/parted.c:90
+msgid "LABEL-TYPE is one of: "
+msgstr ""
+
+#: parted/parted.c:91
+msgid "FLAG is one of: "
+msgstr ""
+
+#: parted/parted.c:92
+msgid "UNIT is one of: "
+msgstr ""
+
+#: parted/parted.c:93
+msgid "PART-TYPE is one of: primary, logical, extended\n"
+msgstr ""
+
+#: parted/parted.c:95
+msgid "FS-TYPE is one of: "
+msgstr ""
+
+#: parted/parted.c:96
+msgid ""
+"START and END are disk locations, such as 4GB or 10%. Negative values count "
+"from the end of the disk. For example, -1s specifies exactly the last "
+"sector.\n"
+msgstr ""
+
+#: parted/parted.c:99
+msgid "STATE is one of: on, off\n"
+msgstr ""
+
+#: parted/parted.c:100
+msgid "DEVICE is usually /dev/hda or /dev/sda\n"
+msgstr ""
+
+#: parted/parted.c:101
+msgid "NAME is any word you want\n"
+msgstr ""
+
+#: parted/parted.c:102
+msgid "The partition must have one of the following FS-TYPEs: "
+msgstr ""
+
+#: parted/parted.c:105
+msgid "GNU Parted Version information:\n"
+msgstr ""
+
+#: parted/parted.c:107
+msgid ""
+"Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n"
+"This program is free software, covered by the GNU General Public License.\n"
+"\n"
+"This program is distributed in the hope that it will be useful, but WITHOUT "
+"ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
+"FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
+"more details.\n"
+"\n"
+msgstr ""
+
+#: parted/parted.c:152
+#, c-format
+msgid "%0.f%%\t(time left %.2d:%.2d)"
+msgstr ""
+
+#: parted/parted.c:170
+#, c-format
+msgid ""
+"Partition %s is being used. You must unmount it before you modify it with "
+"Parted."
+msgstr ""
+
+#: parted/parted.c:187
+#, c-format
+msgid "Partition(s) on %s are being used."
+msgstr ""
+
+#: parted/parted.c:413 parted/parted.c:594 parted/parted.c:979
+#: parted/parted.c:1059 parted/parted.c:1586 parted/parted.c:1663
+#: parted/parted.c:1707
+msgid "Partition number?"
+msgstr ""
+
+#: parted/parted.c:456
+msgid "Source device?"
+msgstr ""
+
+#: parted/parted.c:460
+msgid "Source partition number?"
+msgstr ""
+
+#: parted/parted.c:465
+msgid "Can't copy an extended partition."
+msgstr ""
+
+#: parted/parted.c:471
+msgid "Destination partition number?"
+msgstr ""
+
+#: parted/parted.c:564
+msgid "New disk label type?"
+msgstr ""
+
+#: parted/parted.c:598
+msgid "File system?"
+msgstr ""
+
+#: parted/parted.c:645 parted/parted.c:815
+msgid "Partition type?"
+msgstr ""
+
+#: parted/parted.c:652 parted/parted.c:822 parted/parted.c:1062
+msgid "Partition name?"
+msgstr ""
+
+#: parted/parted.c:660 parted/parted.c:832
+msgid "File system type?"
+msgstr ""
+
+#: parted/parted.c:667 parted/parted.c:834 parted/parted.c:994
+#: parted/parted.c:1544 parted/parted.c:1595
+msgid "Start?"
+msgstr ""
+
+#: parted/parted.c:669 parted/parted.c:837 parted/parted.c:997
+#: parted/parted.c:1546 parted/parted.c:1597
+msgid "End?"
+msgstr ""
+
+#: parted/parted.c:707 parted/parted.c:875
+#, c-format
+msgid ""
+"You requested a partition from %s to %s.\n"
+"The closest location we can manage is %s to %s. Is this still acceptable to "
+"you?"
+msgstr ""
+
+#: parted/parted.c:827
+msgid "An extended partition cannot hold a file system. Did you want mkpart?"
+msgstr ""
+
+#: parted/parted.c:985
+msgid "Can't move an extended partition."
+msgstr ""
+
+#: parted/parted.c:1014
+msgid "Can't move a partition onto itself. Try using resize, perhaps?"
+msgstr ""
+
+#: parted/parted.c:1158
+#, c-format
+msgid "Minor: %d\n"
+msgstr ""
+
+#: parted/parted.c:1159
+#, c-format
+msgid "Flags: %s\n"
+msgstr ""
+
+#: parted/parted.c:1160
+#, c-format
+msgid "File System: %s\n"
+msgstr ""
+
+#: parted/parted.c:1161
+#, c-format
+msgid "Size: "
+msgstr ""
+
+#: parted/parted.c:1166
+#, c-format
+msgid "Minimum size: "
+msgstr ""
+
+#: parted/parted.c:1169
+#, c-format
+msgid "Maximum size: "
+msgstr ""
+
+#: parted/parted.c:1255
+#, c-format
+msgid "Disk %s: %s\n"
+msgstr ""
+
+#: parted/parted.c:1256
+#, c-format
+msgid "Sector size (logical/physical): %lldB/%lldB\n"
+msgstr ""
+
+#: parted/parted.c:1267
+#, c-format
+msgid "BIOS cylinder,head,sector geometry: %d,%d,%d. Each cylinder is %s.\n"
+msgstr ""
+
+#: parted/parted.c:1273
+#, c-format
+msgid "Partition Table: %s\n"
+msgstr ""
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Number"
+msgstr ""
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Start"
+msgstr ""
+
+#: parted/parted.c:1285 parted/parted.c:1288
+msgid "End"
+msgstr ""
+
+#: parted/parted.c:1288
+msgid "Size"
+msgstr ""
+
+#: parted/parted.c:1292
+msgid "Type"
+msgstr ""
+
+#: parted/parted.c:1294
+msgid "File system"
+msgstr ""
+
+#: parted/parted.c:1297
+msgid "Name"
+msgstr ""
+
+#: parted/parted.c:1299
+msgid "Flags"
+msgstr ""
+
+#: parted/parted.c:1352
+msgid "Free Space"
+msgstr ""
+
+#: parted/parted.c:1441
+#, c-format
+msgid ""
+"A %s %s partition was found at %s -> %s. Do you want to add it to the "
+"partition table?"
+msgstr ""
+
+#: parted/parted.c:1479
+msgid "searching for file systems"
+msgstr ""
+
+#: parted/parted.c:1684
+msgid "New device?"
+msgstr ""
+
+#: parted/parted.c:1709
+msgid "Flag to Invert?"
+msgstr ""
+
+#: parted/parted.c:1714
+msgid "New state?"
+msgstr ""
+
+#: parted/parted.c:1747
+msgid "Unit?"
+msgstr ""
+
+#: parted/parted.c:1896
+msgid "check"
+msgstr ""
+
+#: parted/parted.c:1899
+msgid ""
+"check NUMBER do a simple check on the file system"
+msgstr ""
+
+#: parted/parted.c:1905
+msgid "cp"
+msgstr ""
+
+#: parted/parted.c:1908
+msgid ""
+"cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another "
+"partition"
+msgstr ""
+
+#: parted/parted.c:1914
+msgid "help"
+msgstr ""
+
+#: parted/parted.c:1917
+msgid ""
+"help [COMMAND] prints general help, or help on "
+"COMMAND"
+msgstr ""
+
+#: parted/parted.c:1923
+msgid "mklabel"
+msgstr ""
+
+#: parted/parted.c:1926
+msgid ""
+"mklabel LABEL-TYPE create a new disklabel (partition "
+"table)"
+msgstr ""
+
+#: parted/parted.c:1932
+msgid "mkfs"
+msgstr ""
+
+#: parted/parted.c:1935
+msgid ""
+"mkfs NUMBER FS-TYPE make a FS-TYPE file system on "
+"partititon NUMBER"
+msgstr ""
+
+#: parted/parted.c:1941
+msgid "mkpart"
+msgstr ""
+
+#: parted/parted.c:1944
+msgid "mkpart PART-TYPE [FS-TYPE] START END make a partition"
+msgstr ""
+
+#: parted/parted.c:1950
+msgid ""
+"mkpart makes a partition without creating a new file system on the "
+"partition. FS-TYPE may be specified to set an appropriate partition ID.\n"
+msgstr ""
+
+#: parted/parted.c:1955
+msgid "mkpartfs"
+msgstr ""
+
+#: parted/parted.c:1958
+msgid ""
+"mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system"
+msgstr ""
+
+#: parted/parted.c:1964
+msgid "move"
+msgstr ""
+
+#: parted/parted.c:1967
+msgid "move NUMBER START END move partition NUMBER"
+msgstr ""
+
+#: parted/parted.c:1972
+msgid "name"
+msgstr ""
+
+#: parted/parted.c:1975
+msgid "name NUMBER NAME name partition NUMBER as NAME"
+msgstr ""
+
+#: parted/parted.c:1980
+msgid "print"
+msgstr ""
+
+#: parted/parted.c:1983
+msgid ""
+"print [free|NUMBER|all] display the partition table, a "
+"partition, or all devices"
+msgstr ""
+
+#: parted/parted.c:1987
+msgid ""
+"Without arguments, print displays the entire partition table. With 'free'\n"
+"argument, information about free space will be displayed otherwise if a\n"
+"partition number is given, then more detailed information is displayed\n"
+"about that partition. If the 'all' argument is passed instead, partition\n"
+"information for all devices will be displayed."
+msgstr ""
+
+#: parted/parted.c:1995
+msgid "quit"
+msgstr ""
+
+#: parted/parted.c:1998
+msgid "quit exit program"
+msgstr ""
+
+#: parted/parted.c:2003
+msgid "rescue"
+msgstr ""
+
+#: parted/parted.c:2006
+msgid ""
+"rescue START END rescue a lost partition near START "
+"and END"
+msgstr ""
+
+#: parted/parted.c:2012
+msgid "resize"
+msgstr ""
+
+#: parted/parted.c:2015
+msgid ""
+"resize NUMBER START END resize partition NUMBER and its "
+"file system"
+msgstr ""
+
+#: parted/parted.c:2023
+msgid "rm"
+msgstr ""
+
+#: parted/parted.c:2026
+msgid "rm NUMBER delete partition NUMBER"
+msgstr ""
+
+#: parted/parted.c:2031
+msgid "select"
+msgstr ""
+
+#: parted/parted.c:2034
+msgid "select DEVICE choose the device to edit"
+msgstr ""
+
+#: parted/parted.c:2039
+msgid "set"
+msgstr ""
+
+#: parted/parted.c:2042
+msgid ""
+"set NUMBER FLAG STATE change the FLAG on partition NUMBER"
+msgstr ""
+
+#: parted/parted.c:2048
+msgid "toggle"
+msgstr ""
+
+#: parted/parted.c:2051
+msgid ""
+"toggle [NUMBER [FLAG]] toggle the state of FLAG on "
+"partition NUMBER"
+msgstr ""
+
+#: parted/parted.c:2057
+msgid "unit"
+msgstr ""
+
+#: parted/parted.c:2060
+msgid "unit UNIT set the default unit to UNIT"
+msgstr ""
+
+#: parted/parted.c:2065
+msgid "version"
+msgstr ""
+
+#: parted/parted.c:2068
+msgid ""
+"version displays the current version of GNU "
+"Parted and copyright information"
+msgstr ""
+
+#: parted/parted.c:2072
+msgid ""
+"version displays copyright and version information corressponding to this "
+"copy of GNU Parted\n"
+msgstr ""
+
+#: parted/parted.c:2158
+msgid "No device found"
+msgstr ""
+
+#: parted/parted.c:2222
+msgid "Don't forget to update /etc/fstab, if necessary.\n"
+msgstr ""
+
+#: parted/ui.c:68
+msgid "Welcome to GNU Parted! Type 'help' to view a list of commands.\n"
+msgstr ""
+
+#: parted/ui.c:71
+msgid ""
+"Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]\n"
+"Apply COMMANDs with PARAMETERS to DEVICE. If no COMMAND(s) are given, run "
+"in\n"
+"interactive mode.\n"
+msgstr ""
+
+#: parted/ui.c:76
+#, c-format
+msgid ""
+"\n"
+"\n"
+"You found a bug in GNU Parted! Here's what you have to do:\n"
+"\n"
+"Don't panic! The bug has most likely not affected any of your data.\n"
+"Help us to fix this bug by doing the following:\n"
+"\n"
+"Check whether the bug has already been fixed by checking\n"
+"the last version of GNU Parted that you can find at:\n"
+"\n"
+"\thttp://ftp.gnu.org/gnu/parted/\n"
+"\n"
+"Please check this version prior to bug reporting.\n"
+"\n"
+"If this has not been fixed yet or if you don't know how to check,\n"
+"please visit the GNU Parted website:\n"
+"\n"
+"\thttp://www.gnu.org/software/parted\n"
+"\n"
+"for further information.\n"
+"\n"
+"Your report should contain the version of this release (%s)\n"
+"along with the error message below, the output of\n"
+"\n"
+"\tparted DEVICE unit co print unit s print\n"
+"\n"
+"and additional information about your setup you consider important.\n"
+msgstr ""
+
+#: parted/ui.c:230
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_MAPERR (Address not mapped to object)"
+msgstr ""
+
+#: parted/ui.c:235
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_ACCERR (Invalid permissions for mapped object)"
+msgstr ""
+
+#: parted/ui.c:240
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGSEGV signal was encountered."
+msgstr ""
+
+#: parted/ui.c:258
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTDIV (Integer: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:262
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTOVF (Integer: overflow)"
+msgstr ""
+
+#: parted/ui.c:266
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTDIV (Float: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:270
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTOVF (Float: overflow)"
+msgstr ""
+
+#: parted/ui.c:274
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTUND (Float: underflow)"
+msgstr ""
+
+#: parted/ui.c:278
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTRES (Float: inexact result)"
+msgstr ""
+
+#: parted/ui.c:282
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTINV (Float: invalid operation)"
+msgstr ""
+
+#: parted/ui.c:286
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTSUB (Float: subscript out of range)"
+msgstr ""
+
+#: parted/ui.c:291
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGFPE signal was encountered."
+msgstr ""
+
+#: parted/ui.c:310
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPC (Illegal Opcode)"
+msgstr ""
+
+#: parted/ui.c:314
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPN (Illegal Operand)"
+msgstr ""
+
+#: parted/ui.c:318
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLADR (Illegal addressing mode)"
+msgstr ""
+
+#: parted/ui.c:323
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLTRP (Illegal Trap)"
+msgstr ""
+
+#: parted/ui.c:327
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVOPC (Privileged Opcode)"
+msgstr ""
+
+#: parted/ui.c:331
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVREG (Privileged Register)"
+msgstr ""
+
+#: parted/ui.c:335
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_COPROC (Coprocessor Error)"
+msgstr ""
+
+#: parted/ui.c:339
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_BADSTK (Internal Stack Error)"
+msgstr ""
+
+#: parted/ui.c:343
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGILL signal was encountered."
+msgstr ""
+
+#: parted/ui.c:828
+msgid "Expecting a partition number."
+msgstr ""
+
+#: parted/ui.c:837
+msgid "Partition doesn't exist."
+msgstr ""
+
+#: parted/ui.c:857
+msgid "Expecting a file system type."
+msgstr ""
+
+#: parted/ui.c:863
+#, c-format
+msgid "Unknown file system type \"%s\"."
+msgstr ""
+
+#: parted/ui.c:883
+msgid "Expecting a disk label type."
+msgstr ""
+
+#: parted/ui.c:977
+msgid "Can't create any more partitions."
+msgstr ""
+
+#: parted/ui.c:987
+msgid "Expecting a partition type."
+msgstr ""
+
+#: parted/ui.c:1115
+msgid "on"
+msgstr ""
+
+#: parted/ui.c:1116
+msgid "off"
+msgstr ""
+
+#: parted/ui.c:1227
+msgid "OPTIONs:"
+msgstr ""
+
+#: parted/ui.c:1230
+msgid "COMMANDs:"
+msgstr ""
+
+#: parted/ui.c:1238
+#, c-format
+msgid "Using %s\n"
+msgstr ""
diff --git a/po/pl.po b/po/pl.po
new file mode 100644
index 0000000..0ee8582
--- /dev/null
+++ b/po/pl.po
@@ -0,0 +1,2574 @@
+# Polish translations for GNU Parted package.
+# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+# Wojciech Polak <polak@gnu.org>, 2003, 2005.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: parted 1.6.23\n"
+"Report-Msgid-Bugs-To: bug-parted@gnu.org\n"
+"POT-Creation-Date: 2006-04-21 21:20+0200\n"
+"PO-Revision-Date: 2005-07-07 22:23+0200\n"
+"Last-Translator: Wojciech Polak <polak@gnu.org>\n"
+"Language-Team: Polish <translation-team-pl@lists.sourceforge.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-2\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
+"|| n%100>=20) ? 1 : 2);\n"
+
+#: libparted/arch/linux.c:284
+#, c-format
+msgid "Could not stat device %s - %s."
+msgstr "Nie mona sprawdzi urzdzenia %s - %s."
+
+#: libparted/arch/linux.c:390
+#, c-format
+msgid ""
+"Could not determine sector size for %s: %s.\n"
+"Using the default sector size (%lld)."
+msgstr ""
+
+#: libparted/arch/linux.c:401
+#, c-format
+msgid ""
+"Device %s has a logical sector size of %lld. Not all parts of GNU Parted "
+"support this at the moment, and the working code is HIGHLY EXPERIMENTAL.\n"
+msgstr ""
+
+#: libparted/arch/linux.c:441
+#, c-format
+msgid "Unable to determine the size of %s (%s)."
+msgstr "Nie mona ustali rozmiaru %s (%s)."
+
+#: libparted/arch/linux.c:530
+#, c-format
+msgid "Could not get identity of device %s - %s"
+msgstr "Nie mona uzyska tosamoci urzdzenia %s - %s"
+
+#: libparted/arch/linux.c:539
+msgid "Generic IDE"
+msgstr ""
+
+#: libparted/arch/linux.c:556
+#, c-format
+msgid ""
+"Device %s has multiple (%d) logical sectors per physical sector.\n"
+"GNU Parted supports this EXPERIMENTALLY for some special disk label/file "
+"system combinations, e.g. GPT and ext2/3.\n"
+"Please consult the web site for up-to-date information."
+msgstr ""
+
+#: libparted/arch/linux.c:726
+#, c-format
+msgid "Error initialising SCSI device %s - %s"
+msgstr "Bd podczas inicjalizacji urzdzenia SCSI %s - %s"
+
+#: libparted/arch/linux.c:781
+#, fuzzy, c-format
+msgid ""
+"The device %s has zero length, and can't possibly store a file system or "
+"partition table. Perhaps you selected the wrong device?"
+msgstr ""
+"Urzdzenie %s posiada zerow dugo i nie jest w stanie przechowywa "
+"systemu plikw lub tablic partycji. By moe dokonano niewaciwego wyboru "
+"urzdzenia?"
+
+#: libparted/arch/linux.c:829
+msgid ""
+"Unable to determine geometry of file/device. You should not use Parted "
+"unless you REALLY know what you're doing!"
+msgstr ""
+"Nie mona ustali geometrii pliku/urzdzenia. W tym przypadku nie jest "
+"zalecane uywanie Parted chyba, e NAPRAWD wiesz co robisz!"
+
+#: libparted/arch/linux.c:903
+msgid "DAC960 RAID controller"
+msgstr "Kontroler DAC960 RAID"
+
+#: libparted/arch/linux.c:908
+msgid "Compaq Smart Array"
+msgstr "Compaq Smart Array"
+
+#: libparted/arch/linux.c:913
+msgid "ATARAID Controller"
+msgstr "Kontroler ATARAID"
+
+#: libparted/arch/linux.c:918
+msgid "I2O Controller"
+msgstr "Kontroler I20"
+
+#: libparted/arch/linux.c:923
+msgid "User-Mode Linux UBD"
+msgstr ""
+
+#: libparted/arch/linux.c:933
+msgid "Unknown"
+msgstr "Nieznane"
+
+#: libparted/arch/linux.c:940
+msgid "ped_device_new() Unsupported device type"
+msgstr "ped_device_new() Ten typ urzdzenia nie jest wspierany"
+
+#: libparted/arch/linux.c:1041 libparted/arch/gnu.c:264
+#, c-format
+msgid "Error opening %s: %s"
+msgstr "Bd podczas otwierania %s: %s"
+
+#: libparted/arch/linux.c:1052 libparted/arch/gnu.c:274
+#, c-format
+msgid "Unable to open %s read-write (%s). %s has been opened read-only."
+msgstr ""
+"Nie mona otworzy %s jednoczenie w trybie do odczytu i zapisu (%s). %s "
+"zosta otwarty tylko w trybie do odczytu."
+
+#: libparted/arch/linux.c:1160 libparted/arch/linux.c:1228
+#: libparted/arch/gnu.c:452 libparted/arch/gnu.c:550 libparted/arch/gnu.c:678
+#, c-format
+msgid "%s during read on %s"
+msgstr "%s podczas czytania %s"
+
+#: libparted/arch/linux.c:1199
+#, c-format
+msgid "%s during seek for read on %s"
+msgstr "%s podczas ustawiania do odczytu na %s"
+
+#: libparted/arch/linux.c:1270 libparted/arch/linux.c:1355
+#: libparted/arch/linux.c:1413 libparted/arch/gnu.c:587
+#: libparted/arch/gnu.c:632 libparted/arch/gnu.c:709
+#, c-format
+msgid "%s during write on %s"
+msgstr "%s podczas zapisu %s"
+
+#: libparted/arch/linux.c:1297 libparted/arch/gnu.c:512
+#, c-format
+msgid "Can't write to %s, because it is opened read-only."
+msgstr "Nie mona zapisa do %s, poniewa otwarte jest tylko do czytania."
+
+#: libparted/arch/linux.c:1321
+#, c-format
+msgid "%s during seek for write on %s"
+msgstr "%s podczas ustawiania do zapisu na %s"
+
+#: libparted/arch/linux.c:1798
+#, c-format
+msgid ""
+"Error informing the kernel about modifications to partition %s -- %s. This "
+"means Linux won't know about any changes you made to %s until you reboot -- "
+"so you shouldn't mount it or use it in any way before rebooting."
+msgstr ""
+"Bd podczas informowania jdra systemu o modyfikacji partycji %s -- %s. "
+"Oznacza to, e Linux nie bdzie wiedzia o adnych zmianach jakie zostay "
+"dokonane na %s a do czasu ponownego uruchomienia komputera -- prosz nie "
+"podcza ani uywa tej partycji do czasu ponownego uruchomienia komputera."
+
+#: libparted/arch/linux.c:1879
+#, c-format
+msgid ""
+"The kernel was unable to re-read the partition table on %s (%s). This means "
+"Linux won't know anything about the modifications you made until you "
+"reboot. You should reboot your computer before doing anything with %s."
+msgstr ""
+"Jdro systemu nie mogo ponownie odczyta tablicy partycji na %s (%s). "
+"Oznacza to, e Linux nie bdzie wiedzia nic o modyfikacjach jakie zostay "
+"poczynione a do czasu ponownego uruchomienia komputera. Naley ponownie "
+"uruchomi komputer zanim wykonasz jakkolwiek operacj na %s."
+
+#: libparted/arch/gnu.c:97
+#, c-format
+msgid "Unable to open %s."
+msgstr "Nie mona otworzy %s."
+
+#: libparted/arch/gnu.c:117
+msgid "Unable to probe store."
+msgstr "Detekcja geometrii nie powioda si."
+
+#: libparted/arch/gnu.c:355
+msgid ""
+"The partition table cannot be re-read. This means you need to reboot before "
+"mounting any modified partitions. You also need to reinstall your boot "
+"loader before you reboot (which may require mounting modified partitions). "
+"It is impossible do both things! So you'll need to boot off a rescue disk, "
+"and reinstall your boot loader from the rescue disk. Read section 4 of the "
+"Parted User documentation for more information."
+msgstr ""
+"Nie mona ponownie odczyta tablicy partycji. Naley ponownie uruchomi "
+"komputer przed podczeniem jakichkolwiek zmodyfikowanych partycji. Naley "
+"take przeinstalowa program adujcy (boot loader) zanim uruchomisz "
+"ponownie komputer (co moe wymaga podczenia zmodyfikowanych partycji). "
+"Wykonanie dwch powyszych rzeczy jest niemoliwe! A wic pozostaje Ci "
+"uruchomienie dysku/pyty ratunkowej i przeinstalowanie programu adujcego "
+"prosto z dysku ratunkowego. Przeczytaj rozdzia 4 dokumentacji programu GNU "
+"Parted, aby uzyska wicej informacji na ten temat."
+
+#: libparted/arch/gnu.c:372
+#, c-format
+msgid ""
+"The partition table on %s cannot be re-read (%s). This means the Hurd knows "
+"nothing about any modifications you made. You should reboot your computer "
+"before doing anything with %s."
+msgstr ""
+"Nie mona ponownie wczyta tablicy partycji na %s (%s). Oznacza to, e Hurd "
+"nie wie o adnych zmianach jakie zostay wprowadzone. Naley ponownie "
+"uruchomi komputer zanim wykonasz jakkolwiek operacj na %s."
+
+#: libparted/arch/gnu.c:383 parted/parted.c:2215
+msgid ""
+"You should reinstall your boot loader before rebooting. Read section 4 of "
+"the Parted User documentation for more information."
+msgstr ""
+"Naley przeinstalowa program adujcy (boot loader) przed ponownym "
+"uruchomieniem komputera. Przeczytaj rozdzia 4 dokumentacji uytkownika "
+"Parted, aby uzyska wicej informacji."
+
+#: libparted/arch/gnu.c:774
+#, c-format
+msgid "%s trying to sync %s to disk"
+msgstr "Bd synchronizacji %s do dysku %s"
+
+#: libparted/disk.c:183
+#, c-format
+msgid "Unable to open %s - unrecognised disk label."
+msgstr "Nie mona otworzy %s - nierozpoznana etykieta dysku."
+
+#: libparted/disk.c:452
+#, c-format
+msgid ""
+"This libparted doesn't have write support for %s. Perhaps it was compiled "
+"read-only."
+msgstr ""
+"Biblioteka libparted nie posiada obsugi zapisu dla %s. By moe zostaa "
+"ona zbudowana z obsug tylko-do-odczytu."
+
+#: libparted/disk.c:579
+#, c-format
+msgid "Partition %d is %s, but the file system is %s."
+msgstr "Partycja %d jest %s, lecz system plikw jest %s."
+
+#: libparted/disk.c:1056
+#, c-format
+msgid "%s disk labels do not support extended partitions."
+msgstr "Etykiety dysku %s nie wspieraj rozszerzonych partycji."
+
+#: libparted/disk.c:1616
+#, c-format
+msgid "%s disk labels don't support logical or extended partitions."
+msgstr "Etykiety dysku %s nie wspieraj logicznych lub rozszerzonych partycji."
+
+#: libparted/disk.c:1629
+msgid "Too many primary partitions."
+msgstr "Zbyt duo partycji gwnych."
+
+#: libparted/disk.c:1638
+#, c-format
+msgid ""
+"Can't add a logical partition to %s, because there is no extended partition."
+msgstr ""
+"Nie mona doda logicznej partycji do %s, poniewa nie istnieje rozszerzona "
+"partycja."
+
+#: libparted/disk.c:1662
+#, c-format
+msgid "Can't have more than one extended partition on %s."
+msgstr "Nie mona mie wicej ni jedn rozszerzon partycj na %s."
+
+#: libparted/disk.c:1672
+msgid "Can't have logical partitions outside of the extended partition."
+msgstr "Nie mona mie logicznych partycji poza rozszerzon partycj."
+
+#: libparted/disk.c:1697
+#, c-format
+msgid "Can't have a logical partition outside of the extended partition on %s."
+msgstr "%s nie moe mie logicznej partycji poza rozszerzon partycj."
+
+#: libparted/disk.c:1707 libparted/disk.c:1761 libparted/disk.c:1927
+msgid "Can't have overlapping partitions."
+msgstr "Nie mona mie nakadajcych si partycji."
+
+#: libparted/disk.c:1715
+msgid "Can't have a primary partition inside an extended partition."
+msgstr "Nie mona mie gwnej partycji wewntrz rozszerzonej partycji."
+
+#: libparted/disk.c:2123
+msgid "metadata"
+msgstr "metadane"
+
+#: libparted/disk.c:2125
+msgid "free"
+msgstr "wolna"
+
+#: libparted/disk.c:2127 parted/ui.c:968 parted/ui.c:996
+msgid "extended"
+msgstr "rozszerzona"
+
+#: libparted/disk.c:2129 parted/ui.c:972 parted/ui.c:1000
+msgid "logical"
+msgstr "logiczna"
+
+#: libparted/disk.c:2131 parted/ui.c:964 parted/ui.c:992
+msgid "primary"
+msgstr "gwna"
+
+#: libparted/disk.c:2147
+msgid "boot"
+msgstr "adowalna"
+
+#: libparted/disk.c:2149
+msgid "root"
+msgstr "root"
+
+#: libparted/disk.c:2151
+msgid "swap"
+msgstr "wymiany"
+
+#: libparted/disk.c:2153
+msgid "hidden"
+msgstr "ukryta"
+
+#: libparted/disk.c:2155
+msgid "raid"
+msgstr "raid"
+
+#: libparted/disk.c:2157
+msgid "lvm"
+msgstr "lvm"
+
+#: libparted/disk.c:2159
+msgid "lba"
+msgstr "lba"
+
+#: libparted/disk.c:2161
+msgid "hp-service"
+msgstr "usuga-hp"
+
+#: libparted/disk.c:2163
+msgid "palo"
+msgstr "palo"
+
+#: libparted/disk.c:2165
+msgid "prep"
+msgstr "prep"
+
+#: libparted/disk.c:2167
+msgid "msftres"
+msgstr ""
+
+#: libparted/disk.c:2173
+#, c-format
+msgid "Unknown partition flag, %d."
+msgstr "Nieznana flaga partycji, %d."
+
+#: libparted/labels/rdb.c:177
+#, c-format
+msgid "%s : Bad checksum on block %llu of type %s."
+msgstr "%s : Nieprawidowa suma kontrolna bloku %llu typu %s."
+
+#: libparted/labels/rdb.c:510
+#, c-format
+msgid "%s : Didn't find rdb block, should never happen."
+msgstr "%s : Nie znaleziono bloku rdb, co nie powinno si zdarzy."
+
+#: libparted/labels/rdb.c:595
+#, c-format
+msgid "%s : Loop detected at block %d."
+msgstr "%s : Wykryto ptl na bloku %d."
+
+#: libparted/labels/rdb.c:614
+#, c-format
+msgid "%s : The %s list seems bad at block %s."
+msgstr "%s : Lista %s wydaje si by uszkodzona na bloku %s."
+
+#: libparted/labels/rdb.c:703
+#, c-format
+msgid "%s : Failed to list bad blocks."
+msgstr "%s : Nie powiodo si wypisanie uszkodzonych blokw."
+
+#: libparted/labels/rdb.c:711
+#, c-format
+msgid "%s : Failed to list partition blocks."
+msgstr "%s : Wypisanie blokw partycji nie powiodo si."
+
+#: libparted/labels/rdb.c:719
+#, c-format
+msgid "%s : Failed to list file system blocks."
+msgstr "%s : Wypisanie blokw systemu plikw nie powiodo si."
+
+#: libparted/labels/rdb.c:727
+#, c-format
+msgid "%s : Failed to list boot blocks."
+msgstr "%s : Nie powiodo si wypisanie blokw rozruchowych."
+
+#: libparted/labels/rdb.c:750
+#, c-format
+msgid "Failed to write partition block at %d."
+msgstr "Nie powid si zapis bloku partycji na %d."
+
+#: libparted/labels/rdb.c:1053 libparted/labels/bsd.c:505
+#: libparted/labels/dos.c:1942 libparted/labels/dvh.c:772
+#: libparted/labels/gpt.c:1365 libparted/labels/loop.c:251
+#: libparted/labels/mac.c:1318 libparted/labels/pc98.c:764
+#: libparted/labels/sun.c:704
+msgid "Unable to satisfy all constraints on the partition."
+msgstr "Nie mona zaspokoi wszystkich ogranicze na partycji."
+
+#: libparted/labels/rdb.c:1081
+msgid "Unable to allocate a partition number."
+msgstr "Nie mona przydzieli numeru partycji."
+
+#: libparted/labels/bsd.c:530
+msgid "Unable to allocate a bsd disklabel slot."
+msgstr "Nie mona przydzieli miejsca na etykiet dysku bsd."
+
+#: libparted/labels/dos.c:812
+#, c-format
+msgid "Invalid partition table on %s -- wrong signature %x."
+msgstr "Nieprawidowa tablica partycji na %s -- bdna sygnatura %x."
+
+#: libparted/labels/dos.c:840
+#, c-format
+msgid "Invalid partition table - recursive partition on %s."
+msgstr "Nieprawidowa tablica partycji - partycja rekursywna na %s."
+
+#: libparted/labels/dos.c:1300
+msgid "Extended partitions cannot be hidden on msdos disk labels."
+msgstr "Rozszerzone partycje nie mog by ukryte dla etykieta dyskw msdos."
+
+#: libparted/labels/dos.c:1926
+msgid "Parted can't resize partitions managed by Windows Dynamic Disk."
+msgstr ""
+"Parted nie moe zmieni rozmiaru partycji zarzdzanych przez Windows Dynamic "
+"Disk."
+
+#: libparted/labels/dvh.c:192
+#, fuzzy, c-format
+msgid "%s has no extended partition (volume header partition)."
+msgstr ""
+"%s nie posiada adnych rozszerzonych partycji (nagwek wolumenu partycji). "
+"Jeeli zignorujesz, to jakiekolwiek wolumeny rozruchowe (boot volumes) "
+"zostan skasowane."
+
+#: libparted/labels/dvh.c:315
+msgid "Checksum is wrong, indicating the partition table is corrupt."
+msgstr ""
+"Suma kontrolna jest bdna i oznacza to, e tablica partycji jest uszkodzona."
+
+#: libparted/labels/dvh.c:616
+msgid "Only primary partitions can be root partitions."
+msgstr "Tylko gwne partycje mog by typu root."
+
+#: libparted/labels/dvh.c:630
+msgid "Only primary partitions can be swap partitions."
+msgstr "Tylko gwne partycje mog by partycjami wymiany."
+
+#: libparted/labels/dvh.c:644
+msgid "Only logical partitions can be a boot file."
+msgstr "Tylko logiczne partycje mog by plikami adowalnymi (boot)."
+
+#: libparted/labels/dvh.c:723
+msgid "Only logical partitions (boot files) have a name."
+msgstr "Tylko logiczne partycje (adowalne pliki) maj nazwy."
+
+#: libparted/labels/dvh.c:814
+msgid "Too many primary partitions"
+msgstr "Zbyt duo partycji gwnych"
+
+#: libparted/labels/gpt.c:433
+#, c-format
+msgid ""
+"%s contains GPT signatures, indicating that it has a GPT table. However, it "
+"does not have a valid fake msdos partition table, as it should. Perhaps it "
+"was corrupted -- possibly by a program that doesn't understand GPT partition "
+"tables. Or perhaps you deleted the GPT table, and are now using an msdos "
+"partition table. Is this a GPT partition table?"
+msgstr ""
+"%s zawiera sygnatur GPT. Oznacza to, e posiada tablic GPT, ale nie "
+"posiada prawidowej faszywej tablicy partycji msdos, tak jak powinna. By "
+"moe jest uszkodzona -- moliwe, e przez program, ktry nie rozumie tablic "
+"partycji GPT. Albo te tablica GPT zostaa skasowana, za teraz uywana "
+"jest tablica partycji msdos. Czy to jest tablica partycji GPT?"
+
+#: libparted/labels/gpt.c:625
+#, c-format
+msgid ""
+"The format of the GPT partition table is version %x, which is newer than "
+"what Parted can recognise. Please tell us! bug-parted@gnu.org"
+msgstr ""
+"Format tablicy partycji GPT (wersja %x) jest nowszy ni program Parted jest "
+"w stanie rozpozna. Poinformuj nas o tym! bug-parted@gnu.org"
+
+#: libparted/labels/gpt.c:747
+msgid ""
+"The backup GPT table is not at the end of the disk, as it should be. This "
+"might mean that another operating system believes the disk is smaller. Fix, "
+"by moving the backup to the end (and removing the old backup)?"
+msgstr ""
+"Kopia zapasowa tablicy GPT nie znajduje si na kocu dysku, a powinna. Moe "
+"to oznacza, e inny system operacyjny myli, e dysk jest mniejszy ni jest "
+"w rzeczywistoci. Czy naprawi to poprzez przesunicie kopii zapasowej na "
+"koniec (i usunicie starej kopii)?"
+
+#: libparted/labels/gpt.c:782
+msgid ""
+"The primary GPT table is corrupt, but the backup appears OK, so that will be "
+"used."
+msgstr ""
+"Gwna tablica GPT jest uszkodzona, ale jej kopia zapasowa wydaje si by w "
+"porzdku i zostanie ona uyta."
+
+#: libparted/labels/gpt.c:790
+msgid ""
+"Both the primary and backup GPT tables are corrupt. Try making a fresh "
+"table, and using Parted's rescue feature to recover partitions."
+msgstr ""
+"Obie tablice GPT, gwna i jej kopia zapasowa, s uszkodzone. Sprbuj "
+"utworzy now tablic oraz uyj opcj 'rescue', aby odzyska partycje."
+
+#: libparted/labels/mac.c:167
+#, c-format
+msgid "Invalid signature %x for Mac disk labels."
+msgstr "Nieprawidowy podpis %x dla etykiet dyskw Mac."
+
+#: libparted/labels/mac.c:212
+msgid "Partition map has no partition map entry!"
+msgstr "Mapa partycji nie posiada wpisu mapy partycji!"
+
+#: libparted/labels/mac.c:259
+#, c-format
+msgid "%s is too small for a Mac disk label!"
+msgstr "%s jest zbyt may dla etykiety dysku Mac!"
+
+#: libparted/labels/mac.c:490
+#, c-format
+msgid "Partition %d has an invalid signature %x."
+msgstr "Partycja %d posiada nieprawidowy podpis %x."
+
+#: libparted/labels/mac.c:508
+#, c-format
+msgid "Partition %d has an invalid length of 0 bytes!"
+msgstr "Partycja %d posiada nieprawidow dugo 0 bajtw!"
+
+#: libparted/labels/mac.c:536
+msgid "The data region doesn't start at the start of the partition."
+msgstr "Obszar danych nie rozpoczyna si na pocztku partycji."
+
+#: libparted/labels/mac.c:553
+msgid "The boot region doesn't start at the start of the partition."
+msgstr "Obszar rozruchowy nie zaczyna si na pocztku partycji."
+
+#: libparted/labels/mac.c:567
+msgid "The partition's boot region doesn't occupy the entire partition."
+msgstr "Obszar rozruchowy partycji nie okupuje caej partycji."
+
+#: libparted/labels/mac.c:577
+msgid "The partition's data region doesn't occupy the entire partition."
+msgstr "Obszar danych partycji nie okupuje caej partycji."
+
+#: libparted/labels/mac.c:631
+#, c-format
+msgid ""
+"Weird block size on device descriptor: %d bytes is not divisible by 512."
+msgstr ""
+"Dziwny rozmiar bloku w deskryptorze urzdzenia: %d bajtw nie jest podzielne "
+"przez 512."
+
+#: libparted/labels/mac.c:644
+#, c-format
+msgid ""
+"The driver descriptor says the physical block size is %d bytes, but Linux "
+"says it is %d bytes."
+msgstr ""
+"Deskryptor napdu mwi, e fizyczny rozmiar bloku wynosi %d bajtw, ale "
+"Linux mwi, e wynosi %d bajtw."
+
+#: libparted/labels/mac.c:692
+msgid "No valid partition map found."
+msgstr "Nie znaleziono prawidowej mapy partycji."
+
+#: libparted/labels/mac.c:744
+#, c-format
+msgid ""
+"Conflicting partition map entry sizes! Entry 1 says it is %d, but entry %d "
+"says it is %d!"
+msgstr ""
+"Wystpi konflikt midzy rozmiarami wpisw mapy partycji! Wpis 1 mwi, e "
+"jest %d, ale wpis %d mwi, e jest %d!"
+
+#: libparted/labels/mac.c:771
+msgid "Weird! There are 2 partitions map entries!"
+msgstr "Dziwne! Istniej 2 wpisy map partycji!"
+
+#: libparted/labels/mac.c:1257
+msgid ""
+"Changing the name of a root or swap partition will prevent Linux from "
+"recognising it as such."
+msgstr ""
+"Zmiana nazwy partycji root lub wymiany spowoduje, e Linux jej nie rozpozna."
+
+#: libparted/labels/mac.c:1353
+msgid "Can't add another partition -- the partition map is too small!"
+msgstr "Nie mona doda kolejnej partycji -- mapa partycji jest zbyt maa!"
+
+#: libparted/labels/pc98.c:357
+#, c-format
+msgid "Invalid partition table on %s."
+msgstr "Nieprawidowa tablica partycji na %s."
+
+#: libparted/labels/pc98.c:409 libparted/labels/pc98.c:487
+#, c-format
+msgid ""
+"Partition %d isn't aligned to cylinder boundaries. This is still "
+"unsupported."
+msgstr ""
+"Partycja %d nie jest wyrwnana do granic cylindra. Nadal nie jest to "
+"wspierane."
+
+#: libparted/labels/pc98.c:796
+msgid "Can't add another partition."
+msgstr "Nie mona doda kolejnej partycji."
+
+#: libparted/labels/sun.c:143
+msgid "Corrupted Sun disk label detected."
+msgstr "Wykryto uszkodzon etykiet dysku Sun."
+
+#: libparted/labels/sun.c:264
+#, c-format
+msgid ""
+"The disk CHS geometry (%d,%d,%d) reported by the operating system does not "
+"match the geometry stored on the disk label (%d,%d,%d)."
+msgstr ""
+"Geometria dysku CHS (%d,%d,%d), zgoszona przez system operacyjny, nie "
+"pasuje do geometrii przechowywanej w etykiecie dysku (%d,%d,%d)."
+
+#: libparted/labels/sun.c:286
+#, c-format
+msgid "The disk label describes a disk bigger than %s."
+msgstr "Etykieta dysku opisuje dysk wikszy ni %s."
+
+#: libparted/labels/sun.c:440
+#, c-format
+msgid "The disk has %d cylinders, which is greater than the maximum of 65536."
+msgstr ""
+"Dysk posiada %d cylindrw, co stanowi wicej ni dopuszczalny limit 65536."
+
+#: libparted/labels/sun.c:736
+msgid ""
+"The Whole Disk partition is the only available one left. Generally, it is "
+"not a good idea to overwrite this partition with a real one. Solaris may "
+"not be able to boot without it, and SILO (the sparc boot loader) appreciates "
+"it as well."
+msgstr ""
+"Partycja caego dysku jest jedyn jaka pozostaa. Generalnie nie jest to "
+"dobry pomys, aby j nadpisa inn, prawdziw. System Solaris moe si bez "
+"niej nie uruchomi, za SILO (program adujcy SPARC) rwnie j doceni."
+
+#: libparted/labels/sun.c:751
+msgid "Sun disk label is full."
+msgstr "Etykieta dysku Sun jest pena."
+
+#: libparted/filesys.c:386
+msgid "Could not detect file system."
+msgstr "Nie mona wykry systemu plikw."
+
+#: libparted/filesys.c:397
+msgid "The file system is bigger than its volume!"
+msgstr "System plikw jest wikszy ni jego wolumen!"
+
+#: libparted/filesys.c:405
+#, c-format
+msgid "Support for opening %s file systems is not implemented yet."
+msgstr ""
+"Wsparcie dla otwierania systemw plikw %s nie zostao jeszcze "
+"zaimplementowane."
+
+#: libparted/filesys.c:447
+#, c-format
+msgid "Support for creating %s file systems is not implemented yet."
+msgstr ""
+"Wsparcie dla tworzenia systemw plikw %s nie zostao jeszcze "
+"zaimplementowane."
+
+#: libparted/filesys.c:508
+#, c-format
+msgid "Support for checking %s file systems is not implemented yet."
+msgstr ""
+"Wsparcie dla sprawdzania systemw plikw %s nie zostao jeszcze "
+"zaimplementowane."
+
+#: libparted/filesys.c:574
+msgid "raw block copying"
+msgstr "bezporednie kopiowanie blokw"
+
+#: libparted/filesys.c:585
+msgid "growing file system"
+msgstr "powikszanie systemu plikw"
+
+#: libparted/filesys.c:625
+msgid "Can't copy onto an overlapping partition."
+msgstr "Nie mona skopiowa na nakadajc si partycj."
+
+#: libparted/filesys.c:647
+#, c-format
+msgid ""
+"Direct support for copying file systems is not yet implemented for %s. "
+"However, support for resizing is implemented. Therefore, the file system "
+"can be copied if the new partition is at least as big as the old one. So, "
+"either shrink the partition you are trying to copy, or copy to a bigger "
+"partition."
+msgstr ""
+"Bezporednie wsparcie kopiowania systemw plikw dla %s nie jest jeszcze "
+"zaimplementowane. Aczkolwiek, wspierana jest zmiana rozmiaru systemu "
+"plikw. Tak wic, system plikw moe zosta skopiowany, jeli nowa partycja "
+"ma przynajmniej tak sam pojemno jak stara. Moesz take zmniejszy "
+"rozmiar partycji, ktr chcesz skopiowa lub skopiuj na partycj o wikszym "
+"rozmiarze."
+
+#: libparted/filesys.c:661
+#, c-format
+msgid "Support for copying %s file systems is not implemented yet."
+msgstr ""
+"Wsparcie dla kopiowania systemw plikw %s nie zostao jeszcze "
+"zaimplementowane."
+
+#: libparted/filesys.c:699
+#, c-format
+msgid "Support for resizing %s file systems is not implemented yet."
+msgstr ""
+"Wsparcie dla zmiany wielkoci systemw plikw %s nie zostao jeszcze "
+"zaimplementowane."
+
+#: libparted/exception.c:78
+msgid "Information"
+msgstr "Informacja"
+
+#: libparted/exception.c:79
+msgid "Warning"
+msgstr "Ostrzeenie"
+
+#: libparted/exception.c:80
+msgid "Error"
+msgstr "Bd"
+
+#: libparted/exception.c:81
+msgid "Fatal"
+msgstr "Fatalny bd"
+
+#: libparted/exception.c:82
+msgid "Bug"
+msgstr "Bd"
+
+#: libparted/exception.c:83
+msgid "No Implementation"
+msgstr "Brak implementacji"
+
+#: libparted/exception.c:87
+msgid "Fix"
+msgstr "Fix"
+
+#: libparted/exception.c:88
+msgid "Yes"
+msgstr "Tak"
+
+#: libparted/exception.c:89
+msgid "No"
+msgstr "Nie"
+
+#: libparted/exception.c:90
+msgid "OK"
+msgstr "OK"
+
+#: libparted/exception.c:91
+msgid "Retry"
+msgstr "Powtrz"
+
+#: libparted/exception.c:92
+msgid "Ignore"
+msgstr "Zignoruj"
+
+#: libparted/exception.c:93
+msgid "Cancel"
+msgstr "Poniechaj"
+
+#: libparted/exception.c:133
+#, fuzzy, c-format
+msgid ""
+"A bug has been detected in GNU Parted. Refer to the web site of parted "
+"http://www.gnu.org/software/parted/parted.html for more informations of what "
+"could be useful for bug submitting! Please email a bug report to bug-"
+"parted@gnu.org containing at least the version (%s) and the following "
+"message: "
+msgstr ""
+"Zosta wykryty bd w dziaaniu programu GNU parted. Prosz wysa raport "
+"na ten temat na adres bug-parted@gnu.org, doczajc numer wersji (%s) oraz "
+"nastpujc wiadomo:"
+
+#: libparted/cs/geom.c:162
+msgid "Can't have the end before the start!"
+msgstr "Nie mona mie koca przed pocztkiem!"
+
+#: libparted/cs/geom.c:169
+msgid "Can't have a partition outside the disk!"
+msgstr "Nie mona mie partycji poza dyskiem!"
+
+#: libparted/cs/geom.c:303
+#, c-format
+msgid "Attempt to read sectors %ld-%ld outside of partition on %s."
+msgstr "Prba odczytania sektorw %ld-%ld poza partycj na %s."
+
+#: libparted/cs/geom.c:373
+#, c-format
+msgid "Attempt to write sectors %ld-%ld outside of partition on %s."
+msgstr "Prba zapisania sektorw %ld-%ld poza partycj na %s."
+
+#: libparted/cs/geom.c:413 libparted/fs/linux_swap/linux_swap.c:353
+msgid "checking for bad blocks"
+msgstr "sprawdzam czy istniej uszkodzone bloki"
+
+#: libparted/libparted.c:286 libparted/libparted.c:306
+msgid "Out of memory."
+msgstr "Brak pamici"
+
+#: libparted/unit.c:139
+msgid "Cannot get unit size for special unit 'COMPACT'."
+msgstr ""
+"Nie mona pobra rozmiaru jednostki dla specjalnej jednostki 'COMPACT'."
+
+#: libparted/unit.c:382
+#, c-format
+msgid "\"%s\" has invalid syntax for locations."
+msgstr "\"%s\" posiada nieprawidow skadni dla lokacji."
+
+#: libparted/unit.c:390
+#, c-format
+msgid "The maximum head value is %d."
+msgstr "Maksymalna warto gowicy wynosi %d."
+
+#: libparted/unit.c:397
+#, c-format
+msgid "The maximum sector value is %d."
+msgstr "Maksymalna warto sektora wynosi %d."
+
+#: libparted/unit.c:409 libparted/unit.c:540
+#, c-format
+msgid "The location %s is outside of the device %s."
+msgstr "Lokacja %s jest poza urzdzeniem %s."
+
+#: libparted/unit.c:522
+msgid "Invalid number."
+msgstr "Nieprawidowy numer."
+
+#: libparted/fs/ext2/ext2.c:87 libparted/fs/ext2/ext2.c:112
+msgid "Inconsistent group descriptors!"
+msgstr "Sprzeczne deskryptory grup!"
+
+#: libparted/fs/ext2/ext2.c:91 libparted/fs/ext2/ext2.c:116
+msgid "File system full!"
+msgstr "Peny system plikw!"
+
+#: libparted/fs/ext2/ext2.c:750
+msgid "Invalid superblock. Are you sure this is an ext2 file system?"
+msgstr "Nieprawidowy superblok. Czy to na pewno jest system plikw ext2?"
+
+#: libparted/fs/ext2/ext2.c:764 libparted/fs/ext2/ext2_resize.c:597
+msgid "File system has errors! You should run e2fsck."
+msgstr "System plikw posiada bdy! Uruchom program e2fsck."
+
+#: libparted/fs/ext2/ext2.c:775
+msgid ""
+"File system was not cleanly unmounted! You should run e2fsck. Modifying an "
+"unclean file system could cause severe corruption."
+msgstr ""
+"System plikw nie zosta prawidowo odczony! Uruchom program e2fsck. "
+"Modyfikowanie takiego systemu plikw moe spowodowa jego uszkodzenie."
+
+#: libparted/fs/ext2/ext2.c:795
+msgid "File system has an incompatible feature enabled."
+msgstr "System plikw ma wczon niekompatybiln funkcj."
+
+#: libparted/fs/ext2/ext2.c:806
+msgid "Error allocating buffer cache."
+msgstr "Bd podczas przydzielania pamici do bufora podrcznego."
+
+#: libparted/fs/ext2/ext2.c:848
+msgid ""
+"A resize operation on this file system will use EXPERIMENTAL code that MAY "
+"CORRUPT it (although it hasn't done so yet).You should at least backup your "
+"data and run 'e2fsck -f' afterwards."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:114
+msgid ""
+"Found an inode with a incorrect link count. Better go run e2fsck first!"
+msgstr ""
+"Znaleziono i-wze z nieprawidowym licznikiem dowiza. Lepiej uruchom "
+"najpierw program e2fsck!"
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:487
+msgid "Not enough free inodes!"
+msgstr "Zbyt mao wolnych i-wzw!"
+
+#: libparted/fs/ext2/ext2_resize.c:224
+msgid "File system is too full to remove a group!"
+msgstr "System plikw jest zbyt peny, aby usun grup!"
+
+#: libparted/fs/ext2/ext2_resize.c:233
+msgid "File system has too many allocated inodes to remove a group!"
+msgstr ""
+"System plikw posiada zbyt duo przydzielonych i-wzw, aby usun grup!"
+
+#: libparted/fs/ext2/ext2_resize.c:493
+msgid "adding groups"
+msgstr "dodawanie grup"
+
+#: libparted/fs/ext2/ext2_resize.c:530
+#, c-format
+msgid "Your file system is too full to resize it to %i blocks. Sorry."
+msgstr ""
+"Twj system plikw jest zbyt peny, aby mc zmieni jego rozmiar do %i "
+"blokw. Przykro mi."
+
+#: libparted/fs/ext2/ext2_resize.c:540
+#, c-format
+msgid ""
+"Your file system has too many occupied inodes to resize it to %i blocks. "
+"Sorry."
+msgstr ""
+"Twj system plikw posiada zbyt duo okupowanych i-wzw, aby mc zmieni "
+"jego rozmiar do %i blokw. Przykro mi."
+
+#: libparted/fs/ext2/ext2_resize.c:554 libparted/fs/hfs/hfs.c:243
+#: libparted/fs/hfs/hfs.c:624
+msgid "shrinking"
+msgstr "zmniejszanie"
+
+#: libparted/fs/ext2/ext2_resize.c:605
+msgid "File system was not cleanly unmounted! You should run e2fsck."
+msgstr ""
+"System plikw nie zosta prawidowo odczony! Uruchom program e2fsck."
+
+#: libparted/fs/ext2/ext2_resize.c:614
+msgid ""
+"The file system has the 'dir_index' feature enabled. Parted can only resize "
+"the file system if it disables this feature. You can enable it later by "
+"running 'tune2fs -O dir_index DEVICE' and then 'e2fsck -fD DEVICE'."
+msgstr ""
+"System plikw posiada wczon funkcj 'dir_index'. Parted moe tylko "
+"zmieni rozmiar systemu plikw jeli zostanie wyczona ta funkcja. Moesz "
+"j wczy ponownie pniej poprzez uruchomienie 'tune2fs -O dir_index "
+"URZDZENIE', a nastpnie 'e2fsck -fD URZDZENIE'."
+
+#: libparted/fs/ext2/ext2_block_relocator.c:198
+msgid "Cross-linked blocks found! Better go run e2fsck first!"
+msgstr ""
+"Znaleziono bloki dowizane skronie! Lepiej uruchom najpierw program e2fsck!"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:537
+#, c-format
+msgid "Block %i has no reference? Weird."
+msgstr "Blok %i nie posiada odwoa? Dziwne."
+
+#: libparted/fs/ext2/ext2_block_relocator.c:738
+#, c-format
+msgid "Block %i shouldn't have been marked!"
+msgstr "Blok %i nie powinien by zaznaczony!"
+
+#: libparted/fs/ext2/interface.c:188
+msgid ""
+"The ext2 file system passed a basic check. For a more comprehensive check, "
+"use the e2fsck program."
+msgstr ""
+"System plikw ext2 przeszed pomylnie podstawowe sprawdzenie. Uyj program "
+"e2fsck, aby wykona bardziej wyczerpujce sprawdzenie."
+
+#: libparted/fs/ext2/interface.c:205
+msgid "Sorry, can't move the start of ext2 partitions yet!"
+msgstr "Przepraszam, ale na razie nie mona przesun pocztku partycji ext2!"
+
+#: libparted/fs/ext2/ext2_buffer.c:82
+msgid "Couldn't flush buffer cache!"
+msgstr "Nie mona oprni bufora pamici podrcznej!"
+
+#: libparted/fs/ext2/ext2_mkfs.c:162
+msgid "writing per-group metadata"
+msgstr "zapis metadanych do grup"
+
+#: libparted/fs/ext2/ext2_mkfs.c:565
+msgid "File system too small for ext2."
+msgstr "System plikw jest zbyt may dla ext2."
+
+#: libparted/fs/fat/calc.c:134
+#, c-format
+msgid ""
+"You need %s of free disk space to shrink this partition to this size. "
+"Currently, only %s is free."
+msgstr ""
+"Potrzebujesz %s wolnej przestrzeni, aby zmniejszy partycj do tego "
+"rozmiaru. Aktualnie, tylko %s jest wolne."
+
+#: libparted/fs/fat/context.c:55
+#, c-format
+msgid ""
+"Cluster start delta = %d, which is not a multiple of the cluster size %d."
+msgstr ""
+"Pocztek klastra delta = %d, a wic nie jest to wielokrotno rozmiaru "
+"klastra %d."
+
+#: libparted/fs/fat/fat.c:312
+#, c-format
+msgid "Partition too big/small for a %s file system."
+msgstr "Partycja jest zbyt dua/maa dla systemu plikw %s."
+
+#: libparted/fs/fat/fat.c:478
+msgid ""
+"The FATs don't match. If you don't know what this means, then select "
+"cancel, run scandisk on the file system, and then come back."
+msgstr ""
+"Tablice FAT nie pasuj. Jeli nie wiesz co to znaczy, to wybierz "
+"'Poniechaj', uruchom scandisk, a potem ponw prb."
+
+#: libparted/fs/fat/fat.c:518
+msgid "There are no possible configurations for this FAT type."
+msgstr "Nie ma moliwych konfiguracji dla tego typu FAT."
+
+#: libparted/fs/fat/fat.c:530
+#, c-format
+msgid ""
+"File system doesn't have expected sizes for Windows to like it. Cluster "
+"size is %dk (%dk expected); number of clusters is %d (%d expected); size of "
+"FATs is %d sectors (%d expected)."
+msgstr ""
+"System plikw nie posiada rozmiaru spodziewanego przez system MS Windows. "
+"Rozmiar klastra wynosi %dk (powinno by %dk); ilo klastrw wynosi %d "
+"(powinno by %d); rozmiar FAT wynosi %d sektorw (powinno by %d)."
+
+#: libparted/fs/fat/fat.c:553
+#, c-format
+msgid ""
+"File system is reporting the free space as %d clusters, not %d clusters."
+msgstr ""
+"System plikw mwi, e wolna przestrze wynosi %d klastrw, a nie %d "
+"klastrw."
+
+#: libparted/fs/fat/fat.c:878
+msgid ""
+"GNU Parted was miscompiled: the FAT boot sector should be 512 bytes. FAT "
+"support will be disabled."
+msgstr ""
+"Program GNU Parted zosta nieprawidowo zbudowany: sektor rozruchowy FAT "
+"powinien mie 512 bajtw. Wsparcie dla FAT zostaje wyczone."
+
+#: libparted/fs/fat/resize.c:158
+msgid ""
+"There's not enough room in the root directory for all of the files. Either "
+"cancel, or ignore to lose the files."
+msgstr ""
+"Brakuje miejsca w katalogu root dla wszystkich tych plikw. Poniechaj "
+"operacj lub zignoruj, aby utraci pliki."
+
+#: libparted/fs/fat/resize.c:299
+msgid "Error writing to the root directory."
+msgstr "Bd podczas zapisu do katalogu gwnego (root)."
+
+#: libparted/fs/fat/resize.c:484
+msgid "If you leave your file system as FAT16, then you will have no problems."
+msgstr ""
+"Jeli pozostawisz swj system plikw jako FAT16, to nie bdziesz mia(a) "
+"adnych problemw."
+
+#: libparted/fs/fat/resize.c:487
+msgid ""
+"If you convert to FAT16, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual)."
+msgstr ""
+"Jeeli dokonasz konwersji do FAT16 i system MS Windows jest zainstalowany na "
+"tej partycji, to wtedy musisz przeinstalowa program adujcy (boot loader) "
+"MS Windows. Jeli chcesz to zrobi, to prosz przeczytaj dokumentacj "
+"programu Parted (lub dokumentacj Twojej dystrybucji systemu)."
+
+#: libparted/fs/fat/resize.c:495
+msgid ""
+"If you leave your file system as FAT32, then you will not introduce any new "
+"problems."
+msgstr ""
+"Jeli pozostawisz swj system plikw jako FAT32, to wtedy nie bdziesz mia"
+"(a) adnych nowych problemw."
+
+#: libparted/fs/fat/resize.c:499
+msgid ""
+"If you convert to FAT32, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual). Also, "
+"converting to FAT32 will make the file system unreadable by MS DOS, MS "
+"Windows 95a, and MS Windows NT."
+msgstr ""
+"Jeeli dokonasz konwersji do FAT32 i system MS Windows jest zainstalowany na "
+"tej partycji, to wtedy musisz przeinstalowa program adujcy (boot loader) "
+"MS Windows. Jeli chcesz to zrobi, to prosz przeczytaj dokumentacj "
+"programu Parted (lub dokumentacj Twojej dystrybucji systemu). Ponadto, "
+"konwersja do FAT32 spowoduje, e taki system plikw bdzie niemoliwy do "
+"odczytania przez systemy MS-DOS, MS Windows 95a oraz MS Windows NT."
+
+#: libparted/fs/fat/resize.c:513
+#, c-format
+msgid "%s %s %s"
+msgstr "%s %s %s"
+
+#: libparted/fs/fat/resize.c:514
+msgid "Would you like to use FAT32?"
+msgstr "Czy chcesz uy FAT32?"
+
+#: libparted/fs/fat/resize.c:541 libparted/fs/fat/resize.c:557
+#, c-format
+msgid "%s %s"
+msgstr "%s %s"
+
+#: libparted/fs/fat/resize.c:542
+msgid ""
+"The file system can only be resized to this size by converting to FAT16."
+msgstr ""
+"Rozmiar systemu plikw moe by tylko zmieniony poprzez konwersj do FAT16."
+
+#: libparted/fs/fat/resize.c:558
+msgid ""
+"The file system can only be resized to this size by converting to FAT32."
+msgstr ""
+"System plikw moe mie zmieniony rozmiar, ale tylko poprzez konwersj do "
+"FAT32."
+
+#: libparted/fs/fat/resize.c:571
+msgid ""
+"GNU Parted cannot resize this partition to this size. We're working on it!"
+msgstr ""
+"GNU Parted nie moe zmieni rozmiaru tej partycji do podanego. Pracujemy "
+"nad tym!"
+
+#: libparted/fs/fat/bootsector.c:48 libparted/fs/fat/bootsector.c:55
+msgid "File system has an invalid signature for a FAT file system."
+msgstr "System plikw posiada nieprawidowy podpis dla systemu plikw FAT."
+
+#: libparted/fs/fat/bootsector.c:62
+msgid "File system has an invalid sector size for a FAT file system."
+msgstr ""
+"System plikw posiada nieprawidowy rozmiar sektora dla systemu plikw FAT."
+
+#: libparted/fs/fat/bootsector.c:69
+msgid "File system has an invalid cluster size for a FAT file system."
+msgstr ""
+"System plikw posiada nieprawidowy rozmiar klastra dla systemu plikw FAT."
+
+#: libparted/fs/fat/bootsector.c:76
+msgid ""
+"File system has an invalid number of reserved sectors for a FAT file system."
+msgstr ""
+"System plikw posiada nieprawidow ilo zarezerwowanych sektorw dla "
+"systemu plikw FAT."
+
+#: libparted/fs/fat/bootsector.c:83
+msgid "File system has an invalid number of FATs."
+msgstr "System plikw posiada nieprawidow ilo FATw."
+
+#: libparted/fs/fat/bootsector.c:138
+#, c-format
+msgid ""
+"This file system has a logical sector size of %d. GNU Parted is known not "
+"to work properly with sector sizes other than 512 bytes."
+msgstr ""
+"Ten system plikw posiada rozmiar logicznego sektora %d. GNU Parted nie "
+"wsppracuje prawidowo z rozmiarami sektorw innymi ni 512 bajtw."
+
+#: libparted/fs/fat/bootsector.c:163
+#, c-format
+msgid ""
+"The file system's CHS geometry is (%d, %d, %d), which is invalid. The "
+"partition table's CHS geometry is (%d, %d, %d). If you select Ignore, the "
+"file system's CHS geometry will be left unchanged. If you select Fix, the "
+"file system's CHS geometry will be set to match the partition table's CHS "
+"geometry."
+msgstr ""
+"Geometri CHS systemu pliku jest (%d, %d, %d), ktra nie jest prawidowa. "
+"Geometri CHS tablicy partycji jest (%d, %d, %d). Jeli zignorujesz, to "
+"geometria CHS systemu pliku pozostanie niezmieniona. Jeli zdecydujesz si "
+"naprawi, geometria CHS systemu plikw zostanie dopasowana do geometrii CHS "
+"tablicy partycji."
+
+#: libparted/fs/fat/bootsector.c:209
+msgid "FAT boot sector says logical sector size is 0. This is weird. "
+msgstr ""
+"Sektor rozruchowy FAT mwi, e rozmiar sektora logicznego jest 0. Dziwne."
+
+#: libparted/fs/fat/bootsector.c:215
+msgid "FAT boot sector says there are no FAT tables. This is weird. "
+msgstr "Sektor rozruchowy FAT mwi, e nie ma adnych tablic FAT. Dziwne."
+
+#: libparted/fs/fat/bootsector.c:221
+msgid "FAT boot sector says clusters are 0 sectors. This is weird. "
+msgstr "Sektor rozruchowy FAT mwi, e klastry zajmuj 0 sektorw. Dziwne."
+
+#: libparted/fs/fat/bootsector.c:231
+msgid "File system is FAT12, which is unsupported."
+msgstr "Systemem plikw jest FAT12, ktry nie jest wspierany."
+
+#: libparted/fs/fat/bootsector.c:407
+#, c-format
+msgid ""
+"The information sector has the wrong signature (%x). Select cancel for now, "
+"and send in a bug report. If you're desperate, it's probably safe to ignore."
+msgstr ""
+"Sektor informacyjny posiada nieprawidowy podpis (%x). Na razie poniechaj "
+"aktualn operacj i wylij raport dotyczcy bdw. Ewentualnie zignoruj "
+"ca sytuacj."
+
+#: libparted/fs/fat/count.c:149
+#, c-format
+msgid "Bad directory entry for %s: first cluster is the end of file marker."
+msgstr ""
+"Nieprawidowy wpis w katalogu dla %s: pierwszy klaster jest znacznikiem "
+"koca pliku."
+
+#: libparted/fs/fat/count.c:162
+#, c-format
+msgid ""
+"Bad FAT: unterminated chain for %s. You should run dosfsck or scandisk."
+msgstr ""
+"Nieprawidowy FAT: niezakoczony acuch dla %s. Prosz uruchomi program "
+"dosfsck lub scandisk."
+
+#: libparted/fs/fat/count.c:171
+#, c-format
+msgid ""
+"Bad FAT: cluster %d outside file system in chain for %s. You should run "
+"dosfsck or scandisk."
+msgstr ""
+"Nieprawidowy FAT: klaster %d jest poza systemem plikw w acuchu dla %s. "
+"Prosz uruchomi program dosfsck lub scandisk."
+
+#: libparted/fs/fat/count.c:181
+#, c-format
+msgid ""
+"Bad FAT: cluster %d is cross-linked for %s. You should run dosfsck or "
+"scandisk."
+msgstr ""
+"Nieprawidowy FAT: klaster %d jest dowizany skronie dla %s. Prosz "
+"uruchomi program dosfsck lub scandisk."
+
+#: libparted/fs/fat/count.c:200
+#, c-format
+msgid "%s is %dk, but it has %d clusters (%dk)."
+msgstr "%s ma %dk, jednak ma %d klastrw (%dk)."
+
+#: libparted/fs/fat/count.c:263
+#, c-format
+msgid ""
+"The file %s is marked as a system file. This means moving it could cause "
+"some programs to stop working."
+msgstr ""
+"Plik %s jest oznaczony jako plik systemowy. Oznacza to, e jego "
+"przesunicie moe spowodowa nieprawidow prac innych programw."
+
+#: libparted/fs/fat/table.c:138
+#, c-format
+msgid ""
+"FAT %d media %x doesn't match the boot sector's media %x. You should "
+"probably run scandisk."
+msgstr ""
+"Typ nonika odczytany z FAT %d (%x) nie zgadza si z typem odczytanym z "
+"sektora rozruchowego (%x). Naley uruchomi scandisk."
+
+#: libparted/fs/fat/table.c:268
+#, c-format
+msgid "fat_table_set: cluster %ld outside file system"
+msgstr "fat_table_set: klaster %ld poza systemem plikw"
+
+#: libparted/fs/fat/table.c:296
+#, c-format
+msgid "fat_table_get: cluster %ld outside file system"
+msgstr "fat_table_get: klaster %ld poza systemem plikw"
+
+#: libparted/fs/fat/table.c:334
+msgid "fat_table_alloc_cluster: no free clusters"
+msgstr "fat_table_alloc_cluster: brak wolnych klastrw"
+
+#: libparted/fs/linux_swap/linux_swap.c:236
+#, c-format
+msgid "Unrecognised linux swap signature '%10s'."
+msgstr "Nierozpoznany podpis linuxowej partycji wymiany `%10s'."
+
+#: libparted/fs/linux_swap/linux_swap.c:312
+msgid "Too many bad pages."
+msgstr "Zbyt duo nieprawidowych stron."
+
+#: libparted/fs/hfs/advfs.c:123 libparted/fs/hfs/advfs_plus.c:125
+#: libparted/fs/hfs/reloc.c:416 libparted/fs/hfs/reloc.c:510
+#: libparted/fs/hfs/reloc_plus.c:541 libparted/fs/hfs/reloc_plus.c:660
+#: libparted/fs/hfs/reloc_plus.c:774
+msgid "The file system contains errors."
+msgstr "System plikw zawiera bdy."
+
+#: libparted/fs/hfs/advfs_plus.c:290
+msgid "Bad blocks could not be read."
+msgstr "Uszkodzone bloki nie mog by odczytane."
+
+#: libparted/fs/hfs/cache.c:139
+#, c-format
+msgid ""
+"Trying to register an extent starting at block 0x%X, but another one already "
+"exists at this position. You should check the file system!"
+msgstr ""
+"Podczas prby zarejestrowania obszaru z pocztkiem na bloku 0x%X wykryto "
+"inny obszar na tej pozycji. Naley sprawdzi system plikw!"
+
+#: libparted/fs/hfs/cache.c:216
+#, c-format
+msgid ""
+"Trying to move an extent from block Ox%X to block Ox%X, but another one "
+"already exists at this position. This should not happen!"
+msgstr ""
+"Podczas prby przeniesienia obszaru z bloku 0x%X do bloku 0x%X wykryto inny "
+"obszar na tej pozycji. To nie powinno si zdarzy!"
+
+#: libparted/fs/hfs/file.c:145
+#, fuzzy, c-format
+msgid "Could not update the extent cache for HFS file with CNID %X."
+msgstr "Nie mona uaktualni pamici obszarw pliku %s z CNID %X."
+
+#: libparted/fs/hfs/file.c:182
+#, fuzzy, c-format
+msgid "Trying to read HFS file with CNID %X behind EOF."
+msgstr "Prba odczytania pliku %s z CNID %X za EOF."
+
+#: libparted/fs/hfs/file.c:192 libparted/fs/hfs/file.c:222
+#, fuzzy, c-format
+msgid "Could not find sector %lli of HFS file with CNID %X."
+msgstr "Nie znaleziono sektora %lli pliku %s z CNID %X."
+
+#: libparted/fs/hfs/file.c:212
+#, fuzzy, c-format
+msgid "Trying to write HFS file with CNID %X behind EOF."
+msgstr "Zapisywanie pliku %s z CNID %X za EOF."
+
+#: libparted/fs/hfs/file_plus.c:159
+#, fuzzy, c-format
+msgid "Could not update the extent cache for HFS+ file with CNID %X."
+msgstr "Nie mona uaktualni pamici obszarw pliku %s z CNID %X."
+
+#: libparted/fs/hfs/file_plus.c:203
+#, fuzzy, c-format
+msgid "Trying to read HFS+ file with CNID %X behind EOF."
+msgstr "Prba odczytania pliku %s z CNID %X za EOF."
+
+#: libparted/fs/hfs/file_plus.c:214 libparted/fs/hfs/file_plus.c:256
+#, fuzzy, c-format
+msgid "Could not find sector %lli of HFS+ file with CNID %X."
+msgstr "Nie znaleziono sektora %lli pliku %s z CNID %X."
+
+#: libparted/fs/hfs/file_plus.c:245
+#, fuzzy, c-format
+msgid "Trying to write HFS+ file with CNID %X behind EOF."
+msgstr "Zapisywanie pliku %s z CNID %X za EOF."
+
+#: libparted/fs/hfs/hfs.c:225
+msgid "Sorry, HFS cannot be resized that way yet."
+msgstr "Przykro mi, ale nie mona w ten sposb zmieni rozmiaru HFS."
+
+#: libparted/fs/hfs/hfs.c:255 libparted/fs/hfs/hfs.c:636
+msgid "Data relocation has failed."
+msgstr "Relokacja danych nie powioda si."
+
+#: libparted/fs/hfs/hfs.c:274
+msgid "Data relocation left some data in the end of the volume."
+msgstr "Relokacja danych pozostawia dane pod koniec wolumenu."
+
+#: libparted/fs/hfs/hfs.c:313
+msgid "writing HFS Master Directory Block"
+msgstr "zapisywanie gwnego bloku katalogu HFS (HFS Master Directory Block)"
+
+#: libparted/fs/hfs/hfs.c:461
+msgid "No valid HFS[+X] signature has been found while opening."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:471
+#, c-format
+msgid "Version %d of HFS+ isn't supported."
+msgstr "Wersja %d HFS+ nie jest wspierana."
+
+#: libparted/fs/hfs/hfs.c:482
+#, fuzzy, c-format
+msgid "Version %d of HFSX isn't supported."
+msgstr "Wersja %d HFS+ nie jest wspierana."
+
+#: libparted/fs/hfs/hfs.c:667
+msgid "Data relocation left some data at the end of the volume."
+msgstr "Relokacja danych pozostawia dane na kocu wolumenu."
+
+#: libparted/fs/hfs/hfs.c:715
+msgid "Error while writing the allocation file."
+msgstr "Bd podczas zapisu pliku przydziau."
+
+#: libparted/fs/hfs/hfs.c:730
+msgid "Error while writing the compatibility part of the allocation file."
+msgstr "Bd podczas zapisu kompatybilnej czci pliku przydziau."
+
+#: libparted/fs/hfs/hfs.c:745
+msgid "writing HFS+ Volume Header"
+msgstr "zapisywanie nagwka wolumenu HFS+"
+
+#: libparted/fs/hfs/hfs.c:845
+msgid "An error occurred while looking for the mandatory bad blocks file."
+msgstr ""
+"Wystpi bd podczas szukania obowizkowego pliku uszkodzonych blokw."
+
+#: libparted/fs/hfs/hfs.c:899
+msgid ""
+"It seems there is an error in the HFS wrapper: the bad blocks file doesn't "
+"contain the embedded HFS+ volume."
+msgstr ""
+"Prawdopodobnie wystpuje bd w otoczce HFS: plik uszkodzonych blokw nie "
+"zawiera wbudowanego wolumenu HFS+."
+
+#: libparted/fs/hfs/hfs.c:930
+#, fuzzy
+msgid "Sorry, HFS+ cannot be resized that way yet."
+msgstr "Przykro mi, ale nie mona w ten sposb zmieni rozmiaru HFS."
+
+#: libparted/fs/hfs/hfs.c:965
+msgid "shrinking embedded HFS+ volume"
+msgstr "zmniejszanie wbudowanego wolumenu HFS+"
+
+#: libparted/fs/hfs/hfs.c:981
+msgid "Resizing the HFS+ volume has failed."
+msgstr "Zmiana rozmiaru wolumenu HFS+ nie powioda si."
+
+#: libparted/fs/hfs/hfs.c:988
+msgid "shrinking HFS wrapper"
+msgstr "zmniejszanie otoczki HFS"
+
+#: libparted/fs/hfs/hfs.c:997
+msgid "Updating the HFS wrapper has failed."
+msgstr "Aktualizacja otoczki HFS nie powioda si."
+
+#: libparted/fs/hfs/hfs.c:1099 libparted/fs/hfs/hfs.c:1184
+#, c-format
+msgid ""
+"This is not a real %s check. This is going to extract special low level "
+"files for debugging purposes."
+msgstr ""
+"To nie jest prawdziwe sprawdzanie %s. Celem jest wydobycie specjalnych "
+"niskopoziomowych plikw w celu odpluskwiania."
+
+#: libparted/fs/hfs/journal.c:156
+msgid "Bad block list header checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:169
+#, c-format
+msgid ""
+"Invalid size of a transaction block while replaying the journal (%i bytes)."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:261
+#, fuzzy
+msgid ""
+"Journal stored outside of the volume are not supported. Try to desactivate "
+"the journal and run Parted again."
+msgstr ""
+"Wolumeny HFS+ z kronikowaniem nie s wspierane, naley deaktywowa kronik "
+"przed prb jej modyfikacji."
+
+#: libparted/fs/hfs/journal.c:272
+#, fuzzy
+msgid "Journal offset or size is not multiple of the sector size."
+msgstr ""
+"Pocztek klastra delta = %d, a wic nie jest to wielokrotno rozmiaru "
+"klastra %d."
+
+#: libparted/fs/hfs/journal.c:290
+msgid "Incorrect magic values in the journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:299
+msgid "Journal size mismatch between journal info block and journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:311
+#, fuzzy
+msgid "Some header fields are not multiple of the sector size."
+msgstr ""
+"Pocztek klastra delta = %d, a wic nie jest to wielokrotno rozmiaru "
+"klastra %d."
+
+#: libparted/fs/hfs/journal.c:320
+msgid ""
+"The sector size stored in the journal is not 512 bytes. Parted only "
+"supports 512 bytes length sectors."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:332
+msgid "Bad journal checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:350
+msgid ""
+"The journal is not empty. Parted must replay the transactions before "
+"opening the file system. This will modify the file system."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:378
+msgid ""
+"The volume header or the master directory block has changed while replaying "
+"the journal. You should restart Parted."
+msgstr ""
+
+#: libparted/fs/hfs/probe.c:52
+#, c-format
+msgid ""
+"Parted can't use HFS file systems on disks with a sector size not equal to %"
+"d bytes."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:153 libparted/fs/hfs/reloc_plus.c:157
+msgid "An extent has not been relocated."
+msgstr "Obszar nie zosta przeniesiony."
+
+#: libparted/fs/hfs/reloc.c:253 libparted/fs/hfs/reloc_plus.c:309
+msgid ""
+"A reference to an extent comes from a place it should not. You should check "
+"the file system!"
+msgstr ""
+"Odwoanie do obszaru nie powinno byo wystpi w tym miejscu. Naley "
+"sprawdzi system plikw!"
+
+#: libparted/fs/hfs/reloc.c:383
+msgid "This HFS volume has no catalog file. This is very unusual!"
+msgstr ""
+"Ten wolumen HFS nie posiada pliku katalogowego. To jest bardzo niezwyke!"
+
+#: libparted/fs/hfs/reloc.c:477
+#, fuzzy
+msgid "This HFS volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+"Ten tom HFS+ nie zawiera pliku przepenienia obszarw. To raczej niezwykle!"
+
+#: libparted/fs/hfs/reloc.c:519 libparted/fs/hfs/reloc_plus.c:670
+msgid ""
+"The extents overflow file should not contain its own extents! You should "
+"check the file system."
+msgstr ""
+"Plik przepenienia obszarw nie powinien zawiera wasnych obszarw! Naley "
+"sprawdzi system plikw."
+
+#: libparted/fs/hfs/reloc.c:576 libparted/fs/hfs/reloc_plus.c:849
+msgid "Could not cache the file system in memory."
+msgstr "Nie mona zapamita systemu plikw w pamici."
+
+#: libparted/fs/hfs/reloc.c:637 libparted/fs/hfs/reloc_plus.c:910
+msgid "Bad blocks list could not be loaded."
+msgstr "Nie powiodo si zaadowanie listy uszkodzonych blokw."
+
+#: libparted/fs/hfs/reloc.c:651 libparted/fs/hfs/reloc_plus.c:926
+msgid "An error occurred during extent relocation."
+msgstr "Wykryto bd podczas przenoszenia obszaru."
+
+#: libparted/fs/hfs/reloc_plus.c:497
+msgid "This HFS+ volume has no catalog file. This is very unusual!"
+msgstr ""
+"Ten wolumen HFS+ nie posiada pliku katalogowego. To jest bardzo niezwyke!"
+
+#: libparted/fs/hfs/reloc_plus.c:621
+msgid "This HFS+ volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+"Ten tom HFS+ nie zawiera pliku przepenienia obszarw. To raczej niezwykle!"
+
+#: parted/parted.c:76
+msgid "displays this help message"
+msgstr "wywietla t oto pomoc"
+
+#: parted/parted.c:77
+msgid "where necessary, prompts for user intervention"
+msgstr "gdy jest potrzeba, prosi o interwencj uytkownika"
+
+#: parted/parted.c:78
+msgid "never prompts for user intervention"
+msgstr "nigdy nie prosi uytkownika o interwencj"
+
+#: parted/parted.c:79
+msgid "displays the version"
+msgstr "wywietla numer wersji"
+
+#: parted/parted.c:87
+#, fuzzy
+msgid ""
+"NUMBER is the partition number used by Linux. On MS-DOS disk labels, the "
+"primary partitions number from 1 to 4, logical partitions from 5 onwards.\n"
+msgstr ""
+"NUMER oznacza numer partycji uywanej przez Linuxa. Dla etykiet dyskw "
+"msdos liczba partycji gwnych mieci si w przedziale 1-4, za partycje "
+"logiczne zajmuj kolejne numery poczwszy od 5.\n"
+
+#: parted/parted.c:90
+msgid "LABEL-TYPE is one of: "
+msgstr "TYP-ETYKIETY stanowi jedn z nastpujcych wartoci: "
+
+#: parted/parted.c:91
+msgid "FLAG is one of: "
+msgstr "FLAGA stanowi jedn z nastpujcych wartoci: "
+
+#: parted/parted.c:92
+msgid "UNIT is one of: "
+msgstr "JEDNOSTKA stanowi jedn z nastpujcych wartoci: "
+
+#: parted/parted.c:93
+msgid "PART-TYPE is one of: primary, logical, extended\n"
+msgstr ""
+"TYP-PARTYCJI stanowi jedn z nastpujcych wartoci: gwna, logiczna, "
+"rozszerzona\n"
+
+#: parted/parted.c:95
+msgid "FS-TYPE is one of: "
+msgstr "SYSTEM-PLIKW stanowi jedn z nastpujcych wartoci: "
+
+#: parted/parted.c:96
+#, fuzzy
+msgid ""
+"START and END are disk locations, such as 4GB or 10%. Negative values count "
+"from the end of the disk. For example, -1s specifies exactly the last "
+"sector.\n"
+msgstr ""
+"POCZTEK i KONIEC oznaczaj lokacje na dysku, np. 4GB lub 10%. Prefix = "
+"oznacza dokadn lokacj. Ujemne wartoci s liczone od koca dysku. Na "
+"przykad, =-1s oznacza dokadnie ostatni sektor.\n"
+
+#: parted/parted.c:99
+msgid "STATE is one of: on, off\n"
+msgstr "STAN jest reprezentowany poprzez: wczony, wyczony\n"
+
+#: parted/parted.c:100
+msgid "DEVICE is usually /dev/hda or /dev/sda\n"
+msgstr "URZDZENIEM jest zwykle /dev/hda lub /dev/sda\n"
+
+#: parted/parted.c:101
+msgid "NAME is any word you want\n"
+msgstr "NAZWA jest dowolnym sowem jakie chcesz\n"
+
+#: parted/parted.c:102
+msgid "The partition must have one of the following FS-TYPEs: "
+msgstr "Partycja musi posiada jeden z nastpujcych systemw plikw: "
+
+#: parted/parted.c:105
+msgid "GNU Parted Version information:\n"
+msgstr ""
+
+#: parted/parted.c:107
+#, fuzzy
+msgid ""
+"Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n"
+"This program is free software, covered by the GNU General Public License.\n"
+"\n"
+"This program is distributed in the hope that it will be useful, but WITHOUT "
+"ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
+"FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
+"more details.\n"
+"\n"
+msgstr ""
+"Copyright (C) 1998 - 2005 Free Software Foundation, Inc.\n"
+"Program ten jest wolno dostpny, zgodnie z Powszechn Licencj Publiczn "
+"GNU.\n"
+"\n"
+"Program ten udostpniany jest w nadziei, e bdzie przydatny, ale BEZ ADNEJ "
+"GWARANCJI, nawet bez domylnej gwarancji PRZYDATNOCI HANDLOWEJ albo "
+"PRZYDATNOCI DO KONKRETNYCH ZASTOSOWA. Wicej szczegw znajduje si w "
+"Powszechnej Licencji Publicznej GNU.\n"
+"\n"
+
+#: parted/parted.c:152
+#, c-format
+msgid "%0.f%%\t(time left %.2d:%.2d)"
+msgstr "%0.f%%\t(czas do koca %.2d:%.2d)"
+
+#: parted/parted.c:170
+#, c-format
+msgid ""
+"Partition %s is being used. You must unmount it before you modify it with "
+"Parted."
+msgstr "Partycja %s jest uywana. Naley j odczy przed jej modyfikacj."
+
+#: parted/parted.c:187
+#, c-format
+msgid "Partition(s) on %s are being used."
+msgstr "Partycja (partycje) na %s s uywane."
+
+#: parted/parted.c:413 parted/parted.c:594 parted/parted.c:979
+#: parted/parted.c:1059 parted/parted.c:1586 parted/parted.c:1663
+#: parted/parted.c:1707
+msgid "Partition number?"
+msgstr "Numer partycji?"
+
+#: parted/parted.c:456
+msgid "Source device?"
+msgstr "Urzdzenie rdowe?"
+
+#: parted/parted.c:460
+msgid "Source partition number?"
+msgstr "Numer partycji rdowej?"
+
+#: parted/parted.c:465
+msgid "Can't copy an extended partition."
+msgstr "Nie mona skopiowa rozszerzonej partycji."
+
+#: parted/parted.c:471
+msgid "Destination partition number?"
+msgstr "Numer partycji docelowej?"
+
+#: parted/parted.c:564
+msgid "New disk label type?"
+msgstr "Nowy typ etykiety dysku?"
+
+#: parted/parted.c:598
+msgid "File system?"
+msgstr "System plikw?"
+
+#: parted/parted.c:645 parted/parted.c:815
+msgid "Partition type?"
+msgstr "Typ partycji?"
+
+#: parted/parted.c:652 parted/parted.c:822 parted/parted.c:1062
+msgid "Partition name?"
+msgstr "Nazwa partycji?"
+
+#: parted/parted.c:660 parted/parted.c:832
+msgid "File system type?"
+msgstr "Typ systemu plikw?"
+
+#: parted/parted.c:667 parted/parted.c:834 parted/parted.c:994
+#: parted/parted.c:1544 parted/parted.c:1595
+msgid "Start?"
+msgstr "Pocztek?"
+
+#: parted/parted.c:669 parted/parted.c:837 parted/parted.c:997
+#: parted/parted.c:1546 parted/parted.c:1597
+msgid "End?"
+msgstr "Koniec?"
+
+#: parted/parted.c:707 parted/parted.c:875
+#, fuzzy, c-format
+msgid ""
+"You requested a partition from %s to %s.\n"
+"The closest location we can manage is %s to %s. Is this still acceptable to "
+"you?"
+msgstr ""
+"Rozkazano przesunicie partycji do %s - %s. Najblisza z jak Parted moe "
+"sobie poradzi jest %s - %s."
+
+#: parted/parted.c:827
+msgid "An extended partition cannot hold a file system. Did you want mkpart?"
+msgstr ""
+"Rozszerzona partycja nie moe trzyma systemu plikw. Czy chodzio Ci o "
+"mkpart?"
+
+#: parted/parted.c:985
+msgid "Can't move an extended partition."
+msgstr "Nie mona przesun rozszerzonej partycji."
+
+#: parted/parted.c:1014
+msgid "Can't move a partition onto itself. Try using resize, perhaps?"
+msgstr ""
+"Nie mona przesun partycji na sam siebie. Moe sprbuj zmieni jej "
+"rozmiar?"
+
+#: parted/parted.c:1158
+#, c-format
+msgid "Minor: %d\n"
+msgstr "Numer: %d\n"
+
+#: parted/parted.c:1159
+#, fuzzy, c-format
+msgid "Flags: %s\n"
+msgstr "Flagi: "
+
+#: parted/parted.c:1160
+#, c-format
+msgid "File System: %s\n"
+msgstr "System plikw: %s\n"
+
+#: parted/parted.c:1161
+#, c-format
+msgid "Size: "
+msgstr "Rozmiar: "
+
+#: parted/parted.c:1166
+#, c-format
+msgid "Minimum size: "
+msgstr "Minimalny rozmiar: "
+
+#: parted/parted.c:1169
+#, c-format
+msgid "Maximum size: "
+msgstr "Maksymalny rozmiar: "
+
+#: parted/parted.c:1255
+#, fuzzy, c-format
+msgid "Disk %s: %s\n"
+msgstr "%s %s %s"
+
+#: parted/parted.c:1256
+#, c-format
+msgid "Sector size (logical/physical): %lldB/%lldB\n"
+msgstr ""
+
+#: parted/parted.c:1267
+#, c-format
+msgid "BIOS cylinder,head,sector geometry: %d,%d,%d. Each cylinder is %s.\n"
+msgstr ""
+"Geometria BIOS cylinder,gowica,sektor: %d,%d,%d. Kady cylinder ma %s.\n"
+
+#: parted/parted.c:1273
+#, fuzzy, c-format
+msgid "Partition Table: %s\n"
+msgstr "Nazwa partycji?"
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Number"
+msgstr "Numer"
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Start"
+msgstr "Pocztek"
+
+#: parted/parted.c:1285 parted/parted.c:1288
+msgid "End"
+msgstr "Koniec"
+
+#: parted/parted.c:1288
+msgid "Size"
+msgstr "Rozmiar"
+
+#: parted/parted.c:1292
+msgid "Type"
+msgstr "Typ"
+
+#: parted/parted.c:1294
+msgid "File system"
+msgstr "System plikw"
+
+#: parted/parted.c:1297
+msgid "Name"
+msgstr "Nazwa"
+
+#: parted/parted.c:1299
+msgid "Flags"
+msgstr "Flaga"
+
+#: parted/parted.c:1352
+msgid "Free Space"
+msgstr ""
+
+#: parted/parted.c:1441
+#, c-format
+msgid ""
+"A %s %s partition was found at %s -> %s. Do you want to add it to the "
+"partition table?"
+msgstr ""
+"Partycja %s %s zostaa znaleziona na %s -> %s. Czy chcesz j doda do "
+"tablicy partycji?"
+
+#: parted/parted.c:1479
+msgid "searching for file systems"
+msgstr "szukam systemw plikw"
+
+#: parted/parted.c:1684
+msgid "New device?"
+msgstr "Nowe urzdzenie?"
+
+#: parted/parted.c:1709
+#, fuzzy
+msgid "Flag to Invert?"
+msgstr "Flaga do zmienienia?"
+
+#: parted/parted.c:1714
+msgid "New state?"
+msgstr "Nowy stan?"
+
+#: parted/parted.c:1747
+msgid "Unit?"
+msgstr "Jednostka?"
+
+#: parted/parted.c:1896
+msgid "check"
+msgstr "sprawd"
+
+#: parted/parted.c:1899
+#, fuzzy
+msgid ""
+"check NUMBER do a simple check on the file system"
+msgstr ""
+"check NUMER wykonuje proste sprawdzenie systemu plikw"
+
+#: parted/parted.c:1905
+msgid "cp"
+msgstr "kopiuj"
+
+#: parted/parted.c:1908
+msgid ""
+"cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another "
+"partition"
+msgstr ""
+"cp [URZDZENIE-RDOWE] NUMER-RDOWY NUMER-DOCELOWY kopiuje system "
+"plikw na inn partycj"
+
+#: parted/parted.c:1914
+msgid "help"
+msgstr "pomoc"
+
+#: parted/parted.c:1917
+#, fuzzy
+msgid ""
+"help [COMMAND] prints general help, or help on "
+"COMMAND"
+msgstr "pomoc [KOMENDA] wywietla pomoc"
+
+#: parted/parted.c:1923
+msgid "mklabel"
+msgstr "mklabel"
+
+#: parted/parted.c:1926
+#, fuzzy
+msgid ""
+"mklabel LABEL-TYPE create a new disklabel (partition "
+"table)"
+msgstr ""
+"mklabel TYP-ETYKIETY tworzy now etykiet dysku (tablic partycji)"
+
+#: parted/parted.c:1932
+msgid "mkfs"
+msgstr "mkfs"
+
+#: parted/parted.c:1935
+#, fuzzy
+msgid ""
+"mkfs NUMBER FS-TYPE make a FS-TYPE file system on "
+"partititon NUMBER"
+msgstr "mkfs NUMER SYSTEM-PLIKW tworzy system plikw na partycji NUMER"
+
+#: parted/parted.c:1941
+msgid "mkpart"
+msgstr "mkpart"
+
+#: parted/parted.c:1944
+msgid "mkpart PART-TYPE [FS-TYPE] START END make a partition"
+msgstr "mkpart TYP-PARTYCJI [SYSTEM-PLIKW] POCZTEK KONIEC tworzy partycj"
+
+#: parted/parted.c:1950
+msgid ""
+"mkpart makes a partition without creating a new file system on the "
+"partition. FS-TYPE may be specified to set an appropriate partition ID.\n"
+msgstr ""
+"Komenda mkpart tworzy partycj bez tworzenia nowego systemu plikw na tej "
+"partycji. Opcjonalny SYSTEM-PLIKW moe zosta podany do okrelenia "
+"waciwego identyfikatora partycji.\n"
+
+#: parted/parted.c:1955
+msgid "mkpartfs"
+msgstr "mkpartfs"
+
+#: parted/parted.c:1958
+msgid ""
+"mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system"
+msgstr ""
+"mkpartfs TYP-PARTYCJI SYSTEM-PLIKW POCZTEK KONIEC tworzy partycj z "
+"systemem plikw"
+
+#: parted/parted.c:1964
+msgid "move"
+msgstr "przesu"
+
+#: parted/parted.c:1967
+#, fuzzy
+msgid "move NUMBER START END move partition NUMBER"
+msgstr "move NUMER POCZTEK KONIEC przesuwa partycj NUMER"
+
+#: parted/parted.c:1972
+msgid "name"
+msgstr "nazwa"
+
+#: parted/parted.c:1975
+#, fuzzy
+msgid "name NUMBER NAME name partition NUMBER as NAME"
+msgstr "name NUMER NAZWA nadaje NAZW partycji NUMER"
+
+#: parted/parted.c:1980
+msgid "print"
+msgstr "drukuj"
+
+#: parted/parted.c:1983
+#, fuzzy
+msgid ""
+"print [free|NUMBER|all] display the partition table, a "
+"partition, or all devices"
+msgstr ""
+"print [NUMER] wywietla tablic partycji lub ca partycj"
+
+#: parted/parted.c:1987
+#, fuzzy
+msgid ""
+"Without arguments, print displays the entire partition table. With 'free'\n"
+"argument, information about free space will be displayed otherwise if a\n"
+"partition number is given, then more detailed information is displayed\n"
+"about that partition. If the 'all' argument is passed instead, partition\n"
+"information for all devices will be displayed."
+msgstr ""
+"Bez podania argumentw, komenda print wywietla ca tablic partycji.\n"
+"Jeli podano NUMER partycji, to wtedy wywietlone zostan bardziej\n"
+"szczegowe informacje odnonie partycji NUMER.\n"
+
+#: parted/parted.c:1995
+msgid "quit"
+msgstr "koniec"
+
+#: parted/parted.c:1998
+#, fuzzy
+msgid "quit exit program"
+msgstr "quit koczy prac programu"
+
+#: parted/parted.c:2003
+msgid "rescue"
+msgstr "uratuj"
+
+#: parted/parted.c:2006
+#, fuzzy
+msgid ""
+"rescue START END rescue a lost partition near START "
+"and END"
+msgstr ""
+"rescue POCZTEK KONIEC odzyskuje utracon partycj blisko POCZTKU i "
+"KOCA"
+
+#: parted/parted.c:2012
+msgid "resize"
+msgstr "rozmiar"
+
+#: parted/parted.c:2015
+#, fuzzy
+msgid ""
+"resize NUMBER START END resize partition NUMBER and its "
+"file system"
+msgstr ""
+"resize NUMER POCZTEK KONIEC zmienia rozmiar systemu plikw i partycji NUMER"
+
+#: parted/parted.c:2023
+msgid "rm"
+msgstr "usu"
+
+#: parted/parted.c:2026
+#, fuzzy
+msgid "rm NUMBER delete partition NUMBER"
+msgstr "rm NUMER usuwa partycj NUMER"
+
+#: parted/parted.c:2031
+msgid "select"
+msgstr "wybierz"
+
+#: parted/parted.c:2034
+#, fuzzy
+msgid "select DEVICE choose the device to edit"
+msgstr "select URZDZENIE wybiera urzdzenie do edycji"
+
+#: parted/parted.c:2039
+msgid "set"
+msgstr "ustaw"
+
+#: parted/parted.c:2042
+#, fuzzy
+msgid ""
+"set NUMBER FLAG STATE change the FLAG on partition NUMBER"
+msgstr "rm NUMER usuwa partycj NUMER"
+
+#: parted/parted.c:2048
+msgid "toggle"
+msgstr ""
+
+#: parted/parted.c:2051
+#, fuzzy
+msgid ""
+"toggle [NUMBER [FLAG]] toggle the state of FLAG on "
+"partition NUMBER"
+msgstr "rm NUMER usuwa partycj NUMER"
+
+#: parted/parted.c:2057
+msgid "unit"
+msgstr "jednostka"
+
+#: parted/parted.c:2060
+#, fuzzy
+msgid "unit UNIT set the default unit to UNIT"
+msgstr "unit JEDNOSTKA ustawia domyln jednostk"
+
+#: parted/parted.c:2065
+msgid "version"
+msgstr ""
+
+#: parted/parted.c:2068
+msgid ""
+"version displays the current version of GNU "
+"Parted and copyright information"
+msgstr ""
+
+#: parted/parted.c:2072
+msgid ""
+"version displays copyright and version information corressponding to this "
+"copy of GNU Parted\n"
+msgstr ""
+
+#: parted/parted.c:2158
+msgid "No device found"
+msgstr "Nie znaleziono urzdzenia"
+
+#: parted/parted.c:2222
+msgid "Don't forget to update /etc/fstab, if necessary.\n"
+msgstr ""
+"Nie zapomnij o aktualizacji /etc/fstab, jeli istnieje taka potrzeba.\n"
+
+#: parted/ui.c:68
+msgid "Welcome to GNU Parted! Type 'help' to view a list of commands.\n"
+msgstr ""
+
+#: parted/ui.c:71
+#, fuzzy
+msgid ""
+"Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]\n"
+"Apply COMMANDs with PARAMETERS to DEVICE. If no COMMAND(s) are given, run "
+"in\n"
+"interactive mode.\n"
+msgstr ""
+"Uycie: parted [OPCJE]... [URZDZENIE [KOMENDA [PARAMETRY]...]...]\n"
+"Zastosuj KOMENDY z PARAMETRAMI dla URZDZENIA. Jeli nie podano KOMEND(Y),\n"
+"program zostanie uruchomiony w trybie interaktywnym.\n"
+
+#: parted/ui.c:76
+#, c-format
+msgid ""
+"\n"
+"\n"
+"You found a bug in GNU Parted! Here's what you have to do:\n"
+"\n"
+"Don't panic! The bug has most likely not affected any of your data.\n"
+"Help us to fix this bug by doing the following:\n"
+"\n"
+"Check whether the bug has already been fixed by checking\n"
+"the last version of GNU Parted that you can find at:\n"
+"\n"
+"\thttp://ftp.gnu.org/gnu/parted/\n"
+"\n"
+"Please check this version prior to bug reporting.\n"
+"\n"
+"If this has not been fixed yet or if you don't know how to check,\n"
+"please visit the GNU Parted website:\n"
+"\n"
+"\thttp://www.gnu.org/software/parted\n"
+"\n"
+"for further information.\n"
+"\n"
+"Your report should contain the version of this release (%s)\n"
+"along with the error message below, the output of\n"
+"\n"
+"\tparted DEVICE unit co print unit s print\n"
+"\n"
+"and additional information about your setup you consider important.\n"
+msgstr ""
+
+#: parted/ui.c:230
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_MAPERR (Address not mapped to object)"
+msgstr ""
+
+#: parted/ui.c:235
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_ACCERR (Invalid permissions for mapped object)"
+msgstr ""
+
+#: parted/ui.c:240
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGSEGV signal was encountered."
+msgstr ""
+
+#: parted/ui.c:258
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTDIV (Integer: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:262
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTOVF (Integer: overflow)"
+msgstr ""
+
+#: parted/ui.c:266
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTDIV (Float: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:270
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTOVF (Float: overflow)"
+msgstr ""
+
+#: parted/ui.c:274
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTUND (Float: underflow)"
+msgstr ""
+
+#: parted/ui.c:278
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTRES (Float: inexact result)"
+msgstr ""
+
+#: parted/ui.c:282
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTINV (Float: invalid operation)"
+msgstr ""
+
+#: parted/ui.c:286
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTSUB (Float: subscript out of range)"
+msgstr ""
+
+#: parted/ui.c:291
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGFPE signal was encountered."
+msgstr ""
+
+#: parted/ui.c:310
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPC (Illegal Opcode)"
+msgstr ""
+
+#: parted/ui.c:314
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPN (Illegal Operand)"
+msgstr ""
+
+#: parted/ui.c:318
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLADR (Illegal addressing mode)"
+msgstr ""
+
+#: parted/ui.c:323
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLTRP (Illegal Trap)"
+msgstr ""
+
+#: parted/ui.c:327
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVOPC (Privileged Opcode)"
+msgstr ""
+
+#: parted/ui.c:331
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVREG (Privileged Register)"
+msgstr ""
+
+#: parted/ui.c:335
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_COPROC (Coprocessor Error)"
+msgstr ""
+
+#: parted/ui.c:339
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_BADSTK (Internal Stack Error)"
+msgstr ""
+
+#: parted/ui.c:343
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGILL signal was encountered."
+msgstr ""
+
+#: parted/ui.c:828
+msgid "Expecting a partition number."
+msgstr "Oczekiwany by numer partycji."
+
+#: parted/ui.c:837
+msgid "Partition doesn't exist."
+msgstr "Partycja nie istnieje."
+
+#: parted/ui.c:857
+msgid "Expecting a file system type."
+msgstr "Oczekiwany by typ systemu plikw."
+
+#: parted/ui.c:863
+#, c-format
+msgid "Unknown file system type \"%s\"."
+msgstr "Nieznany typ systemu plikw \"%s\"."
+
+#: parted/ui.c:883
+msgid "Expecting a disk label type."
+msgstr "Oczekiwany by typ etykiety dysku."
+
+#: parted/ui.c:977
+msgid "Can't create any more partitions."
+msgstr "Nie mona utworzy wicej partycji."
+
+#: parted/ui.c:987
+msgid "Expecting a partition type."
+msgstr "Oczekiwany by typ partycji."
+
+#: parted/ui.c:1115
+msgid "on"
+msgstr "wczone"
+
+#: parted/ui.c:1116
+msgid "off"
+msgstr "wyczone"
+
+#: parted/ui.c:1227
+msgid "OPTIONs:"
+msgstr "OPCJE:"
+
+#: parted/ui.c:1230
+msgid "COMMANDs:"
+msgstr "KOMENDY:"
+
+#: parted/ui.c:1238
+#, c-format
+msgid "Using %s\n"
+msgstr "Uycie %s\n"
+
+#~ msgid ""
+#~ "This ext2 file system has a rather strange layout! Parted can't resize "
+#~ "this (yet)."
+#~ msgstr ""
+#~ "Ten system plikw ext2 ma raczej dziwne rozmieszczenie! Parted nie moe "
+#~ "zmieni jego rozmiaru (na razie)."
+
+#~ msgid "IDE"
+#~ msgstr "IDE"
+
+#, fuzzy
+#~ msgid ""
+#~ "You have an HFS+ file system that has a feature that I haven't seen used "
+#~ "anywhere. Parted can theoretically handle it, but the corresponding code "
+#~ "has never been tested, so this might be risky. Please email me so I can "
+#~ "see how it works! <xxx@yyy.zz>"
+#~ msgstr ""
+#~ "Ten system plikw HFS+ posiada cech ktrej nigdy dotychczas nie "
+#~ "widziaem. Teoretycznie, Parted potrafi j obsugiwa, ale odpowiadajcy "
+#~ "kod nie przeszed testw, z powodu czego jego uycie moe by ryzykowne. "
+#~ "Prosz o zgoszenie wynikw, bym wiedzia czy to dziaa! "
+#~ "<xilun666@libertysurf.fr>"
+
+#~ msgid ""
+#~ "The extents overflow file should not contain its own extents. You should "
+#~ "check the file system."
+#~ msgstr ""
+#~ "Plik przepenienia obszarw nie powinien zawiera wasnych obszarw. "
+#~ "Naley sprawdzi system plikw."
+
+#~ msgid "Disk geometry for %s: %s - %s\n"
+#~ msgstr "Geometria dysku dla %s: %s - %s\n"
+
+#~ msgid "Disk label type: %s\n"
+#~ msgstr "Typ etykiety dysku: %s\n"
+
+#~ msgid "set NUMBER FLAG STATE change a flag on partition NUMBER"
+#~ msgstr "set NUMER FLAGA STAN zmienia flag na partycji NUMER"
+
+#~ msgid ""
+#~ "The sector size on %s is %d bytes. Parted is known not to work properly "
+#~ "with drives with sector sizes other than %d bytes."
+#~ msgstr ""
+#~ "Rozmiar sektora na %s wynosi %d bajtw. Parted nie potrafi prawidowo "
+#~ "wsppracowa z napdami o rozmiarze sektora innym ni %d bajtw."
+
+#~ msgid ""
+#~ "This HFS volume has no extents overflow file. This is quite unusual !"
+#~ msgstr ""
+#~ "Ten wolumen HFS nie zawiera pliku przepenienia obszarw. To raczej "
+#~ "niezwykle!"
+
+#~ msgid ""
+#~ "You found a bug in GNU Parted. Please email a bug report to bug-"
+#~ "parted@gnu.org containing the version (%s), and the following message:\n"
+#~ msgstr ""
+#~ "Znalaze bd w programie GNU Parted. Prosz wylij informacj na ten "
+#~ "temat na adres bug-parted@gnu.org, doczajc numer wersji (%s) oraz "
+#~ "nastpujc wiadomo:\n"
+
+#~ msgid ""
+#~ "You requested to create a partition at %s - %s. The closest Parted can "
+#~ "manage is %s - %s."
+#~ msgstr ""
+#~ "Rozkazano utworzenie partycji na %s - %s. Najblisza z jak Parted moe "
+#~ "sobie poradzi jest %s - %s."
+
+#~ msgid ""
+#~ "You requested to resize the partition to %s - %s. The closest Parted can "
+#~ "manage is %s - %s."
+#~ msgstr ""
+#~ "Rozkazano zmieni rozmiar partycji do %s - %s. Najblisza z jak Parted "
+#~ "moe sobie poradzi jest %s - %s."
+
+#~ msgid "Could not read geometry of %s - %s."
+#~ msgstr "Nie mona odczyta geometrii %s - %s."
+
+#~ msgid "Device %s has dodgey geometry."
+#~ msgstr "Urzdzenie %s ma niepoprawn geometri."
+
+#~ msgid "SCSI"
+#~ msgstr "SCSI"
+
+#~ msgid "Device %s is neither a SCSI nor IDE drive."
+#~ msgstr "Urzdzenie %s nie jest ani napdem SCSI, ani IDE."
+
+#~ msgid "Error reading %s (%s) to determine if partition is mounted."
+#~ msgstr ""
+#~ "Bd podczas czytania %s (%s) w celu ustalenia czy partycja jest "
+#~ "podczona."
+
+#~ msgid ""
+#~ "Unable to determine if partitions are mounted via /proc/mounts or /etc/"
+#~ "mtab. Make sure you don't attempt to resize or modify mounted file "
+#~ "systems. (Even read-only mounted)"
+#~ msgstr ""
+#~ "Nie mona ustali czy partycje s podczone poprzez /proc/mount czy /etc/"
+#~ "mtab. Upewnij si czy nie zamierzasz zmieni rozmiaru lub zmodyfikowa "
+#~ "podczonych systemw plikw. (Nawet podczonych jako tylko-do-odczytu)"
+
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. However, the most likely reason is that Linux "
+#~ "detected the BIOS geometry for %s incorrectly. GNU Parted suspects the "
+#~ "real geometry should be %d/%d/%d (not %d/%d/%d). You should check with "
+#~ "your BIOS first, as this may not be correct. You can inform Linux by "
+#~ "adding the parameter %s=%d,%d,%d to the command line. See the LILO or "
+#~ "GRUB documentation for more information. If you think Parted's suggested "
+#~ "geometry is correct, you may select Ignore to continue (and fix Linux "
+#~ "later). Otherwise, select Cancel (and fix Linux and/or the BIOS now)."
+#~ msgstr ""
+#~ "Tablica partycji na %s jest sprzeczna. Moe by wiele powodw takiego "
+#~ "stanu rzeczy. Aczkolwiek, najbardziej prawdopodobny powd jest taki, e "
+#~ "jdro Linux wykrywa geometri BIOS dla %s w sposb nieprawidowy. GNU "
+#~ "Parted podejrzewa, e prawdziwa geometria powinna wynosi %d/%d/%d (a nie "
+#~ "%d/%d/%d). W takim przypadku naley najpierw sprawdzi ustawienia BIOS, "
+#~ "poniewa moe to nie by prawd. Moesz poinformowa o tym jdro Linux "
+#~ "poprzez dodanie parametrw %s=%d,%d,%d w linii polece. Przeczytaj "
+#~ "dokumentacj LILO lub GRUB, aby uzyska wicej informacji na ten temat. "
+#~ "Jeli mylisz, e geometria zasugerowana przez program Parted jest "
+#~ "prawidowa, to moesz wybra 'Zignoruj', aby kontynuowa (i pniej "
+#~ "naprawi Linuxa). W innym przypadku wybierz 'Poniechaj' (i od razu "
+#~ "napraw Linuxa i/lub BIOS)."
+
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. Often, the reason is that Linux detected the "
+#~ "BIOS geometry incorrectly. However, this does not appear to be the case "
+#~ "here. It is safe to ignore,but ignoring may cause (fixable) problems "
+#~ "with some boot loaders, and may cause problems with FAT file systems. "
+#~ "Using LBA is recommended."
+#~ msgstr ""
+#~ "Tablica partycji na %s jest sprzeczna. Moe by wiele powodw takiego "
+#~ "stanu rzeczy. Najczciej win ponosi jdro Linux, ktre wykrywa "
+#~ "geometri BIOS w sposb nieprawidowy. Aczkolwiek, w tym przypadku nie "
+#~ "jest to przyczyn. Mona ten problem bezpiecznie zignorowa, ale moe to "
+#~ "spowodowa (naprawialne) problemy z niektrymi programami adujcymi oraz "
+#~ "z systemem plikw FAT. Zalecane jest uywanie LBA."
+
+#~ msgid ""
+#~ "Unable to align partition properly. This probably means that another "
+#~ "partitioning tool generated an incorrect partition table, because it "
+#~ "didn't have the correct BIOS geometry. It is safe to ignore,but ignoring "
+#~ "may cause (fixable) problems with some boot loaders."
+#~ msgstr ""
+#~ "Nie mona prawidowo wyrwna partycji. Oznacza to prawdopodobnie, e "
+#~ "inne narzdzie do partycjonowania wytworzyo nieprawidow tablic "
+#~ "partycji, poniewa nie miaa ona prawidowej geometrii BIOS. Bezpiecznie "
+#~ "jest zignorowa, ale moe to spowodowa (naprawialne) problemy z "
+#~ "niektrymi programi adujcymi (boot loaders)."
+
+#~ msgid "File system has an invalid signature for a FAT file systems."
+#~ msgstr "System plikw posiada nieprawidowy podpis dla systemw plikw FAT."
+
+#~ msgid ""
+#~ "START and END are in megabytes. Negative values count from the end of "
+#~ "the disk.\n"
+#~ msgstr ""
+#~ "POCZTEK i KONIEC wyraone s w megabajtach. Ujemne wartoci liczone s "
+#~ "od koca dysku.\n"
+
+#~ msgid ""
+#~ "Partition %s is being used. Modifying it while it is in use could cause "
+#~ "severe corruption."
+#~ msgstr ""
+#~ "Partycja %s jest uywana. Modyfikowanie jej podczas dziaania moe "
+#~ "spowodowa jej uszkodzenie."
+
+#~ msgid "Minor Start End "
+#~ msgstr "Numer Pocztek Koniec "
+
+#~ msgid "Type "
+#~ msgstr "Typ "
+
+#~ msgid "Filesystem "
+#~ msgstr "Sys. plikw "
+
+#~ msgid "Name "
+#~ msgstr "Nazwa "
+
+#~ msgid ""
+#~ " You have Windows FAT partition(s) that are not using LBA. If your BIOS "
+#~ "supports LBA, then you should switch to LBA by setting the LBA flag on "
+#~ "all FAT partitions. Otherwise, make sure the operating system and the "
+#~ "BIOS have the same geometry before resizing any FAT partitions."
+#~ msgstr ""
+#~ "Posiadasz partycj (partycje) Windows FAT, ktra nie uywa LBA. Jeli "
+#~ "Twj BIOS wspiera LBA, to wtedy naley ustawi flag LBA na wszystkich "
+#~ "partycjach FAT. W innym przypadku, upewnij si, e system operacyjny i "
+#~ "BIOS maj tak sam geometri zanim wykonasz zmian wielkoci "
+#~ "jakiejkolwiek partycji FAT."
+
+#~ msgid ""
+#~ "The operating system thinks the geometry on %s is %d/%d/%d. Therefore, "
+#~ "cylinder 1024 ends at %.3fM.%s"
+#~ msgstr ""
+#~ "System operacyjny myli, e geometri urzdzenia %s jest %d/%d/%d. Jednak "
+#~ "cylinder 1024 koczy si na %.3fM.%s"
+
+#~ msgid "The operating system thinks the geometry on %s is %d/%d/%d.%s"
+#~ msgstr ""
+#~ "System operacyjny myli, e geometri urzdzenia %s jest %d/%d/%d.%s"
diff --git a/po/pt.po b/po/pt.po
new file mode 100644
index 0000000..8e3eb8f
--- /dev/null
+++ b/po/pt.po
@@ -0,0 +1,2644 @@
+# Portuguese messages for GNU parted.
+# Copyright (C) 2001 Free Software Foundation, Inc.
+# Gonalo Silva <goncalo.silva@caixamagica.pt>, 2001.
+# Based on pt_BR.po made by Eliphas Levy Theodoro.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: parted 1.4.20\n"
+"Report-Msgid-Bugs-To: bug-parted@gnu.org\n"
+"POT-Creation-Date: 2006-04-21 21:20+0200\n"
+"PO-Revision-Date: 2001-10-16 20:16+02:00\n"
+"Last-Translator: Gonalo Silva <goncalo.silva@caixamagica.org>\n"
+"Language-Team: Portuguese <pt@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: libparted/arch/linux.c:284
+#, c-format
+msgid "Could not stat device %s - %s."
+msgstr "No foi possvel inicializar o dispositivo %s - %s."
+
+#: libparted/arch/linux.c:390
+#, c-format
+msgid ""
+"Could not determine sector size for %s: %s.\n"
+"Using the default sector size (%lld)."
+msgstr ""
+
+#: libparted/arch/linux.c:401
+#, c-format
+msgid ""
+"Device %s has a logical sector size of %lld. Not all parts of GNU Parted "
+"support this at the moment, and the working code is HIGHLY EXPERIMENTAL.\n"
+msgstr ""
+
+#: libparted/arch/linux.c:441
+#, fuzzy, c-format
+msgid "Unable to determine the size of %s (%s)."
+msgstr "Impossvel determinar tamanho de %s (%s)"
+
+#: libparted/arch/linux.c:530
+#, c-format
+msgid "Could not get identity of device %s - %s"
+msgstr "No foi possvel obter a identificao do dispositivo %s - %s"
+
+#: libparted/arch/linux.c:539
+msgid "Generic IDE"
+msgstr ""
+
+#: libparted/arch/linux.c:556
+#, c-format
+msgid ""
+"Device %s has multiple (%d) logical sectors per physical sector.\n"
+"GNU Parted supports this EXPERIMENTALLY for some special disk label/file "
+"system combinations, e.g. GPT and ext2/3.\n"
+"Please consult the web site for up-to-date information."
+msgstr ""
+
+#: libparted/arch/linux.c:726
+#, c-format
+msgid "Error initialising SCSI device %s - %s"
+msgstr "Erro inicializando dispositivo SCSI %s - %s"
+
+#: libparted/arch/linux.c:781
+#, c-format
+msgid ""
+"The device %s has zero length, and can't possibly store a file system or "
+"partition table. Perhaps you selected the wrong device?"
+msgstr ""
+
+#: libparted/arch/linux.c:829
+msgid ""
+"Unable to determine geometry of file/device. You should not use Parted "
+"unless you REALLY know what you're doing!"
+msgstr ""
+"Impossvel determinar a geometria do ficheiro/dispositivo. No deve utilizar "
+"o Parted a no ser que REALMENTE saiba o que est a fazer!"
+
+#: libparted/arch/linux.c:903
+msgid "DAC960 RAID controller"
+msgstr "Controlador RAID DAC960"
+
+#: libparted/arch/linux.c:908
+msgid "Compaq Smart Array"
+msgstr "Compaq Smart Array"
+
+#: libparted/arch/linux.c:913
+msgid "ATARAID Controller"
+msgstr "Controlador ATARAID"
+
+#: libparted/arch/linux.c:918
+msgid "I2O Controller"
+msgstr "Controlador I20"
+
+#: libparted/arch/linux.c:923
+msgid "User-Mode Linux UBD"
+msgstr ""
+
+#: libparted/arch/linux.c:933
+msgid "Unknown"
+msgstr "Desconhecido"
+
+#: libparted/arch/linux.c:940
+msgid "ped_device_new() Unsupported device type"
+msgstr "ped_device_new() Tipo de dispositivo no suportado"
+
+#: libparted/arch/linux.c:1041 libparted/arch/gnu.c:264
+#, c-format
+msgid "Error opening %s: %s"
+msgstr "Erro abrindo %s: %s"
+
+#: libparted/arch/linux.c:1052 libparted/arch/gnu.c:274
+#, c-format
+msgid "Unable to open %s read-write (%s). %s has been opened read-only."
+msgstr ""
+"No posso abrir %s para gravao (%s). %s foi aberto somente para leitura."
+
+#: libparted/arch/linux.c:1160 libparted/arch/linux.c:1228
+#: libparted/arch/gnu.c:452 libparted/arch/gnu.c:550 libparted/arch/gnu.c:678
+#, c-format
+msgid "%s during read on %s"
+msgstr "%s durante leitura em %s"
+
+#: libparted/arch/linux.c:1199
+#, c-format
+msgid "%s during seek for read on %s"
+msgstr "%s durante procura para leitura em %s"
+
+#: libparted/arch/linux.c:1270 libparted/arch/linux.c:1355
+#: libparted/arch/linux.c:1413 libparted/arch/gnu.c:587
+#: libparted/arch/gnu.c:632 libparted/arch/gnu.c:709
+#, c-format
+msgid "%s during write on %s"
+msgstr "%s durante escrita em %s"
+
+#: libparted/arch/linux.c:1297 libparted/arch/gnu.c:512
+#, c-format
+msgid "Can't write to %s, because it is opened read-only."
+msgstr "No posso gravar em %s, pois ela foi aberta como somente para leitura."
+
+#: libparted/arch/linux.c:1321
+#, c-format
+msgid "%s during seek for write on %s"
+msgstr "%s durante procura para escrita em %s"
+
+#: libparted/arch/linux.c:1798
+#, fuzzy, c-format
+msgid ""
+"Error informing the kernel about modifications to partition %s -- %s. This "
+"means Linux won't know about any changes you made to %s until you reboot -- "
+"so you shouldn't mount it or use it in any way before rebooting."
+msgstr ""
+"O kernel no conseguiu reler a tabela de parties de %s (%s). Isto "
+"significa que o Linux no sabe nada sobre as modificaes que fez. Dever "
+"reinicializar seu computador antes de fazer qualquer uso de %s."
+
+#: libparted/arch/linux.c:1879
+#, fuzzy, c-format
+msgid ""
+"The kernel was unable to re-read the partition table on %s (%s). This means "
+"Linux won't know anything about the modifications you made until you "
+"reboot. You should reboot your computer before doing anything with %s."
+msgstr ""
+"O kernel no conseguiu reler a tabela de parties de %s (%s). Isto "
+"significa que o Linux no sabe nada sobre as modificaes que fez. Dever "
+"reinicializar seu computador antes de fazer qualquer uso de %s."
+
+#: libparted/arch/gnu.c:97
+#, c-format
+msgid "Unable to open %s."
+msgstr ""
+
+#: libparted/arch/gnu.c:117
+#, fuzzy
+msgid "Unable to probe store."
+msgstr "Impossvel alinhar a partio."
+
+#: libparted/arch/gnu.c:355
+#, fuzzy
+msgid ""
+"The partition table cannot be re-read. This means you need to reboot before "
+"mounting any modified partitions. You also need to reinstall your boot "
+"loader before you reboot (which may require mounting modified partitions). "
+"It is impossible do both things! So you'll need to boot off a rescue disk, "
+"and reinstall your boot loader from the rescue disk. Read section 4 of the "
+"Parted User documentation for more information."
+msgstr ""
+"O kernel no pde reler sua tabela de parties, portanto precisa de "
+"reiniciar antes de montar qualquer partio modificada. Voce pode tambm "
+"precisar reinstalar seu gestor de boot antes de reinicializar (o que pode "
+"requerer a montagem das parties modificadas). impossvel fazer as duas "
+"coisas! Leia a seco 4 da documentao do usurio do Parted para mais "
+"informaes."
+
+#: libparted/arch/gnu.c:372
+#, fuzzy, c-format
+msgid ""
+"The partition table on %s cannot be re-read (%s). This means the Hurd knows "
+"nothing about any modifications you made. You should reboot your computer "
+"before doing anything with %s."
+msgstr ""
+"O kernel no conseguiu reler a tabela de parties de %s (%s). Isto "
+"significa que o Linux no sabe nada sobre as modificaes que fez. Dever "
+"reinicializar seu computador antes de fazer qualquer uso de %s."
+
+#: libparted/arch/gnu.c:383 parted/parted.c:2215
+msgid ""
+"You should reinstall your boot loader before rebooting. Read section 4 of "
+"the Parted User documentation for more information."
+msgstr ""
+"Dever reinstalar seu gestor de boot antes de reinicializar. Leia a seco 4 "
+"da documentao do utilizador do Parted para mais informaes."
+
+#: libparted/arch/gnu.c:774
+#, c-format
+msgid "%s trying to sync %s to disk"
+msgstr ""
+
+#: libparted/disk.c:183
+#, c-format
+msgid "Unable to open %s - unrecognised disk label."
+msgstr "Impossvel abrir %s - rtulo de disco desconhecido."
+
+#: libparted/disk.c:452
+#, fuzzy, c-format
+msgid ""
+"This libparted doesn't have write support for %s. Perhaps it was compiled "
+"read-only."
+msgstr "No posso gravar em %s, pois ela foi aberta como somente para leitura."
+
+#: libparted/disk.c:579
+#, fuzzy, c-format
+msgid "Partition %d is %s, but the file system is %s."
+msgstr "A partio muito pequena para um sistema de ficheiros FAT"
+
+#: libparted/disk.c:1056
+#, c-format
+msgid "%s disk labels do not support extended partitions."
+msgstr "Rtulos de disco %s no suportam parties extendidas."
+
+#: libparted/disk.c:1616
+#, c-format
+msgid "%s disk labels don't support logical or extended partitions."
+msgstr "Rtulos de disco %s no suportam parties lgicas ou extendidas."
+
+#: libparted/disk.c:1629
+#, fuzzy
+msgid "Too many primary partitions."
+msgstr "Muitas pginas invlidas."
+
+#: libparted/disk.c:1638
+#, c-format
+msgid ""
+"Can't add a logical partition to %s, because there is no extended partition."
+msgstr ""
+"No posso adicionar uma partio lgica em %s, pois no h uma partio "
+"extendida."
+
+#: libparted/disk.c:1662
+#, fuzzy, c-format
+msgid "Can't have more than one extended partition on %s."
+msgstr "No se pode haver mais de uma partio extendida em %s"
+
+#: libparted/disk.c:1672
+#, fuzzy
+msgid "Can't have logical partitions outside of the extended partition."
+msgstr ""
+"No posso adicionar uma partio lgica fora da partio extendida em %s."
+
+#: libparted/disk.c:1697
+#, fuzzy, c-format
+msgid "Can't have a logical partition outside of the extended partition on %s."
+msgstr ""
+"No posso adicionar uma partio lgica fora da partio extendida em %s."
+
+#: libparted/disk.c:1707 libparted/disk.c:1761 libparted/disk.c:1927
+#, fuzzy
+msgid "Can't have overlapping partitions."
+msgstr "No posso copiar para uma partio sobreposta."
+
+#: libparted/disk.c:1715
+#, fuzzy
+msgid "Can't have a primary partition inside an extended partition."
+msgstr "No posso adicionar uma partio primria dentro de uma extendida."
+
+#: libparted/disk.c:2123
+msgid "metadata"
+msgstr ""
+
+#: libparted/disk.c:2125
+msgid "free"
+msgstr "livre"
+
+#: libparted/disk.c:2127 parted/ui.c:968 parted/ui.c:996
+msgid "extended"
+msgstr "extendida"
+
+#: libparted/disk.c:2129 parted/ui.c:972 parted/ui.c:1000
+msgid "logical"
+msgstr "lgica"
+
+#: libparted/disk.c:2131 parted/ui.c:964 parted/ui.c:992
+msgid "primary"
+msgstr "primria"
+
+#: libparted/disk.c:2147
+msgid "boot"
+msgstr "boot"
+
+#: libparted/disk.c:2149
+msgid "root"
+msgstr "root"
+
+#: libparted/disk.c:2151
+msgid "swap"
+msgstr "swap"
+
+#: libparted/disk.c:2153
+msgid "hidden"
+msgstr "escondida"
+
+#: libparted/disk.c:2155
+msgid "raid"
+msgstr "raid"
+
+#: libparted/disk.c:2157
+msgid "lvm"
+msgstr "lvm"
+
+#: libparted/disk.c:2159
+msgid "lba"
+msgstr "lba"
+
+#: libparted/disk.c:2161
+msgid "hp-service"
+msgstr ""
+
+#: libparted/disk.c:2163
+msgid "palo"
+msgstr ""
+
+#: libparted/disk.c:2165
+#, fuzzy
+msgid "prep"
+msgstr "boot"
+
+#: libparted/disk.c:2167
+msgid "msftres"
+msgstr ""
+
+#: libparted/disk.c:2173
+#, fuzzy, c-format
+msgid "Unknown partition flag, %d."
+msgstr "Sinalizador de partio desconhecido, %d."
+
+#: libparted/labels/rdb.c:177
+#, c-format
+msgid "%s : Bad checksum on block %llu of type %s."
+msgstr ""
+
+#: libparted/labels/rdb.c:510
+#, c-format
+msgid "%s : Didn't find rdb block, should never happen."
+msgstr ""
+
+#: libparted/labels/rdb.c:595
+#, c-format
+msgid "%s : Loop detected at block %d."
+msgstr ""
+
+#: libparted/labels/rdb.c:614
+#, c-format
+msgid "%s : The %s list seems bad at block %s."
+msgstr ""
+
+#: libparted/labels/rdb.c:703
+#, c-format
+msgid "%s : Failed to list bad blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:711
+#, c-format
+msgid "%s : Failed to list partition blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:719
+#, c-format
+msgid "%s : Failed to list file system blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:727
+#, c-format
+msgid "%s : Failed to list boot blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:750
+#, fuzzy, c-format
+msgid "Failed to write partition block at %d."
+msgstr "Impossvel determinar se a partio est montada."
+
+#: libparted/labels/rdb.c:1053 libparted/labels/bsd.c:505
+#: libparted/labels/dos.c:1942 libparted/labels/dvh.c:772
+#: libparted/labels/gpt.c:1365 libparted/labels/loop.c:251
+#: libparted/labels/mac.c:1318 libparted/labels/pc98.c:764
+#: libparted/labels/sun.c:704
+#, fuzzy
+msgid "Unable to satisfy all constraints on the partition."
+msgstr "Impossvel alinhar a partio."
+
+#: libparted/labels/rdb.c:1081
+#, fuzzy
+msgid "Unable to allocate a partition number."
+msgstr "A partio destino est a ser utilizada."
+
+#: libparted/labels/bsd.c:530
+#, fuzzy
+msgid "Unable to allocate a bsd disklabel slot."
+msgstr "Impossvel localizar um rotulo de disco bsd"
+
+#: libparted/labels/dos.c:812
+#, fuzzy, c-format
+msgid "Invalid partition table on %s -- wrong signature %x."
+msgstr "Tabela de parties invlida em %s - assinatura errada %x"
+
+#: libparted/labels/dos.c:840
+#, c-format
+msgid "Invalid partition table - recursive partition on %s."
+msgstr "Tabela de parties invlida - partio recursiva em %s."
+
+#: libparted/labels/dos.c:1300
+#, fuzzy
+msgid "Extended partitions cannot be hidden on msdos disk labels."
+msgstr "Parties ext2 no podem ser escondidas em rtulos de disco msdos."
+
+#: libparted/labels/dos.c:1926
+msgid "Parted can't resize partitions managed by Windows Dynamic Disk."
+msgstr ""
+
+#: libparted/labels/dvh.c:192
+#, fuzzy, c-format
+msgid "%s has no extended partition (volume header partition)."
+msgstr ""
+"No posso redimensionar uma partio extendida, sem excluir uma partio "
+"lgica."
+
+#: libparted/labels/dvh.c:315
+msgid "Checksum is wrong, indicating the partition table is corrupt."
+msgstr ""
+
+#: libparted/labels/dvh.c:616
+#, fuzzy
+msgid "Only primary partitions can be root partitions."
+msgstr "No posso adicionar uma partio primria dentro de uma extendida."
+
+#: libparted/labels/dvh.c:630
+#, fuzzy
+msgid "Only primary partitions can be swap partitions."
+msgstr "No posso adicionar uma partio primria dentro de uma extendida."
+
+#: libparted/labels/dvh.c:644
+#, fuzzy
+msgid "Only logical partitions can be a boot file."
+msgstr "No posso adicionar uma partio primria dentro de uma extendida."
+
+#: libparted/labels/dvh.c:723
+msgid "Only logical partitions (boot files) have a name."
+msgstr ""
+
+#: libparted/labels/dvh.c:814
+#, fuzzy
+msgid "Too many primary partitions"
+msgstr "Muitas pginas invlidas."
+
+#: libparted/labels/gpt.c:433
+#, c-format
+msgid ""
+"%s contains GPT signatures, indicating that it has a GPT table. However, it "
+"does not have a valid fake msdos partition table, as it should. Perhaps it "
+"was corrupted -- possibly by a program that doesn't understand GPT partition "
+"tables. Or perhaps you deleted the GPT table, and are now using an msdos "
+"partition table. Is this a GPT partition table?"
+msgstr ""
+
+#: libparted/labels/gpt.c:625
+#, c-format
+msgid ""
+"The format of the GPT partition table is version %x, which is newer than "
+"what Parted can recognise. Please tell us! bug-parted@gnu.org"
+msgstr ""
+
+#: libparted/labels/gpt.c:747
+msgid ""
+"The backup GPT table is not at the end of the disk, as it should be. This "
+"might mean that another operating system believes the disk is smaller. Fix, "
+"by moving the backup to the end (and removing the old backup)?"
+msgstr ""
+
+#: libparted/labels/gpt.c:782
+msgid ""
+"The primary GPT table is corrupt, but the backup appears OK, so that will be "
+"used."
+msgstr ""
+
+#: libparted/labels/gpt.c:790
+msgid ""
+"Both the primary and backup GPT tables are corrupt. Try making a fresh "
+"table, and using Parted's rescue feature to recover partitions."
+msgstr ""
+
+#: libparted/labels/mac.c:167
+#, c-format
+msgid "Invalid signature %x for Mac disk labels."
+msgstr "Assinatura invlida %x para rtulos de disco Mac."
+
+#: libparted/labels/mac.c:212
+msgid "Partition map has no partition map entry!"
+msgstr "Mapa de parties no tem nenhuma entrada!"
+
+#: libparted/labels/mac.c:259
+#, c-format
+msgid "%s is too small for a Mac disk label!"
+msgstr "%s muito pequeno para um rtulo de disco Mac!"
+
+#: libparted/labels/mac.c:490
+#, c-format
+msgid "Partition %d has an invalid signature %x."
+msgstr "A partio %d tem uma assinatura invlida %x."
+
+#: libparted/labels/mac.c:508
+#, c-format
+msgid "Partition %d has an invalid length of 0 bytes!"
+msgstr "A partio %d tem um tamanho invlido de 0 bytes!"
+
+#: libparted/labels/mac.c:536
+#, fuzzy
+msgid "The data region doesn't start at the start of the partition."
+msgstr "A regio de dados no comea no incio da partio"
+
+#: libparted/labels/mac.c:553
+#, fuzzy
+msgid "The boot region doesn't start at the start of the partition."
+msgstr "A regio de inicializao no comea no incio da partio"
+
+#: libparted/labels/mac.c:567
+msgid "The partition's boot region doesn't occupy the entire partition."
+msgstr "A regio de inicializao da partio no a ocupa inteiramente."
+
+#: libparted/labels/mac.c:577
+msgid "The partition's data region doesn't occupy the entire partition."
+msgstr "A regio de dados da partio no a ocupa inteiramente."
+
+#: libparted/labels/mac.c:631
+#, c-format
+msgid ""
+"Weird block size on device descriptor: %d bytes is not divisible by 512."
+msgstr ""
+"tamanho de bloco estranho no descritor de dispositivo: %d bytes no so "
+"divisveis por 512."
+
+#: libparted/labels/mac.c:644
+#, c-format
+msgid ""
+"The driver descriptor says the physical block size is %d bytes, but Linux "
+"says it is %d bytes."
+msgstr ""
+"O descritor do driver informa que o tamanho fsico de bloco %d bytes, mas "
+"o Linux informa que %d bytes."
+
+#: libparted/labels/mac.c:692
+msgid "No valid partition map found."
+msgstr "Nenhum mapa de parties vlido foi encontrado."
+
+#: libparted/labels/mac.c:744
+#, fuzzy, c-format
+msgid ""
+"Conflicting partition map entry sizes! Entry 1 says it is %d, but entry %d "
+"says it is %d!"
+msgstr ""
+"Conflito nos tamanhos de mapa de partio! Entrada 1 informa que %d, mas "
+"entrada %d informa que %d!"
+
+#: libparted/labels/mac.c:771
+#, fuzzy
+msgid "Weird! There are 2 partitions map entries!"
+msgstr "Estranho - 2 entradas no mapa de partio"
+
+#: libparted/labels/mac.c:1257
+msgid ""
+"Changing the name of a root or swap partition will prevent Linux from "
+"recognising it as such."
+msgstr ""
+"Mudar o nome de uma partio root ou swap ir impedir o Linux de reconhec-"
+"la como tal."
+
+#: libparted/labels/mac.c:1353
+#, fuzzy
+msgid "Can't add another partition -- the partition map is too small!"
+msgstr ""
+"No posso adicionar outra partio - o mapa de parties muito pequeno!"
+
+#: libparted/labels/pc98.c:357
+#, fuzzy, c-format
+msgid "Invalid partition table on %s."
+msgstr "Tabela de parties invlida em %s"
+
+#: libparted/labels/pc98.c:409 libparted/labels/pc98.c:487
+#, fuzzy, c-format
+msgid ""
+"Partition %d isn't aligned to cylinder boundaries. This is still "
+"unsupported."
+msgstr ""
+"A partio %d no est alinhada com o limite do cilindro. Preciso adicionar "
+"suporte para isso."
+
+#: libparted/labels/pc98.c:796
+msgid "Can't add another partition."
+msgstr "No posso adicionar outra partio."
+
+#: libparted/labels/sun.c:143
+msgid "Corrupted Sun disk label detected."
+msgstr ""
+
+#: libparted/labels/sun.c:264
+#, c-format
+msgid ""
+"The disk CHS geometry (%d,%d,%d) reported by the operating system does not "
+"match the geometry stored on the disk label (%d,%d,%d)."
+msgstr ""
+
+#: libparted/labels/sun.c:286
+#, c-format
+msgid "The disk label describes a disk bigger than %s."
+msgstr "O rotulo do disco afirma que o disco maior que %s"
+
+#: libparted/labels/sun.c:440
+#, c-format
+msgid "The disk has %d cylinders, which is greater than the maximum of 65536."
+msgstr ""
+
+#: libparted/labels/sun.c:736
+msgid ""
+"The Whole Disk partition is the only available one left. Generally, it is "
+"not a good idea to overwrite this partition with a real one. Solaris may "
+"not be able to boot without it, and SILO (the sparc boot loader) appreciates "
+"it as well."
+msgstr ""
+
+#: libparted/labels/sun.c:751
+msgid "Sun disk label is full."
+msgstr ""
+
+#: libparted/filesys.c:386
+msgid "Could not detect file system."
+msgstr "No foi possvel detectar o sistema de Ficheiros."
+
+#: libparted/filesys.c:397
+#, fuzzy
+msgid "The file system is bigger than its volume!"
+msgstr "O rotulo do disco afirma que o disco maior que %s"
+
+#: libparted/filesys.c:405
+#, c-format
+msgid "Support for opening %s file systems is not implemented yet."
+msgstr ""
+"O suporte para abrir sistema de ficheiros %s no foi implementado ainda."
+
+#: libparted/filesys.c:447
+#, c-format
+msgid "Support for creating %s file systems is not implemented yet."
+msgstr ""
+"O suporte para criar sistema de ficheiros %s no foi implementado ainda."
+
+#: libparted/filesys.c:508
+#, c-format
+msgid "Support for checking %s file systems is not implemented yet."
+msgstr "Suporte para verificar sistema de ficheiros no implementado para %s."
+
+#: libparted/filesys.c:574
+msgid "raw block copying"
+msgstr ""
+
+#: libparted/filesys.c:585
+#, fuzzy
+msgid "growing file system"
+msgstr "Tipo de sistema de ficheiros desconhecido."
+
+#: libparted/filesys.c:625
+msgid "Can't copy onto an overlapping partition."
+msgstr "No posso copiar para uma partio sobreposta."
+
+#: libparted/filesys.c:647
+#, fuzzy, c-format
+msgid ""
+"Direct support for copying file systems is not yet implemented for %s. "
+"However, support for resizing is implemented. Therefore, the file system "
+"can be copied if the new partition is at least as big as the old one. So, "
+"either shrink the partition you are trying to copy, or copy to a bigger "
+"partition."
+msgstr ""
+"O suporte directo para cpia de sistemas de ficheiros no est implementado "
+"para %s. Entretanto, o suporte para redimensionamento est. Portanto, o "
+"sistema de ficheiros pode ser copiado se a nova partio for pelo menos to "
+"grande quanto a antiga. Ento, diminua a partio que voc est a tentar "
+"copiar, ou copie para uma partio maior."
+
+#: libparted/filesys.c:661
+#, c-format
+msgid "Support for copying %s file systems is not implemented yet."
+msgstr "Suporte para copiar sistema de ficheiros no implementado para %s."
+
+#: libparted/filesys.c:699
+#, c-format
+msgid "Support for resizing %s file systems is not implemented yet."
+msgstr ""
+"Suporte para redimensionar sistema de ficheiros no implementado para %s."
+
+#: libparted/exception.c:78
+msgid "Information"
+msgstr "Informao"
+
+#: libparted/exception.c:79
+msgid "Warning"
+msgstr "Aviso"
+
+#: libparted/exception.c:80
+msgid "Error"
+msgstr "Erro"
+
+#: libparted/exception.c:81
+msgid "Fatal"
+msgstr "Fatal"
+
+#: libparted/exception.c:82
+msgid "Bug"
+msgstr "Bug"
+
+#: libparted/exception.c:83
+msgid "No Implementation"
+msgstr "Sem Implementao"
+
+#: libparted/exception.c:87
+msgid "Fix"
+msgstr "Arranjar"
+
+#: libparted/exception.c:88
+msgid "Yes"
+msgstr "Sim"
+
+#: libparted/exception.c:89
+msgid "No"
+msgstr "No"
+
+#: libparted/exception.c:90
+msgid "OK"
+msgstr "OK"
+
+#: libparted/exception.c:91
+msgid "Retry"
+msgstr "Repetir"
+
+#: libparted/exception.c:92
+msgid "Ignore"
+msgstr "Ignorar"
+
+#: libparted/exception.c:93
+msgid "Cancel"
+msgstr "Cancelar"
+
+#: libparted/exception.c:133
+#, fuzzy, c-format
+msgid ""
+"A bug has been detected in GNU Parted. Refer to the web site of parted "
+"http://www.gnu.org/software/parted/parted.html for more informations of what "
+"could be useful for bug submitting! Please email a bug report to bug-"
+"parted@gnu.org containing at least the version (%s) and the following "
+"message: "
+msgstr ""
+"Um bug foi detectado no GNU parted. Por favor, envie um relatrio do bug "
+"para bug-parted@gnu.org contendo a verso (%s) e a mensagem abaixo:"
+
+#: libparted/cs/geom.c:162
+msgid "Can't have the end before the start!"
+msgstr "No pode ter o fim da partio antes do incio."
+
+#: libparted/cs/geom.c:169
+msgid "Can't have a partition outside the disk!"
+msgstr "No pode ter uma partio fora do disco!."
+
+#: libparted/cs/geom.c:303
+#, fuzzy, c-format
+msgid "Attempt to read sectors %ld-%ld outside of partition on %s."
+msgstr "Tentativa de ler sectores %ld-%ld fora da partio em %s"
+
+#: libparted/cs/geom.c:373
+#, fuzzy, c-format
+msgid "Attempt to write sectors %ld-%ld outside of partition on %s."
+msgstr "Tentativa de escrever sectores %ld-%ld fora da partio em %s"
+
+#: libparted/cs/geom.c:413 libparted/fs/linux_swap/linux_swap.c:353
+msgid "checking for bad blocks"
+msgstr ""
+
+#: libparted/libparted.c:286 libparted/libparted.c:306
+msgid "Out of memory."
+msgstr "No h memria."
+
+#: libparted/unit.c:139
+msgid "Cannot get unit size for special unit 'COMPACT'."
+msgstr ""
+
+#: libparted/unit.c:382
+#, c-format
+msgid "\"%s\" has invalid syntax for locations."
+msgstr ""
+
+#: libparted/unit.c:390
+#, c-format
+msgid "The maximum head value is %d."
+msgstr ""
+
+#: libparted/unit.c:397
+#, c-format
+msgid "The maximum sector value is %d."
+msgstr ""
+
+#: libparted/unit.c:409 libparted/unit.c:540
+#, fuzzy, c-format
+msgid "The location %s is outside of the device %s."
+msgstr "Impossvel criar partio fora do dispositivo."
+
+#: libparted/unit.c:522
+msgid "Invalid number."
+msgstr ""
+
+#: libparted/fs/ext2/ext2.c:87 libparted/fs/ext2/ext2.c:112
+msgid "Inconsistent group descriptors!"
+msgstr "Descritores de grupo inconsistentes!"
+
+#: libparted/fs/ext2/ext2.c:91 libparted/fs/ext2/ext2.c:116
+#, fuzzy
+msgid "File system full!"
+msgstr "Sistema de ficheiros cheio!"
+
+#: libparted/fs/ext2/ext2.c:750
+#, fuzzy
+msgid "Invalid superblock. Are you sure this is an ext2 file system?"
+msgstr "Superbloco invlido. Tem certeza que isto um sistema ext2?"
+
+#: libparted/fs/ext2/ext2.c:764 libparted/fs/ext2/ext2_resize.c:597
+#, fuzzy
+msgid "File system has errors! You should run e2fsck."
+msgstr "Sistema de ficheiros tem erros! Execute e2fsck primeiro!"
+
+#: libparted/fs/ext2/ext2.c:775
+#, fuzzy
+msgid ""
+"File system was not cleanly unmounted! You should run e2fsck. Modifying an "
+"unclean file system could cause severe corruption."
+msgstr ""
+"Sistema de ficheiros no foi desmontado correctamente! Execute e2fsck "
+"primeiro!"
+
+#: libparted/fs/ext2/ext2.c:795
+#, fuzzy
+msgid "File system has an incompatible feature enabled."
+msgstr "Sistema de ficheiros tem caractersticas incompatveis"
+
+#: libparted/fs/ext2/ext2.c:806
+msgid "Error allocating buffer cache."
+msgstr "Erro ao determinar o cache temporrio."
+
+#: libparted/fs/ext2/ext2.c:848
+msgid ""
+"A resize operation on this file system will use EXPERIMENTAL code that MAY "
+"CORRUPT it (although it hasn't done so yet).You should at least backup your "
+"data and run 'e2fsck -f' afterwards."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:114
+#, fuzzy
+msgid ""
+"Found an inode with a incorrect link count. Better go run e2fsck first!"
+msgstr ""
+"Encontrado um inode com uma contagem incorreta de ligaes. Melhor executar "
+"o e2fsck primeiro."
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:487
+msgid "Not enough free inodes!"
+msgstr "No h inodes livres suficientes!"
+
+#: libparted/fs/ext2/ext2_resize.c:224
+#, fuzzy
+msgid "File system is too full to remove a group!"
+msgstr "Sistema de ficheiros muito ocupado para remover um grupo!"
+
+#: libparted/fs/ext2/ext2_resize.c:233
+#, fuzzy
+msgid "File system has too many allocated inodes to remove a group!"
+msgstr ""
+"Sistema de ficheiros tem muitos inodes utilizados para remover um grupo!"
+
+#: libparted/fs/ext2/ext2_resize.c:493
+msgid "adding groups"
+msgstr ""
+
+#: libparted/fs/ext2/ext2_resize.c:530
+#, fuzzy, c-format
+msgid "Your file system is too full to resize it to %i blocks. Sorry."
+msgstr ""
+"Seu sistema de ficheiros est muito ocupado para redimension-lo para %i "
+"blocos. Desculpe."
+
+#: libparted/fs/ext2/ext2_resize.c:540
+#, fuzzy, c-format
+msgid ""
+"Your file system has too many occupied inodes to resize it to %i blocks. "
+"Sorry."
+msgstr ""
+"Seu sistema de ficheiros est com muitos inodes ocupados para redimension-"
+"lo para %i blocos. Desculpe."
+
+#: libparted/fs/ext2/ext2_resize.c:554 libparted/fs/hfs/hfs.c:243
+#: libparted/fs/hfs/hfs.c:624
+#, fuzzy
+msgid "shrinking"
+msgstr "Aviso"
+
+#: libparted/fs/ext2/ext2_resize.c:605
+#, fuzzy
+msgid "File system was not cleanly unmounted! You should run e2fsck."
+msgstr ""
+"Sistema de ficheiros no foi desmontado correctamente! Execute e2fsck "
+"primeiro!"
+
+#: libparted/fs/ext2/ext2_resize.c:614
+msgid ""
+"The file system has the 'dir_index' feature enabled. Parted can only resize "
+"the file system if it disables this feature. You can enable it later by "
+"running 'tune2fs -O dir_index DEVICE' and then 'e2fsck -fD DEVICE'."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_block_relocator.c:198
+#, fuzzy
+msgid "Cross-linked blocks found! Better go run e2fsck first!"
+msgstr ""
+"Encontrados blocos com referncia cruzada! Melhor executar e2fsck primeiro."
+
+#: libparted/fs/ext2/ext2_block_relocator.c:537
+#, fuzzy, c-format
+msgid "Block %i has no reference? Weird."
+msgstr "Bloco %i no tem referncia? Estranho"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:738
+#, c-format
+msgid "Block %i shouldn't have been marked!"
+msgstr "Bloco %i no deveria ter sido marcado!"
+
+#: libparted/fs/ext2/interface.c:188
+#, fuzzy
+msgid ""
+"The ext2 file system passed a basic check. For a more comprehensive check, "
+"use the e2fsck program."
+msgstr ""
+"O sistema de ficheiros ext2 passou pelo teste bsico. Para um teste mais "
+"profundo, utilize o programa e2fsck."
+
+#: libparted/fs/ext2/interface.c:205
+msgid "Sorry, can't move the start of ext2 partitions yet!"
+msgstr "Desculpe, no posso mover o incio de parties ext2 ainda!"
+
+#: libparted/fs/ext2/ext2_buffer.c:82
+msgid "Couldn't flush buffer cache!"
+msgstr "No foi possvel esvaziar a cache temporria!"
+
+#: libparted/fs/ext2/ext2_mkfs.c:162
+msgid "writing per-group metadata"
+msgstr ""
+
+#: libparted/fs/ext2/ext2_mkfs.c:565
+msgid "File system too small for ext2."
+msgstr ""
+
+#: libparted/fs/fat/calc.c:134
+#, fuzzy, c-format
+msgid ""
+"You need %s of free disk space to shrink this partition to this size. "
+"Currently, only %s is free."
+msgstr ""
+"Voc precisa de %dM de espao livre para diminuir esta partio para este "
+"tamanho (voc tem somente %dM livres)"
+
+#: libparted/fs/fat/context.c:55
+#, c-format
+msgid ""
+"Cluster start delta = %d, which is not a multiple of the cluster size %d."
+msgstr ""
+"O cluster inicia em delta = %d, que no um mltiplo do tamanho de cluster %"
+"d."
+
+#: libparted/fs/fat/fat.c:312
+#, fuzzy, c-format
+msgid "Partition too big/small for a %s file system."
+msgstr "A partio muito pequena para um sistema de ficheiros FAT"
+
+#: libparted/fs/fat/fat.c:478
+msgid ""
+"The FATs don't match. If you don't know what this means, then select "
+"cancel, run scandisk on the file system, and then come back."
+msgstr ""
+"As FATs no esto iguais. Se no sabe o que isto significa, seleccione "
+"cancelar, execute o scandisk no sistema de ficheiros, depois volte."
+
+#: libparted/fs/fat/fat.c:518
+msgid "There are no possible configurations for this FAT type."
+msgstr "No h configuraes possveis para este tipo de FAT."
+
+#: libparted/fs/fat/fat.c:530
+#, c-format
+msgid ""
+"File system doesn't have expected sizes for Windows to like it. Cluster "
+"size is %dk (%dk expected); number of clusters is %d (%d expected); size of "
+"FATs is %d sectors (%d expected)."
+msgstr ""
+"O sistema de ficheiros no tem o tamanho esperado para que o Windows o "
+"utilize. O tamanho do cluster %dk (%dk esperado); nmero de clusters %d "
+"(%d esperado); tamanho da FAT %d sectores (%d esperado)."
+
+#: libparted/fs/fat/fat.c:553
+#, c-format
+msgid ""
+"File system is reporting the free space as %d clusters, not %d clusters."
+msgstr ""
+"O sistema de ficheiros reporta que o espao livre de %d clusters, no de %"
+"d clusters."
+
+#: libparted/fs/fat/fat.c:878
+#, fuzzy
+msgid ""
+"GNU Parted was miscompiled: the FAT boot sector should be 512 bytes. FAT "
+"support will be disabled."
+msgstr ""
+"O GNU parted foi compilado erradamente: o sector de boot FAT deveria ser de "
+"512 bytes. O suporte a FAT ser desabilitado."
+
+#: libparted/fs/fat/resize.c:158
+#, fuzzy
+msgid ""
+"There's not enough room in the root directory for all of the files. Either "
+"cancel, or ignore to lose the files."
+msgstr ""
+"No h espao suficiente no diretrio raiz para todos os ficheiros. Cancele, "
+"ou ignore para perder os ficheiros."
+
+#: libparted/fs/fat/resize.c:299
+msgid "Error writing to the root directory."
+msgstr "Erro escrevendo no diretrio raiz."
+
+#: libparted/fs/fat/resize.c:484
+#, fuzzy
+msgid "If you leave your file system as FAT16, then you will have no problems."
+msgstr "Se deixar seu sistema de ficheiros como FAT16, no haver problemas."
+
+#: libparted/fs/fat/resize.c:487
+msgid ""
+"If you convert to FAT16, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual)."
+msgstr ""
+"Se voc converter para FAT16, e o MS Windows est instalado nesta partio, "
+"dever reinstalar o gestor de boot do MS Windows. Se quiser fazer isso, "
+"consulte o manual do Parted (ou o manual de sua distribuio)."
+
+#: libparted/fs/fat/resize.c:495
+msgid ""
+"If you leave your file system as FAT32, then you will not introduce any new "
+"problems."
+msgstr ""
+"Se deixar seu sistema de ficheiros como FAT32, voc no ter mais nenhum "
+"problema novo."
+
+#: libparted/fs/fat/resize.c:499
+msgid ""
+"If you convert to FAT32, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual). Also, "
+"converting to FAT32 will make the file system unreadable by MS DOS, MS "
+"Windows 95a, and MS Windows NT."
+msgstr ""
+"Se voc converter para FAT32, e o MS Windows est instalado nesta partio, "
+"dever reinstalar o gestor de boot do MS Windows. Se quiser fazer isso, "
+"consulte o manual do Parted (ou o manual de sua distribuio). Tambm, "
+"convertendo para FAT32 far com que o sistema de ficheiros no seja mais "
+"reconhecido pelo MS DOS, Windows 95a, e MS Windows NT."
+
+#: libparted/fs/fat/resize.c:513
+#, c-format
+msgid "%s %s %s"
+msgstr ""
+
+#: libparted/fs/fat/resize.c:514
+msgid "Would you like to use FAT32?"
+msgstr "Voc gostaria de usar FAT32?"
+
+#: libparted/fs/fat/resize.c:541 libparted/fs/fat/resize.c:557
+#, c-format
+msgid "%s %s"
+msgstr ""
+
+#: libparted/fs/fat/resize.c:542
+msgid ""
+"The file system can only be resized to this size by converting to FAT16."
+msgstr ""
+"O sistema de ficheiros s pode ser redimensionado para esse tamanho se "
+"convertido para FAT16."
+
+#: libparted/fs/fat/resize.c:558
+msgid ""
+"The file system can only be resized to this size by converting to FAT32."
+msgstr ""
+"O sistema de ficheiros s pode ser redimensionado para esse tamanho se "
+"convertido para FAT32."
+
+#: libparted/fs/fat/resize.c:571
+#, fuzzy
+msgid ""
+"GNU Parted cannot resize this partition to this size. We're working on it!"
+msgstr ""
+"O GNU Parted no pode redimensionar esta partio para esse tamanho. Estamos "
+"a trabalhar nisso!"
+
+#: libparted/fs/fat/bootsector.c:48 libparted/fs/fat/bootsector.c:55
+msgid "File system has an invalid signature for a FAT file system."
+msgstr "Sistema de ficheiros tem uma assinatura invlida para um FAT."
+
+#: libparted/fs/fat/bootsector.c:62
+msgid "File system has an invalid sector size for a FAT file system."
+msgstr "Sistema de ficheiros tem um tamanho de sector invlido para um FAT."
+
+#: libparted/fs/fat/bootsector.c:69
+#, fuzzy
+msgid "File system has an invalid cluster size for a FAT file system."
+msgstr "Sistema de ficheiros tem um tamanho de sector invlido para um FAT."
+
+#: libparted/fs/fat/bootsector.c:76
+#, fuzzy
+msgid ""
+"File system has an invalid number of reserved sectors for a FAT file system."
+msgstr ""
+"Sistema de ficheiros tem um nmero de setores reservados invlido para um "
+"FAT."
+
+#: libparted/fs/fat/bootsector.c:83
+#, fuzzy
+msgid "File system has an invalid number of FATs."
+msgstr "Sistema de ficheiros tem um nmero invlido de FATS."
+
+#: libparted/fs/fat/bootsector.c:138
+#, c-format
+msgid ""
+"This file system has a logical sector size of %d. GNU Parted is known not "
+"to work properly with sector sizes other than 512 bytes."
+msgstr ""
+"Este sistema de ficheiros tem um tamanho de sector lgico de %d. O GNU "
+"Parted conhecido por no funcionar corretamente com sectores diferentes de "
+"512 bytes."
+
+#: libparted/fs/fat/bootsector.c:163
+#, c-format
+msgid ""
+"The file system's CHS geometry is (%d, %d, %d), which is invalid. The "
+"partition table's CHS geometry is (%d, %d, %d). If you select Ignore, the "
+"file system's CHS geometry will be left unchanged. If you select Fix, the "
+"file system's CHS geometry will be set to match the partition table's CHS "
+"geometry."
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:209
+msgid "FAT boot sector says logical sector size is 0. This is weird. "
+msgstr "Sector de boot FAT diz que o tamanho lgico do sector 0. Estranho. "
+
+#: libparted/fs/fat/bootsector.c:215
+msgid "FAT boot sector says there are no FAT tables. This is weird. "
+msgstr "Sector de boot FAT diz que no h tabelas FAT. Estranho. "
+
+#: libparted/fs/fat/bootsector.c:221
+msgid "FAT boot sector says clusters are 0 sectors. This is weird. "
+msgstr "Sector de boot FAT diz que os clusters tm 0 setores. Estranho. "
+
+#: libparted/fs/fat/bootsector.c:231
+#, fuzzy
+msgid "File system is FAT12, which is unsupported."
+msgstr "O sistema de ficheiros FAT12, que no suportado."
+
+#: libparted/fs/fat/bootsector.c:407
+#, c-format
+msgid ""
+"The information sector has the wrong signature (%x). Select cancel for now, "
+"and send in a bug report. If you're desperate, it's probably safe to ignore."
+msgstr ""
+"O sector de informaes tem uma assinatura invlida (%x). Selecione cancelar "
+"agora, e mande um relatrio de bug. Se voc est desesperado, provvel que "
+"seja seguro ignorar."
+
+#: libparted/fs/fat/count.c:149
+#, c-format
+msgid "Bad directory entry for %s: first cluster is the end of file marker."
+msgstr ""
+"Entrada de diretrio invlida para %s: o primeiro cluster o fim do "
+"marcador de ficheiro."
+
+#: libparted/fs/fat/count.c:162
+#, c-format
+msgid ""
+"Bad FAT: unterminated chain for %s. You should run dosfsck or scandisk."
+msgstr ""
+"FAT estragada: cadeia no terminada para %s. Voc deveria correr o dosfsck "
+"ou o scandisk."
+
+#: libparted/fs/fat/count.c:171
+#, fuzzy, c-format
+msgid ""
+"Bad FAT: cluster %d outside file system in chain for %s. You should run "
+"dosfsck or scandisk."
+msgstr ""
+"FAT estragada: cluster %d fora do sistema de ficheiros na cadeia para %s. "
+"Voc deveria correr o dosfsck ou o scandisk."
+
+#: libparted/fs/fat/count.c:181
+#, c-format
+msgid ""
+"Bad FAT: cluster %d is cross-linked for %s. You should run dosfsck or "
+"scandisk."
+msgstr ""
+"FAT estragada: o cluster %d tem uma referncia cruzada para %s. Voc deveria "
+"correr o dosfsck ou o scandisk."
+
+#: libparted/fs/fat/count.c:200
+#, fuzzy, c-format
+msgid "%s is %dk, but it has %d clusters (%dk)."
+msgstr "%s %dk, mas tem %d clusters (%dk)."
+
+#: libparted/fs/fat/count.c:263
+#, c-format
+msgid ""
+"The file %s is marked as a system file. This means moving it could cause "
+"some programs to stop working."
+msgstr ""
+
+#: libparted/fs/fat/table.c:138
+#, c-format
+msgid ""
+"FAT %d media %x doesn't match the boot sector's media %x. You should "
+"probably run scandisk."
+msgstr ""
+"FAT %d mdia %x no coincide com o sector de boot mdio %x. Voc deveria "
+"executar o scandisk."
+
+#: libparted/fs/fat/table.c:268
+#, fuzzy, c-format
+msgid "fat_table_set: cluster %ld outside file system"
+msgstr "fat_table_set: cluster %ld fora do sistema de ficheiros"
+
+#: libparted/fs/fat/table.c:296
+#, fuzzy, c-format
+msgid "fat_table_get: cluster %ld outside file system"
+msgstr "fat_table_get: cluster %ld fora do sistema de ficheiros"
+
+#: libparted/fs/fat/table.c:334
+msgid "fat_table_alloc_cluster: no free clusters"
+msgstr "fat_table_alloc_cluster: no h clusters livres"
+
+#: libparted/fs/linux_swap/linux_swap.c:236
+#, c-format
+msgid "Unrecognised linux swap signature '%10s'."
+msgstr "Assinatura linux swap no reconhecida '%10s'."
+
+#: libparted/fs/linux_swap/linux_swap.c:312
+msgid "Too many bad pages."
+msgstr "Muitas pginas invlidas."
+
+#: libparted/fs/hfs/advfs.c:123 libparted/fs/hfs/advfs_plus.c:125
+#: libparted/fs/hfs/reloc.c:416 libparted/fs/hfs/reloc.c:510
+#: libparted/fs/hfs/reloc_plus.c:541 libparted/fs/hfs/reloc_plus.c:660
+#: libparted/fs/hfs/reloc_plus.c:774
+msgid "The file system contains errors."
+msgstr ""
+
+#: libparted/fs/hfs/advfs_plus.c:290
+msgid "Bad blocks could not be read."
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:139
+#, c-format
+msgid ""
+"Trying to register an extent starting at block 0x%X, but another one already "
+"exists at this position. You should check the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:216
+#, c-format
+msgid ""
+"Trying to move an extent from block Ox%X to block Ox%X, but another one "
+"already exists at this position. This should not happen!"
+msgstr ""
+
+#: libparted/fs/hfs/file.c:145
+#, c-format
+msgid "Could not update the extent cache for HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:182
+#, c-format
+msgid "Trying to read HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:192 libparted/fs/hfs/file.c:222
+#, c-format
+msgid "Could not find sector %lli of HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:212
+#, c-format
+msgid "Trying to write HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:159
+#, c-format
+msgid "Could not update the extent cache for HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:203
+#, c-format
+msgid "Trying to read HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:214 libparted/fs/hfs/file_plus.c:256
+#, c-format
+msgid "Could not find sector %lli of HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:245
+#, c-format
+msgid "Trying to write HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:225
+msgid "Sorry, HFS cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:255 libparted/fs/hfs/hfs.c:636
+msgid "Data relocation has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:274
+msgid "Data relocation left some data in the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:313
+#, fuzzy
+msgid "writing HFS Master Directory Block"
+msgstr "Erro escrevendo no diretrio raiz."
+
+#: libparted/fs/hfs/hfs.c:461
+msgid "No valid HFS[+X] signature has been found while opening."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:471
+#, c-format
+msgid "Version %d of HFS+ isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:482
+#, c-format
+msgid "Version %d of HFSX isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:667
+msgid "Data relocation left some data at the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:715
+#, fuzzy
+msgid "Error while writing the allocation file."
+msgstr "Erro escrevendo no diretrio raiz."
+
+#: libparted/fs/hfs/hfs.c:730
+msgid "Error while writing the compatibility part of the allocation file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:745
+msgid "writing HFS+ Volume Header"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:845
+msgid "An error occurred while looking for the mandatory bad blocks file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:899
+msgid ""
+"It seems there is an error in the HFS wrapper: the bad blocks file doesn't "
+"contain the embedded HFS+ volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:930
+msgid "Sorry, HFS+ cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:965
+msgid "shrinking embedded HFS+ volume"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:981
+msgid "Resizing the HFS+ volume has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:988
+#, fuzzy
+msgid "shrinking HFS wrapper"
+msgstr "Aviso"
+
+#: libparted/fs/hfs/hfs.c:997
+msgid "Updating the HFS wrapper has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:1099 libparted/fs/hfs/hfs.c:1184
+#, c-format
+msgid ""
+"This is not a real %s check. This is going to extract special low level "
+"files for debugging purposes."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:156
+msgid "Bad block list header checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:169
+#, c-format
+msgid ""
+"Invalid size of a transaction block while replaying the journal (%i bytes)."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:261
+msgid ""
+"Journal stored outside of the volume are not supported. Try to desactivate "
+"the journal and run Parted again."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:272
+#, fuzzy
+msgid "Journal offset or size is not multiple of the sector size."
+msgstr ""
+"O cluster inicia em delta = %d, que no um mltiplo do tamanho de cluster %"
+"d."
+
+#: libparted/fs/hfs/journal.c:290
+msgid "Incorrect magic values in the journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:299
+msgid "Journal size mismatch between journal info block and journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:311
+#, fuzzy
+msgid "Some header fields are not multiple of the sector size."
+msgstr ""
+"O cluster inicia em delta = %d, que no um mltiplo do tamanho de cluster %"
+"d."
+
+#: libparted/fs/hfs/journal.c:320
+msgid ""
+"The sector size stored in the journal is not 512 bytes. Parted only "
+"supports 512 bytes length sectors."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:332
+msgid "Bad journal checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:350
+msgid ""
+"The journal is not empty. Parted must replay the transactions before "
+"opening the file system. This will modify the file system."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:378
+msgid ""
+"The volume header or the master directory block has changed while replaying "
+"the journal. You should restart Parted."
+msgstr ""
+
+#: libparted/fs/hfs/probe.c:52
+#, c-format
+msgid ""
+"Parted can't use HFS file systems on disks with a sector size not equal to %"
+"d bytes."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:153 libparted/fs/hfs/reloc_plus.c:157
+msgid "An extent has not been relocated."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:253 libparted/fs/hfs/reloc_plus.c:309
+msgid ""
+"A reference to an extent comes from a place it should not. You should check "
+"the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:383
+msgid "This HFS volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:477
+msgid "This HFS volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:519 libparted/fs/hfs/reloc_plus.c:670
+msgid ""
+"The extents overflow file should not contain its own extents! You should "
+"check the file system."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:576 libparted/fs/hfs/reloc_plus.c:849
+#, fuzzy
+msgid "Could not cache the file system in memory."
+msgstr "No foi possvel detectar o sistema de Ficheiros."
+
+#: libparted/fs/hfs/reloc.c:637 libparted/fs/hfs/reloc_plus.c:910
+msgid "Bad blocks list could not be loaded."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:651 libparted/fs/hfs/reloc_plus.c:926
+msgid "An error occurred during extent relocation."
+msgstr ""
+
+#: libparted/fs/hfs/reloc_plus.c:497
+msgid "This HFS+ volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc_plus.c:621
+msgid "This HFS+ volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: parted/parted.c:76
+msgid "displays this help message"
+msgstr "mostra esta mensagem de ajuda"
+
+#: parted/parted.c:77
+msgid "where necessary, prompts for user intervention"
+msgstr "quando necessrio, pede interveno do utilizador"
+
+#: parted/parted.c:78
+msgid "never prompts for user intervention"
+msgstr "nunca pede interveno do utulizador"
+
+#: parted/parted.c:79
+msgid "displays the version"
+msgstr "mostra a verso"
+
+#: parted/parted.c:87
+#, fuzzy
+msgid ""
+"NUMBER is the partition number used by Linux. On MS-DOS disk labels, the "
+"primary partitions number from 1 to 4, logical partitions from 5 onwards.\n"
+msgstr ""
+"MINOR o nmero da partio usado pelo linux. Em rtulos de disco msdos, as "
+"parties primrias so de 1-4, e parties lgicas de 5 adiante.\n"
+
+#: parted/parted.c:90
+msgid "LABEL-TYPE is one of: "
+msgstr "TIPO_ROTULO um de:"
+
+#: parted/parted.c:91
+msgid "FLAG is one of: "
+msgstr "FLAG um de: "
+
+#: parted/parted.c:92
+#, fuzzy
+msgid "UNIT is one of: "
+msgstr "FLAG um de: "
+
+#: parted/parted.c:93
+msgid "PART-TYPE is one of: primary, logical, extended\n"
+msgstr "TIPO-PART um de: primary, logical, extended\n"
+
+#: parted/parted.c:95
+msgid "FS-TYPE is one of: "
+msgstr "TIPO-FS um de: "
+
+#: parted/parted.c:96
+msgid ""
+"START and END are disk locations, such as 4GB or 10%. Negative values count "
+"from the end of the disk. For example, -1s specifies exactly the last "
+"sector.\n"
+msgstr ""
+
+#: parted/parted.c:99
+msgid "STATE is one of: on, off\n"
+msgstr "ESTADO um de: on, off\n"
+
+#: parted/parted.c:100
+msgid "DEVICE is usually /dev/hda or /dev/sda\n"
+msgstr "DISPOSITIVO usualmente /dev/hda ou /dev/sda\n"
+
+#: parted/parted.c:101
+msgid "NAME is any word you want\n"
+msgstr "NAME qualquer palavra que desejar\n"
+
+#: parted/parted.c:102
+msgid "The partition must have one of the following FS-TYPEs: "
+msgstr ""
+
+#: parted/parted.c:105
+msgid "GNU Parted Version information:\n"
+msgstr ""
+
+#: parted/parted.c:107
+msgid ""
+"Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n"
+"This program is free software, covered by the GNU General Public License.\n"
+"\n"
+"This program is distributed in the hope that it will be useful, but WITHOUT "
+"ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
+"FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
+"more details.\n"
+"\n"
+msgstr ""
+
+#: parted/parted.c:152
+#, c-format
+msgid "%0.f%%\t(time left %.2d:%.2d)"
+msgstr ""
+
+#: parted/parted.c:170
+#, c-format
+msgid ""
+"Partition %s is being used. You must unmount it before you modify it with "
+"Parted."
+msgstr ""
+
+#: parted/parted.c:187
+#, c-format
+msgid "Partition(s) on %s are being used."
+msgstr "Partio(es) em %s est(o) a ser utilizada(s)."
+
+#: parted/parted.c:413 parted/parted.c:594 parted/parted.c:979
+#: parted/parted.c:1059 parted/parted.c:1586 parted/parted.c:1663
+#: parted/parted.c:1707
+#, fuzzy
+msgid "Partition number?"
+msgstr "A partio est a ser utilizada."
+
+#: parted/parted.c:456
+msgid "Source device?"
+msgstr ""
+
+#: parted/parted.c:460
+#, fuzzy
+msgid "Source partition number?"
+msgstr "A partio origem no existe."
+
+#: parted/parted.c:465
+#, fuzzy
+msgid "Can't copy an extended partition."
+msgstr "No posso copiar parties extendidas."
+
+#: parted/parted.c:471
+#, fuzzy
+msgid "Destination partition number?"
+msgstr "A partio destino est a ser utilizada."
+
+#: parted/parted.c:564
+#, fuzzy
+msgid "New disk label type?"
+msgstr "Tipo de rtulo de disco: %s\n"
+
+#: parted/parted.c:598
+#, fuzzy
+msgid "File system?"
+msgstr "SistemaFich "
+
+#: parted/parted.c:645 parted/parted.c:815
+#, fuzzy
+msgid "Partition type?"
+msgstr "A partio no existe."
+
+#: parted/parted.c:652 parted/parted.c:822 parted/parted.c:1062
+#, fuzzy
+msgid "Partition name?"
+msgstr "A partio no existe."
+
+#: parted/parted.c:660 parted/parted.c:832
+#, fuzzy
+msgid "File system type?"
+msgstr "SistemaFich "
+
+#: parted/parted.c:667 parted/parted.c:834 parted/parted.c:994
+#: parted/parted.c:1544 parted/parted.c:1595
+msgid "Start?"
+msgstr ""
+
+#: parted/parted.c:669 parted/parted.c:837 parted/parted.c:997
+#: parted/parted.c:1546 parted/parted.c:1597
+msgid "End?"
+msgstr ""
+
+#: parted/parted.c:707 parted/parted.c:875
+#, fuzzy, c-format
+msgid ""
+"You requested a partition from %s to %s.\n"
+"The closest location we can manage is %s to %s. Is this still acceptable to "
+"you?"
+msgstr ""
+"Pretende mover a partiao para %.3f-%.3fMb. O mais perto que se consegue "
+"ser %3f-%.3fMb"
+
+#: parted/parted.c:827
+msgid "An extended partition cannot hold a file system. Did you want mkpart?"
+msgstr ""
+
+#: parted/parted.c:985
+#, fuzzy
+msgid "Can't move an extended partition."
+msgstr "No posso mover parties extendidas."
+
+#: parted/parted.c:1014
+msgid "Can't move a partition onto itself. Try using resize, perhaps?"
+msgstr ""
+"No posso mover a partio sobre ela mesma. Talvez queira redimensionar?"
+
+#: parted/parted.c:1158
+#, c-format
+msgid "Minor: %d\n"
+msgstr ""
+
+#: parted/parted.c:1159
+#, fuzzy, c-format
+msgid "Flags: %s\n"
+msgstr "Sinalizador"
+
+#: parted/parted.c:1160
+#, fuzzy, c-format
+msgid "File System: %s\n"
+msgstr "SistemaFich "
+
+#: parted/parted.c:1161
+#, c-format
+msgid "Size: "
+msgstr ""
+
+#: parted/parted.c:1166
+#, c-format
+msgid "Minimum size: "
+msgstr ""
+
+#: parted/parted.c:1169
+#, c-format
+msgid "Maximum size: "
+msgstr ""
+
+#: parted/parted.c:1255
+#, fuzzy, c-format
+msgid "Disk %s: %s\n"
+msgstr "Tipo de rtulo de disco: %s\n"
+
+#: parted/parted.c:1256
+#, c-format
+msgid "Sector size (logical/physical): %lldB/%lldB\n"
+msgstr ""
+
+#: parted/parted.c:1267
+#, c-format
+msgid "BIOS cylinder,head,sector geometry: %d,%d,%d. Each cylinder is %s.\n"
+msgstr ""
+
+#: parted/parted.c:1273
+#, fuzzy, c-format
+msgid "Partition Table: %s\n"
+msgstr "A partio no existe."
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Number"
+msgstr ""
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Start"
+msgstr ""
+
+#: parted/parted.c:1285 parted/parted.c:1288
+msgid "End"
+msgstr ""
+
+#: parted/parted.c:1288
+#, fuzzy
+msgid "Size"
+msgstr "resize"
+
+#: parted/parted.c:1292
+msgid "Type"
+msgstr ""
+
+#: parted/parted.c:1294
+#, fuzzy
+msgid "File system"
+msgstr "SistemaFich "
+
+#: parted/parted.c:1297
+#, fuzzy
+msgid "Name"
+msgstr "name"
+
+#: parted/parted.c:1299
+msgid "Flags"
+msgstr "Sinalizador"
+
+#: parted/parted.c:1352
+msgid "Free Space"
+msgstr ""
+
+#: parted/parted.c:1441
+#, c-format
+msgid ""
+"A %s %s partition was found at %s -> %s. Do you want to add it to the "
+"partition table?"
+msgstr ""
+
+#: parted/parted.c:1479
+#, fuzzy
+msgid "searching for file systems"
+msgstr "Tipo de sistema de ficheiros desconhecido."
+
+#: parted/parted.c:1684
+#, fuzzy
+msgid "New device?"
+msgstr "Nenhum dispositivo encontrado"
+
+#: parted/parted.c:1709
+msgid "Flag to Invert?"
+msgstr ""
+
+#: parted/parted.c:1714
+#, fuzzy
+msgid "New state?"
+msgstr "Tipo de rtulo de disco: %s\n"
+
+#: parted/parted.c:1747
+msgid "Unit?"
+msgstr ""
+
+#: parted/parted.c:1896
+msgid "check"
+msgstr "check"
+
+#: parted/parted.c:1899
+#, fuzzy
+msgid ""
+"check NUMBER do a simple check on the file system"
+msgstr ""
+"check MINOR faz um teste simples no sistema de ficheiros"
+
+#: parted/parted.c:1905
+msgid "cp"
+msgstr "cp"
+
+#: parted/parted.c:1908
+#, fuzzy
+msgid ""
+"cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another "
+"partition"
+msgstr ""
+"cp [FROM-DEVICE] FROM-MINOR TO-MINOR copia o sistema de ficheiros para "
+"outra partio"
+
+#: parted/parted.c:1914
+msgid "help"
+msgstr "help"
+
+#: parted/parted.c:1917
+#, fuzzy
+msgid ""
+"help [COMMAND] prints general help, or help on "
+"COMMAND"
+msgstr "help [COMANDO] mostra ajuda geral, ou ajuda a COMANDO"
+
+#: parted/parted.c:1923
+msgid "mklabel"
+msgstr "mklabel"
+
+#: parted/parted.c:1926
+#, fuzzy
+msgid ""
+"mklabel LABEL-TYPE create a new disklabel (partition "
+"table)"
+msgstr ""
+"mklabel TIPO-ROTULO cria um novo rtulo (na tabela de partio)"
+
+#: parted/parted.c:1932
+msgid "mkfs"
+msgstr "mkfs"
+
+#: parted/parted.c:1935
+#, fuzzy
+msgid ""
+"mkfs NUMBER FS-TYPE make a FS-TYPE file system on "
+"partititon NUMBER"
+msgstr ""
+"mkfs MINOR TIPO-FS cria um sistema TIPO-FS na partio MINOR"
+
+#: parted/parted.c:1941
+msgid "mkpart"
+msgstr "mkpart"
+
+#: parted/parted.c:1944
+#, fuzzy
+msgid "mkpart PART-TYPE [FS-TYPE] START END make a partition"
+msgstr "mkpart TIPO-PART [FS-TYPE] INICIO FIM cria uma partio"
+
+#: parted/parted.c:1950
+#, fuzzy
+msgid ""
+"mkpart makes a partition without creating a new file system on the "
+"partition. FS-TYPE may be specified to set an appropriate partition ID.\n"
+msgstr ""
+"mkpart cria uma partio sem criar um novo sistema de ficheiros na partio. "
+"TIPO-FS deve ser especificado para parties de dados (ao oposto de uma "
+"partio extendida). Este comando til se apagou acidentalmente uma "
+"partio.\n"
+
+#: parted/parted.c:1955
+msgid "mkpartfs"
+msgstr "mkpartfs"
+
+#: parted/parted.c:1958
+#, fuzzy
+msgid ""
+"mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system"
+msgstr "mkpartfs TIPO-PART TIPO-FS INICIO FIM cria uma partio TIPO-FS"
+
+#: parted/parted.c:1964
+msgid "move"
+msgstr "move"
+
+#: parted/parted.c:1967
+#, fuzzy
+msgid "move NUMBER START END move partition NUMBER"
+msgstr "move MINOR INICIO [FIM] redimensiona a partio MINOR"
+
+#: parted/parted.c:1972
+msgid "name"
+msgstr "name"
+
+#: parted/parted.c:1975
+#, fuzzy
+msgid "name NUMBER NAME name partition NUMBER as NAME"
+msgstr "name MINOR NAME renomeia a partio MINOR para NAME"
+
+#: parted/parted.c:1980
+msgid "print"
+msgstr "print"
+
+#: parted/parted.c:1983
+#, fuzzy
+msgid ""
+"print [free|NUMBER|all] display the partition table, a "
+"partition, or all devices"
+msgstr "print mostra a tabela de parties"
+
+#: parted/parted.c:1987
+msgid ""
+"Without arguments, print displays the entire partition table. With 'free'\n"
+"argument, information about free space will be displayed otherwise if a\n"
+"partition number is given, then more detailed information is displayed\n"
+"about that partition. If the 'all' argument is passed instead, partition\n"
+"information for all devices will be displayed."
+msgstr ""
+
+#: parted/parted.c:1995
+msgid "quit"
+msgstr "quit"
+
+#: parted/parted.c:1998
+#, fuzzy
+msgid "quit exit program"
+msgstr "quit sair do programa"
+
+#: parted/parted.c:2003
+#, fuzzy
+msgid "rescue"
+msgstr "resize"
+
+#: parted/parted.c:2006
+#, fuzzy
+msgid ""
+"rescue START END rescue a lost partition near START "
+"and END"
+msgstr "rm MINOR apaga a partio MINOR"
+
+#: parted/parted.c:2012
+msgid "resize"
+msgstr "resize"
+
+#: parted/parted.c:2015
+#, fuzzy
+msgid ""
+"resize NUMBER START END resize partition NUMBER and its "
+"file system"
+msgstr "resize MINOR INICIO FIM redimensiona a partio MINOR"
+
+#: parted/parted.c:2023
+msgid "rm"
+msgstr "rm"
+
+#: parted/parted.c:2026
+#, fuzzy
+msgid "rm NUMBER delete partition NUMBER"
+msgstr "rm MINOR apaga a partio MINOR"
+
+#: parted/parted.c:2031
+msgid "select"
+msgstr "select"
+
+#: parted/parted.c:2034
+#, fuzzy
+msgid "select DEVICE choose the device to edit"
+msgstr "select DEVICE selecciona o dispositivo a editar"
+
+#: parted/parted.c:2039
+msgid "set"
+msgstr "set"
+
+#: parted/parted.c:2042
+#, fuzzy
+msgid ""
+"set NUMBER FLAG STATE change the FLAG on partition NUMBER"
+msgstr "rm MINOR apaga a partio MINOR"
+
+#: parted/parted.c:2048
+msgid "toggle"
+msgstr ""
+
+#: parted/parted.c:2051
+#, fuzzy
+msgid ""
+"toggle [NUMBER [FLAG]] toggle the state of FLAG on "
+"partition NUMBER"
+msgstr "rm MINOR apaga a partio MINOR"
+
+#: parted/parted.c:2057
+#, fuzzy
+msgid "unit"
+msgstr "quit"
+
+#: parted/parted.c:2060
+#, fuzzy
+msgid "unit UNIT set the default unit to UNIT"
+msgstr "quit sair do programa"
+
+#: parted/parted.c:2065
+msgid "version"
+msgstr ""
+
+#: parted/parted.c:2068
+msgid ""
+"version displays the current version of GNU "
+"Parted and copyright information"
+msgstr ""
+
+#: parted/parted.c:2072
+msgid ""
+"version displays copyright and version information corressponding to this "
+"copy of GNU Parted\n"
+msgstr ""
+
+#: parted/parted.c:2158
+msgid "No device found"
+msgstr "Nenhum dispositivo encontrado"
+
+#: parted/parted.c:2222
+msgid "Don't forget to update /etc/fstab, if necessary.\n"
+msgstr ""
+
+#: parted/ui.c:68
+msgid "Welcome to GNU Parted! Type 'help' to view a list of commands.\n"
+msgstr ""
+
+#: parted/ui.c:71
+#, fuzzy
+msgid ""
+"Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]\n"
+"Apply COMMANDs with PARAMETERS to DEVICE. If no COMMAND(s) are given, run "
+"in\n"
+"interactive mode.\n"
+msgstr ""
+"Uso: parted [OPCOES]... [DISPOSITIVO [COMANDO [PARAMETROS]...]...]\n"
+"Aplica COMANDO com os PARAMETROS no DISPOSITIVO. Se no for dado nenhum\n"
+"COMANDO, executa em modo interactivo.\n"
+
+#: parted/ui.c:76
+#, c-format
+msgid ""
+"\n"
+"\n"
+"You found a bug in GNU Parted! Here's what you have to do:\n"
+"\n"
+"Don't panic! The bug has most likely not affected any of your data.\n"
+"Help us to fix this bug by doing the following:\n"
+"\n"
+"Check whether the bug has already been fixed by checking\n"
+"the last version of GNU Parted that you can find at:\n"
+"\n"
+"\thttp://ftp.gnu.org/gnu/parted/\n"
+"\n"
+"Please check this version prior to bug reporting.\n"
+"\n"
+"If this has not been fixed yet or if you don't know how to check,\n"
+"please visit the GNU Parted website:\n"
+"\n"
+"\thttp://www.gnu.org/software/parted\n"
+"\n"
+"for further information.\n"
+"\n"
+"Your report should contain the version of this release (%s)\n"
+"along with the error message below, the output of\n"
+"\n"
+"\tparted DEVICE unit co print unit s print\n"
+"\n"
+"and additional information about your setup you consider important.\n"
+msgstr ""
+
+#: parted/ui.c:230
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_MAPERR (Address not mapped to object)"
+msgstr ""
+
+#: parted/ui.c:235
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_ACCERR (Invalid permissions for mapped object)"
+msgstr ""
+
+#: parted/ui.c:240
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGSEGV signal was encountered."
+msgstr ""
+
+#: parted/ui.c:258
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTDIV (Integer: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:262
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTOVF (Integer: overflow)"
+msgstr ""
+
+#: parted/ui.c:266
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTDIV (Float: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:270
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTOVF (Float: overflow)"
+msgstr ""
+
+#: parted/ui.c:274
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTUND (Float: underflow)"
+msgstr ""
+
+#: parted/ui.c:278
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTRES (Float: inexact result)"
+msgstr ""
+
+#: parted/ui.c:282
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTINV (Float: invalid operation)"
+msgstr ""
+
+#: parted/ui.c:286
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTSUB (Float: subscript out of range)"
+msgstr ""
+
+#: parted/ui.c:291
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGFPE signal was encountered."
+msgstr ""
+
+#: parted/ui.c:310
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPC (Illegal Opcode)"
+msgstr ""
+
+#: parted/ui.c:314
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPN (Illegal Operand)"
+msgstr ""
+
+#: parted/ui.c:318
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLADR (Illegal addressing mode)"
+msgstr ""
+
+#: parted/ui.c:323
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLTRP (Illegal Trap)"
+msgstr ""
+
+#: parted/ui.c:327
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVOPC (Privileged Opcode)"
+msgstr ""
+
+#: parted/ui.c:331
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVREG (Privileged Register)"
+msgstr ""
+
+#: parted/ui.c:335
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_COPROC (Coprocessor Error)"
+msgstr ""
+
+#: parted/ui.c:339
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_BADSTK (Internal Stack Error)"
+msgstr ""
+
+#: parted/ui.c:343
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGILL signal was encountered."
+msgstr ""
+
+#: parted/ui.c:828
+#, fuzzy
+msgid "Expecting a partition number."
+msgstr "A partio destino est a ser utilizada."
+
+#: parted/ui.c:837
+msgid "Partition doesn't exist."
+msgstr "A partio no existe."
+
+#: parted/ui.c:857
+#, fuzzy
+msgid "Expecting a file system type."
+msgstr "Tipo de sistema de ficheiros desconhecido."
+
+#: parted/ui.c:863
+#, fuzzy, c-format
+msgid "Unknown file system type \"%s\"."
+msgstr "Tipo de sistema de ficheiros desconhecido."
+
+#: parted/ui.c:883
+msgid "Expecting a disk label type."
+msgstr ""
+
+#: parted/ui.c:977
+#, fuzzy
+msgid "Can't create any more partitions."
+msgstr "No posso adicionar outra partio."
+
+#: parted/ui.c:987
+#, fuzzy
+msgid "Expecting a partition type."
+msgstr "A partio destino no existe."
+
+#: parted/ui.c:1115
+msgid "on"
+msgstr "on"
+
+#: parted/ui.c:1116
+msgid "off"
+msgstr ""
+
+#: parted/ui.c:1227
+msgid "OPTIONs:"
+msgstr "OPES:"
+
+#: parted/ui.c:1230
+msgid "COMMANDs:"
+msgstr "COMANDOs:"
+
+#: parted/ui.c:1238
+#, fuzzy, c-format
+msgid "Using %s\n"
+msgstr ""
+"\n"
+"Usando %s\n"
+
+#, fuzzy
+#~ msgid ""
+#~ "This ext2 file system has a rather strange layout! Parted can't resize "
+#~ "this (yet)."
+#~ msgstr ""
+#~ "Este sistema de ficheiros ext2 tem uma aparncia muito estranha! Por "
+#~ "favor use o dumpe2fs neste sistema e envie-o para <buytenh@dsv.nl>. Eu "
+#~ "no vou redimension-lo, desculpe."
+
+#, fuzzy
+#~ msgid "Disk geometry for %s: %s - %s\n"
+#~ msgstr "Geometria de disco para %s: 0.000-%.3f megabytes\n"
+
+#, fuzzy
+#~ msgid "set NUMBER FLAG STATE change a flag on partition NUMBER"
+#~ msgstr "set MINOR FLAG ESTADO muda o sinalizador na partio MINOR"
+
+#, fuzzy
+#~ msgid ""
+#~ "The sector size on %s is %d bytes. Parted is known not to work properly "
+#~ "with drives with sector sizes other than %d bytes."
+#~ msgstr ""
+#~ "O tamanho do sector em %s %d bytes. O Parted conhecido por no "
+#~ "funcionar perfeitamente com discos com sectores diferentes de 512 bytes"
+
+#~ msgid ""
+#~ "You found a bug in GNU Parted. Please email a bug report to bug-"
+#~ "parted@gnu.org containing the version (%s), and the following message:\n"
+#~ msgstr ""
+#~ "Voc encontrou um bug no GNU parted. Por favor envie um relatrio para "
+#~ "bug-parted@gnu.org\n"
+#~ "contendo a verso (%s), e a mensagem abaixo:\n"
+
+#, fuzzy
+#~ msgid ""
+#~ "You requested to create a partition at %s - %s. The closest Parted can "
+#~ "manage is %s - %s."
+#~ msgstr ""
+#~ "Pretende criar uma partiao em %.3f-%.3fMb. O mais perto que se consegue "
+#~ "ser %3f-%.3fMb."
+
+#, fuzzy
+#~ msgid ""
+#~ "You requested to resize the partition to %s - %s. The closest Parted can "
+#~ "manage is %s - %s."
+#~ msgstr ""
+#~ "Pretende redimensionar a partiao para %.3f-%.3fMb. O mais perto que se "
+#~ "consegue ser %3f-%.3fMb"
+
+#~ msgid "File system has an invalid signature for a FAT file systems."
+#~ msgstr "Sistema de ficheiros tem uma assinatura invlida para um FAT."
+
+#~ msgid "Minor Start End "
+#~ msgstr "Minor Incio Fim "
+
+#~ msgid "Type "
+#~ msgstr "Tipo "
+
+#~ msgid "Filesystem "
+#~ msgstr "SistemaFich "
+
+#~ msgid "Name "
+#~ msgstr "Nome "
+
+#~ msgid "Device %s is neither a SCSI nor IDE drive."
+#~ msgstr "O dispositivo %s no um drive SCSI ou IDE."
+
+#~ msgid "Error reading %s (%s) to determine if partition is mounted."
+#~ msgstr "Erro lendo %s (%s) para determinar se a partio est montada."
+
+#~ msgid "Could not read geometry of %s - %s."
+#~ msgstr "No foi possvel ler a geometria de %s - %s"
+
+#~ msgid "Device %s has dodgey geometry."
+#~ msgstr "Dispositivo %s tem geometria estranha."
+
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. However, the most likely reason is that Linux "
+#~ "detected the BIOS geometry for %s incorrectly. GNU Parted suspects the "
+#~ "real geometry should be %d/%d/%d (not %d/%d/%d). You should check with "
+#~ "your BIOS first, as this may not be correct. You can inform Linux by "
+#~ "adding the parameter %s=%d,%d,%d to the command line. See the LILO or "
+#~ "GRUB documentation for more information. If you think Parted's suggested "
+#~ "geometry is correct, you may select Ignore to continue (and fix Linux "
+#~ "later). Otherwise, select Cancel (and fix Linux and/or the BIOS now)."
+#~ msgstr ""
+#~ "A tabela de parties em %s inconsistente. H vrias razes para isto "
+#~ "ocorrer. A mais certa seria o Linux detectar a geometria da BIOS para %s "
+#~ "incorretamente. O GNU Parted suspeita que a geometria real deveria ser %d/"
+#~ "%d/%d (e no %d/%d/%d). Dever vefificar a BIOS primeiro, pois isto pode "
+#~ "no estar correcto. Poder informar o Linux adicionando o parmetro %s=%d,"
+#~ "%d,%d na linha de comando. Veja a documentao do LILO ou GRUB para "
+#~ "maiores informaes. Se acha que a geometria sugeria pelo Parted a "
+#~ "correcta, pode selecionar Ignorar para continuar (e corrigir o Linux "
+#~ "depois). De outra maneira, seleccione Cancelar (e corrigir o Linux e/ou a "
+#~ "BIOS agora)."
+
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. Often, the reason is that Linux detected the "
+#~ "BIOS geometry incorrectly. However, this does not appear to be the case "
+#~ "here. It is safe to ignore,but ignoring may cause (fixable) problems "
+#~ "with some boot loaders, and may cause problems with FAT file systems. "
+#~ "Using LBA is recommended."
+#~ msgstr ""
+#~ "A tabela de parties em %s inconsistente. H vrias razes para isto "
+#~ "ocorrer. Muitas vezes, o Linux detecta a geometria da BIOS "
+#~ "incorretamente. Porm, isso no parece ser o caso aqui. seguro ignorar, "
+#~ "mas isso pode causar problemas (solucionveis) com alguns gestores de "
+#~ "boot."
+
+#~ msgid ""
+#~ "Unable to align partition properly. This probably means that another "
+#~ "partitioning tool generated an incorrect partition table, because it "
+#~ "didn't have the correct BIOS geometry. It is safe to ignore,but ignoring "
+#~ "may cause (fixable) problems with some boot loaders."
+#~ msgstr ""
+#~ "Impossvel alinhar a partio propriamente. Isso provavelmente significa "
+#~ "que outra ferramenta de particionamento gerou uma tabela de parties "
+#~ "incorreta porque no tinha a geometria na BIOS correta. seguro ignorar, "
+#~ "mas isto pode causar problemas (solucionveis) com alguns gestores de "
+#~ "boot."
+
+#~ msgid ""
+#~ " You have Windows FAT partition(s) that are not using LBA. If your BIOS "
+#~ "supports LBA, then you should switch to LBA by setting the LBA flag on "
+#~ "all FAT partitions. Otherwise, make sure the operating system and the "
+#~ "BIOS have the same geometry before resizing any FAT partitions."
+#~ msgstr ""
+#~ "Voc tem partioes FAT e nao esta a usar LBA. Se a sua BIOS suporta LBA "
+#~ "entao dever mudar todas as partioes FAT para essa opao. Caso "
+#~ "contrrio, certifique-se que o sistema operativo e a BIOS tm a mesma "
+#~ "geometria antes de fazer o redimensionamento de qualquer partiao FAT"
+
+#~ msgid ""
+#~ "The operating system thinks the geometry on %s is %d/%d/%d. Therefore, "
+#~ "cylinder 1024 ends at %.3fM.%s"
+#~ msgstr ""
+#~ "O sistema Operativo acha que a geometria de %s %d/%d/%d. Porm, o "
+#~ "cilindro 1024 termina em %.3fM%s. Voc devia verificar se isto est "
+#~ "correto com sua \"\"BIOS, antes de usar este programa."
+
+#~ msgid "The operating system thinks the geometry on %s is %d/%d/%d.%s"
+#~ msgstr "O Sistema Operativo detectou que a gemotria em %s %d/%d/%d.%s"
+
+#, fuzzy
+#~ msgid "Partition %s is being used."
+#~ msgstr "A partio est a ser utilizada."
+
+#~ msgid "START and END are in megabytes\n"
+#~ msgstr "INICIO e FIM so em megabytes\n"
+
+#~ msgid ""
+#~ "The FATs aren't big enough to describe all clusters! Each FAT is %d "
+#~ "sectors. There are %d clusters, which would require each FAT to be %d "
+#~ "sectors. This is REALLY weird. You might want to write us an email: bug-"
+#~ "parted@gnu.org"
+#~ msgstr ""
+#~ "As FATs no so grandes o suficiente para descrever todos os clusters! "
+#~ "Cada FAT tem %d sectores. Existem %d clusters, os quais requerem que cada "
+#~ "FAT tenha %d setores. Isto REALMENTE estranho. Voc pode querer "
+#~ "escrever um email: bug-parted@gnu.org"
+
+#~ msgid ""
+#~ "This swap partition is not compatible with Linux version 2.1.117 or "
+#~ "earlier. Use a smaller partition (maximum size 128mb) if you want to use "
+#~ "old versions of Linux."
+#~ msgstr ""
+#~ "Esta partio swap no compatvel com o Linux verso 2.1.117 ou "
+#~ "anterior. Utilize uma partio menor (mximo de 128mb) se quiser utilizar "
+#~ "verses antigas do Linux."
+
+#, fuzzy
+#~ msgid ""
+#~ "The new partition overlaps with another partition so badly that it isn't "
+#~ "obvious want you want!"
+#~ msgstr "A nova partio sobrepe alguma outra partio"
+
+#~ msgid "Can't grow a partition onto used space."
+#~ msgstr "No posso aumentar a partio acima de espao j utilizado."
+
+#~ msgid ""
+#~ "The kernel was unable to re-read your partition table, so you need to "
+#~ "reboot before mounting any modified partitions. You also need to "
+#~ "reinstall your boot loader before you reboot (which may require mounting "
+#~ "modified partitions). It is impossible do both things! So you'll need "
+#~ "to boot off a rescue disk, and reinstall your boot loader from the rescue "
+#~ "disk. Read section 4 of the Parted User documentation for more "
+#~ "information."
+#~ msgstr ""
+#~ "O kernel no pde reler sua tabela de parties, portanto precisa de "
+#~ "reiniciar antes de montar qualquer partio modificada. Voce pode tambm "
+#~ "precisar reinstalar seu gestor de boot antes de reinicializar (o que pode "
+#~ "requerer a montagem das parties modificadas). impossvel fazer as "
+#~ "duas coisas! Leia a seco 4 da documentao do usurio do Parted para "
+#~ "mais informaes."
+
+#~ msgid ""
+#~ "The kernel was unable to re-read the partition table on %s (%s). This "
+#~ "means Linux knows nothing about any modifications you made. You should "
+#~ "reboot your computer before doing anything with %s."
+#~ msgstr ""
+#~ "O kernel no conseguiu reler a tabela de parties de %s (%s). Isto "
+#~ "significa que o Linux no sabe nada sobre as modificaes que fez. Dever "
+#~ "reinicializar seu computador antes de fazer qualquer uso de %s."
+
+#~ msgid "Insane! %d clusters!"
+#~ msgstr "Estranho! %d clusters!"
+
+#~ msgid ""
+#~ "File system doesn't have expected sizes for Windows to like it. Number "
+#~ "of clusters is %d (%d expected); size of FATs is %d sectors (%d expected)."
+#~ msgstr ""
+#~ "O sistema de ficheiros no tem o tamanho esperado para que o Windows o "
+#~ "utilize. O tamanho do cluster %dk (%dk esperado); tamanho da FAT %d "
+#~ "sectores (%d esperado)."
+
+#~ msgid "No get_resize_constraint for %s!"
+#~ msgstr "No h get_resize_constraint para %s!"
+
+#~ msgid ""
+#~ "The filesystem is going to be too big for FAT16, so FAT32 will be used. "
+#~ "This is not compatible with MS-DOS, early versions of MS-Windows 95 and "
+#~ "Windows NT. If you use these operating systems, then select cancel, and "
+#~ "create a smaller partition. If you only use Linux, BSD, MS Windows 98 "
+#~ "and/or MS Windows 95 B, then select OK."
+#~ msgstr ""
+#~ "O sistema de ficheiros ser muito grande para FAT16, o melhor ser usar "
+#~ "FAT32. Isto no compatvel com o MS-DOS, verses antigas do MS-Windows "
+#~ "95 e Windows NT. Se utiliza estes sistemas operativos, selecione "
+#~ "cancelar, e crie uma partio menor. Se utiliza somente Linux, BSD, MS-"
+#~ "Windows 98 e/ou MS-Windows 95 B, ento selecione OK."
+
+#~ msgid "Weird: fat_calc_sizes() failed for FAT32!"
+#~ msgstr "Estranho: fat_calc_sizes() falhou para a FAT32!"
+
+#~ msgid ""
+#~ "Would you like to use FAT32 for this filesystem? It is much more "
+#~ "efficient with your disk space, but is not compatible with early versions "
+#~ "of Windows 95 and Windows NT. Only select yes if you only use Linux, "
+#~ "BSD, MS Windows 98 and/or MS Windows 95 B."
+#~ msgstr ""
+#~ "Voc gostaria de usar a FAT32 para este sistema de ficheiros? muito "
+#~ "mais eficiente com o espao em disco, mas no compatvel com verses "
+#~ "antigas do Windows 95 e Windows NT. Seleccione SIM se voc s utilizar "
+#~ "Linux, BSD, MS-Windows 98 e/ou MS-Windows 95 B."
+
+#~ msgid "The %s file system code doesn't support %s disk labels."
+#~ msgstr ""
+#~ "O cdigo do sistema de ficheiros %s no suporta rtulos de disco %s."
+
+#~ msgid "Can't set non-Linux partitions as a root device."
+#~ msgstr "No posso configurar parties no Linux como uma partio root."
+
+#~ msgid "Can't set non-Linux partitions as a swap device."
+#~ msgstr ""
+#~ "No posso configurar parties no nao sejam Linux como uma partio swap."
+
+#~ msgid "Linux-swap partitions can not be hidden on msdos disk labels."
+#~ msgstr ""
+#~ "Parties Linux-swap no podem ser escondidas em rtulos de disco msdos."
+
+#~ msgid "Linux-swap partitions can not be bootable on pc98 disk labels."
+#~ msgstr ""
+#~ "Parties Linux-swap no podem ser inicializveis em rtulos de disco "
+#~ "pc98."
+
+#~ msgid "HFS partitions can't be hidden on msdos disk labels."
+#~ msgstr "Parties HFS no podem ser escondidas em rtulos de disco msdos."
+
+#~ msgid "JFS partitions can't be hidden on msdos disk labels."
+#~ msgstr "Parties JHS no podem ser escondidas em rtulos de disco msdos."
+
+#~ msgid "XFS partitions can't be hidden on msdos disk labels."
+#~ msgstr "Parties XFS no podem ser escondidas em rtulos de disco msdos."
+
+#~ msgid "unknown"
+#~ msgstr "desconhecido"
+
+#~ msgid "Unknown SCSI"
+#~ msgstr "SCSI desconhecido"
+
+#~ msgid "GUID Partition Table Header Signature is wrong: "
+#~ msgstr "A GUID no cabealho da tabela de partio est incorrecta: "
+
+#~ msgid " should be "
+#~ msgstr " Deveria ser"
+
+#~ msgid "Creating new %s disklabels is not implemented yet."
+#~ msgstr "Criao de novos rtulos %s no est implementado ainda."
+
+#~ msgid "The code to write the partition table hasn't been written for %s yet"
+#~ msgstr ""
+#~ "O cdigo para escrever a tabela de parties ainda no foi escrito para %"
+#~ "s."
+
+#~ msgid ""
+#~ "Partition size (%ld sectors) and filesystem size (%ld sectors) do not "
+#~ "match."
+#~ msgstr ""
+#~ "Tamanho da partio (%ld sectores) e tamanho do sistema de ficheiros (%ld "
+#~ "sectores) no coincidem."
+
+#~ msgid "Reiserfs partitions can't be hidden on msdos disk labels."
+#~ msgstr ""
+#~ "Parties Reiserfs no podem ser escondidas em rtulos de disco msdos."
+
+#~ msgid "Reiserfs partitions must be bootable on pc98 disk labels."
+#~ msgstr ""
+#~ "Parties Reiserfs no podem ser inicializveis em rtulos de disco pc98."
diff --git a/po/pt_BR.po b/po/pt_BR.po
new file mode 100644
index 0000000..bb460c6
--- /dev/null
+++ b/po/pt_BR.po
@@ -0,0 +1,2689 @@
+# Brazilian portuguese messages for GNU parted.
+# Copyright (C) 1999 Free Software Foundation, Inc.
+# Eliphas Levy Theodoro <eliphas@conectiva.com>, 1999.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU parted 1.4.21\n"
+"Report-Msgid-Bugs-To: bug-parted@gnu.org\n"
+"POT-Creation-Date: 2006-04-21 21:20+0200\n"
+"PO-Revision-Date: 2001-11-21 09:10-0300\n"
+"Last-Translator: Eliphas Levy Theodoro <eliphas@f2s.com>\n"
+"Language-Team: Brazilian Portuguese <ldp-br@bazar.conectiva.com.br>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: libparted/arch/linux.c:284
+#, c-format
+msgid "Could not stat device %s - %s."
+msgstr "No foi possvel obter status do dispositivo %s - %s."
+
+#: libparted/arch/linux.c:390
+#, c-format
+msgid ""
+"Could not determine sector size for %s: %s.\n"
+"Using the default sector size (%lld)."
+msgstr ""
+
+#: libparted/arch/linux.c:401
+#, c-format
+msgid ""
+"Device %s has a logical sector size of %lld. Not all parts of GNU Parted "
+"support this at the moment, and the working code is HIGHLY EXPERIMENTAL.\n"
+msgstr ""
+
+#: libparted/arch/linux.c:441
+#, fuzzy, c-format
+msgid "Unable to determine the size of %s (%s)."
+msgstr "Impossvel determinar tamanho de %s (%s)"
+
+#: libparted/arch/linux.c:530
+#, c-format
+msgid "Could not get identity of device %s - %s"
+msgstr "No foi possvel obter a identificao do dispositivo %s - %s"
+
+#: libparted/arch/linux.c:539
+msgid "Generic IDE"
+msgstr ""
+
+#: libparted/arch/linux.c:556
+#, c-format
+msgid ""
+"Device %s has multiple (%d) logical sectors per physical sector.\n"
+"GNU Parted supports this EXPERIMENTALLY for some special disk label/file "
+"system combinations, e.g. GPT and ext2/3.\n"
+"Please consult the web site for up-to-date information."
+msgstr ""
+
+#: libparted/arch/linux.c:726
+#, c-format
+msgid "Error initialising SCSI device %s - %s"
+msgstr "Erro inicializando dispositivo SCSI %s - %s"
+
+#: libparted/arch/linux.c:781
+#, c-format
+msgid ""
+"The device %s has zero length, and can't possibly store a file system or "
+"partition table. Perhaps you selected the wrong device?"
+msgstr ""
+
+#: libparted/arch/linux.c:829
+msgid ""
+"Unable to determine geometry of file/device. You should not use Parted "
+"unless you REALLY know what you're doing!"
+msgstr ""
+"Impossvel determinar a geometria do arquivo/dispositivo. Voc no deveria "
+"utilizar o Parted a no ser que voc REALMENTE saiba o que est fazendo!"
+
+#: libparted/arch/linux.c:903
+msgid "DAC960 RAID controller"
+msgstr "Controlador RAID DAC960"
+
+#: libparted/arch/linux.c:908
+msgid "Compaq Smart Array"
+msgstr "Compaq Smart Array"
+
+#: libparted/arch/linux.c:913
+msgid "ATARAID Controller"
+msgstr "Controlador ATARAID"
+
+#: libparted/arch/linux.c:918
+msgid "I2O Controller"
+msgstr "Controlador I2O"
+
+#: libparted/arch/linux.c:923
+msgid "User-Mode Linux UBD"
+msgstr ""
+
+#: libparted/arch/linux.c:933
+msgid "Unknown"
+msgstr "Desconhecido"
+
+#: libparted/arch/linux.c:940
+msgid "ped_device_new() Unsupported device type"
+msgstr "ped_device_new() Tipo de dispositivo no suportado"
+
+#: libparted/arch/linux.c:1041 libparted/arch/gnu.c:264
+#, c-format
+msgid "Error opening %s: %s"
+msgstr "Erro abrindo %s: %s"
+
+#: libparted/arch/linux.c:1052 libparted/arch/gnu.c:274
+#, c-format
+msgid "Unable to open %s read-write (%s). %s has been opened read-only."
+msgstr ""
+"No posso abrir %s para leitura-gravao (%s). %s foi aberto somente-leitura."
+
+#: libparted/arch/linux.c:1160 libparted/arch/linux.c:1228
+#: libparted/arch/gnu.c:452 libparted/arch/gnu.c:550 libparted/arch/gnu.c:678
+#, c-format
+msgid "%s during read on %s"
+msgstr "%s durante leitura em %s"
+
+#: libparted/arch/linux.c:1199
+#, c-format
+msgid "%s during seek for read on %s"
+msgstr "%s durante procura para leitura em %s"
+
+#: libparted/arch/linux.c:1270 libparted/arch/linux.c:1355
+#: libparted/arch/linux.c:1413 libparted/arch/gnu.c:587
+#: libparted/arch/gnu.c:632 libparted/arch/gnu.c:709
+#, c-format
+msgid "%s during write on %s"
+msgstr "%s durante escrita em %s"
+
+#: libparted/arch/linux.c:1297 libparted/arch/gnu.c:512
+#, c-format
+msgid "Can't write to %s, because it is opened read-only."
+msgstr "No posso gravar em %s, pois ela foi aberta como somente-leitura."
+
+#: libparted/arch/linux.c:1321
+#, c-format
+msgid "%s during seek for write on %s"
+msgstr "%s durante procura para escrita em %s"
+
+#: libparted/arch/linux.c:1798
+#, fuzzy, c-format
+msgid ""
+"Error informing the kernel about modifications to partition %s -- %s. This "
+"means Linux won't know about any changes you made to %s until you reboot -- "
+"so you shouldn't mount it or use it in any way before rebooting."
+msgstr ""
+"O kernel no conseguiu reler a tabela de parties de %s (%s). Isto "
+"significa que o Linux no sabe nada sobre as modificaes que voc fez. Voc "
+"deve reinicializar seu computador antes de fazer qualquer uso de %s."
+
+#: libparted/arch/linux.c:1879
+#, fuzzy, c-format
+msgid ""
+"The kernel was unable to re-read the partition table on %s (%s). This means "
+"Linux won't know anything about the modifications you made until you "
+"reboot. You should reboot your computer before doing anything with %s."
+msgstr ""
+"O kernel no conseguiu reler a tabela de parties de %s (%s). Isto "
+"significa que o Linux no sabe nada sobre as modificaes que voc fez. Voc "
+"deve reinicializar seu computador antes de fazer qualquer uso de %s."
+
+#: libparted/arch/gnu.c:97
+#, c-format
+msgid "Unable to open %s."
+msgstr ""
+
+#: libparted/arch/gnu.c:117
+#, fuzzy
+msgid "Unable to probe store."
+msgstr "Impossvel alinhar a partio."
+
+#: libparted/arch/gnu.c:355
+#, fuzzy
+msgid ""
+"The partition table cannot be re-read. This means you need to reboot before "
+"mounting any modified partitions. You also need to reinstall your boot "
+"loader before you reboot (which may require mounting modified partitions). "
+"It is impossible do both things! So you'll need to boot off a rescue disk, "
+"and reinstall your boot loader from the rescue disk. Read section 4 of the "
+"Parted User documentation for more information."
+msgstr ""
+"O kernel no pde reler sua tabela de parties, ento voc precisa "
+"reiniciar antes de montar qualquer partio modificada. Voce pode tambm "
+"precisar reinstalar seu gerenciador de boot antes de reinicializar (o que "
+"pode requerer a montagem das parties modificadas). impossvel fazer as "
+"duas coisas! Ento voc ir precisar inicializar por um disco de resgate, e "
+"reinstalar seu gerenciador de boot desde este disco. Leia a seo 4 da "
+"documentao do usurio do Parted para mais informaes."
+
+#: libparted/arch/gnu.c:372
+#, fuzzy, c-format
+msgid ""
+"The partition table on %s cannot be re-read (%s). This means the Hurd knows "
+"nothing about any modifications you made. You should reboot your computer "
+"before doing anything with %s."
+msgstr ""
+"O kernel no conseguiu reler a tabela de parties de %s (%s). Isto "
+"significa que o Linux no sabe nada sobre as modificaes que voc fez. Voc "
+"deve reinicializar seu computador antes de fazer qualquer uso de %s."
+
+#: libparted/arch/gnu.c:383 parted/parted.c:2215
+msgid ""
+"You should reinstall your boot loader before rebooting. Read section 4 of "
+"the Parted User documentation for more information."
+msgstr ""
+"Voc deve reinstalar seu gerenciador de boot antes de reinicializar. Leia a "
+"seo 4 da documentao do usurio do Parted para mais informaes."
+
+#: libparted/arch/gnu.c:774
+#, c-format
+msgid "%s trying to sync %s to disk"
+msgstr ""
+
+#: libparted/disk.c:183
+#, c-format
+msgid "Unable to open %s - unrecognised disk label."
+msgstr "Impossvel abrir %s - rtulo de disco desconhecido."
+
+#: libparted/disk.c:452
+#, fuzzy, c-format
+msgid ""
+"This libparted doesn't have write support for %s. Perhaps it was compiled "
+"read-only."
+msgstr "No posso gravar em %s, pois ela foi aberta como somente-leitura."
+
+#: libparted/disk.c:579
+#, fuzzy, c-format
+msgid "Partition %d is %s, but the file system is %s."
+msgstr "A partio muito pequena para um sistema de arquivos FAT"
+
+#: libparted/disk.c:1056
+#, c-format
+msgid "%s disk labels do not support extended partitions."
+msgstr "Rtulos de disco %s no suportam parties extendidas."
+
+#: libparted/disk.c:1616
+#, c-format
+msgid "%s disk labels don't support logical or extended partitions."
+msgstr "Rtulos de disco %s no suportam parties lgicas ou extendidas."
+
+#: libparted/disk.c:1629
+#, fuzzy
+msgid "Too many primary partitions."
+msgstr "Muitas pginas invlidas."
+
+#: libparted/disk.c:1638
+#, c-format
+msgid ""
+"Can't add a logical partition to %s, because there is no extended partition."
+msgstr ""
+"No posso adicionar uma partio lgica em %s, pois no h uma partio "
+"extendida."
+
+#: libparted/disk.c:1662
+#, fuzzy, c-format
+msgid "Can't have more than one extended partition on %s."
+msgstr "No se pode haver mais de uma partio extendida em %s"
+
+#: libparted/disk.c:1672
+#, fuzzy
+msgid "Can't have logical partitions outside of the extended partition."
+msgstr ""
+"No posso adicionar uma partio lgica fora da partio extendida em %s."
+
+#: libparted/disk.c:1697
+#, fuzzy, c-format
+msgid "Can't have a logical partition outside of the extended partition on %s."
+msgstr ""
+"No posso adicionar uma partio lgica fora da partio extendida em %s."
+
+#: libparted/disk.c:1707 libparted/disk.c:1761 libparted/disk.c:1927
+#, fuzzy
+msgid "Can't have overlapping partitions."
+msgstr "No posso copiar em uma partio sobreposta."
+
+#: libparted/disk.c:1715
+#, fuzzy
+msgid "Can't have a primary partition inside an extended partition."
+msgstr "No posso adicionar uma partio primria dentro de uma extendida."
+
+#: libparted/disk.c:2123
+msgid "metadata"
+msgstr "metadado"
+
+#: libparted/disk.c:2125
+msgid "free"
+msgstr "livre"
+
+#: libparted/disk.c:2127 parted/ui.c:968 parted/ui.c:996
+msgid "extended"
+msgstr "extendida"
+
+#: libparted/disk.c:2129 parted/ui.c:972 parted/ui.c:1000
+msgid "logical"
+msgstr "lgica"
+
+#: libparted/disk.c:2131 parted/ui.c:964 parted/ui.c:992
+msgid "primary"
+msgstr "primria"
+
+#: libparted/disk.c:2147
+msgid "boot"
+msgstr "boot"
+
+#: libparted/disk.c:2149
+msgid "root"
+msgstr "root"
+
+#: libparted/disk.c:2151
+msgid "swap"
+msgstr "swap"
+
+#: libparted/disk.c:2153
+msgid "hidden"
+msgstr "escondida"
+
+#: libparted/disk.c:2155
+msgid "raid"
+msgstr "raid"
+
+#: libparted/disk.c:2157
+msgid "lvm"
+msgstr "lvm"
+
+#: libparted/disk.c:2159
+msgid "lba"
+msgstr "lba"
+
+#: libparted/disk.c:2161
+msgid "hp-service"
+msgstr ""
+
+#: libparted/disk.c:2163
+msgid "palo"
+msgstr ""
+
+#: libparted/disk.c:2165
+#, fuzzy
+msgid "prep"
+msgstr "boot"
+
+#: libparted/disk.c:2167
+msgid "msftres"
+msgstr ""
+
+#: libparted/disk.c:2173
+#, fuzzy, c-format
+msgid "Unknown partition flag, %d."
+msgstr "Sinalizador de partio desconhecido, %d."
+
+#: libparted/labels/rdb.c:177
+#, c-format
+msgid "%s : Bad checksum on block %llu of type %s."
+msgstr ""
+
+#: libparted/labels/rdb.c:510
+#, c-format
+msgid "%s : Didn't find rdb block, should never happen."
+msgstr ""
+
+#: libparted/labels/rdb.c:595
+#, c-format
+msgid "%s : Loop detected at block %d."
+msgstr ""
+
+#: libparted/labels/rdb.c:614
+#, c-format
+msgid "%s : The %s list seems bad at block %s."
+msgstr ""
+
+#: libparted/labels/rdb.c:703
+#, c-format
+msgid "%s : Failed to list bad blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:711
+#, c-format
+msgid "%s : Failed to list partition blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:719
+#, c-format
+msgid "%s : Failed to list file system blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:727
+#, c-format
+msgid "%s : Failed to list boot blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:750
+#, fuzzy, c-format
+msgid "Failed to write partition block at %d."
+msgstr "Impossvel determinar se a partio est montada."
+
+#: libparted/labels/rdb.c:1053 libparted/labels/bsd.c:505
+#: libparted/labels/dos.c:1942 libparted/labels/dvh.c:772
+#: libparted/labels/gpt.c:1365 libparted/labels/loop.c:251
+#: libparted/labels/mac.c:1318 libparted/labels/pc98.c:764
+#: libparted/labels/sun.c:704
+#, fuzzy
+msgid "Unable to satisfy all constraints on the partition."
+msgstr "Impossvel alinhar a partio."
+
+#: libparted/labels/rdb.c:1081
+#, fuzzy
+msgid "Unable to allocate a partition number."
+msgstr "A partio destino est sendo utilizada."
+
+#: libparted/labels/bsd.c:530
+#, fuzzy
+msgid "Unable to allocate a bsd disklabel slot."
+msgstr "Impossvel alocar um slot de rtulo de disco bsd"
+
+#: libparted/labels/dos.c:812
+#, fuzzy, c-format
+msgid "Invalid partition table on %s -- wrong signature %x."
+msgstr "Tabela de parties invlida em %s - assinatura errada %x"
+
+#: libparted/labels/dos.c:840
+#, c-format
+msgid "Invalid partition table - recursive partition on %s."
+msgstr "Tabela de parties invlida - partio recursiva em %s."
+
+#: libparted/labels/dos.c:1300
+#, fuzzy
+msgid "Extended partitions cannot be hidden on msdos disk labels."
+msgstr "Parties ext2 no podem ser escondidas em rtulos de disco msdos."
+
+#: libparted/labels/dos.c:1926
+msgid "Parted can't resize partitions managed by Windows Dynamic Disk."
+msgstr ""
+
+#: libparted/labels/dvh.c:192
+#, fuzzy, c-format
+msgid "%s has no extended partition (volume header partition)."
+msgstr ""
+"No posso redimensionar uma partio extendida, sem excluir uma partio "
+"lgica."
+
+#: libparted/labels/dvh.c:315
+msgid "Checksum is wrong, indicating the partition table is corrupt."
+msgstr ""
+
+#: libparted/labels/dvh.c:616
+#, fuzzy
+msgid "Only primary partitions can be root partitions."
+msgstr "No posso adicionar uma partio primria dentro de uma extendida."
+
+#: libparted/labels/dvh.c:630
+#, fuzzy
+msgid "Only primary partitions can be swap partitions."
+msgstr "No posso adicionar uma partio primria dentro de uma extendida."
+
+#: libparted/labels/dvh.c:644
+msgid "Only logical partitions can be a boot file."
+msgstr ""
+
+#: libparted/labels/dvh.c:723
+msgid "Only logical partitions (boot files) have a name."
+msgstr ""
+
+#: libparted/labels/dvh.c:814
+#, fuzzy
+msgid "Too many primary partitions"
+msgstr "Muitas pginas invlidas."
+
+#: libparted/labels/gpt.c:433
+#, c-format
+msgid ""
+"%s contains GPT signatures, indicating that it has a GPT table. However, it "
+"does not have a valid fake msdos partition table, as it should. Perhaps it "
+"was corrupted -- possibly by a program that doesn't understand GPT partition "
+"tables. Or perhaps you deleted the GPT table, and are now using an msdos "
+"partition table. Is this a GPT partition table?"
+msgstr ""
+
+#: libparted/labels/gpt.c:625
+#, c-format
+msgid ""
+"The format of the GPT partition table is version %x, which is newer than "
+"what Parted can recognise. Please tell us! bug-parted@gnu.org"
+msgstr ""
+
+#: libparted/labels/gpt.c:747
+msgid ""
+"The backup GPT table is not at the end of the disk, as it should be. This "
+"might mean that another operating system believes the disk is smaller. Fix, "
+"by moving the backup to the end (and removing the old backup)?"
+msgstr ""
+
+#: libparted/labels/gpt.c:782
+msgid ""
+"The primary GPT table is corrupt, but the backup appears OK, so that will be "
+"used."
+msgstr ""
+
+#: libparted/labels/gpt.c:790
+msgid ""
+"Both the primary and backup GPT tables are corrupt. Try making a fresh "
+"table, and using Parted's rescue feature to recover partitions."
+msgstr ""
+
+#: libparted/labels/mac.c:167
+#, c-format
+msgid "Invalid signature %x for Mac disk labels."
+msgstr "Assinatura invlida %x para rtulos de disco Mac."
+
+#: libparted/labels/mac.c:212
+msgid "Partition map has no partition map entry!"
+msgstr "Mapa de parties no tem nenhuma entrada!"
+
+#: libparted/labels/mac.c:259
+#, c-format
+msgid "%s is too small for a Mac disk label!"
+msgstr "%s muito pequeno para um rtulo de disco Mac!"
+
+#: libparted/labels/mac.c:490
+#, c-format
+msgid "Partition %d has an invalid signature %x."
+msgstr "A partio %d tem uma assinatura invlida %x."
+
+#: libparted/labels/mac.c:508
+#, c-format
+msgid "Partition %d has an invalid length of 0 bytes!"
+msgstr "A partio %d tem um tamanho invlido de 0 bytes!"
+
+#: libparted/labels/mac.c:536
+#, fuzzy
+msgid "The data region doesn't start at the start of the partition."
+msgstr "A regio de dados no comea no incio da partio"
+
+#: libparted/labels/mac.c:553
+#, fuzzy
+msgid "The boot region doesn't start at the start of the partition."
+msgstr "A regio de inicializao no comea no incio da partio"
+
+#: libparted/labels/mac.c:567
+msgid "The partition's boot region doesn't occupy the entire partition."
+msgstr "A regio de inicializao da partio no a ocupa inteiramente."
+
+#: libparted/labels/mac.c:577
+msgid "The partition's data region doesn't occupy the entire partition."
+msgstr "A regio de dados da partio no a ocupa inteiramente."
+
+#: libparted/labels/mac.c:631
+#, c-format
+msgid ""
+"Weird block size on device descriptor: %d bytes is not divisible by 512."
+msgstr ""
+"tamanho de bloco estranho no descritor de dispositivo: %d bytes no "
+"sodivisveis por 512."
+
+#: libparted/labels/mac.c:644
+#, c-format
+msgid ""
+"The driver descriptor says the physical block size is %d bytes, but Linux "
+"says it is %d bytes."
+msgstr ""
+"O descritor do driver informa que o tamanho fsico de bloco %d bytes, mas "
+"o Linux informa que %d bytes."
+
+#: libparted/labels/mac.c:692
+msgid "No valid partition map found."
+msgstr "Nenhum mapa de parties vlido foi encontrado."
+
+#: libparted/labels/mac.c:744
+#, fuzzy, c-format
+msgid ""
+"Conflicting partition map entry sizes! Entry 1 says it is %d, but entry %d "
+"says it is %d!"
+msgstr ""
+"Tamanhos de mapa de partio conflitantes! Entrada 1 informa que %d, mas "
+"entrada %d informa que %d!"
+
+#: libparted/labels/mac.c:771
+#, fuzzy
+msgid "Weird! There are 2 partitions map entries!"
+msgstr "Estranho - 2 entradas no mapa de partio"
+
+#: libparted/labels/mac.c:1257
+msgid ""
+"Changing the name of a root or swap partition will prevent Linux from "
+"recognising it as such."
+msgstr ""
+"Mudar o nome de uma partio root ou swap ir impedir o Linux de reconhec-"
+"la como tal."
+
+#: libparted/labels/mac.c:1353
+#, fuzzy
+msgid "Can't add another partition -- the partition map is too small!"
+msgstr ""
+"No posso adicionar outra partio - o mapa de parties muito pequeno!"
+
+#: libparted/labels/pc98.c:357
+#, fuzzy, c-format
+msgid "Invalid partition table on %s."
+msgstr "Tabela de parties invlida em %s"
+
+#: libparted/labels/pc98.c:409 libparted/labels/pc98.c:487
+#, fuzzy, c-format
+msgid ""
+"Partition %d isn't aligned to cylinder boundaries. This is still "
+"unsupported."
+msgstr ""
+"A partio %d no est alinhada ao limite do cilindro. Preciso adicionar "
+"suporte para isso."
+
+#: libparted/labels/pc98.c:796
+msgid "Can't add another partition."
+msgstr "No posso adicionar outra partio."
+
+#: libparted/labels/sun.c:143
+msgid "Corrupted Sun disk label detected."
+msgstr "Um rtulo de disco Sun corrompido foi detectado."
+
+#: libparted/labels/sun.c:264
+#, fuzzy, c-format
+msgid ""
+"The disk CHS geometry (%d,%d,%d) reported by the operating system does not "
+"match the geometry stored on the disk label (%d,%d,%d)."
+msgstr ""
+"A geometria CHS do disco (%d,%d,%d) no confere com a geometria gravada no "
+"rtulo de disco (%d,%d,%d)."
+
+#: libparted/labels/sun.c:286
+#, c-format
+msgid "The disk label describes a disk bigger than %s."
+msgstr "O rtulo de disco descreve um disco maior que %s."
+
+#: libparted/labels/sun.c:440
+#, c-format
+msgid "The disk has %d cylinders, which is greater than the maximum of 65536."
+msgstr ""
+
+#: libparted/labels/sun.c:736
+msgid ""
+"The Whole Disk partition is the only available one left. Generally, it is "
+"not a good idea to overwrite this partition with a real one. Solaris may "
+"not be able to boot without it, and SILO (the sparc boot loader) appreciates "
+"it as well."
+msgstr ""
+
+#: libparted/labels/sun.c:751
+msgid "Sun disk label is full."
+msgstr "O rtulo de disco Sun est cheio."
+
+#: libparted/filesys.c:386
+msgid "Could not detect file system."
+msgstr "No foi possvel detectar o sistema de arquivos."
+
+#: libparted/filesys.c:397
+#, fuzzy
+msgid "The file system is bigger than its volume!"
+msgstr "O rtulo de disco descreve um disco maior que %s."
+
+#: libparted/filesys.c:405
+#, c-format
+msgid "Support for opening %s file systems is not implemented yet."
+msgstr ""
+"O suporte para abrir sistema de arquivos %s no foi implementado ainda."
+
+#: libparted/filesys.c:447
+#, c-format
+msgid "Support for creating %s file systems is not implemented yet."
+msgstr ""
+"O suporte para criar sistema de arquivos %s no foi implementado ainda."
+
+#: libparted/filesys.c:508
+#, c-format
+msgid "Support for checking %s file systems is not implemented yet."
+msgstr "Suporte para checar sistema de arquivos no implementado para %s."
+
+#: libparted/filesys.c:574
+msgid "raw block copying"
+msgstr ""
+
+#: libparted/filesys.c:585
+#, fuzzy
+msgid "growing file system"
+msgstr "Tipo de sistema de arquivos desconhecido."
+
+#: libparted/filesys.c:625
+msgid "Can't copy onto an overlapping partition."
+msgstr "No posso copiar em uma partio sobreposta."
+
+#: libparted/filesys.c:647
+#, fuzzy, c-format
+msgid ""
+"Direct support for copying file systems is not yet implemented for %s. "
+"However, support for resizing is implemented. Therefore, the file system "
+"can be copied if the new partition is at least as big as the old one. So, "
+"either shrink the partition you are trying to copy, or copy to a bigger "
+"partition."
+msgstr ""
+"O suporte direto para cpia de sistemas de arquivos no est implementado "
+"para %s. Entretanto, o suporte para redimensionamento est. Portanto, o "
+"sistema de arquivos pode ser copiado se a nova partio for pelo menos to "
+"grande quanto a antiga. Ento, diminua a partio que voc est tentando "
+"copiar, ou copie para uma partio maior."
+
+#: libparted/filesys.c:661
+#, c-format
+msgid "Support for copying %s file systems is not implemented yet."
+msgstr "Suporte para copiar sistema de arquivos no implementado para %s."
+
+#: libparted/filesys.c:699
+#, c-format
+msgid "Support for resizing %s file systems is not implemented yet."
+msgstr ""
+"Suporte para redimensionar sistema de arquivos no implementado para %s."
+
+#: libparted/exception.c:78
+msgid "Information"
+msgstr "Informao"
+
+#: libparted/exception.c:79
+msgid "Warning"
+msgstr "Aviso"
+
+#: libparted/exception.c:80
+msgid "Error"
+msgstr "Erro"
+
+#: libparted/exception.c:81
+msgid "Fatal"
+msgstr "Fatal"
+
+#: libparted/exception.c:82
+msgid "Bug"
+msgstr "Bug"
+
+#: libparted/exception.c:83
+msgid "No Implementation"
+msgstr "Sem Implementao"
+
+#: libparted/exception.c:87
+msgid "Fix"
+msgstr "Arrumar"
+
+#: libparted/exception.c:88
+msgid "Yes"
+msgstr "Sim"
+
+#: libparted/exception.c:89
+msgid "No"
+msgstr "No"
+
+#: libparted/exception.c:90
+msgid "OK"
+msgstr "OK"
+
+#: libparted/exception.c:91
+msgid "Retry"
+msgstr "Repetir"
+
+#: libparted/exception.c:92
+msgid "Ignore"
+msgstr "Ignorar"
+
+#: libparted/exception.c:93
+msgid "Cancel"
+msgstr "Cancelar"
+
+#: libparted/exception.c:133
+#, fuzzy, c-format
+msgid ""
+"A bug has been detected in GNU Parted. Refer to the web site of parted "
+"http://www.gnu.org/software/parted/parted.html for more informations of what "
+"could be useful for bug submitting! Please email a bug report to bug-"
+"parted@gnu.org containing at least the version (%s) and the following "
+"message: "
+msgstr ""
+"Um bug foi detectado no GNU parted. Por favor, envie um relatrio de bugpara "
+"bug-parted@gnu.org contendo a verso (%s) e a mensagem abaixo:"
+
+#: libparted/cs/geom.c:162
+msgid "Can't have the end before the start!"
+msgstr "No pode ter fim da partio antes do incio."
+
+#: libparted/cs/geom.c:169
+msgid "Can't have a partition outside the disk!"
+msgstr "No pode ter uma partio para fora do disco!."
+
+#: libparted/cs/geom.c:303
+#, fuzzy, c-format
+msgid "Attempt to read sectors %ld-%ld outside of partition on %s."
+msgstr "Tentativa de ler setores %ld-%ld fora da partio em %s"
+
+#: libparted/cs/geom.c:373
+#, fuzzy, c-format
+msgid "Attempt to write sectors %ld-%ld outside of partition on %s."
+msgstr "Tentativa de escrever setores %ld-%ld fora da partio em %s"
+
+#: libparted/cs/geom.c:413 libparted/fs/linux_swap/linux_swap.c:353
+msgid "checking for bad blocks"
+msgstr ""
+
+#: libparted/libparted.c:286 libparted/libparted.c:306
+msgid "Out of memory."
+msgstr "No h memria."
+
+#: libparted/unit.c:139
+msgid "Cannot get unit size for special unit 'COMPACT'."
+msgstr ""
+
+#: libparted/unit.c:382
+#, c-format
+msgid "\"%s\" has invalid syntax for locations."
+msgstr ""
+
+#: libparted/unit.c:390
+#, c-format
+msgid "The maximum head value is %d."
+msgstr ""
+
+#: libparted/unit.c:397
+#, c-format
+msgid "The maximum sector value is %d."
+msgstr ""
+
+#: libparted/unit.c:409 libparted/unit.c:540
+#, fuzzy, c-format
+msgid "The location %s is outside of the device %s."
+msgstr "Impossvel criar partio para fora do dispositivo."
+
+#: libparted/unit.c:522
+msgid "Invalid number."
+msgstr ""
+
+#: libparted/fs/ext2/ext2.c:87 libparted/fs/ext2/ext2.c:112
+msgid "Inconsistent group descriptors!"
+msgstr "Descritores de grupo inconsistentes!"
+
+#: libparted/fs/ext2/ext2.c:91 libparted/fs/ext2/ext2.c:116
+#, fuzzy
+msgid "File system full!"
+msgstr "Sistema de arquivos cheio!"
+
+#: libparted/fs/ext2/ext2.c:750
+#, fuzzy
+msgid "Invalid superblock. Are you sure this is an ext2 file system?"
+msgstr "Superbloco invlido. Voc tem certeza que isto um sistema ext2?"
+
+#: libparted/fs/ext2/ext2.c:764 libparted/fs/ext2/ext2_resize.c:597
+#, fuzzy
+msgid "File system has errors! You should run e2fsck."
+msgstr "Sistema de arquivos tem erros! Execute e2fsck primeiro."
+
+#: libparted/fs/ext2/ext2.c:775
+#, fuzzy
+msgid ""
+"File system was not cleanly unmounted! You should run e2fsck. Modifying an "
+"unclean file system could cause severe corruption."
+msgstr ""
+"Sistema de arquivos no foi desmontado corretamente! Execute e2fsck primeiro."
+
+#: libparted/fs/ext2/ext2.c:795
+#, fuzzy
+msgid "File system has an incompatible feature enabled."
+msgstr "Sistema de arquivos tem uma caracterstica incompatvel habilitada"
+
+#: libparted/fs/ext2/ext2.c:806
+msgid "Error allocating buffer cache."
+msgstr "Erro determinando o cache temporrio."
+
+#: libparted/fs/ext2/ext2.c:848
+msgid ""
+"A resize operation on this file system will use EXPERIMENTAL code that MAY "
+"CORRUPT it (although it hasn't done so yet).You should at least backup your "
+"data and run 'e2fsck -f' afterwards."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:114
+#, fuzzy
+msgid ""
+"Found an inode with a incorrect link count. Better go run e2fsck first!"
+msgstr ""
+"Encontrado um inode com uma contagem incorreta de ligaes. Melhor executar "
+"o e2fsck primeiro."
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:487
+msgid "Not enough free inodes!"
+msgstr "No h inodes livres suficientes!"
+
+#: libparted/fs/ext2/ext2_resize.c:224
+#, fuzzy
+msgid "File system is too full to remove a group!"
+msgstr "Sistema de arquivos muito ocupado para remover um grupo!"
+
+#: libparted/fs/ext2/ext2_resize.c:233
+#, fuzzy
+msgid "File system has too many allocated inodes to remove a group!"
+msgstr ""
+"Sistema de arquivos tem muitos inodes utilizados para remover um grupo!"
+
+#: libparted/fs/ext2/ext2_resize.c:493
+msgid "adding groups"
+msgstr ""
+
+#: libparted/fs/ext2/ext2_resize.c:530
+#, fuzzy, c-format
+msgid "Your file system is too full to resize it to %i blocks. Sorry."
+msgstr ""
+"Seu sistema de arquivos est muito ocupado para redimension-lo para %i "
+"blocos. Desculpe."
+
+#: libparted/fs/ext2/ext2_resize.c:540
+#, fuzzy, c-format
+msgid ""
+"Your file system has too many occupied inodes to resize it to %i blocks. "
+"Sorry."
+msgstr ""
+"Seu sistema de arquivos est com muitos inodes ocupados para redimension-lo "
+"para %i blocos. Desculpe."
+
+#: libparted/fs/ext2/ext2_resize.c:554 libparted/fs/hfs/hfs.c:243
+#: libparted/fs/hfs/hfs.c:624
+#, fuzzy
+msgid "shrinking"
+msgstr "Aviso"
+
+#: libparted/fs/ext2/ext2_resize.c:605
+#, fuzzy
+msgid "File system was not cleanly unmounted! You should run e2fsck."
+msgstr ""
+"Sistema de arquivos no foi desmontado corretamente! Execute e2fsck primeiro."
+
+#: libparted/fs/ext2/ext2_resize.c:614
+msgid ""
+"The file system has the 'dir_index' feature enabled. Parted can only resize "
+"the file system if it disables this feature. You can enable it later by "
+"running 'tune2fs -O dir_index DEVICE' and then 'e2fsck -fD DEVICE'."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_block_relocator.c:198
+#, fuzzy
+msgid "Cross-linked blocks found! Better go run e2fsck first!"
+msgstr ""
+"Encontrados blocos com referncia cruzada! Melhor executar e2fsck primeiro."
+
+#: libparted/fs/ext2/ext2_block_relocator.c:537
+#, fuzzy, c-format
+msgid "Block %i has no reference? Weird."
+msgstr "Bloco %i no tem referncia? Estranho"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:738
+#, c-format
+msgid "Block %i shouldn't have been marked!"
+msgstr "Bloco %i no deveria ter sido marcado!"
+
+#: libparted/fs/ext2/interface.c:188
+#, fuzzy
+msgid ""
+"The ext2 file system passed a basic check. For a more comprehensive check, "
+"use the e2fsck program."
+msgstr ""
+"O sistema de arquivos ext2 passou pelo teste bsico. Para um teste mais "
+"compreensivo, utilize o programa e2fsck."
+
+#: libparted/fs/ext2/interface.c:205
+msgid "Sorry, can't move the start of ext2 partitions yet!"
+msgstr "Desculpe, no posso mover o incio de parties ext2 ainda!"
+
+#: libparted/fs/ext2/ext2_buffer.c:82
+msgid "Couldn't flush buffer cache!"
+msgstr "No foi possvel esvaziar cache temporrio!"
+
+#: libparted/fs/ext2/ext2_mkfs.c:162
+msgid "writing per-group metadata"
+msgstr ""
+
+#: libparted/fs/ext2/ext2_mkfs.c:565
+msgid "File system too small for ext2."
+msgstr ""
+
+#: libparted/fs/fat/calc.c:134
+#, fuzzy, c-format
+msgid ""
+"You need %s of free disk space to shrink this partition to this size. "
+"Currently, only %s is free."
+msgstr ""
+"Voc precisa de %dM de espao livre para diminuir esta partio para este "
+"tamanho (voc tem somente %dM livres)"
+
+#: libparted/fs/fat/context.c:55
+#, c-format
+msgid ""
+"Cluster start delta = %d, which is not a multiple of the cluster size %d."
+msgstr ""
+"O cluster inicia em delta = %d, que no um mltiplo do tamanho de cluster %"
+"d."
+
+#: libparted/fs/fat/fat.c:312
+#, fuzzy, c-format
+msgid "Partition too big/small for a %s file system."
+msgstr "A partio muito pequena para um sistema de arquivos FAT"
+
+#: libparted/fs/fat/fat.c:478
+msgid ""
+"The FATs don't match. If you don't know what this means, then select "
+"cancel, run scandisk on the file system, and then come back."
+msgstr ""
+"As FATs no esto iguais. Se voc no sabe o que isto significa, selecione "
+"cancelar, execute o scandisk no sistema de arquivos, depois volte."
+
+#: libparted/fs/fat/fat.c:518
+msgid "There are no possible configurations for this FAT type."
+msgstr "No h configuraes possveis para este tipo de FAT."
+
+#: libparted/fs/fat/fat.c:530
+#, c-format
+msgid ""
+"File system doesn't have expected sizes for Windows to like it. Cluster "
+"size is %dk (%dk expected); number of clusters is %d (%d expected); size of "
+"FATs is %d sectors (%d expected)."
+msgstr ""
+"O sistema de arquivos no tem o tamanho esperado para que o Windows utilize. "
+"O tamanho do cluster %dk (%dk esperado); nmero de clusters %d (%d "
+"esperado); tamanho da FAT %d setores (%d esperado)."
+
+#: libparted/fs/fat/fat.c:553
+#, c-format
+msgid ""
+"File system is reporting the free space as %d clusters, not %d clusters."
+msgstr ""
+"O sistema de arquivos est reportando que o espao livre %d clusters, no %"
+"d clusters."
+
+#: libparted/fs/fat/fat.c:878
+#, fuzzy
+msgid ""
+"GNU Parted was miscompiled: the FAT boot sector should be 512 bytes. FAT "
+"support will be disabled."
+msgstr ""
+"O GNU parted foi compilado erradamente: o setor de boot FAT deveria ser de "
+"512 bytes. O suporte a FAT ser desabilitado."
+
+#: libparted/fs/fat/resize.c:158
+#, fuzzy
+msgid ""
+"There's not enough room in the root directory for all of the files. Either "
+"cancel, or ignore to lose the files."
+msgstr ""
+"No h espao suficiente no diretrio raiz, para todos os arquivos. Cancele, "
+"ou ignore para perder os arquivos."
+
+#: libparted/fs/fat/resize.c:299
+msgid "Error writing to the root directory."
+msgstr "Erro escrevendo no diretrio raiz."
+
+#: libparted/fs/fat/resize.c:484
+#, fuzzy
+msgid "If you leave your file system as FAT16, then you will have no problems."
+msgstr "Se deixar seu sistema de arquivos como FAT16, no haver problemas."
+
+#: libparted/fs/fat/resize.c:487
+msgid ""
+"If you convert to FAT16, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual)."
+msgstr ""
+"Se voc converter para FAT16, e o MS Windows est instalado nesta partio, "
+"voc dever reinstalar o gerenciador de boot do MS Windows. Se quiser fazer "
+"isso, consulte o manual do Parted (ou o manual de sua distribuio)."
+
+#: libparted/fs/fat/resize.c:495
+msgid ""
+"If you leave your file system as FAT32, then you will not introduce any new "
+"problems."
+msgstr ""
+"Se deixar seu sistema de arquivos como FAT32, voc no criar mais nenhum "
+"problema novo."
+
+#: libparted/fs/fat/resize.c:499
+msgid ""
+"If you convert to FAT32, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual). Also, "
+"converting to FAT32 will make the file system unreadable by MS DOS, MS "
+"Windows 95a, and MS Windows NT."
+msgstr ""
+"Se voc converter para FAT32, e o MS Windows est instalado nesta partio, "
+"voc dever reinstalar o gerenciador de boot do MS Windows. Se quiser fazer "
+"isso, consulte o manual do Parted (ou o manual de sua distribuio). Tambm, "
+"convertendo para FAT32 far com que o sistema de arquivos no seja mais "
+"reconhecido pelo MS DOS, Windows 95a, e MS Windows NT."
+
+#: libparted/fs/fat/resize.c:513
+#, c-format
+msgid "%s %s %s"
+msgstr "%s %s %s"
+
+#: libparted/fs/fat/resize.c:514
+msgid "Would you like to use FAT32?"
+msgstr "Voc gostaria de usar FAT32?"
+
+#: libparted/fs/fat/resize.c:541 libparted/fs/fat/resize.c:557
+#, c-format
+msgid "%s %s"
+msgstr "%s %s"
+
+#: libparted/fs/fat/resize.c:542
+msgid ""
+"The file system can only be resized to this size by converting to FAT16."
+msgstr ""
+"O sistema de arquivos s pode ser redimensionado para este tamanho sendo "
+"convertido para FAT16."
+
+#: libparted/fs/fat/resize.c:558
+msgid ""
+"The file system can only be resized to this size by converting to FAT32."
+msgstr ""
+"O sistema de arquivos s pode ser redimensionado para este tamanho sendo "
+"convertido para FAT32."
+
+#: libparted/fs/fat/resize.c:571
+#, fuzzy
+msgid ""
+"GNU Parted cannot resize this partition to this size. We're working on it!"
+msgstr ""
+"O GNU Parted no pode redimensionar esta partio a este tamanho. Estamos "
+"trabalhando nisto!"
+
+#: libparted/fs/fat/bootsector.c:48 libparted/fs/fat/bootsector.c:55
+msgid "File system has an invalid signature for a FAT file system."
+msgstr "Sistema de arquivos tem uma assinatura invlida para um FAT."
+
+#: libparted/fs/fat/bootsector.c:62
+msgid "File system has an invalid sector size for a FAT file system."
+msgstr "Sistema de arquivos tem um tamanho de setor invlido para um FAT."
+
+#: libparted/fs/fat/bootsector.c:69
+#, fuzzy
+msgid "File system has an invalid cluster size for a FAT file system."
+msgstr "Sistema de arquivos tem um tamanho de setor invlido para um FAT."
+
+#: libparted/fs/fat/bootsector.c:76
+#, fuzzy
+msgid ""
+"File system has an invalid number of reserved sectors for a FAT file system."
+msgstr ""
+"Sistema de arquivos tem um nmero de setores reservados invlido para um FAT."
+
+#: libparted/fs/fat/bootsector.c:83
+#, fuzzy
+msgid "File system has an invalid number of FATs."
+msgstr "Sistema de arquivos tem um nmero invlido de FATS."
+
+#: libparted/fs/fat/bootsector.c:138
+#, c-format
+msgid ""
+"This file system has a logical sector size of %d. GNU Parted is known not "
+"to work properly with sector sizes other than 512 bytes."
+msgstr ""
+"Este sistema de arquivos tem um tamanho de setor lgico de %d. O GNU Parted "
+" conhecido por no funcionar corretamente com setores diferentes de 512 "
+"bytes."
+
+#: libparted/fs/fat/bootsector.c:163
+#, c-format
+msgid ""
+"The file system's CHS geometry is (%d, %d, %d), which is invalid. The "
+"partition table's CHS geometry is (%d, %d, %d). If you select Ignore, the "
+"file system's CHS geometry will be left unchanged. If you select Fix, the "
+"file system's CHS geometry will be set to match the partition table's CHS "
+"geometry."
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:209
+msgid "FAT boot sector says logical sector size is 0. This is weird. "
+msgstr "Setor de boot FAT diz que o tamanho lgico do setor 0. Estranho. "
+
+#: libparted/fs/fat/bootsector.c:215
+msgid "FAT boot sector says there are no FAT tables. This is weird. "
+msgstr "Setor de boot FAT diz que no h tabelas FAT. Estranho. "
+
+#: libparted/fs/fat/bootsector.c:221
+msgid "FAT boot sector says clusters are 0 sectors. This is weird. "
+msgstr "Setor de boot FAT diz que os clusters tm 0 setores. Estranho. "
+
+#: libparted/fs/fat/bootsector.c:231
+#, fuzzy
+msgid "File system is FAT12, which is unsupported."
+msgstr "O sistema de arquivos FAT12, que no suportado."
+
+#: libparted/fs/fat/bootsector.c:407
+#, c-format
+msgid ""
+"The information sector has the wrong signature (%x). Select cancel for now, "
+"and send in a bug report. If you're desperate, it's probably safe to ignore."
+msgstr ""
+"O setor de informaes tem uma assinatura invlida (%x). Selecione cancelar "
+"agora, e mande um relatrio de bug. Se voc est desesperado, provvel que "
+"seja seguro ignorar."
+
+#: libparted/fs/fat/count.c:149
+#, c-format
+msgid "Bad directory entry for %s: first cluster is the end of file marker."
+msgstr ""
+"Entrada de diretrio invlida para %s: o primeiro cluster o fim do "
+"marcador de arquivo."
+
+#: libparted/fs/fat/count.c:162
+#, c-format
+msgid ""
+"Bad FAT: unterminated chain for %s. You should run dosfsck or scandisk."
+msgstr ""
+"FAT ruim: cadeia no terminada para %s. Voc deveria rodar o dosfsck ou o "
+"scandisk."
+
+#: libparted/fs/fat/count.c:171
+#, fuzzy, c-format
+msgid ""
+"Bad FAT: cluster %d outside file system in chain for %s. You should run "
+"dosfsck or scandisk."
+msgstr ""
+"FAT ruim: cluster %d fora do sistema de arquivos na cadeia para %s. Voc "
+"deveria rodar o dosfsck ou o scandisk."
+
+#: libparted/fs/fat/count.c:181
+#, c-format
+msgid ""
+"Bad FAT: cluster %d is cross-linked for %s. You should run dosfsck or "
+"scandisk."
+msgstr ""
+"FAT ruim: o cluster %d tem uma referncia cruzada para %s. Voc deveria "
+"rodar o dosfsck ou o scandisk."
+
+#: libparted/fs/fat/count.c:200
+#, fuzzy, c-format
+msgid "%s is %dk, but it has %d clusters (%dk)."
+msgstr "%s %dk, mas tem %d clusters (%dk)."
+
+#: libparted/fs/fat/count.c:263
+#, c-format
+msgid ""
+"The file %s is marked as a system file. This means moving it could cause "
+"some programs to stop working."
+msgstr ""
+
+#: libparted/fs/fat/table.c:138
+#, c-format
+msgid ""
+"FAT %d media %x doesn't match the boot sector's media %x. You should "
+"probably run scandisk."
+msgstr ""
+"FAT %d mdia %x no bate com o setor de boot mdia %x. Voc deveria executar "
+"o scandisk."
+
+#: libparted/fs/fat/table.c:268
+#, fuzzy, c-format
+msgid "fat_table_set: cluster %ld outside file system"
+msgstr "fat_table_set: cluster %ld fora do sistema de arquivos"
+
+#: libparted/fs/fat/table.c:296
+#, fuzzy, c-format
+msgid "fat_table_get: cluster %ld outside file system"
+msgstr "fat_table_get: cluster %ld fora do sistema de arquivos"
+
+#: libparted/fs/fat/table.c:334
+msgid "fat_table_alloc_cluster: no free clusters"
+msgstr "fat_table_alloc_cluster: no h clusters livres"
+
+#: libparted/fs/linux_swap/linux_swap.c:236
+#, c-format
+msgid "Unrecognised linux swap signature '%10s'."
+msgstr "Assinatura linux swap no reconhecida '%10s'."
+
+#: libparted/fs/linux_swap/linux_swap.c:312
+msgid "Too many bad pages."
+msgstr "Muitas pginas invlidas."
+
+#: libparted/fs/hfs/advfs.c:123 libparted/fs/hfs/advfs_plus.c:125
+#: libparted/fs/hfs/reloc.c:416 libparted/fs/hfs/reloc.c:510
+#: libparted/fs/hfs/reloc_plus.c:541 libparted/fs/hfs/reloc_plus.c:660
+#: libparted/fs/hfs/reloc_plus.c:774
+msgid "The file system contains errors."
+msgstr ""
+
+#: libparted/fs/hfs/advfs_plus.c:290
+msgid "Bad blocks could not be read."
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:139
+#, c-format
+msgid ""
+"Trying to register an extent starting at block 0x%X, but another one already "
+"exists at this position. You should check the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:216
+#, c-format
+msgid ""
+"Trying to move an extent from block Ox%X to block Ox%X, but another one "
+"already exists at this position. This should not happen!"
+msgstr ""
+
+#: libparted/fs/hfs/file.c:145
+#, c-format
+msgid "Could not update the extent cache for HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:182
+#, c-format
+msgid "Trying to read HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:192 libparted/fs/hfs/file.c:222
+#, c-format
+msgid "Could not find sector %lli of HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:212
+#, c-format
+msgid "Trying to write HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:159
+#, c-format
+msgid "Could not update the extent cache for HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:203
+#, c-format
+msgid "Trying to read HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:214 libparted/fs/hfs/file_plus.c:256
+#, c-format
+msgid "Could not find sector %lli of HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:245
+#, c-format
+msgid "Trying to write HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:225
+msgid "Sorry, HFS cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:255 libparted/fs/hfs/hfs.c:636
+msgid "Data relocation has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:274
+msgid "Data relocation left some data in the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:313
+#, fuzzy
+msgid "writing HFS Master Directory Block"
+msgstr "Erro escrevendo no diretrio raiz."
+
+#: libparted/fs/hfs/hfs.c:461
+msgid "No valid HFS[+X] signature has been found while opening."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:471
+#, c-format
+msgid "Version %d of HFS+ isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:482
+#, c-format
+msgid "Version %d of HFSX isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:667
+msgid "Data relocation left some data at the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:715
+#, fuzzy
+msgid "Error while writing the allocation file."
+msgstr "Erro escrevendo no diretrio raiz."
+
+#: libparted/fs/hfs/hfs.c:730
+msgid "Error while writing the compatibility part of the allocation file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:745
+msgid "writing HFS+ Volume Header"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:845
+msgid "An error occurred while looking for the mandatory bad blocks file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:899
+msgid ""
+"It seems there is an error in the HFS wrapper: the bad blocks file doesn't "
+"contain the embedded HFS+ volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:930
+msgid "Sorry, HFS+ cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:965
+msgid "shrinking embedded HFS+ volume"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:981
+msgid "Resizing the HFS+ volume has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:988
+#, fuzzy
+msgid "shrinking HFS wrapper"
+msgstr "Aviso"
+
+#: libparted/fs/hfs/hfs.c:997
+msgid "Updating the HFS wrapper has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:1099 libparted/fs/hfs/hfs.c:1184
+#, c-format
+msgid ""
+"This is not a real %s check. This is going to extract special low level "
+"files for debugging purposes."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:156
+msgid "Bad block list header checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:169
+#, c-format
+msgid ""
+"Invalid size of a transaction block while replaying the journal (%i bytes)."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:261
+msgid ""
+"Journal stored outside of the volume are not supported. Try to desactivate "
+"the journal and run Parted again."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:272
+#, fuzzy
+msgid "Journal offset or size is not multiple of the sector size."
+msgstr ""
+"O cluster inicia em delta = %d, que no um mltiplo do tamanho de cluster %"
+"d."
+
+#: libparted/fs/hfs/journal.c:290
+msgid "Incorrect magic values in the journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:299
+msgid "Journal size mismatch between journal info block and journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:311
+#, fuzzy
+msgid "Some header fields are not multiple of the sector size."
+msgstr ""
+"O cluster inicia em delta = %d, que no um mltiplo do tamanho de cluster %"
+"d."
+
+#: libparted/fs/hfs/journal.c:320
+msgid ""
+"The sector size stored in the journal is not 512 bytes. Parted only "
+"supports 512 bytes length sectors."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:332
+msgid "Bad journal checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:350
+msgid ""
+"The journal is not empty. Parted must replay the transactions before "
+"opening the file system. This will modify the file system."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:378
+msgid ""
+"The volume header or the master directory block has changed while replaying "
+"the journal. You should restart Parted."
+msgstr ""
+
+#: libparted/fs/hfs/probe.c:52
+#, c-format
+msgid ""
+"Parted can't use HFS file systems on disks with a sector size not equal to %"
+"d bytes."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:153 libparted/fs/hfs/reloc_plus.c:157
+msgid "An extent has not been relocated."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:253 libparted/fs/hfs/reloc_plus.c:309
+msgid ""
+"A reference to an extent comes from a place it should not. You should check "
+"the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:383
+msgid "This HFS volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:477
+msgid "This HFS volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:519 libparted/fs/hfs/reloc_plus.c:670
+msgid ""
+"The extents overflow file should not contain its own extents! You should "
+"check the file system."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:576 libparted/fs/hfs/reloc_plus.c:849
+#, fuzzy
+msgid "Could not cache the file system in memory."
+msgstr "No foi possvel detectar o sistema de arquivos."
+
+#: libparted/fs/hfs/reloc.c:637 libparted/fs/hfs/reloc_plus.c:910
+msgid "Bad blocks list could not be loaded."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:651 libparted/fs/hfs/reloc_plus.c:926
+msgid "An error occurred during extent relocation."
+msgstr ""
+
+#: libparted/fs/hfs/reloc_plus.c:497
+msgid "This HFS+ volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc_plus.c:621
+msgid "This HFS+ volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: parted/parted.c:76
+msgid "displays this help message"
+msgstr "mostra esta mensagem de ajuda"
+
+#: parted/parted.c:77
+msgid "where necessary, prompts for user intervention"
+msgstr "quando necessrio, pede interveno do usurio"
+
+#: parted/parted.c:78
+msgid "never prompts for user intervention"
+msgstr "nunca pede interveno do usurio"
+
+#: parted/parted.c:79
+msgid "displays the version"
+msgstr "mostra a verso"
+
+#: parted/parted.c:87
+#, fuzzy
+msgid ""
+"NUMBER is the partition number used by Linux. On MS-DOS disk labels, the "
+"primary partitions number from 1 to 4, logical partitions from 5 onwards.\n"
+msgstr ""
+"MINOR o nmero da partio usado pelo linux. Em rtulos de disco msdos, as "
+"parties primrias so de 1-4, e parties lgicas de 5 adiante.\n"
+
+#: parted/parted.c:90
+msgid "LABEL-TYPE is one of: "
+msgstr "TIPO_ROTULO um de:"
+
+#: parted/parted.c:91
+msgid "FLAG is one of: "
+msgstr "FLAG um de: "
+
+#: parted/parted.c:92
+#, fuzzy
+msgid "UNIT is one of: "
+msgstr "FLAG um de: "
+
+#: parted/parted.c:93
+msgid "PART-TYPE is one of: primary, logical, extended\n"
+msgstr "TIPO-PART um de: primary, logical, extended\n"
+
+#: parted/parted.c:95
+msgid "FS-TYPE is one of: "
+msgstr "TIPO-FS um de: "
+
+#: parted/parted.c:96
+msgid ""
+"START and END are disk locations, such as 4GB or 10%. Negative values count "
+"from the end of the disk. For example, -1s specifies exactly the last "
+"sector.\n"
+msgstr ""
+
+#: parted/parted.c:99
+msgid "STATE is one of: on, off\n"
+msgstr "ESTADO um de: on, off\n"
+
+#: parted/parted.c:100
+msgid "DEVICE is usually /dev/hda or /dev/sda\n"
+msgstr "DISPOSITIVO usualmente /dev/hda ou /dev/sda\n"
+
+#: parted/parted.c:101
+msgid "NAME is any word you want\n"
+msgstr "NAME qualquer palavra que desejar\n"
+
+#: parted/parted.c:102
+msgid "The partition must have one of the following FS-TYPEs: "
+msgstr ""
+
+#: parted/parted.c:105
+msgid "GNU Parted Version information:\n"
+msgstr ""
+
+#: parted/parted.c:107
+msgid ""
+"Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n"
+"This program is free software, covered by the GNU General Public License.\n"
+"\n"
+"This program is distributed in the hope that it will be useful, but WITHOUT "
+"ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
+"FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
+"more details.\n"
+"\n"
+msgstr ""
+
+#: parted/parted.c:152
+#, c-format
+msgid "%0.f%%\t(time left %.2d:%.2d)"
+msgstr ""
+
+#: parted/parted.c:170
+#, c-format
+msgid ""
+"Partition %s is being used. You must unmount it before you modify it with "
+"Parted."
+msgstr ""
+
+#: parted/parted.c:187
+#, c-format
+msgid "Partition(s) on %s are being used."
+msgstr "Partio(es) em %s est(o) sendo utilizada(s)."
+
+#: parted/parted.c:413 parted/parted.c:594 parted/parted.c:979
+#: parted/parted.c:1059 parted/parted.c:1586 parted/parted.c:1663
+#: parted/parted.c:1707
+#, fuzzy
+msgid "Partition number?"
+msgstr "A partio est sendo utilizada."
+
+#: parted/parted.c:456
+msgid "Source device?"
+msgstr ""
+
+#: parted/parted.c:460
+#, fuzzy
+msgid "Source partition number?"
+msgstr "A partio origem no existe."
+
+#: parted/parted.c:465
+#, fuzzy
+msgid "Can't copy an extended partition."
+msgstr "No posso copiar parties extendidas."
+
+#: parted/parted.c:471
+#, fuzzy
+msgid "Destination partition number?"
+msgstr "A partio destino est sendo utilizada."
+
+#: parted/parted.c:564
+#, fuzzy
+msgid "New disk label type?"
+msgstr "Tipo de rtulo de disco: %s\n"
+
+#: parted/parted.c:598
+#, fuzzy
+msgid "File system?"
+msgstr "Sistema de arquivos "
+
+#: parted/parted.c:645 parted/parted.c:815
+#, fuzzy
+msgid "Partition type?"
+msgstr "A partio no existe."
+
+#: parted/parted.c:652 parted/parted.c:822 parted/parted.c:1062
+#, fuzzy
+msgid "Partition name?"
+msgstr "A partio no existe."
+
+#: parted/parted.c:660 parted/parted.c:832
+#, fuzzy
+msgid "File system type?"
+msgstr "Sistema de arquivos "
+
+#: parted/parted.c:667 parted/parted.c:834 parted/parted.c:994
+#: parted/parted.c:1544 parted/parted.c:1595
+msgid "Start?"
+msgstr ""
+
+#: parted/parted.c:669 parted/parted.c:837 parted/parted.c:997
+#: parted/parted.c:1546 parted/parted.c:1597
+msgid "End?"
+msgstr ""
+
+#: parted/parted.c:707 parted/parted.c:875
+#, fuzzy, c-format
+msgid ""
+"You requested a partition from %s to %s.\n"
+"The closest location we can manage is %s to %s. Is this still acceptable to "
+"you?"
+msgstr ""
+"Voc comandou a movimentao da partio para %.3f-%.3fMb. O mais perto que "
+"o Parted pode chegar %.3f-%.3fMb."
+
+#: parted/parted.c:827
+msgid "An extended partition cannot hold a file system. Did you want mkpart?"
+msgstr ""
+
+#: parted/parted.c:985
+#, fuzzy
+msgid "Can't move an extended partition."
+msgstr "No posso mover parties extendidas."
+
+#: parted/parted.c:1014
+msgid "Can't move a partition onto itself. Try using resize, perhaps?"
+msgstr ""
+"No posso mover a partio sobre ela mesma. Talvez queira redimensionar?"
+
+#: parted/parted.c:1158
+#, c-format
+msgid "Minor: %d\n"
+msgstr ""
+
+#: parted/parted.c:1159
+#, fuzzy, c-format
+msgid "Flags: %s\n"
+msgstr "Sinalizador"
+
+#: parted/parted.c:1160
+#, fuzzy, c-format
+msgid "File System: %s\n"
+msgstr "Sistema de arquivos "
+
+#: parted/parted.c:1161
+#, c-format
+msgid "Size: "
+msgstr ""
+
+#: parted/parted.c:1166
+#, c-format
+msgid "Minimum size: "
+msgstr ""
+
+#: parted/parted.c:1169
+#, c-format
+msgid "Maximum size: "
+msgstr ""
+
+#: parted/parted.c:1255
+#, fuzzy, c-format
+msgid "Disk %s: %s\n"
+msgstr "%s %s %s"
+
+#: parted/parted.c:1256
+#, c-format
+msgid "Sector size (logical/physical): %lldB/%lldB\n"
+msgstr ""
+
+#: parted/parted.c:1267
+#, c-format
+msgid "BIOS cylinder,head,sector geometry: %d,%d,%d. Each cylinder is %s.\n"
+msgstr ""
+
+#: parted/parted.c:1273
+#, fuzzy, c-format
+msgid "Partition Table: %s\n"
+msgstr "A partio no existe."
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Number"
+msgstr ""
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Start"
+msgstr ""
+
+#: parted/parted.c:1285 parted/parted.c:1288
+msgid "End"
+msgstr ""
+
+#: parted/parted.c:1288
+#, fuzzy
+msgid "Size"
+msgstr "resize"
+
+#: parted/parted.c:1292
+msgid "Type"
+msgstr ""
+
+#: parted/parted.c:1294
+#, fuzzy
+msgid "File system"
+msgstr "Sistema de arquivos "
+
+#: parted/parted.c:1297
+#, fuzzy
+msgid "Name"
+msgstr "name"
+
+#: parted/parted.c:1299
+msgid "Flags"
+msgstr "Sinalizador"
+
+#: parted/parted.c:1352
+msgid "Free Space"
+msgstr ""
+
+#: parted/parted.c:1441
+#, c-format
+msgid ""
+"A %s %s partition was found at %s -> %s. Do you want to add it to the "
+"partition table?"
+msgstr ""
+
+#: parted/parted.c:1479
+#, fuzzy
+msgid "searching for file systems"
+msgstr "Tipo de sistema de arquivos desconhecido."
+
+#: parted/parted.c:1684
+#, fuzzy
+msgid "New device?"
+msgstr "Nenhum dispositivo encontrado"
+
+#: parted/parted.c:1709
+msgid "Flag to Invert?"
+msgstr ""
+
+#: parted/parted.c:1714
+#, fuzzy
+msgid "New state?"
+msgstr "Tipo de rtulo de disco: %s\n"
+
+#: parted/parted.c:1747
+msgid "Unit?"
+msgstr ""
+
+#: parted/parted.c:1896
+msgid "check"
+msgstr "check"
+
+#: parted/parted.c:1899
+#, fuzzy
+msgid ""
+"check NUMBER do a simple check on the file system"
+msgstr ""
+"check MINOR faz um teste simples no sistema de arquivos"
+
+#: parted/parted.c:1905
+msgid "cp"
+msgstr "cp"
+
+#: parted/parted.c:1908
+#, fuzzy
+msgid ""
+"cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another "
+"partition"
+msgstr ""
+"cp [FROM-DEVICE] FROM-MINOR TO-MINOR copia o sistema de arquivos para "
+"outra partio"
+
+#: parted/parted.c:1914
+msgid "help"
+msgstr "help"
+
+#: parted/parted.c:1917
+#, fuzzy
+msgid ""
+"help [COMMAND] prints general help, or help on "
+"COMMAND"
+msgstr "help [COMANDO] mostra ajuda geral, ou ajuda a COMANDO"
+
+#: parted/parted.c:1923
+msgid "mklabel"
+msgstr "mklabel"
+
+#: parted/parted.c:1926
+#, fuzzy
+msgid ""
+"mklabel LABEL-TYPE create a new disklabel (partition "
+"table)"
+msgstr ""
+"mklabel TIPO-ROTULO cria um novo rtulo (na tabela de partio)"
+
+#: parted/parted.c:1932
+msgid "mkfs"
+msgstr "mkfs"
+
+#: parted/parted.c:1935
+#, fuzzy
+msgid ""
+"mkfs NUMBER FS-TYPE make a FS-TYPE file system on "
+"partititon NUMBER"
+msgstr ""
+"mkfs MINOR TIPO-FS cria um sistema TIPO-FS na partio MINOR"
+
+#: parted/parted.c:1941
+msgid "mkpart"
+msgstr "mkpart"
+
+#: parted/parted.c:1944
+#, fuzzy
+msgid "mkpart PART-TYPE [FS-TYPE] START END make a partition"
+msgstr "mkpart TIPO-PART [FS-TYPE] INICIO FIM cria uma partio"
+
+#: parted/parted.c:1950
+#, fuzzy
+msgid ""
+"mkpart makes a partition without creating a new file system on the "
+"partition. FS-TYPE may be specified to set an appropriate partition ID.\n"
+msgstr ""
+"mkpart cria uma partio sem criar um novo sistema de arquivos na partio. "
+"TIPO-FS deve ser especificado para parties de dados (ao oposto de uma "
+"partio extendida). Este comando til se voc apagou acidentalmente uma "
+"partio.\n"
+
+#: parted/parted.c:1955
+msgid "mkpartfs"
+msgstr "mkpartfs"
+
+#: parted/parted.c:1958
+#, fuzzy
+msgid ""
+"mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system"
+msgstr "mkpartfs TIPO-PART TIPO-FS INICIO FIM cria uma partio TIPO-FS"
+
+#: parted/parted.c:1964
+msgid "move"
+msgstr "move"
+
+#: parted/parted.c:1967
+#, fuzzy
+msgid "move NUMBER START END move partition NUMBER"
+msgstr "move MINOR INICIO [FIM] move a partio MINOR"
+
+#: parted/parted.c:1972
+msgid "name"
+msgstr "name"
+
+#: parted/parted.c:1975
+#, fuzzy
+msgid "name NUMBER NAME name partition NUMBER as NAME"
+msgstr "name MINOR NAME renomeia a partio MINOR para NAME"
+
+#: parted/parted.c:1980
+msgid "print"
+msgstr "print"
+
+#: parted/parted.c:1983
+#, fuzzy
+msgid ""
+"print [free|NUMBER|all] display the partition table, a "
+"partition, or all devices"
+msgstr "print mostra a tabela de parties"
+
+#: parted/parted.c:1987
+msgid ""
+"Without arguments, print displays the entire partition table. With 'free'\n"
+"argument, information about free space will be displayed otherwise if a\n"
+"partition number is given, then more detailed information is displayed\n"
+"about that partition. If the 'all' argument is passed instead, partition\n"
+"information for all devices will be displayed."
+msgstr ""
+
+#: parted/parted.c:1995
+msgid "quit"
+msgstr "quit"
+
+#: parted/parted.c:1998
+#, fuzzy
+msgid "quit exit program"
+msgstr "quit sair do programa"
+
+#: parted/parted.c:2003
+#, fuzzy
+msgid "rescue"
+msgstr "resize"
+
+#: parted/parted.c:2006
+#, fuzzy
+msgid ""
+"rescue START END rescue a lost partition near START "
+"and END"
+msgstr "resize MINOR INICIO FIM redimensiona a partio MINOR"
+
+#: parted/parted.c:2012
+msgid "resize"
+msgstr "resize"
+
+#: parted/parted.c:2015
+#, fuzzy
+msgid ""
+"resize NUMBER START END resize partition NUMBER and its "
+"file system"
+msgstr "resize MINOR INICIO FIM redimensiona a partio MINOR"
+
+#: parted/parted.c:2023
+msgid "rm"
+msgstr "rm"
+
+#: parted/parted.c:2026
+#, fuzzy
+msgid "rm NUMBER delete partition NUMBER"
+msgstr "rm MINOR apaga a partio MINOR"
+
+#: parted/parted.c:2031
+msgid "select"
+msgstr "select"
+
+#: parted/parted.c:2034
+#, fuzzy
+msgid "select DEVICE choose the device to edit"
+msgstr "select DEVICE seleciona o dispositivo a editar"
+
+#: parted/parted.c:2039
+msgid "set"
+msgstr "set"
+
+#: parted/parted.c:2042
+#, fuzzy
+msgid ""
+"set NUMBER FLAG STATE change the FLAG on partition NUMBER"
+msgstr "rm MINOR apaga a partio MINOR"
+
+#: parted/parted.c:2048
+msgid "toggle"
+msgstr ""
+
+#: parted/parted.c:2051
+#, fuzzy
+msgid ""
+"toggle [NUMBER [FLAG]] toggle the state of FLAG on "
+"partition NUMBER"
+msgstr "rm MINOR apaga a partio MINOR"
+
+#: parted/parted.c:2057
+#, fuzzy
+msgid "unit"
+msgstr "quit"
+
+#: parted/parted.c:2060
+#, fuzzy
+msgid "unit UNIT set the default unit to UNIT"
+msgstr "quit sair do programa"
+
+#: parted/parted.c:2065
+msgid "version"
+msgstr ""
+
+#: parted/parted.c:2068
+msgid ""
+"version displays the current version of GNU "
+"Parted and copyright information"
+msgstr ""
+
+#: parted/parted.c:2072
+msgid ""
+"version displays copyright and version information corressponding to this "
+"copy of GNU Parted\n"
+msgstr ""
+
+#: parted/parted.c:2158
+msgid "No device found"
+msgstr "Nenhum dispositivo encontrado"
+
+#: parted/parted.c:2222
+msgid "Don't forget to update /etc/fstab, if necessary.\n"
+msgstr ""
+
+#: parted/ui.c:68
+msgid "Welcome to GNU Parted! Type 'help' to view a list of commands.\n"
+msgstr ""
+
+#: parted/ui.c:71
+#, fuzzy
+msgid ""
+"Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]\n"
+"Apply COMMANDs with PARAMETERS to DEVICE. If no COMMAND(s) are given, run "
+"in\n"
+"interactive mode.\n"
+msgstr ""
+"Uso: parted [OPCOES]... [DISPOSITIVO [COMANDO [PARAMETROS]...]...]\n"
+"Aplica COMANDO com PARAMETROS em DISPOSITIVO. Se no for dado nenhum\n"
+"COMANDO, executa em modo interativo.\n"
+
+#: parted/ui.c:76
+#, c-format
+msgid ""
+"\n"
+"\n"
+"You found a bug in GNU Parted! Here's what you have to do:\n"
+"\n"
+"Don't panic! The bug has most likely not affected any of your data.\n"
+"Help us to fix this bug by doing the following:\n"
+"\n"
+"Check whether the bug has already been fixed by checking\n"
+"the last version of GNU Parted that you can find at:\n"
+"\n"
+"\thttp://ftp.gnu.org/gnu/parted/\n"
+"\n"
+"Please check this version prior to bug reporting.\n"
+"\n"
+"If this has not been fixed yet or if you don't know how to check,\n"
+"please visit the GNU Parted website:\n"
+"\n"
+"\thttp://www.gnu.org/software/parted\n"
+"\n"
+"for further information.\n"
+"\n"
+"Your report should contain the version of this release (%s)\n"
+"along with the error message below, the output of\n"
+"\n"
+"\tparted DEVICE unit co print unit s print\n"
+"\n"
+"and additional information about your setup you consider important.\n"
+msgstr ""
+
+#: parted/ui.c:230
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_MAPERR (Address not mapped to object)"
+msgstr ""
+
+#: parted/ui.c:235
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_ACCERR (Invalid permissions for mapped object)"
+msgstr ""
+
+#: parted/ui.c:240
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGSEGV signal was encountered."
+msgstr ""
+
+#: parted/ui.c:258
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTDIV (Integer: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:262
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTOVF (Integer: overflow)"
+msgstr ""
+
+#: parted/ui.c:266
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTDIV (Float: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:270
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTOVF (Float: overflow)"
+msgstr ""
+
+#: parted/ui.c:274
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTUND (Float: underflow)"
+msgstr ""
+
+#: parted/ui.c:278
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTRES (Float: inexact result)"
+msgstr ""
+
+#: parted/ui.c:282
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTINV (Float: invalid operation)"
+msgstr ""
+
+#: parted/ui.c:286
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTSUB (Float: subscript out of range)"
+msgstr ""
+
+#: parted/ui.c:291
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGFPE signal was encountered."
+msgstr ""
+
+#: parted/ui.c:310
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPC (Illegal Opcode)"
+msgstr ""
+
+#: parted/ui.c:314
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPN (Illegal Operand)"
+msgstr ""
+
+#: parted/ui.c:318
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLADR (Illegal addressing mode)"
+msgstr ""
+
+#: parted/ui.c:323
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLTRP (Illegal Trap)"
+msgstr ""
+
+#: parted/ui.c:327
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVOPC (Privileged Opcode)"
+msgstr ""
+
+#: parted/ui.c:331
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVREG (Privileged Register)"
+msgstr ""
+
+#: parted/ui.c:335
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_COPROC (Coprocessor Error)"
+msgstr ""
+
+#: parted/ui.c:339
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_BADSTK (Internal Stack Error)"
+msgstr ""
+
+#: parted/ui.c:343
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGILL signal was encountered."
+msgstr ""
+
+#: parted/ui.c:828
+#, fuzzy
+msgid "Expecting a partition number."
+msgstr "A partio destino est sendo utilizada."
+
+#: parted/ui.c:837
+msgid "Partition doesn't exist."
+msgstr "A partio no existe."
+
+#: parted/ui.c:857
+#, fuzzy
+msgid "Expecting a file system type."
+msgstr "Tipo de sistema de arquivos desconhecido."
+
+#: parted/ui.c:863
+#, fuzzy, c-format
+msgid "Unknown file system type \"%s\"."
+msgstr "Tipo de sistema de arquivos desconhecido."
+
+#: parted/ui.c:883
+msgid "Expecting a disk label type."
+msgstr ""
+
+#: parted/ui.c:977
+#, fuzzy
+msgid "Can't create any more partitions."
+msgstr "No posso adicionar outra partio."
+
+#: parted/ui.c:987
+#, fuzzy
+msgid "Expecting a partition type."
+msgstr "A partio destino no existe."
+
+#: parted/ui.c:1115
+msgid "on"
+msgstr "on"
+
+#: parted/ui.c:1116
+msgid "off"
+msgstr ""
+
+#: parted/ui.c:1227
+msgid "OPTIONs:"
+msgstr "OPESs:"
+
+#: parted/ui.c:1230
+msgid "COMMANDs:"
+msgstr "COMANDOs:"
+
+#: parted/ui.c:1238
+#, fuzzy, c-format
+msgid "Using %s\n"
+msgstr ""
+"\n"
+"Usando %s\n"
+
+#, fuzzy
+#~ msgid ""
+#~ "This ext2 file system has a rather strange layout! Parted can't resize "
+#~ "this (yet)."
+#~ msgstr ""
+#~ "Este sistema de arquivos ext2 tem uma aparncia muito estranha! O Parted "
+#~ "no pode redimension-lo (ainda)."
+
+#, fuzzy
+#~ msgid "Disk geometry for %s: %s - %s\n"
+#~ msgstr "Geometria de disco para %s: 0.000-%.3f megabytes\n"
+
+#~ msgid "Disk label type: %s\n"
+#~ msgstr "Tipo de rtulo de disco: %s\n"
+
+#, fuzzy
+#~ msgid "set NUMBER FLAG STATE change a flag on partition NUMBER"
+#~ msgstr "set MINOR FLAG ESTADO muda o sinalizador na partio MINOR"
+
+#, fuzzy
+#~ msgid ""
+#~ "The sector size on %s is %d bytes. Parted is known not to work properly "
+#~ "with drives with sector sizes other than %d bytes."
+#~ msgstr ""
+#~ "O tamanho do setor em %s %d bytes. O Parted conhecido por no "
+#~ "funcionar perfeitamente com discos com setores diferentes de 512 bytes"
+
+#~ msgid ""
+#~ "You found a bug in GNU Parted. Please email a bug report to bug-"
+#~ "parted@gnu.org containing the version (%s), and the following message:\n"
+#~ msgstr ""
+#~ "Voc encontrou um bug no GNU parted. Por favor envie um relatrio para "
+#~ "bug-parted@gnu.org\n"
+#~ "contendo a verso (%s), e a mensagem abaixo:\n"
+
+#, fuzzy
+#~ msgid ""
+#~ "You requested to create a partition at %s - %s. The closest Parted can "
+#~ "manage is %s - %s."
+#~ msgstr ""
+#~ "Voc comandou a criao de uma partio em %.3f-%.3fMb. O mais perto que "
+#~ "o Parted pode chegar %.3f-%.3fMb."
+
+#, fuzzy
+#~ msgid ""
+#~ "You requested to resize the partition to %s - %s. The closest Parted can "
+#~ "manage is %s - %s."
+#~ msgstr ""
+#~ "Voc comandou o redimensionamento da partio para %.3f-%.3fMb. O mais "
+#~ "perto que o Parted pode chegar %.3f-%.3fMb."
+
+#~ msgid "File system has an invalid signature for a FAT file systems."
+#~ msgstr "Sistema de arquivos tem uma assinatura invlida para um FAT."
+
+#~ msgid "Minor Start End "
+#~ msgstr "Minor Incio Fim "
+
+#~ msgid "Type "
+#~ msgstr "Tipo "
+
+#~ msgid "Filesystem "
+#~ msgstr "Sistema de arquivos "
+
+#~ msgid "Name "
+#~ msgstr "Nome "
+
+#~ msgid "Device %s is neither a SCSI nor IDE drive."
+#~ msgstr "O dispositivo %s no um drive SCSI ou IDE."
+
+#~ msgid "Error reading %s (%s) to determine if partition is mounted."
+#~ msgstr "Erro lendo %s (%s) para determinar se a partio est montada."
+
+#~ msgid "Could not read geometry of %s - %s."
+#~ msgstr "No foi possvel ler a geometria de %s - %s"
+
+#~ msgid "Device %s has dodgey geometry."
+#~ msgstr "Dispositivo %s tem uma geometria estranha."
+
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. However, the most likely reason is that Linux "
+#~ "detected the BIOS geometry for %s incorrectly. GNU Parted suspects the "
+#~ "real geometry should be %d/%d/%d (not %d/%d/%d). You should check with "
+#~ "your BIOS first, as this may not be correct. You can inform Linux by "
+#~ "adding the parameter %s=%d,%d,%d to the command line. See the LILO or "
+#~ "GRUB documentation for more information. If you think Parted's suggested "
+#~ "geometry is correct, you may select Ignore to continue (and fix Linux "
+#~ "later). Otherwise, select Cancel (and fix Linux and/or the BIOS now)."
+#~ msgstr ""
+#~ "A tabela de parties em %s inconsistente. H vrias razes para isto "
+#~ "ocorrer. A mais certa seria o Linux detectar a geometria do BIOS para %s "
+#~ "incorretamente. O GNU Parted suspeita que a geometria real deveria ser %d/"
+#~ "%d/%d (e no %d/%d/%d). Voc deve checar com seu BIOS primeiro, pois isto "
+#~ "pode no ser correto. Voc pode informar o Linux adicionando o parmetro %"
+#~ "s=%d,%d,%d na linha de comando. Veja a documentao do LILO ou GRUB para "
+#~ "maiores informaes. Se voc acha que a geometria sugeria pelo Parted a "
+#~ "correta, pode selecionar Ignorar para continuar (e arrumar o Linux "
+#~ "depois). De outra maneira, selecione Cancelar (e arrume o Linux e/ou o "
+#~ "BIOS agora)."
+
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. Often, the reason is that Linux detected the "
+#~ "BIOS geometry incorrectly. However, this does not appear to be the case "
+#~ "here. It is safe to ignore,but ignoring may cause (fixable) problems "
+#~ "with some boot loaders, and may cause problems with FAT file systems. "
+#~ "Using LBA is recommended."
+#~ msgstr ""
+#~ "A tabela de parties em %s est inconsistente. H vrias razes para "
+#~ "isto ocorrer. Muitas vezes, o Linux detecta a geometria do BIOS "
+#~ "incorretamente. Porm, isso no parece ser o caso aqui. seguro ignorar, "
+#~ "mas isso pode causar problemas (solucionveis) com alguns gerenciadores "
+#~ "de boot. recomendvel usar LBA."
+
+#~ msgid ""
+#~ "Unable to align partition properly. This probably means that another "
+#~ "partitioning tool generated an incorrect partition table, because it "
+#~ "didn't have the correct BIOS geometry. It is safe to ignore,but ignoring "
+#~ "may cause (fixable) problems with some boot loaders."
+#~ msgstr ""
+#~ "Impossvel alinhar a partio propriamente. Isso provavelmente significa "
+#~ "que outra ferramenta de particionamento gerou uma tabela de parties "
+#~ "incorreta porque no tinha a geometria na BIOS correta. seguro ignorar, "
+#~ "mas isto pode causar problemas (solucionveis) com alguns gerenciadores "
+#~ "de boot."
+
+#~ msgid ""
+#~ " You have Windows FAT partition(s) that are not using LBA. If your BIOS "
+#~ "supports LBA, then you should switch to LBA by setting the LBA flag on "
+#~ "all FAT partitions. Otherwise, make sure the operating system and the "
+#~ "BIOS have the same geometry before resizing any FAT partitions."
+#~ msgstr ""
+#~ " Voc tem parties FAT Windows que no esto usando LBA. Se seu BIOS "
+#~ "suporta LBA, voc deveria mudar para LBA ligando o sinalizador LBA em "
+#~ "todas as parties FAT. De outro modo, tenha certeza que o sistema "
+#~ "operacional e o BIOS tm a mesma geometria antes de redimensionar "
+#~ "quaisquer parties FAT."
+
+#~ msgid ""
+#~ "The operating system thinks the geometry on %s is %d/%d/%d. Therefore, "
+#~ "cylinder 1024 ends at %.3fM.%s"
+#~ msgstr ""
+#~ "O sistema operacional acha que a geometria de %s %d/%d/%d. Porm, o "
+#~ "cilindro 1024 termina em %.3fM.%s"
+
+#~ msgid "The operating system thinks the geometry on %s is %d/%d/%d.%s"
+#~ msgstr "O sistema operacional acha que a geometria de %s %d/%d/%d.%s"
+
+#, fuzzy
+#~ msgid "Partition %s is being used."
+#~ msgstr "A partio est sendo utilizada."
+
+#~ msgid "START and END are in megabytes\n"
+#~ msgstr "INICIO e FIM so em megabytes\n"
+
+#~ msgid ""
+#~ "The FATs aren't big enough to describe all clusters! Each FAT is %d "
+#~ "sectors. There are %d clusters, which would require each FAT to be %d "
+#~ "sectors. This is REALLY weird. You might want to write us an email: bug-"
+#~ "parted@gnu.org"
+#~ msgstr ""
+#~ "As FATs no so grandes o suficiente para descrever todos os clusters! "
+#~ "Cada FAT tem %d setores. Existem %d clusters, os quais requerem que cada "
+#~ "FAT tenha %d setores. Isto REALMENTE estranho. Voc pode querer nos "
+#~ "escrever um email: bug-parted@gnu.org"
+
+#~ msgid ""
+#~ "This swap partition is not compatible with Linux version 2.1.117 or "
+#~ "earlier. Use a smaller partition (maximum size 128mb) if you want to use "
+#~ "old versions of Linux."
+#~ msgstr ""
+#~ "Esta partio swap no compatvel com o Linux verso 2.1.117 ou "
+#~ "anterior. Utilize uma partio menor (mximo de 128mb) se voc quiser "
+#~ "utilizar verses antigas do Linux."
+
+#, fuzzy
+#~ msgid ""
+#~ "The new partition overlaps with another partition so badly that it isn't "
+#~ "obvious want you want!"
+#~ msgstr "A nova partio sobrepe alguma outra partio"
+
+#~ msgid "Can't grow a partition onto used space."
+#~ msgstr "No posso aumentar a partio acima de algum espao utilizado."
+
+#~ msgid "unknown"
+#~ msgstr "desconhecido"
+
+#~ msgid "Unknown SCSI"
+#~ msgstr "SCSI desconhecido"
+
+#~ msgid "GUID Partition Table Header Signature is wrong: "
+#~ msgstr "A Assinatura do Cabealho da Tabela de Parties GUID est errada: "
+
+#~ msgid " should be "
+#~ msgstr " deveria ser "
+
+#~ msgid "GPT Header CRC check failed, %x should be %x."
+#~ msgstr "Checagem de CRC no cabealho GPT falhou, %x deveria ser %x."
+
+#~ msgid "GPT Partition Entry Array CRC check failed, %x should be %x."
+#~ msgstr ""
+#~ "Checagem de CRC na Matriz de Entradas de Partio GPT falhou, %x deveria "
+#~ "ser %x."
+
+#~ msgid ""
+#~ "This disk contains a valid Primary and Alternate GUID Partition Table but "
+#~ "the Protective MBR is invalid. This generally means that the disk had "
+#~ "GPT partitions on it, but then a legacy partition editing tool was used "
+#~ "to change the partition table stored in the MBR.\n"
+#~ "Which data is valid, GPT or MBR?\n"
+#~ "Yes will assume that the GPT information is correct, and rewrite the "
+#~ "PMBR.\n"
+#~ "No will assume that the MBR is correct, and erase the GPT information.\n"
+#~ "Ignore will assume that the MBR is correct, but not change the disk."
+#~ msgstr ""
+#~ "Esse disco contm as Tabelas de Parties GUID primria e alternativa "
+#~ "corretas, mas a Protective MBR invlida. Isso geralmente significa que "
+#~ "o disco tinha parties GPT, mas um programa padro de particionamento "
+#~ "foi usado para mudar a tabela de parties gravada na MBR.\n"
+#~ "Quais dados so vlidos, GPT ou MBR?\n"
+#~ "Sim: assume que a informao na GPT a correta, e reescreve a PMBR.\n"
+#~ "No: assume que a MBR a correta, e apaga as informaes na GPT.\n"
+#~ "Ignorar: assume que a MBR correta, mas no altera o disco."
+
+#~ msgid ""
+#~ "This disk contains a valid Alternate GUID Partition Table but the Primary "
+#~ "GPT and Protective MBR are invalid. This generally means that the disk "
+#~ "had GPT partitions on it, but then a legacy partition editing tool was "
+#~ "used to change the partition table stored in the MBR.\n"
+#~ "Which data is valid, GPT or MBR?\n"
+#~ "Yes will assume that the GPT information is correct, and will rewrite the "
+#~ "PMBR and Primary GPT.\n"
+#~ "No will assume that the MBR is correct, and erase the GPT information.\n"
+#~ "Ignore will assume that the MBR is correct, but not change the disk."
+#~ msgstr ""
+#~ "Esse disco contm uma Tabela de Partio GUID alternativa correta, mas a "
+#~ "GPT primria e a Protective MBR so invlidas. Isso geralmente significa "
+#~ "que o disco tinha parties GPT, mas um programa padro de "
+#~ "particionamento foi usado para mudar a tabela de parties gravada na "
+#~ "MBR.\n"
+#~ "Quais dados so vlidos, GPT ou MBR?\n"
+#~ "Sim: assume que a informao na GPT a correta, e reescreve a PMBR e a "
+#~ "GPT primria.\n"
+#~ "No: assume que a MBR a correta, e apaga as informaes na GPT.\n"
+#~ "Ignorar: assume que a MBR correta, mas no altera o disco."
+
+#~ msgid ""
+#~ "This disk contains a valid Primary GUID Partition Table but the Alternate "
+#~ "GPT and Protective MBR are invalid. This generally means that the disk "
+#~ "had GPT partitions on it, but then a legacy partition editing tool was "
+#~ "used to change the partition table stored in the MBR.\n"
+#~ "Which data is valid, GPT or MBR?\n"
+#~ "Yes will assume that the GPT information is correct, and will rewrite the "
+#~ "PMBR and Alternate GPT.\n"
+#~ "No will assume that the MBR is correct, and erase the GPT information.\n"
+#~ "Ignore will assume that the MBR is correct, but not change the disk.\n"
+#~ msgstr ""
+#~ "Esse disco contm uma Tabela de Partio GUID primria correta, mas a GPT "
+#~ "alternativa e a Protective MBR so invlidas. Isso geralmente significa "
+#~ "que o disco tinha parties GPT, mas um programa padro de "
+#~ "particionamento foi usado para mudar a tabela de parties gravada na "
+#~ "MBR.\n"
+#~ "Quais dados so vlidos, GPT ou MBR?\n"
+#~ "Sim: assume que a informao na GPT a correta, e reescreve a PMBR e a "
+#~ "GPT alternativa.\n"
+#~ "No: assume que a MBR a correta, e apaga as informaes na GPT.\n"
+#~ "Ignorar: assume que a MBR correta, mas no altera o disco.\n"
+
+#~ msgid "Can't set non-Linux partitions as a root device."
+#~ msgstr "No posso configurar parties no Linux como uma partio root."
+
+#~ msgid "Can't set non-Linux partitions as a swap device."
+#~ msgstr "No posso configurar parties no Linux como uma partio swap."
+
+#~ msgid "No get_resize_constraint for %s!"
+#~ msgstr "No h get_resize_constraint para %s!"
+
+#~ msgid "The %s file system code doesn't support %s disk labels."
+#~ msgstr "O cdigo do sistema de arquivos %s no suporta rtulos de disco %s."
+
+#~ msgid "Creating new %s disklabels is not implemented yet."
+#~ msgstr "Criao de novos rtulos %s no est implementado ainda."
+
+#~ msgid "The code to write the partition table hasn't been written for %s yet"
+#~ msgstr ""
+#~ "O cdigo para escrever a tabela de parties ainda no foi escrito para %"
+#~ "s."
+
+#~ msgid "Insane! %d clusters!"
+#~ msgstr "Insano! %d clusters!"
+
+#~ msgid ""
+#~ "The filesystem is going to be too big for FAT16, so FAT32 will be used. "
+#~ "This is not compatible with MS-DOS, early versions of MS-Windows 95 and "
+#~ "Windows NT. If you use these operating systems, then select cancel, and "
+#~ "create a smaller partition. If you only use Linux, BSD, MS Windows 98 "
+#~ "and/or MS Windows 95 B, then select OK."
+#~ msgstr ""
+#~ "O sistema de arquivos ser muito grande para FAT16, ento ser usado "
+#~ "FAT32. Isto no compatvel com o MS-DOS, verses antigas do MS-Windows "
+#~ "95 e Windows NT. Se voc utiliza estes sistemas operacionais, selecione "
+#~ "cancelar, e crie uma partio menor. Se voc utiliza somente Linux, BSD, "
+#~ "MS-Windows 98 e/ou MS-Windows 95 B, ento selecione OK."
+
+#~ msgid "Weird: fat_calc_sizes() failed for FAT32!"
+#~ msgstr "Estranho: fat_calc_sizes() falhou para a FAT32!"
+
+#~ msgid ""
+#~ "Would you like to use FAT32 for this filesystem? It is much more "
+#~ "efficient with your disk space, but is not compatible with early versions "
+#~ "of Windows 95 and Windows NT. Only select yes if you only use Linux, "
+#~ "BSD, MS Windows 98 and/or MS Windows 95 B."
+#~ msgstr ""
+#~ "Voc gostaria de usar a FAT32 para este sistema de arquivos? muito mais "
+#~ "eficiente com o espao em disco, mas no compatvel com verses antigas "
+#~ "do Windows 95 e Windows NT. Somente selecione sim se voc s utilizar "
+#~ "Linux, BSD, MS-Windows 98 e/ou MS-Windows 95 B."
+
+#~ msgid ""
+#~ "File system doesn't have expected sizes for Windows to like it. Number "
+#~ "of clusters is %d (%d expected); size of FATs is %d sectors (%d expected)."
+#~ msgstr ""
+#~ "O sistema de arquivos no tem o tamanho esperado para que o Windows "
+#~ "utilize. O tamanho do cluster %dk (%dk esperado); tamanho da FAT %d "
+#~ "setores (%d esperado)."
+
+#~ msgid ""
+#~ "Partition size (%ld sectors) and filesystem size (%ld sectors) do not "
+#~ "match."
+#~ msgstr ""
+#~ "Tamanho de partio (%ld setores) e tamanho do sistema de arquivos (%ld "
+#~ "setores) no batem."
+
+#~ msgid "Linux-swap partitions can not be hidden on msdos disk labels."
+#~ msgstr ""
+#~ "Parties Linux-swap no podem ser escondidas em rtulos de disco msdos."
+
+#~ msgid "Linux-swap partitions can not be bootable on pc98 disk labels."
+#~ msgstr ""
+#~ "Parties Linux-swap no podem ser inicializveis em rtulos de disco "
+#~ "pc98."
+
+#~ msgid "HFS partitions can't be hidden on msdos disk labels."
+#~ msgstr "Parties HFS no podem ser escondidas em rtulos de disco msdos."
+
+#~ msgid "JFS partitions can't be hidden on msdos disk labels."
+#~ msgstr "Parties JFS no podem ser escondidas em rtulos de disco msdos."
+
+#~ msgid "Reiserfs partitions can't be hidden on msdos disk labels."
+#~ msgstr ""
+#~ "Parties ReiserFS no podem ser escondidas em rtulos de disco msdos."
+
+#~ msgid "Reiserfs partitions must be bootable on pc98 disk labels."
+#~ msgstr ""
+#~ "Parties ReiserFS devem ser inicializveis em rtulos de disco pc98."
+
+#~ msgid "XFS partitions can't be hidden on msdos disk labels."
+#~ msgstr "Parties XFS no podem ser escondidas em rtulos de disco msdos."
diff --git a/po/quot.sed b/po/quot.sed
new file mode 100644
index 0000000..0122c46
--- /dev/null
+++ b/po/quot.sed
@@ -0,0 +1,6 @@
+s/"\([^"]*\)"/“\1”/g
+s/`\([^`']*\)'/‘\1’/g
+s/ '\([^`']*\)' / ‘\1’ /g
+s/ '\([^`']*\)'$/ ‘\1’/g
+s/^'\([^`']*\)' /‘\1’ /g
+s/“”/""/g
diff --git a/po/remove-potcdate.sin b/po/remove-potcdate.sin
new file mode 100644
index 0000000..2436c49
--- /dev/null
+++ b/po/remove-potcdate.sin
@@ -0,0 +1,19 @@
+# Sed script that remove the POT-Creation-Date line in the header entry
+# from a POT file.
+#
+# The distinction between the first and the following occurrences of the
+# pattern is achieved by looking at the hold space.
+/^"POT-Creation-Date: .*"$/{
+x
+# Test if the hold space is empty.
+s/P/P/
+ta
+# Yes it was empty. First occurrence. Remove the line.
+g
+d
+bb
+:a
+# The hold space was nonempty. Following occurrences. Do nothing.
+x
+:b
+}
diff --git a/po/ru.po b/po/ru.po
new file mode 100644
index 0000000..b41814d
--- /dev/null
+++ b/po/ru.po
@@ -0,0 +1,2631 @@
+# parted.
+# Copyright (C) 1999 Free Software Foundation, Inc.
+# Dmitry S. Sivachenko <dima@Chg.RU>, 1999.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: parted 1.2.1\n"
+"Report-Msgid-Bugs-To: bug-parted@gnu.org\n"
+"POT-Creation-Date: 2006-04-21 21:20+0200\n"
+"PO-Revision-Date: 2000-06-16 22:52+04:00\n"
+"Last-Translator: Dmitry S. Sivachenko <dima@Chg.RU>\n"
+"Language-Team: Russian <ru@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=koi8-r\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: libparted/arch/linux.c:284
+#, c-format
+msgid "Could not stat device %s - %s."
+msgstr " %s - %s."
+
+#: libparted/arch/linux.c:390
+#, c-format
+msgid ""
+"Could not determine sector size for %s: %s.\n"
+"Using the default sector size (%lld)."
+msgstr ""
+
+#: libparted/arch/linux.c:401
+#, c-format
+msgid ""
+"Device %s has a logical sector size of %lld. Not all parts of GNU Parted "
+"support this at the moment, and the working code is HIGHLY EXPERIMENTAL.\n"
+msgstr ""
+
+#: libparted/arch/linux.c:441
+#, fuzzy, c-format
+msgid "Unable to determine the size of %s (%s)."
+msgstr " %s (%s)"
+
+#: libparted/arch/linux.c:530
+#, c-format
+msgid "Could not get identity of device %s - %s"
+msgstr " %s - %s"
+
+#: libparted/arch/linux.c:539
+msgid "Generic IDE"
+msgstr ""
+
+#: libparted/arch/linux.c:556
+#, c-format
+msgid ""
+"Device %s has multiple (%d) logical sectors per physical sector.\n"
+"GNU Parted supports this EXPERIMENTALLY for some special disk label/file "
+"system combinations, e.g. GPT and ext2/3.\n"
+"Please consult the web site for up-to-date information."
+msgstr ""
+
+#: libparted/arch/linux.c:726
+#, c-format
+msgid "Error initialising SCSI device %s - %s"
+msgstr " SCSI- %s - %s"
+
+#: libparted/arch/linux.c:781
+#, c-format
+msgid ""
+"The device %s has zero length, and can't possibly store a file system or "
+"partition table. Perhaps you selected the wrong device?"
+msgstr ""
+
+#: libparted/arch/linux.c:829
+msgid ""
+"Unable to determine geometry of file/device. You should not use Parted "
+"unless you REALLY know what you're doing!"
+msgstr ""
+" /. "
+"Parted, , !"
+
+#: libparted/arch/linux.c:903
+msgid "DAC960 RAID controller"
+msgstr ""
+
+#: libparted/arch/linux.c:908
+msgid "Compaq Smart Array"
+msgstr ""
+
+#: libparted/arch/linux.c:913
+msgid "ATARAID Controller"
+msgstr ""
+
+#: libparted/arch/linux.c:918
+msgid "I2O Controller"
+msgstr ""
+
+#: libparted/arch/linux.c:923
+msgid "User-Mode Linux UBD"
+msgstr ""
+
+#: libparted/arch/linux.c:933
+#, fuzzy
+msgid "Unknown"
+msgstr ""
+
+#: libparted/arch/linux.c:940
+#, fuzzy
+msgid "ped_device_new() Unsupported device type"
+msgstr "ped_device_new() "
+
+#: libparted/arch/linux.c:1041 libparted/arch/gnu.c:264
+#, c-format
+msgid "Error opening %s: %s"
+msgstr ""
+
+#: libparted/arch/linux.c:1052 libparted/arch/gnu.c:274
+#, c-format
+msgid "Unable to open %s read-write (%s). %s has been opened read-only."
+msgstr ""
+
+#: libparted/arch/linux.c:1160 libparted/arch/linux.c:1228
+#: libparted/arch/gnu.c:452 libparted/arch/gnu.c:550 libparted/arch/gnu.c:678
+#, c-format
+msgid "%s during read on %s"
+msgstr "%s %s"
+
+#: libparted/arch/linux.c:1199
+#, c-format
+msgid "%s during seek for read on %s"
+msgstr "%s %s"
+
+#: libparted/arch/linux.c:1270 libparted/arch/linux.c:1355
+#: libparted/arch/linux.c:1413 libparted/arch/gnu.c:587
+#: libparted/arch/gnu.c:632 libparted/arch/gnu.c:709
+#, c-format
+msgid "%s during write on %s"
+msgstr "%s %s"
+
+#: libparted/arch/linux.c:1297 libparted/arch/gnu.c:512
+#, fuzzy, c-format
+msgid "Can't write to %s, because it is opened read-only."
+msgstr ""
+" %s, "
+"."
+
+#: libparted/arch/linux.c:1321
+#, c-format
+msgid "%s during seek for write on %s"
+msgstr "%s %s"
+
+#: libparted/arch/linux.c:1798
+#, fuzzy, c-format
+msgid ""
+"Error informing the kernel about modifications to partition %s -- %s. This "
+"means Linux won't know about any changes you made to %s until you reboot -- "
+"so you shouldn't mount it or use it in any way before rebooting."
+msgstr ""
+" %s (%s). , "
+" Linux. "
+" , - %s."
+
+#: libparted/arch/linux.c:1879
+#, fuzzy, c-format
+msgid ""
+"The kernel was unable to re-read the partition table on %s (%s). This means "
+"Linux won't know anything about the modifications you made until you "
+"reboot. You should reboot your computer before doing anything with %s."
+msgstr ""
+" %s (%s). , "
+" Linux. "
+" , - %s."
+
+#: libparted/arch/gnu.c:97
+#, c-format
+msgid "Unable to open %s."
+msgstr ""
+
+#: libparted/arch/gnu.c:117
+#, fuzzy
+msgid "Unable to probe store."
+msgstr " , ."
+
+#: libparted/arch/gnu.c:355
+msgid ""
+"The partition table cannot be re-read. This means you need to reboot before "
+"mounting any modified partitions. You also need to reinstall your boot "
+"loader before you reboot (which may require mounting modified partitions). "
+"It is impossible do both things! So you'll need to boot off a rescue disk, "
+"and reinstall your boot loader from the rescue disk. Read section 4 of the "
+"Parted User documentation for more information."
+msgstr ""
+
+#: libparted/arch/gnu.c:372
+#, fuzzy, c-format
+msgid ""
+"The partition table on %s cannot be re-read (%s). This means the Hurd knows "
+"nothing about any modifications you made. You should reboot your computer "
+"before doing anything with %s."
+msgstr ""
+" %s (%s). , "
+" Linux. "
+" , - %s."
+
+#: libparted/arch/gnu.c:383 parted/parted.c:2215
+msgid ""
+"You should reinstall your boot loader before rebooting. Read section 4 of "
+"the Parted User documentation for more information."
+msgstr ""
+
+#: libparted/arch/gnu.c:774
+#, c-format
+msgid "%s trying to sync %s to disk"
+msgstr ""
+
+#: libparted/disk.c:183
+#, c-format
+msgid "Unable to open %s - unrecognised disk label."
+msgstr " %s - ."
+
+#: libparted/disk.c:452
+#, fuzzy, c-format
+msgid ""
+"This libparted doesn't have write support for %s. Perhaps it was compiled "
+"read-only."
+msgstr ""
+" %s, "
+"."
+
+#: libparted/disk.c:579
+#, fuzzy, c-format
+msgid "Partition %d is %s, but the file system is %s."
+msgstr " FAT"
+
+#: libparted/disk.c:1056
+#, fuzzy, c-format
+msgid "%s disk labels do not support extended partitions."
+msgstr " ."
+
+#: libparted/disk.c:1616
+#, fuzzy, c-format
+msgid "%s disk labels don't support logical or extended partitions."
+msgstr " ."
+
+#: libparted/disk.c:1629
+#, fuzzy
+msgid "Too many primary partitions."
+msgstr " ."
+
+#: libparted/disk.c:1638
+#, c-format
+msgid ""
+"Can't add a logical partition to %s, because there is no extended partition."
+msgstr ""
+" %s, "
+"."
+
+#: libparted/disk.c:1662
+#, fuzzy, c-format
+msgid "Can't have more than one extended partition on %s."
+msgstr " %s"
+
+#: libparted/disk.c:1672
+#, fuzzy
+msgid "Can't have logical partitions outside of the extended partition."
+msgstr " ."
+
+#: libparted/disk.c:1697
+#, fuzzy, c-format
+msgid "Can't have a logical partition outside of the extended partition on %s."
+msgstr " %s."
+
+#: libparted/disk.c:1707 libparted/disk.c:1761 libparted/disk.c:1927
+#, fuzzy
+msgid "Can't have overlapping partitions."
+msgstr " ."
+
+#: libparted/disk.c:1715
+#, fuzzy
+msgid "Can't have a primary partition inside an extended partition."
+msgstr " ."
+
+#: libparted/disk.c:2123
+msgid "metadata"
+msgstr ""
+
+#: libparted/disk.c:2125
+msgid "free"
+msgstr ""
+
+#: libparted/disk.c:2127 parted/ui.c:968 parted/ui.c:996
+msgid "extended"
+msgstr ""
+
+#: libparted/disk.c:2129 parted/ui.c:972 parted/ui.c:1000
+msgid "logical"
+msgstr ""
+
+#: libparted/disk.c:2131 parted/ui.c:964 parted/ui.c:992
+msgid "primary"
+msgstr ""
+
+#: libparted/disk.c:2147
+msgid "boot"
+msgstr "boot"
+
+#: libparted/disk.c:2149
+#, fuzzy
+msgid "root"
+msgstr "boot"
+
+#: libparted/disk.c:2151
+msgid "swap"
+msgstr ""
+
+#: libparted/disk.c:2153
+msgid "hidden"
+msgstr ""
+
+#: libparted/disk.c:2155
+msgid "raid"
+msgstr ""
+
+#: libparted/disk.c:2157
+msgid "lvm"
+msgstr ""
+
+#: libparted/disk.c:2159
+msgid "lba"
+msgstr ""
+
+#: libparted/disk.c:2161
+msgid "hp-service"
+msgstr ""
+
+#: libparted/disk.c:2163
+msgid "palo"
+msgstr ""
+
+#: libparted/disk.c:2165
+#, fuzzy
+msgid "prep"
+msgstr "boot"
+
+#: libparted/disk.c:2167
+msgid "msftres"
+msgstr ""
+
+#: libparted/disk.c:2173
+#, c-format
+msgid "Unknown partition flag, %d."
+msgstr ""
+
+#: libparted/labels/rdb.c:177
+#, c-format
+msgid "%s : Bad checksum on block %llu of type %s."
+msgstr ""
+
+#: libparted/labels/rdb.c:510
+#, c-format
+msgid "%s : Didn't find rdb block, should never happen."
+msgstr ""
+
+#: libparted/labels/rdb.c:595
+#, fuzzy, c-format
+msgid "%s : Loop detected at block %d."
+msgstr "%s ."
+
+#: libparted/labels/rdb.c:614
+#, c-format
+msgid "%s : The %s list seems bad at block %s."
+msgstr ""
+
+#: libparted/labels/rdb.c:703
+#, c-format
+msgid "%s : Failed to list bad blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:711
+#, c-format
+msgid "%s : Failed to list partition blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:719
+#, c-format
+msgid "%s : Failed to list file system blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:727
+#, c-format
+msgid "%s : Failed to list boot blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:750
+#, fuzzy, c-format
+msgid "Failed to write partition block at %d."
+msgstr " , ."
+
+#: libparted/labels/rdb.c:1053 libparted/labels/bsd.c:505
+#: libparted/labels/dos.c:1942 libparted/labels/dvh.c:772
+#: libparted/labels/gpt.c:1365 libparted/labels/loop.c:251
+#: libparted/labels/mac.c:1318 libparted/labels/pc98.c:764
+#: libparted/labels/sun.c:704
+#, fuzzy
+msgid "Unable to satisfy all constraints on the partition."
+msgstr " , ."
+
+#: libparted/labels/rdb.c:1081
+#, fuzzy
+msgid "Unable to allocate a partition number."
+msgstr " ."
+
+#: libparted/labels/bsd.c:530
+#, fuzzy
+msgid "Unable to allocate a bsd disklabel slot."
+msgstr " %s - ."
+
+#: libparted/labels/dos.c:812
+#, fuzzy, c-format
+msgid "Invalid partition table on %s -- wrong signature %x."
+msgstr " %s - %x"
+
+#: libparted/labels/dos.c:840
+#, c-format
+msgid "Invalid partition table - recursive partition on %s."
+msgstr " - %s."
+
+#: libparted/labels/dos.c:1300
+#, fuzzy
+msgid "Extended partitions cannot be hidden on msdos disk labels."
+msgstr " ext2 ."
+
+#: libparted/labels/dos.c:1926
+msgid "Parted can't resize partitions managed by Windows Dynamic Disk."
+msgstr ""
+
+#: libparted/labels/dvh.c:192
+#, fuzzy, c-format
+msgid "%s has no extended partition (volume header partition)."
+msgstr ""
+" , "
+" ."
+
+#: libparted/labels/dvh.c:315
+msgid "Checksum is wrong, indicating the partition table is corrupt."
+msgstr ""
+
+#: libparted/labels/dvh.c:616
+#, fuzzy
+msgid "Only primary partitions can be root partitions."
+msgstr " ."
+
+#: libparted/labels/dvh.c:630
+#, fuzzy
+msgid "Only primary partitions can be swap partitions."
+msgstr " ."
+
+#: libparted/labels/dvh.c:644
+#, fuzzy
+msgid "Only logical partitions can be a boot file."
+msgstr " ."
+
+#: libparted/labels/dvh.c:723
+msgid "Only logical partitions (boot files) have a name."
+msgstr ""
+
+#: libparted/labels/dvh.c:814
+#, fuzzy
+msgid "Too many primary partitions"
+msgstr " ."
+
+#: libparted/labels/gpt.c:433
+#, c-format
+msgid ""
+"%s contains GPT signatures, indicating that it has a GPT table. However, it "
+"does not have a valid fake msdos partition table, as it should. Perhaps it "
+"was corrupted -- possibly by a program that doesn't understand GPT partition "
+"tables. Or perhaps you deleted the GPT table, and are now using an msdos "
+"partition table. Is this a GPT partition table?"
+msgstr ""
+
+#: libparted/labels/gpt.c:625
+#, c-format
+msgid ""
+"The format of the GPT partition table is version %x, which is newer than "
+"what Parted can recognise. Please tell us! bug-parted@gnu.org"
+msgstr ""
+
+#: libparted/labels/gpt.c:747
+msgid ""
+"The backup GPT table is not at the end of the disk, as it should be. This "
+"might mean that another operating system believes the disk is smaller. Fix, "
+"by moving the backup to the end (and removing the old backup)?"
+msgstr ""
+
+#: libparted/labels/gpt.c:782
+msgid ""
+"The primary GPT table is corrupt, but the backup appears OK, so that will be "
+"used."
+msgstr ""
+
+#: libparted/labels/gpt.c:790
+msgid ""
+"Both the primary and backup GPT tables are corrupt. Try making a fresh "
+"table, and using Parted's rescue feature to recover partitions."
+msgstr ""
+
+#: libparted/labels/mac.c:167
+#, c-format
+msgid "Invalid signature %x for Mac disk labels."
+msgstr ""
+
+#: libparted/labels/mac.c:212
+msgid "Partition map has no partition map entry!"
+msgstr ""
+
+#: libparted/labels/mac.c:259
+#, c-format
+msgid "%s is too small for a Mac disk label!"
+msgstr ""
+
+#: libparted/labels/mac.c:490
+#, c-format
+msgid "Partition %d has an invalid signature %x."
+msgstr ""
+
+#: libparted/labels/mac.c:508
+#, c-format
+msgid "Partition %d has an invalid length of 0 bytes!"
+msgstr ""
+
+#: libparted/labels/mac.c:536
+#, fuzzy
+msgid "The data region doesn't start at the start of the partition."
+msgstr " ."
+
+#: libparted/labels/mac.c:553
+#, fuzzy
+msgid "The boot region doesn't start at the start of the partition."
+msgstr " ."
+
+#: libparted/labels/mac.c:567
+#, fuzzy
+msgid "The partition's boot region doesn't occupy the entire partition."
+msgstr " ."
+
+#: libparted/labels/mac.c:577
+#, fuzzy
+msgid "The partition's data region doesn't occupy the entire partition."
+msgstr " ."
+
+#: libparted/labels/mac.c:631
+#, c-format
+msgid ""
+"Weird block size on device descriptor: %d bytes is not divisible by 512."
+msgstr ""
+
+#: libparted/labels/mac.c:644
+#, c-format
+msgid ""
+"The driver descriptor says the physical block size is %d bytes, but Linux "
+"says it is %d bytes."
+msgstr ""
+
+#: libparted/labels/mac.c:692
+#, fuzzy
+msgid "No valid partition map found."
+msgstr " %s - %x"
+
+#: libparted/labels/mac.c:744
+#, c-format
+msgid ""
+"Conflicting partition map entry sizes! Entry 1 says it is %d, but entry %d "
+"says it is %d!"
+msgstr ""
+
+#: libparted/labels/mac.c:771
+msgid "Weird! There are 2 partitions map entries!"
+msgstr ""
+
+#: libparted/labels/mac.c:1257
+msgid ""
+"Changing the name of a root or swap partition will prevent Linux from "
+"recognising it as such."
+msgstr ""
+
+#: libparted/labels/mac.c:1353
+#, fuzzy
+msgid "Can't add another partition -- the partition map is too small!"
+msgstr ""
+" , 4 "
+"."
+
+#: libparted/labels/pc98.c:357
+#, fuzzy, c-format
+msgid "Invalid partition table on %s."
+msgstr " %s - %x"
+
+#: libparted/labels/pc98.c:409 libparted/labels/pc98.c:487
+#, c-format
+msgid ""
+"Partition %d isn't aligned to cylinder boundaries. This is still "
+"unsupported."
+msgstr ""
+
+#: libparted/labels/pc98.c:796
+#, fuzzy
+msgid "Can't add another partition."
+msgstr " ."
+
+#: libparted/labels/sun.c:143
+msgid "Corrupted Sun disk label detected."
+msgstr ""
+
+#: libparted/labels/sun.c:264
+#, c-format
+msgid ""
+"The disk CHS geometry (%d,%d,%d) reported by the operating system does not "
+"match the geometry stored on the disk label (%d,%d,%d)."
+msgstr ""
+
+#: libparted/labels/sun.c:286
+#, c-format
+msgid "The disk label describes a disk bigger than %s."
+msgstr ""
+
+#: libparted/labels/sun.c:440
+#, c-format
+msgid "The disk has %d cylinders, which is greater than the maximum of 65536."
+msgstr ""
+
+#: libparted/labels/sun.c:736
+msgid ""
+"The Whole Disk partition is the only available one left. Generally, it is "
+"not a good idea to overwrite this partition with a real one. Solaris may "
+"not be able to boot without it, and SILO (the sparc boot loader) appreciates "
+"it as well."
+msgstr ""
+
+#: libparted/labels/sun.c:751
+msgid "Sun disk label is full."
+msgstr ""
+
+#: libparted/filesys.c:386
+msgid "Could not detect file system."
+msgstr " ."
+
+#: libparted/filesys.c:397
+msgid "The file system is bigger than its volume!"
+msgstr ""
+
+#: libparted/filesys.c:405
+#, fuzzy, c-format
+msgid "Support for opening %s file systems is not implemented yet."
+msgstr " %s ."
+
+#: libparted/filesys.c:447
+#, fuzzy, c-format
+msgid "Support for creating %s file systems is not implemented yet."
+msgstr " %s ."
+
+#: libparted/filesys.c:508
+#, fuzzy, c-format
+msgid "Support for checking %s file systems is not implemented yet."
+msgstr " %s ."
+
+#: libparted/filesys.c:574
+msgid "raw block copying"
+msgstr ""
+
+#: libparted/filesys.c:585
+#, fuzzy
+msgid "growing file system"
+msgstr " ."
+
+#: libparted/filesys.c:625
+#, fuzzy
+msgid "Can't copy onto an overlapping partition."
+msgstr " ."
+
+#: libparted/filesys.c:647
+#, c-format
+msgid ""
+"Direct support for copying file systems is not yet implemented for %s. "
+"However, support for resizing is implemented. Therefore, the file system "
+"can be copied if the new partition is at least as big as the old one. So, "
+"either shrink the partition you are trying to copy, or copy to a bigger "
+"partition."
+msgstr ""
+
+#: libparted/filesys.c:661
+#, fuzzy, c-format
+msgid "Support for copying %s file systems is not implemented yet."
+msgstr " %s ."
+
+#: libparted/filesys.c:699
+#, fuzzy, c-format
+msgid "Support for resizing %s file systems is not implemented yet."
+msgstr ""
+" %s ."
+
+#: libparted/exception.c:78
+msgid "Information"
+msgstr ""
+
+#: libparted/exception.c:79
+msgid "Warning"
+msgstr ""
+
+#: libparted/exception.c:80
+msgid "Error"
+msgstr ""
+
+#: libparted/exception.c:81
+msgid "Fatal"
+msgstr " "
+
+#: libparted/exception.c:82
+msgid "Bug"
+msgstr ""
+
+#: libparted/exception.c:83
+msgid "No Implementation"
+msgstr " "
+
+#: libparted/exception.c:87
+msgid "Fix"
+msgstr ""
+
+#: libparted/exception.c:88
+msgid "Yes"
+msgstr ""
+
+#: libparted/exception.c:89
+msgid "No"
+msgstr ""
+
+#: libparted/exception.c:90
+msgid "OK"
+msgstr "OK"
+
+#: libparted/exception.c:91
+msgid "Retry"
+msgstr ""
+
+#: libparted/exception.c:92
+msgid "Ignore"
+msgstr ""
+
+#: libparted/exception.c:93
+msgid "Cancel"
+msgstr ""
+
+#: libparted/exception.c:133
+#, fuzzy, c-format
+msgid ""
+"A bug has been detected in GNU Parted. Refer to the web site of parted "
+"http://www.gnu.org/software/parted/parted.html for more informations of what "
+"could be useful for bug submitting! Please email a bug report to bug-"
+"parted@gnu.org containing at least the version (%s) and the following "
+"message: "
+msgstr ""
+" GNU parted . , bug-"
+"parted@gnu.org , (%s) "
+":"
+
+#: libparted/cs/geom.c:162
+#, fuzzy
+msgid "Can't have the end before the start!"
+msgstr " ."
+
+#: libparted/cs/geom.c:169
+#, fuzzy
+msgid "Can't have a partition outside the disk!"
+msgstr " ."
+
+#: libparted/cs/geom.c:303
+#, fuzzy, c-format
+msgid "Attempt to read sectors %ld-%ld outside of partition on %s."
+msgstr " %ld-%ld %s"
+
+#: libparted/cs/geom.c:373
+#, fuzzy, c-format
+msgid "Attempt to write sectors %ld-%ld outside of partition on %s."
+msgstr " %ld-%ld %s"
+
+#: libparted/cs/geom.c:413 libparted/fs/linux_swap/linux_swap.c:353
+msgid "checking for bad blocks"
+msgstr ""
+
+#: libparted/libparted.c:286 libparted/libparted.c:306
+msgid "Out of memory."
+msgstr " ."
+
+#: libparted/unit.c:139
+msgid "Cannot get unit size for special unit 'COMPACT'."
+msgstr ""
+
+#: libparted/unit.c:382
+#, c-format
+msgid "\"%s\" has invalid syntax for locations."
+msgstr ""
+
+#: libparted/unit.c:390
+#, c-format
+msgid "The maximum head value is %d."
+msgstr ""
+
+#: libparted/unit.c:397
+#, c-format
+msgid "The maximum sector value is %d."
+msgstr ""
+
+#: libparted/unit.c:409 libparted/unit.c:540
+#, fuzzy, c-format
+msgid "The location %s is outside of the device %s."
+msgstr " ."
+
+#: libparted/unit.c:522
+msgid "Invalid number."
+msgstr ""
+
+#: libparted/fs/ext2/ext2.c:87 libparted/fs/ext2/ext2.c:112
+msgid "Inconsistent group descriptors!"
+msgstr " !"
+
+#: libparted/fs/ext2/ext2.c:91 libparted/fs/ext2/ext2.c:116
+#, fuzzy
+msgid "File system full!"
+msgstr " !"
+
+#: libparted/fs/ext2/ext2.c:750
+#, fuzzy
+msgid "Invalid superblock. Are you sure this is an ext2 file system?"
+msgstr " . , ext2?"
+
+#: libparted/fs/ext2/ext2.c:764 libparted/fs/ext2/ext2_resize.c:597
+#, fuzzy
+msgid "File system has errors! You should run e2fsck."
+msgstr " ! e2fsck!"
+
+#: libparted/fs/ext2/ext2.c:775
+#, fuzzy
+msgid ""
+"File system was not cleanly unmounted! You should run e2fsck. Modifying an "
+"unclean file system could cause severe corruption."
+msgstr ""
+" ! e2fsck!"
+
+#: libparted/fs/ext2/ext2.c:795
+#, fuzzy
+msgid "File system has an incompatible feature enabled."
+msgstr " "
+
+#: libparted/fs/ext2/ext2.c:806
+msgid "Error allocating buffer cache."
+msgstr " ."
+
+#: libparted/fs/ext2/ext2.c:848
+msgid ""
+"A resize operation on this file system will use EXPERIMENTAL code that MAY "
+"CORRUPT it (although it hasn't done so yet).You should at least backup your "
+"data and run 'e2fsck -f' afterwards."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:114
+#, fuzzy
+msgid ""
+"Found an inode with a incorrect link count. Better go run e2fsck first!"
+msgstr ""
+" inode . e2fsck."
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:487
+msgid "Not enough free inodes!"
+msgstr " inode!"
+
+#: libparted/fs/ext2/ext2_resize.c:224
+#, fuzzy
+msgid "File system is too full to remove a group!"
+msgstr " , !"
+
+#: libparted/fs/ext2/ext2_resize.c:233
+#, fuzzy
+msgid "File system has too many allocated inodes to remove a group!"
+msgstr ""
+" inode, !"
+
+#: libparted/fs/ext2/ext2_resize.c:493
+msgid "adding groups"
+msgstr ""
+
+#: libparted/fs/ext2/ext2_resize.c:530
+#, fuzzy, c-format
+msgid "Your file system is too full to resize it to %i blocks. Sorry."
+msgstr ""
+" , , "
+"%i ."
+
+#: libparted/fs/ext2/ext2_resize.c:540
+#, fuzzy, c-format
+msgid ""
+"Your file system has too many occupied inodes to resize it to %i blocks. "
+"Sorry."
+msgstr ""
+" , inode, "
+" %i ."
+
+#: libparted/fs/ext2/ext2_resize.c:554 libparted/fs/hfs/hfs.c:243
+#: libparted/fs/hfs/hfs.c:624
+#, fuzzy
+msgid "shrinking"
+msgstr ""
+
+#: libparted/fs/ext2/ext2_resize.c:605
+#, fuzzy
+msgid "File system was not cleanly unmounted! You should run e2fsck."
+msgstr ""
+" ! e2fsck!"
+
+#: libparted/fs/ext2/ext2_resize.c:614
+msgid ""
+"The file system has the 'dir_index' feature enabled. Parted can only resize "
+"the file system if it disables this feature. You can enable it later by "
+"running 'tune2fs -O dir_index DEVICE' and then 'e2fsck -fD DEVICE'."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_block_relocator.c:198
+#, fuzzy
+msgid "Cross-linked blocks found! Better go run e2fsck first!"
+msgstr ""
+" ! e2fsck!"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:537
+#, fuzzy, c-format
+msgid "Block %i has no reference? Weird."
+msgstr " %i ? "
+
+#: libparted/fs/ext2/ext2_block_relocator.c:738
+#, c-format
+msgid "Block %i shouldn't have been marked!"
+msgstr " %i !"
+
+#: libparted/fs/ext2/interface.c:188
+#, fuzzy
+msgid ""
+"The ext2 file system passed a basic check. For a more comprehensive check, "
+"use the e2fsck program."
+msgstr ""
+" ext2 . "
+", e2fsck."
+
+#: libparted/fs/ext2/interface.c:205
+msgid "Sorry, can't move the start of ext2 partitions yet!"
+msgstr " , ext2 !"
+
+#: libparted/fs/ext2/ext2_buffer.c:82
+msgid "Couldn't flush buffer cache!"
+msgstr " !"
+
+#: libparted/fs/ext2/ext2_mkfs.c:162
+msgid "writing per-group metadata"
+msgstr ""
+
+#: libparted/fs/ext2/ext2_mkfs.c:565
+msgid "File system too small for ext2."
+msgstr ""
+
+#: libparted/fs/fat/calc.c:134
+#, fuzzy, c-format
+msgid ""
+"You need %s of free disk space to shrink this partition to this size. "
+"Currently, only %s is free."
+msgstr ""
+" %d , "
+" ( %d)"
+
+#: libparted/fs/fat/context.c:55
+#, c-format
+msgid ""
+"Cluster start delta = %d, which is not a multiple of the cluster size %d."
+msgstr ""
+" %d, "
+" %d."
+
+#: libparted/fs/fat/fat.c:312
+#, fuzzy, c-format
+msgid "Partition too big/small for a %s file system."
+msgstr " FAT"
+
+#: libparted/fs/fat/fat.c:478
+msgid ""
+"The FATs don't match. If you don't know what this means, then select "
+"cancel, run scandisk on the file system, and then come back."
+msgstr ""
+" FAT . , , "
+" , scandisk , "
+"."
+
+#: libparted/fs/fat/fat.c:518
+msgid "There are no possible configurations for this FAT type."
+msgstr " FAT ."
+
+#: libparted/fs/fat/fat.c:530
+#, c-format
+msgid ""
+"File system doesn't have expected sizes for Windows to like it. Cluster "
+"size is %dk (%dk expected); number of clusters is %d (%d expected); size of "
+"FATs is %d sectors (%d expected)."
+msgstr ""
+"Windows , . "
+" %dk ( %dk); %d ( %d); "
+" FAT %d ( %d)."
+
+#: libparted/fs/fat/fat.c:553
+#, c-format
+msgid ""
+"File system is reporting the free space as %d clusters, not %d clusters."
+msgstr ""
+" %d , %d "
+"."
+
+#: libparted/fs/fat/fat.c:878
+#, fuzzy
+msgid ""
+"GNU Parted was miscompiled: the FAT boot sector should be 512 bytes. FAT "
+"support will be disabled."
+msgstr ""
+"GNU parted : FAT "
+" 512 . FAT ."
+
+#: libparted/fs/fat/resize.c:158
+#, fuzzy
+msgid ""
+"There's not enough room in the root directory for all of the files. Either "
+"cancel, or ignore to lose the files."
+msgstr ""
+" . , "
+" ."
+
+#: libparted/fs/fat/resize.c:299
+msgid "Error writing to the root directory."
+msgstr " ."
+
+#: libparted/fs/fat/resize.c:484
+msgid "If you leave your file system as FAT16, then you will have no problems."
+msgstr ""
+
+#: libparted/fs/fat/resize.c:487
+msgid ""
+"If you convert to FAT16, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual)."
+msgstr ""
+
+#: libparted/fs/fat/resize.c:495
+msgid ""
+"If you leave your file system as FAT32, then you will not introduce any new "
+"problems."
+msgstr ""
+
+#: libparted/fs/fat/resize.c:499
+msgid ""
+"If you convert to FAT32, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual). Also, "
+"converting to FAT32 will make the file system unreadable by MS DOS, MS "
+"Windows 95a, and MS Windows NT."
+msgstr ""
+
+#: libparted/fs/fat/resize.c:513
+#, c-format
+msgid "%s %s %s"
+msgstr ""
+
+#: libparted/fs/fat/resize.c:514
+msgid "Would you like to use FAT32?"
+msgstr ""
+
+#: libparted/fs/fat/resize.c:541 libparted/fs/fat/resize.c:557
+#, c-format
+msgid "%s %s"
+msgstr ""
+
+#: libparted/fs/fat/resize.c:542
+msgid ""
+"The file system can only be resized to this size by converting to FAT16."
+msgstr ""
+
+#: libparted/fs/fat/resize.c:558
+msgid ""
+"The file system can only be resized to this size by converting to FAT32."
+msgstr ""
+
+#: libparted/fs/fat/resize.c:571
+#, fuzzy
+msgid ""
+"GNU Parted cannot resize this partition to this size. We're working on it!"
+msgstr ""
+"GNU Parted . "
+" !"
+
+#: libparted/fs/fat/bootsector.c:48 libparted/fs/fat/bootsector.c:55
+#, fuzzy
+msgid "File system has an invalid signature for a FAT file system."
+msgstr " FAT ."
+
+#: libparted/fs/fat/bootsector.c:62
+#, fuzzy
+msgid "File system has an invalid sector size for a FAT file system."
+msgstr " FAT ."
+
+#: libparted/fs/fat/bootsector.c:69
+#, fuzzy
+msgid "File system has an invalid cluster size for a FAT file system."
+msgstr " FAT ."
+
+#: libparted/fs/fat/bootsector.c:76
+#, fuzzy
+msgid ""
+"File system has an invalid number of reserved sectors for a FAT file system."
+msgstr ""
+" FAT ."
+
+#: libparted/fs/fat/bootsector.c:83
+#, fuzzy
+msgid "File system has an invalid number of FATs."
+msgstr " FAT ."
+
+#: libparted/fs/fat/bootsector.c:138
+#, c-format
+msgid ""
+"This file system has a logical sector size of %d. GNU Parted is known not "
+"to work properly with sector sizes other than 512 bytes."
+msgstr ""
+" %d. , "
+"GNU Parted , 512 "
+"."
+
+#: libparted/fs/fat/bootsector.c:163
+#, c-format
+msgid ""
+"The file system's CHS geometry is (%d, %d, %d), which is invalid. The "
+"partition table's CHS geometry is (%d, %d, %d). If you select Ignore, the "
+"file system's CHS geometry will be left unchanged. If you select Fix, the "
+"file system's CHS geometry will be set to match the partition table's CHS "
+"geometry."
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:209
+msgid "FAT boot sector says logical sector size is 0. This is weird. "
+msgstr ""
+" FAT , 0. "
+". "
+
+#: libparted/fs/fat/bootsector.c:215
+msgid "FAT boot sector says there are no FAT tables. This is weird. "
+msgstr ""
+" FAT FAT. "
+". "
+
+#: libparted/fs/fat/bootsector.c:221
+msgid "FAT boot sector says clusters are 0 sectors. This is weird. "
+msgstr ""
+" FAT, 0 . "
+". "
+
+#: libparted/fs/fat/bootsector.c:231
+#, fuzzy
+msgid "File system is FAT12, which is unsupported."
+msgstr " FAT12. ."
+
+#: libparted/fs/fat/bootsector.c:407
+#, c-format
+msgid ""
+"The information sector has the wrong signature (%x). Select cancel for now, "
+"and send in a bug report. If you're desperate, it's probably safe to ignore."
+msgstr ""
+" (%x). , "
+" . , , , "
+"."
+
+#: libparted/fs/fat/count.c:149
+#, c-format
+msgid "Bad directory entry for %s: first cluster is the end of file marker."
+msgstr ""
+" %s: ."
+
+#: libparted/fs/fat/count.c:162
+#, fuzzy, c-format
+msgid ""
+"Bad FAT: unterminated chain for %s. You should run dosfsck or scandisk."
+msgstr " FAT: %s"
+
+#: libparted/fs/fat/count.c:171
+#, fuzzy, c-format
+msgid ""
+"Bad FAT: cluster %d outside file system in chain for %s. You should run "
+"dosfsck or scandisk."
+msgstr ""
+" FAT: %d %s"
+
+#: libparted/fs/fat/count.c:181
+#, fuzzy, c-format
+msgid ""
+"Bad FAT: cluster %d is cross-linked for %s. You should run dosfsck or "
+"scandisk."
+msgstr " FAT: %d %s"
+
+#: libparted/fs/fat/count.c:200
+#, c-format
+msgid "%s is %dk, but it has %d clusters (%dk)."
+msgstr ""
+
+#: libparted/fs/fat/count.c:263
+#, c-format
+msgid ""
+"The file %s is marked as a system file. This means moving it could cause "
+"some programs to stop working."
+msgstr ""
+" %s . , "
+" ."
+
+#: libparted/fs/fat/table.c:138
+#, c-format
+msgid ""
+"FAT %d media %x doesn't match the boot sector's media %x. You should "
+"probably run scandisk."
+msgstr ""
+"FAT %d %x %x. "
+", scandisk."
+
+#: libparted/fs/fat/table.c:268
+#, fuzzy, c-format
+msgid "fat_table_set: cluster %ld outside file system"
+msgstr "fat_table_set: %ld "
+
+#: libparted/fs/fat/table.c:296
+#, fuzzy, c-format
+msgid "fat_table_get: cluster %ld outside file system"
+msgstr "fat_table_get: %ld "
+
+#: libparted/fs/fat/table.c:334
+msgid "fat_table_alloc_cluster: no free clusters"
+msgstr "fat_table_alloc_cluster: "
+
+#: libparted/fs/linux_swap/linux_swap.c:236
+#, fuzzy, c-format
+msgid "Unrecognised linux swap signature '%10s'."
+msgstr " linux swap %10s."
+
+#: libparted/fs/linux_swap/linux_swap.c:312
+msgid "Too many bad pages."
+msgstr " ."
+
+#: libparted/fs/hfs/advfs.c:123 libparted/fs/hfs/advfs_plus.c:125
+#: libparted/fs/hfs/reloc.c:416 libparted/fs/hfs/reloc.c:510
+#: libparted/fs/hfs/reloc_plus.c:541 libparted/fs/hfs/reloc_plus.c:660
+#: libparted/fs/hfs/reloc_plus.c:774
+msgid "The file system contains errors."
+msgstr ""
+
+#: libparted/fs/hfs/advfs_plus.c:290
+msgid "Bad blocks could not be read."
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:139
+#, c-format
+msgid ""
+"Trying to register an extent starting at block 0x%X, but another one already "
+"exists at this position. You should check the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:216
+#, c-format
+msgid ""
+"Trying to move an extent from block Ox%X to block Ox%X, but another one "
+"already exists at this position. This should not happen!"
+msgstr ""
+
+#: libparted/fs/hfs/file.c:145
+#, c-format
+msgid "Could not update the extent cache for HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:182
+#, c-format
+msgid "Trying to read HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:192 libparted/fs/hfs/file.c:222
+#, c-format
+msgid "Could not find sector %lli of HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:212
+#, c-format
+msgid "Trying to write HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:159
+#, c-format
+msgid "Could not update the extent cache for HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:203
+#, c-format
+msgid "Trying to read HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:214 libparted/fs/hfs/file_plus.c:256
+#, c-format
+msgid "Could not find sector %lli of HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:245
+#, c-format
+msgid "Trying to write HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:225
+msgid "Sorry, HFS cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:255 libparted/fs/hfs/hfs.c:636
+msgid "Data relocation has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:274
+msgid "Data relocation left some data in the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:313
+#, fuzzy
+msgid "writing HFS Master Directory Block"
+msgstr " ."
+
+#: libparted/fs/hfs/hfs.c:461
+msgid "No valid HFS[+X] signature has been found while opening."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:471
+#, c-format
+msgid "Version %d of HFS+ isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:482
+#, c-format
+msgid "Version %d of HFSX isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:667
+msgid "Data relocation left some data at the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:715
+#, fuzzy
+msgid "Error while writing the allocation file."
+msgstr " ."
+
+#: libparted/fs/hfs/hfs.c:730
+msgid "Error while writing the compatibility part of the allocation file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:745
+msgid "writing HFS+ Volume Header"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:845
+msgid "An error occurred while looking for the mandatory bad blocks file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:899
+msgid ""
+"It seems there is an error in the HFS wrapper: the bad blocks file doesn't "
+"contain the embedded HFS+ volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:930
+msgid "Sorry, HFS+ cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:965
+msgid "shrinking embedded HFS+ volume"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:981
+msgid "Resizing the HFS+ volume has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:988
+#, fuzzy
+msgid "shrinking HFS wrapper"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:997
+msgid "Updating the HFS wrapper has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:1099 libparted/fs/hfs/hfs.c:1184
+#, c-format
+msgid ""
+"This is not a real %s check. This is going to extract special low level "
+"files for debugging purposes."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:156
+msgid "Bad block list header checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:169
+#, c-format
+msgid ""
+"Invalid size of a transaction block while replaying the journal (%i bytes)."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:261
+msgid ""
+"Journal stored outside of the volume are not supported. Try to desactivate "
+"the journal and run Parted again."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:272
+#, fuzzy
+msgid "Journal offset or size is not multiple of the sector size."
+msgstr ""
+" %d, "
+" %d."
+
+#: libparted/fs/hfs/journal.c:290
+msgid "Incorrect magic values in the journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:299
+msgid "Journal size mismatch between journal info block and journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:311
+#, fuzzy
+msgid "Some header fields are not multiple of the sector size."
+msgstr ""
+" %d, "
+" %d."
+
+#: libparted/fs/hfs/journal.c:320
+msgid ""
+"The sector size stored in the journal is not 512 bytes. Parted only "
+"supports 512 bytes length sectors."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:332
+msgid "Bad journal checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:350
+msgid ""
+"The journal is not empty. Parted must replay the transactions before "
+"opening the file system. This will modify the file system."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:378
+msgid ""
+"The volume header or the master directory block has changed while replaying "
+"the journal. You should restart Parted."
+msgstr ""
+
+#: libparted/fs/hfs/probe.c:52
+#, c-format
+msgid ""
+"Parted can't use HFS file systems on disks with a sector size not equal to %"
+"d bytes."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:153 libparted/fs/hfs/reloc_plus.c:157
+msgid "An extent has not been relocated."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:253 libparted/fs/hfs/reloc_plus.c:309
+msgid ""
+"A reference to an extent comes from a place it should not. You should check "
+"the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:383
+msgid "This HFS volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:477
+msgid "This HFS volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:519 libparted/fs/hfs/reloc_plus.c:670
+msgid ""
+"The extents overflow file should not contain its own extents! You should "
+"check the file system."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:576 libparted/fs/hfs/reloc_plus.c:849
+#, fuzzy
+msgid "Could not cache the file system in memory."
+msgstr " ."
+
+#: libparted/fs/hfs/reloc.c:637 libparted/fs/hfs/reloc_plus.c:910
+msgid "Bad blocks list could not be loaded."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:651 libparted/fs/hfs/reloc_plus.c:926
+msgid "An error occurred during extent relocation."
+msgstr ""
+
+#: libparted/fs/hfs/reloc_plus.c:497
+msgid "This HFS+ volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc_plus.c:621
+msgid "This HFS+ volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: parted/parted.c:76
+msgid "displays this help message"
+msgstr " "
+
+#: parted/parted.c:77
+msgid "where necessary, prompts for user intervention"
+msgstr " , "
+
+#: parted/parted.c:78
+msgid "never prompts for user intervention"
+msgstr " "
+
+#: parted/parted.c:79
+msgid "displays the version"
+msgstr " "
+
+#: parted/parted.c:87
+#, fuzzy
+msgid ""
+"NUMBER is the partition number used by Linux. On MS-DOS disk labels, the "
+"primary partitions number from 1 to 4, logical partitions from 5 onwards.\n"
+msgstr ""
+"MINOR - , Linux. "
+" 1-4, - 5 .\n"
+
+#: parted/parted.c:90
+msgid "LABEL-TYPE is one of: "
+msgstr "- : "
+
+#: parted/parted.c:91
+#, fuzzy
+msgid "FLAG is one of: "
+msgstr "_ : "
+
+#: parted/parted.c:92
+#, fuzzy
+msgid "UNIT is one of: "
+msgstr "_ : "
+
+#: parted/parted.c:93
+msgid "PART-TYPE is one of: primary, logical, extended\n"
+msgstr "_ : , , \n"
+
+#: parted/parted.c:95
+msgid "FS-TYPE is one of: "
+msgstr "_ : "
+
+#: parted/parted.c:96
+msgid ""
+"START and END are disk locations, such as 4GB or 10%. Negative values count "
+"from the end of the disk. For example, -1s specifies exactly the last "
+"sector.\n"
+msgstr ""
+
+#: parted/parted.c:99
+#, fuzzy
+msgid "STATE is one of: on, off\n"
+msgstr "_ : "
+
+#: parted/parted.c:100
+msgid "DEVICE is usually /dev/hda or /dev/sda\n"
+msgstr " /dev/hda /dev/sda\n"
+
+#: parted/parted.c:101
+msgid "NAME is any word you want\n"
+msgstr ""
+
+#: parted/parted.c:102
+msgid "The partition must have one of the following FS-TYPEs: "
+msgstr ""
+
+#: parted/parted.c:105
+msgid "GNU Parted Version information:\n"
+msgstr ""
+
+#: parted/parted.c:107
+#, fuzzy
+msgid ""
+"Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n"
+"This program is free software, covered by the GNU General Public License.\n"
+"\n"
+"This program is distributed in the hope that it will be useful, but WITHOUT "
+"ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
+"FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
+"more details.\n"
+"\n"
+msgstr ""
+"Copyright (C) 1999-2000 Andrew Clausen, Lennert Buytenhek Red Hat Inc.\n"
+": Copyright (C) 1999-2000 Free Software Foundation, Inc\n"
+" , \n"
+" GNU.\n"
+"\n"
+" , , \n"
+"- ; "
+" . "
+" GNU.\n"
+
+#: parted/parted.c:152
+#, c-format
+msgid "%0.f%%\t(time left %.2d:%.2d)"
+msgstr ""
+
+#: parted/parted.c:170
+#, c-format
+msgid ""
+"Partition %s is being used. You must unmount it before you modify it with "
+"Parted."
+msgstr ""
+
+#: parted/parted.c:187
+#, c-format
+msgid "Partition(s) on %s are being used."
+msgstr " %s ."
+
+#: parted/parted.c:413 parted/parted.c:594 parted/parted.c:979
+#: parted/parted.c:1059 parted/parted.c:1586 parted/parted.c:1663
+#: parted/parted.c:1707
+#, fuzzy
+msgid "Partition number?"
+msgstr " ."
+
+#: parted/parted.c:456
+msgid "Source device?"
+msgstr ""
+
+#: parted/parted.c:460
+#, fuzzy
+msgid "Source partition number?"
+msgstr " ."
+
+#: parted/parted.c:465
+#, fuzzy
+msgid "Can't copy an extended partition."
+msgstr " ."
+
+#: parted/parted.c:471
+#, fuzzy
+msgid "Destination partition number?"
+msgstr " ."
+
+#: parted/parted.c:564
+msgid "New disk label type?"
+msgstr ""
+
+#: parted/parted.c:598
+#, fuzzy
+msgid "File system?"
+msgstr " !"
+
+#: parted/parted.c:645 parted/parted.c:815
+#, fuzzy
+msgid "Partition type?"
+msgstr " ."
+
+#: parted/parted.c:652 parted/parted.c:822 parted/parted.c:1062
+#, fuzzy
+msgid "Partition name?"
+msgstr " ."
+
+#: parted/parted.c:660 parted/parted.c:832
+#, fuzzy
+msgid "File system type?"
+msgstr " !"
+
+#: parted/parted.c:667 parted/parted.c:834 parted/parted.c:994
+#: parted/parted.c:1544 parted/parted.c:1595
+msgid "Start?"
+msgstr ""
+
+#: parted/parted.c:669 parted/parted.c:837 parted/parted.c:997
+#: parted/parted.c:1546 parted/parted.c:1597
+msgid "End?"
+msgstr ""
+
+#: parted/parted.c:707 parted/parted.c:875
+#, c-format
+msgid ""
+"You requested a partition from %s to %s.\n"
+"The closest location we can manage is %s to %s. Is this still acceptable to "
+"you?"
+msgstr ""
+
+#: parted/parted.c:827
+msgid "An extended partition cannot hold a file system. Did you want mkpart?"
+msgstr ""
+
+#: parted/parted.c:985
+#, fuzzy
+msgid "Can't move an extended partition."
+msgstr " ."
+
+#: parted/parted.c:1014
+#, fuzzy
+msgid "Can't move a partition onto itself. Try using resize, perhaps?"
+msgstr ""
+" , "
+" ."
+
+#: parted/parted.c:1158
+#, c-format
+msgid "Minor: %d\n"
+msgstr ""
+
+#: parted/parted.c:1159
+#, fuzzy, c-format
+msgid "Flags: %s\n"
+msgstr " !"
+
+#: parted/parted.c:1160
+#, fuzzy, c-format
+msgid "File System: %s\n"
+msgstr " !"
+
+#: parted/parted.c:1161
+#, c-format
+msgid "Size: "
+msgstr ""
+
+#: parted/parted.c:1166
+#, c-format
+msgid "Minimum size: "
+msgstr ""
+
+#: parted/parted.c:1169
+#, c-format
+msgid "Maximum size: "
+msgstr ""
+
+#: parted/parted.c:1255
+#, c-format
+msgid "Disk %s: %s\n"
+msgstr ""
+
+#: parted/parted.c:1256
+#, c-format
+msgid "Sector size (logical/physical): %lldB/%lldB\n"
+msgstr ""
+
+#: parted/parted.c:1267
+#, c-format
+msgid "BIOS cylinder,head,sector geometry: %d,%d,%d. Each cylinder is %s.\n"
+msgstr ""
+
+#: parted/parted.c:1273
+#, fuzzy, c-format
+msgid "Partition Table: %s\n"
+msgstr " ."
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Number"
+msgstr ""
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Start"
+msgstr ""
+
+#: parted/parted.c:1285 parted/parted.c:1288
+msgid "End"
+msgstr ""
+
+#: parted/parted.c:1288
+#, fuzzy
+msgid "Size"
+msgstr "resize"
+
+#: parted/parted.c:1292
+msgid "Type"
+msgstr ""
+
+#: parted/parted.c:1294
+#, fuzzy
+msgid "File system"
+msgstr " !"
+
+#: parted/parted.c:1297
+msgid "Name"
+msgstr ""
+
+#: parted/parted.c:1299
+msgid "Flags"
+msgstr ""
+
+#: parted/parted.c:1352
+msgid "Free Space"
+msgstr ""
+
+#: parted/parted.c:1441
+#, c-format
+msgid ""
+"A %s %s partition was found at %s -> %s. Do you want to add it to the "
+"partition table?"
+msgstr ""
+
+#: parted/parted.c:1479
+#, fuzzy
+msgid "searching for file systems"
+msgstr " ."
+
+#: parted/parted.c:1684
+#, fuzzy
+msgid "New device?"
+msgstr " "
+
+#: parted/parted.c:1709
+msgid "Flag to Invert?"
+msgstr ""
+
+#: parted/parted.c:1714
+msgid "New state?"
+msgstr ""
+
+#: parted/parted.c:1747
+msgid "Unit?"
+msgstr ""
+
+#: parted/parted.c:1896
+msgid "check"
+msgstr "check"
+
+#: parted/parted.c:1899
+#, fuzzy
+msgid ""
+"check NUMBER do a simple check on the file system"
+msgstr ""
+"check MINOR "
+
+#: parted/parted.c:1905
+msgid "cp"
+msgstr "cp"
+
+#: parted/parted.c:1908
+#, fuzzy
+msgid ""
+"cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another "
+"partition"
+msgstr ""
+"cp MINOR [] MINOR "
+
+#: parted/parted.c:1914
+msgid "help"
+msgstr "help"
+
+#: parted/parted.c:1917
+#, fuzzy
+msgid ""
+"help [COMMAND] prints general help, or help on "
+"COMMAND"
+msgstr ""
+"help [] , "
+""
+
+#: parted/parted.c:1923
+msgid "mklabel"
+msgstr "mklabel"
+
+#: parted/parted.c:1926
+#, fuzzy
+msgid ""
+"mklabel LABEL-TYPE create a new disklabel (partition "
+"table)"
+msgstr ""
+"mklabel - ( )"
+
+#: parted/parted.c:1932
+msgid "mkfs"
+msgstr "mkfs"
+
+#: parted/parted.c:1935
+#, fuzzy
+msgid ""
+"mkfs NUMBER FS-TYPE make a FS-TYPE file system on "
+"partititon NUMBER"
+msgstr ""
+"mkfs MINOR - - "
+"MINOR"
+
+#: parted/parted.c:1941
+msgid "mkpart"
+msgstr "mkpart"
+
+#: parted/parted.c:1944
+#, fuzzy
+msgid "mkpart PART-TYPE [FS-TYPE] START END make a partition"
+msgstr "mkpart - [-] "
+
+#: parted/parted.c:1950
+#, fuzzy
+msgid ""
+"mkpart makes a partition without creating a new file system on the "
+"partition. FS-TYPE may be specified to set an appropriate partition ID.\n"
+msgstr ""
+"mkpart . - "
+" ( "
+"). , .\n"
+
+#: parted/parted.c:1955
+msgid "mkpartfs"
+msgstr "mkpartfs"
+
+#: parted/parted.c:1958
+#, fuzzy
+msgid ""
+"mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system"
+msgstr ""
+"mkpartfs - - "
+
+#: parted/parted.c:1964
+msgid "move"
+msgstr ""
+
+#: parted/parted.c:1967
+#, fuzzy
+msgid "move NUMBER START END move partition NUMBER"
+msgstr ""
+"resize MINOR "
+"MINOR"
+
+#: parted/parted.c:1972
+msgid "name"
+msgstr ""
+
+#: parted/parted.c:1975
+#, fuzzy
+msgid "name NUMBER NAME name partition NUMBER as NAME"
+msgstr "unhide MINOR MINOR"
+
+#: parted/parted.c:1980
+msgid "print"
+msgstr "print"
+
+#: parted/parted.c:1983
+#, fuzzy
+msgid ""
+"print [free|NUMBER|all] display the partition table, a "
+"partition, or all devices"
+msgstr "print "
+
+#: parted/parted.c:1987
+msgid ""
+"Without arguments, print displays the entire partition table. With 'free'\n"
+"argument, information about free space will be displayed otherwise if a\n"
+"partition number is given, then more detailed information is displayed\n"
+"about that partition. If the 'all' argument is passed instead, partition\n"
+"information for all devices will be displayed."
+msgstr ""
+
+#: parted/parted.c:1995
+msgid "quit"
+msgstr "quit"
+
+#: parted/parted.c:1998
+#, fuzzy
+msgid "quit exit program"
+msgstr "quit "
+
+#: parted/parted.c:2003
+#, fuzzy
+msgid "rescue"
+msgstr "resize"
+
+#: parted/parted.c:2006
+#, fuzzy
+msgid ""
+"rescue START END rescue a lost partition near START "
+"and END"
+msgstr "rm MINOR MINOR"
+
+#: parted/parted.c:2012
+msgid "resize"
+msgstr "resize"
+
+#: parted/parted.c:2015
+#, fuzzy
+msgid ""
+"resize NUMBER START END resize partition NUMBER and its "
+"file system"
+msgstr ""
+"resize MINOR "
+"MINOR"
+
+#: parted/parted.c:2023
+msgid "rm"
+msgstr "rm"
+
+#: parted/parted.c:2026
+#, fuzzy
+msgid "rm NUMBER delete partition NUMBER"
+msgstr "rm MINOR MINOR"
+
+#: parted/parted.c:2031
+msgid "select"
+msgstr ""
+
+#: parted/parted.c:2034
+#, fuzzy
+msgid "select DEVICE choose the device to edit"
+msgstr "boot MINOR MINOR"
+
+#: parted/parted.c:2039
+msgid "set"
+msgstr ""
+
+#: parted/parted.c:2042
+#, fuzzy
+msgid ""
+"set NUMBER FLAG STATE change the FLAG on partition NUMBER"
+msgstr "rm MINOR MINOR"
+
+#: parted/parted.c:2048
+msgid "toggle"
+msgstr ""
+
+#: parted/parted.c:2051
+#, fuzzy
+msgid ""
+"toggle [NUMBER [FLAG]] toggle the state of FLAG on "
+"partition NUMBER"
+msgstr "rm MINOR MINOR"
+
+#: parted/parted.c:2057
+#, fuzzy
+msgid "unit"
+msgstr "quit"
+
+#: parted/parted.c:2060
+#, fuzzy
+msgid "unit UNIT set the default unit to UNIT"
+msgstr "boot MINOR MINOR"
+
+#: parted/parted.c:2065
+msgid "version"
+msgstr ""
+
+#: parted/parted.c:2068
+msgid ""
+"version displays the current version of GNU "
+"Parted and copyright information"
+msgstr ""
+
+#: parted/parted.c:2072
+msgid ""
+"version displays copyright and version information corressponding to this "
+"copy of GNU Parted\n"
+msgstr ""
+
+#: parted/parted.c:2158
+msgid "No device found"
+msgstr " "
+
+#: parted/parted.c:2222
+msgid "Don't forget to update /etc/fstab, if necessary.\n"
+msgstr ""
+
+#: parted/ui.c:68
+msgid "Welcome to GNU Parted! Type 'help' to view a list of commands.\n"
+msgstr ""
+
+#: parted/ui.c:71
+#, fuzzy
+msgid ""
+"Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]\n"
+"Apply COMMANDs with PARAMETERS to DEVICE. If no COMMAND(s) are given, run "
+"in\n"
+"interactive mode.\n"
+msgstr ""
+": parted [] [ [ []...]...]\n"
+" . "
+",\n"
+" .\n"
+
+#: parted/ui.c:76
+#, c-format
+msgid ""
+"\n"
+"\n"
+"You found a bug in GNU Parted! Here's what you have to do:\n"
+"\n"
+"Don't panic! The bug has most likely not affected any of your data.\n"
+"Help us to fix this bug by doing the following:\n"
+"\n"
+"Check whether the bug has already been fixed by checking\n"
+"the last version of GNU Parted that you can find at:\n"
+"\n"
+"\thttp://ftp.gnu.org/gnu/parted/\n"
+"\n"
+"Please check this version prior to bug reporting.\n"
+"\n"
+"If this has not been fixed yet or if you don't know how to check,\n"
+"please visit the GNU Parted website:\n"
+"\n"
+"\thttp://www.gnu.org/software/parted\n"
+"\n"
+"for further information.\n"
+"\n"
+"Your report should contain the version of this release (%s)\n"
+"along with the error message below, the output of\n"
+"\n"
+"\tparted DEVICE unit co print unit s print\n"
+"\n"
+"and additional information about your setup you consider important.\n"
+msgstr ""
+
+#: parted/ui.c:230
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_MAPERR (Address not mapped to object)"
+msgstr ""
+
+#: parted/ui.c:235
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_ACCERR (Invalid permissions for mapped object)"
+msgstr ""
+
+#: parted/ui.c:240
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGSEGV signal was encountered."
+msgstr ""
+
+#: parted/ui.c:258
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTDIV (Integer: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:262
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTOVF (Integer: overflow)"
+msgstr ""
+
+#: parted/ui.c:266
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTDIV (Float: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:270
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTOVF (Float: overflow)"
+msgstr ""
+
+#: parted/ui.c:274
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTUND (Float: underflow)"
+msgstr ""
+
+#: parted/ui.c:278
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTRES (Float: inexact result)"
+msgstr ""
+
+#: parted/ui.c:282
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTINV (Float: invalid operation)"
+msgstr ""
+
+#: parted/ui.c:286
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTSUB (Float: subscript out of range)"
+msgstr ""
+
+#: parted/ui.c:291
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGFPE signal was encountered."
+msgstr ""
+
+#: parted/ui.c:310
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPC (Illegal Opcode)"
+msgstr ""
+
+#: parted/ui.c:314
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPN (Illegal Operand)"
+msgstr ""
+
+#: parted/ui.c:318
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLADR (Illegal addressing mode)"
+msgstr ""
+
+#: parted/ui.c:323
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLTRP (Illegal Trap)"
+msgstr ""
+
+#: parted/ui.c:327
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVOPC (Privileged Opcode)"
+msgstr ""
+
+#: parted/ui.c:331
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVREG (Privileged Register)"
+msgstr ""
+
+#: parted/ui.c:335
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_COPROC (Coprocessor Error)"
+msgstr ""
+
+#: parted/ui.c:339
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_BADSTK (Internal Stack Error)"
+msgstr ""
+
+#: parted/ui.c:343
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGILL signal was encountered."
+msgstr ""
+
+#: parted/ui.c:828
+#, fuzzy
+msgid "Expecting a partition number."
+msgstr " ."
+
+#: parted/ui.c:837
+msgid "Partition doesn't exist."
+msgstr " ."
+
+#: parted/ui.c:857
+#, fuzzy
+msgid "Expecting a file system type."
+msgstr " ."
+
+#: parted/ui.c:863
+#, fuzzy, c-format
+msgid "Unknown file system type \"%s\"."
+msgstr " ."
+
+#: parted/ui.c:883
+msgid "Expecting a disk label type."
+msgstr ""
+
+#: parted/ui.c:977
+#, fuzzy
+msgid "Can't create any more partitions."
+msgstr " ."
+
+#: parted/ui.c:987
+#, fuzzy
+msgid "Expecting a partition type."
+msgstr " ."
+
+#: parted/ui.c:1115
+msgid "on"
+msgstr ""
+
+#: parted/ui.c:1116
+msgid "off"
+msgstr ""
+
+#: parted/ui.c:1227
+msgid "OPTIONs:"
+msgstr ":"
+
+#: parted/ui.c:1230
+msgid "COMMANDs:"
+msgstr ":"
+
+#: parted/ui.c:1238
+#, fuzzy, c-format
+msgid "Using %s\n"
+msgstr ""
+"\n"
+" %s\n"
+
+#, fuzzy
+#~ msgid ""
+#~ "This ext2 file system has a rather strange layout! Parted can't resize "
+#~ "this (yet)."
+#~ msgstr ""
+#~ " ext2 ! , "
+#~ " dumpe2fs "
+#~ "<buytenh@gnu.org>. , ."
+
+#, fuzzy
+#~ msgid "Disk geometry for %s: %s - %s\n"
+#~ msgstr " : 1-%d, %dk \n"
+
+#, fuzzy
+#~ msgid "set NUMBER FLAG STATE change a flag on partition NUMBER"
+#~ msgstr ""
+#~ "resize MINOR "
+#~ "MINOR"
+
+#, fuzzy
+#~ msgid ""
+#~ "The sector size on %s is %d bytes. Parted is known not to work properly "
+#~ "with drives with sector sizes other than %d bytes."
+#~ msgstr ""
+#~ " %s %d . , Parted "
+#~ " , 512 "
+
+#~ msgid ""
+#~ "You found a bug in GNU Parted. Please email a bug report to bug-"
+#~ "parted@gnu.org containing the version (%s), and the following message:\n"
+#~ msgstr ""
+#~ " GNU parted. , \n"
+#~ " bug-parted@gnu.org, (%s) \n"
+#~ " :\n"
+
+#, fuzzy
+#~ msgid "File system has an invalid signature for a FAT file systems."
+#~ msgstr " FAT ."
+
+#, fuzzy
+#~ msgid "Filesystem "
+#~ msgstr " !"
+
+#~ msgid "Device %s is neither a SCSI nor IDE drive."
+#~ msgstr " %s SCSI, IDE ."
+
+#~ msgid "Error reading %s (%s) to determine if partition is mounted."
+#~ msgstr ""
+#~ " %s (%s) , "
+#~ "."
+
+#~ msgid "Could not read geometry of %s - %s."
+#~ msgstr " %s - %s."
+
+#~ msgid "Device %s has dodgey geometry."
+#~ msgstr " %s ."
+
+#, fuzzy
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. However, the most likely reason is that Linux "
+#~ "detected the BIOS geometry for %s incorrectly. GNU Parted suspects the "
+#~ "real geometry should be %d/%d/%d (not %d/%d/%d). You should check with "
+#~ "your BIOS first, as this may not be correct. You can inform Linux by "
+#~ "adding the parameter %s=%d,%d,%d to the command line. See the LILO or "
+#~ "GRUB documentation for more information. If you think Parted's suggested "
+#~ "geometry is correct, you may select Ignore to continue (and fix Linux "
+#~ "later). Otherwise, select Cancel (and fix Linux and/or the BIOS now)."
+#~ msgstr ""
+#~ " %s . , "
+#~ " . , , Linux "
+#~ " BIOS %s. GNU Parted , "
+#~ " %d/%d/%d ( %d/%d/%d). "
+#~ " BIOS, . "
+#~ " Linux, %s=%d,%d,%d. "
+#~ " , . LILO. , "
+#~ " Parted , "
+#~ " ( Linux ). , ( "
+#~ " Linux / BIOS )."
+
+#, fuzzy
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. Often, the reason is that Linux detected the "
+#~ "BIOS geometry incorrectly. However, this does not appear to be the case "
+#~ "here. It is safe to ignore,but ignoring may cause (fixable) problems "
+#~ "with some boot loaders, and may cause problems with FAT file systems. "
+#~ "Using LBA is recommended."
+#~ msgstr ""
+#~ " %s. "
+#~ " . , Linux "
+#~ " BIOS. , , , ."
+
+#, fuzzy
+#~ msgid ""
+#~ "The operating system thinks the geometry on %s is %d/%d/%d. Therefore, "
+#~ "cylinder 1024 ends at %.3fM.%s"
+#~ msgstr ""
+#~ " %s %d/%d/%d. "
+#~ " , , "
+#~ ", BIOS."
+
+#, fuzzy
+#~ msgid "Partition %s is being used."
+#~ msgstr " ."
+
+#, fuzzy
+#~ msgid "START and END are in megabytes\n"
+#~ msgstr "START END \n"
+
+#~ msgid ""
+#~ "This swap partition is not compatible with Linux version 2.1.117 or "
+#~ "earlier. Use a smaller partition (maximum size 128mb) if you want to use "
+#~ "old versions of Linux."
+#~ msgstr ""
+#~ " swap- Linux 2.1.117 . "
+#~ " ( 128), "
+#~ " Linux."
+
+#, fuzzy
+#~ msgid ""
+#~ "The new partition overlaps with another partition so badly that it isn't "
+#~ "obvious want you want!"
+#~ msgstr " ."
+
+#, fuzzy
+#~ msgid "Can't grow a partition onto used space."
+#~ msgstr ""
+#~ " , "
+#~ " ."
+
+#~ msgid ""
+#~ "The kernel was unable to re-read the partition table on %s (%s). This "
+#~ "means Linux knows nothing about any modifications you made. You should "
+#~ "reboot your computer before doing anything with %s."
+#~ msgstr ""
+#~ " %s (%s). , "
+#~ " Linux. "
+#~ " , - %s."
+
+#~ msgid "Insane! %d clusters!"
+#~ msgstr "! %d !"
+
+#~ msgid ""
+#~ "File system doesn't have expected sizes for Windows to like it. Number "
+#~ "of clusters is %d (%d expected); size of FATs is %d sectors (%d expected)."
+#~ msgstr ""
+#~ "Windows , . "
+#~ " %d ( %d); FAT %d ( %d)."
+
+#, fuzzy
+#~ msgid "No get_resize_constraint for %s!"
+#~ msgstr " get_min_size() %s!"
+
+#~ msgid ""
+#~ "The filesystem is going to be too big for FAT16, so FAT32 will be used. "
+#~ "This is not compatible with MS-DOS, early versions of MS-Windows 95 and "
+#~ "Windows NT. If you use these operating systems, then select cancel, and "
+#~ "create a smaller partition. If you only use Linux, BSD, MS Windows 98 "
+#~ "and/or MS Windows 95 B, then select OK."
+#~ msgstr ""
+#~ " FAT16, "
+#~ " FAT32. MS-DOS, MS-"
+#~ "Windows 95 Windows NT. , "
+#~ " . "
+#~ "Linux, BSD, MS Windows 98 / MS Widnows 95 B, OK."
+
+#~ msgid "Weird: fat_calc_sizes() failed for FAT32!"
+#~ msgstr ": fat_calc_sizes() FAT32!"
+
+#~ msgid ""
+#~ "Would you like to use FAT32 for this filesystem? It is much more "
+#~ "efficient with your disk space, but is not compatible with early versions "
+#~ "of Windows 95 and Windows NT. Only select yes if you only use Linux, "
+#~ "BSD, MS Windows 98 and/or MS Windows 95 B."
+#~ msgstr ""
+#~ " FAT32 ? "
+#~ " , "
+#~ " Windows 95 Windows NT. `' , "
+#~ " Linux, BSD, MS Windows 98 / MS Windows 95 B."
+
+#, fuzzy
+#~ msgid "Can't set non-Linux partitions as a root device."
+#~ msgstr " ."
+
+#, fuzzy
+#~ msgid "Can't set non-Linux partitions as a swap device."
+#~ msgstr " ."
+
+#, fuzzy
+#~ msgid "Linux-swap partitions can not be hidden on msdos disk labels."
+#~ msgstr "swap- Linux ."
+
+#, fuzzy
+#~ msgid "Linux-swap partitions can not be bootable on pc98 disk labels."
+#~ msgstr "swap- Linux ."
+
+#, fuzzy
+#~ msgid "HFS partitions can't be hidden on msdos disk labels."
+#~ msgstr " ext2 ."
+
+#, fuzzy
+#~ msgid "JFS partitions can't be hidden on msdos disk labels."
+#~ msgstr " ext2 ."
+
+#, fuzzy
+#~ msgid "XFS partitions can't be hidden on msdos disk labels."
+#~ msgstr " ext2 ."
+
+#~ msgid "unknown"
+#~ msgstr ""
+
+#~ msgid "Unknown SCSI"
+#~ msgstr " SCSI"
+
+#~ msgid "Creating new %s disklabels is not implemented yet."
+#~ msgstr " %s ."
+
+#~ msgid "The code to write the partition table hasn't been written for %s yet"
+#~ msgstr " %s "
+
+#, fuzzy
+#~ msgid ""
+#~ "Partition size (%ld sectors) and filesystem size (%ld sectors) do not "
+#~ "match."
+#~ msgstr ""
+#~ " (%ld ) (%d ) "
+#~ "."
+
+#, fuzzy
+#~ msgid "Reiserfs partitions can't be hidden on msdos disk labels."
+#~ msgstr " ext2 ."
+
+#, fuzzy
+#~ msgid "Reiserfs partitions must be bootable on pc98 disk labels."
+#~ msgstr "swap- Linux ."
+
+#, fuzzy
+#~ msgid "NTFS partitions can't be hidden on msdos disk labels."
+#~ msgstr " ext2 ."
+
+#~ msgid ""
+#~ "The operating system thinks the geometry on %s is %d/%d/%d. You should "
+#~ "check that this matches the BIOS geometry before using this program."
+#~ msgstr ""
+#~ " %s %d/%d/%d. "
+#~ " , , "
+#~ ", BIOS."
+
+#, fuzzy
+#~ msgid ""
+#~ "There is no boot code on this disk. Would you like to use GNU Parted's "
+#~ "boot loader?"
+#~ msgstr ""
+#~ " . GNU "
+#~ "parted?"
+
+#, fuzzy
+#~ msgid "No set_system() for %s!"
+#~ msgstr " get_system() %s!"
+
+#~ msgid ""
+#~ "Would you like to use FAT32? It is more efficient, but it is not "
+#~ "compatible with MS-DOS, early versions of MS-Windows 95 and Windows NT. "
+#~ "If you use these operating systems, then select No. If you only use "
+#~ "Linux, BSD, MS Windows 98 and/or MS Windows 95 B, then you may select Yes."
+#~ msgstr ""
+#~ " FAT32? , "
+#~ "MS-DOS, MS-Windows 95 Windows NT. "
+#~ " , . "
+#~ "Linux, BSD, MS Windows 98 / MS Widnows 95 B, ."
+
+#~ msgid ""
+#~ "The filesystem is going to be too big for FAT16, so FAT32 must be used. "
+#~ "This is not compatible with MS-DOS, early versions of MS-Windows 95 and "
+#~ "Windows NT. If you use these operating systems, then select Cancel, and "
+#~ "create a smaller partition. If you only use Linux, BSD, MS Windows 98 "
+#~ "and/or MS Windows 95 B, then select OK."
+#~ msgstr ""
+#~ " FAT16, "
+#~ " FAT32. MS-DOS, MS-"
+#~ "Windows 95 Windows NT. , "
+#~ " . "
+#~ "Linux, BSD, MS Windows 98 / MS Widnows 95 B, OK."
+
+#~ msgid ""
+#~ "No filesystem found on partition. Can't determine what partition system "
+#~ "to use."
+#~ msgstr ""
+#~ " . , "
+#~ " ."
+
+#~ msgid "FAT filesystems don't have an id for non-msdos partition tables"
+#~ msgstr ""
+#~ " FAT -msdos "
+
+#~ msgid "hide"
+#~ msgstr "hide"
+
+#, fuzzy
+#~ msgid "Minor Start End Type Filesystem Flags\n"
+#~ msgstr " \n"
+
+#~ msgid "unhide"
+#~ msgstr "unhide"
+
+#~ msgid "hide MINOR hides partition MINOR"
+#~ msgstr "hide MINOR MINOR"
+
+#~ msgid "Can't create a partition with the start after the end."
+#~ msgstr ""
+#~ " , ."
diff --git a/po/sv.po b/po/sv.po
new file mode 100644
index 0000000..247fe38
--- /dev/null
+++ b/po/sv.po
@@ -0,0 +1,2634 @@
+# Swedish messages for parted
+# Copyright 2001 Jrgen Tegnr.
+# Jrgen Tegnr <jorgen.tegner@telia.com>, 2001.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: parted 1.4.18\n"
+"Report-Msgid-Bugs-To: bug-parted@gnu.org\n"
+"POT-Creation-Date: 2006-04-21 21:20+0200\n"
+"PO-Revision-Date: 2001-08-26 23:09+0200\n"
+"Last-Translator: Jrgen Tegnr <jorgen.tegner@telia.com>\n"
+"Language-Team: Swedish <sv@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=iso-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: libparted/arch/linux.c:284
+#, c-format
+msgid "Could not stat device %s - %s."
+msgstr "Kunde inte ta status p enheten %s - %s."
+
+#: libparted/arch/linux.c:390
+#, c-format
+msgid ""
+"Could not determine sector size for %s: %s.\n"
+"Using the default sector size (%lld)."
+msgstr ""
+
+#: libparted/arch/linux.c:401
+#, c-format
+msgid ""
+"Device %s has a logical sector size of %lld. Not all parts of GNU Parted "
+"support this at the moment, and the working code is HIGHLY EXPERIMENTAL.\n"
+msgstr ""
+
+#: libparted/arch/linux.c:441
+#, fuzzy, c-format
+msgid "Unable to determine the size of %s (%s)."
+msgstr "Kunde inte avgra storleken p %s (%s)"
+
+#: libparted/arch/linux.c:530
+#, c-format
+msgid "Could not get identity of device %s - %s"
+msgstr "Kunde inte hitta identitet fr enhet %s - %s"
+
+#: libparted/arch/linux.c:539
+msgid "Generic IDE"
+msgstr ""
+
+#: libparted/arch/linux.c:556
+#, c-format
+msgid ""
+"Device %s has multiple (%d) logical sectors per physical sector.\n"
+"GNU Parted supports this EXPERIMENTALLY for some special disk label/file "
+"system combinations, e.g. GPT and ext2/3.\n"
+"Please consult the web site for up-to-date information."
+msgstr ""
+
+#: libparted/arch/linux.c:726
+#, c-format
+msgid "Error initialising SCSI device %s - %s"
+msgstr "Ett fel uppstod vid initiering av SCSI-enheten %s - %s"
+
+#: libparted/arch/linux.c:781
+#, c-format
+msgid ""
+"The device %s has zero length, and can't possibly store a file system or "
+"partition table. Perhaps you selected the wrong device?"
+msgstr ""
+
+#: libparted/arch/linux.c:829
+msgid ""
+"Unable to determine geometry of file/device. You should not use Parted "
+"unless you REALLY know what you're doing!"
+msgstr ""
+"Kunde inte avgra geometrin p filen/enheten. Du br inte anvnda Parted om "
+"du inte r RIKTIGT sker p vad du gr!"
+
+#: libparted/arch/linux.c:903
+msgid "DAC960 RAID controller"
+msgstr "Styrkort fr DAC960 RAID"
+
+#: libparted/arch/linux.c:908
+msgid "Compaq Smart Array"
+msgstr "Compaq Smart Array"
+
+#: libparted/arch/linux.c:913
+msgid "ATARAID Controller"
+msgstr "Styrkort fr ATARAID"
+
+#: libparted/arch/linux.c:918
+#, fuzzy
+msgid "I2O Controller"
+msgstr "Styrkort fr ATARAID"
+
+#: libparted/arch/linux.c:923
+msgid "User-Mode Linux UBD"
+msgstr ""
+
+#: libparted/arch/linux.c:933
+msgid "Unknown"
+msgstr "Oknd"
+
+#: libparted/arch/linux.c:940
+msgid "ped_device_new() Unsupported device type"
+msgstr "ped_device_new() Std saknas fr den hr enhetstypen"
+
+#: libparted/arch/linux.c:1041 libparted/arch/gnu.c:264
+#, c-format
+msgid "Error opening %s: %s"
+msgstr "Ett fel uppstod nr %s ppnades: %s"
+
+#: libparted/arch/linux.c:1052 libparted/arch/gnu.c:274
+#, c-format
+msgid "Unable to open %s read-write (%s). %s has been opened read-only."
+msgstr ""
+"Kunde inte ppna %s fr bde lsning och skrivning (%s). %s ppnades i "
+"lslge."
+
+#: libparted/arch/linux.c:1160 libparted/arch/linux.c:1228
+#: libparted/arch/gnu.c:452 libparted/arch/gnu.c:550 libparted/arch/gnu.c:678
+#, c-format
+msgid "%s during read on %s"
+msgstr "%s under lsning p %s"
+
+#: libparted/arch/linux.c:1199
+#, c-format
+msgid "%s during seek for read on %s"
+msgstr "%s under positionering fr att lsa p %s"
+
+#: libparted/arch/linux.c:1270 libparted/arch/linux.c:1355
+#: libparted/arch/linux.c:1413 libparted/arch/gnu.c:587
+#: libparted/arch/gnu.c:632 libparted/arch/gnu.c:709
+#, c-format
+msgid "%s during write on %s"
+msgstr "%s under skrivning p %s"
+
+#: libparted/arch/linux.c:1297 libparted/arch/gnu.c:512
+#, c-format
+msgid "Can't write to %s, because it is opened read-only."
+msgstr "Kan inte skriva till %s eftersom den endast r ppnad i lslge."
+
+#: libparted/arch/linux.c:1321
+#, c-format
+msgid "%s during seek for write on %s"
+msgstr "%s under positionering fr att skriva p %s"
+
+#: libparted/arch/linux.c:1798
+#, fuzzy, c-format
+msgid ""
+"Error informing the kernel about modifications to partition %s -- %s. This "
+"means Linux won't know about any changes you made to %s until you reboot -- "
+"so you shouldn't mount it or use it in any way before rebooting."
+msgstr ""
+"Krnan kunde inte lsa om partitionstabellen p %s (%s). Det betyder att "
+"Linux inte vet nnting om de ndringar du gjort. Du br starta om datorn "
+"innan du gr nnting med %s."
+
+#: libparted/arch/linux.c:1879
+#, fuzzy, c-format
+msgid ""
+"The kernel was unable to re-read the partition table on %s (%s). This means "
+"Linux won't know anything about the modifications you made until you "
+"reboot. You should reboot your computer before doing anything with %s."
+msgstr ""
+"Krnan kunde inte lsa om partitionstabellen p %s (%s). Det betyder att "
+"Linux inte vet nnting om de ndringar du gjort. Du br starta om datorn "
+"innan du gr nnting med %s."
+
+#: libparted/arch/gnu.c:97
+#, c-format
+msgid "Unable to open %s."
+msgstr ""
+
+#: libparted/arch/gnu.c:117
+#, fuzzy
+msgid "Unable to probe store."
+msgstr "Kunde inte placera partitionen p jmn cylindergrns."
+
+#: libparted/arch/gnu.c:355
+#, fuzzy
+msgid ""
+"The partition table cannot be re-read. This means you need to reboot before "
+"mounting any modified partitions. You also need to reinstall your boot "
+"loader before you reboot (which may require mounting modified partitions). "
+"It is impossible do both things! So you'll need to boot off a rescue disk, "
+"and reinstall your boot loader from the rescue disk. Read section 4 of the "
+"Parted User documentation for more information."
+msgstr ""
+"Krnan kunde inte lsa om partitionstabellen, s du mste starta om datorn "
+"innan du kan montera ngon ndrad partition. Du mste ocks installera om "
+"startprogrammet innan du startar om (vilket kan innebra montering av "
+"ndrade partitioner). Det r omjligt att gra bda! Du mste starta frn en "
+"rddningsskiva och installera om startprogrammet frn den. Ls kapitel fyra "
+"i Parteds anvndarmanual fr mer information."
+
+#: libparted/arch/gnu.c:372
+#, fuzzy, c-format
+msgid ""
+"The partition table on %s cannot be re-read (%s). This means the Hurd knows "
+"nothing about any modifications you made. You should reboot your computer "
+"before doing anything with %s."
+msgstr ""
+"Krnan kunde inte lsa om partitionstabellen p %s (%s). Det betyder att "
+"Linux inte vet nnting om de ndringar du gjort. Du br starta om datorn "
+"innan du gr nnting med %s."
+
+#: libparted/arch/gnu.c:383 parted/parted.c:2215
+msgid ""
+"You should reinstall your boot loader before rebooting. Read section 4 of "
+"the Parted User documentation for more information."
+msgstr ""
+"Du br installera om startprogrammet innan du startar om. Ls sektion fyra i "
+"Parteds anvndarmanual fr mer information."
+
+#: libparted/arch/gnu.c:774
+#, c-format
+msgid "%s trying to sync %s to disk"
+msgstr ""
+
+#: libparted/disk.c:183
+#, c-format
+msgid "Unable to open %s - unrecognised disk label."
+msgstr "Kan inte ppna %s - oknd filallokeringstabell."
+
+#: libparted/disk.c:452
+#, fuzzy, c-format
+msgid ""
+"This libparted doesn't have write support for %s. Perhaps it was compiled "
+"read-only."
+msgstr "Kan inte skriva till %s eftersom den endast r ppnad i lslge."
+
+#: libparted/disk.c:579
+#, fuzzy, c-format
+msgid "Partition %d is %s, but the file system is %s."
+msgstr "Partitionen fr liten fr att hlla ett filsystem av typen FAT"
+
+#: libparted/disk.c:1056
+#, c-format
+msgid "%s disk labels do not support extended partitions."
+msgstr "Filallokeringstabeller fr %s stdjer inte utkade partitioner."
+
+#: libparted/disk.c:1616
+#, c-format
+msgid "%s disk labels don't support logical or extended partitions."
+msgstr ""
+"Filallokeringstalbeller fr %s stdjer inte logiska eller utkade "
+"partitioner."
+
+#: libparted/disk.c:1629
+#, fuzzy
+msgid "Too many primary partitions."
+msgstr "Fr mnga dliga sidor."
+
+#: libparted/disk.c:1638
+#, c-format
+msgid ""
+"Can't add a logical partition to %s, because there is no extended partition."
+msgstr ""
+"Kan inte lgga till en logisk partition till %s, eftersom det saknas en "
+"utkad partition."
+
+#: libparted/disk.c:1662
+#, fuzzy, c-format
+msgid "Can't have more than one extended partition on %s."
+msgstr "Kan inte ha fler n en utkad partition p %s"
+
+#: libparted/disk.c:1672
+#, fuzzy
+msgid "Can't have logical partitions outside of the extended partition."
+msgstr ""
+"Kan inte lta en logisk partition vxa ut utanfr den utkade partitionen."
+
+#: libparted/disk.c:1697
+#, fuzzy, c-format
+msgid "Can't have a logical partition outside of the extended partition on %s."
+msgstr ""
+"Kan inte lgga till en logisk partition utanfr en utkad partition p %s."
+
+#: libparted/disk.c:1707 libparted/disk.c:1761 libparted/disk.c:1927
+#, fuzzy
+msgid "Can't have overlapping partitions."
+msgstr "Kan inte kopiera till en verlappande partition."
+
+#: libparted/disk.c:1715
+#, fuzzy
+msgid "Can't have a primary partition inside an extended partition."
+msgstr "Kan inte lgga till en primr partition inuti en utkad."
+
+#: libparted/disk.c:2123
+msgid "metadata"
+msgstr "metadata"
+
+#: libparted/disk.c:2125
+msgid "free"
+msgstr "ledigt"
+
+#: libparted/disk.c:2127 parted/ui.c:968 parted/ui.c:996
+msgid "extended"
+msgstr "utkat"
+
+#: libparted/disk.c:2129 parted/ui.c:972 parted/ui.c:1000
+msgid "logical"
+msgstr "logiskt"
+
+#: libparted/disk.c:2131 parted/ui.c:964 parted/ui.c:992
+msgid "primary"
+msgstr "primr"
+
+#: libparted/disk.c:2147
+msgid "boot"
+msgstr "start"
+
+#: libparted/disk.c:2149
+msgid "root"
+msgstr "rot"
+
+#: libparted/disk.c:2151
+msgid "swap"
+msgstr "vxlingsutrymme"
+
+#: libparted/disk.c:2153
+msgid "hidden"
+msgstr "dold"
+
+#: libparted/disk.c:2155
+msgid "raid"
+msgstr "raid"
+
+#: libparted/disk.c:2157
+msgid "lvm"
+msgstr "lvm"
+
+#: libparted/disk.c:2159
+msgid "lba"
+msgstr "lba"
+
+#: libparted/disk.c:2161
+msgid "hp-service"
+msgstr ""
+
+#: libparted/disk.c:2163
+msgid "palo"
+msgstr ""
+
+#: libparted/disk.c:2165
+#, fuzzy
+msgid "prep"
+msgstr "start"
+
+#: libparted/disk.c:2167
+msgid "msftres"
+msgstr ""
+
+#: libparted/disk.c:2173
+#, fuzzy, c-format
+msgid "Unknown partition flag, %d."
+msgstr "Oknd partitionsflagga, %d."
+
+#: libparted/labels/rdb.c:177
+#, c-format
+msgid "%s : Bad checksum on block %llu of type %s."
+msgstr ""
+
+#: libparted/labels/rdb.c:510
+#, c-format
+msgid "%s : Didn't find rdb block, should never happen."
+msgstr ""
+
+#: libparted/labels/rdb.c:595
+#, c-format
+msgid "%s : Loop detected at block %d."
+msgstr ""
+
+#: libparted/labels/rdb.c:614
+#, c-format
+msgid "%s : The %s list seems bad at block %s."
+msgstr ""
+
+#: libparted/labels/rdb.c:703
+#, c-format
+msgid "%s : Failed to list bad blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:711
+#, c-format
+msgid "%s : Failed to list partition blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:719
+#, c-format
+msgid "%s : Failed to list file system blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:727
+#, c-format
+msgid "%s : Failed to list boot blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:750
+#, fuzzy, c-format
+msgid "Failed to write partition block at %d."
+msgstr "Kan inte avgra om partitionen r monterad."
+
+#: libparted/labels/rdb.c:1053 libparted/labels/bsd.c:505
+#: libparted/labels/dos.c:1942 libparted/labels/dvh.c:772
+#: libparted/labels/gpt.c:1365 libparted/labels/loop.c:251
+#: libparted/labels/mac.c:1318 libparted/labels/pc98.c:764
+#: libparted/labels/sun.c:704
+#, fuzzy
+msgid "Unable to satisfy all constraints on the partition."
+msgstr "Kunde inte placera partitionen p jmn cylindergrns."
+
+#: libparted/labels/rdb.c:1081
+#, fuzzy
+msgid "Unable to allocate a partition number."
+msgstr "Mlpartitionen r i bruk."
+
+#: libparted/labels/bsd.c:530
+#, fuzzy
+msgid "Unable to allocate a bsd disklabel slot."
+msgstr "Kan inte ppna %s - oknd filallokeringstabell."
+
+#: libparted/labels/dos.c:812
+#, fuzzy, c-format
+msgid "Invalid partition table on %s -- wrong signature %x."
+msgstr "Ogiltig partitionstabell p %s - felaktig signatur %x"
+
+#: libparted/labels/dos.c:840
+#, c-format
+msgid "Invalid partition table - recursive partition on %s."
+msgstr "Ogiltig partitionstabell - rekursiv partition p %s."
+
+#: libparted/labels/dos.c:1300
+#, fuzzy
+msgid "Extended partitions cannot be hidden on msdos disk labels."
+msgstr "Ext2-partitioner kan inte gmmas i filsystem av typen msdos."
+
+#: libparted/labels/dos.c:1926
+msgid "Parted can't resize partitions managed by Windows Dynamic Disk."
+msgstr ""
+
+#: libparted/labels/dvh.c:192
+#, fuzzy, c-format
+msgid "%s has no extended partition (volume header partition)."
+msgstr ""
+"Kan inte ndra storlek p en utkad partition fr att exkludera en logisk "
+"partition."
+
+#: libparted/labels/dvh.c:315
+msgid "Checksum is wrong, indicating the partition table is corrupt."
+msgstr ""
+
+#: libparted/labels/dvh.c:616
+#, fuzzy
+msgid "Only primary partitions can be root partitions."
+msgstr "Kan inte lgga till en primr partition inuti en utkad."
+
+#: libparted/labels/dvh.c:630
+#, fuzzy
+msgid "Only primary partitions can be swap partitions."
+msgstr "Kan inte lgga till en primr partition inuti en utkad."
+
+#: libparted/labels/dvh.c:644
+#, fuzzy
+msgid "Only logical partitions can be a boot file."
+msgstr "Kan inte lgga till en primr partition inuti en utkad."
+
+#: libparted/labels/dvh.c:723
+msgid "Only logical partitions (boot files) have a name."
+msgstr ""
+
+#: libparted/labels/dvh.c:814
+#, fuzzy
+msgid "Too many primary partitions"
+msgstr "Fr mnga dliga sidor."
+
+#: libparted/labels/gpt.c:433
+#, c-format
+msgid ""
+"%s contains GPT signatures, indicating that it has a GPT table. However, it "
+"does not have a valid fake msdos partition table, as it should. Perhaps it "
+"was corrupted -- possibly by a program that doesn't understand GPT partition "
+"tables. Or perhaps you deleted the GPT table, and are now using an msdos "
+"partition table. Is this a GPT partition table?"
+msgstr ""
+
+#: libparted/labels/gpt.c:625
+#, c-format
+msgid ""
+"The format of the GPT partition table is version %x, which is newer than "
+"what Parted can recognise. Please tell us! bug-parted@gnu.org"
+msgstr ""
+
+#: libparted/labels/gpt.c:747
+msgid ""
+"The backup GPT table is not at the end of the disk, as it should be. This "
+"might mean that another operating system believes the disk is smaller. Fix, "
+"by moving the backup to the end (and removing the old backup)?"
+msgstr ""
+
+#: libparted/labels/gpt.c:782
+msgid ""
+"The primary GPT table is corrupt, but the backup appears OK, so that will be "
+"used."
+msgstr ""
+
+#: libparted/labels/gpt.c:790
+msgid ""
+"Both the primary and backup GPT tables are corrupt. Try making a fresh "
+"table, and using Parted's rescue feature to recover partitions."
+msgstr ""
+
+#: libparted/labels/mac.c:167
+#, c-format
+msgid "Invalid signature %x for Mac disk labels."
+msgstr "Ogiltig signatur %x fr en filallokeringstabell fr Mac."
+
+#: libparted/labels/mac.c:212
+msgid "Partition map has no partition map entry!"
+msgstr "Partitionstabellen saknar uppgift om sig sjlv!"
+
+#: libparted/labels/mac.c:259
+#, c-format
+msgid "%s is too small for a Mac disk label!"
+msgstr "%s r fr liten fr en filallokeringstabell fr Mac!"
+
+#: libparted/labels/mac.c:490
+#, c-format
+msgid "Partition %d has an invalid signature %x."
+msgstr "Partition %d har en ogiltig signatur %x."
+
+#: libparted/labels/mac.c:508
+#, c-format
+msgid "Partition %d has an invalid length of 0 bytes!"
+msgstr "Partition %d har en ogiltig lngd, 0 byte!"
+
+#: libparted/labels/mac.c:536
+#, fuzzy
+msgid "The data region doesn't start at the start of the partition."
+msgstr "Dataomrdet brjar inte vid partitionens brjan"
+
+#: libparted/labels/mac.c:553
+#, fuzzy
+msgid "The boot region doesn't start at the start of the partition."
+msgstr "Startomrdet brjar inte vid partitionens brjan"
+
+#: libparted/labels/mac.c:567
+msgid "The partition's boot region doesn't occupy the entire partition."
+msgstr "Partitionens startomrde tar inte upp hela partitionens utrymme."
+
+#: libparted/labels/mac.c:577
+msgid "The partition's data region doesn't occupy the entire partition."
+msgstr "Partitionens dataomrde tar inte upp hela partitionens utrymme."
+
+#: libparted/labels/mac.c:631
+#, c-format
+msgid ""
+"Weird block size on device descriptor: %d bytes is not divisible by 512."
+msgstr ""
+"Konstig blockstorlek p enhetens handtag: %d byte r inte jmnt delbart med "
+"512."
+
+#: libparted/labels/mac.c:644
+#, c-format
+msgid ""
+"The driver descriptor says the physical block size is %d bytes, but Linux "
+"says it is %d bytes."
+msgstr ""
+"Enhetens handtag pstr att den fysiska blockstorleken r %d byte, men Linux "
+"pstr att den r %d byte."
+
+#: libparted/labels/mac.c:692
+msgid "No valid partition map found."
+msgstr "Ingen giltig partitionstabell kunde hittas."
+
+#: libparted/labels/mac.c:744
+#, fuzzy, c-format
+msgid ""
+"Conflicting partition map entry sizes! Entry 1 says it is %d, but entry %d "
+"says it is %d!"
+msgstr ""
+"Motsgelsefulla storleksdata i partitionstabellen! Post ett pstr sig vara %"
+"d medan post %d pstr sig vara %d!"
+
+#: libparted/labels/mac.c:771
+#, fuzzy
+msgid "Weird! There are 2 partitions map entries!"
+msgstr "Konstigt - tv poster i partitionstabellen!"
+
+#: libparted/labels/mac.c:1257
+msgid ""
+"Changing the name of a root or swap partition will prevent Linux from "
+"recognising it as such."
+msgstr ""
+"Att ndra namnet p en rot- eller vxlingspartition gr att Linux inte kan "
+"knna igen dem."
+
+#: libparted/labels/mac.c:1353
+#, fuzzy
+msgid "Can't add another partition -- the partition map is too small!"
+msgstr ""
+"Kan inte lgga till en till primr partition - partitionstabellen r fr "
+"liten."
+
+#: libparted/labels/pc98.c:357
+#, fuzzy, c-format
+msgid "Invalid partition table on %s."
+msgstr "Ogiltig partitionstabell p %s"
+
+#: libparted/labels/pc98.c:409 libparted/labels/pc98.c:487
+#, fuzzy, c-format
+msgid ""
+"Partition %d isn't aligned to cylinder boundaries. This is still "
+"unsupported."
+msgstr ""
+"Partitionen %d ligger inte p jmna cylindergrnser. Mste lgga till std "
+"fr detta."
+
+#: libparted/labels/pc98.c:796
+msgid "Can't add another partition."
+msgstr "Kan inte lgga till nnu en partition."
+
+#: libparted/labels/sun.c:143
+msgid "Corrupted Sun disk label detected."
+msgstr ""
+
+#: libparted/labels/sun.c:264
+#, c-format
+msgid ""
+"The disk CHS geometry (%d,%d,%d) reported by the operating system does not "
+"match the geometry stored on the disk label (%d,%d,%d)."
+msgstr ""
+
+#: libparted/labels/sun.c:286
+#, c-format
+msgid "The disk label describes a disk bigger than %s."
+msgstr ""
+
+#: libparted/labels/sun.c:440
+#, c-format
+msgid "The disk has %d cylinders, which is greater than the maximum of 65536."
+msgstr ""
+
+#: libparted/labels/sun.c:736
+msgid ""
+"The Whole Disk partition is the only available one left. Generally, it is "
+"not a good idea to overwrite this partition with a real one. Solaris may "
+"not be able to boot without it, and SILO (the sparc boot loader) appreciates "
+"it as well."
+msgstr ""
+
+#: libparted/labels/sun.c:751
+msgid "Sun disk label is full."
+msgstr ""
+
+#: libparted/filesys.c:386
+msgid "Could not detect file system."
+msgstr "Kunde inte hitta ngot filsystem."
+
+#: libparted/filesys.c:397
+msgid "The file system is bigger than its volume!"
+msgstr ""
+
+#: libparted/filesys.c:405
+#, c-format
+msgid "Support for opening %s file systems is not implemented yet."
+msgstr "Std fr att ppna filsystem av typ %s r inte implementerat n."
+
+#: libparted/filesys.c:447
+#, c-format
+msgid "Support for creating %s file systems is not implemented yet."
+msgstr "Std fr att skapa filsystem av typ %s r inte implementerat n."
+
+#: libparted/filesys.c:508
+#, c-format
+msgid "Support for checking %s file systems is not implemented yet."
+msgstr "Std fr att kontrollera filsystem av typ %s r inte implementerat n."
+
+#: libparted/filesys.c:574
+msgid "raw block copying"
+msgstr ""
+
+#: libparted/filesys.c:585
+#, fuzzy
+msgid "growing file system"
+msgstr "Oknd filsystemstyp."
+
+#: libparted/filesys.c:625
+msgid "Can't copy onto an overlapping partition."
+msgstr "Kan inte kopiera till en verlappande partition."
+
+#: libparted/filesys.c:647
+#, fuzzy, c-format
+msgid ""
+"Direct support for copying file systems is not yet implemented for %s. "
+"However, support for resizing is implemented. Therefore, the file system "
+"can be copied if the new partition is at least as big as the old one. So, "
+"either shrink the partition you are trying to copy, or copy to a bigger "
+"partition."
+msgstr ""
+"Direkt std fr att kopiera filsystem av typen %s r inte implementerat n. "
+"Std fr att ndra storlek finns dock. Drfr kan filsystemet kopieras om "
+"den nya partitionen r minst lika stor som den gamla. S antingen fr du "
+"minska partitionen som du frsker kopiera, eller s kopierar du till en "
+"strre partition."
+
+#: libparted/filesys.c:661
+#, c-format
+msgid "Support for copying %s file systems is not implemented yet."
+msgstr "Std fr att kopiera filsystem av typ %s r inte implementerat n."
+
+#: libparted/filesys.c:699
+#, c-format
+msgid "Support for resizing %s file systems is not implemented yet."
+msgstr ""
+"Std fr att ndra storlek p filsystem av typ %s r inte implementerat n."
+
+#: libparted/exception.c:78
+msgid "Information"
+msgstr "Information"
+
+#: libparted/exception.c:79
+msgid "Warning"
+msgstr "Varning"
+
+#: libparted/exception.c:80
+msgid "Error"
+msgstr "Fel"
+
+#: libparted/exception.c:81
+msgid "Fatal"
+msgstr "desdiger"
+
+#: libparted/exception.c:82
+msgid "Bug"
+msgstr "Programfel"
+
+#: libparted/exception.c:83
+msgid "No Implementation"
+msgstr "Inte implementerat"
+
+#: libparted/exception.c:87
+msgid "Fix"
+msgstr "Reparera"
+
+#: libparted/exception.c:88
+msgid "Yes"
+msgstr "Ja"
+
+#: libparted/exception.c:89
+msgid "No"
+msgstr "Nej"
+
+#: libparted/exception.c:90
+msgid "OK"
+msgstr "OK"
+
+#: libparted/exception.c:91
+msgid "Retry"
+msgstr "Frsk igen"
+
+#: libparted/exception.c:92
+msgid "Ignore"
+msgstr "Ignorera"
+
+#: libparted/exception.c:93
+msgid "Cancel"
+msgstr "Avbryt"
+
+#: libparted/exception.c:133
+#, fuzzy, c-format
+msgid ""
+"A bug has been detected in GNU Parted. Refer to the web site of parted "
+"http://www.gnu.org/software/parted/parted.html for more informations of what "
+"could be useful for bug submitting! Please email a bug report to bug-"
+"parted@gnu.org containing at least the version (%s) and the following "
+"message: "
+msgstr ""
+"Skicka en felrapport med e-post till bug-parted@gnu.org, dr du tar med "
+"versionsnumret (%s) och fljande meddelande:"
+
+#: libparted/cs/geom.c:162
+msgid "Can't have the end before the start!"
+msgstr "Kan inte ha slutet fre brjan!"
+
+#: libparted/cs/geom.c:169
+msgid "Can't have a partition outside the disk!"
+msgstr "Kan inte ha en partition utanfr hrddisken!"
+
+#: libparted/cs/geom.c:303
+#, fuzzy, c-format
+msgid "Attempt to read sectors %ld-%ld outside of partition on %s."
+msgstr "Frskte lsa sektorerna %ld-%ld utanfr partitionen p %s"
+
+#: libparted/cs/geom.c:373
+#, fuzzy, c-format
+msgid "Attempt to write sectors %ld-%ld outside of partition on %s."
+msgstr "Frskte skriva sektorerna %ld-%ld utanfr partitionen p %s"
+
+#: libparted/cs/geom.c:413 libparted/fs/linux_swap/linux_swap.c:353
+msgid "checking for bad blocks"
+msgstr ""
+
+#: libparted/libparted.c:286 libparted/libparted.c:306
+msgid "Out of memory."
+msgstr "Slut p minne."
+
+#: libparted/unit.c:139
+msgid "Cannot get unit size for special unit 'COMPACT'."
+msgstr ""
+
+#: libparted/unit.c:382
+#, c-format
+msgid "\"%s\" has invalid syntax for locations."
+msgstr ""
+
+#: libparted/unit.c:390
+#, c-format
+msgid "The maximum head value is %d."
+msgstr ""
+
+#: libparted/unit.c:397
+#, c-format
+msgid "The maximum sector value is %d."
+msgstr ""
+
+#: libparted/unit.c:409 libparted/unit.c:540
+#, fuzzy, c-format
+msgid "The location %s is outside of the device %s."
+msgstr "Kan inte skapa en partition utanfr enheten."
+
+#: libparted/unit.c:522
+msgid "Invalid number."
+msgstr ""
+
+#: libparted/fs/ext2/ext2.c:87 libparted/fs/ext2/ext2.c:112
+msgid "Inconsistent group descriptors!"
+msgstr "Inkonsistenta grupphandtag!"
+
+#: libparted/fs/ext2/ext2.c:91 libparted/fs/ext2/ext2.c:116
+#, fuzzy
+msgid "File system full!"
+msgstr "Filsystemet r fullt!"
+
+#: libparted/fs/ext2/ext2.c:750
+#, fuzzy
+msgid "Invalid superblock. Are you sure this is an ext2 file system?"
+msgstr "Ogiltigt superblock. r du sker p att det hr r ett ext2-filsystem?"
+
+#: libparted/fs/ext2/ext2.c:764 libparted/fs/ext2/ext2_resize.c:597
+#, fuzzy
+msgid "File system has errors! You should run e2fsck."
+msgstr "Filsystemet innehller fel! Kr e2fsck frst."
+
+#: libparted/fs/ext2/ext2.c:775
+#, fuzzy
+msgid ""
+"File system was not cleanly unmounted! You should run e2fsck. Modifying an "
+"unclean file system could cause severe corruption."
+msgstr "Filsystemet har inte avmonterats p rtt stt! Anvnd e2fsck."
+
+#: libparted/fs/ext2/ext2.c:795
+#, fuzzy
+msgid "File system has an incompatible feature enabled."
+msgstr "Filsystemet har en inkompatibel finess aktiverad"
+
+#: libparted/fs/ext2/ext2.c:806
+msgid "Error allocating buffer cache."
+msgstr "Kunde inte reservera buffercache"
+
+#: libparted/fs/ext2/ext2.c:848
+msgid ""
+"A resize operation on this file system will use EXPERIMENTAL code that MAY "
+"CORRUPT it (although it hasn't done so yet).You should at least backup your "
+"data and run 'e2fsck -f' afterwards."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:114
+#, fuzzy
+msgid ""
+"Found an inode with a incorrect link count. Better go run e2fsck first!"
+msgstr "Hittade en inode med felaktiga antal lnkar. Kr e2fsck frst."
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:487
+msgid "Not enough free inodes!"
+msgstr "Det finns inte tillrckligt mnga fria inoder!"
+
+#: libparted/fs/ext2/ext2_resize.c:224
+#, fuzzy
+msgid "File system is too full to remove a group!"
+msgstr "Filsystemet r fr upptaget fr att ta bort en grupp!"
+
+#: libparted/fs/ext2/ext2_resize.c:233
+#, fuzzy
+msgid "File system has too many allocated inodes to remove a group!"
+msgstr "Filsystemet har fr mnga reserverade inoder fr att ta bort en grupp!"
+
+#: libparted/fs/ext2/ext2_resize.c:493
+msgid "adding groups"
+msgstr ""
+
+#: libparted/fs/ext2/ext2_resize.c:530
+#, fuzzy, c-format
+msgid "Your file system is too full to resize it to %i blocks. Sorry."
+msgstr "Filsystemet r fr upptaget fr att ndra dess storlek till %i block."
+
+#: libparted/fs/ext2/ext2_resize.c:540
+#, fuzzy, c-format
+msgid ""
+"Your file system has too many occupied inodes to resize it to %i blocks. "
+"Sorry."
+msgstr ""
+"Filsystemet har fr mnga upptagna inoder fr att ndra dess storlek till %i "
+"block."
+
+#: libparted/fs/ext2/ext2_resize.c:554 libparted/fs/hfs/hfs.c:243
+#: libparted/fs/hfs/hfs.c:624
+#, fuzzy
+msgid "shrinking"
+msgstr "Varning"
+
+#: libparted/fs/ext2/ext2_resize.c:605
+#, fuzzy
+msgid "File system was not cleanly unmounted! You should run e2fsck."
+msgstr "Filsystemet har inte avmonterats p rtt stt! Anvnd e2fsck."
+
+#: libparted/fs/ext2/ext2_resize.c:614
+msgid ""
+"The file system has the 'dir_index' feature enabled. Parted can only resize "
+"the file system if it disables this feature. You can enable it later by "
+"running 'tune2fs -O dir_index DEVICE' and then 'e2fsck -fD DEVICE'."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_block_relocator.c:198
+#, fuzzy
+msgid "Cross-linked blocks found! Better go run e2fsck first!"
+msgstr "Korslnkade block hittades! Kr e2fsck frst!"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:537
+#, fuzzy, c-format
+msgid "Block %i has no reference? Weird."
+msgstr "Block %i har ingen referens? Konstigt"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:738
+#, c-format
+msgid "Block %i shouldn't have been marked!"
+msgstr "Block %i borde ha markerats!"
+
+#: libparted/fs/ext2/interface.c:188
+#, fuzzy
+msgid ""
+"The ext2 file system passed a basic check. For a more comprehensive check, "
+"use the e2fsck program."
+msgstr ""
+"Filsystemet (e2fs) klarade ett grundlggande test. Fr ett mer genomgende "
+"test, anvnd programmet e2fsck."
+
+#: libparted/fs/ext2/interface.c:205
+msgid "Sorry, can't move the start of ext2 partitions yet!"
+msgstr "Kan inte flytta en ext2-partitions brjan nnu!"
+
+#: libparted/fs/ext2/ext2_buffer.c:82
+msgid "Couldn't flush buffer cache!"
+msgstr "Kunde inte rensa buffercachen!"
+
+#: libparted/fs/ext2/ext2_mkfs.c:162
+msgid "writing per-group metadata"
+msgstr ""
+
+#: libparted/fs/ext2/ext2_mkfs.c:565
+msgid "File system too small for ext2."
+msgstr ""
+
+#: libparted/fs/fat/calc.c:134
+#, fuzzy, c-format
+msgid ""
+"You need %s of free disk space to shrink this partition to this size. "
+"Currently, only %s is free."
+msgstr ""
+"Du behver %dM ledigt utrymme fr att minska storleken p den hr "
+"partitionen till angiven storlek. (det finns endast %dM ledigt)"
+
+#: libparted/fs/fat/context.c:55
+#, c-format
+msgid ""
+"Cluster start delta = %d, which is not a multiple of the cluster size %d."
+msgstr ""
+"Klustrets startdifferens r %d, vilket inte r en multipel av "
+"klusterstorleken %d"
+
+#: libparted/fs/fat/fat.c:312
+#, fuzzy, c-format
+msgid "Partition too big/small for a %s file system."
+msgstr "Partitionen fr liten fr att hlla ett filsystem av typen FAT"
+
+#: libparted/fs/fat/fat.c:478
+msgid ""
+"The FATs don't match. If you don't know what this means, then select "
+"cancel, run scandisk on the file system, and then come back."
+msgstr ""
+"Filallokeringstabellerna stmmer inte verens. Om du inte vet vad detta "
+"betyder, vlj avbryt, kr scandisk p filsystemet och frsk igen."
+
+#: libparted/fs/fat/fat.c:518
+msgid "There are no possible configurations for this FAT type."
+msgstr "Det finns inga mjliga kombinationer fr den hr sortens FAT."
+
+#: libparted/fs/fat/fat.c:530
+#, c-format
+msgid ""
+"File system doesn't have expected sizes for Windows to like it. Cluster "
+"size is %dk (%dk expected); number of clusters is %d (%d expected); size of "
+"FATs is %d sectors (%d expected)."
+msgstr ""
+"Filsystemet har inte en storlek som Windows gillar. Klusterstorleken r %dk "
+"(%dk frvntas); antalet kluster r %d (%d frvntas); storleken p FAT:arna "
+"r %d sektorer (%d frvntas)."
+
+#: libparted/fs/fat/fat.c:553
+#, c-format
+msgid ""
+"File system is reporting the free space as %d clusters, not %d clusters."
+msgstr "Filsystemet menar att det fria utrymmet r %d kluster, inte %d."
+
+#: libparted/fs/fat/fat.c:878
+#, fuzzy
+msgid ""
+"GNU Parted was miscompiled: the FAT boot sector should be 512 bytes. FAT "
+"support will be disabled."
+msgstr ""
+"GNU Parted kompilerades felaktigt: FAT's startsektor skall vara 512 byte. "
+"Stdet fr FAT kommer att blockeras."
+
+#: libparted/fs/fat/resize.c:158
+#, fuzzy
+msgid ""
+"There's not enough room in the root directory for all of the files. Either "
+"cancel, or ignore to lose the files."
+msgstr ""
+"Det finns inte tillrckligt med utrymme fr alla filer i rotkatalogen. Vlj "
+"antingen att avbryta, eller ignorera och frlora filerna."
+
+#: libparted/fs/fat/resize.c:299
+msgid "Error writing to the root directory."
+msgstr "Ett fel uppstod vid skrivning till rotkatalogen."
+
+#: libparted/fs/fat/resize.c:484
+#, fuzzy
+msgid "If you leave your file system as FAT16, then you will have no problems."
+msgstr ""
+"Om du lter filsystemet fortstta vara FAT16 kommer du inte att f ngra "
+"bekymmer."
+
+#: libparted/fs/fat/resize.c:487
+msgid ""
+"If you convert to FAT16, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual)."
+msgstr ""
+"Om du konverterar till FAT16 och MS Windows r installerad p den hr "
+"partitionen s mste du installera om MS Windows startprogram. Om du gr det "
+"br du studera Parteds manual (eller din distributions manual)."
+
+#: libparted/fs/fat/resize.c:495
+msgid ""
+"If you leave your file system as FAT32, then you will not introduce any new "
+"problems."
+msgstr ""
+"Om du lter filsystemet fortstta vara FAT32 kommer du inte att introducera "
+"ngra nya problem."
+
+#: libparted/fs/fat/resize.c:499
+msgid ""
+"If you convert to FAT32, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual). Also, "
+"converting to FAT32 will make the file system unreadable by MS DOS, MS "
+"Windows 95a, and MS Windows NT."
+msgstr ""
+"Om du konverterar till FAT32 och MS Windows r installerad p den hr "
+"partitionen mste du installera om MS Windows startprogram. Om du gr det "
+"br du studera Parteds manual (eller din distributions manual). Mrk att "
+"genom att konvertera filsystemet till FAT32 kommer det inte att kunna lsas "
+"av MS DOS, MS Windows 95a och MS Windows NT."
+
+#: libparted/fs/fat/resize.c:513
+#, c-format
+msgid "%s %s %s"
+msgstr "%s %s %s"
+
+#: libparted/fs/fat/resize.c:514
+msgid "Would you like to use FAT32?"
+msgstr "Vill du anvnda FAT32?"
+
+#: libparted/fs/fat/resize.c:541 libparted/fs/fat/resize.c:557
+#, c-format
+msgid "%s %s"
+msgstr "%s %s"
+
+#: libparted/fs/fat/resize.c:542
+msgid ""
+"The file system can only be resized to this size by converting to FAT16."
+msgstr ""
+"Filsystemet kan bara ndras till den hr storleken genom att konvertera till "
+"FAT16."
+
+#: libparted/fs/fat/resize.c:558
+msgid ""
+"The file system can only be resized to this size by converting to FAT32."
+msgstr ""
+"Filsystemet kan bara ndras till den hr storleken genom att konvertera till "
+"FAT32."
+
+#: libparted/fs/fat/resize.c:571
+#, fuzzy
+msgid ""
+"GNU Parted cannot resize this partition to this size. We're working on it!"
+msgstr ""
+"GNU Parted kan inte ndra partitionen till den hr storleken. Vi arbetar p "
+"en lsning!"
+
+#: libparted/fs/fat/bootsector.c:48 libparted/fs/fat/bootsector.c:55
+msgid "File system has an invalid signature for a FAT file system."
+msgstr "Filsystemet har en ogiltig signatur fr filsystem av typen FAT."
+
+#: libparted/fs/fat/bootsector.c:62
+msgid "File system has an invalid sector size for a FAT file system."
+msgstr ""
+"Filsystemet har en ogiltig sektorstorlek fr ett filsystem av typen FAT."
+
+#: libparted/fs/fat/bootsector.c:69
+#, fuzzy
+msgid "File system has an invalid cluster size for a FAT file system."
+msgstr ""
+"Filsystemet har en ogiltig sektorstorlek fr ett filsystem av typen FAT."
+
+#: libparted/fs/fat/bootsector.c:76
+#, fuzzy
+msgid ""
+"File system has an invalid number of reserved sectors for a FAT file system."
+msgstr ""
+"Filsystemet har ett ogiltigt antal reserverade sektorer fr ett filsystem av "
+"typen FAT."
+
+#: libparted/fs/fat/bootsector.c:83
+#, fuzzy
+msgid "File system has an invalid number of FATs."
+msgstr "Filsystemet har ett felaktigt antal filallokeringstabeller."
+
+#: libparted/fs/fat/bootsector.c:138
+#, c-format
+msgid ""
+"This file system has a logical sector size of %d. GNU Parted is known not "
+"to work properly with sector sizes other than 512 bytes."
+msgstr ""
+"Filsystemet har en logisk sektorstorlek p %d. Det r knt att GNU Parted "
+"inte fungerar bra med andra sektorstorlekar 512 byte."
+
+#: libparted/fs/fat/bootsector.c:163
+#, c-format
+msgid ""
+"The file system's CHS geometry is (%d, %d, %d), which is invalid. The "
+"partition table's CHS geometry is (%d, %d, %d). If you select Ignore, the "
+"file system's CHS geometry will be left unchanged. If you select Fix, the "
+"file system's CHS geometry will be set to match the partition table's CHS "
+"geometry."
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:209
+msgid "FAT boot sector says logical sector size is 0. This is weird. "
+msgstr ""
+"FAT:s startsektor menar att den logiska sektorstorleken r 0. Mrkligt."
+
+#: libparted/fs/fat/bootsector.c:215
+msgid "FAT boot sector says there are no FAT tables. This is weird. "
+msgstr "FAT:s startsektor menar att det saknas FAT-tabeller. Mrkligt."
+
+#: libparted/fs/fat/bootsector.c:221
+msgid "FAT boot sector says clusters are 0 sectors. This is weird. "
+msgstr ""
+"FAT:s startsektor menar att ett kluster bestr av 0 sektorer. Mrkligt."
+
+#: libparted/fs/fat/bootsector.c:231
+#, fuzzy
+msgid "File system is FAT12, which is unsupported."
+msgstr "Filsystemet r FAT12, som inte stds."
+
+#: libparted/fs/fat/bootsector.c:407
+#, c-format
+msgid ""
+"The information sector has the wrong signature (%x). Select cancel for now, "
+"and send in a bug report. If you're desperate, it's probably safe to ignore."
+msgstr ""
+"Informationssektorn har fel signatur (%x). Vlj avbryt och skicka in en "
+"felrapport. Om du r desperat s r det troligen skert att strunta i felet."
+
+#: libparted/fs/fat/count.c:149
+#, c-format
+msgid "Bad directory entry for %s: first cluster is the end of file marker."
+msgstr "Felaktig katalogpost fr %s: frsta klustret r en filslutsmarkering."
+
+#: libparted/fs/fat/count.c:162
+#, c-format
+msgid ""
+"Bad FAT: unterminated chain for %s. You should run dosfsck or scandisk."
+msgstr ""
+"Trasig filallokeringstabell: ej avslutad kedja fr %s. Du br kra dosfsck "
+"eller scandisk."
+
+#: libparted/fs/fat/count.c:171
+#, fuzzy, c-format
+msgid ""
+"Bad FAT: cluster %d outside file system in chain for %s. You should run "
+"dosfsck or scandisk."
+msgstr ""
+"Trasig filallokeringstabell: kluster %d ligger utanfr filsystemet fr %s. "
+"Du br kra dosfsck eller scandisk."
+
+#: libparted/fs/fat/count.c:181
+#, c-format
+msgid ""
+"Bad FAT: cluster %d is cross-linked for %s. You should run dosfsck or "
+"scandisk."
+msgstr ""
+"Trasig filallokeringstabell: kluster %d r korslnkad fr %s. Du br kra "
+"dosfsck eller scandisk."
+
+#: libparted/fs/fat/count.c:200
+#, fuzzy, c-format
+msgid "%s is %dk, but it has %d clusters (%dk)."
+msgstr "%s r %dk, men den har %d kluster (%dk)."
+
+#: libparted/fs/fat/count.c:263
+#, c-format
+msgid ""
+"The file %s is marked as a system file. This means moving it could cause "
+"some programs to stop working."
+msgstr ""
+
+#: libparted/fs/fat/table.c:138
+#, c-format
+msgid ""
+"FAT %d media %x doesn't match the boot sector's media %x. You should "
+"probably run scandisk."
+msgstr ""
+"FAT %d media %x passar inte med startsektorns media %x. Du br antagligen "
+"kra scandisk."
+
+#: libparted/fs/fat/table.c:268
+#, fuzzy, c-format
+msgid "fat_table_set: cluster %ld outside file system"
+msgstr "fat_table_set: kluster %ld ligger utanfr filsystemet"
+
+#: libparted/fs/fat/table.c:296
+#, fuzzy, c-format
+msgid "fat_table_get: cluster %ld outside file system"
+msgstr "fat_table_get: kluster %ld ligger utanfr filsystemet"
+
+#: libparted/fs/fat/table.c:334
+msgid "fat_table_alloc_cluster: no free clusters"
+msgstr "fat_table_alloc_cluster: inga lediga kluster"
+
+#: libparted/fs/linux_swap/linux_swap.c:236
+#, c-format
+msgid "Unrecognised linux swap signature '%10s'."
+msgstr "Oknd signatur fr Linux vxlingsutrymme \\\"%10s\\\"."
+
+#: libparted/fs/linux_swap/linux_swap.c:312
+msgid "Too many bad pages."
+msgstr "Fr mnga dliga sidor."
+
+#: libparted/fs/hfs/advfs.c:123 libparted/fs/hfs/advfs_plus.c:125
+#: libparted/fs/hfs/reloc.c:416 libparted/fs/hfs/reloc.c:510
+#: libparted/fs/hfs/reloc_plus.c:541 libparted/fs/hfs/reloc_plus.c:660
+#: libparted/fs/hfs/reloc_plus.c:774
+msgid "The file system contains errors."
+msgstr ""
+
+#: libparted/fs/hfs/advfs_plus.c:290
+msgid "Bad blocks could not be read."
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:139
+#, c-format
+msgid ""
+"Trying to register an extent starting at block 0x%X, but another one already "
+"exists at this position. You should check the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:216
+#, c-format
+msgid ""
+"Trying to move an extent from block Ox%X to block Ox%X, but another one "
+"already exists at this position. This should not happen!"
+msgstr ""
+
+#: libparted/fs/hfs/file.c:145
+#, c-format
+msgid "Could not update the extent cache for HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:182
+#, c-format
+msgid "Trying to read HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:192 libparted/fs/hfs/file.c:222
+#, c-format
+msgid "Could not find sector %lli of HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:212
+#, c-format
+msgid "Trying to write HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:159
+#, c-format
+msgid "Could not update the extent cache for HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:203
+#, c-format
+msgid "Trying to read HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:214 libparted/fs/hfs/file_plus.c:256
+#, c-format
+msgid "Could not find sector %lli of HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:245
+#, c-format
+msgid "Trying to write HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:225
+msgid "Sorry, HFS cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:255 libparted/fs/hfs/hfs.c:636
+msgid "Data relocation has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:274
+msgid "Data relocation left some data in the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:313
+#, fuzzy
+msgid "writing HFS Master Directory Block"
+msgstr "Ett fel uppstod vid skrivning till rotkatalogen."
+
+#: libparted/fs/hfs/hfs.c:461
+msgid "No valid HFS[+X] signature has been found while opening."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:471
+#, c-format
+msgid "Version %d of HFS+ isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:482
+#, c-format
+msgid "Version %d of HFSX isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:667
+msgid "Data relocation left some data at the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:715
+#, fuzzy
+msgid "Error while writing the allocation file."
+msgstr "Ett fel uppstod vid skrivning till rotkatalogen."
+
+#: libparted/fs/hfs/hfs.c:730
+msgid "Error while writing the compatibility part of the allocation file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:745
+msgid "writing HFS+ Volume Header"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:845
+msgid "An error occurred while looking for the mandatory bad blocks file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:899
+msgid ""
+"It seems there is an error in the HFS wrapper: the bad blocks file doesn't "
+"contain the embedded HFS+ volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:930
+msgid "Sorry, HFS+ cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:965
+msgid "shrinking embedded HFS+ volume"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:981
+msgid "Resizing the HFS+ volume has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:988
+#, fuzzy
+msgid "shrinking HFS wrapper"
+msgstr "Varning"
+
+#: libparted/fs/hfs/hfs.c:997
+msgid "Updating the HFS wrapper has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:1099 libparted/fs/hfs/hfs.c:1184
+#, c-format
+msgid ""
+"This is not a real %s check. This is going to extract special low level "
+"files for debugging purposes."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:156
+msgid "Bad block list header checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:169
+#, c-format
+msgid ""
+"Invalid size of a transaction block while replaying the journal (%i bytes)."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:261
+msgid ""
+"Journal stored outside of the volume are not supported. Try to desactivate "
+"the journal and run Parted again."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:272
+#, fuzzy
+msgid "Journal offset or size is not multiple of the sector size."
+msgstr ""
+"Klustrets startdifferens r %d, vilket inte r en multipel av "
+"klusterstorleken %d"
+
+#: libparted/fs/hfs/journal.c:290
+msgid "Incorrect magic values in the journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:299
+msgid "Journal size mismatch between journal info block and journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:311
+#, fuzzy
+msgid "Some header fields are not multiple of the sector size."
+msgstr ""
+"Klustrets startdifferens r %d, vilket inte r en multipel av "
+"klusterstorleken %d"
+
+#: libparted/fs/hfs/journal.c:320
+msgid ""
+"The sector size stored in the journal is not 512 bytes. Parted only "
+"supports 512 bytes length sectors."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:332
+msgid "Bad journal checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:350
+msgid ""
+"The journal is not empty. Parted must replay the transactions before "
+"opening the file system. This will modify the file system."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:378
+msgid ""
+"The volume header or the master directory block has changed while replaying "
+"the journal. You should restart Parted."
+msgstr ""
+
+#: libparted/fs/hfs/probe.c:52
+#, c-format
+msgid ""
+"Parted can't use HFS file systems on disks with a sector size not equal to %"
+"d bytes."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:153 libparted/fs/hfs/reloc_plus.c:157
+msgid "An extent has not been relocated."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:253 libparted/fs/hfs/reloc_plus.c:309
+msgid ""
+"A reference to an extent comes from a place it should not. You should check "
+"the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:383
+msgid "This HFS volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:477
+msgid "This HFS volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:519 libparted/fs/hfs/reloc_plus.c:670
+msgid ""
+"The extents overflow file should not contain its own extents! You should "
+"check the file system."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:576 libparted/fs/hfs/reloc_plus.c:849
+#, fuzzy
+msgid "Could not cache the file system in memory."
+msgstr "Kunde inte hitta ngot filsystem."
+
+#: libparted/fs/hfs/reloc.c:637 libparted/fs/hfs/reloc_plus.c:910
+msgid "Bad blocks list could not be loaded."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:651 libparted/fs/hfs/reloc_plus.c:926
+msgid "An error occurred during extent relocation."
+msgstr ""
+
+#: libparted/fs/hfs/reloc_plus.c:497
+msgid "This HFS+ volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc_plus.c:621
+msgid "This HFS+ volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: parted/parted.c:76
+msgid "displays this help message"
+msgstr "visa den hr hjlptexten"
+
+#: parted/parted.c:77
+msgid "where necessary, prompts for user intervention"
+msgstr "dr s r ndvndigt, frgar anvndaren om alternativ"
+
+#: parted/parted.c:78
+msgid "never prompts for user intervention"
+msgstr "frgar aldrig anvndaren om alternativ"
+
+#: parted/parted.c:79
+msgid "displays the version"
+msgstr "visar versionen"
+
+#: parted/parted.c:87
+#, fuzzy
+msgid ""
+"NUMBER is the partition number used by Linux. On MS-DOS disk labels, the "
+"primary partitions number from 1 to 4, logical partitions from 5 onwards.\n"
+msgstr ""
+"UNDRE r partitionsnumret som Linux anvnder. P filsystem av typ MSDOS r "
+"de primra partitionerna numrerade frn ett till fyra, och de logiska "
+"partitionerna frn fem och uppt.\n"
+
+#: parted/parted.c:90
+msgid "LABEL-TYPE is one of: "
+msgstr "PART-TYP r en av:"
+
+#: parted/parted.c:91
+msgid "FLAG is one of: "
+msgstr "FLAGGA r en av: "
+
+#: parted/parted.c:92
+#, fuzzy
+msgid "UNIT is one of: "
+msgstr "FLAGGA r en av: "
+
+#: parted/parted.c:93
+#, fuzzy
+msgid "PART-TYPE is one of: primary, logical, extended\n"
+msgstr "PART-TYP r en av: primr, logisk, utkad\n"
+
+#: parted/parted.c:95
+msgid "FS-TYPE is one of: "
+msgstr "FS-TYP r en av: "
+
+#: parted/parted.c:96
+msgid ""
+"START and END are disk locations, such as 4GB or 10%. Negative values count "
+"from the end of the disk. For example, -1s specifies exactly the last "
+"sector.\n"
+msgstr ""
+
+#: parted/parted.c:99
+msgid "STATE is one of: on, off\n"
+msgstr "TILLSTND r ett av: p, av\n"
+
+#: parted/parted.c:100
+msgid "DEVICE is usually /dev/hda or /dev/sda\n"
+msgstr "ENHET r vanligen /dev/hda eller /dev/sda\n"
+
+#: parted/parted.c:101
+msgid "NAME is any word you want\n"
+msgstr "NAMN r vilket ord du vill\n"
+
+#: parted/parted.c:102
+msgid "The partition must have one of the following FS-TYPEs: "
+msgstr ""
+
+#: parted/parted.c:105
+msgid "GNU Parted Version information:\n"
+msgstr ""
+
+#: parted/parted.c:107
+#, fuzzy
+msgid ""
+"Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n"
+"This program is free software, covered by the GNU General Public License.\n"
+"\n"
+"This program is distributed in the hope that it will be useful, but WITHOUT "
+"ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
+"FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
+"more details.\n"
+"\n"
+msgstr ""
+"Upphovsrtt 1998, 1999, 2000, 2001 Free Software Foundation, Inc.\n"
+"\n"
+"Fljande text r en informell versttning som enbart tillhandahlls i\n"
+"informativt syfte. Fr alla juridiska tolkningar gller den engelska "
+"original-\n"
+"texten.\n"
+"\n"
+"Detta program r fri programvara. Du kan distribuera det och/eller "
+"modifiera\n"
+"det under villkoren i GNU General Public License, publicerad av Free "
+"Software\n"
+"Foundation, antingen version 2 eller (om du s vill) ngon senare version.\n"
+"\n"
+"Detta program distribueras i hopp om att det ska vara anvndbart, men UTAN\n"
+"NGON SOM HELST GARANTI, ven utan underfrstdd garanti om SLJBARHET "
+"eller\n"
+"LMPLIGHET FR NGOT SPECIELLT NDAML. Se GNU General Public License fr\n"
+"ytterligare information.\n"
+"\n"
+"Du br ha ftt en kopia av GNU General Public License tillsammans med detta\n"
+"program. Om inte, skriv till \n"
+"Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,\n"
+"Boston, MA 02110-1301, USA.\n"
+
+#: parted/parted.c:152
+#, c-format
+msgid "%0.f%%\t(time left %.2d:%.2d)"
+msgstr ""
+
+#: parted/parted.c:170
+#, c-format
+msgid ""
+"Partition %s is being used. You must unmount it before you modify it with "
+"Parted."
+msgstr ""
+
+#: parted/parted.c:187
+#, c-format
+msgid "Partition(s) on %s are being used."
+msgstr "Partitionen p %s r i bruk."
+
+#: parted/parted.c:413 parted/parted.c:594 parted/parted.c:979
+#: parted/parted.c:1059 parted/parted.c:1586 parted/parted.c:1663
+#: parted/parted.c:1707
+#, fuzzy
+msgid "Partition number?"
+msgstr "Partitionen r i bruk."
+
+#: parted/parted.c:456
+msgid "Source device?"
+msgstr ""
+
+#: parted/parted.c:460
+#, fuzzy
+msgid "Source partition number?"
+msgstr "Kllpartitionen finns inte."
+
+#: parted/parted.c:465
+#, fuzzy
+msgid "Can't copy an extended partition."
+msgstr "Kan inte kopiera utkade partitioner."
+
+#: parted/parted.c:471
+#, fuzzy
+msgid "Destination partition number?"
+msgstr "Mlpartitionen r i bruk."
+
+#: parted/parted.c:564
+#, fuzzy
+msgid "New disk label type?"
+msgstr "Typ av filsystem: %s\n"
+
+#: parted/parted.c:598
+#, fuzzy
+msgid "File system?"
+msgstr "Filsystem "
+
+#: parted/parted.c:645 parted/parted.c:815
+#, fuzzy
+msgid "Partition type?"
+msgstr "Partitionen finns inte."
+
+#: parted/parted.c:652 parted/parted.c:822 parted/parted.c:1062
+#, fuzzy
+msgid "Partition name?"
+msgstr "Partitionen finns inte."
+
+#: parted/parted.c:660 parted/parted.c:832
+#, fuzzy
+msgid "File system type?"
+msgstr "Filsystem "
+
+#: parted/parted.c:667 parted/parted.c:834 parted/parted.c:994
+#: parted/parted.c:1544 parted/parted.c:1595
+msgid "Start?"
+msgstr ""
+
+#: parted/parted.c:669 parted/parted.c:837 parted/parted.c:997
+#: parted/parted.c:1546 parted/parted.c:1597
+msgid "End?"
+msgstr ""
+
+#: parted/parted.c:707 parted/parted.c:875
+#, c-format
+msgid ""
+"You requested a partition from %s to %s.\n"
+"The closest location we can manage is %s to %s. Is this still acceptable to "
+"you?"
+msgstr ""
+
+#: parted/parted.c:827
+msgid "An extended partition cannot hold a file system. Did you want mkpart?"
+msgstr ""
+
+#: parted/parted.c:985
+#, fuzzy
+msgid "Can't move an extended partition."
+msgstr "Kan inte flytta utkade partitioner."
+
+#: parted/parted.c:1014
+msgid "Can't move a partition onto itself. Try using resize, perhaps?"
+msgstr ""
+"Kan inte flytta en partition till sig sjlv. Prova att ndra storleken "
+"istllet."
+
+#: parted/parted.c:1158
+#, c-format
+msgid "Minor: %d\n"
+msgstr ""
+
+#: parted/parted.c:1159
+#, fuzzy, c-format
+msgid "Flags: %s\n"
+msgstr "Flaggor"
+
+#: parted/parted.c:1160
+#, fuzzy, c-format
+msgid "File System: %s\n"
+msgstr "Filsystem "
+
+#: parted/parted.c:1161
+#, c-format
+msgid "Size: "
+msgstr ""
+
+#: parted/parted.c:1166
+#, c-format
+msgid "Minimum size: "
+msgstr ""
+
+#: parted/parted.c:1169
+#, c-format
+msgid "Maximum size: "
+msgstr ""
+
+#: parted/parted.c:1255
+#, fuzzy, c-format
+msgid "Disk %s: %s\n"
+msgstr "%s %s %s"
+
+#: parted/parted.c:1256
+#, c-format
+msgid "Sector size (logical/physical): %lldB/%lldB\n"
+msgstr ""
+
+#: parted/parted.c:1267
+#, c-format
+msgid "BIOS cylinder,head,sector geometry: %d,%d,%d. Each cylinder is %s.\n"
+msgstr ""
+
+#: parted/parted.c:1273
+#, fuzzy, c-format
+msgid "Partition Table: %s\n"
+msgstr "Partitionen finns inte."
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Number"
+msgstr ""
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Start"
+msgstr ""
+
+#: parted/parted.c:1285 parted/parted.c:1288
+msgid "End"
+msgstr ""
+
+#: parted/parted.c:1288
+#, fuzzy
+msgid "Size"
+msgstr "ndra_storlek"
+
+#: parted/parted.c:1292
+msgid "Type"
+msgstr ""
+
+#: parted/parted.c:1294
+#, fuzzy
+msgid "File system"
+msgstr "Filsystem "
+
+#: parted/parted.c:1297
+#, fuzzy
+msgid "Name"
+msgstr "namn"
+
+#: parted/parted.c:1299
+msgid "Flags"
+msgstr "Flaggor"
+
+#: parted/parted.c:1352
+msgid "Free Space"
+msgstr ""
+
+#: parted/parted.c:1441
+#, c-format
+msgid ""
+"A %s %s partition was found at %s -> %s. Do you want to add it to the "
+"partition table?"
+msgstr ""
+
+#: parted/parted.c:1479
+#, fuzzy
+msgid "searching for file systems"
+msgstr "Oknd filsystemstyp."
+
+#: parted/parted.c:1684
+#, fuzzy
+msgid "New device?"
+msgstr "Ingen enhet hittades"
+
+#: parted/parted.c:1709
+msgid "Flag to Invert?"
+msgstr ""
+
+#: parted/parted.c:1714
+#, fuzzy
+msgid "New state?"
+msgstr "Typ av filsystem: %s\n"
+
+#: parted/parted.c:1747
+msgid "Unit?"
+msgstr ""
+
+#: parted/parted.c:1896
+msgid "check"
+msgstr "testa"
+
+#: parted/parted.c:1899
+#, fuzzy
+msgid ""
+"check NUMBER do a simple check on the file system"
+msgstr "testa UNDRE gr en enkel test av filsystemet"
+
+#: parted/parted.c:1905
+msgid "cp"
+msgstr "kopiera"
+
+#: parted/parted.c:1908
+#, fuzzy
+msgid ""
+"cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another "
+"partition"
+msgstr ""
+"kopiera [FRN ENHET] FRN-UNDRE TILL-UNDRE kopiera ett filsystem till "
+"ett annat"
+
+#: parted/parted.c:1914
+msgid "help"
+msgstr "hjlp"
+
+#: parted/parted.c:1917
+#, fuzzy
+msgid ""
+"help [COMMAND] prints general help, or help on "
+"COMMAND"
+msgstr ""
+"hjlp [KOMMANDO] skriver generell hjlp, eller speciell hjlp "
+"fr KOMMANDO"
+
+#: parted/parted.c:1923
+msgid "mklabel"
+msgstr "mklabel"
+
+#: parted/parted.c:1926
+#, fuzzy
+msgid ""
+"mklabel LABEL-TYPE create a new disklabel (partition "
+"table)"
+msgstr "mklabel PART-TYP skapa en ny partitionstabell"
+
+#: parted/parted.c:1932
+msgid "mkfs"
+msgstr "mkfs"
+
+#: parted/parted.c:1935
+#, fuzzy
+msgid ""
+"mkfs NUMBER FS-TYPE make a FS-TYPE file system on "
+"partititon NUMBER"
+msgstr ""
+"mkfs UNDRE TYP skapa ett filsystem av typen TYP p partition UNDRE"
+
+#: parted/parted.c:1941
+msgid "mkpart"
+msgstr "mkpart"
+
+#: parted/parted.c:1944
+#, fuzzy
+msgid "mkpart PART-TYPE [FS-TYPE] START END make a partition"
+msgstr "mkpart PARTITIONSTYP [TYP] BRJAN SLUT skapa en partition"
+
+#: parted/parted.c:1950
+#, fuzzy
+msgid ""
+"mkpart makes a partition without creating a new file system on the "
+"partition. FS-TYPE may be specified to set an appropriate partition ID.\n"
+msgstr ""
+"mkpart skapar en partition utan att skapa ett nytt filsystem p den. TYP "
+"mste vara angiven fr datapartitioner (till skillnad mot utkade "
+"partitioner). Det hr kommandot r anvndbart om du tar bort en partition av "
+"misstag.\n"
+
+#: parted/parted.c:1955
+msgid "mkpartfs"
+msgstr "mkpartfs"
+
+#: parted/parted.c:1958
+#, fuzzy
+msgid ""
+"mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system"
+msgstr ""
+"mkpartfs PARTITIONSTYP FILSYSTEMSTYP BRJAN SLUT gr en partition med ett "
+"filsystem"
+
+#: parted/parted.c:1964
+msgid "move"
+msgstr "flytta"
+
+#: parted/parted.c:1967
+#, fuzzy
+msgid "move NUMBER START END move partition NUMBER"
+msgstr "flytta UNDRE START [SLUT] flytta partition UNDRE"
+
+#: parted/parted.c:1972
+msgid "name"
+msgstr "namn"
+
+#: parted/parted.c:1975
+#, fuzzy
+msgid "name NUMBER NAME name partition NUMBER as NAME"
+msgstr "namn UNDRE NAMN benmn partition UNDRE NAMN"
+
+#: parted/parted.c:1980
+msgid "print"
+msgstr "skriv"
+
+#: parted/parted.c:1983
+#, fuzzy
+msgid ""
+"print [free|NUMBER|all] display the partition table, a "
+"partition, or all devices"
+msgstr "skriv visa partitionstabellen"
+
+#: parted/parted.c:1987
+msgid ""
+"Without arguments, print displays the entire partition table. With 'free'\n"
+"argument, information about free space will be displayed otherwise if a\n"
+"partition number is given, then more detailed information is displayed\n"
+"about that partition. If the 'all' argument is passed instead, partition\n"
+"information for all devices will be displayed."
+msgstr ""
+
+#: parted/parted.c:1995
+msgid "quit"
+msgstr "avsluta"
+
+#: parted/parted.c:1998
+#, fuzzy
+msgid "quit exit program"
+msgstr "avsluta avsluta programmet"
+
+#: parted/parted.c:2003
+#, fuzzy
+msgid "rescue"
+msgstr "ndra_storlek"
+
+#: parted/parted.c:2006
+#, fuzzy
+msgid ""
+"rescue START END rescue a lost partition near START "
+"and END"
+msgstr "ta_bort UNDRE ta bort partition UNDRE"
+
+#: parted/parted.c:2012
+msgid "resize"
+msgstr "ndra_storlek"
+
+#: parted/parted.c:2015
+#, fuzzy
+msgid ""
+"resize NUMBER START END resize partition NUMBER and its "
+"file system"
+msgstr ""
+"ndra_storlek UNDRE START SLUT ndra storlek p filsystemet p partition "
+"UNDRE"
+
+#: parted/parted.c:2023
+msgid "rm"
+msgstr "ta_bort"
+
+#: parted/parted.c:2026
+#, fuzzy
+msgid "rm NUMBER delete partition NUMBER"
+msgstr "ta_bort UNDRE ta bort partition UNDRE"
+
+#: parted/parted.c:2031
+msgid "select"
+msgstr "vlj"
+
+#: parted/parted.c:2034
+#, fuzzy
+msgid "select DEVICE choose the device to edit"
+msgstr "vlj ENHET vlj enhet att frndra"
+
+#: parted/parted.c:2039
+msgid "set"
+msgstr "stt"
+
+#: parted/parted.c:2042
+#, fuzzy
+msgid ""
+"set NUMBER FLAG STATE change the FLAG on partition NUMBER"
+msgstr "ta_bort UNDRE ta bort partition UNDRE"
+
+#: parted/parted.c:2048
+msgid "toggle"
+msgstr ""
+
+#: parted/parted.c:2051
+#, fuzzy
+msgid ""
+"toggle [NUMBER [FLAG]] toggle the state of FLAG on "
+"partition NUMBER"
+msgstr "ta_bort UNDRE ta bort partition UNDRE"
+
+#: parted/parted.c:2057
+#, fuzzy
+msgid "unit"
+msgstr "avsluta"
+
+#: parted/parted.c:2060
+#, fuzzy
+msgid "unit UNIT set the default unit to UNIT"
+msgstr "avsluta avsluta programmet"
+
+#: parted/parted.c:2065
+msgid "version"
+msgstr ""
+
+#: parted/parted.c:2068
+msgid ""
+"version displays the current version of GNU "
+"Parted and copyright information"
+msgstr ""
+
+#: parted/parted.c:2072
+msgid ""
+"version displays copyright and version information corressponding to this "
+"copy of GNU Parted\n"
+msgstr ""
+
+#: parted/parted.c:2158
+msgid "No device found"
+msgstr "Ingen enhet hittades"
+
+#: parted/parted.c:2222
+msgid "Don't forget to update /etc/fstab, if necessary.\n"
+msgstr ""
+
+#: parted/ui.c:68
+msgid "Welcome to GNU Parted! Type 'help' to view a list of commands.\n"
+msgstr ""
+
+#: parted/ui.c:71
+#, fuzzy
+msgid ""
+"Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]\n"
+"Apply COMMANDs with PARAMETERS to DEVICE. If no COMMAND(s) are given, run "
+"in\n"
+"interactive mode.\n"
+msgstr ""
+"Anvndning: parted [FLAGGA]... [ENHET [KOMMANDO [PARAMETRAR]...]...]\n"
+"Kr KOMMANDO med PARAMETRARNA p ENHET. Om inga KOMMANDON anges krs\n"
+"programmet i interaktivt lge.\n"
+
+#: parted/ui.c:76
+#, c-format
+msgid ""
+"\n"
+"\n"
+"You found a bug in GNU Parted! Here's what you have to do:\n"
+"\n"
+"Don't panic! The bug has most likely not affected any of your data.\n"
+"Help us to fix this bug by doing the following:\n"
+"\n"
+"Check whether the bug has already been fixed by checking\n"
+"the last version of GNU Parted that you can find at:\n"
+"\n"
+"\thttp://ftp.gnu.org/gnu/parted/\n"
+"\n"
+"Please check this version prior to bug reporting.\n"
+"\n"
+"If this has not been fixed yet or if you don't know how to check,\n"
+"please visit the GNU Parted website:\n"
+"\n"
+"\thttp://www.gnu.org/software/parted\n"
+"\n"
+"for further information.\n"
+"\n"
+"Your report should contain the version of this release (%s)\n"
+"along with the error message below, the output of\n"
+"\n"
+"\tparted DEVICE unit co print unit s print\n"
+"\n"
+"and additional information about your setup you consider important.\n"
+msgstr ""
+
+#: parted/ui.c:230
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_MAPERR (Address not mapped to object)"
+msgstr ""
+
+#: parted/ui.c:235
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_ACCERR (Invalid permissions for mapped object)"
+msgstr ""
+
+#: parted/ui.c:240
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGSEGV signal was encountered."
+msgstr ""
+
+#: parted/ui.c:258
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTDIV (Integer: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:262
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTOVF (Integer: overflow)"
+msgstr ""
+
+#: parted/ui.c:266
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTDIV (Float: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:270
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTOVF (Float: overflow)"
+msgstr ""
+
+#: parted/ui.c:274
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTUND (Float: underflow)"
+msgstr ""
+
+#: parted/ui.c:278
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTRES (Float: inexact result)"
+msgstr ""
+
+#: parted/ui.c:282
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTINV (Float: invalid operation)"
+msgstr ""
+
+#: parted/ui.c:286
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTSUB (Float: subscript out of range)"
+msgstr ""
+
+#: parted/ui.c:291
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGFPE signal was encountered."
+msgstr ""
+
+#: parted/ui.c:310
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPC (Illegal Opcode)"
+msgstr ""
+
+#: parted/ui.c:314
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPN (Illegal Operand)"
+msgstr ""
+
+#: parted/ui.c:318
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLADR (Illegal addressing mode)"
+msgstr ""
+
+#: parted/ui.c:323
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLTRP (Illegal Trap)"
+msgstr ""
+
+#: parted/ui.c:327
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVOPC (Privileged Opcode)"
+msgstr ""
+
+#: parted/ui.c:331
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVREG (Privileged Register)"
+msgstr ""
+
+#: parted/ui.c:335
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_COPROC (Coprocessor Error)"
+msgstr ""
+
+#: parted/ui.c:339
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_BADSTK (Internal Stack Error)"
+msgstr ""
+
+#: parted/ui.c:343
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGILL signal was encountered."
+msgstr ""
+
+#: parted/ui.c:828
+#, fuzzy
+msgid "Expecting a partition number."
+msgstr "Mlpartitionen r i bruk."
+
+#: parted/ui.c:837
+msgid "Partition doesn't exist."
+msgstr "Partitionen finns inte."
+
+#: parted/ui.c:857
+#, fuzzy
+msgid "Expecting a file system type."
+msgstr "Oknd filsystemstyp."
+
+#: parted/ui.c:863
+#, fuzzy, c-format
+msgid "Unknown file system type \"%s\"."
+msgstr "Oknd filsystemstyp."
+
+#: parted/ui.c:883
+msgid "Expecting a disk label type."
+msgstr ""
+
+#: parted/ui.c:977
+#, fuzzy
+msgid "Can't create any more partitions."
+msgstr "Kan inte lgga till nnu en partition."
+
+#: parted/ui.c:987
+#, fuzzy
+msgid "Expecting a partition type."
+msgstr "Mlpartitionen finns inte."
+
+#: parted/ui.c:1115
+msgid "on"
+msgstr "p"
+
+#: parted/ui.c:1116
+msgid "off"
+msgstr ""
+
+#: parted/ui.c:1227
+msgid "OPTIONs:"
+msgstr "FLAGGOR:"
+
+#: parted/ui.c:1230
+msgid "COMMANDs:"
+msgstr "KOMMANDON:"
+
+#: parted/ui.c:1238
+#, fuzzy, c-format
+msgid "Using %s\n"
+msgstr ""
+"\n"
+"Anvnder %s\n"
+
+#, fuzzy
+#~ msgid ""
+#~ "This ext2 file system has a rather strange layout! Parted can't resize "
+#~ "this (yet)."
+#~ msgstr ""
+#~ "Det hr filsystemet (ext2) har en ganska konstig upplggning! Anvnd "
+#~ "dumpe2fs p filsystemet och skicka resultatet till <buytenh@gnu.org>. "
+#~ "Storleken kommer inte att ndras."
+
+#, fuzzy
+#~ msgid "Disk geometry for %s: %s - %s\n"
+#~ msgstr "Geometri p %s: 0.000-%.3f megabyte\n"
+
+#~ msgid "Disk label type: %s\n"
+#~ msgstr "Typ av filsystem: %s\n"
+
+#, fuzzy
+#~ msgid "set NUMBER FLAG STATE change a flag on partition NUMBER"
+#~ msgstr ""
+#~ "stt UNDRE FLAGGA TILLSTND ndra en flagga p partition UNDRE"
+
+#, fuzzy
+#~ msgid ""
+#~ "The sector size on %s is %d bytes. Parted is known not to work properly "
+#~ "with drives with sector sizes other than %d bytes."
+#~ msgstr ""
+#~ "Sektorstorleken p %s r %d byte. Parted fungerar inte bra p skivor med "
+#~ "annan sektorstorlek n 512 byte"
+
+#~ msgid ""
+#~ "You found a bug in GNU Parted. Please email a bug report to bug-"
+#~ "parted@gnu.org containing the version (%s), and the following message:\n"
+#~ msgstr ""
+#~ "Du har hittat ett fel i GNU Parted. Skicka en felrapport till bug-"
+#~ "parted@gnu.org innehllande versionsnummer (%s) och fljande meddelande:\n"
+
+#~ msgid "File system has an invalid signature for a FAT file systems."
+#~ msgstr "Filsystemet har en ogiltig signatur fr filsystem av typen FAT."
+
+#~ msgid "Minor Start End "
+#~ msgstr "Minor Start Slut "
+
+#~ msgid "Type "
+#~ msgstr "Typ "
+
+#~ msgid "Filesystem "
+#~ msgstr "Filsystem "
+
+#~ msgid "Name "
+#~ msgstr "Namn "
+
+#~ msgid "Device %s is neither a SCSI nor IDE drive."
+#~ msgstr "Enheten %s r varken en SCSI- eller IDE-enhet."
+
+#~ msgid "Error reading %s (%s) to determine if partition is mounted."
+#~ msgstr ""
+#~ "Ett fel uppstod nr %s (%s) skulle lsas fr att avgra om partitionen r "
+#~ "monterad."
+
+#~ msgid "Could not read geometry of %s - %s."
+#~ msgstr "Kunde inte lsa geometrin p %s - %s."
+
+#~ msgid "Device %s has dodgey geometry."
+#~ msgstr "Enheten %s har mrklig geometri."
+
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. However, the most likely reason is that Linux "
+#~ "detected the BIOS geometry for %s incorrectly. GNU Parted suspects the "
+#~ "real geometry should be %d/%d/%d (not %d/%d/%d). You should check with "
+#~ "your BIOS first, as this may not be correct. You can inform Linux by "
+#~ "adding the parameter %s=%d,%d,%d to the command line. See the LILO or "
+#~ "GRUB documentation for more information. If you think Parted's suggested "
+#~ "geometry is correct, you may select Ignore to continue (and fix Linux "
+#~ "later). Otherwise, select Cancel (and fix Linux and/or the BIOS now)."
+#~ msgstr ""
+#~ "Partitionstabellen p %s r inte konsistent. Det kan finns mnga skl "
+#~ "till detta. Det mest troliga sklet r att Linux lste fel "
+#~ "geometriinformation fr %s i BIOS. GNU Parted misstnker att den riktiga "
+#~ "geometrin br vara %d/%d/%d (inte %d/%d/%d). Du br frst kontrollera "
+#~ "ditt BIOS eftersom det kan vara fel. Du kan informera Linux genom att "
+#~ "lgga till parametern %s=%d,%d,%d p kommandoraden. Mer information finns "
+#~ "i manualerna fr LILO eller GRUB. Om du tror att Parteds freslagna "
+#~ "geometri r riktig kan du vlja Ignorera fr att fortstta (och ordna "
+#~ "till Linux senare). Annars, vlj Avbryt (och ordna till Linux och/eller "
+#~ "BIOS nu)."
+
+#, fuzzy
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. Often, the reason is that Linux detected the "
+#~ "BIOS geometry incorrectly. However, this does not appear to be the case "
+#~ "here. It is safe to ignore,but ignoring may cause (fixable) problems "
+#~ "with some boot loaders, and may cause problems with FAT file systems. "
+#~ "Using LBA is recommended."
+#~ msgstr ""
+#~ "Partitionstabellen p %s r inte konsistent. Det kan finnas flera "
+#~ "anledningar till det. Ofta r anledningen att Linux har lst "
+#~ "geometriinformationen i BIOS felaktigt. Det verkar dock inte vara "
+#~ "problemet hr. Du kan ignorera felet, men det kan uppst problem (som kan "
+#~ "tgrdas) med vissa startprogram."
+
+#~ msgid ""
+#~ "Unable to align partition properly. This probably means that another "
+#~ "partitioning tool generated an incorrect partition table, because it "
+#~ "didn't have the correct BIOS geometry. It is safe to ignore,but ignoring "
+#~ "may cause (fixable) problems with some boot loaders."
+#~ msgstr ""
+#~ "Kunde inte lgga partitionen p jmn cylindergrns. Det betyder ofta att "
+#~ "ett annat partitionsverktyg skrev en ogiltig partitionstabell, beroende "
+#~ "p felaktig geomtriinformation frn ditt BIOS. Du kan ignorera felet, men "
+#~ "det kan uppst problem (som kan tgrdas) med vissa startprogram."
+
+#, fuzzy
+#~ msgid ""
+#~ "The operating system thinks the geometry on %s is %d/%d/%d. Therefore, "
+#~ "cylinder 1024 ends at %.3fM.%s"
+#~ msgstr ""
+#~ "Operativsystemet tror att %s geometri r %d/%d/%d. Drfr slutar cylinder "
+#~ "1024 p %.3fM. Du br kontrollera att detta stmmer verens med "
+#~ "informationen i BIOS innan du anvnder programmet."
+
+#, fuzzy
+#~ msgid "Partition %s is being used."
+#~ msgstr "Partitionen r i bruk."
+
+#~ msgid "START and END are in megabytes\n"
+#~ msgstr "BRJAN och SLUT anges i megabyte\n"
+
+#~ msgid ""
+#~ "The FATs aren't big enough to describe all clusters! Each FAT is %d "
+#~ "sectors. There are %d clusters, which would require each FAT to be %d "
+#~ "sectors. This is REALLY weird. You might want to write us an email: bug-"
+#~ "parted@gnu.org"
+#~ msgstr ""
+#~ "Filallokeringstabellerna r inte stora nog fr att beskriva alla kluster! "
+#~ "Varje tabell r %d sektorer. Det finns %d kluster, vilket innebr att "
+#~ "varje tabell borde vara %d sektorer. Detta r RIKTIGT konstigt. Skriv ett "
+#~ "brev till oss: bug-parted@gnu.org"
+
+#~ msgid ""
+#~ "This swap partition is not compatible with Linux version 2.1.117 or "
+#~ "earlier. Use a smaller partition (maximum size 128mb) if you want to use "
+#~ "old versions of Linux."
+#~ msgstr ""
+#~ "Den hr vxlingspartitionen r inte kompatibel med Linux version 2.1.117 "
+#~ "och tidigare. Anvnd en mindre partition (maximal storlek 128 MB) om du "
+#~ "anvnder ldre versioner av Linux."
+
+#, fuzzy
+#~ msgid ""
+#~ "The new partition overlaps with another partition so badly that it isn't "
+#~ "obvious want you want!"
+#~ msgstr "Den nya partitionen verlappar med en annan."
+
+#~ msgid "Can't grow a partition onto used space."
+#~ msgstr "Kan inte lta en partition vxa ut p anvnt utrymme."
+
+#~ msgid ""
+#~ "The kernel was unable to re-read your partition table, so you need to "
+#~ "reboot before mounting any modified partitions. You also need to "
+#~ "reinstall your boot loader before you reboot (which may require mounting "
+#~ "modified partitions). It is impossible do both things! So you'll need "
+#~ "to boot off a rescue disk, and reinstall your boot loader from the rescue "
+#~ "disk. Read section 4 of the Parted User documentation for more "
+#~ "information."
+#~ msgstr ""
+#~ "Krnan kunde inte lsa om partitionstabellen, s du mste starta om "
+#~ "datorn innan du kan montera ngon ndrad partition. Du mste ocks "
+#~ "installera om startprogrammet innan du startar om (vilket kan innebra "
+#~ "montering av ndrade partitioner). Det r omjligt att gra bda! Du "
+#~ "mste starta frn en rddningsskiva och installera om startprogrammet "
+#~ "frn den. Ls kapitel fyra i Parteds anvndarmanual fr mer information."
+
+#~ msgid ""
+#~ "The kernel was unable to re-read the partition table on %s (%s). This "
+#~ "means Linux knows nothing about any modifications you made. You should "
+#~ "reboot your computer before doing anything with %s."
+#~ msgstr ""
+#~ "Krnan kunde inte lsa om partitionstabellen p %s (%s). Det betyder att "
+#~ "Linux inte vet nnting om de ndringar du gjort. Du br starta om datorn "
+#~ "innan du gr nnting med %s."
+
+#~ msgid "Insane! %d clusters!"
+#~ msgstr "Konstigt! %d clusters!"
+
+#~ msgid ""
+#~ "File system doesn't have expected sizes for Windows to like it. Number "
+#~ "of clusters is %d (%d expected); size of FATs is %d sectors (%d expected)."
+#~ msgstr ""
+#~ "Filsystemet har inte en storlek som Windows gillar. Antalet kluster r %d "
+#~ "(%d frvntas); storleken p FAT:arna r %d sektorer (%d frvntas)."
+
+#~ msgid "No get_resize_constraint for %s!"
+#~ msgstr "get_resize_constraint saknas fr %s!"
+
+#~ msgid ""
+#~ "The filesystem is going to be too big for FAT16, so FAT32 will be used. "
+#~ "This is not compatible with MS-DOS, early versions of MS-Windows 95 and "
+#~ "Windows NT. If you use these operating systems, then select cancel, and "
+#~ "create a smaller partition. If you only use Linux, BSD, MS Windows 98 "
+#~ "and/or MS Windows 95 B, then select OK."
+#~ msgstr ""
+#~ "Filsystem kommer att lbi fr stort fr FAT16, s FAT32 kommer att "
+#~ "anvndas. Det r inte kompatibelt med MS-DOS, tidiga versioner av MS-"
+#~ "Windows 95 eller Windows NT. Om du anvnder dessa operativsystem, vlj "
+#~ "avbryt och skapa en mindre partition. Om du endast anvnder Linux, BSD, "
+#~ "MS Windows 98 och/eller MS Windows 95 B, vlj OK."
+
+#~ msgid "Weird: fat_calc_sizes() failed for FAT32!"
+#~ msgstr "Konstigt: fat_calc_sizes() misslyckades fr FAT32!"
+
+#~ msgid ""
+#~ "Would you like to use FAT32 for this filesystem? It is much more "
+#~ "efficient with your disk space, but is not compatible with early versions "
+#~ "of Windows 95 and Windows NT. Only select yes if you only use Linux, "
+#~ "BSD, MS Windows 98 and/or MS Windows 95 B."
+#~ msgstr ""
+#~ "Vill du anvnda FAT32 som filsystem? Det r mycket mer effektivt med "
+#~ "skivutrymmet, men det r inte kompatibelt med tidiga versioner av Windows "
+#~ "95 eller Windows NT. Vlj bara JA om du endast anvnder Linux, BSD, MS "
+#~ "Windows 98 och/eller MS Windows 95 B."
+
+#~ msgid "The %s file system code doesn't support %s disk labels."
+#~ msgstr "Koden fr filsystemet %s stder inte filallokeringstabeller fr %s."
+
+#~ msgid "Can't set non-Linux partitions as a root device."
+#~ msgstr "Kan inte stta andra partitioner n Linux egna som rotenhet."
+
+#~ msgid "Can't set non-Linux partitions as a swap device."
+#~ msgstr ""
+#~ "Kan inte stta partition som inte finns fr Linux som vxlingsenhet."
+
+#~ msgid "Linux-swap partitions can not be hidden on msdos disk labels."
+#~ msgstr ""
+#~ "Linux vxlingsenhet kan inte dljas p ett filsystem av typen msdos."
+
+#~ msgid "Linux-swap partitions can not be bootable on pc98 disk labels."
+#~ msgstr "Linux vxlingsenhet r inte startbar p pc98."
+
+#~ msgid "HFS partitions can't be hidden on msdos disk labels."
+#~ msgstr "Partitioner av typ HFS kan inte gmmas p filsystem av typen msdos."
+
+#, fuzzy
+#~ msgid "JFS partitions can't be hidden on msdos disk labels."
+#~ msgstr "Partitioner av typ HFS kan inte gmmas p filsystem av typen msdos."
+
+#, fuzzy
+#~ msgid "XFS partitions can't be hidden on msdos disk labels."
+#~ msgstr "Partitioner av typ HFS kan inte gmmas p filsystem av typen msdos."
+
+#~ msgid "unknown"
+#~ msgstr "oknd"
+
+# ??
+#~ msgid "Unknown SCSI"
+#~ msgstr "Oknd SCSI"
+
+#~ msgid "Creating new %s disklabels is not implemented yet."
+#~ msgstr ""
+#~ "Std fr att skapa nya partitionstabeller av typen %s r inte "
+#~ "implementerat n."
+
+#~ msgid "The code to write the partition table hasn't been written for %s yet"
+#~ msgstr ""
+#~ "Std fr att skriva partitionstabell fr %s r inte implementerat n."
+
+#~ msgid ""
+#~ "Partition size (%ld sectors) and filesystem size (%ld sectors) do not "
+#~ "match."
+#~ msgstr ""
+#~ "Partitionens storlek (%ld sektorer) och filsystemets storlek (%ld "
+#~ "sektorer) stmmer inte verens."
+
+#~ msgid ""
+#~ "The operating system thinks the geometry on %s is %d/%d/%d. You should "
+#~ "check that this matches the BIOS geometry before using this program."
+#~ msgstr ""
+#~ "Operativsystemet tror att %s geomtri r %d/%d/%d. Du br kontrollera att "
+#~ "detta stmmer verens med informationen i BIOS innan du anvnder "
+#~ "programmet."
diff --git a/po/tr.po b/po/tr.po
new file mode 100644
index 0000000..9914b14
--- /dev/null
+++ b/po/tr.po
@@ -0,0 +1,2416 @@
+# translation of parted-1.7.0rc1.po to Turkish
+# parted-1.7.0rc1.po'nun Trke evirisi
+# Copyright (C) 2002, 2006 Free Software Foundation, Inc.
+# Eyp Hakan Duran <hakan_duran@hotmail.com>, 2002, 2006.
+msgid ""
+msgstr ""
+"Project-Id-Version: parted-1.7.0rc1\n"
+"Report-Msgid-Bugs-To: bug-parted@gnu.org\n"
+"POT-Creation-Date: 2006-04-21 21:20+0200\n"
+"PO-Revision-Date: 2006-04-11 15:06-0400\n"
+"Last-Translator: Eyp Hakan Duran <hakan_duran@hotmail.com>\n"
+"Language-Team: Turkish <gnu-tr-u12a@lists.sourceforge.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-9\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.10.2\n"
+
+#: libparted/arch/linux.c:284
+#, c-format
+msgid "Could not stat device %s - %s."
+msgstr "Dosya durum bilgisi alnamayan aygt %s - %s."
+
+#: libparted/arch/linux.c:390
+#, fuzzy, c-format
+msgid ""
+"Could not determine sector size for %s: %s.\n"
+"Using the default sector size (%lld)."
+msgstr ""
+"%1$s: %2$s iin sektr boyutu belirlenemiyor.\n"
+"ntanml sektr boyutu (%3$d) kullanlacak."
+
+#: libparted/arch/linux.c:401
+#, fuzzy, c-format
+msgid ""
+"Device %s has a logical sector size of %lld. Not all parts of GNU Parted "
+"support this at the moment, and the working code is HIGHLY EXPERIMENTAL.\n"
+msgstr ""
+"%s iin mantksal sektr boyutu %d. GNU parted'in tm blmleri bunu henz "
+"desteklemiyor.\n"
+
+#: libparted/arch/linux.c:441
+#, c-format
+msgid "Unable to determine the size of %s (%s)."
+msgstr "%1$s (%2$s)'in boyutu belirlenemedi"
+
+#: libparted/arch/linux.c:530
+#, c-format
+msgid "Could not get identity of device %s - %s"
+msgstr "%s - %s aygtnn kimlii alnamad "
+
+#: libparted/arch/linux.c:539
+msgid "Generic IDE"
+msgstr "Genel IDE"
+
+#: libparted/arch/linux.c:556
+#, c-format
+msgid ""
+"Device %s has multiple (%d) logical sectors per physical sector.\n"
+"GNU Parted supports this EXPERIMENTALLY for some special disk label/file "
+"system combinations, e.g. GPT and ext2/3.\n"
+"Please consult the web site for up-to-date information."
+msgstr ""
+"Aygt %s fiziksel sektr bana ok sayda (%d) mantksal sektr ieriyor.\n"
+"GNU Parted bunu DENEYSEL olarak baz disk etiketi/dosya sistemi "
+"kombinasyonlar iin destekliyor, rnein GPT ve ext2/3.\n"
+"Ltfen gncel bilgi iin web sitesine bavurun."
+
+#: libparted/arch/linux.c:726
+#, c-format
+msgid "Error initialising SCSI device %s - %s"
+msgstr "%s - %s SCSI aygtn ilklendirmede hata"
+
+#: libparted/arch/linux.c:781
+#, c-format
+msgid ""
+"The device %s has zero length, and can't possibly store a file system or "
+"partition table. Perhaps you selected the wrong device?"
+msgstr ""
+"%s aygt sfr-uzunlukta ve muhtemelen bir dosya sistemi ya da blmleme "
+"tablosu depolayamyor. Yanl aygt semi olmayasnz?"
+
+#: libparted/arch/linux.c:829
+msgid ""
+"Unable to determine geometry of file/device. You should not use Parted "
+"unless you REALLY know what you're doing!"
+msgstr ""
+"Dosya/aygt geometrisi belirlenemedi. CDDEN ne yaptnz bilmiyorsanz "
+"Parted kullanmamalsnz!"
+
+#: libparted/arch/linux.c:903
+msgid "DAC960 RAID controller"
+msgstr "DAC960 RAID denetleyici"
+
+#: libparted/arch/linux.c:908
+msgid "Compaq Smart Array"
+msgstr "Compaq Akll Dizi"
+
+#: libparted/arch/linux.c:913
+msgid "ATARAID Controller"
+msgstr "ATARAID Denetleyici"
+
+#: libparted/arch/linux.c:918
+msgid "I2O Controller"
+msgstr "I20 Denetleyici"
+
+#: libparted/arch/linux.c:923
+msgid "User-Mode Linux UBD"
+msgstr "Kullanc Kipi Linux UBD"
+
+#: libparted/arch/linux.c:933
+msgid "Unknown"
+msgstr "Bilinmeyen"
+
+#: libparted/arch/linux.c:940
+msgid "ped_device_new() Unsupported device type"
+msgstr "ped_device_new() Desteklenmeyen aygt tr"
+
+#: libparted/arch/linux.c:1041 libparted/arch/gnu.c:264
+#, c-format
+msgid "Error opening %s: %s"
+msgstr "%1$s aarken hata: %2$s"
+
+#: libparted/arch/linux.c:1052 libparted/arch/gnu.c:274
+#, c-format
+msgid "Unable to open %s read-write (%s). %s has been opened read-only."
+msgstr ""
+"%1$s oku-yaz eklinde alamyor (%2$s). %3$s salt-okunur olarak ald."
+
+#: libparted/arch/linux.c:1160 libparted/arch/linux.c:1228
+#: libparted/arch/gnu.c:452 libparted/arch/gnu.c:550 libparted/arch/gnu.c:678
+#, c-format
+msgid "%s during read on %s"
+msgstr "%2$s'i okuma srasnda %1$s"
+
+#: libparted/arch/linux.c:1199
+#, c-format
+msgid "%s during seek for read on %s"
+msgstr "%2$s'te okuma iin arama srasnda %1$s"
+
+#: libparted/arch/linux.c:1270 libparted/arch/linux.c:1355
+#: libparted/arch/linux.c:1413 libparted/arch/gnu.c:587
+#: libparted/arch/gnu.c:632 libparted/arch/gnu.c:709
+#, c-format
+msgid "%s during write on %s"
+msgstr "%2$s'e yazma srasnda %1$s"
+
+#: libparted/arch/linux.c:1297 libparted/arch/gnu.c:512
+#, c-format
+msgid "Can't write to %s, because it is opened read-only."
+msgstr "%s'e yazlamyor, nk salt-okunur olarak alm."
+
+#: libparted/arch/linux.c:1321
+#, c-format
+msgid "%s during seek for write on %s"
+msgstr "%2$s'e yazma iin arama srasnda %1$s"
+
+#: libparted/arch/linux.c:1798
+#, c-format
+msgid ""
+"Error informing the kernel about modifications to partition %s -- %s. This "
+"means Linux won't know about any changes you made to %s until you reboot -- "
+"so you shouldn't mount it or use it in any way before rebooting."
+msgstr ""
+"%1$s - %2$s disk blmndeki deiiklikler hakknda kerneli bilgilendirmede "
+"hata. Bu, siz (bilgisayar) yeniden aana dek %3$s'e yaptnz "
+"deiiklikleri Linux'un bilmemesi demek - dolaysyla yeniden amadan "
+"herhangi bir ekilde balamamal ya da kullanmamalsnz."
+
+#: libparted/arch/linux.c:1879
+#, c-format
+msgid ""
+"The kernel was unable to re-read the partition table on %s (%s). This means "
+"Linux won't know anything about the modifications you made until you "
+"reboot. You should reboot your computer before doing anything with %s."
+msgstr ""
+"Kernel, %1$s (%2$s) zerindeki disk blmleme tablosunu yeniden okuyamad. "
+"Bu, siz (bilgisayar) yeniden aana dek yaptnz deiiklikleri Linux'un "
+"bilmemesi demek... %3$s ile ilgili herhangi bir ey yapmadan "
+"bilgisayarnz yeniden amalsnz."
+
+#: libparted/arch/gnu.c:97
+#, c-format
+msgid "Unable to open %s."
+msgstr "%s alamad."
+
+#: libparted/arch/gnu.c:117
+msgid "Unable to probe store."
+msgstr "Depo sondalanamad."
+
+#: libparted/arch/gnu.c:355
+msgid ""
+"The partition table cannot be re-read. This means you need to reboot before "
+"mounting any modified partitions. You also need to reinstall your boot "
+"loader before you reboot (which may require mounting modified partitions). "
+"It is impossible do both things! So you'll need to boot off a rescue disk, "
+"and reinstall your boot loader from the rescue disk. Read section 4 of the "
+"Parted User documentation for more information."
+msgstr ""
+"Disk blmleme tablosu yeniden okunamad, bu nedenle deitirilmi herhangi "
+"bir disk blmn balamadan (bilgisayar) yeniden amalsnz. Yeniden "
+"amadan nce nykleyicinizi de yeniden kurmalsnz (ki bu deitirilmi "
+"disk blmlerini balamay gerektirebilir). ki eyi birden yapmak "
+"olanaksz! Dolaysyla, bir kurtarma diskiyle amanz ve nykleyicinizi bu "
+"diskten yeniden kurmanz gerekecek. Daha fazla bilgi iin Parted Kullanc "
+"belgesinin 4. blmn okuyunuz."
+
+#: libparted/arch/gnu.c:372
+#, c-format
+msgid ""
+"The partition table on %s cannot be re-read (%s). This means the Hurd knows "
+"nothing about any modifications you made. You should reboot your computer "
+"before doing anything with %s."
+msgstr ""
+"%1$s (%2$s) zerindeki disk blmleme tablosu. Bu, sizin yaptnz "
+"deiiklikleri Hurd bilmiyor anlamna gelir. %3$s ile ilgili hibir ey "
+"yapmadan nce bilgisayarnz yeniden amalsnz."
+
+#: libparted/arch/gnu.c:383 parted/parted.c:2215
+msgid ""
+"You should reinstall your boot loader before rebooting. Read section 4 of "
+"the Parted User documentation for more information."
+msgstr ""
+"Yeniden amadan nce nykleyicinizi yeniden kurmalsnz. Daha fazla bilgi "
+"iin Parted Kullanc belgesinin 4. blmn okuyunuz."
+
+#: libparted/arch/gnu.c:774
+#, c-format
+msgid "%s trying to sync %s to disk"
+msgstr "%1$s %2$s diske ezamanlanmaya allyor"
+
+#: libparted/disk.c:183
+#, c-format
+msgid "Unable to open %s - unrecognised disk label."
+msgstr "%s alamyor - tannmayan disk etiketi."
+
+#: libparted/disk.c:452
+#, c-format
+msgid ""
+"This libparted doesn't have write support for %s. Perhaps it was compiled "
+"read-only."
+msgstr ""
+"Bu libparted'in %s iin yazma destei yok. Belki de salt-okunur olarak "
+"derlenmitir."
+
+#: libparted/disk.c:579
+#, c-format
+msgid "Partition %d is %s, but the file system is %s."
+msgstr "%1$d disk blm %2$s, fakat dosya sistemi %3$s'dir."
+
+#: libparted/disk.c:1056
+#, c-format
+msgid "%s disk labels do not support extended partitions."
+msgstr "%s disk etiketleri ek disk blmlerini desteklemiyor."
+
+#: libparted/disk.c:1616
+#, c-format
+msgid "%s disk labels don't support logical or extended partitions."
+msgstr "%s disk etiketleri mantksal ya da ek disk blmlerini desteklemiyor."
+
+#: libparted/disk.c:1629
+msgid "Too many primary partitions."
+msgstr "ok fazla birincil disk blm"
+
+#: libparted/disk.c:1638
+#, c-format
+msgid ""
+"Can't add a logical partition to %s, because there is no extended partition."
+msgstr "%s'e mantksal disk blm eklenemez, nk ek disk blm yok."
+
+#: libparted/disk.c:1662
+#, c-format
+msgid "Can't have more than one extended partition on %s."
+msgstr "%s zerinde birden fazla ek disk blm olamaz"
+
+#: libparted/disk.c:1672
+msgid "Can't have logical partitions outside of the extended partition."
+msgstr "Ek disk blm dnda mantksal disk blmleri olamaz."
+
+#: libparted/disk.c:1697
+#, c-format
+msgid "Can't have a logical partition outside of the extended partition on %s."
+msgstr "%s zerinde ek disk blm dnda mantksal disk blmleri olamaz."
+
+#: libparted/disk.c:1707 libparted/disk.c:1761 libparted/disk.c:1927
+msgid "Can't have overlapping partitions."
+msgstr "rten disk blmleri olamaz"
+
+#: libparted/disk.c:1715
+msgid "Can't have a primary partition inside an extended partition."
+msgstr "Bir ek disk blm iinde birincil disk blm bulunamaz."
+
+#: libparted/disk.c:2123
+msgid "metadata"
+msgstr "metaverisi"
+
+#: libparted/disk.c:2125
+msgid "free"
+msgstr "kullanlmam"
+
+#: libparted/disk.c:2127 parted/ui.c:968 parted/ui.c:996
+msgid "extended"
+msgstr "ek"
+
+#: libparted/disk.c:2129 parted/ui.c:972 parted/ui.c:1000
+msgid "logical"
+msgstr "mantksal"
+
+#: libparted/disk.c:2131 parted/ui.c:964 parted/ui.c:992
+msgid "primary"
+msgstr "birincil"
+
+#: libparted/disk.c:2147
+msgid "boot"
+msgstr "nykleme"
+
+#: libparted/disk.c:2149
+msgid "root"
+msgstr "kk"
+
+#: libparted/disk.c:2151
+msgid "swap"
+msgstr "takas"
+
+#: libparted/disk.c:2153
+msgid "hidden"
+msgstr "gizli"
+
+#: libparted/disk.c:2155
+msgid "raid"
+msgstr "raid"
+
+#: libparted/disk.c:2157
+msgid "lvm"
+msgstr "lvm"
+
+#: libparted/disk.c:2159
+msgid "lba"
+msgstr "lba"
+
+#: libparted/disk.c:2161
+msgid "hp-service"
+msgstr "hp-servisi"
+
+#: libparted/disk.c:2163
+msgid "palo"
+msgstr "palo"
+
+#: libparted/disk.c:2165
+msgid "prep"
+msgstr "prep"
+
+#: libparted/disk.c:2167
+msgid "msftres"
+msgstr "msftres"
+
+#: libparted/disk.c:2173
+#, c-format
+msgid "Unknown partition flag, %d."
+msgstr "Bilinmeyen.disk blm bayra, %d."
+
+#: libparted/labels/rdb.c:177
+#, c-format
+msgid "%s : Bad checksum on block %llu of type %s."
+msgstr "%1$s : %3$s trndeki %2$llu blounda bozuk salama toplam"
+
+#: libparted/labels/rdb.c:510
+#, c-format
+msgid "%s : Didn't find rdb block, should never happen."
+msgstr "%s : rdb blou bulunamad, asla olmamal(yd)."
+
+#: libparted/labels/rdb.c:595
+#, c-format
+msgid "%s : Loop detected at block %d."
+msgstr "%1$s : Blok %2$d'de dng saptand."
+
+#: libparted/labels/rdb.c:614
+#, c-format
+msgid "%s : The %s list seems bad at block %s."
+msgstr "%1$s : %2$s listesi %3$s blounda bozuk grnyor."
+
+#: libparted/labels/rdb.c:703
+#, c-format
+msgid "%s : Failed to list bad blocks."
+msgstr "%s : Hatal bloklar listeleme baarsz."
+
+#: libparted/labels/rdb.c:711
+#, c-format
+msgid "%s : Failed to list partition blocks."
+msgstr "%s : Blmleme bloklarn listeleme baarsz."
+
+#: libparted/labels/rdb.c:719
+#, c-format
+msgid "%s : Failed to list file system blocks."
+msgstr "%s : Dosya sistemi bloklarn listeleme baarsz"
+
+#: libparted/labels/rdb.c:727
+#, c-format
+msgid "%s : Failed to list boot blocks."
+msgstr "%s : nykleme bloklarn listeleme baarsz."
+
+#: libparted/labels/rdb.c:750
+#, c-format
+msgid "Failed to write partition block at %d."
+msgstr "%d'ye blmleme blou yazm baarsz."
+
+#: libparted/labels/rdb.c:1053 libparted/labels/bsd.c:505
+#: libparted/labels/dos.c:1942 libparted/labels/dvh.c:772
+#: libparted/labels/gpt.c:1365 libparted/labels/loop.c:251
+#: libparted/labels/mac.c:1318 libparted/labels/pc98.c:764
+#: libparted/labels/sun.c:704
+msgid "Unable to satisfy all constraints on the partition."
+msgstr "Disk blm zerindeki tm koullar karlanamad."
+
+#: libparted/labels/rdb.c:1081
+msgid "Unable to allocate a partition number."
+msgstr "Bir disk blm numaras atanamad."
+
+#: libparted/labels/bsd.c:530
+msgid "Unable to allocate a bsd disklabel slot."
+msgstr "Bir bsd disk etiketi yuvas tahsis edilemedi"
+
+#: libparted/labels/dos.c:812
+#, c-format
+msgid "Invalid partition table on %s -- wrong signature %x."
+msgstr "%1$s zerinde geersiz disk blmleme tablosu - yanl imza %2$x"
+
+#: libparted/labels/dos.c:840
+#, c-format
+msgid "Invalid partition table - recursive partition on %s."
+msgstr ""
+"Geersiz disk blmleme tablosu - %s zerinde zyinelemeli disk blm."
+
+#: libparted/labels/dos.c:1300
+msgid "Extended partitions cannot be hidden on msdos disk labels."
+msgstr "Msdos disk etiketlerinde ek disk blmleri gizli olamaz."
+
+#: libparted/labels/dos.c:1926
+msgid "Parted can't resize partitions managed by Windows Dynamic Disk."
+msgstr ""
+"Parted, Windows Dinamik Disk tarafndan ynetilen blmleri yeniden "
+"boyutlayamaz."
+
+#: libparted/labels/dvh.c:192
+#, c-format
+msgid "%s has no extended partition (volume header partition)."
+msgstr "%s'in ek disk blm (oylum bal disk blm) yok."
+
+#: libparted/labels/dvh.c:315
+msgid "Checksum is wrong, indicating the partition table is corrupt."
+msgstr ""
+"Salama toplam, disk blmleme tablosunun bozuk olduunu belirtir ekilde "
+"yanl."
+
+#: libparted/labels/dvh.c:616
+msgid "Only primary partitions can be root partitions."
+msgstr "Yalnzca birincil disk blmleri kk disk blm olabilir."
+
+#: libparted/labels/dvh.c:630
+msgid "Only primary partitions can be swap partitions."
+msgstr "Yalnzca birincil disk blmleri takas disk blmleri olabilir."
+
+#: libparted/labels/dvh.c:644
+msgid "Only logical partitions can be a boot file."
+msgstr "Yalnzca mantksal disk blmleri bir nykleme dosyas olabilir."
+
+#: libparted/labels/dvh.c:723
+msgid "Only logical partitions (boot files) have a name."
+msgstr ""
+"Yalnzca mantksal disk blmlerinin (nykleme dosyalar) bir ad olabilir."
+
+#: libparted/labels/dvh.c:814
+msgid "Too many primary partitions"
+msgstr "ok fazla birincil disk blm"
+
+#: libparted/labels/gpt.c:433
+#, c-format
+msgid ""
+"%s contains GPT signatures, indicating that it has a GPT table. However, it "
+"does not have a valid fake msdos partition table, as it should. Perhaps it "
+"was corrupted -- possibly by a program that doesn't understand GPT partition "
+"tables. Or perhaps you deleted the GPT table, and are now using an msdos "
+"partition table. Is this a GPT partition table?"
+msgstr ""
+"%s, GPT tablosu ierdiini belirten GPT imzalarna sahip. Ayrca, olmas "
+"gerekenin aksine, geerli sahte msdos disk blmleme tablosu yok. Belki GPT "
+"disk blmleme tablolarndan anlamayan bir program tarafndan bozulmutur. "
+"Ya da belki siz GPT tablosunu sildiniz ve imdi bir msdos disk blmleme "
+"tablosu kullanmaktasnz. Bu bir GPT disk blmleme tablosu mu?"
+
+#: libparted/labels/gpt.c:625
+#, c-format
+msgid ""
+"The format of the GPT partition table is version %x, which is newer than "
+"what Parted can recognise. Please tell us! bug-parted@gnu.org"
+msgstr ""
+"GPT disk blmleme tablosu biemi srm %x olup, Parted'n "
+"tanyabileceinden daha yenidir. Ltfen bize bildirin! bug-parted@gnu.org"
+
+#: libparted/labels/gpt.c:747
+msgid ""
+"The backup GPT table is not at the end of the disk, as it should be. This "
+"might mean that another operating system believes the disk is smaller. Fix, "
+"by moving the backup to the end (and removing the old backup)?"
+msgstr ""
+"GPT tablosunun yedei, olmas gerektii gibi diskin sonunda deil. Bu, bir "
+"baka iletim sisteminin diski olduundan kk sanmas anlamna gelebilir. "
+"Yedei sona tayarak (ve eski yedei silerek) onarnz?"
+
+#: libparted/labels/gpt.c:782
+msgid ""
+"The primary GPT table is corrupt, but the backup appears OK, so that will be "
+"used."
+msgstr ""
+"Birincil GPT tablosu bozuk, ama yedek tamam grnyor, dolaysyla yedek "
+"kullanlacak."
+
+#: libparted/labels/gpt.c:790
+msgid ""
+"Both the primary and backup GPT tables are corrupt. Try making a fresh "
+"table, and using Parted's rescue feature to recover partitions."
+msgstr ""
+"Hem birincil, hem de yedek GPT tablosu bozuk. Yeni bir tablo oluturmay ve "
+"Parted'n kurtarma zelliini kullanarak disk blmlerini kurtarmay deneyin."
+
+#: libparted/labels/mac.c:167
+#, c-format
+msgid "Invalid signature %x for Mac disk labels."
+msgstr "Mac disk etiketleri iin geersiz imza %x."
+
+#: libparted/labels/mac.c:212
+msgid "Partition map has no partition map entry!"
+msgstr "Disk blm eleminin disk blm elem girdisi yok!"
+
+#: libparted/labels/mac.c:259
+#, c-format
+msgid "%s is too small for a Mac disk label!"
+msgstr "%s, bir Mac disk etiketi iin ok kk!"
+
+#: libparted/labels/mac.c:490
+#, c-format
+msgid "Partition %d has an invalid signature %x."
+msgstr "%d disk blm geersiz imzaya sahip %x."
+
+#: libparted/labels/mac.c:508
+#, c-format
+msgid "Partition %d has an invalid length of 0 bytes!"
+msgstr "%d disk blm 0 baytlk geersiz uzunlua sahip!"
+
+#: libparted/labels/mac.c:536
+msgid "The data region doesn't start at the start of the partition."
+msgstr "Veri blgesi, disk blmnn bandan balamyor"
+
+#: libparted/labels/mac.c:553
+msgid "The boot region doesn't start at the start of the partition."
+msgstr "nykleme blgesi, disk blmnn bandan balamyor"
+
+#: libparted/labels/mac.c:567
+msgid "The partition's boot region doesn't occupy the entire partition."
+msgstr "Disk blmnn nykleme blgesi tm disk blmn kaplamyor."
+
+#: libparted/labels/mac.c:577
+msgid "The partition's data region doesn't occupy the entire partition."
+msgstr "Disk blmnn veri blgesi tm disk blmn kaplamyor."
+
+#: libparted/labels/mac.c:631
+#, c-format
+msgid ""
+"Weird block size on device descriptor: %d bytes is not divisible by 512."
+msgstr "Aygt tanmlaycsnda tuhaf blok boyutu: %d bayt, 512'ye blnemiyor."
+
+#: libparted/labels/mac.c:644
+#, c-format
+msgid ""
+"The driver descriptor says the physical block size is %d bytes, but Linux "
+"says it is %d bytes."
+msgstr ""
+"Src tanmlaycs fiziksel blok boyutunun %d bayt olduunu, Linux %d bayt "
+"olduunu bildiriyor.."
+
+#: libparted/labels/mac.c:692
+msgid "No valid partition map found."
+msgstr "Geerli disk blm elemi bulunamad."
+
+#: libparted/labels/mac.c:744
+#, c-format
+msgid ""
+"Conflicting partition map entry sizes! Entry 1 says it is %d, but entry %d "
+"says it is %d!"
+msgstr ""
+"elien disk blm elem girdi boyutlar! 1. Girdi %1$d olduunu, ancak %2"
+"$d. girdi %3$d olduunu bildiriyor!"
+
+#: libparted/labels/mac.c:771
+msgid "Weird! There are 2 partitions map entries!"
+msgstr "Tuhaf!- 2 disk blm elem girdisi mevcut!"
+
+#: libparted/labels/mac.c:1257
+msgid ""
+"Changing the name of a root or swap partition will prevent Linux from "
+"recognising it as such."
+msgstr ""
+"Bir kk ya da takas disk blmnn adn deitirmek, Linux'un onu olduu "
+"gibi tanmasn engelleyecek."
+
+#: libparted/labels/mac.c:1353
+msgid "Can't add another partition -- the partition map is too small!"
+msgstr "Bir baka disk blm eklenemiyor -- disk blm elemi ok kk!"
+
+#: libparted/labels/pc98.c:357
+#, c-format
+msgid "Invalid partition table on %s."
+msgstr "%s zerinde geersiz disk blmleme tablosu."
+
+#: libparted/labels/pc98.c:409 libparted/labels/pc98.c:487
+#, c-format
+msgid ""
+"Partition %d isn't aligned to cylinder boundaries. This is still "
+"unsupported."
+msgstr ""
+"%d disk blm silindir snrlarna hizalanmam. Bu hala desteklenmiyor."
+
+#: libparted/labels/pc98.c:796
+msgid "Can't add another partition."
+msgstr "Bir baka disk blm eklenemiyor."
+
+#: libparted/labels/sun.c:143
+msgid "Corrupted Sun disk label detected."
+msgstr "Bozuk Sun disk etiketi saptand."
+
+#: libparted/labels/sun.c:264
+#, c-format
+msgid ""
+"The disk CHS geometry (%d,%d,%d) reported by the operating system does not "
+"match the geometry stored on the disk label (%d,%d,%d)."
+msgstr ""
+"Disk CHS geometrisi (%d,%d,%d), disk etiketinde saklanan geometriye (%d,%d,%"
+"d).uymuyor."
+
+#: libparted/labels/sun.c:286
+#, c-format
+msgid "The disk label describes a disk bigger than %s."
+msgstr "Disk etiketi, %s'den daha byk bir disk tanmlyor."
+
+#: libparted/labels/sun.c:440
+#, c-format
+msgid "The disk has %d cylinders, which is greater than the maximum of 65536."
+msgstr "Disk %d silindire sahip ki bu maksimum 65536'dan daha ok."
+
+#: libparted/labels/sun.c:736
+msgid ""
+"The Whole Disk partition is the only available one left. Generally, it is "
+"not a good idea to overwrite this partition with a real one. Solaris may "
+"not be able to boot without it, and SILO (the sparc boot loader) appreciates "
+"it as well."
+msgstr ""
+"Geride yalnzca Tm Disk disk blm kald. Genellikle, bu disk blmnn "
+"zerine bir gereini yazmak iyi bir fikir deildir. Solaris onsuz "
+"almayabilir, ve SILO da (sparc nykleyicisi) ona deer verir."
+
+#: libparted/labels/sun.c:751
+msgid "Sun disk label is full."
+msgstr "Sun disk etiketi doldu."
+
+#: libparted/filesys.c:386
+msgid "Could not detect file system."
+msgstr "Dosya sistemi saptanamyor."
+
+#: libparted/filesys.c:397
+msgid "The file system is bigger than its volume!"
+msgstr "Dosya sistemi oylumundan daha byk!"
+
+#: libparted/filesys.c:405
+#, c-format
+msgid "Support for opening %s file systems is not implemented yet."
+msgstr "%s dosya sistemlerini amak iin destek henz salanmamtr."
+
+#: libparted/filesys.c:447
+#, c-format
+msgid "Support for creating %s file systems is not implemented yet."
+msgstr "%s dosya sistemlerini oluturmak iin destek henz salanmamtr."
+
+#: libparted/filesys.c:508
+#, c-format
+msgid "Support for checking %s file systems is not implemented yet."
+msgstr "%s dosya sistemlerini kontrol etmek iin destek henz salanmamtr."
+
+#: libparted/filesys.c:574
+msgid "raw block copying"
+msgstr "ham blok kopyalama"
+
+#: libparted/filesys.c:585
+msgid "growing file system"
+msgstr "byyen dosya sistemi"
+
+#: libparted/filesys.c:625
+msgid "Can't copy onto an overlapping partition."
+msgstr "akan disk blmlerinin zerine kopyalanamyor."
+
+#: libparted/filesys.c:647
+#, c-format
+msgid ""
+"Direct support for copying file systems is not yet implemented for %s. "
+"However, support for resizing is implemented. Therefore, the file system "
+"can be copied if the new partition is at least as big as the old one. So, "
+"either shrink the partition you are trying to copy, or copy to a bigger "
+"partition."
+msgstr ""
+"%s iin dosya sistemlerini kopyalamaya direkt destek henz salanmamtr. "
+"Ancak yeniden boyutlandrma destei mevcut. Bu nedenle, eer yeni disk "
+"blm en az eskisi kadar bykse, dosya sistemi kopyalanabilir. "
+"Dolaysyla, ya kopyalamaya altnz disk blmn kltn, ya da daha "
+"byk bir disk blmne kopyalayn."
+
+#: libparted/filesys.c:661
+#, c-format
+msgid "Support for copying %s file systems is not implemented yet."
+msgstr "%s dosya sistemlerini kopyalamak iin destek henz salanmamtr."
+
+#: libparted/filesys.c:699
+#, c-format
+msgid "Support for resizing %s file systems is not implemented yet."
+msgstr ""
+"%s dosya sistemlerini yeniden boyutlandrmak iin destek henz "
+"salanmamtr."
+
+#: libparted/exception.c:78
+msgid "Information"
+msgstr "Bilgi"
+
+#: libparted/exception.c:79
+msgid "Warning"
+msgstr "Uyar"
+
+#: libparted/exception.c:80
+msgid "Error"
+msgstr "Hata"
+
+#: libparted/exception.c:81
+msgid "Fatal"
+msgstr "lmcl"
+
+#: libparted/exception.c:82
+msgid "Bug"
+msgstr "Yazlm hatas"
+
+#: libparted/exception.c:83
+msgid "No Implementation"
+msgstr "Uyarlama yok"
+
+#: libparted/exception.c:87
+msgid "Fix"
+msgstr "Onar"
+
+#: libparted/exception.c:88
+msgid "Yes"
+msgstr "Evet"
+
+#: libparted/exception.c:89
+msgid "No"
+msgstr "Hayr"
+
+#: libparted/exception.c:90
+msgid "OK"
+msgstr "Tamam"
+
+#: libparted/exception.c:91
+msgid "Retry"
+msgstr "Yeniden dene"
+
+#: libparted/exception.c:92
+msgid "Ignore"
+msgstr "Yoksay"
+
+#: libparted/exception.c:93
+msgid "Cancel"
+msgstr "Vazge"
+
+#: libparted/exception.c:133
+#, c-format
+msgid ""
+"A bug has been detected in GNU Parted. Refer to the web site of parted "
+"http://www.gnu.org/software/parted/parted.html for more informations of what "
+"could be useful for bug submitting! Please email a bug report to bug-"
+"parted@gnu.org containing at least the version (%s) and the following "
+"message: "
+msgstr ""
+"GNU parted'da bir yazlm hatas saptand. Hata bildirmek iin daha fazla "
+"bilgiye ulamak zere parted'n web sitesine bavurun: http://www.gnu.org/"
+"software/parted/parted.html! Ltfen bug-parted@gnu.org'a srm (%s) ve "
+"aadaki mesaj ieren bir yazlm hatas raporu gnderin: "
+
+#: libparted/cs/geom.c:162
+msgid "Can't have the end before the start!"
+msgstr "Balangtan nce son gelemez!"
+
+#: libparted/cs/geom.c:169
+msgid "Can't have a partition outside the disk!"
+msgstr "Disk blm disk dnda bulunamaz!"
+
+#: libparted/cs/geom.c:303
+#, c-format
+msgid "Attempt to read sectors %ld-%ld outside of partition on %s."
+msgstr ""
+"%3$s zerindeki disk blmnn dnda yeralan %1$ld-%2$ld sektrleri "
+"okunmaya allyor."
+
+#: libparted/cs/geom.c:373
+#, c-format
+msgid "Attempt to write sectors %ld-%ld outside of partition on %s."
+msgstr ""
+"%3$s zerindeki disk blmnn dnda yeralan %1$ld-%2$ld sektrlere "
+"yazmaya allyor."
+
+#: libparted/cs/geom.c:413 libparted/fs/linux_swap/linux_swap.c:353
+msgid "checking for bad blocks"
+msgstr "hatal blok aranyor"
+
+#: libparted/libparted.c:286 libparted/libparted.c:306
+msgid "Out of memory."
+msgstr "Yetersiz bellek"
+
+#: libparted/unit.c:139
+msgid "Cannot get unit size for special unit 'COMPACT'."
+msgstr "zel birim 'COMPACT' iin birim boyutu alnamyor."
+
+#: libparted/unit.c:382
+#, c-format
+msgid "\"%s\" has invalid syntax for locations."
+msgstr "\"%s\" yerleimler iin geersiz yazma sahip."
+
+#: libparted/unit.c:390
+#, c-format
+msgid "The maximum head value is %d."
+msgstr "Maksimum kafa deeri %d."
+
+#: libparted/unit.c:397
+#, c-format
+msgid "The maximum sector value is %d."
+msgstr "Maksimum sektr deeri %d."
+
+#: libparted/unit.c:409 libparted/unit.c:540
+#, c-format
+msgid "The location %s is outside of the device %s."
+msgstr "%1$s yerleimi %2$s aygtnn dnda."
+
+#: libparted/unit.c:522
+msgid "Invalid number."
+msgstr "Geersiz numara."
+
+#: libparted/fs/ext2/ext2.c:87 libparted/fs/ext2/ext2.c:112
+msgid "Inconsistent group descriptors!"
+msgstr "Tutarsz grup tanmlayclar!"
+
+#: libparted/fs/ext2/ext2.c:91 libparted/fs/ext2/ext2.c:116
+msgid "File system full!"
+msgstr "Dosya sistemi dolu!"
+
+#: libparted/fs/ext2/ext2.c:750
+msgid "Invalid superblock. Are you sure this is an ext2 file system?"
+msgstr ""
+"Geersiz sperblok. Bunun bir ext2 dosya sistemi olduundan emin misiniz?"
+
+#: libparted/fs/ext2/ext2.c:764 libparted/fs/ext2/ext2_resize.c:597
+msgid "File system has errors! You should run e2fsck."
+msgstr "Dosya sisteminde hatalar var! e2fsck'yi yrtn."
+
+#: libparted/fs/ext2/ext2.c:775
+msgid ""
+"File system was not cleanly unmounted! You should run e2fsck. Modifying an "
+"unclean file system could cause severe corruption."
+msgstr ""
+"Dosya sistemi temizce ayrlmad! e2fsck'lamalsnz. Temiz olmayan dosya "
+"sistemini deitirmek ciddi sorunlara yol aabilir."
+
+#: libparted/fs/ext2/ext2.c:795
+msgid "File system has an incompatible feature enabled."
+msgstr "Dosya sisteminin uyumsuz bir nitelii etkinletirilmi"
+
+#: libparted/fs/ext2/ext2.c:806
+msgid "Error allocating buffer cache."
+msgstr "Tampon nbellek atamada hata."
+
+#: libparted/fs/ext2/ext2.c:848
+msgid ""
+"A resize operation on this file system will use EXPERIMENTAL code that MAY "
+"CORRUPT it (although it hasn't done so yet).You should at least backup your "
+"data and run 'e2fsck -f' afterwards."
+msgstr ""
+"Bu dosya sisteminde bir yeniden boyutlama ilemi BOZULMAYA yol aabilecek "
+"DENEYSEL kod kullanacak (henz kullanlmad). En azndan verilerinizi "
+"yedekleyip sonrasnda 'e2fsck -f' yrtmelisiniz."
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:114
+msgid ""
+"Found an inode with a incorrect link count. Better go run e2fsck first!"
+msgstr ""
+"Yanl link saysna sahip bir dosya indeksi bulundu. yisi mi nce bir "
+"e2fsck yrtn."
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:487
+msgid "Not enough free inodes!"
+msgstr "Yeterli serbest dosya indeksi yok!"
+
+#: libparted/fs/ext2/ext2_resize.c:224
+msgid "File system is too full to remove a group!"
+msgstr "Dosya sistemi bir grubu silmek iin ok dolu!"
+
+#: libparted/fs/ext2/ext2_resize.c:233
+msgid "File system has too many allocated inodes to remove a group!"
+msgstr "Dosya sistemi bir grubu silmek iin ok sayda dosya indeksine sahip!"
+
+#: libparted/fs/ext2/ext2_resize.c:493
+msgid "adding groups"
+msgstr "gruplar ekleniyor"
+
+#: libparted/fs/ext2/ext2_resize.c:530
+#, c-format
+msgid "Your file system is too full to resize it to %i blocks. Sorry."
+msgstr ""
+"Dosya sisteminiz %i bloa yeniden boyutlandrlmak iin ok dolul. zgnm."
+
+#: libparted/fs/ext2/ext2_resize.c:540
+#, c-format
+msgid ""
+"Your file system has too many occupied inodes to resize it to %i blocks. "
+"Sorry."
+msgstr ""
+"Dosya sisteminiz %i bloa yeniden boyutlandrmak iin ok sayda dolu dosya "
+"indeksine sahip. zgnm."
+
+#: libparted/fs/ext2/ext2_resize.c:554 libparted/fs/hfs/hfs.c:243
+#: libparted/fs/hfs/hfs.c:624
+msgid "shrinking"
+msgstr "kltlyor"
+
+#: libparted/fs/ext2/ext2_resize.c:605
+msgid "File system was not cleanly unmounted! You should run e2fsck."
+msgstr "Dosya sistemi temizce ayrlmad! e2fsck altrmalsnz."
+
+#: libparted/fs/ext2/ext2_resize.c:614
+msgid ""
+"The file system has the 'dir_index' feature enabled. Parted can only resize "
+"the file system if it disables this feature. You can enable it later by "
+"running 'tune2fs -O dir_index DEVICE' and then 'e2fsck -fD DEVICE'."
+msgstr ""
+"Dosya sisteminin 'dir_index' zellii etkin halde... Parted, dosya "
+"sistemini ancak bu zellii devre d brakarak yeniden boyutlandrabilir. "
+"Daha sonra 'tune2fs -O dir_index' ve sonrasnda 'e2fsck -fD AYGIT' "
+"komutlaryla yeniden etkinletirebilirsiniz."
+
+#: libparted/fs/ext2/ext2_block_relocator.c:198
+msgid "Cross-linked blocks found! Better go run e2fsck first!"
+msgstr "apraz bal bloklar bulundu! iyisi mi nce gibip e2fsck yrtn!"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:537
+#, c-format
+msgid "Block %i has no reference? Weird."
+msgstr "%i blounun bavurusu yok? Tuhaf"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:738
+#, c-format
+msgid "Block %i shouldn't have been marked!"
+msgstr "%i blou iaretlenmemi olmalyd!"
+
+#: libparted/fs/ext2/interface.c:188
+msgid ""
+"The ext2 file system passed a basic check. For a more comprehensive check, "
+"use the e2fsck program."
+msgstr ""
+"ext2 dosya sistemi temel bir kontrol geti. Daha kapsaml bir kontrol iin "
+"e2fsck programn kullannz."
+
+#: libparted/fs/ext2/interface.c:205
+msgid "Sorry, can't move the start of ext2 partitions yet!"
+msgstr "zgnm, henz ext2 disk blmlerinin balangc tanamyor!"
+
+#: libparted/fs/ext2/ext2_buffer.c:82
+msgid "Couldn't flush buffer cache!"
+msgstr "Tampon nbellek boaltlamad!"
+
+#: libparted/fs/ext2/ext2_mkfs.c:162
+msgid "writing per-group metadata"
+msgstr "grup baznda metaverisi yazlyor"
+
+#: libparted/fs/ext2/ext2_mkfs.c:565
+msgid "File system too small for ext2."
+msgstr "ext2 iin dosya sistemi ok kk."
+
+#: libparted/fs/fat/calc.c:134
+#, c-format
+msgid ""
+"You need %s of free disk space to shrink this partition to this size. "
+"Currently, only %s is free."
+msgstr ""
+"Bu disk blmn bu boyuta kltmek iin %1$s'lik bo yere gereksiniminiz "
+"var. Halen yalnzca %2$s kadar bo."
+
+#: libparted/fs/fat/context.c:55
+#, c-format
+msgid ""
+"Cluster start delta = %d, which is not a multiple of the cluster size %d."
+msgstr "Kme balangc delta = %d, kme boyutu olan %d'nin katsays deil."
+
+#: libparted/fs/fat/fat.c:312
+#, c-format
+msgid "Partition too big/small for a %s file system."
+msgstr "Disk blm, bir %s dosya sistemi iin ok byk/kk"
+
+#: libparted/fs/fat/fat.c:478
+msgid ""
+"The FATs don't match. If you don't know what this means, then select "
+"cancel, run scandisk on the file system, and then come back."
+msgstr ""
+"FAT'lar uyumuyor. Eer bunun ne demek olduunu bilmiyorsanz, Vazge'i "
+"sein, dosya sisteminde scandisk'i yrtn, ve buraya dnn."
+
+#: libparted/fs/fat/fat.c:518
+msgid "There are no possible configurations for this FAT type."
+msgstr "Bu FAT tr iin olas yaplandrma yok."
+
+#: libparted/fs/fat/fat.c:530
+#, c-format
+msgid ""
+"File system doesn't have expected sizes for Windows to like it. Cluster "
+"size is %dk (%dk expected); number of clusters is %d (%d expected); size of "
+"FATs is %d sectors (%d expected)."
+msgstr ""
+"Dosya sistemi, Windows'un holanmas beklenen boyutlara sahip deil. Kme "
+"boyutu %dk (%dk beklenirdi); kme says %d (%d beklenirdi); FAT boyutlar %"
+"d sektrdr (%d beklenirdi)."
+
+#: libparted/fs/fat/fat.c:553
+#, c-format
+msgid ""
+"File system is reporting the free space as %d clusters, not %d clusters."
+msgstr "Dosya sistemi boluun %d kme olduunu bildiriyor, %d kme deil."
+
+#: libparted/fs/fat/fat.c:878
+msgid ""
+"GNU Parted was miscompiled: the FAT boot sector should be 512 bytes. FAT "
+"support will be disabled."
+msgstr ""
+"GNU parted yanl derlenmi: FAT nykleme sektr 512 bayt olmal. FAT "
+"destei devre d braklacak."
+
+#: libparted/fs/fat/resize.c:158
+msgid ""
+"There's not enough room in the root directory for all of the files. Either "
+"cancel, or ignore to lose the files."
+msgstr ""
+"Kk dizininde tm dosyalara yetecek yer yok. Ya iptal edin, ya da dosyalar "
+"yitirmek iin yoksayn."
+
+#: libparted/fs/fat/resize.c:299
+msgid "Error writing to the root directory."
+msgstr "Kk dizinine yazmada hata."
+
+#: libparted/fs/fat/resize.c:484
+msgid "If you leave your file system as FAT16, then you will have no problems."
+msgstr "Eer dosya sisteminizi FAT16 olarak brakrsanz sorununuz olmaz."
+
+#: libparted/fs/fat/resize.c:487
+msgid ""
+"If you convert to FAT16, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual)."
+msgstr ""
+"Eer FAT16'ya dntrrseniz ve bu disk blmne MS Windows yklenmise, MS "
+"Windows nykleyicisini yeniden yklemelisiniz. Eer bunu yapmak "
+"isterseniz, Parted el kitabna (ya da datmnzn el kitabna) "
+"bavurmalsnz."
+
+#: libparted/fs/fat/resize.c:495
+msgid ""
+"If you leave your file system as FAT32, then you will not introduce any new "
+"problems."
+msgstr ""
+"Eer dosya sisteminizi FAT32 olarak brakrsanz yeni bir sorunla "
+"karlamayacaksnz."
+
+#: libparted/fs/fat/resize.c:499
+msgid ""
+"If you convert to FAT32, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual). Also, "
+"converting to FAT32 will make the file system unreadable by MS DOS, MS "
+"Windows 95a, and MS Windows NT."
+msgstr ""
+"Eer FAT32'ye dntrrseniz ve bu disk blmne MS Windows yklenmise, MS "
+"Windows nykleyicisini yeniden yklemelisiniz. Eer bunu yapmak "
+"isterseniz, Parted el kitabna (ya da datmnzn el kitabna) "
+"bavurmalsnz. Ayrca FAT32'ye dnm, dosya sisteminin MS DOS, MS "
+"Windows 95a ve MS Windows NT tarafndan okunamaz olmasna yol aacaktr."
+
+#: libparted/fs/fat/resize.c:513
+#, c-format
+msgid "%s %s %s"
+msgstr "%s %s %s"
+
+#: libparted/fs/fat/resize.c:514
+msgid "Would you like to use FAT32?"
+msgstr "FAT32 kullanmak ister misiniz?"
+
+#: libparted/fs/fat/resize.c:541 libparted/fs/fat/resize.c:557
+#, c-format
+msgid "%s %s"
+msgstr "%s %s"
+
+#: libparted/fs/fat/resize.c:542
+msgid ""
+"The file system can only be resized to this size by converting to FAT16."
+msgstr ""
+"Dosya sistemi, yalnzca FAT16'ya dntrlerek bu boyuta yeniden "
+"boyutlandrlabilir."
+
+#: libparted/fs/fat/resize.c:558
+msgid ""
+"The file system can only be resized to this size by converting to FAT32."
+msgstr ""
+"Dosya sistemi, yalnzca FAT32'ye dntrlerek bu boyuta yeniden "
+"boyutlandrlabilir."
+
+#: libparted/fs/fat/resize.c:571
+msgid ""
+"GNU Parted cannot resize this partition to this size. We're working on it!"
+msgstr ""
+"GNU Parted bu disk blmn bu boyuta yeniden boyutlandramaz. zerinde "
+"alyoruz!"
+
+#: libparted/fs/fat/bootsector.c:48 libparted/fs/fat/bootsector.c:55
+msgid "File system has an invalid signature for a FAT file system."
+msgstr "Dosya sistemi, FAT dosya sistemi iin geersiz bir imzaya sahip.."
+
+#: libparted/fs/fat/bootsector.c:62
+msgid "File system has an invalid sector size for a FAT file system."
+msgstr ""
+"Dosya sistemi, FAT dosya sistemi iin geersiz bir sektr boyutuna sahip."
+
+#: libparted/fs/fat/bootsector.c:69
+msgid "File system has an invalid cluster size for a FAT file system."
+msgstr ""
+"Dosya sistemi, FAT dosya sistemi iin geersiz bir kme boyutuna sahip."
+
+#: libparted/fs/fat/bootsector.c:76
+msgid ""
+"File system has an invalid number of reserved sectors for a FAT file system."
+msgstr ""
+"Dosya sistemi, FAT dosya sistemi iin geersiz bir ayrlm sektr saysna "
+"sahip."
+
+#: libparted/fs/fat/bootsector.c:83
+msgid "File system has an invalid number of FATs."
+msgstr "Dosya sistemi, geersiz FATS saysna sahip."
+
+#: libparted/fs/fat/bootsector.c:138
+#, c-format
+msgid ""
+"This file system has a logical sector size of %d. GNU Parted is known not "
+"to work properly with sector sizes other than 512 bytes."
+msgstr ""
+"Bu dosya sistemi %d mantksal sektr boyutuna sahip. GNU Parted'in 512 "
+"bayttan farkl sektr boyutlaryla dzgn almad bilinmektedir."
+
+#: libparted/fs/fat/bootsector.c:163
+#, c-format
+msgid ""
+"The file system's CHS geometry is (%d, %d, %d), which is invalid. The "
+"partition table's CHS geometry is (%d, %d, %d). If you select Ignore, the "
+"file system's CHS geometry will be left unchanged. If you select Fix, the "
+"file system's CHS geometry will be set to match the partition table's CHS "
+"geometry."
+msgstr ""
+"Dosya sisteminin CHS geometrisi (%d, %d, %d), ki bu geersiz. Blmleme "
+"tablosunun CHS geometrisi (%d ,%d ,%d). Yoksay' seerseniz dosya "
+"sisteminin CHS geometrisi deitirilmeyecek. Onar' seerseniz dosya "
+"sisteminin CHS geometrisi, blmleme tablosunun CHS geometrisiyle uyuacak "
+"ekilde ayarlanacak."
+
+#: libparted/fs/fat/bootsector.c:209
+msgid "FAT boot sector says logical sector size is 0. This is weird. "
+msgstr ""
+"FAT nykleme sektr mantksal sektr boyutunun 0 olduunu sylyor. Bu "
+"tuhaf. "
+
+#: libparted/fs/fat/bootsector.c:215
+msgid "FAT boot sector says there are no FAT tables. This is weird. "
+msgstr "FAT nykleme sektr FAT tablosunun olmadn sylyor. Bu tuhaf. "
+
+#: libparted/fs/fat/bootsector.c:221
+msgid "FAT boot sector says clusters are 0 sectors. This is weird. "
+msgstr ""
+"FAT nykleme sektr kmelerin 0 sektr olduunu sylyor. Bu tuhaf. "
+
+#: libparted/fs/fat/bootsector.c:231
+msgid "File system is FAT12, which is unsupported."
+msgstr "Dosya sistemi FAT12, ki desteklenmiyor."
+
+#: libparted/fs/fat/bootsector.c:407
+#, c-format
+msgid ""
+"The information sector has the wrong signature (%x). Select cancel for now, "
+"and send in a bug report. If you're desperate, it's probably safe to ignore."
+msgstr ""
+"Bilgi sektr yanl imzaya sahip. (%x). imdilik vazgei sein ve bir "
+"yazlm hatas raporu gnderin. aresizseniz, yoksaymak muhtemelen gvenli."
+
+#: libparted/fs/fat/count.c:149
+#, c-format
+msgid "Bad directory entry for %s: first cluster is the end of file marker."
+msgstr "%s iin bozuk dizin girii: ilk kme dosya belirtecinin sonunda."
+
+#: libparted/fs/fat/count.c:162
+#, c-format
+msgid ""
+"Bad FAT: unterminated chain for %s. You should run dosfsck or scandisk."
+msgstr ""
+"Bozuk FAT: %s iin sonlandrlmam zincir. dosfsck ya da scandisk "
+"yrtmelisiniz."
+
+#: libparted/fs/fat/count.c:171
+#, c-format
+msgid ""
+"Bad FAT: cluster %d outside file system in chain for %s. You should run "
+"dosfsck or scandisk."
+msgstr ""
+"Bozuk FAT: %d kmesi %s iin dosya sistemi zincirinin dnda. dosfsck ya "
+"da scandisk yrtmelisiniz."
+
+#: libparted/fs/fat/count.c:181
+#, c-format
+msgid ""
+"Bad FAT: cluster %d is cross-linked for %s. You should run dosfsck or "
+"scandisk."
+msgstr ""
+"Bozuk FAT: %d kmesi %s iin apraz bal. dosfsck ya da scandisk "
+"yrtmelisiniz."
+
+#: libparted/fs/fat/count.c:200
+#, c-format
+msgid "%s is %dk, but it has %d clusters (%dk)."
+msgstr "%s %dkdr, fakat %d kmeye (%dk) sahip."
+
+#: libparted/fs/fat/count.c:263
+#, c-format
+msgid ""
+"The file %s is marked as a system file. This means moving it could cause "
+"some programs to stop working."
+msgstr ""
+"%s dosyas bir sistem dosyas olarak iaretlenmi. Bu, onu tamann baz "
+"programlarn almasn durdurmaya yolaaca anlamna gelir."
+
+#: libparted/fs/fat/table.c:138
+#, c-format
+msgid ""
+"FAT %d media %x doesn't match the boot sector's media %x. You should "
+"probably run scandisk."
+msgstr ""
+"FAT %d ortam %x nykleme sektrnn ortam %x'le uyumamakta. Muhtemelen "
+"scandisk yrtmelisiniz."
+
+#: libparted/fs/fat/table.c:268
+#, c-format
+msgid "fat_table_set: cluster %ld outside file system"
+msgstr "fat_table_set: %ld kmesi dosya sisteminin dnda"
+
+#: libparted/fs/fat/table.c:296
+#, c-format
+msgid "fat_table_get: cluster %ld outside file system"
+msgstr "fat_table_get: %ld kmesi dosya sisteminin dnda"
+
+#: libparted/fs/fat/table.c:334
+msgid "fat_table_alloc_cluster: no free clusters"
+msgstr "fat_table_alloc_cluster: bo kme yok"
+
+#: libparted/fs/linux_swap/linux_swap.c:236
+#, c-format
+msgid "Unrecognised linux swap signature '%10s'."
+msgstr "Tannmayan linux takas imzas '%10s'."
+
+#: libparted/fs/linux_swap/linux_swap.c:312
+msgid "Too many bad pages."
+msgstr "ok sayda bozuk sayfa."
+
+#: libparted/fs/hfs/advfs.c:123 libparted/fs/hfs/advfs_plus.c:125
+#: libparted/fs/hfs/reloc.c:416 libparted/fs/hfs/reloc.c:510
+#: libparted/fs/hfs/reloc_plus.c:541 libparted/fs/hfs/reloc_plus.c:660
+#: libparted/fs/hfs/reloc_plus.c:774
+msgid "The file system contains errors."
+msgstr "Dosya sistemi hatalar ieriyor."
+
+#: libparted/fs/hfs/advfs_plus.c:290
+msgid "Bad blocks could not be read."
+msgstr "Hatal bloklar okunamyor."
+
+#: libparted/fs/hfs/cache.c:139
+#, c-format
+msgid ""
+"Trying to register an extent starting at block 0x%X, but another one already "
+"exists at this position. You should check the file system!"
+msgstr ""
+"Blok 0x%X'den balayacak ekilde bir aralk kaydedilmeye allyor, fakat "
+"bu konumda bir bakas zaten mevcut. Dosya sistemini kontrol etmelisiniz!"
+
+#: libparted/fs/hfs/cache.c:216
+#, c-format
+msgid ""
+"Trying to move an extent from block Ox%X to block Ox%X, but another one "
+"already exists at this position. This should not happen!"
+msgstr ""
+"Blok Ox%X'den Ox%X'e bir aralk tanmaya allyor, fakat bu konumda bir "
+"bakas zaten mevcut. Bu olmamal!"
+
+#: libparted/fs/hfs/file.c:145
+#, c-format
+msgid "Could not update the extent cache for HFS file with CNID %X."
+msgstr "Aralk nbellei CNID %X'li HFS dosyas iin gncellenemedi."
+
+#: libparted/fs/hfs/file.c:182
+#, c-format
+msgid "Trying to read HFS file with CNID %X behind EOF."
+msgstr "EOF arkasnda CNID %X'li HFS dosyas okunmaya allyor."
+
+#: libparted/fs/hfs/file.c:192 libparted/fs/hfs/file.c:222
+#, c-format
+msgid "Could not find sector %lli of HFS file with CNID %X."
+msgstr "CNID %2$X li HFS dosyasnn %1$lli sektr bulunamad."
+
+#: libparted/fs/hfs/file.c:212
+#, c-format
+msgid "Trying to write HFS file with CNID %X behind EOF."
+msgstr "EOF arkasnda CNID %X'li HFS dosyas yazlmaya allyor."
+
+#: libparted/fs/hfs/file_plus.c:159
+#, c-format
+msgid "Could not update the extent cache for HFS+ file with CNID %X."
+msgstr "Aralk nbellei CNID %X'li HFS+ dosyas iin gncellenemedi."
+
+#: libparted/fs/hfs/file_plus.c:203
+#, c-format
+msgid "Trying to read HFS+ file with CNID %X behind EOF."
+msgstr "EOF arkasnda CNID %X'li HFS+ dosyas okunmaya allyor."
+
+#: libparted/fs/hfs/file_plus.c:214 libparted/fs/hfs/file_plus.c:256
+#, c-format
+msgid "Could not find sector %lli of HFS+ file with CNID %X."
+msgstr "CNID %2$X li HFS+ dosyasnn %1$lli sektr bulunamad."
+
+#: libparted/fs/hfs/file_plus.c:245
+#, c-format
+msgid "Trying to write HFS+ file with CNID %X behind EOF."
+msgstr "EOF arkasnda CNID %X'li HFS+ dosyas yazlmaya allyor."
+
+#: libparted/fs/hfs/hfs.c:225
+msgid "Sorry, HFS cannot be resized that way yet."
+msgstr "zgnm, HFS henz o ekilde yeniden boyutlandrlamyor."
+
+#: libparted/fs/hfs/hfs.c:255 libparted/fs/hfs/hfs.c:636
+msgid "Data relocation has failed."
+msgstr "Veri yeniden konumlandrlmas baarsz."
+
+#: libparted/fs/hfs/hfs.c:274
+msgid "Data relocation left some data in the end of the volume."
+msgstr "Veri yeniden konumladrlmas oylumun sonunda baz verileri brakt."
+
+#: libparted/fs/hfs/hfs.c:313
+msgid "writing HFS Master Directory Block"
+msgstr "HFS Ana Dizin Blou yazlyor"
+
+#: libparted/fs/hfs/hfs.c:461
+msgid "No valid HFS[+X] signature has been found while opening."
+msgstr "Aarken, geerli HFS[+X] imzas bulunamad."
+
+#: libparted/fs/hfs/hfs.c:471
+#, c-format
+msgid "Version %d of HFS+ isn't supported."
+msgstr "HFS+'in %d srm desteklenmiyor."
+
+#: libparted/fs/hfs/hfs.c:482
+#, c-format
+msgid "Version %d of HFSX isn't supported."
+msgstr "HFSX'in %d srm desteklenmiyor."
+
+#: libparted/fs/hfs/hfs.c:667
+msgid "Data relocation left some data at the end of the volume."
+msgstr "Veri yeniden konumladrlmas oylumun sonunda baz verileri brakt."
+
+#: libparted/fs/hfs/hfs.c:715
+msgid "Error while writing the allocation file."
+msgstr "Atama dosyasna yazmada hata."
+
+#: libparted/fs/hfs/hfs.c:730
+msgid "Error while writing the compatibility part of the allocation file."
+msgstr "Atama dosyasnn uyumluluk blmne yazmada hata."
+
+#: libparted/fs/hfs/hfs.c:745
+msgid "writing HFS+ Volume Header"
+msgstr "HFS+ Oylum Bal yazlyor"
+
+#: libparted/fs/hfs/hfs.c:845
+msgid "An error occurred while looking for the mandatory bad blocks file."
+msgstr "Zorunlu hatal bloklar dosyas aranrken bir hata olutu."
+
+#: libparted/fs/hfs/hfs.c:899
+msgid ""
+"It seems there is an error in the HFS wrapper: the bad blocks file doesn't "
+"contain the embedded HFS+ volume."
+msgstr ""
+"HFS sarmalaycsnda hata var gibi grnyor: hatal blok dosyas, gml HFS"
+"+ oylumunu iermiyor."
+
+#: libparted/fs/hfs/hfs.c:930
+msgid "Sorry, HFS+ cannot be resized that way yet."
+msgstr "zgnm, HFS+ henz o ekilde yeniden boyutlandrlamyor."
+
+#: libparted/fs/hfs/hfs.c:965
+msgid "shrinking embedded HFS+ volume"
+msgstr "gml HFS+ oylumu kltlyor"
+
+#: libparted/fs/hfs/hfs.c:981
+msgid "Resizing the HFS+ volume has failed."
+msgstr "HFS+ oylumunun yeniden boyutlandrlmas baarsz."
+
+#: libparted/fs/hfs/hfs.c:988
+msgid "shrinking HFS wrapper"
+msgstr "HFS sarmalaycs kltlyor"
+
+#: libparted/fs/hfs/hfs.c:997
+msgid "Updating the HFS wrapper has failed."
+msgstr "HFS sarmalaycsnn gncellenmesi baarsz."
+
+#: libparted/fs/hfs/hfs.c:1099 libparted/fs/hfs/hfs.c:1184
+#, c-format
+msgid ""
+"This is not a real %s check. This is going to extract special low level "
+"files for debugging purposes."
+msgstr ""
+"Bu geek bir %s kontrol deil. Hata ayklama amacyla dk dzey dosyalar "
+"ztlenecek."
+
+#: libparted/fs/hfs/journal.c:156
+msgid "Bad block list header checksum."
+msgstr "Hatal blok liste bal salama toplam"
+
+#: libparted/fs/hfs/journal.c:169
+#, c-format
+msgid ""
+"Invalid size of a transaction block while replaying the journal (%i bytes)."
+msgstr "Gnlk tekrar okunurken geersiz bir ilem boyut blou (%i bayt)."
+
+#: libparted/fs/hfs/journal.c:261
+msgid ""
+"Journal stored outside of the volume are not supported. Try to desactivate "
+"the journal and run Parted again."
+msgstr ""
+"Oylum dnda depolanan gnlkler desteklenmiyor. Gnl etkisiz klmay "
+"ve Parted' yeniden altrmay deneyin."
+
+#: libparted/fs/hfs/journal.c:272
+msgid "Journal offset or size is not multiple of the sector size."
+msgstr "Gnlk balangc ya da boyutu sektr boyutunun kat deil."
+
+#: libparted/fs/hfs/journal.c:290
+msgid "Incorrect magic values in the journal header."
+msgstr "Gnlk balnda geersiz sihirli deerler."
+
+#: libparted/fs/hfs/journal.c:299
+msgid "Journal size mismatch between journal info block and journal header."
+msgstr "Gnlk bilgi blou ve bal arasnda gnlk boyutu rtmyor."
+
+#: libparted/fs/hfs/journal.c:311
+msgid "Some header fields are not multiple of the sector size."
+msgstr "Baz balk alanlar sektr boyutunun kat deil."
+
+#: libparted/fs/hfs/journal.c:320
+msgid ""
+"The sector size stored in the journal is not 512 bytes. Parted only "
+"supports 512 bytes length sectors."
+msgstr ""
+"Gnlkte kaytl sektr boyutu 512 bayt deil. Parted yalnzca 512 bayt "
+"uzunluktaki sektrleri destekler."
+
+#: libparted/fs/hfs/journal.c:332
+msgid "Bad journal checksum."
+msgstr "Bozuk gnlk salama toplam."
+
+#: libparted/fs/hfs/journal.c:350
+msgid ""
+"The journal is not empty. Parted must replay the transactions before "
+"opening the file system. This will modify the file system."
+msgstr ""
+"Gnlk bo. Parted, dosya sistemini amadan ilemleri yinelemeli. Bu, "
+"dosya sistemini deitirecek."
+
+#: libparted/fs/hfs/journal.c:378
+msgid ""
+"The volume header or the master directory block has changed while replaying "
+"the journal. You should restart Parted."
+msgstr ""
+"Gnlk yinelenirken ana dizin blounun oylum bal deiti. Parted' "
+"yeniden balatmalsnz."
+
+#: libparted/fs/hfs/probe.c:52
+#, c-format
+msgid ""
+"Parted can't use HFS file systems on disks with a sector size not equal to %"
+"d bytes."
+msgstr ""
+"Parted sektr boyutu %d bayta eit olmayan disklerde HFS dosya sistemi "
+"kullanamaz."
+
+#: libparted/fs/hfs/reloc.c:153 libparted/fs/hfs/reloc_plus.c:157
+msgid "An extent has not been relocated."
+msgstr "Bir aralk yeniden konumlanmad."
+
+#: libparted/fs/hfs/reloc.c:253 libparted/fs/hfs/reloc_plus.c:309
+msgid ""
+"A reference to an extent comes from a place it should not. You should check "
+"the file system!"
+msgstr ""
+"Bir araln bavurusu gelmemesi gereken bir yerden geliyor. Dosya "
+"sistemini kontrol etmelisiniz!"
+
+#: libparted/fs/hfs/reloc.c:383
+msgid "This HFS volume has no catalog file. This is very unusual!"
+msgstr "Bu HFS oylumunun katalog dosyas yok. Bu ok srad!"
+
+#: libparted/fs/hfs/reloc.c:477
+msgid "This HFS volume has no extents overflow file. This is quite unusual!"
+msgstr "Bu HFS oylumunun aralk tamas dosyas yok. Bu olduka srad!"
+
+#: libparted/fs/hfs/reloc.c:519 libparted/fs/hfs/reloc_plus.c:670
+msgid ""
+"The extents overflow file should not contain its own extents! You should "
+"check the file system."
+msgstr ""
+"Aralk tamas dosyas, kendi aralklarn iermemeli! Dosya sistemini "
+"kontrol etmelisiniz."
+
+#: libparted/fs/hfs/reloc.c:576 libparted/fs/hfs/reloc_plus.c:849
+msgid "Could not cache the file system in memory."
+msgstr "Dosya sistemi nbellee alnamyor."
+
+#: libparted/fs/hfs/reloc.c:637 libparted/fs/hfs/reloc_plus.c:910
+msgid "Bad blocks list could not be loaded."
+msgstr "Hatal blok listesi yklenemedi."
+
+#: libparted/fs/hfs/reloc.c:651 libparted/fs/hfs/reloc_plus.c:926
+msgid "An error occurred during extent relocation."
+msgstr "Aralk yeniden konumlandrlmas srasnda bir hata olutu."
+
+#: libparted/fs/hfs/reloc_plus.c:497
+msgid "This HFS+ volume has no catalog file. This is very unusual!"
+msgstr "Bu HFS+ oylumunun katalog dosyas yok. Bu ok srad!"
+
+#: libparted/fs/hfs/reloc_plus.c:621
+msgid "This HFS+ volume has no extents overflow file. This is quite unusual!"
+msgstr "Bu HFS+ oylumunun aralk tamas dosyas yok. Bu olduka srad!"
+
+#: parted/parted.c:76
+msgid "displays this help message"
+msgstr "bu yardm mesajn grntler"
+
+#: parted/parted.c:77
+msgid "where necessary, prompts for user intervention"
+msgstr "zorunlu olduunda, kullanc mdahalesi iin istemde bulunur"
+
+#: parted/parted.c:78
+msgid "never prompts for user intervention"
+msgstr "kullanc mdahalesi iin asla istemde bulunmaz"
+
+#: parted/parted.c:79
+msgid "displays the version"
+msgstr "srm grntler"
+
+#: parted/parted.c:87
+msgid ""
+"NUMBER is the partition number used by Linux. On MS-DOS disk labels, the "
+"primary partitions number from 1 to 4, logical partitions from 5 onwards.\n"
+msgstr ""
+"NUMBER, Linux tarafndan kullanlan disk blm numarasdr. Msdos disk "
+"etiketlerinde birincil disk blm numaras 1-4 aras, mantksal disk "
+"blmleri de 5 ve stdr.\n"
+
+#: parted/parted.c:90
+msgid "LABEL-TYPE is one of: "
+msgstr "LABEL-TYPE unlardan biridir: "
+
+#: parted/parted.c:91
+msgid "FLAG is one of: "
+msgstr "FLAG unlardan biridir: "
+
+#: parted/parted.c:92
+msgid "UNIT is one of: "
+msgstr "UNIT unlardan biridir: "
+
+#: parted/parted.c:93
+msgid "PART-TYPE is one of: primary, logical, extended\n"
+msgstr "PART-TYPE unlardan biridir: birincil, mantksal, ek\n"
+
+#: parted/parted.c:95
+msgid "FS-TYPE is one of: "
+msgstr "FS-TYPE unlardan biridir: "
+
+#: parted/parted.c:96
+msgid ""
+"START and END are disk locations, such as 4GB or 10%. Negative values count "
+"from the end of the disk. For example, -1s specifies exactly the last "
+"sector.\n"
+msgstr ""
+"START ve END disk konumlardr, 4GB ya da %10 gibi. Eksi deerler, diskin "
+"sonuna uzakl belirtir. rnein -1s tam olarak son sektr belirtir.\n"
+
+#: parted/parted.c:99
+msgid "STATE is one of: on, off\n"
+msgstr "STATE unlardan biridir: ak, kapal\n"
+
+#: parted/parted.c:100
+msgid "DEVICE is usually /dev/hda or /dev/sda\n"
+msgstr "DEVICE sklkla /dev/hda ya da /dev/sda'dr\n"
+
+#: parted/parted.c:101
+msgid "NAME is any word you want\n"
+msgstr "NAME istediiniz herhangi bir szcktr\n"
+
+#: parted/parted.c:102
+msgid "The partition must have one of the following FS-TYPEs: "
+msgstr "Disk blm aadaki FS-TYPE'larndan birine sahip olmaldr: "
+
+#: parted/parted.c:105
+msgid "GNU Parted Version information:\n"
+msgstr "GNU Parted Srm bilgisi:\n"
+
+#: parted/parted.c:107
+msgid ""
+"Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n"
+"This program is free software, covered by the GNU General Public License.\n"
+"\n"
+"This program is distributed in the hope that it will be useful, but WITHOUT "
+"ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
+"FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
+"more details.\n"
+"\n"
+msgstr ""
+"Telifhakk (C) 1998 - 2005 zgr Yazlm Kuruluu, A..\n"
+"Bu program, GNU Genel Kamu Lisans'nca kapsanan bedava yazlmdr.\n"
+"\n"
+"Bu program, yararl olaca midiyle datlm olup, SATILABLRLK ya da "
+"BELL BR AMACA UYGUNLUK garantileri de dahil olmak zere HERHANG BR "
+"GARANT iermez. Daha fazla ayrnt iin GNU Genel Kamu Lisans'na "
+"baknz.\n"
+"\n"
+
+#: parted/parted.c:152
+#, c-format
+msgid "%0.f%%\t(time left %.2d:%.2d)"
+msgstr "%0.f%%\t(kalan sre %.2d:%.2d)"
+
+#: parted/parted.c:170
+#, c-format
+msgid ""
+"Partition %s is being used. You must unmount it before you modify it with "
+"Parted."
+msgstr ""
+"%s disk blm kullanlyor. Parted'la deitirmeden nce ayrmalsnz."
+
+#: parted/parted.c:187
+#, c-format
+msgid "Partition(s) on %s are being used."
+msgstr "%s zerindeki disk blm(leri) kullanlyor."
+
+#: parted/parted.c:413 parted/parted.c:594 parted/parted.c:979
+#: parted/parted.c:1059 parted/parted.c:1586 parted/parted.c:1663
+#: parted/parted.c:1707
+msgid "Partition number?"
+msgstr "Disk blm numaras?"
+
+#: parted/parted.c:456
+msgid "Source device?"
+msgstr "Kaynak aygt?"
+
+#: parted/parted.c:460
+msgid "Source partition number?"
+msgstr "Kaynak disk blm numaras?"
+
+#: parted/parted.c:465
+msgid "Can't copy an extended partition."
+msgstr "Ek disk blmleri kopyalanamyor."
+
+#: parted/parted.c:471
+msgid "Destination partition number?"
+msgstr "Hedef disk blm numaras?"
+
+#: parted/parted.c:564
+msgid "New disk label type?"
+msgstr "Yeni disk etiketi tr?"
+
+#: parted/parted.c:598
+msgid "File system?"
+msgstr "Dosya sistemi?"
+
+#: parted/parted.c:645 parted/parted.c:815
+msgid "Partition type?"
+msgstr "Disk blm tr?"
+
+#: parted/parted.c:652 parted/parted.c:822 parted/parted.c:1062
+msgid "Partition name?"
+msgstr "Disk blm ad?"
+
+#: parted/parted.c:660 parted/parted.c:832
+msgid "File system type?"
+msgstr "Dosya sistemi tr?"
+
+#: parted/parted.c:667 parted/parted.c:834 parted/parted.c:994
+#: parted/parted.c:1544 parted/parted.c:1595
+msgid "Start?"
+msgstr "Balang?"
+
+#: parted/parted.c:669 parted/parted.c:837 parted/parted.c:997
+#: parted/parted.c:1546 parted/parted.c:1597
+msgid "End?"
+msgstr "Biti?"
+
+#: parted/parted.c:707 parted/parted.c:875
+#, c-format
+msgid ""
+"You requested a partition from %s to %s.\n"
+"The closest location we can manage is %s to %s. Is this still acceptable to "
+"you?"
+msgstr ""
+"%1$s'den %2$s'e bir blm istediniz.\n"
+"Becerebildiimiz buna en yakn konum %3$s-%4$s. Bu sizin iin hala kabul "
+"edilebilir mi?"
+
+#: parted/parted.c:827
+msgid "An extended partition cannot hold a file system. Did you want mkpart?"
+msgstr "Bir ek disk blmnn dosya sistemi olamaz. mkpart m istediniz?"
+
+#: parted/parted.c:985
+msgid "Can't move an extended partition."
+msgstr "Bir ek disk blm tanamaz."
+
+#: parted/parted.c:1014
+msgid "Can't move a partition onto itself. Try using resize, perhaps?"
+msgstr ""
+"Bir disk blm kendi zerine tanamaz. Belki yeniden boyutlandrmay "
+"dener misiniz?"
+
+#: parted/parted.c:1158
+#, c-format
+msgid "Minor: %d\n"
+msgstr "Minor: %d\n"
+
+#: parted/parted.c:1159
+#, c-format
+msgid "Flags: %s\n"
+msgstr "Bayraklar: %s\n"
+
+#: parted/parted.c:1160
+#, c-format
+msgid "File System: %s\n"
+msgstr "Dosya Sistemi: %s\n"
+
+#: parted/parted.c:1161
+#, c-format
+msgid "Size: "
+msgstr "Boyut: "
+
+#: parted/parted.c:1166
+#, c-format
+msgid "Minimum size: "
+msgstr "Minimum boyut: "
+
+#: parted/parted.c:1169
+#, c-format
+msgid "Maximum size: "
+msgstr "Maksimum boyut: "
+
+#: parted/parted.c:1255
+#, c-format
+msgid "Disk %s: %s\n"
+msgstr "Disk %1$s: %2$s\n"
+
+#: parted/parted.c:1256
+#, c-format
+msgid "Sector size (logical/physical): %lldB/%lldB\n"
+msgstr "Sektr boyutu (mantksal/fiziksel): %lldB/%lldB\n"
+
+#: parted/parted.c:1267
+#, c-format
+msgid "BIOS cylinder,head,sector geometry: %d,%d,%d. Each cylinder is %s.\n"
+msgstr ""
+"BIOS silindiri, kafa, sektr geometrisi: %d,%d,%d. Herbir silindir %s'tir.\n"
+
+#: parted/parted.c:1273
+#, c-format
+msgid "Partition Table: %s\n"
+msgstr "Disk blm Tablosu: %s\n"
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Number"
+msgstr "Numara"
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Start"
+msgstr "Balang"
+
+#: parted/parted.c:1285 parted/parted.c:1288
+msgid "End"
+msgstr "Son"
+
+#: parted/parted.c:1288
+msgid "Size"
+msgstr "Boyut"
+
+#: parted/parted.c:1292
+msgid "Type"
+msgstr "Tr"
+
+#: parted/parted.c:1294
+msgid "File system"
+msgstr "Dosya sistemi"
+
+#: parted/parted.c:1297
+msgid "Name"
+msgstr "sim"
+
+#: parted/parted.c:1299
+msgid "Flags"
+msgstr "Bayraklar"
+
+#: parted/parted.c:1352
+msgid "Free Space"
+msgstr "Bo Alan"
+
+#: parted/parted.c:1441
+#, c-format
+msgid ""
+"A %s %s partition was found at %s -> %s. Do you want to add it to the "
+"partition table?"
+msgstr ""
+"%3$s -> %4$s'de bir %1$s %2$s disk blm bulundu. Bunu disk blm "
+"tablosuna eklemeyi ister misiniz?"
+
+#: parted/parted.c:1479
+msgid "searching for file systems"
+msgstr "dosya"
+
+#: parted/parted.c:1684
+msgid "New device?"
+msgstr "Yeni aygt?"
+
+#: parted/parted.c:1709
+msgid "Flag to Invert?"
+msgstr "Tersine evirmek zere bayrakla?"
+
+#: parted/parted.c:1714
+msgid "New state?"
+msgstr "Yeni durum?"
+
+#: parted/parted.c:1747
+msgid "Unit?"
+msgstr "Birim?"
+
+#: parted/parted.c:1896
+msgid "check"
+msgstr "check"
+
+#: parted/parted.c:1899
+msgid ""
+"check NUMBER do a simple check on the file system"
+msgstr ""
+"check NUMBER dosya sistemi zerinde basit bir kontrol yap"
+
+#: parted/parted.c:1905
+msgid "cp"
+msgstr "cp"
+
+#: parted/parted.c:1908
+msgid ""
+"cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another "
+"partition"
+msgstr ""
+"cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER dosya sistemini bir baka disk "
+"blmne kopyala"
+
+#: parted/parted.c:1914
+msgid "help"
+msgstr "help"
+
+#: parted/parted.c:1917
+msgid ""
+"help [COMMAND] prints general help, or help on "
+"COMMAND"
+msgstr ""
+"help [COMMAND] genel yardm ya da KOMUT yardmn yazdrr"
+
+#: parted/parted.c:1923
+msgid "mklabel"
+msgstr "mklabel"
+
+#: parted/parted.c:1926
+msgid ""
+"mklabel LABEL-TYPE create a new disklabel (partition "
+"table)"
+msgstr ""
+"mklabel LABEL-TYPE yeni bir disk etiketi (disk blm tablosu) "
+"olutur"
+
+#: parted/parted.c:1932
+msgid "mkfs"
+msgstr "mkfs"
+
+#: parted/parted.c:1935
+msgid ""
+"mkfs NUMBER FS-TYPE make a FS-TYPE file system on "
+"partititon NUMBER"
+msgstr ""
+"mkfs NUMBER FS-TYPE NUMBER disk blm zerinde FS-TYPE dosya "
+"sistemini yap"
+
+#: parted/parted.c:1941
+msgid "mkpart"
+msgstr "mkpart"
+
+#: parted/parted.c:1944
+msgid "mkpart PART-TYPE [FS-TYPE] START END make a partition"
+msgstr "mkpart PART-TYPE [FS-TYPE] START END bir disk blm yap"
+
+#: parted/parted.c:1950
+msgid ""
+"mkpart makes a partition without creating a new file system on the "
+"partition. FS-TYPE may be specified to set an appropriate partition ID.\n"
+msgstr ""
+"mkpart, disk blm zerinde yeni bir dosya sistemi oluturmadan bir disk "
+"blm yapar. DS-TR, uygun bir disk blm numaras atamak iin "
+"belirtilebilir.\n"
+"\n"
+
+#: parted/parted.c:1955
+msgid "mkpartfs"
+msgstr "mkpartfs"
+
+#: parted/parted.c:1958
+msgid ""
+"mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system"
+msgstr ""
+"mkpartfs PART-TYPE FS-TYPE START END dosya sistemi olan bir disk blm "
+"yap"
+
+#: parted/parted.c:1964
+msgid "move"
+msgstr "move"
+
+#: parted/parted.c:1967
+msgid "move NUMBER START END move partition NUMBER"
+msgstr "move NUMBER START END NUMBER. disk blmn ta"
+
+#: parted/parted.c:1972
+msgid "name"
+msgstr "name"
+
+#: parted/parted.c:1975
+msgid "name NUMBER NAME name partition NUMBER as NAME"
+msgstr ""
+"name NUMBER NAME NUMBER. disk blmn NAME'le adlandr"
+
+#: parted/parted.c:1980
+msgid "print"
+msgstr "print"
+
+#: parted/parted.c:1983
+msgid ""
+"print [free|NUMBER|all] display the partition table, a "
+"partition, or all devices"
+msgstr ""
+"print [free|NUMBER|all] bir disk blm, tablosu ya da "
+"tm aygtlar grntle"
+
+#: parted/parted.c:1987
+msgid ""
+"Without arguments, print displays the entire partition table. With 'free'\n"
+"argument, information about free space will be displayed otherwise if a\n"
+"partition number is given, then more detailed information is displayed\n"
+"about that partition. If the 'all' argument is passed instead, partition\n"
+"information for all devices will be displayed."
+msgstr ""
+"Argmansz kullanldnda yazdr, tm disk blm tablosunu grntler. "
+"'free' argmanyla\n"
+"bo alan hakkndaki bilgi grntlenir, ya da eer\n"
+"bir disk blm numaras verilirse, o disk blm hakknda daha ayrntl "
+"bilgi grntlenir.\n"
+"Eer 'all' argman kullanlrsa tm aygtlarn blmleme bilgisi "
+"grntlenecektir."
+
+#: parted/parted.c:1995
+msgid "quit"
+msgstr "quit"
+
+#: parted/parted.c:1998
+msgid "quit exit program"
+msgstr "quit programdan k"
+
+#: parted/parted.c:2003
+msgid "rescue"
+msgstr "rescue"
+
+#: parted/parted.c:2006
+msgid ""
+"rescue START END rescue a lost partition near START "
+"and END"
+msgstr ""
+"rescue START END START ve END arasndaki kayp disk "
+"blmlerini kurtar"
+
+#: parted/parted.c:2012
+msgid "resize"
+msgstr "resize"
+
+#: parted/parted.c:2015
+msgid ""
+"resize NUMBER START END resize partition NUMBER and its "
+"file system"
+msgstr ""
+"resize NUMBER START END NUMBER. disk blmn ve zerindeki dosya "
+"sistemini yeniden boyutlandr"
+
+#: parted/parted.c:2023
+msgid "rm"
+msgstr "rm"
+
+#: parted/parted.c:2026
+msgid "rm NUMBER delete partition NUMBER"
+msgstr "rm NUMBER NUMBER. disk blmn sil"
+
+#: parted/parted.c:2031
+msgid "select"
+msgstr "select"
+
+#: parted/parted.c:2034
+msgid "select DEVICE choose the device to edit"
+msgstr "select DEVICE dzenlenecek aygt se"
+
+#: parted/parted.c:2039
+msgid "set"
+msgstr "set"
+
+#: parted/parted.c:2042
+msgid ""
+"set NUMBER FLAG STATE change the FLAG on partition NUMBER"
+msgstr ""
+"set NUMBER FLAG STATE NUMBER. disk blm zerindeki bayra "
+"deitir"
+
+#: parted/parted.c:2048
+msgid "toggle"
+msgstr "semece / deitir"
+
+#: parted/parted.c:2051
+msgid ""
+"toggle [NUMBER [FLAG]] toggle the state of FLAG on "
+"partition NUMBER"
+msgstr ""
+"toggle [NUMBER [FLAG] NUMBER. disk blm zerindeki "
+"BAYRAK durumunu deitir"
+
+#: parted/parted.c:2057
+msgid "unit"
+msgstr "birim"
+
+#: parted/parted.c:2060
+msgid "unit UNIT set the default unit to UNIT"
+msgstr "birim UNIT ntanml birimi UNIT'e ayarla"
+
+#: parted/parted.c:2065
+#, fuzzy
+msgid "version"
+msgstr "srm"
+
+#: parted/parted.c:2068
+msgid ""
+"version displays the current version of GNU "
+"Parted and copyright information"
+msgstr ""
+"version GNU Parted'in gncel srmn ve telif "
+"hakk bilgisini grntler"
+
+#: parted/parted.c:2072
+msgid ""
+"version displays copyright and version information corressponding to this "
+"copy of GNU Parted\n"
+msgstr ""
+"srm, GNU Parted'in bu kopyasnn telif hakk ve srm bilgisini "
+"grntler\n"
+
+#: parted/parted.c:2158
+msgid "No device found"
+msgstr "Aygt bulunamad"
+
+#: parted/parted.c:2222
+msgid "Don't forget to update /etc/fstab, if necessary.\n"
+msgstr "Zorunluysa, /etc/fstab'i gncellemeyi unutmayn.\n"
+
+#: parted/ui.c:68
+msgid "Welcome to GNU Parted! Type 'help' to view a list of commands.\n"
+msgstr ""
+"GNU Parted'a hogeldiniz! Komutlarn bir listesini grmek iin 'help' "
+"yaznz.\n"
+
+#: parted/ui.c:71
+msgid ""
+"Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]\n"
+"Apply COMMANDs with PARAMETERS to DEVICE. If no COMMAND(s) are given, run "
+"in\n"
+"interactive mode.\n"
+msgstr ""
+"Kullanm: parted [SEENEK]... [AYGIT [KOMUT [PARAMETRELER]...]...]\n"
+"KOMUTLARI PARAMETRELERle AYGITa uygular. Eer KOMUT(lar) verilmezse,\n"
+"etkileimli kipte alr.\n"
+
+#: parted/ui.c:76
+#, c-format
+msgid ""
+"\n"
+"\n"
+"You found a bug in GNU Parted! Here's what you have to do:\n"
+"\n"
+"Don't panic! The bug has most likely not affected any of your data.\n"
+"Help us to fix this bug by doing the following:\n"
+"\n"
+"Check whether the bug has already been fixed by checking\n"
+"the last version of GNU Parted that you can find at:\n"
+"\n"
+"\thttp://ftp.gnu.org/gnu/parted/\n"
+"\n"
+"Please check this version prior to bug reporting.\n"
+"\n"
+"If this has not been fixed yet or if you don't know how to check,\n"
+"please visit the GNU Parted website:\n"
+"\n"
+"\thttp://www.gnu.org/software/parted\n"
+"\n"
+"for further information.\n"
+"\n"
+"Your report should contain the version of this release (%s)\n"
+"along with the error message below, the output of\n"
+"\n"
+"\tparted DEVICE unit co print unit s print\n"
+"\n"
+"and additional information about your setup you consider important.\n"
+msgstr ""
+"\n"
+"\n"
+"GNU Parted'da bir yazlm hatas buldunuz! Yapmanz gereken unlardr:\n"
+"\n"
+"Panie kaplmayn! Yazlm hatas byk olaslkla verinizi etkilemedi.\n"
+"Bu hatay onarmak iin bize unlar yaparak yardm edin:\n"
+"\n"
+"\thttp://ftp.gnu.org/gnu/parted/\n"
+"\n"
+"adresinde bulabileceiniz GNU Parted'in son srmn kontrol\n"
+"ederek hatann zaten dzeltilmi olup olmadn kontrol edin.\n"
+"Hatay rapor etmeden nce ltfen bu srm kontrol edin.\n"
+"\n"
+"Eer hata onarlmamsa ya da nasl kontrol edeceinizi bilmiyorsanz,\n"
+"ltfen GNU Parted web sitesini\n"
+"daha fazla bilgi iin ziyaret edin:\n"
+"\n"
+"\thttp://www.gnu.org/software/parted\n"
+"\n"
+"Raporunuz bu datmn srm numarasn (%s)\n"
+"aadaki hata mesajn,\n"
+"\n"
+"\tparted DEVICE unit co print unit s print\n"
+"\n"
+"komutunun ktsn ve kurulumunuz hakknda nemli olduunu dndnz ek "
+"bilgileri\n"
+"iermelidir.\n"
+
+#: parted/ui.c:230
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_MAPERR (Address not mapped to object)"
+msgstr ""
+"\n"
+"Hata: SEGV_MAPERR (Adres nesneye elenmedi)"
+
+#: parted/ui.c:235
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_ACCERR (Invalid permissions for mapped object)"
+msgstr ""
+"\n"
+"Hata: SEGV_ACCERR (Elenmi nesne iin geersiz izinler)"
+
+#: parted/ui.c:240
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGSEGV signal was encountered."
+msgstr ""
+"\n"
+"Hata: Genel bir SIGSEGV sinyaliyle karlald."
+
+#: parted/ui.c:258
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTDIV (Integer: divide by zero)"
+msgstr ""
+"\n"
+"Hata: FPE_INTDIV (Tamsay: sfrla blnme)"
+
+#: parted/ui.c:262
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTOVF (Integer: overflow)"
+msgstr ""
+"\n"
+"Hata: FPE_INTOVF (Tamsay: tama)"
+
+#: parted/ui.c:266
+#, fuzzy, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTDIV (Float: divide by zero)"
+msgstr ""
+"\n"
+"Hata: FPE_INTDIV (Kayan: sfrla blnme)"
+
+#: parted/ui.c:270
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTOVF (Float: overflow)"
+msgstr ""
+"\n"
+"Hata: FPE_FLTOVF (Kayan: tama)"
+
+#: parted/ui.c:274
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTUND (Float: underflow)"
+msgstr ""
+"\n"
+"Hata: FPE_FLTUND (Kayan: boalma)"
+
+#: parted/ui.c:278
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTRES (Float: inexact result)"
+msgstr ""
+"\n"
+"Hata: FPE_FLTRES (Kayan: kesin olmayan sonu)"
+
+#: parted/ui.c:282
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTINV (Float: invalid operation)"
+msgstr ""
+"\n"
+"Hata: FPE_FLTINV (Kayan: geersiz ilem)"
+
+#: parted/ui.c:286
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTSUB (Float: subscript out of range)"
+msgstr ""
+"\n"
+"Hata: FPE_FLTSUB (Kayan: altsimge erim d)"
+
+#: parted/ui.c:291
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGFPE signal was encountered."
+msgstr ""
+"\n"
+"Hata: Genel bir SIGFPE sinyaliyle karlald."
+
+#: parted/ui.c:310
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPC (Illegal Opcode)"
+msgstr ""
+"\n"
+"Hata: ILL_ILLOPC (Kurald Opcode)"
+
+#: parted/ui.c:314
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPN (Illegal Operand)"
+msgstr ""
+"\n"
+"Hata: ILL_ILLOPN (Kurald lenen)"
+
+#: parted/ui.c:318
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLADR (Illegal addressing mode)"
+msgstr ""
+"\n"
+"Hata: ILL_ILLADR (Kurald adresleme kipi)"
+
+#: parted/ui.c:323
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLTRP (Illegal Trap)"
+msgstr ""
+"\n"
+"Hata: ILL_ILLTRP (Kurald Tuzak)"
+
+#: parted/ui.c:327
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVOPC (Privileged Opcode)"
+msgstr ""
+"\n"
+"Hata: ILL_PRVOPC (Ayrcalkl Opcode)"
+
+#: parted/ui.c:331
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVREG (Privileged Register)"
+msgstr ""
+"\n"
+"Hata: ILL_PRVREG (Ayrcalkl Yazma)"
+
+#: parted/ui.c:335
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_COPROC (Coprocessor Error)"
+msgstr ""
+"\n"
+"Hata: ILL_COPROC (Eilemci Hatas)"
+
+#: parted/ui.c:339
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_BADSTK (Internal Stack Error)"
+msgstr ""
+"\n"
+"Hata: ILL_BADSTK (Dahili Yn Hatas)"
+
+#: parted/ui.c:343
+#, fuzzy, c-format
+msgid ""
+"\n"
+"Error: A general SIGILL signal was encountered."
+msgstr ""
+"\n"
+"Hata: Genel bir SIGILL sinyaliyle karlald."
+
+#: parted/ui.c:828
+msgid "Expecting a partition number."
+msgstr "Bir disk blm numaras bekleniyor."
+
+#: parted/ui.c:837
+msgid "Partition doesn't exist."
+msgstr "Disk blm yok."
+
+#: parted/ui.c:857
+msgid "Expecting a file system type."
+msgstr "Bir dosya sistemi tr bekleniyor."
+
+#: parted/ui.c:863
+#, c-format
+msgid "Unknown file system type \"%s\"."
+msgstr "Bilinmeyen dosya sistemi tr \"%s\"."
+
+#: parted/ui.c:883
+msgid "Expecting a disk label type."
+msgstr "Bir disk etiketi tr bekleniyor."
+
+#: parted/ui.c:977
+msgid "Can't create any more partitions."
+msgstr "Baka disk blm oluturulamyor."
+
+#: parted/ui.c:987
+msgid "Expecting a partition type."
+msgstr "Bir disk blm tr bekleniyor."
+
+#: parted/ui.c:1115
+msgid "on"
+msgstr "ak"
+
+#: parted/ui.c:1116
+msgid "off"
+msgstr "kapal"
+
+#: parted/ui.c:1227
+msgid "OPTIONs:"
+msgstr "SEENEKler:"
+
+#: parted/ui.c:1230
+msgid "COMMANDs:"
+msgstr "KOMUTlar:"
+
+#: parted/ui.c:1238
+#, c-format
+msgid "Using %s\n"
+msgstr "%s kullanlyor\n"
diff --git a/po/uk.po b/po/uk.po
new file mode 100644
index 0000000..c634fd0
--- /dev/null
+++ b/po/uk.po
@@ -0,0 +1,2401 @@
+# Ukrainian translation to parted.
+# Copyright (C) 2004 Free Software Foundation, Inc.
+# Maxim V. Dziumanenko <mvd@mylinux.com.ua>, 2004-2006.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: parted 1.7.0rc1\n"
+"Report-Msgid-Bugs-To: bug-parted@gnu.org\n"
+"POT-Creation-Date: 2006-04-21 21:20+0200\n"
+"PO-Revision-Date: 2006-04-07 10:07+0200\n"
+"Last-Translator: Maxim V. Dziumanenko <mvd@mylinux.com.ua>\n"
+"Language-Team: Ukrainian <translation-team-uk@lists.sourceforge.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: libparted/arch/linux.c:284
+#, c-format
+msgid "Could not stat device %s - %s."
+msgstr "Не вдається отримати статус пристрою %s - %s."
+
+#: libparted/arch/linux.c:390
+#, fuzzy, c-format
+msgid ""
+"Could not determine sector size for %s: %s.\n"
+"Using the default sector size (%lld)."
+msgstr ""
+"Не вдається визначити розмір сектору для %s: %s.\n"
+"Використовується типовий розмір сектору (%d)."
+
+#: libparted/arch/linux.c:401
+#, fuzzy, c-format
+msgid ""
+"Device %s has a logical sector size of %lld. Not all parts of GNU Parted "
+"support this at the moment, and the working code is HIGHLY EXPERIMENTAL.\n"
+msgstr ""
+"Розмір логічного сектору для %s складає %d. Наразі не всі компоненти GNU "
+"Parted це підтримують.\n"
+
+#: libparted/arch/linux.c:441
+#, c-format
+msgid "Unable to determine the size of %s (%s)."
+msgstr "Не вдається визначити розмір %s (%s)."
+
+#: libparted/arch/linux.c:530
+#, c-format
+msgid "Could not get identity of device %s - %s"
+msgstr "Не вдається отримати ідентифікатор пристрою %s - %s"
+
+#: libparted/arch/linux.c:539
+msgid "Generic IDE"
+msgstr "Загальний IDE"
+
+#: libparted/arch/linux.c:556
+#, c-format
+msgid ""
+"Device %s has multiple (%d) logical sectors per physical sector.\n"
+"GNU Parted supports this EXPERIMENTALLY for some special disk label/file "
+"system combinations, e.g. GPT and ext2/3.\n"
+"Please consult the web site for up-to-date information."
+msgstr ""
+"Пристрій %s має декілька (%d) логічних серверів на фізичний сектор.\n"
+"Підтримка цього у GNU Parted є ЕКСПЕРИМЕНТАЛЬНОЮ для деяких спеціальних "
+"комбінацій позначка диску/файлова система, наприклад. GPT та ext2/3.\n"
+"Додаткову інформацію шукайте на веб-сайті."
+
+#: libparted/arch/linux.c:726
+#, c-format
+msgid "Error initialising SCSI device %s - %s"
+msgstr "Помилка ініціалізації SCSI пристрою %s - %s"
+
+#: libparted/arch/linux.c:781
+#, c-format
+msgid ""
+"The device %s has zero length, and can't possibly store a file system or "
+"partition table. Perhaps you selected the wrong device?"
+msgstr ""
+"Пристрій %s має нульову довжину, та непридатний для розміщення файлової "
+"системи чи таблиці розділів. Можливо ви вибрали неправильний пристрій?"
+
+#: libparted/arch/linux.c:829
+msgid ""
+"Unable to determine geometry of file/device. You should not use Parted "
+"unless you REALLY know what you're doing!"
+msgstr ""
+"Не вдається визначити геометрію файлу/пристрою. Не слід використовувати "
+"Parted, хіба-що ви ДІЙСНО знаєте, що ви робите!"
+
+#: libparted/arch/linux.c:903
+msgid "DAC960 RAID controller"
+msgstr "DAC960 RAID контролер"
+
+#: libparted/arch/linux.c:908
+msgid "Compaq Smart Array"
+msgstr "Compaq Smart Array"
+
+#: libparted/arch/linux.c:913
+msgid "ATARAID Controller"
+msgstr "ATARAID контролер"
+
+#: libparted/arch/linux.c:918
+msgid "I2O Controller"
+msgstr "I2O контролер"
+
+#: libparted/arch/linux.c:923
+msgid "User-Mode Linux UBD"
+msgstr "User-Mode Linux UBD"
+
+#: libparted/arch/linux.c:933
+msgid "Unknown"
+msgstr "Невідомий"
+
+#: libparted/arch/linux.c:940
+msgid "ped_device_new() Unsupported device type"
+msgstr "ped_device_new() тип пристрою не підтримується"
+
+#: libparted/arch/linux.c:1041 libparted/arch/gnu.c:264
+#, c-format
+msgid "Error opening %s: %s"
+msgstr "Помилка відкривання %s: %s"
+
+#: libparted/arch/linux.c:1052 libparted/arch/gnu.c:274
+#, c-format
+msgid "Unable to open %s read-write (%s). %s has been opened read-only."
+msgstr ""
+"Не вдається відкрити %s для читання-запису (%s). %s відкрито у режимі лише-"
+"читання."
+
+#: libparted/arch/linux.c:1160 libparted/arch/linux.c:1228
+#: libparted/arch/gnu.c:452 libparted/arch/gnu.c:550 libparted/arch/gnu.c:678
+#, c-format
+msgid "%s during read on %s"
+msgstr "%s при читанні з %s"
+
+#: libparted/arch/linux.c:1199
+#, c-format
+msgid "%s during seek for read on %s"
+msgstr "%s при встановленні позиції для читання на %s"
+
+#: libparted/arch/linux.c:1270 libparted/arch/linux.c:1355
+#: libparted/arch/linux.c:1413 libparted/arch/gnu.c:587
+#: libparted/arch/gnu.c:632 libparted/arch/gnu.c:709
+#, c-format
+msgid "%s during write on %s"
+msgstr "%s при записі на %s"
+
+#: libparted/arch/linux.c:1297 libparted/arch/gnu.c:512
+#, c-format
+msgid "Can't write to %s, because it is opened read-only."
+msgstr "Не вдається записати на %s, тому що він відкритий лише для читання."
+
+#: libparted/arch/linux.c:1321
+#, c-format
+msgid "%s during seek for write on %s"
+msgstr "%s при встановленні позиції для запису на %s"
+
+#: libparted/arch/linux.c:1798
+#, c-format
+msgid ""
+"Error informing the kernel about modifications to partition %s -- %s. This "
+"means Linux won't know about any changes you made to %s until you reboot -- "
+"so you shouldn't mount it or use it in any way before rebooting."
+msgstr ""
+"Помилка сповіщення ядра про зміни у розділі %s -- %s. Це означає, що Linux "
+"не враховуватиме внесені у %s зміни до перезавантаження - тому до "
+"перезавантаження не слід підключати розділ чи використовувати будь-яким "
+"іншим чином."
+
+#: libparted/arch/linux.c:1879
+#, c-format
+msgid ""
+"The kernel was unable to re-read the partition table on %s (%s). This means "
+"Linux won't know anything about the modifications you made until you "
+"reboot. You should reboot your computer before doing anything with %s."
+msgstr ""
+"Ядро не може перечитати таблицю розділів на %s (%s). Це означає, що Linux не "
+"враховуватиме внесені зміни до перезавантаження. Необхідно перезавантажити "
+"ваш комп'ютер перш ніж якось використовувати %s."
+
+#: libparted/arch/gnu.c:97
+#, c-format
+msgid "Unable to open %s."
+msgstr "Не вдається відкрити %s."
+
+#: libparted/arch/gnu.c:117
+msgid "Unable to probe store."
+msgstr "Не вдається визначити сховище."
+
+#: libparted/arch/gnu.c:355
+msgid ""
+"The partition table cannot be re-read. This means you need to reboot before "
+"mounting any modified partitions. You also need to reinstall your boot "
+"loader before you reboot (which may require mounting modified partitions). "
+"It is impossible do both things! So you'll need to boot off a rescue disk, "
+"and reinstall your boot loader from the rescue disk. Read section 4 of the "
+"Parted User documentation for more information."
+msgstr ""
+"Не вдається перечитати таблицю розділів, слід перезавантажитись перш ніж "
+"підключати змінені розділи. Також перед перезавантаженням необхідно "
+"перевстановити завантажувач (що вимагає підключення змінених розділів). "
+"Неможливо виконати одночасно обидві дії! Тому слід завантажитись з "
+"завантажувального диску, та перевстановити завантажувач. Додаткову "
+"інформацію знайдете у розділі 4 документації з Parted."
+
+#: libparted/arch/gnu.c:372
+#, c-format
+msgid ""
+"The partition table on %s cannot be re-read (%s). This means the Hurd knows "
+"nothing about any modifications you made. You should reboot your computer "
+"before doing anything with %s."
+msgstr ""
+"Таблицю розділів на %s не вдається перечитати (%s). Це означає, що Hurd "
+"нічого не знає про внесені вами зміни. Необхідно перезавантажити ваш "
+"комп'ютер перед виконанням будь-яких дій з %s."
+
+#: libparted/arch/gnu.c:383 parted/parted.c:2215
+msgid ""
+"You should reinstall your boot loader before rebooting. Read section 4 of "
+"the Parted User documentation for more information."
+msgstr ""
+"Необхідно перевстановити ваш завантажувач перед перезавантаженням. Додаткову "
+"інформацію знайдете у розділі 4 документації з Parted."
+
+#: libparted/arch/gnu.c:774
+#, c-format
+msgid "%s trying to sync %s to disk"
+msgstr "%s при спробі синхронізації %s на диск"
+
+#: libparted/disk.c:183
+#, c-format
+msgid "Unable to open %s - unrecognised disk label."
+msgstr "Не вдається відкрити %s - нерозпізнана етикетка диска."
+
+#: libparted/disk.c:452
+#, c-format
+msgid ""
+"This libparted doesn't have write support for %s. Perhaps it was compiled "
+"read-only."
+msgstr ""
+"Ця версія libparted не підтримує запис на %s. Можливо програму зібрано з "
+"підтримкою лише для читання."
+
+#: libparted/disk.c:579
+#, c-format
+msgid "Partition %d is %s, but the file system is %s."
+msgstr "Розмір %d %s, але файлова система %s."
+
+#: libparted/disk.c:1056
+#, c-format
+msgid "%s disk labels do not support extended partitions."
+msgstr "%s етикетки дисків для розширених розділів не підтримуються."
+
+#: libparted/disk.c:1616
+#, c-format
+msgid "%s disk labels don't support logical or extended partitions."
+msgstr ""
+"%s етикетки дисків для логічних або розширених розділів не підтримуються."
+
+#: libparted/disk.c:1629
+msgid "Too many primary partitions."
+msgstr "Занадто багато основних розділів."
+
+#: libparted/disk.c:1638
+#, c-format
+msgid ""
+"Can't add a logical partition to %s, because there is no extended partition."
+msgstr ""
+"Не вдається додати логічний розділ до %s, тому що немає розширеного розділу."
+
+#: libparted/disk.c:1662
+#, c-format
+msgid "Can't have more than one extended partition on %s."
+msgstr "Не можна мати більше одного розширеного розділу на %s."
+
+#: libparted/disk.c:1672
+msgid "Can't have logical partitions outside of the extended partition."
+msgstr "Не вдається розширити логічний розділ за межі розширеного розділу."
+
+#: libparted/disk.c:1697
+#, c-format
+msgid "Can't have a logical partition outside of the extended partition on %s."
+msgstr ""
+"Не вдається розширити логічний розділ за межі розширеного розділу на %s."
+
+#: libparted/disk.c:1707 libparted/disk.c:1761 libparted/disk.c:1927
+msgid "Can't have overlapping partitions."
+msgstr "Не можна мати розділи, які перекриваються."
+
+#: libparted/disk.c:1715
+msgid "Can't have a primary partition inside an extended partition."
+msgstr "Не можна додавати основний розділ у розширений розділ."
+
+#: libparted/disk.c:2123
+msgid "metadata"
+msgstr "метадані"
+
+#: libparted/disk.c:2125
+msgid "free"
+msgstr "вільно"
+
+#: libparted/disk.c:2127 parted/ui.c:968 parted/ui.c:996
+msgid "extended"
+msgstr "розширений"
+
+#: libparted/disk.c:2129 parted/ui.c:972 parted/ui.c:1000
+msgid "logical"
+msgstr "логічний"
+
+#: libparted/disk.c:2131 parted/ui.c:964 parted/ui.c:992
+msgid "primary"
+msgstr "основний"
+
+#: libparted/disk.c:2147
+msgid "boot"
+msgstr "boot"
+
+#: libparted/disk.c:2149
+msgid "root"
+msgstr "кореневий"
+
+#: libparted/disk.c:2151
+msgid "swap"
+msgstr "swap"
+
+#: libparted/disk.c:2153
+msgid "hidden"
+msgstr "схований"
+
+#: libparted/disk.c:2155
+msgid "raid"
+msgstr "raid"
+
+#: libparted/disk.c:2157
+msgid "lvm"
+msgstr "lvm"
+
+#: libparted/disk.c:2159
+msgid "lba"
+msgstr "lba"
+
+#: libparted/disk.c:2161
+msgid "hp-service"
+msgstr "hp-сервіс"
+
+#: libparted/disk.c:2163
+msgid "palo"
+msgstr "palo"
+
+#: libparted/disk.c:2165
+msgid "prep"
+msgstr "prep"
+
+#: libparted/disk.c:2167
+msgid "msftres"
+msgstr "msftres"
+
+#: libparted/disk.c:2173
+#, c-format
+msgid "Unknown partition flag, %d."
+msgstr "Невідома ознака розділу, %d."
+
+#: libparted/labels/rdb.c:177
+#, c-format
+msgid "%s : Bad checksum on block %llu of type %s."
+msgstr "%s : Неправильна контрольна сума на блоці %llu типу %s."
+
+#: libparted/labels/rdb.c:510
+#, c-format
+msgid "%s : Didn't find rdb block, should never happen."
+msgstr "%s : Не вдається знайти блок rdb, цього не повинно було статися."
+
+#: libparted/labels/rdb.c:595
+#, c-format
+msgid "%s : Loop detected at block %d."
+msgstr "%s : виявлено цикл у блоці %d."
+
+#: libparted/labels/rdb.c:614
+#, c-format
+msgid "%s : The %s list seems bad at block %s."
+msgstr "%s : Список %s має пошкоджений блок %s."
+
+#: libparted/labels/rdb.c:703
+#, c-format
+msgid "%s : Failed to list bad blocks."
+msgstr "%s : не вдається отримати список пошкоджених блоків."
+
+#: libparted/labels/rdb.c:711
+#, c-format
+msgid "%s : Failed to list partition blocks."
+msgstr "%s : не вдається отримати список блоків розділу."
+
+#: libparted/labels/rdb.c:719
+#, c-format
+msgid "%s : Failed to list file system blocks."
+msgstr "%s : не вдається отримати список блоків файлової системи."
+
+#: libparted/labels/rdb.c:727
+#, c-format
+msgid "%s : Failed to list boot blocks."
+msgstr "%s : не вдається отримати список завантажувальних блоків."
+
+#: libparted/labels/rdb.c:750
+#, c-format
+msgid "Failed to write partition block at %d."
+msgstr "Не вдається записати блок розділу у %d."
+
+#: libparted/labels/rdb.c:1053 libparted/labels/bsd.c:505
+#: libparted/labels/dos.c:1942 libparted/labels/dvh.c:772
+#: libparted/labels/gpt.c:1365 libparted/labels/loop.c:251
+#: libparted/labels/mac.c:1318 libparted/labels/pc98.c:764
+#: libparted/labels/sun.c:704
+msgid "Unable to satisfy all constraints on the partition."
+msgstr "Не вдається задовольнити всі обмеження на розділ."
+
+#: libparted/labels/rdb.c:1081
+msgid "Unable to allocate a partition number."
+msgstr "Очікується номер розділу."
+
+#: libparted/labels/bsd.c:530
+msgid "Unable to allocate a bsd disklabel slot."
+msgstr "Не вдається розподілити слот bsd етикетки диску."
+
+#: libparted/labels/dos.c:812
+#, c-format
+msgid "Invalid partition table on %s -- wrong signature %x."
+msgstr "Неправильна таблиця розділів на %s - неправильна сигнатура %x."
+
+#: libparted/labels/dos.c:840
+#, c-format
+msgid "Invalid partition table - recursive partition on %s."
+msgstr "Неправильна таблиця розділів - рекурсивні розділи на %s."
+
+#: libparted/labels/dos.c:1300
+msgid "Extended partitions cannot be hidden on msdos disk labels."
+msgstr "Розширені розділи не можуть бути на дискових етикетках msdos."
+
+#: libparted/labels/dos.c:1926
+msgid "Parted can't resize partitions managed by Windows Dynamic Disk."
+msgstr "Parted не може змінювати розділи, які створені Windows Dynamic Disk."
+
+#: libparted/labels/dvh.c:192
+#, c-format
+msgid "%s has no extended partition (volume header partition)."
+msgstr "%s не містить розширеного розділу (розділу заголовків томів)."
+
+#: libparted/labels/dvh.c:315
+msgid "Checksum is wrong, indicating the partition table is corrupt."
+msgstr ""
+"Неправильна контрольна сума, це означає, що таблиця розділів пошкоджена."
+
+#: libparted/labels/dvh.c:616
+msgid "Only primary partitions can be root partitions."
+msgstr "Лише основні розділи можуть бути завантажувальними."
+
+#: libparted/labels/dvh.c:630
+msgid "Only primary partitions can be swap partitions."
+msgstr "Лише основні розділи можуть бути розділами підкачки."
+
+#: libparted/labels/dvh.c:644
+msgid "Only logical partitions can be a boot file."
+msgstr "Лише логічні розділи можуть бути завантажувальним файлом."
+
+#: libparted/labels/dvh.c:723
+msgid "Only logical partitions (boot files) have a name."
+msgstr "Лише логічні розділи (завантажувальні файли) мають назву."
+
+#: libparted/labels/dvh.c:814
+msgid "Too many primary partitions"
+msgstr "Занадто багато основних розділів"
+
+#: libparted/labels/gpt.c:433
+#, c-format
+msgid ""
+"%s contains GPT signatures, indicating that it has a GPT table. However, it "
+"does not have a valid fake msdos partition table, as it should. Perhaps it "
+"was corrupted -- possibly by a program that doesn't understand GPT partition "
+"tables. Or perhaps you deleted the GPT table, and are now using an msdos "
+"partition table. Is this a GPT partition table?"
+msgstr ""
+"%s містить GPT сигнатуру, це означає, що він містить GPT таблицю. Але, він "
+"не містить правильної імітації msdos-сумісної таблиці розділів, хоча і "
+"повинен містити. Можливо він пошкоджений програмою яка не розуміє GPT "
+"таблиці розділів. Або, можливо, ви видалили GPT таблицю, а тепер "
+"використовуєте msdos-сумісну таблицю розділів. На цьому розділі є GPT "
+"таблиця?"
+
+#: libparted/labels/gpt.c:625
+#, c-format
+msgid ""
+"The format of the GPT partition table is version %x, which is newer than "
+"what Parted can recognise. Please tell us! bug-parted@gnu.org"
+msgstr ""
+"Знайдено GPT таблицю розділів версії %x, ця версія старша ніж версія, що "
+"підтримується програмою Parted. Будь ласка, повідомте нам! bug-parted@gnu.org"
+
+#: libparted/labels/gpt.c:747
+msgid ""
+"The backup GPT table is not at the end of the disk, as it should be. This "
+"might mean that another operating system believes the disk is smaller. Fix, "
+"by moving the backup to the end (and removing the old backup)?"
+msgstr ""
+"Резервна GPT таблиця не знаходиться наприкінці диска, хоча повинна там "
+"знаходитись. Можливо, це означає, що інша операційна система вважає, що "
+"розмір диску менший. Виправити це шляхом переміщення копії таблиці у кінець "
+"(та видалити стару копію)?"
+
+#: libparted/labels/gpt.c:782
+msgid ""
+"The primary GPT table is corrupt, but the backup appears OK, so that will be "
+"used."
+msgstr ""
+"Основна GPT таблиця пошкоджена, але резервна виглядає правильною, тому буде "
+"використовуватись саме вона."
+
+#: libparted/labels/gpt.c:790
+msgid ""
+"Both the primary and backup GPT tables are corrupt. Try making a fresh "
+"table, and using Parted's rescue feature to recover partitions."
+msgstr ""
+"Пошкоджено як головну так і резервну GPT таблиці. Спробуйте створити чисту "
+"таблицю, та використовуйте функцію відновлення програми Parted, щоб "
+"повернути розділи."
+
+#: libparted/labels/mac.c:167
+#, c-format
+msgid "Invalid signature %x for Mac disk labels."
+msgstr "Неправильна сигнатура %x для Macintosh етикетки диску."
+
+#: libparted/labels/mac.c:212
+msgid "Partition map has no partition map entry!"
+msgstr "Карта розділів не містить елементу карти розділів!"
+
+#: libparted/labels/mac.c:259
+#, c-format
+msgid "%s is too small for a Mac disk label!"
+msgstr "%s занадто мале для Macintosh етикетки диску!"
+
+#: libparted/labels/mac.c:490
+#, c-format
+msgid "Partition %d has an invalid signature %x."
+msgstr "Розділ %d має неправильну сигнатуру %x."
+
+#: libparted/labels/mac.c:508
+#, c-format
+msgid "Partition %d has an invalid length of 0 bytes!"
+msgstr "Розділ %d має неправильну довжину 0 байт!"
+
+#: libparted/labels/mac.c:536
+msgid "The data region doesn't start at the start of the partition."
+msgstr "Область даних не починається з початку розділу."
+
+#: libparted/labels/mac.c:553
+msgid "The boot region doesn't start at the start of the partition."
+msgstr "Область завантаження не починається з початку розділу."
+
+#: libparted/labels/mac.c:567
+msgid "The partition's boot region doesn't occupy the entire partition."
+msgstr "Область завантаження розділу не займає весь розділ."
+
+#: libparted/labels/mac.c:577
+msgid "The partition's data region doesn't occupy the entire partition."
+msgstr "Область даних розділу не займає весь розділ."
+
+#: libparted/labels/mac.c:631
+#, c-format
+msgid ""
+"Weird block size on device descriptor: %d bytes is not divisible by 512."
+msgstr ""
+"Дивний розмір блоку у дескрипторі пристрою: %d байт не ділиться на 512."
+
+#: libparted/labels/mac.c:644
+#, c-format
+msgid ""
+"The driver descriptor says the physical block size is %d bytes, but Linux "
+"says it is %d bytes."
+msgstr ""
+"У дескрипторі драйвера зазначено, що розмір фізичного блоку дорівнює %d "
+"байтів, але Linux вважає, що він %d байтів."
+
+#: libparted/labels/mac.c:692
+msgid "No valid partition map found."
+msgstr "Не знайдено правильної карти розділів."
+
+#: libparted/labels/mac.c:744
+#, c-format
+msgid ""
+"Conflicting partition map entry sizes! Entry 1 says it is %d, but entry %d "
+"says it is %d!"
+msgstr ""
+"Конфліктуючі розміри у елементах карти розділів! У елементі 1 вказано %d, "
+"але у елементі %d вказано %d!"
+
+#: libparted/labels/mac.c:771
+msgid "Weird! There are 2 partitions map entries!"
+msgstr "Фатально! Дивна помилка - 2 елементи карти розділів!"
+
+#: libparted/labels/mac.c:1257
+msgid ""
+"Changing the name of a root or swap partition will prevent Linux from "
+"recognising it as such."
+msgstr ""
+"Зміна назви кореневого розділу чи розділу підкачки заважатиме Linux "
+"розпізнати їх."
+
+#: libparted/labels/mac.c:1353
+msgid "Can't add another partition -- the partition map is too small!"
+msgstr "Не вдається додати інший розділ - карта розділів надто маленька!"
+
+#: libparted/labels/pc98.c:357
+#, c-format
+msgid "Invalid partition table on %s."
+msgstr "Неправильна таблиця розділів у %s."
+
+#: libparted/labels/pc98.c:409 libparted/labels/pc98.c:487
+#, c-format
+msgid ""
+"Partition %d isn't aligned to cylinder boundaries. This is still "
+"unsupported."
+msgstr ""
+"Розділ %d не вирівняний на межі циліндру. Необхідно додати підтримку для "
+"цього випадку."
+
+#: libparted/labels/pc98.c:796
+msgid "Can't add another partition."
+msgstr "Не вдається додати інший розділ."
+
+#: libparted/labels/sun.c:143
+msgid "Corrupted Sun disk label detected."
+msgstr "Знайдено пошкоджену Sun етикетку диску."
+
+#: libparted/labels/sun.c:264
+#, c-format
+msgid ""
+"The disk CHS geometry (%d,%d,%d) reported by the operating system does not "
+"match the geometry stored on the disk label (%d,%d,%d)."
+msgstr ""
+"ЦГС(CHS) геометрія диску (%d,%d,%d) яку видає операційна система не "
+"відповідає геометрії, що зберігається у позначці диску (%d,%d,%d)."
+
+#: libparted/labels/sun.c:286
+#, c-format
+msgid "The disk label describes a disk bigger than %s."
+msgstr "Етикетка диску описує диск більшого розміру ніж %s."
+
+#: libparted/labels/sun.c:440
+#, c-format
+msgid "The disk has %d cylinders, which is greater than the maximum of 65536."
+msgstr "Диск має %d циліндрів, що більше ніж максимальне значення 65536."
+
+#: libparted/labels/sun.c:736
+msgid ""
+"The Whole Disk partition is the only available one left. Generally, it is "
+"not a good idea to overwrite this partition with a real one. Solaris may "
+"not be able to boot without it, and SILO (the sparc boot loader) appreciates "
+"it as well."
+msgstr ""
+"Розділ \"Весь диск\" - єдиний наявний. Зазвичай, небажано перезаписувати цей "
+"розділ реальним розділом. Solaris, можливо, не буде здатний завантажитись "
+"без нього, це також вплине на SILO (завантажувач sparc)."
+
+#: libparted/labels/sun.c:751
+msgid "Sun disk label is full."
+msgstr "Sun етикетка диску заповнена."
+
+#: libparted/filesys.c:386
+msgid "Could not detect file system."
+msgstr "Не вдається виявити файлову систему."
+
+#: libparted/filesys.c:397
+msgid "The file system is bigger than its volume!"
+msgstr "Файлова система більша ніж том!"
+
+#: libparted/filesys.c:405
+#, c-format
+msgid "Support for opening %s file systems is not implemented yet."
+msgstr "Підтримка відкривання %s файлових систем ще не реалізована."
+
+#: libparted/filesys.c:447
+#, c-format
+msgid "Support for creating %s file systems is not implemented yet."
+msgstr "Підтримка створення %s файлових систем ще не реалізована."
+
+#: libparted/filesys.c:508
+#, c-format
+msgid "Support for checking %s file systems is not implemented yet."
+msgstr "Підтримка перевірки %s файлових систем ще не реалізована."
+
+#: libparted/filesys.c:574
+msgid "raw block copying"
+msgstr "копіювання блоків"
+
+#: libparted/filesys.c:585
+msgid "growing file system"
+msgstr "розширення файлової системи"
+
+#: libparted/filesys.c:625
+msgid "Can't copy onto an overlapping partition."
+msgstr "Не можна копіювати на розділи, що перекриваються."
+
+#: libparted/filesys.c:647
+#, c-format
+msgid ""
+"Direct support for copying file systems is not yet implemented for %s. "
+"However, support for resizing is implemented. Therefore, the file system "
+"can be copied if the new partition is at least as big as the old one. So, "
+"either shrink the partition you are trying to copy, or copy to a bigger "
+"partition."
+msgstr ""
+"Безпосередня підтримка файлових систем ще не реалізована для %s. Але, "
+"реалізована підтримка зміни розміру. Таким чином файлову систему можна "
+"скопіювати на новий розділ більшого розміру ніж існуючий. Тому або зменшіть "
+"розділ, який ви намагаєтесь скопіювати, або копіюйте на більший розділ."
+
+#: libparted/filesys.c:661
+#, c-format
+msgid "Support for copying %s file systems is not implemented yet."
+msgstr "Підтримка копіювання файлових систем типу %s ще не підтримується."
+
+#: libparted/filesys.c:699
+#, c-format
+msgid "Support for resizing %s file systems is not implemented yet."
+msgstr "Підтримка зміни розміру файлових систем типу %s ще не підтримується."
+
+#: libparted/exception.c:78
+msgid "Information"
+msgstr "Інформація"
+
+#: libparted/exception.c:79
+msgid "Warning"
+msgstr "Попередження"
+
+#: libparted/exception.c:80
+msgid "Error"
+msgstr "Помилка"
+
+#: libparted/exception.c:81
+msgid "Fatal"
+msgstr "Критична помилка"
+
+#: libparted/exception.c:82
+msgid "Bug"
+msgstr "Помилка"
+
+#: libparted/exception.c:83
+msgid "No Implementation"
+msgstr "Не реалізовано"
+
+#: libparted/exception.c:87
+msgid "Fix"
+msgstr "Виправити"
+
+#: libparted/exception.c:88
+msgid "Yes"
+msgstr "Так"
+
+#: libparted/exception.c:89
+msgid "No"
+msgstr "Ні"
+
+#: libparted/exception.c:90
+msgid "OK"
+msgstr "Гаразд"
+
+#: libparted/exception.c:91
+msgid "Retry"
+msgstr "Повторити"
+
+#: libparted/exception.c:92
+msgid "Ignore"
+msgstr "Ігнорувати"
+
+#: libparted/exception.c:93
+msgid "Cancel"
+msgstr "Скасувати"
+
+#: libparted/exception.c:133
+#, c-format
+msgid ""
+"A bug has been detected in GNU Parted. Refer to the web site of parted "
+"http://www.gnu.org/software/parted/parted.html for more informations of what "
+"could be useful for bug submitting! Please email a bug report to bug-"
+"parted@gnu.org containing at least the version (%s) and the following "
+"message: "
+msgstr ""
+"У GNU parted виникла помилка. На веб-сайті http://www.gnu.org/software/"
+"parted/parted.html дивіться інформацію стосовно звітів про помилки. Будь "
+"ласка, відправте повідомлення про помилку за адресою bug-parted@gnu.org, не "
+"забудьте вказати версію (%s) та наступне повідомлення:"
+
+#: libparted/cs/geom.c:162
+msgid "Can't have the end before the start!"
+msgstr "Неприпустимо, щоб кінець розділу був перед початком!"
+
+#: libparted/cs/geom.c:169
+msgid "Can't have a partition outside the disk!"
+msgstr "Неприпустимо, щоб розділ виходив за межі диску!"
+
+#: libparted/cs/geom.c:303
+#, c-format
+msgid "Attempt to read sectors %ld-%ld outside of partition on %s."
+msgstr "Спроба прочитати сектори %ld-%ld за межами розділу на %s."
+
+#: libparted/cs/geom.c:373
+#, c-format
+msgid "Attempt to write sectors %ld-%ld outside of partition on %s."
+msgstr "Спроба записати сектори %ld-%ld за межами розділу на %s."
+
+#: libparted/cs/geom.c:413 libparted/fs/linux_swap/linux_swap.c:353
+msgid "checking for bad blocks"
+msgstr "пошук пошкоджених блоків"
+
+#: libparted/libparted.c:286 libparted/libparted.c:306
+msgid "Out of memory."
+msgstr "Недостатньо пам'яті."
+
+#: libparted/unit.c:139
+msgid "Cannot get unit size for special unit 'COMPACT'."
+msgstr "Не вдається отримати одиницю розміру для спеціального блоку 'COMPACT'."
+
+#: libparted/unit.c:382
+#, c-format
+msgid "\"%s\" has invalid syntax for locations."
+msgstr "\"%s\" має неправильний синтаксис адрес."
+
+#: libparted/unit.c:390
+#, c-format
+msgid "The maximum head value is %d."
+msgstr "Максимальний номер головки - %d."
+
+#: libparted/unit.c:397
+#, c-format
+msgid "The maximum sector value is %d."
+msgstr "Максимальний номер сектора - %d."
+
+#: libparted/unit.c:409 libparted/unit.c:540
+#, c-format
+msgid "The location %s is outside of the device %s."
+msgstr "Адреса %s поза межами пристрою %s."
+
+#: libparted/unit.c:522
+msgid "Invalid number."
+msgstr "Неправильне число."
+
+#: libparted/fs/ext2/ext2.c:87 libparted/fs/ext2/ext2.c:112
+msgid "Inconsistent group descriptors!"
+msgstr "Суперечлива група дескрипторів!"
+
+#: libparted/fs/ext2/ext2.c:91 libparted/fs/ext2/ext2.c:116
+msgid "File system full!"
+msgstr "Файлова система повна!"
+
+#: libparted/fs/ext2/ext2.c:750
+msgid "Invalid superblock. Are you sure this is an ext2 file system?"
+msgstr "Неправильний суперблок. Ви впевнені, що це файлова система типу ext2?"
+
+#: libparted/fs/ext2/ext2.c:764 libparted/fs/ext2/ext2_resize.c:597
+msgid "File system has errors! You should run e2fsck."
+msgstr "Файлова система містить помилки! Необхідно запустити e2fsck."
+
+#: libparted/fs/ext2/ext2.c:775
+msgid ""
+"File system was not cleanly unmounted! You should run e2fsck. Modifying an "
+"unclean file system could cause severe corruption."
+msgstr ""
+"Файлова система не була правильно відключена! Необхідно запустити e2fsck. "
+"Зміни до нецілісної файлової системи можуть призвести до серйозних "
+"пошкоджень."
+
+#: libparted/fs/ext2/ext2.c:795
+msgid "File system has an incompatible feature enabled."
+msgstr "У файловій системі ввімкнено несумісну властивість."
+
+#: libparted/fs/ext2/ext2.c:806
+msgid "Error allocating buffer cache."
+msgstr "Помилка розподілу буфера кеша."
+
+#: libparted/fs/ext2/ext2.c:848
+msgid ""
+"A resize operation on this file system will use EXPERIMENTAL code that MAY "
+"CORRUPT it (although it hasn't done so yet).You should at least backup your "
+"data and run 'e2fsck -f' afterwards."
+msgstr ""
+"Операція зміни розміру на цій файловій системі використовує "
+"ЕКСПЕРИМЕНТАЛЬНИЙ код та МОЖЕ ПОШКОДИТИ її (хоча цього досі не було "
+"помічено). Принаймні, слід зробити резервну копію даних та запустити 'e2fsck "
+"-f' після завершення зміни розміру."
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:114
+msgid ""
+"Found an inode with a incorrect link count. Better go run e2fsck first!"
+msgstr ""
+"Знайдено вузол (inode) з неправильною кількістю посилань. Рекомендується "
+"спочатку запустити e2fsck."
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:487
+msgid "Not enough free inodes!"
+msgstr "Недостатньо вільних вузлів (inode)!"
+
+#: libparted/fs/ext2/ext2_resize.c:224
+msgid "File system is too full to remove a group!"
+msgstr "Файлова система надто заповнена, щоб видалити групу!"
+
+#: libparted/fs/ext2/ext2_resize.c:233
+msgid "File system has too many allocated inodes to remove a group!"
+msgstr ""
+"У файловій системі виділено надто багато вузлів (inode), щоб видалити групу!"
+
+#: libparted/fs/ext2/ext2_resize.c:493
+msgid "adding groups"
+msgstr "додавання груп"
+
+#: libparted/fs/ext2/ext2_resize.c:530
+#, c-format
+msgid "Your file system is too full to resize it to %i blocks. Sorry."
+msgstr "Файлова система надто заповнена щоб змінити її розмір до %i блоків."
+
+#: libparted/fs/ext2/ext2_resize.c:540
+#, c-format
+msgid ""
+"Your file system has too many occupied inodes to resize it to %i blocks. "
+"Sorry."
+msgstr ""
+"У файловій системі надто багато зайнятих i-вузлів, щоб змінити її розмір до %"
+"i блоків."
+
+#: libparted/fs/ext2/ext2_resize.c:554 libparted/fs/hfs/hfs.c:243
+#: libparted/fs/hfs/hfs.c:624
+msgid "shrinking"
+msgstr "скорочення"
+
+#: libparted/fs/ext2/ext2_resize.c:605
+msgid "File system was not cleanly unmounted! You should run e2fsck."
+msgstr ""
+"Файлова система була неправильно відключена! Необхідно запустити e2fsck."
+
+#: libparted/fs/ext2/ext2_resize.c:614
+msgid ""
+"The file system has the 'dir_index' feature enabled. Parted can only resize "
+"the file system if it disables this feature. You can enable it later by "
+"running 'tune2fs -O dir_index DEVICE' and then 'e2fsck -fD DEVICE'."
+msgstr ""
+"У файловій системі ввімкнено властивість 'dir_index'. Parted може змінювати "
+"розмір лише у файлових систем, у яких ця властивість вимкнена. Ви можете "
+"увімкнути її пізніше, командою 'tune2fs -O dir_index DEVICE', після чого "
+"слід запустити 'e2fsck -fD DEVICE'."
+
+#: libparted/fs/ext2/ext2_block_relocator.c:198
+msgid "Cross-linked blocks found! Better go run e2fsck first!"
+msgstr ""
+"Виявлено блоки з перехресними посиланнями! Краще спочатку запустити e2fsck!"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:537
+#, c-format
+msgid "Block %i has no reference? Weird."
+msgstr "Блок %i не має посилання? Дивно"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:738
+#, c-format
+msgid "Block %i shouldn't have been marked!"
+msgstr "Блок %i не повинен бути відміченим!"
+
+#: libparted/fs/ext2/interface.c:188
+msgid ""
+"The ext2 file system passed a basic check. For a more comprehensive check, "
+"use the e2fsck program."
+msgstr ""
+"Файлова система ext2 пройшла загальну перевірку. Для більш докладної "
+"перевірки користуйтесь програмою e2fsck."
+
+#: libparted/fs/ext2/interface.c:205
+msgid "Sorry, can't move the start of ext2 partitions yet!"
+msgstr "Нажаль, переміщення початку розділів типу ext2 ще не підтримується!"
+
+#: libparted/fs/ext2/ext2_buffer.c:82
+msgid "Couldn't flush buffer cache!"
+msgstr "Не вдається очистити буфер кешу!"
+
+#: libparted/fs/ext2/ext2_mkfs.c:162
+msgid "writing per-group metadata"
+msgstr "записування метаданих груп"
+
+#: libparted/fs/ext2/ext2_mkfs.c:565
+msgid "File system too small for ext2."
+msgstr "Файлова система занадто маленька для ext2."
+
+#: libparted/fs/fat/calc.c:134
+#, c-format
+msgid ""
+"You need %s of free disk space to shrink this partition to this size. "
+"Currently, only %s is free."
+msgstr ""
+"Необхідно %s вільного простору, щоб зменшити розділ до такого розміру (зараз "
+"у вас вільно лише %s)."
+
+#: libparted/fs/fat/context.c:55
+#, c-format
+msgid ""
+"Cluster start delta = %d, which is not a multiple of the cluster size %d."
+msgstr ""
+"Кластер починається зі зсувом %d, що не є цілим числом кластерів розміру %d."
+
+#: libparted/fs/fat/fat.c:312
+#, c-format
+msgid "Partition too big/small for a %s file system."
+msgstr "Розділ надто великий/малий для файлової системи типу %s."
+
+#: libparted/fs/fat/fat.c:478
+msgid ""
+"The FATs don't match. If you don't know what this means, then select "
+"cancel, run scandisk on the file system, and then come back."
+msgstr ""
+"Копії FAT не співпадають. Якщо ви не знаєте, що це означає, виберіть "
+"\"Скасувати\", запустіть scandisk для файлової системи, а потім повторіть цю "
+"команду."
+
+#: libparted/fs/fat/fat.c:518
+msgid "There are no possible configurations for this FAT type."
+msgstr "Для цього типу FAT немає допустимих конфігурацій."
+
+#: libparted/fs/fat/fat.c:530
+#, c-format
+msgid ""
+"File system doesn't have expected sizes for Windows to like it. Cluster "
+"size is %dk (%dk expected); number of clusters is %d (%d expected); size of "
+"FATs is %d sectors (%d expected)."
+msgstr ""
+"Windows не підтримує файлову систему, що має такі розміри. Розмір кластера %"
+"dk (очікувалось %dk); кількість кластерів %d (очікувалось %d); розмір FAT %d "
+"секторів (очікувалось %d)."
+
+#: libparted/fs/fat/fat.c:553
+#, c-format
+msgid ""
+"File system is reporting the free space as %d clusters, not %d clusters."
+msgstr ""
+"Файлова система повідомляє про вільний простір %d кластерів, а не %d "
+"кластерів."
+
+#: libparted/fs/fat/fat.c:878
+msgid ""
+"GNU Parted was miscompiled: the FAT boot sector should be 512 bytes. FAT "
+"support will be disabled."
+msgstr ""
+"GNU parted зібрано неправильно: завантажувальний сектор FAT повинен мати "
+"розмір 512 байтів. Підтримка FAT вимкнена."
+
+#: libparted/fs/fat/resize.c:158
+msgid ""
+"There's not enough room in the root directory for all of the files. Either "
+"cancel, or ignore to lose the files."
+msgstr ""
+"Не вистачає простору для всіх файлів в кореневому каталозі. Виберіть "
+"\"Скасувати\", якщо проігноруєте, це призведе до втрати файлів."
+
+#: libparted/fs/fat/resize.c:299
+msgid "Error writing to the root directory."
+msgstr "Помилка записування у кореневий каталог."
+
+#: libparted/fs/fat/resize.c:484
+msgid "If you leave your file system as FAT16, then you will have no problems."
+msgstr ""
+"Якщо залишити файлову систему як FAT16, тоді у вас не виникатиме проблем."
+
+#: libparted/fs/fat/resize.c:487
+msgid ""
+"If you convert to FAT16, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual)."
+msgstr ""
+"Якщо ви перетворюєте файлову систему розділу з Windows у розділ FAT16, буде "
+"потрібно перевстановити завантажувач MS Windows. Для цього слід переглянути "
+"довідку з Parted (або посібник з вашого дистрибутиву)."
+
+#: libparted/fs/fat/resize.c:495
+msgid ""
+"If you leave your file system as FAT32, then you will not introduce any new "
+"problems."
+msgstr ""
+"Якщо ви залишаєте файлову систему як FAT32, тоді не виникне ніяких нових "
+"проблем."
+
+#: libparted/fs/fat/resize.c:499
+msgid ""
+"If you convert to FAT32, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual). Also, "
+"converting to FAT32 will make the file system unreadable by MS DOS, MS "
+"Windows 95a, and MS Windows NT."
+msgstr ""
+"Якщо ви перетворите файлову систему розділу з MS Windows у розділ FAT32,буде "
+"потрібно перевстановити завантажувач MS Windows. Для цього слід переглянути "
+"довідку з Parted (або посібник з вашого дистрибутиву). Перетворення у FAT32 "
+"унеможливить читання файлової системи під MS DOS, MS Windows 95a, та MS "
+"Windows NT."
+
+#: libparted/fs/fat/resize.c:513
+#, c-format
+msgid "%s %s %s"
+msgstr "%s %s %s"
+
+#: libparted/fs/fat/resize.c:514
+msgid "Would you like to use FAT32?"
+msgstr "Бажаєте використовувати FAT32?"
+
+#: libparted/fs/fat/resize.c:541 libparted/fs/fat/resize.c:557
+#, c-format
+msgid "%s %s"
+msgstr "%s %s"
+
+#: libparted/fs/fat/resize.c:542
+msgid ""
+"The file system can only be resized to this size by converting to FAT16."
+msgstr ""
+"Змінити розмір файлової системи на вказаний розмір можна лише при "
+"перетворенні на FAT16."
+
+#: libparted/fs/fat/resize.c:558
+msgid ""
+"The file system can only be resized to this size by converting to FAT32."
+msgstr ""
+"Змінити розмір файлової системи на вказаний розмір можна лише при "
+"перетворенні на FAT32."
+
+#: libparted/fs/fat/resize.c:571
+msgid ""
+"GNU Parted cannot resize this partition to this size. We're working on it!"
+msgstr ""
+"GNU Parted нездатен змінити розмір розділу на вказане значення. Ми над цим "
+"працюємо!"
+
+#: libparted/fs/fat/bootsector.c:48 libparted/fs/fat/bootsector.c:55
+msgid "File system has an invalid signature for a FAT file system."
+msgstr "Файлова система містить неправильну сигнатуру файлової системи FAT."
+
+#: libparted/fs/fat/bootsector.c:62
+msgid "File system has an invalid sector size for a FAT file system."
+msgstr "Файлова система має неправильний розмір сектора файлової системи FAT."
+
+#: libparted/fs/fat/bootsector.c:69
+msgid "File system has an invalid cluster size for a FAT file system."
+msgstr "Файлова система має неправильний розмір кластера файлової системи FAT."
+
+#: libparted/fs/fat/bootsector.c:76
+msgid ""
+"File system has an invalid number of reserved sectors for a FAT file system."
+msgstr "У файловій системі неправильна кількість резервних секторів FAT."
+
+#: libparted/fs/fat/bootsector.c:83
+msgid "File system has an invalid number of FATs."
+msgstr "У файловій системі неправильне число копій FAT."
+
+#: libparted/fs/fat/bootsector.c:138
+#, c-format
+msgid ""
+"This file system has a logical sector size of %d. GNU Parted is known not "
+"to work properly with sector sizes other than 512 bytes."
+msgstr ""
+"Файлова система має логічний розмір сектора %d. Вважається, що GNU Parted "
+"працює неправильно з секторами, розмір яких не дорівнює 512 байт."
+
+#: libparted/fs/fat/bootsector.c:163
+#, c-format
+msgid ""
+"The file system's CHS geometry is (%d, %d, %d), which is invalid. The "
+"partition table's CHS geometry is (%d, %d, %d). If you select Ignore, the "
+"file system's CHS geometry will be left unchanged. If you select Fix, the "
+"file system's CHS geometry will be set to match the partition table's CHS "
+"geometry."
+msgstr ""
+"Геометрія CHS файлової системи становить (%d, %d, %d), що є неправильним. "
+"Геометрія CHS таблиці розділів становить (%d, %d, %d). Якщо ви виберете "
+"Ігнорувати, геометрію CHS файлової системи буде залишено без змін. Якщо ви "
+"оберете Виправити(Fix), геометрію CHS файлової системи буде приведено у "
+"відповідність до геометрії CHS таблиці розділів."
+
+#: libparted/fs/fat/bootsector.c:209
+msgid "FAT boot sector says logical sector size is 0. This is weird. "
+msgstr ""
+"Завантажувальний сектор FAT містить розмір логічного сектора, що дорівнює 0. "
+"Це дивно."
+
+#: libparted/fs/fat/bootsector.c:215
+msgid "FAT boot sector says there are no FAT tables. This is weird. "
+msgstr ""
+"У завантажувальному секторі FAT не міститься інформація про таблиці FAT. Це "
+"дивно."
+
+#: libparted/fs/fat/bootsector.c:221
+msgid "FAT boot sector says clusters are 0 sectors. This is weird. "
+msgstr ""
+"У відповідності до завантажувального сектора FAT, кластер містить 0 "
+"секторів. Це дивно."
+
+#: libparted/fs/fat/bootsector.c:231
+msgid "File system is FAT12, which is unsupported."
+msgstr "Файлові системи типу FAT12 не підтримуються."
+
+#: libparted/fs/fat/bootsector.c:407
+#, c-format
+msgid ""
+"The information sector has the wrong signature (%x). Select cancel for now, "
+"and send in a bug report. If you're desperate, it's probably safe to ignore."
+msgstr ""
+"Інформаційний сектор містить неправильну сигнатуру (%x). Виберіть \"Скасувати"
+"\" та відправте повідомлення про помилку. Якщо ви втратили надію, тоді можна "
+"проігнорувати цю проблему."
+
+#: libparted/fs/fat/count.c:149
+#, c-format
+msgid "Bad directory entry for %s: first cluster is the end of file marker."
+msgstr ""
+"Неправильний елемент каталогу %s: перший кластер є кінцем маркера файла."
+
+#: libparted/fs/fat/count.c:162
+#, c-format
+msgid ""
+"Bad FAT: unterminated chain for %s. You should run dosfsck or scandisk."
+msgstr ""
+"Помилка у FAT: незавершений ланцюг для %s. Потрібно запустити dosfsck або "
+"scandisk."
+
+#: libparted/fs/fat/count.c:171
+#, c-format
+msgid ""
+"Bad FAT: cluster %d outside file system in chain for %s. You should run "
+"dosfsck or scandisk."
+msgstr ""
+"Помилка у FAT: кластер %d знаходиться поза межами файлової системи у ланцюгу "
+"для %s. Потрібно запустити dosfsck або scandisk."
+
+#: libparted/fs/fat/count.c:181
+#, c-format
+msgid ""
+"Bad FAT: cluster %d is cross-linked for %s. You should run dosfsck or "
+"scandisk."
+msgstr ""
+"Помилка у FAT: перехресне посилання у кластері %d для %s. Потрібно запустити "
+"dosfsck або scandisk."
+
+#: libparted/fs/fat/count.c:200
+#, c-format
+msgid "%s is %dk, but it has %d clusters (%dk)."
+msgstr "%s дорівнює %dk, але має %d кластерів (%dk)."
+
+#: libparted/fs/fat/count.c:263
+#, c-format
+msgid ""
+"The file %s is marked as a system file. This means moving it could cause "
+"some programs to stop working."
+msgstr ""
+"Файл %s позначений як системний файл. Це означає, що його переміщення може "
+"призвести до припинення роботи деяких програм."
+
+#: libparted/fs/fat/table.c:138
+#, c-format
+msgid ""
+"FAT %d media %x doesn't match the boot sector's media %x. You should "
+"probably run scandisk."
+msgstr ""
+"FAT %d носій %x не відповідає завантажувальним секторам носія %x. Потрібно "
+"запустити dosfsck або scandisk."
+
+#: libparted/fs/fat/table.c:268
+#, c-format
+msgid "fat_table_set: cluster %ld outside file system"
+msgstr "fat_table_set: кластер %ld знаходиться поза межами файлової системи"
+
+#: libparted/fs/fat/table.c:296
+#, c-format
+msgid "fat_table_get: cluster %ld outside file system"
+msgstr "fat_table_get: кластер %ld знаходиться поза межами файлової системи"
+
+#: libparted/fs/fat/table.c:334
+msgid "fat_table_alloc_cluster: no free clusters"
+msgstr "fat_table_alloc_cluster: немає вільних кластерів"
+
+#: libparted/fs/linux_swap/linux_swap.c:236
+#, c-format
+msgid "Unrecognised linux swap signature '%10s'."
+msgstr "Невідома сигнатура '%10s' розділу підкачки linux."
+
+#: libparted/fs/linux_swap/linux_swap.c:312
+msgid "Too many bad pages."
+msgstr "Надто багато пошкоджених сторінок."
+
+#: libparted/fs/hfs/advfs.c:123 libparted/fs/hfs/advfs_plus.c:125
+#: libparted/fs/hfs/reloc.c:416 libparted/fs/hfs/reloc.c:510
+#: libparted/fs/hfs/reloc_plus.c:541 libparted/fs/hfs/reloc_plus.c:660
+#: libparted/fs/hfs/reloc_plus.c:774
+msgid "The file system contains errors."
+msgstr "Файлова система містить помилки."
+
+#: libparted/fs/hfs/advfs_plus.c:290
+msgid "Bad blocks could not be read."
+msgstr "Пошкоджені блоки не вдається прочитати."
+
+#: libparted/fs/hfs/cache.c:139
+#, c-format
+msgid ""
+"Trying to register an extent starting at block 0x%X, but another one already "
+"exists at this position. You should check the file system!"
+msgstr ""
+"Спроба зареєструвати екстент, о починається з блоку 0x%X, але в цій позиції "
+"вже існує інший. Слід перевірити файлову систему!"
+
+#: libparted/fs/hfs/cache.c:216
+#, c-format
+msgid ""
+"Trying to move an extent from block Ox%X to block Ox%X, but another one "
+"already exists at this position. This should not happen!"
+msgstr ""
+"Спроба перемістити екстент з блоку Ox%X у блок Ox%X, але в цій позиції вже "
+"існує інший. Цього не повинно бути!"
+
+#: libparted/fs/hfs/file.c:145
+#, c-format
+msgid "Could not update the extent cache for HFS file with CNID %X."
+msgstr "Не вдається оновити кеш екстенту для файлу HFS з CNID %X."
+
+#: libparted/fs/hfs/file.c:182
+#, c-format
+msgid "Trying to read HFS file with CNID %X behind EOF."
+msgstr "Спроба прочитати файл HFS з CNID %X перед EOF."
+
+#: libparted/fs/hfs/file.c:192 libparted/fs/hfs/file.c:222
+#, c-format
+msgid "Could not find sector %lli of HFS file with CNID %X."
+msgstr "Не вдається знайти сектор %lli з файлу HFS з CNID %X."
+
+#: libparted/fs/hfs/file.c:212
+#, c-format
+msgid "Trying to write HFS file with CNID %X behind EOF."
+msgstr "Спроба записати файл HFS з CNID %X перед EOF."
+
+#: libparted/fs/hfs/file_plus.c:159
+#, c-format
+msgid "Could not update the extent cache for HFS+ file with CNID %X."
+msgstr "Не вдається оновити кеш екстенту для файлу HFS+ з CNID %X."
+
+#: libparted/fs/hfs/file_plus.c:203
+#, c-format
+msgid "Trying to read HFS+ file with CNID %X behind EOF."
+msgstr "Спроба прочитати файл HFS+ з CNID %X перед EOF."
+
+#: libparted/fs/hfs/file_plus.c:214 libparted/fs/hfs/file_plus.c:256
+#, c-format
+msgid "Could not find sector %lli of HFS+ file with CNID %X."
+msgstr "Не вдається знайти сектор %lli з файлу HFS+ з CNID %X."
+
+#: libparted/fs/hfs/file_plus.c:245
+#, c-format
+msgid "Trying to write HFS+ file with CNID %X behind EOF."
+msgstr "Спроба записати файл HFS+ з CNID %X перед EOF."
+
+#: libparted/fs/hfs/hfs.c:225
+msgid "Sorry, HFS cannot be resized that way yet."
+msgstr "Розмір HFS не можна змінювати таким способом."
+
+#: libparted/fs/hfs/hfs.c:255 libparted/fs/hfs/hfs.c:636
+msgid "Data relocation has failed."
+msgstr "Помилка переносу даних."
+
+#: libparted/fs/hfs/hfs.c:274
+msgid "Data relocation left some data in the end of the volume."
+msgstr "При переносі даних частина даних залишилась наприкінці тому."
+
+#: libparted/fs/hfs/hfs.c:313
+msgid "writing HFS Master Directory Block"
+msgstr "записується головний блок каталогу"
+
+#: libparted/fs/hfs/hfs.c:461
+msgid "No valid HFS[+X] signature has been found while opening."
+msgstr "При відкриванні не виявлено правильну сигнатуру HFS[+X]."
+
+#: libparted/fs/hfs/hfs.c:471
+#, c-format
+msgid "Version %d of HFS+ isn't supported."
+msgstr "Версія %d системи HFS+ не підтримується."
+
+#: libparted/fs/hfs/hfs.c:482
+#, c-format
+msgid "Version %d of HFSX isn't supported."
+msgstr "Версія %d системи HFSX не підтримується."
+
+#: libparted/fs/hfs/hfs.c:667
+msgid "Data relocation left some data at the end of the volume."
+msgstr "При переносі даних наприкінці розділу залишились деякі дані."
+
+#: libparted/fs/hfs/hfs.c:715
+msgid "Error while writing the allocation file."
+msgstr "Помилка запису виділеного файлу."
+
+#: libparted/fs/hfs/hfs.c:730
+msgid "Error while writing the compatibility part of the allocation file."
+msgstr "Помилка запису частини сумісності виділеного файлу."
+
+#: libparted/fs/hfs/hfs.c:745
+msgid "writing HFS+ Volume Header"
+msgstr "запис заголовку тому HFS+"
+
+#: libparted/fs/hfs/hfs.c:845
+msgid "An error occurred while looking for the mandatory bad blocks file."
+msgstr "Помилка пошуку файлу відомих пошкоджених блоків."
+
+#: libparted/fs/hfs/hfs.c:899
+msgid ""
+"It seems there is an error in the HFS wrapper: the bad blocks file doesn't "
+"contain the embedded HFS+ volume."
+msgstr ""
+"Помилка у обробнику HFS: файл пошкоджених блоків не містить вбудований том "
+"HFS+."
+
+#: libparted/fs/hfs/hfs.c:930
+msgid "Sorry, HFS+ cannot be resized that way yet."
+msgstr "Розмір HFS+ не можна змінювати таким способом."
+
+#: libparted/fs/hfs/hfs.c:965
+msgid "shrinking embedded HFS+ volume"
+msgstr "зменшення вбудованого тому HFS+"
+
+#: libparted/fs/hfs/hfs.c:981
+msgid "Resizing the HFS+ volume has failed."
+msgstr "Помилка зміни розміру тому HFS+."
+
+#: libparted/fs/hfs/hfs.c:988
+msgid "shrinking HFS wrapper"
+msgstr "оболонка скорочення HFS"
+
+#: libparted/fs/hfs/hfs.c:997
+msgid "Updating the HFS wrapper has failed."
+msgstr "оновлення помилка оболонки HFS."
+
+#: libparted/fs/hfs/hfs.c:1099 libparted/fs/hfs/hfs.c:1184
+#, c-format
+msgid ""
+"This is not a real %s check. This is going to extract special low level "
+"files for debugging purposes."
+msgstr ""
+"Це не справжня перевірка %s. Відбувається лише отримання спеціальних "
+"ньзькорівневих файлів для налагодження."
+
+#: libparted/fs/hfs/journal.c:156
+msgid "Bad block list header checksum."
+msgstr "Неправильна контрольна сума заголовка списку блоків."
+
+#: libparted/fs/hfs/journal.c:169
+#, c-format
+msgid ""
+"Invalid size of a transaction block while replaying the journal (%i bytes)."
+msgstr ""
+"Неправильний розмір блоку транзакції при повторному накладанні журналу (%i "
+"байтів)."
+
+#: libparted/fs/hfs/journal.c:261
+msgid ""
+"Journal stored outside of the volume are not supported. Try to desactivate "
+"the journal and run Parted again."
+msgstr ""
+"Журнал розміщено поза межами тому не підтримується. Слід вимкнути журнал та "
+"перезапустити Parted."
+
+#: libparted/fs/hfs/journal.c:272
+msgid "Journal offset or size is not multiple of the sector size."
+msgstr "Початок чи розмір журналу не є цілим числом секторів."
+
+#: libparted/fs/hfs/journal.c:290
+msgid "Incorrect magic values in the journal header."
+msgstr "Неправильні сигнатури у заголовку журналу."
+
+#: libparted/fs/hfs/journal.c:299
+msgid "Journal size mismatch between journal info block and journal header."
+msgstr ""
+"Розмір журналу не відповідає значенню у інформаційному блоці журналу та "
+"заголовку журналу."
+
+#: libparted/fs/hfs/journal.c:311
+msgid "Some header fields are not multiple of the sector size."
+msgstr "Розмір деяких полів заголовку не складає ціле число секторів."
+
+#: libparted/fs/hfs/journal.c:320
+msgid ""
+"The sector size stored in the journal is not 512 bytes. Parted only "
+"supports 512 bytes length sectors."
+msgstr ""
+"Розмір сектора, що зберігається у журналі, не дорівнює 512 байтам. Parted "
+"підтримує лише сектори розміром 512 байтів."
+
+#: libparted/fs/hfs/journal.c:332
+msgid "Bad journal checksum."
+msgstr "Неправильна контрольна сума журналу."
+
+#: libparted/fs/hfs/journal.c:350
+msgid ""
+"The journal is not empty. Parted must replay the transactions before "
+"opening the file system. This will modify the file system."
+msgstr ""
+"Журнал не порожній. Parted маж накласти транзакції перед відкривання "
+"файлової системи. Це призведе до зміни файлової системи."
+
+#: libparted/fs/hfs/journal.c:378
+msgid ""
+"The volume header or the master directory block has changed while replaying "
+"the journal. You should restart Parted."
+msgstr ""
+"При накладанні журналу змінився заголовок тому чи блок головного каталогу. "
+"Слід перезапустити Parted."
+
+#: libparted/fs/hfs/probe.c:52
+#, c-format
+msgid ""
+"Parted can't use HFS file systems on disks with a sector size not equal to %"
+"d bytes."
+msgstr ""
+"Parted не може використовувати файлові системи HFS на дисках з розміром "
+"сектору, що не кратний %d байтів."
+
+#: libparted/fs/hfs/reloc.c:153 libparted/fs/hfs/reloc_plus.c:157
+msgid "An extent has not been relocated."
+msgstr "Екстент не був переміщений."
+
+#: libparted/fs/hfs/reloc.c:253 libparted/fs/hfs/reloc_plus.c:309
+msgid ""
+"A reference to an extent comes from a place it should not. You should check "
+"the file system!"
+msgstr ""
+"Посилання на екстент з місця, з якого не має бути посилання. Слід перевірити "
+"файлову систему!"
+
+#: libparted/fs/hfs/reloc.c:383
+msgid "This HFS volume has no catalog file. This is very unusual!"
+msgstr "Цей том HFS не містить файл каталогу. Досить дивно!"
+
+#: libparted/fs/hfs/reloc.c:477
+msgid "This HFS volume has no extents overflow file. This is quite unusual!"
+msgstr "Цей том HFS не містить файлу перекривання екстентів. Досить дивно!"
+
+#: libparted/fs/hfs/reloc.c:519 libparted/fs/hfs/reloc_plus.c:670
+msgid ""
+"The extents overflow file should not contain its own extents! You should "
+"check the file system."
+msgstr ""
+"Файл перекривання екстентів не має містить власних екстентів! Слід "
+"перевірити файлову систему."
+
+#: libparted/fs/hfs/reloc.c:576 libparted/fs/hfs/reloc_plus.c:849
+msgid "Could not cache the file system in memory."
+msgstr "Не вдається занести у кеш файлову систему у пам'яті."
+
+#: libparted/fs/hfs/reloc.c:637 libparted/fs/hfs/reloc_plus.c:910
+msgid "Bad blocks list could not be loaded."
+msgstr "Список неправильних блоків не було завантажено."
+
+#: libparted/fs/hfs/reloc.c:651 libparted/fs/hfs/reloc_plus.c:926
+msgid "An error occurred during extent relocation."
+msgstr "Помилка при переміщенні екстенту."
+
+#: libparted/fs/hfs/reloc_plus.c:497
+msgid "This HFS+ volume has no catalog file. This is very unusual!"
+msgstr "Цей том HFS+ не містить файлу каталогу. Досить дивно!"
+
+#: libparted/fs/hfs/reloc_plus.c:621
+msgid "This HFS+ volume has no extents overflow file. This is quite unusual!"
+msgstr "Цей том HFS+ не містить файлу перекривання екстентів. Досить дивно!"
+
+#: parted/parted.c:76
+msgid "displays this help message"
+msgstr "відображає це повідомлення"
+
+#: parted/parted.c:77
+msgid "where necessary, prompts for user intervention"
+msgstr "коли необхідно, запитувати втручання користувача"
+
+#: parted/parted.c:78
+msgid "never prompts for user intervention"
+msgstr "ніколи не запитувати втручання користувача"
+
+#: parted/parted.c:79
+msgid "displays the version"
+msgstr "відображає версію"
+
+#: parted/parted.c:87
+msgid ""
+"NUMBER is the partition number used by Linux. On MS-DOS disk labels, the "
+"primary partitions number from 1 to 4, logical partitions from 5 onwards.\n"
+msgstr ""
+"НОМЕР - це номер розділу, що використовується Linux. У етикетках диску MS-"
+"DOS, основні розділи мають номери 1-4, а логічні - 5 та далі.\n"
+
+#: parted/parted.c:90
+msgid "LABEL-TYPE is one of: "
+msgstr "ТИП-ЕТИКЕТКИ один з: "
+
+#: parted/parted.c:91
+msgid "FLAG is one of: "
+msgstr "ОЗНАКА одне з: "
+
+#: parted/parted.c:92
+msgid "UNIT is one of: "
+msgstr "БЛОК одне з: "
+
+#: parted/parted.c:93
+msgid "PART-TYPE is one of: primary, logical, extended\n"
+msgstr "ТИП-РОЗДІЛУ один з: основний, логічний, розширений\n"
+
+#: parted/parted.c:95
+msgid "FS-TYPE is one of: "
+msgstr "ТИП-ФС один з: "
+
+#: parted/parted.c:96
+msgid ""
+"START and END are disk locations, such as 4GB or 10%. Negative values count "
+"from the end of the disk. For example, -1s specifies exactly the last "
+"sector.\n"
+msgstr ""
+"ПОЧАТОК та КІНЕЦЬ - це місця на диску, такі як 4GB чи 10%. Від'ємні "
+"значення відраховуються від кінця диску. Наприклад, -1s вказує останній "
+"сектор диску.\n"
+
+#: parted/parted.c:99
+msgid "STATE is one of: on, off\n"
+msgstr "СТАН один з: on, off\n"
+
+#: parted/parted.c:100
+msgid "DEVICE is usually /dev/hda or /dev/sda\n"
+msgstr "ПРИСТРІЙ - зазвичай /dev/hda чи /dev/sda\n"
+
+#: parted/parted.c:101
+msgid "NAME is any word you want\n"
+msgstr "НАЗВА - будь-яке слово на ваш вибір\n"
+
+#: parted/parted.c:102
+msgid "The partition must have one of the following FS-TYPEs: "
+msgstr "Розділ повинен мати один з наступних типів FS-TYPE: "
+
+#: parted/parted.c:105
+msgid "GNU Parted Version information:\n"
+msgstr "Версія GNU Parted:\n"
+
+#: parted/parted.c:107
+msgid ""
+"Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n"
+"This program is free software, covered by the GNU General Public License.\n"
+"\n"
+"This program is distributed in the hope that it will be useful, but WITHOUT "
+"ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
+"FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
+"more details.\n"
+"\n"
+msgstr ""
+"Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n"
+"Ця програма є вільним програмним забезпеченням, на неї поширюється "
+"Універсальна Публічна Ліцензія GNU.\n"
+"\n"
+"Ця програма розповсюджується зі сподіванням,що вона буде корисною, але БЕЗ "
+"БУДЬ-ЯКИХ ГАРАНТІЙ; навіть без неявної гарантії КОМЕРЦІЙНОЇ ЦІННОСТІ чи "
+"ПРИДАТНОСТІ ДЛЯ ПЕВНОЇ МЕТИ. Докладнішу інформацію про це дивіться у "
+"Універсальній Публічній Ліцензії GNU.\n"
+
+#: parted/parted.c:152
+#, c-format
+msgid "%0.f%%\t(time left %.2d:%.2d)"
+msgstr "%0.f%%\t(залишилось часу %.2d:%.2d)"
+
+#: parted/parted.c:170
+#, c-format
+msgid ""
+"Partition %s is being used. You must unmount it before you modify it with "
+"Parted."
+msgstr ""
+"Розділ %s наразі зайнятий. Слід відключити його, перш ніж змінювати його "
+"програмою Parted."
+
+#: parted/parted.c:187
+#, c-format
+msgid "Partition(s) on %s are being used."
+msgstr "Розділи на %s наразі зайняті."
+
+#: parted/parted.c:413 parted/parted.c:594 parted/parted.c:979
+#: parted/parted.c:1059 parted/parted.c:1586 parted/parted.c:1663
+#: parted/parted.c:1707
+msgid "Partition number?"
+msgstr "Номер розділу?"
+
+#: parted/parted.c:456
+msgid "Source device?"
+msgstr "Пристрій-джерело?"
+
+#: parted/parted.c:460
+msgid "Source partition number?"
+msgstr "Номер вихідного розділу?"
+
+#: parted/parted.c:465
+msgid "Can't copy an extended partition."
+msgstr "Не можна копіювати розширені розділи."
+
+#: parted/parted.c:471
+msgid "Destination partition number?"
+msgstr "Номер цільового розділу?"
+
+#: parted/parted.c:564
+msgid "New disk label type?"
+msgstr "Нова етикетка диску?"
+
+#: parted/parted.c:598
+msgid "File system?"
+msgstr "Файлова система?"
+
+#: parted/parted.c:645 parted/parted.c:815
+msgid "Partition type?"
+msgstr "Тип розділу?"
+
+#: parted/parted.c:652 parted/parted.c:822 parted/parted.c:1062
+msgid "Partition name?"
+msgstr "Назва розділу?"
+
+#: parted/parted.c:660 parted/parted.c:832
+msgid "File system type?"
+msgstr "Тип файлової системи?"
+
+#: parted/parted.c:667 parted/parted.c:834 parted/parted.c:994
+#: parted/parted.c:1544 parted/parted.c:1595
+msgid "Start?"
+msgstr "Початок?"
+
+#: parted/parted.c:669 parted/parted.c:837 parted/parted.c:997
+#: parted/parted.c:1546 parted/parted.c:1597
+msgid "End?"
+msgstr "Кінець?"
+
+#: parted/parted.c:707 parted/parted.c:875
+#, c-format
+msgid ""
+"You requested a partition from %s to %s.\n"
+"The closest location we can manage is %s to %s. Is this still acceptable to "
+"you?"
+msgstr ""
+"Ви вказали розділ у межах %s - %s.\n"
+"Найближчий до нього діапазон %s - %s. Ви згодні з таким діапазоном?"
+
+#: parted/parted.c:827
+msgid "An extended partition cannot hold a file system. Did you want mkpart?"
+msgstr "Розширений розділ не може мати файлову систему. Виконати mkpart?"
+
+#: parted/parted.c:985
+msgid "Can't move an extended partition."
+msgstr "Переміщення розширених розділів не підтримується."
+
+#: parted/parted.c:1014
+msgid "Can't move a partition onto itself. Try using resize, perhaps?"
+msgstr "Не можна переміщувати розділ сам у себе. Може спробувати resize?"
+
+#: parted/parted.c:1158
+#, c-format
+msgid "Minor: %d\n"
+msgstr "Номер: %d\n"
+
+#: parted/parted.c:1159
+#, c-format
+msgid "Flags: %s\n"
+msgstr "Ознаки: %s\n"
+
+#: parted/parted.c:1160
+#, c-format
+msgid "File System: %s\n"
+msgstr "Файлова система: %s\n"
+
+#: parted/parted.c:1161
+#, c-format
+msgid "Size: "
+msgstr "Розмір: "
+
+#: parted/parted.c:1166
+#, c-format
+msgid "Minimum size: "
+msgstr "Мінімальний розмір: "
+
+#: parted/parted.c:1169
+#, c-format
+msgid "Maximum size: "
+msgstr "Максимальний розмір: "
+
+#: parted/parted.c:1255
+#, c-format
+msgid "Disk %s: %s\n"
+msgstr "Диск %s: %s\n"
+
+#: parted/parted.c:1256
+#, c-format
+msgid "Sector size (logical/physical): %lldB/%lldB\n"
+msgstr "Розмір сектора (логічний/фізичний): %lldБ/%lldБ\n"
+
+#: parted/parted.c:1267
+#, c-format
+msgid "BIOS cylinder,head,sector geometry: %d,%d,%d. Each cylinder is %s.\n"
+msgstr "BIOS циліндр,головка,сектор геометрія: %d,%d,%d. Кожен циліндр %s.\n"
+
+#: parted/parted.c:1273
+#, c-format
+msgid "Partition Table: %s\n"
+msgstr "таблиця розділів: %s\n"
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Number"
+msgstr "Номер"
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Start"
+msgstr "Початок"
+
+#: parted/parted.c:1285 parted/parted.c:1288
+msgid "End"
+msgstr "Кінець"
+
+#: parted/parted.c:1288
+msgid "Size"
+msgstr "Розмір"
+
+#: parted/parted.c:1292
+msgid "Type"
+msgstr "Тип"
+
+#: parted/parted.c:1294
+msgid "File system"
+msgstr "Файлова система"
+
+#: parted/parted.c:1297
+msgid "Name"
+msgstr "Назва"
+
+#: parted/parted.c:1299
+msgid "Flags"
+msgstr "Ознаки"
+
+#: parted/parted.c:1352
+msgid "Free Space"
+msgstr "Вільний простір"
+
+#: parted/parted.c:1441
+#, c-format
+msgid ""
+"A %s %s partition was found at %s -> %s. Do you want to add it to the "
+"partition table?"
+msgstr ""
+"Знайдено розділ %s %s у межах від %s -> %s. Бажаєте додати його до таблиці "
+"розділів?"
+
+#: parted/parted.c:1479
+msgid "searching for file systems"
+msgstr "пошук файлових систем"
+
+#: parted/parted.c:1684
+msgid "New device?"
+msgstr "Новий пристрій?"
+
+#: parted/parted.c:1709
+msgid "Flag to Invert?"
+msgstr "Ознака, яку інвертувати?"
+
+#: parted/parted.c:1714
+msgid "New state?"
+msgstr "Нове значення?"
+
+#: parted/parted.c:1747
+msgid "Unit?"
+msgstr "Блок?"
+
+#: parted/parted.c:1896
+msgid "check"
+msgstr "check"
+
+#: parted/parted.c:1899
+msgid ""
+"check NUMBER do a simple check on the file system"
+msgstr ""
+"check НОМЕР виконати просту перевірку файлової системи"
+
+#: parted/parted.c:1905
+msgid "cp"
+msgstr "cp"
+
+#: parted/parted.c:1908
+msgid ""
+"cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another "
+"partition"
+msgstr ""
+"cp [З-ПРИСТРОЮ] З-НОМЕР У-НОМЕР копіювати файлову систему у інший розділ"
+
+#: parted/parted.c:1914
+msgid "help"
+msgstr "help"
+
+#: parted/parted.c:1917
+msgid ""
+"help [COMMAND] prints general help, or help on "
+"COMMAND"
+msgstr "help [КОМАНДА] вивести довідку, або довідку про КОМАНДА"
+
+#: parted/parted.c:1923
+msgid "mklabel"
+msgstr "mklabel"
+
+#: parted/parted.c:1926
+msgid ""
+"mklabel LABEL-TYPE create a new disklabel (partition "
+"table)"
+msgstr ""
+"mklabel ТИП_ЕТИКЕТКИ створити нову позначку диску (таблицю розділів)"
+
+#: parted/parted.c:1932
+msgid "mkfs"
+msgstr "mkfs"
+
+#: parted/parted.c:1935
+msgid ""
+"mkfs NUMBER FS-TYPE make a FS-TYPE file system on "
+"partititon NUMBER"
+msgstr ""
+"mkfs НОМЕР ТИП-ФС створити файлову систему ТИП-ФС у розділі НОМЕР"
+
+#: parted/parted.c:1941
+msgid "mkpart"
+msgstr "mkpart"
+
+#: parted/parted.c:1944
+msgid "mkpart PART-TYPE [FS-TYPE] START END make a partition"
+msgstr "mkpart ТИП-РОЗДІЛУ [ТИП-ФС] ПОЧАТОК КІНЕЦЬ створити розділ"
+
+#: parted/parted.c:1950
+msgid ""
+"mkpart makes a partition without creating a new file system on the "
+"partition. FS-TYPE may be specified to set an appropriate partition ID.\n"
+msgstr ""
+"mkpart створити розділ без створення нової файлової системи у ньому. Можна "
+"вказати ТИП-ФС для встановлення відповідного ідентифікатора розділу.\n"
+
+#: parted/parted.c:1955
+msgid "mkpartfs"
+msgstr "mkpartfs"
+
+#: parted/parted.c:1958
+msgid ""
+"mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system"
+msgstr ""
+"mkpartfs ТИП-РОЗДІЛУ ТИП-ФС ПОЧАТОК КІНЕЦЬ створити розділ з файловою "
+"системою"
+
+#: parted/parted.c:1964
+msgid "move"
+msgstr "move"
+
+#: parted/parted.c:1967
+msgid "move NUMBER START END move partition NUMBER"
+msgstr "move НОМЕР ПОЧАТОК КІНЕЦЬ перемістити розділ з номером НОМЕР"
+
+#: parted/parted.c:1972
+msgid "name"
+msgstr "name"
+
+#: parted/parted.c:1975
+msgid "name NUMBER NAME name partition NUMBER as NAME"
+msgstr "name НОМЕР НАЗВА призначити назву НАЗВА розділу НОМЕР"
+
+#: parted/parted.c:1980
+msgid "print"
+msgstr "print"
+
+#: parted/parted.c:1983
+msgid ""
+"print [free|NUMBER|all] display the partition table, a "
+"partition, or all devices"
+msgstr ""
+"print [free|НОМЕР|all] вивести таблицю розділів, розділ або усі "
+"пристрої"
+
+#: parted/parted.c:1987
+msgid ""
+"Without arguments, print displays the entire partition table. With 'free'\n"
+"argument, information about free space will be displayed otherwise if a\n"
+"partition number is given, then more detailed information is displayed\n"
+"about that partition. If the 'all' argument is passed instead, partition\n"
+"information for all devices will be displayed."
+msgstr ""
+"Без аргументів, виводить таблицю розділів. Якщо вказано 'free',\n"
+"відображається інформація про вільний простір, якщо вказано номер\n"
+"розділу, виводиться докладніша інформація про розділ. \n"
+"Якщо вказано 'all', відображається інформація про усі пристрої."
+
+#: parted/parted.c:1995
+msgid "quit"
+msgstr "quit"
+
+#: parted/parted.c:1998
+msgid "quit exit program"
+msgstr "quit вихід з програми"
+
+#: parted/parted.c:2003
+msgid "rescue"
+msgstr "rescue"
+
+#: parted/parted.c:2006
+msgid ""
+"rescue START END rescue a lost partition near START "
+"and END"
+msgstr ""
+"rescue ПОЧАТОК КІНЕЦЬ знайти втрачені розділи між ПОЧАТОК та КІНЕЦЬ"
+
+#: parted/parted.c:2012
+msgid "resize"
+msgstr "resize"
+
+#: parted/parted.c:2015
+msgid ""
+"resize NUMBER START END resize partition NUMBER and its "
+"file system"
+msgstr "resize НОМЕР ПОЧАТОК КІНЕЦЬ змінити розмір розділу НОМЕР"
+
+#: parted/parted.c:2023
+msgid "rm"
+msgstr "rm"
+
+#: parted/parted.c:2026
+msgid "rm NUMBER delete partition NUMBER"
+msgstr "rm НОМЕР видалити розділ з номером НОМЕР"
+
+#: parted/parted.c:2031
+msgid "select"
+msgstr "select"
+
+#: parted/parted.c:2034
+msgid "select DEVICE choose the device to edit"
+msgstr "select ПРИСТРІЙ вибирати пристрій для роботи"
+
+#: parted/parted.c:2039
+msgid "set"
+msgstr "set"
+
+#: parted/parted.c:2042
+msgid ""
+"set NUMBER FLAG STATE change the FLAG on partition NUMBER"
+msgstr "set НОМЕР ОЗНАКА СТАН змінити ознаку розділу з номером НОМЕР"
+
+#: parted/parted.c:2048
+msgid "toggle"
+msgstr "toggle"
+
+#: parted/parted.c:2051
+msgid ""
+"toggle [NUMBER [FLAG]] toggle the state of FLAG on "
+"partition NUMBER"
+msgstr ""
+"toggle [НОМЕР [ОЗНАКА]] перемикнути ознаку ОЗНАКА розділу з номером "
+"НОМЕР"
+
+#: parted/parted.c:2057
+msgid "unit"
+msgstr "unit"
+
+#: parted/parted.c:2060
+msgid "unit UNIT set the default unit to UNIT"
+msgstr ""
+"unit БЛОК встановити для типового блоку значення БЛОК"
+
+#: parted/parted.c:2065
+#, fuzzy
+msgid "version"
+msgstr "версія"
+
+#: parted/parted.c:2068
+msgid ""
+"version displays the current version of GNU "
+"Parted and copyright information"
+msgstr ""
+"версія вивести поточну версію GNU Parted та "
+"інформацію про авторське право"
+
+#: parted/parted.c:2072
+msgid ""
+"version displays copyright and version information corressponding to this "
+"copy of GNU Parted\n"
+msgstr ""
+"команда version виводить інформацію про версію цієї програми GNU Parted\n"
+
+#: parted/parted.c:2158
+msgid "No device found"
+msgstr "Пристрій не знайдено"
+
+#: parted/parted.c:2222
+msgid "Don't forget to update /etc/fstab, if necessary.\n"
+msgstr "Не забудьте оновити /etc/fstab, якщо це необхідно.\n"
+
+#: parted/ui.c:68
+msgid "Welcome to GNU Parted! Type 'help' to view a list of commands.\n"
+msgstr ""
+"Ласкаво просимо до GNU Parted! Перелік команд виводиться командою 'help'.\n"
+
+#: parted/ui.c:71
+msgid ""
+"Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]\n"
+"Apply COMMANDs with PARAMETERS to DEVICE. If no COMMAND(s) are given, run "
+"in\n"
+"interactive mode.\n"
+msgstr ""
+"Використання: parted [КЛЮЧ]... [ПРИСТРІЙ [КОМАНДА [ПАРАМЕТРИ]...]...]\n"
+"Виконати КОМАНДА з параметрами ПАРАМЕТРИ для пристрою ПРИСТРІЙ. Якщо\n"
+"КОМАНДА не вказана, запускається у інтерактивному режимі.\n"
+
+#: parted/ui.c:76
+#, c-format
+msgid ""
+"\n"
+"\n"
+"You found a bug in GNU Parted! Here's what you have to do:\n"
+"\n"
+"Don't panic! The bug has most likely not affected any of your data.\n"
+"Help us to fix this bug by doing the following:\n"
+"\n"
+"Check whether the bug has already been fixed by checking\n"
+"the last version of GNU Parted that you can find at:\n"
+"\n"
+"\thttp://ftp.gnu.org/gnu/parted/\n"
+"\n"
+"Please check this version prior to bug reporting.\n"
+"\n"
+"If this has not been fixed yet or if you don't know how to check,\n"
+"please visit the GNU Parted website:\n"
+"\n"
+"\thttp://www.gnu.org/software/parted\n"
+"\n"
+"for further information.\n"
+"\n"
+"Your report should contain the version of this release (%s)\n"
+"along with the error message below, the output of\n"
+"\n"
+"\tparted DEVICE unit co print unit s print\n"
+"\n"
+"and additional information about your setup you consider important.\n"
+msgstr ""
+"\n"
+"\n"
+"Ви знайшли помилку у GNU Parted! Рекомендації щодо подальших дій:\n"
+"\n"
+"Не панікуйте! Швидше за все помилка не впливає на ваші дані.\n"
+"Допоможіть нам виправити помилку, для цього:\n"
+"\n"
+"Перевірте чи не була помилка вже виправлена у останній версії\n"
+"GNU Parted, яку можна знайти за адресою:\n"
+"\n"
+"\thttp://ftp.gnu.org/gnu/parted/\n"
+"\n"
+"Перевірте цю версію, перш ніж надсилати звіт про помилку.\n"
+"\n"
+"Якщо помилка не виправлена чи ви не знаєте як це перевірити,\n"
+"подальшу інформацію шукайте на веб-сайті GNU Parted:\n"
+"\n"
+"\thttp://www.gnu.org/software/parted\n"
+"\n"
+"У вашому звіті слід вказати версію випуску, (%s)\n"
+"наведене нижче повідомлення про помилку, вивід команди\n"
+"\n"
+"\tparted DEVICE unit co print unit s print\n"
+"\n"
+"та додаткову інформацію про параметри, які ви вважатимете важливими.\n"
+
+#: parted/ui.c:230
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_MAPERR (Address not mapped to object)"
+msgstr ""
+"\n"
+"Помилка: SEGV_MAPERR (Адреса не прив'язана до об'єкту)"
+
+#: parted/ui.c:235
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_ACCERR (Invalid permissions for mapped object)"
+msgstr ""
+"\n"
+"Помилка: SEGV_ACCERR (Неправильні права доступу для прив'язаного об'єкту)"
+
+#: parted/ui.c:240
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGSEGV signal was encountered."
+msgstr ""
+"\n"
+"Помилка: Виявлено загальний сигнал SIGSEGV."
+
+#: parted/ui.c:258
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTDIV (Integer: divide by zero)"
+msgstr ""
+"\n"
+"Помилка: FPE_INTDIV (Ціле: ділення на нуль)"
+
+#: parted/ui.c:262
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTOVF (Integer: overflow)"
+msgstr ""
+"\n"
+"Помилка: FPE_INTOVF (Ціле число: переповнення)"
+
+#: parted/ui.c:266
+#, fuzzy, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTDIV (Float: divide by zero)"
+msgstr ""
+"\n"
+"Помилка: FPE_INTDIV (Число з рухомою комою: ділення на нуль)"
+
+#: parted/ui.c:270
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTOVF (Float: overflow)"
+msgstr ""
+"\n"
+"Помилка: FPE_FLTOVF (Число з рухомою комою: переповнення)"
+
+#: parted/ui.c:274
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTUND (Float: underflow)"
+msgstr ""
+"\n"
+"Помилка: FPE_FLTUND (Число з рухомою комою: дуже мале значення)"
+
+#: parted/ui.c:278
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTRES (Float: inexact result)"
+msgstr ""
+"\n"
+"Помилка: FPE_FLTRES (Число з рухомою комою: неточний результат)"
+
+#: parted/ui.c:282
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTINV (Float: invalid operation)"
+msgstr ""
+"\n"
+"Помилка: FPE_FLTINV (Число з рухомою комою: неправильна операція)"
+
+#: parted/ui.c:286
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTSUB (Float: subscript out of range)"
+msgstr ""
+"\n"
+"Помилка: FPE_FLTSUB (Число з рухомою комою: підпис поза межами)"
+
+#: parted/ui.c:291
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGFPE signal was encountered."
+msgstr ""
+"\n"
+"Помилка: Виявлено загальний сигнал SIGFPE."
+
+#: parted/ui.c:310
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPC (Illegal Opcode)"
+msgstr ""
+"\n"
+"Помилка: ILL_ILLOPC (Недопустимий код операцій)"
+
+#: parted/ui.c:314
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPN (Illegal Operand)"
+msgstr ""
+"\n"
+"Помилка: ILL_ILLOPN (Неправильний операнд)"
+
+#: parted/ui.c:318
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLADR (Illegal addressing mode)"
+msgstr ""
+"\n"
+"Помилка: ILL_ILLADR (Неправильний режим адресації)"
+
+#: parted/ui.c:323
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLTRP (Illegal Trap)"
+msgstr ""
+"\n"
+"Помилка: ILL_ILLTRP (Неправильна пастка)"
+
+#: parted/ui.c:327
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVOPC (Privileged Opcode)"
+msgstr ""
+"\n"
+"Помилка: ILL_PRVOPC (Код привілейованої операції)"
+
+#: parted/ui.c:331
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVREG (Privileged Register)"
+msgstr ""
+"\n"
+"Помилка: ILL_PRVREG (Привілейований регістр)"
+
+#: parted/ui.c:335
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_COPROC (Coprocessor Error)"
+msgstr ""
+"\n"
+"Помилка: ILL_COPROC (Помилка співпроцесора)"
+
+#: parted/ui.c:339
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_BADSTK (Internal Stack Error)"
+msgstr ""
+"\n"
+"Помилка: ILL_BADSTK (Внутрішня помилка стеку)"
+
+#: parted/ui.c:343
+#, fuzzy, c-format
+msgid ""
+"\n"
+"Error: A general SIGILL signal was encountered."
+msgstr ""
+"\n"
+"Помилка: Виявлено загальний сигнал SIGILL."
+
+#: parted/ui.c:828
+msgid "Expecting a partition number."
+msgstr "Очікується номер розділу."
+
+#: parted/ui.c:837
+msgid "Partition doesn't exist."
+msgstr "Розділ не існує."
+
+#: parted/ui.c:857
+msgid "Expecting a file system type."
+msgstr "Очікується тип файлова система."
+
+#: parted/ui.c:863
+#, c-format
+msgid "Unknown file system type \"%s\"."
+msgstr "Невідомий тип файлової системи \"%s\"."
+
+#: parted/ui.c:883
+msgid "Expecting a disk label type."
+msgstr "Очікується тип дискової етикетки."
+
+#: parted/ui.c:977
+msgid "Can't create any more partitions."
+msgstr "Не вдається додатково створити розділи."
+
+#: parted/ui.c:987
+msgid "Expecting a partition type."
+msgstr "Очікується тип розділу."
+
+#: parted/ui.c:1115
+msgid "on"
+msgstr "on"
+
+#: parted/ui.c:1116
+msgid "off"
+msgstr "off"
+
+#: parted/ui.c:1227
+msgid "OPTIONs:"
+msgstr "КЛЮЧІ:"
+
+#: parted/ui.c:1230
+msgid "COMMANDs:"
+msgstr "КОМАНДИ:"
+
+#: parted/ui.c:1238
+#, c-format
+msgid "Using %s\n"
+msgstr "Використовується %s\n"
diff --git a/po/vi.po b/po/vi.po
new file mode 100644
index 0000000..227bb9f
--- /dev/null
+++ b/po/vi.po
@@ -0,0 +1,2498 @@
+# translation of parted-1.6.6.po to Vietnamese
+# Copyright (C) 2005 Free Software Foundation, Inc.
+# Tran Thi Hoang Quyen <banhdauxanhhaiduong@gmail.com>, 2005.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: parted 1.6.6\n"
+"Report-Msgid-Bugs-To: bug-parted@gnu.org\n"
+"POT-Creation-Date: 2006-04-21 21:20+0200\n"
+"PO-Revision-Date: 2005-07-03 21:04+0400\n"
+"Last-Translator: Tran Thi Hoang Quyen <banhdauxanhhaiduong@gmail.com>\n"
+"Language-Team: Vietnamese <gnomevi-list@lists.sourceforge.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.9.1\n"
+
+#: libparted/arch/linux.c:284
+#, c-format
+msgid "Could not stat device %s - %s."
+msgstr "Không stat được thiết bị %s - %s."
+
+#: libparted/arch/linux.c:390
+#, c-format
+msgid ""
+"Could not determine sector size for %s: %s.\n"
+"Using the default sector size (%lld)."
+msgstr ""
+
+#: libparted/arch/linux.c:401
+#, c-format
+msgid ""
+"Device %s has a logical sector size of %lld. Not all parts of GNU Parted "
+"support this at the moment, and the working code is HIGHLY EXPERIMENTAL.\n"
+msgstr ""
+
+#: libparted/arch/linux.c:441
+#, fuzzy, c-format
+msgid "Unable to determine the size of %s (%s)."
+msgstr "Không nhận ra kích thước của %s (%s)"
+
+#: libparted/arch/linux.c:530
+#, c-format
+msgid "Could not get identity of device %s - %s"
+msgstr "Không lấy được tên của thiết bị %s - %s"
+
+#: libparted/arch/linux.c:539
+msgid "Generic IDE"
+msgstr ""
+
+#: libparted/arch/linux.c:556
+#, c-format
+msgid ""
+"Device %s has multiple (%d) logical sectors per physical sector.\n"
+"GNU Parted supports this EXPERIMENTALLY for some special disk label/file "
+"system combinations, e.g. GPT and ext2/3.\n"
+"Please consult the web site for up-to-date information."
+msgstr ""
+
+#: libparted/arch/linux.c:726
+#, c-format
+msgid "Error initialising SCSI device %s - %s"
+msgstr "Lỗi chạy thiết bị SCSI %s - %s"
+
+#: libparted/arch/linux.c:781
+#, fuzzy, c-format
+msgid ""
+"The device %s has zero length, and can't possibly store a file system or "
+"partition table. Perhaps you selected the wrong device?"
+msgstr ""
+"Thiết bị %s có chiều dài bằng không, và không thể chứa một hệ thống tập tin "
+"hay một bảng phân vùng. Có thể đã chọn sai thiết bị?"
+
+#: libparted/arch/linux.c:829
+msgid ""
+"Unable to determine geometry of file/device. You should not use Parted "
+"unless you REALLY know what you're doing!"
+msgstr ""
+"Không nhận ra cấu trúc hình học của tập tin/thiết bị. Không được sử dụng "
+"Parted trừ khi THỰC SỰ biết mình đang làm gì!"
+
+#: libparted/arch/linux.c:903
+msgid "DAC960 RAID controller"
+msgstr "Điều khiển DAC960 RAID controller"
+
+#: libparted/arch/linux.c:908
+msgid "Compaq Smart Array"
+msgstr "Dãy Thông minh của Compaq"
+
+#: libparted/arch/linux.c:913
+msgid "ATARAID Controller"
+msgstr "Điều khiển ATARAID Controller"
+
+#: libparted/arch/linux.c:918
+msgid "I2O Controller"
+msgstr "Điều khiển I2O Controller"
+
+#: libparted/arch/linux.c:923
+msgid "User-Mode Linux UBD"
+msgstr ""
+
+#: libparted/arch/linux.c:933
+msgid "Unknown"
+msgstr "Không rõ"
+
+#: libparted/arch/linux.c:940
+msgid "ped_device_new() Unsupported device type"
+msgstr "ped_device_new() Dạng thiết bị không hỗ trợ"
+
+#: libparted/arch/linux.c:1041 libparted/arch/gnu.c:264
+#, c-format
+msgid "Error opening %s: %s"
+msgstr "Lỗi mở %s: %s"
+
+#: libparted/arch/linux.c:1052 libparted/arch/gnu.c:274
+#, c-format
+msgid "Unable to open %s read-write (%s). %s has been opened read-only."
+msgstr "KHông mở được %s đọc-ghi (%s). Mở %s chỉ đọc."
+
+#: libparted/arch/linux.c:1160 libparted/arch/linux.c:1228
+#: libparted/arch/gnu.c:452 libparted/arch/gnu.c:550 libparted/arch/gnu.c:678
+#, c-format
+msgid "%s during read on %s"
+msgstr "%s khi đọc trên %s"
+
+#: libparted/arch/linux.c:1199
+#, c-format
+msgid "%s during seek for read on %s"
+msgstr "%s khi tìm để đọc trên %s"
+
+#: libparted/arch/linux.c:1270 libparted/arch/linux.c:1355
+#: libparted/arch/linux.c:1413 libparted/arch/gnu.c:587
+#: libparted/arch/gnu.c:632 libparted/arch/gnu.c:709
+#, c-format
+msgid "%s during write on %s"
+msgstr "%s khi ghi trên %s"
+
+#: libparted/arch/linux.c:1297 libparted/arch/gnu.c:512
+#, c-format
+msgid "Can't write to %s, because it is opened read-only."
+msgstr "Không ghi được tới %s, vì mở nó chỉ đọc."
+
+#: libparted/arch/linux.c:1321
+#, c-format
+msgid "%s during seek for write on %s"
+msgstr "%s khi tìm để ghi trên %s"
+
+#: libparted/arch/linux.c:1798
+#, fuzzy, c-format
+msgid ""
+"Error informing the kernel about modifications to partition %s -- %s. This "
+"means Linux won't know about any changes you made to %s until you reboot -- "
+"so you shouldn't mount it or use it in any way before rebooting."
+msgstr ""
+"Lỗi cung cấp cho nhân thông tin về sự sửa đổi phân vùng %s - %s. Có nghĩa "
+"là Linux sẽ không biết về những thay đổi đã tạo ra trên %s cho đến khi khởi "
+"động lại - vì thế không nên gắn hoặc sử dụng phân vùng này trước khi khởi "
+"động lại."
+
+#: libparted/arch/linux.c:1879
+#, fuzzy, c-format
+msgid ""
+"The kernel was unable to re-read the partition table on %s (%s). This means "
+"Linux won't know anything about the modifications you made until you "
+"reboot. You should reboot your computer before doing anything with %s."
+msgstr ""
+"Nhân không đọc lại được bảng phân vùng trên %s (%s). Có nghĩa là Linux sẽ "
+"không biết về những thay đổi đã tạo ra cho đến khi khởi động lại. Người "
+"dùng nên khởi động lại máy tính trước khi thao tác với %s."
+
+#: libparted/arch/gnu.c:97
+#, c-format
+msgid "Unable to open %s."
+msgstr "Không mở được %s."
+
+#: libparted/arch/gnu.c:117
+msgid "Unable to probe store."
+msgstr "Không thăm dò được kho chứa."
+
+#: libparted/arch/gnu.c:355
+#, fuzzy
+msgid ""
+"The partition table cannot be re-read. This means you need to reboot before "
+"mounting any modified partitions. You also need to reinstall your boot "
+"loader before you reboot (which may require mounting modified partitions). "
+"It is impossible do both things! So you'll need to boot off a rescue disk, "
+"and reinstall your boot loader from the rescue disk. Read section 4 of the "
+"Parted User documentation for more information."
+msgstr ""
+"Không đọc lại được bảng phân vùng, vì thế, cần khởi động lại trước khi gắn "
+"bất ký phân vùng đã sửa đổi nào. Người dùng cũng cần cài đặt lại trình khởi "
+"động của mình trước khi khởi động lại (thao tác này có thể yêu cầu gắn phân "
+"vùng đã sửa đổi). Không thể thực hiện cả hai thao tác! Vì thế người dùng "
+"sẽ cần khởi động bẳng đĩa mềm dự phòng, và cài đặt lại trình khởi động từ "
+"đó. Hãy đọc phần 4 của tài liệu Người dùng Parted để biết thêm chi tiết."
+
+#: libparted/arch/gnu.c:372
+#, fuzzy, c-format
+msgid ""
+"The partition table on %s cannot be re-read (%s). This means the Hurd knows "
+"nothing about any modifications you made. You should reboot your computer "
+"before doing anything with %s."
+msgstr ""
+"Bảng phân vùng trên %s (%s). Có nghĩa là Hurd không biết gì về những thay "
+"đổi đã tạo ra. Người dùng cần khởi động lại máy tính trước khi thực hiện "
+"bất kỳ thao tác nào với %s."
+
+#: libparted/arch/gnu.c:383 parted/parted.c:2215
+msgid ""
+"You should reinstall your boot loader before rebooting. Read section 4 of "
+"the Parted User documentation for more information."
+msgstr ""
+"Cần cài đặt lại trình khởi động trước khi khởi động lại. Hãy đọc phần 4 của "
+"tài liệu Người dùng Parted để biết thêm chi tiết."
+
+#: libparted/arch/gnu.c:774
+#, c-format
+msgid "%s trying to sync %s to disk"
+msgstr "%s đang cố đồng bộ sync %s lên đĩa"
+
+#: libparted/disk.c:183
+#, c-format
+msgid "Unable to open %s - unrecognised disk label."
+msgstr "Không mở được %s - nhãn đĩa không nhận ra."
+
+#: libparted/disk.c:452
+#, c-format
+msgid ""
+"This libparted doesn't have write support for %s. Perhaps it was compiled "
+"read-only."
+msgstr ""
+"Thư viện libparted này không hỗ trợ %s. Có thể đã biên dịch nó chỉ đọc."
+
+#: libparted/disk.c:579
+#, fuzzy, c-format
+msgid "Partition %d is %s, but the file system is %s."
+msgstr "Phân vùng %d %.3fMb, nhưng hệ thống tập tin là %.3fMb."
+
+#: libparted/disk.c:1056
+#, c-format
+msgid "%s disk labels do not support extended partitions."
+msgstr "Nhãn đĩa %s không hỗ trợ các phân vùng mở rộng."
+
+#: libparted/disk.c:1616
+#, c-format
+msgid "%s disk labels don't support logical or extended partitions."
+msgstr "Nhãn đĩa %s không hỗ trợ các phân vùng mở rộng hay lôgíc."
+
+#: libparted/disk.c:1629
+#, fuzzy
+msgid "Too many primary partitions."
+msgstr "Quá nhiều phân vùng chính"
+
+#: libparted/disk.c:1638
+#, c-format
+msgid ""
+"Can't add a logical partition to %s, because there is no extended partition."
+msgstr "Không thêm được phân vùng lôgíc vào %s, vì không có phân vùng mở rộng."
+
+#: libparted/disk.c:1662
+#, fuzzy, c-format
+msgid "Can't have more than one extended partition on %s."
+msgstr "Không thể có hơn một phân vùng mở rộng trên %s"
+
+#: libparted/disk.c:1672
+msgid "Can't have logical partitions outside of the extended partition."
+msgstr "Không thể có phân vùng lôgíc nằm ngoài phân vùng mở rộng."
+
+#: libparted/disk.c:1697
+#, c-format
+msgid "Can't have a logical partition outside of the extended partition on %s."
+msgstr "Không thể có phân vùng lôgíc nằm ngoài phân vùng mở rộng trên %s."
+
+#: libparted/disk.c:1707 libparted/disk.c:1761 libparted/disk.c:1927
+#, fuzzy
+msgid "Can't have overlapping partitions."
+msgstr "Không thể có phân vùng đè lên nhau"
+
+#: libparted/disk.c:1715
+msgid "Can't have a primary partition inside an extended partition."
+msgstr "Không thể có phân vùng chính nằm trong một phân vùng mở rộng."
+
+#: libparted/disk.c:2123
+msgid "metadata"
+msgstr "dữ liệu mêta"
+
+#: libparted/disk.c:2125
+msgid "free"
+msgstr "trống"
+
+#: libparted/disk.c:2127 parted/ui.c:968 parted/ui.c:996
+msgid "extended"
+msgstr "mởrộng"
+
+#: libparted/disk.c:2129 parted/ui.c:972 parted/ui.c:1000
+msgid "logical"
+msgstr "lôgíc"
+
+#: libparted/disk.c:2131 parted/ui.c:964 parted/ui.c:992
+msgid "primary"
+msgstr "chính"
+
+#: libparted/disk.c:2147
+msgid "boot"
+msgstr "kđộng"
+
+#: libparted/disk.c:2149
+msgid "root"
+msgstr "gốc"
+
+#: libparted/disk.c:2151
+msgid "swap"
+msgstr "swap"
+
+#: libparted/disk.c:2153
+msgid "hidden"
+msgstr "ẩn"
+
+#: libparted/disk.c:2155
+msgid "raid"
+msgstr "raid"
+
+#: libparted/disk.c:2157
+msgid "lvm"
+msgstr "lvm"
+
+#: libparted/disk.c:2159
+msgid "lba"
+msgstr "lba"
+
+#: libparted/disk.c:2161
+msgid "hp-service"
+msgstr "hp-dịchvụ"
+
+#: libparted/disk.c:2163
+msgid "palo"
+msgstr ""
+
+#: libparted/disk.c:2165
+msgid "prep"
+msgstr ""
+
+#: libparted/disk.c:2167
+msgid "msftres"
+msgstr ""
+
+#: libparted/disk.c:2173
+#, fuzzy, c-format
+msgid "Unknown partition flag, %d."
+msgstr "Không rõ cờ phân vùng, %d."
+
+#: libparted/labels/rdb.c:177
+#, c-format
+msgid "%s : Bad checksum on block %llu of type %s."
+msgstr ""
+
+#: libparted/labels/rdb.c:510
+#, c-format
+msgid "%s : Didn't find rdb block, should never happen."
+msgstr ""
+
+#: libparted/labels/rdb.c:595
+#, c-format
+msgid "%s : Loop detected at block %d."
+msgstr ""
+
+#: libparted/labels/rdb.c:614
+#, c-format
+msgid "%s : The %s list seems bad at block %s."
+msgstr ""
+
+#: libparted/labels/rdb.c:703
+#, c-format
+msgid "%s : Failed to list bad blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:711
+#, c-format
+msgid "%s : Failed to list partition blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:719
+#, c-format
+msgid "%s : Failed to list file system blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:727
+#, c-format
+msgid "%s : Failed to list boot blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:750
+#, c-format
+msgid "Failed to write partition block at %d."
+msgstr ""
+
+#: libparted/labels/rdb.c:1053 libparted/labels/bsd.c:505
+#: libparted/labels/dos.c:1942 libparted/labels/dvh.c:772
+#: libparted/labels/gpt.c:1365 libparted/labels/loop.c:251
+#: libparted/labels/mac.c:1318 libparted/labels/pc98.c:764
+#: libparted/labels/sun.c:704
+msgid "Unable to satisfy all constraints on the partition."
+msgstr "Không thể thoả mãn mọi sự bắt buộc trên phân vùng."
+
+#: libparted/labels/rdb.c:1081
+#, fuzzy
+msgid "Unable to allocate a partition number."
+msgstr "Mong đợi một số của phân vùng."
+
+#: libparted/labels/bsd.c:530
+#, fuzzy
+msgid "Unable to allocate a bsd disklabel slot."
+msgstr "Không phân phối được một rãnh nhãn đĩa bsd"
+
+#: libparted/labels/dos.c:812
+#, fuzzy, c-format
+msgid "Invalid partition table on %s -- wrong signature %x."
+msgstr "Bảng phân vùng sai trên %s - sai chữ ký %x"
+
+#: libparted/labels/dos.c:840
+#, c-format
+msgid "Invalid partition table - recursive partition on %s."
+msgstr "Bảng phân vùng sai - phân vùng đệ quy trên %s."
+
+#: libparted/labels/dos.c:1300
+msgid "Extended partitions cannot be hidden on msdos disk labels."
+msgstr ""
+
+#: libparted/labels/dos.c:1926
+msgid "Parted can't resize partitions managed by Windows Dynamic Disk."
+msgstr ""
+
+#: libparted/labels/dvh.c:192
+#, fuzzy, c-format
+msgid "%s has no extended partition (volume header partition)."
+msgstr ""
+"%s không có phân vùng mở rộng (phân vùng phần đầu của các volume). Nếu lờ "
+"đi, thì mọi volume khởi động sẽ bị xóa."
+
+#: libparted/labels/dvh.c:315
+msgid "Checksum is wrong, indicating the partition table is corrupt."
+msgstr "Tổng kiểm tra bị sai, chỉ ra bảng phân vùng bị hỏng."
+
+#: libparted/labels/dvh.c:616
+msgid "Only primary partitions can be root partitions."
+msgstr "Chỉ các phân vùng chính có thể là phân vùng gốc."
+
+#: libparted/labels/dvh.c:630
+msgid "Only primary partitions can be swap partitions."
+msgstr "Chỉ các phân vùng chính có thể là phân vùng swap."
+
+#: libparted/labels/dvh.c:644
+msgid "Only logical partitions can be a boot file."
+msgstr "Chỉ phân vùng lôgíc có thể là tập tin khởi động."
+
+#: libparted/labels/dvh.c:723
+msgid "Only logical partitions (boot files) have a name."
+msgstr "Chỉ phân vùng lôgíc (tập tin khởi động) có một tên."
+
+#: libparted/labels/dvh.c:814
+msgid "Too many primary partitions"
+msgstr "Quá nhiều phân vùng chính"
+
+#: libparted/labels/gpt.c:433
+#, fuzzy, c-format
+msgid ""
+"%s contains GPT signatures, indicating that it has a GPT table. However, it "
+"does not have a valid fake msdos partition table, as it should. Perhaps it "
+"was corrupted -- possibly by a program that doesn't understand GPT partition "
+"tables. Or perhaps you deleted the GPT table, and are now using an msdos "
+"partition table. Is this a GPT partition table?"
+msgstr ""
+"%s chứa chữ ký GPT, chỉ ra nó có bảng GPT. Tuy nhiên, nó không có một bảng "
+"phân vùng giả msdos cần thiết. Có thể nó đã bị làm hỏng bởi một chương "
+"trình không hiểu bảng phân vùng GPT. Hoặc có thể người dùng đã xóa bảng "
+"GPT, và bây giờ đang sử dụng một bảng phân vùng msdos. Đây có phải là một "
+"bảng phân vùng GPT?"
+
+#: libparted/labels/gpt.c:625
+#, c-format
+msgid ""
+"The format of the GPT partition table is version %x, which is newer than "
+"what Parted can recognise. Please tell us! bug-parted@gnu.org"
+msgstr ""
+"Định dạng của bảng phân vùng GPT có phiên bản %x, mới hơn so với phiên bản "
+"Parted có thể nhận ra. Xin hãy cho chúng tôi biết! bug-parted@gnu.org"
+
+#: libparted/labels/gpt.c:747
+msgid ""
+"The backup GPT table is not at the end of the disk, as it should be. This "
+"might mean that another operating system believes the disk is smaller. Fix, "
+"by moving the backup to the end (and removing the old backup)?"
+msgstr ""
+"Bảng GPT sao lưu không nằm tại cuối đĩa như yêu cầu. Có nghĩa là hệ điều "
+"hành khác sẽ thấy đĩa nhỏ hơn thông thường. Sửa bằng cách di chuyển sao lưu "
+"tới cuối (và xóa bỏ sao lưu cũ)?"
+
+#: libparted/labels/gpt.c:782
+#, fuzzy
+msgid ""
+"The primary GPT table is corrupt, but the backup appears OK, so that will be "
+"used."
+msgstr ""
+"Bảng GPT chính bị hỏng, nhưng sao lưu thì vẫn tốt, vì thế sẽ sử dụng sao lưu."
+
+#: libparted/labels/gpt.c:790
+#, fuzzy
+msgid ""
+"Both the primary and backup GPT tables are corrupt. Try making a fresh "
+"table, and using Parted's rescue feature to recover partitions."
+msgstr ""
+"Cả bảng GPT chính và sao lưu đều hỏng. Hãy thử tạo một bảng mới, và sử dụng "
+"tính năng cứu nguy của Parted, để phục hồi các phân vùng."
+
+#: libparted/labels/mac.c:167
+#, c-format
+msgid "Invalid signature %x for Mac disk labels."
+msgstr "Chữ ký sai %x cho nhãn đĩa Mac."
+
+#: libparted/labels/mac.c:212
+msgid "Partition map has no partition map entry!"
+msgstr "Sơ đồ phân vùng không có mục sơ đồ phân vùng!"
+
+#: libparted/labels/mac.c:259
+#, c-format
+msgid "%s is too small for a Mac disk label!"
+msgstr "%s quá nhỏ cho một nhãn đĩa Mac!"
+
+#: libparted/labels/mac.c:490
+#, c-format
+msgid "Partition %d has an invalid signature %x."
+msgstr "Phân vùng %d có một chữ ký sai %x."
+
+#: libparted/labels/mac.c:508
+#, c-format
+msgid "Partition %d has an invalid length of 0 bytes!"
+msgstr "Phân vùng %d có một chiều dài sai 0 byte!"
+
+#: libparted/labels/mac.c:536
+#, fuzzy
+msgid "The data region doesn't start at the start of the partition."
+msgstr "Vùng dữ liệu không bắt đầu tại đầu của phân vùng"
+
+#: libparted/labels/mac.c:553
+#, fuzzy
+msgid "The boot region doesn't start at the start of the partition."
+msgstr "Vùng khởi động không bắt đầu tại đầu của phân vùng"
+
+#: libparted/labels/mac.c:567
+msgid "The partition's boot region doesn't occupy the entire partition."
+msgstr "Vùng khởi động của phân vùng không chiếm toàn bộ phân vùng."
+
+#: libparted/labels/mac.c:577
+msgid "The partition's data region doesn't occupy the entire partition."
+msgstr "Vùng dữ liệu của phân vùng không chiếm toàn bộ phân vùng."
+
+#: libparted/labels/mac.c:631
+#, c-format
+msgid ""
+"Weird block size on device descriptor: %d bytes is not divisible by 512."
+msgstr ""
+"Kích thước khối kỳ lạ trên mô tả thiết bị: %d byte không chia hết cho 512."
+
+#: libparted/labels/mac.c:644
+#, c-format
+msgid ""
+"The driver descriptor says the physical block size is %d bytes, but Linux "
+"says it is %d bytes."
+msgstr ""
+"Mô tả của ổ cho biết kích thước khối là %d byte, nhưng Linux nói nó %d byte."
+
+#: libparted/labels/mac.c:692
+msgid "No valid partition map found."
+msgstr "Không tìm thấy một sơ đồ phân vùng đúng."
+
+#: libparted/labels/mac.c:744
+#, fuzzy, c-format
+msgid ""
+"Conflicting partition map entry sizes! Entry 1 says it is %d, but entry %d "
+"says it is %d!"
+msgstr ""
+"Xung đột kích thước mục sơ đồ phân vùng! Mục 1 nói là %d, nhưng mục %d nói "
+"là %d!"
+
+#: libparted/labels/mac.c:771
+#, fuzzy
+msgid "Weird! There are 2 partitions map entries!"
+msgstr "Kỳ lạ - hai mục sơ đồ phân vùng!"
+
+#: libparted/labels/mac.c:1257
+msgid ""
+"Changing the name of a root or swap partition will prevent Linux from "
+"recognising it as such."
+msgstr ""
+"Thay đổi tên của một phân vùng gốc hay swap sẽ khiến Linux không nhận ra "
+"chúng như trước."
+
+#: libparted/labels/mac.c:1353
+#, fuzzy
+msgid "Can't add another partition -- the partition map is too small!"
+msgstr "Không thêm được phân vùng khác - sơ đồ phân quá nhỏ!"
+
+#: libparted/labels/pc98.c:357
+#, fuzzy, c-format
+msgid "Invalid partition table on %s."
+msgstr "Bảng phân vùng sai trên %s"
+
+#: libparted/labels/pc98.c:409 libparted/labels/pc98.c:487
+#, fuzzy, c-format
+msgid ""
+"Partition %d isn't aligned to cylinder boundaries. This is still "
+"unsupported."
+msgstr ""
+"Phân vùng %d chưa sắp hàng tới khung cylinder. Cần thêm hỗ trợ cho tính "
+"năng này."
+
+#: libparted/labels/pc98.c:796
+msgid "Can't add another partition."
+msgstr "Không thêm được phân vùng khác."
+
+#: libparted/labels/sun.c:143
+msgid "Corrupted Sun disk label detected."
+msgstr "Nhận ra một nhãn đĩa Sun bị hỏng."
+
+#: libparted/labels/sun.c:264
+#, fuzzy, c-format
+msgid ""
+"The disk CHS geometry (%d,%d,%d) reported by the operating system does not "
+"match the geometry stored on the disk label (%d,%d,%d)."
+msgstr ""
+"Cấu trúc CHS của đĩa (%d,%d,%d) không tương ứng cấu trúc chứa trong nhãn đĩa "
+"(%d,%d,%d)."
+
+#: libparted/labels/sun.c:286
+#, c-format
+msgid "The disk label describes a disk bigger than %s."
+msgstr "Nhãn đĩa mô tả một đĩa lớn hơn %s."
+
+#: libparted/labels/sun.c:440
+#, c-format
+msgid "The disk has %d cylinders, which is greater than the maximum of 65536."
+msgstr ""
+
+#: libparted/labels/sun.c:736
+msgid ""
+"The Whole Disk partition is the only available one left. Generally, it is "
+"not a good idea to overwrite this partition with a real one. Solaris may "
+"not be able to boot without it, and SILO (the sparc boot loader) appreciates "
+"it as well."
+msgstr ""
+"Phân vùng Toàn bộ Đĩa Whole Disk là phân vùng còn lại duy nhất. Nói chung, "
+"không nên ghi chèn phân vùng này bằng một phân vùng thực sự. Solaris có thể "
+"sẽ không khởi động khi không có nó, và SILO (trình khởi động sparc) cũng cần "
+"phân vùng này."
+
+#: libparted/labels/sun.c:751
+msgid "Sun disk label is full."
+msgstr "Nhãn đĩa Sun đầy."
+
+#: libparted/filesys.c:386
+msgid "Could not detect file system."
+msgstr "Không nhận ra hệ thống tập tin."
+
+#: libparted/filesys.c:397
+#, fuzzy
+msgid "The file system is bigger than its volume!"
+msgstr "Hệ thống tập tin lớn hơn volume của nó!"
+
+#: libparted/filesys.c:405
+#, c-format
+msgid "Support for opening %s file systems is not implemented yet."
+msgstr "Hỗ trợ mở %s hệ thống tập tin còn chưa được phát triển."
+
+#: libparted/filesys.c:447
+#, c-format
+msgid "Support for creating %s file systems is not implemented yet."
+msgstr "Hỗ trợ tạo %s hệ thống tập tin còn chưa được phát triển."
+
+#: libparted/filesys.c:508
+#, c-format
+msgid "Support for checking %s file systems is not implemented yet."
+msgstr "Hỗ trợ kiểm tra %s hệ thống tập tin còn chưa được phát triển."
+
+#: libparted/filesys.c:574
+msgid "raw block copying"
+msgstr "sao chép các khối thô sơ"
+
+#: libparted/filesys.c:585
+msgid "growing file system"
+msgstr "đang tăng hệ thống tập tin"
+
+#: libparted/filesys.c:625
+msgid "Can't copy onto an overlapping partition."
+msgstr "Không sao chép được tới một phân vùng chèn lên nhau."
+
+#: libparted/filesys.c:647
+#, fuzzy, c-format
+msgid ""
+"Direct support for copying file systems is not yet implemented for %s. "
+"However, support for resizing is implemented. Therefore, the file system "
+"can be copied if the new partition is at least as big as the old one. So, "
+"either shrink the partition you are trying to copy, or copy to a bigger "
+"partition."
+msgstr ""
+"Hỗ trợ thẳng để sao chép hệ thống tập tin chưa được phát triển cho %s. Tuy "
+"nhiên, đã có hỗ trợ thay đổi kích thước. Vì thế, có thể sao chép hệ thống "
+"tập tin nếu phân vùng mới có kích thước không nhỏ hơn phân vùng cũ. Vì vậy, "
+"hoặc rút ngắn phân vùng cần sao chép, hoặc sao chép tới một phân vùng lớn "
+"hơn."
+
+#: libparted/filesys.c:661
+#, c-format
+msgid "Support for copying %s file systems is not implemented yet."
+msgstr "Hỗ trợ sao chép chép %s hệ thống tập tin chưa được phát triển."
+
+#: libparted/filesys.c:699
+#, c-format
+msgid "Support for resizing %s file systems is not implemented yet."
+msgstr "Hỗ trợ thay đổi kích thước %s hệ thống tập tin chưa được phát triển."
+
+#: libparted/exception.c:78
+msgid "Information"
+msgstr "Thông tin"
+
+#: libparted/exception.c:79
+msgid "Warning"
+msgstr "Cảnh báo"
+
+#: libparted/exception.c:80
+msgid "Error"
+msgstr "Lỗi"
+
+#: libparted/exception.c:81
+msgid "Fatal"
+msgstr "Lỗi nặng"
+
+#: libparted/exception.c:82
+msgid "Bug"
+msgstr "Lỗi bug"
+
+#: libparted/exception.c:83
+msgid "No Implementation"
+msgstr "Chưa phát triển"
+
+#: libparted/exception.c:87
+msgid "Fix"
+msgstr "Sửa"
+
+#: libparted/exception.c:88
+msgid "Yes"
+msgstr "Có"
+
+#: libparted/exception.c:89
+msgid "No"
+msgstr "Không"
+
+#: libparted/exception.c:90
+msgid "OK"
+msgstr "Được"
+
+#: libparted/exception.c:91
+msgid "Retry"
+msgstr "Thử lại"
+
+#: libparted/exception.c:92
+msgid "Ignore"
+msgstr "Lờ đi"
+
+#: libparted/exception.c:93
+msgid "Cancel"
+msgstr "Dừng"
+
+#: libparted/exception.c:133
+#, fuzzy, c-format
+msgid ""
+"A bug has been detected in GNU Parted. Refer to the web site of parted "
+"http://www.gnu.org/software/parted/parted.html for more informations of what "
+"could be useful for bug submitting! Please email a bug report to bug-"
+"parted@gnu.org containing at least the version (%s) and the following "
+"message: "
+msgstr ""
+"Phát hiện ra một lỗi bug trong GNU parted. Xin hãy gửi email thông báo tới "
+"bug-parted@gnu.org kèm theo phiên bản (%s) và thông tin sau:"
+
+#: libparted/cs/geom.c:162
+msgid "Can't have the end before the start!"
+msgstr "Không thể có kết thúc đứng trước bắt đầu!"
+
+#: libparted/cs/geom.c:169
+msgid "Can't have a partition outside the disk!"
+msgstr "Không thể có phân vùng nằm ngoài ổ đĩa!"
+
+#: libparted/cs/geom.c:303
+#, fuzzy, c-format
+msgid "Attempt to read sectors %ld-%ld outside of partition on %s."
+msgstr "Cố đọc các sector %ld-%ld nằm ngoài phân vùng trên %s"
+
+#: libparted/cs/geom.c:373
+#, fuzzy, c-format
+msgid "Attempt to write sectors %ld-%ld outside of partition on %s."
+msgstr "Cố ghi các sector %ld-%ld nằm ngoài phân vùng trên %s"
+
+#: libparted/cs/geom.c:413 libparted/fs/linux_swap/linux_swap.c:353
+msgid "checking for bad blocks"
+msgstr "đang kiểm tra các khối xấu"
+
+#: libparted/libparted.c:286 libparted/libparted.c:306
+msgid "Out of memory."
+msgstr "Không đủ bộ nhớ."
+
+#: libparted/unit.c:139
+msgid "Cannot get unit size for special unit 'COMPACT'."
+msgstr ""
+
+#: libparted/unit.c:382
+#, c-format
+msgid "\"%s\" has invalid syntax for locations."
+msgstr ""
+
+#: libparted/unit.c:390
+#, c-format
+msgid "The maximum head value is %d."
+msgstr ""
+
+#: libparted/unit.c:397
+#, c-format
+msgid "The maximum sector value is %d."
+msgstr ""
+
+#: libparted/unit.c:409 libparted/unit.c:540
+#, c-format
+msgid "The location %s is outside of the device %s."
+msgstr ""
+
+#: libparted/unit.c:522
+msgid "Invalid number."
+msgstr ""
+
+#: libparted/fs/ext2/ext2.c:87 libparted/fs/ext2/ext2.c:112
+msgid "Inconsistent group descriptors!"
+msgstr "Các mô tả nhóm đã thay đổi!"
+
+#: libparted/fs/ext2/ext2.c:91 libparted/fs/ext2/ext2.c:116
+#, fuzzy
+msgid "File system full!"
+msgstr "Đầy hệ thống tập tin!"
+
+#: libparted/fs/ext2/ext2.c:750
+#, fuzzy
+msgid "Invalid superblock. Are you sure this is an ext2 file system?"
+msgstr "Khối super sai. Đây chắc chắn là hệ thống tập tin ext2?"
+
+#: libparted/fs/ext2/ext2.c:764 libparted/fs/ext2/ext2_resize.c:597
+#, fuzzy
+msgid "File system has errors! You should run e2fsck."
+msgstr "Hệ thống tập tin có lỗi! Cần chạy e2fsck."
+
+#: libparted/fs/ext2/ext2.c:775
+#, fuzzy
+msgid ""
+"File system was not cleanly unmounted! You should run e2fsck. Modifying an "
+"unclean file system could cause severe corruption."
+msgstr ""
+"Hệ thống tập tin chưa được bỏ gắn một cách đúng đắn! Cần chạy e2fsck. Sửa "
+"đổi hệ thống tin đó có thể gây một vài lỗi."
+
+#: libparted/fs/ext2/ext2.c:795
+#, fuzzy
+msgid "File system has an incompatible feature enabled."
+msgstr "Hệ thống tập tin có tính năng không tương thích được bật"
+
+#: libparted/fs/ext2/ext2.c:806
+msgid "Error allocating buffer cache."
+msgstr "Lỗi phân phối cache bộ đệm."
+
+#: libparted/fs/ext2/ext2.c:848
+msgid ""
+"A resize operation on this file system will use EXPERIMENTAL code that MAY "
+"CORRUPT it (although it hasn't done so yet).You should at least backup your "
+"data and run 'e2fsck -f' afterwards."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:114
+#, fuzzy
+msgid ""
+"Found an inode with a incorrect link count. Better go run e2fsck first!"
+msgstr ""
+"Tìm thấy một inode với số đếm liên kết sai. Tốt nhất hãy chạy e2fsck trước."
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:487
+msgid "Not enough free inodes!"
+msgstr "Không đủ inode trống!"
+
+#: libparted/fs/ext2/ext2_resize.c:224
+#, fuzzy
+msgid "File system is too full to remove a group!"
+msgstr "Hệ thống tập tin không còn đủ chỗ để xóa bỏ một nhóm!"
+
+#: libparted/fs/ext2/ext2_resize.c:233
+#, fuzzy
+msgid "File system has too many allocated inodes to remove a group!"
+msgstr "Hệ thống tập tin có quá nhiều inode phân phối để xóa một nhóm!"
+
+#: libparted/fs/ext2/ext2_resize.c:493
+msgid "adding groups"
+msgstr "thêm nhóm"
+
+#: libparted/fs/ext2/ext2_resize.c:530
+#, fuzzy, c-format
+msgid "Your file system is too full to resize it to %i blocks. Sorry."
+msgstr ""
+"Hệ thống tập tin không còn đủ trống để thay đổi kích thước thành %i khối. "
+"Rất tiếc."
+
+#: libparted/fs/ext2/ext2_resize.c:540
+#, fuzzy, c-format
+msgid ""
+"Your file system has too many occupied inodes to resize it to %i blocks. "
+"Sorry."
+msgstr ""
+"Hệ thống tập tin không còn đủ inode để thay đổi kích thước thành %i khối. "
+"Rất tiếc."
+
+#: libparted/fs/ext2/ext2_resize.c:554 libparted/fs/hfs/hfs.c:243
+#: libparted/fs/hfs/hfs.c:624
+msgid "shrinking"
+msgstr "đang rút ngắn"
+
+#: libparted/fs/ext2/ext2_resize.c:605
+#, fuzzy
+msgid "File system was not cleanly unmounted! You should run e2fsck."
+msgstr "Hệ thống tập tin chưa được bỏ gắn đúng! Cần chạy e2fsck."
+
+#: libparted/fs/ext2/ext2_resize.c:614
+msgid ""
+"The file system has the 'dir_index' feature enabled. Parted can only resize "
+"the file system if it disables this feature. You can enable it later by "
+"running 'tune2fs -O dir_index DEVICE' and then 'e2fsck -fD DEVICE'."
+msgstr ""
+"Hệ thống tập tin có tính năng 'dir_index' bật dùng. Parted chỉ có thể thay "
+"đổi kích thước của hệ thống tập tin nếu tắt bỏ tính năng này. Có thể bật "
+"dùng lại tính năng sau này bằng 'tune2fs -O dir_index THIẾTBỊ' và sau đó "
+"'e2fsck -fD THIẾTBỊ'."
+
+#: libparted/fs/ext2/ext2_block_relocator.c:198
+#, fuzzy
+msgid "Cross-linked blocks found! Better go run e2fsck first!"
+msgstr "Tìm thấy các khối liên kết chồng chéo! tốt nhất hãy chạy e2fsck trước!"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:537
+#, fuzzy, c-format
+msgid "Block %i has no reference? Weird."
+msgstr "Khối %i không có liên kết? Kỳ lạ"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:738
+#, c-format
+msgid "Block %i shouldn't have been marked!"
+msgstr "Không được đánh dấu khối %i!"
+
+#: libparted/fs/ext2/interface.c:188
+#, fuzzy
+msgid ""
+"The ext2 file system passed a basic check. For a more comprehensive check, "
+"use the e2fsck program."
+msgstr ""
+"Hệ thống tập tin ext2 đã qua kiểm tra cơ bản. Để kiểm tra kỹ hơn, hãy dùng "
+"chương trình e2fsck."
+
+#: libparted/fs/ext2/interface.c:205
+msgid "Sorry, can't move the start of ext2 partitions yet!"
+msgstr "Rất tiếc, tạm thời chưa thể di chuyển đầu của phân vùng ext2!"
+
+#: libparted/fs/ext2/ext2_buffer.c:82
+msgid "Couldn't flush buffer cache!"
+msgstr "Không san bằng được cache bộ đệm!"
+
+#: libparted/fs/ext2/ext2_mkfs.c:162
+msgid "writing per-group metadata"
+msgstr "đang ghi dữ liệu mêta của mỗi nhóm"
+
+#: libparted/fs/ext2/ext2_mkfs.c:565
+msgid "File system too small for ext2."
+msgstr "Hệ thống tập tin quá nhỏ cho ext2."
+
+#: libparted/fs/fat/calc.c:134
+#, fuzzy, c-format
+msgid ""
+"You need %s of free disk space to shrink this partition to this size. "
+"Currently, only %s is free."
+msgstr ""
+"Người dùng cần %dM không gian trống để rút ngắn phân vùng tới kích thước này "
+"(hiện thời chỉ có %dM trống)"
+
+#: libparted/fs/fat/context.c:55
+#, c-format
+msgid ""
+"Cluster start delta = %d, which is not a multiple of the cluster size %d."
+msgstr ""
+"Delta bắt đầu cluster = %d, và không phải là bộ số của kích thước cluster %d."
+
+#: libparted/fs/fat/fat.c:312
+#, fuzzy, c-format
+msgid "Partition too big/small for a %s file system."
+msgstr "Phân vùng quá lớn/nhỏ cho một hệ thống tập tin %s"
+
+#: libparted/fs/fat/fat.c:478
+msgid ""
+"The FATs don't match. If you don't know what this means, then select "
+"cancel, run scandisk on the file system, and then come back."
+msgstr ""
+"Các FAT không tương ứng. Nếu không biết ý nghĩa của nó, thì hãy chọn cancel "
+"(dừng), chạy scandisk trên hệ thống tập tin, sau đó quay lại."
+
+#: libparted/fs/fat/fat.c:518
+msgid "There are no possible configurations for this FAT type."
+msgstr "Không có cấu hình có thể cho dạng FAT này."
+
+#: libparted/fs/fat/fat.c:530
+#, c-format
+msgid ""
+"File system doesn't have expected sizes for Windows to like it. Cluster "
+"size is %dk (%dk expected); number of clusters is %d (%d expected); size of "
+"FATs is %d sectors (%d expected)."
+msgstr ""
+"Hệ thống tập tin không có kích thước Windows mong đợi. Kích thước cluster "
+"là %dk (mong đợi %dk); số cluster là %d (mong đợi %d); kích thước FAT là %d "
+"sector (mong đợi %d)."
+
+#: libparted/fs/fat/fat.c:553
+#, c-format
+msgid ""
+"File system is reporting the free space as %d clusters, not %d clusters."
+msgstr ""
+"Hệ thống tập tin cho biết không gian trống là %d cluster, không phải %d."
+
+#: libparted/fs/fat/fat.c:878
+#, fuzzy
+msgid ""
+"GNU Parted was miscompiled: the FAT boot sector should be 512 bytes. FAT "
+"support will be disabled."
+msgstr ""
+"Đã biên dịch sai GNU parted: sector khởi động FAT phải là 512 byte. Hỗ trợ "
+"FAT sẽ bị tắt bỏ."
+
+#: libparted/fs/fat/resize.c:158
+#, fuzzy
+msgid ""
+"There's not enough room in the root directory for all of the files. Either "
+"cancel, or ignore to lose the files."
+msgstr ""
+"Không đủ chỗ trống trong thư mục gốc, cho tất cả các tập tin. Hoặc dừng "
+"(cancel), hoặc lờ đi (ignore) và sẽ mất các tập tin."
+
+#: libparted/fs/fat/resize.c:299
+msgid "Error writing to the root directory."
+msgstr "Lỗi ghi tới thư mục gốc."
+
+#: libparted/fs/fat/resize.c:484
+#, fuzzy
+msgid "If you leave your file system as FAT16, then you will have no problems."
+msgstr "Nếu để hệ thống tập tin là FAT16, thì sẽ không có vấn đề gì."
+
+#: libparted/fs/fat/resize.c:487
+msgid ""
+"If you convert to FAT16, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual)."
+msgstr ""
+"Nếu chuyển thành FAT16, và cài đặt MS Windows trên phân vùng này, thì sẽ "
+"phải cài đặt lại trình khởi động của MS Windows. Nếu muốn thực hiện, thì "
+"cần xem tài liệu người dùng của Parted (hoặc tài liệu của nhà phân phối)."
+
+#: libparted/fs/fat/resize.c:495
+msgid ""
+"If you leave your file system as FAT32, then you will not introduce any new "
+"problems."
+msgstr "Nếu dể hệ thống là FAT32, thì sẽ không có vấn đề mới nào xảy ra."
+
+#: libparted/fs/fat/resize.c:499
+msgid ""
+"If you convert to FAT32, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual). Also, "
+"converting to FAT32 will make the file system unreadable by MS DOS, MS "
+"Windows 95a, and MS Windows NT."
+msgstr ""
+"Nếu chuyển thành FAT32, và cài đặt MS Windows trên phân vùng này, thì sẽ "
+"phải cài đặt lại trình khởi động của MS Windows. Nếu muốn thực hiện, thì "
+"cần xem tài liệu người dùng của Parted (hoặc tài liệu của nhà phân phối). "
+"Đồng thời, chuyển thành FAT32 sẽ khiến MS DOS, MS Windows 95a, và MS Windows "
+"NT không đọc được chúng."
+
+#: libparted/fs/fat/resize.c:513
+#, c-format
+msgid "%s %s %s"
+msgstr "%s %s %s"
+
+#: libparted/fs/fat/resize.c:514
+msgid "Would you like to use FAT32?"
+msgstr "Ngài muốn dùng FAT32?"
+
+#: libparted/fs/fat/resize.c:541 libparted/fs/fat/resize.c:557
+#, c-format
+msgid "%s %s"
+msgstr "%s %s"
+
+#: libparted/fs/fat/resize.c:542
+msgid ""
+"The file system can only be resized to this size by converting to FAT16."
+msgstr ""
+"Chỉ thay đổi được kích thước của hệ thống tập tin thành kích thước này khi "
+"chuyển thành FAT16."
+
+#: libparted/fs/fat/resize.c:558
+msgid ""
+"The file system can only be resized to this size by converting to FAT32."
+msgstr ""
+"Chỉ thay đổi được kích thước của hệ thống tập tin thành kích thước này khi "
+"chuyển thành FAT32."
+
+#: libparted/fs/fat/resize.c:571
+#, fuzzy
+msgid ""
+"GNU Parted cannot resize this partition to this size. We're working on it!"
+msgstr ""
+"GNU Parted không thay đổi được kích thước của phân vùng này thành kích thước "
+"chỉ ra. Chúng tôi đang thực hiện việc đó!"
+
+#: libparted/fs/fat/bootsector.c:48 libparted/fs/fat/bootsector.c:55
+msgid "File system has an invalid signature for a FAT file system."
+msgstr "Hệ thống tập tin có chữ ký hệ thống tập tin FAT sai."
+
+#: libparted/fs/fat/bootsector.c:62
+msgid "File system has an invalid sector size for a FAT file system."
+msgstr "Hệ thống tập tin có kích thước sector sai cho hệ thống tập tin FAT."
+
+#: libparted/fs/fat/bootsector.c:69
+msgid "File system has an invalid cluster size for a FAT file system."
+msgstr "Hệ thống tập tin có kích thước cluster sai cho hệ thống tập tin FAT."
+
+#: libparted/fs/fat/bootsector.c:76
+#, fuzzy
+msgid ""
+"File system has an invalid number of reserved sectors for a FAT file system."
+msgstr "Hệ thống tập tin có số sector dự trữ sai cho hệ thống tập tin FAT."
+
+#: libparted/fs/fat/bootsector.c:83
+#, fuzzy
+msgid "File system has an invalid number of FATs."
+msgstr "Hệ thống tập tin có số hệ thống tập tin FAT sai."
+
+#: libparted/fs/fat/bootsector.c:138
+#, c-format
+msgid ""
+"This file system has a logical sector size of %d. GNU Parted is known not "
+"to work properly with sector sizes other than 512 bytes."
+msgstr ""
+"Hệ thống tập tin có kích thước sector lôgíc là %d. GNU Parted không làm "
+"việc chính xác với kích thước sector khác 512 byte."
+
+#: libparted/fs/fat/bootsector.c:163
+#, c-format
+msgid ""
+"The file system's CHS geometry is (%d, %d, %d), which is invalid. The "
+"partition table's CHS geometry is (%d, %d, %d). If you select Ignore, the "
+"file system's CHS geometry will be left unchanged. If you select Fix, the "
+"file system's CHS geometry will be set to match the partition table's CHS "
+"geometry."
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:209
+msgid "FAT boot sector says logical sector size is 0. This is weird. "
+msgstr "Sector khởi động FAT nói kích thước sector lôgíc là 0. Kỳ lạ. "
+
+#: libparted/fs/fat/bootsector.c:215
+msgid "FAT boot sector says there are no FAT tables. This is weird. "
+msgstr "Sector khởi động FAT nói không có bảng FAT. Kỳ lạ. "
+
+#: libparted/fs/fat/bootsector.c:221
+msgid "FAT boot sector says clusters are 0 sectors. This is weird. "
+msgstr "Sector khởi động FAT nói các cluster là các sector 0. Kỳ lạ. "
+
+#: libparted/fs/fat/bootsector.c:231
+#, fuzzy
+msgid "File system is FAT12, which is unsupported."
+msgstr "Hệ thống tập tin là FAT12, và không được hỗ trợ."
+
+#: libparted/fs/fat/bootsector.c:407
+#, c-format
+msgid ""
+"The information sector has the wrong signature (%x). Select cancel for now, "
+"and send in a bug report. If you're desperate, it's probably safe to ignore."
+msgstr ""
+"Sector thông tin có chữ ký sai (%x). Hãy chọn dừng (cancel), và gửi một báo "
+"cáo lỗi bug. Nếu liều lĩnh, thì có thể lờ đi."
+
+#: libparted/fs/fat/count.c:149
+#, c-format
+msgid "Bad directory entry for %s: first cluster is the end of file marker."
+msgstr "Mục thư mục xấu cho %s: cluster đầu tiên là cuối của đánh dấu tập tin."
+
+#: libparted/fs/fat/count.c:162
+#, c-format
+msgid ""
+"Bad FAT: unterminated chain for %s. You should run dosfsck or scandisk."
+msgstr "FAT Xấu: chuỗi không kết thúc cho %s. Cần chạy dosfsck hoặc scandisk."
+
+#: libparted/fs/fat/count.c:171
+#, fuzzy, c-format
+msgid ""
+"Bad FAT: cluster %d outside file system in chain for %s. You should run "
+"dosfsck or scandisk."
+msgstr ""
+"FAT Xấu: cluster %d ngoài hệ thống tập tin trong chuỗi cho %s. Cần chạy "
+"dosfsck hoặc scandisk."
+
+#: libparted/fs/fat/count.c:181
+#, c-format
+msgid ""
+"Bad FAT: cluster %d is cross-linked for %s. You should run dosfsck or "
+"scandisk."
+msgstr ""
+"FAT Xấu: cluster %d là liên kết chồng chéo cho %s. Cần chạy dosfsck hoặc "
+"scandisk."
+
+#: libparted/fs/fat/count.c:200
+#, c-format
+msgid "%s is %dk, but it has %d clusters (%dk)."
+msgstr "%s là %dk, nhưng nó có %d cluster (%dk)."
+
+#: libparted/fs/fat/count.c:263
+#, c-format
+msgid ""
+"The file %s is marked as a system file. This means moving it could cause "
+"some programs to stop working."
+msgstr ""
+"Tập tin %s có dấu hiệu của tập tin hệ thống. Có nghĩa di chuyển tập tin này "
+"có thể khiến một số chương trình dừng làm việc."
+
+#: libparted/fs/fat/table.c:138
+#, c-format
+msgid ""
+"FAT %d media %x doesn't match the boot sector's media %x. You should "
+"probably run scandisk."
+msgstr ""
+"FAT %d thiết bị %x không tương ứng thiết bị sector khởi động %x. Có thể cần "
+"chạy scandisk."
+
+#: libparted/fs/fat/table.c:268
+#, fuzzy, c-format
+msgid "fat_table_set: cluster %ld outside file system"
+msgstr "fat_table_set: cluster %ld ngoài hệ thống tập tin"
+
+#: libparted/fs/fat/table.c:296
+#, fuzzy, c-format
+msgid "fat_table_get: cluster %ld outside file system"
+msgstr "fat_table_get: cluster %ld ngoài hệ thống tập tin"
+
+#: libparted/fs/fat/table.c:334
+msgid "fat_table_alloc_cluster: no free clusters"
+msgstr "fat_table_alloc_cluster: không còn cluster trống"
+
+#: libparted/fs/linux_swap/linux_swap.c:236
+#, c-format
+msgid "Unrecognised linux swap signature '%10s'."
+msgstr "Chữ ký linux swap không nhận ra '%10s'."
+
+#: libparted/fs/linux_swap/linux_swap.c:312
+msgid "Too many bad pages."
+msgstr "Quá nhiều trang xấu."
+
+#: libparted/fs/hfs/advfs.c:123 libparted/fs/hfs/advfs_plus.c:125
+#: libparted/fs/hfs/reloc.c:416 libparted/fs/hfs/reloc.c:510
+#: libparted/fs/hfs/reloc_plus.c:541 libparted/fs/hfs/reloc_plus.c:660
+#: libparted/fs/hfs/reloc_plus.c:774
+msgid "The file system contains errors."
+msgstr ""
+
+#: libparted/fs/hfs/advfs_plus.c:290
+msgid "Bad blocks could not be read."
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:139
+#, c-format
+msgid ""
+"Trying to register an extent starting at block 0x%X, but another one already "
+"exists at this position. You should check the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:216
+#, c-format
+msgid ""
+"Trying to move an extent from block Ox%X to block Ox%X, but another one "
+"already exists at this position. This should not happen!"
+msgstr ""
+
+#: libparted/fs/hfs/file.c:145
+#, c-format
+msgid "Could not update the extent cache for HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:182
+#, c-format
+msgid "Trying to read HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:192 libparted/fs/hfs/file.c:222
+#, c-format
+msgid "Could not find sector %lli of HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:212
+#, c-format
+msgid "Trying to write HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:159
+#, c-format
+msgid "Could not update the extent cache for HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:203
+#, c-format
+msgid "Trying to read HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:214 libparted/fs/hfs/file_plus.c:256
+#, c-format
+msgid "Could not find sector %lli of HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:245
+#, c-format
+msgid "Trying to write HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:225
+msgid "Sorry, HFS cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:255 libparted/fs/hfs/hfs.c:636
+msgid "Data relocation has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:274
+msgid "Data relocation left some data in the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:313
+#, fuzzy
+msgid "writing HFS Master Directory Block"
+msgstr "Lỗi ghi tới thư mục gốc."
+
+#: libparted/fs/hfs/hfs.c:461
+msgid "No valid HFS[+X] signature has been found while opening."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:471
+#, c-format
+msgid "Version %d of HFS+ isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:482
+#, c-format
+msgid "Version %d of HFSX isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:667
+msgid "Data relocation left some data at the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:715
+#, fuzzy
+msgid "Error while writing the allocation file."
+msgstr "Lỗi ghi tới thư mục gốc."
+
+#: libparted/fs/hfs/hfs.c:730
+msgid "Error while writing the compatibility part of the allocation file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:745
+msgid "writing HFS+ Volume Header"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:845
+msgid "An error occurred while looking for the mandatory bad blocks file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:899
+msgid ""
+"It seems there is an error in the HFS wrapper: the bad blocks file doesn't "
+"contain the embedded HFS+ volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:930
+msgid "Sorry, HFS+ cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:965
+msgid "shrinking embedded HFS+ volume"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:981
+msgid "Resizing the HFS+ volume has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:988
+#, fuzzy
+msgid "shrinking HFS wrapper"
+msgstr "đang rút ngắn"
+
+#: libparted/fs/hfs/hfs.c:997
+msgid "Updating the HFS wrapper has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:1099 libparted/fs/hfs/hfs.c:1184
+#, c-format
+msgid ""
+"This is not a real %s check. This is going to extract special low level "
+"files for debugging purposes."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:156
+msgid "Bad block list header checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:169
+#, c-format
+msgid ""
+"Invalid size of a transaction block while replaying the journal (%i bytes)."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:261
+msgid ""
+"Journal stored outside of the volume are not supported. Try to desactivate "
+"the journal and run Parted again."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:272
+#, fuzzy
+msgid "Journal offset or size is not multiple of the sector size."
+msgstr ""
+"Delta bắt đầu cluster = %d, và không phải là bộ số của kích thước cluster %d."
+
+#: libparted/fs/hfs/journal.c:290
+msgid "Incorrect magic values in the journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:299
+msgid "Journal size mismatch between journal info block and journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:311
+#, fuzzy
+msgid "Some header fields are not multiple of the sector size."
+msgstr ""
+"Delta bắt đầu cluster = %d, và không phải là bộ số của kích thước cluster %d."
+
+#: libparted/fs/hfs/journal.c:320
+msgid ""
+"The sector size stored in the journal is not 512 bytes. Parted only "
+"supports 512 bytes length sectors."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:332
+msgid "Bad journal checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:350
+msgid ""
+"The journal is not empty. Parted must replay the transactions before "
+"opening the file system. This will modify the file system."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:378
+msgid ""
+"The volume header or the master directory block has changed while replaying "
+"the journal. You should restart Parted."
+msgstr ""
+
+#: libparted/fs/hfs/probe.c:52
+#, c-format
+msgid ""
+"Parted can't use HFS file systems on disks with a sector size not equal to %"
+"d bytes."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:153 libparted/fs/hfs/reloc_plus.c:157
+msgid "An extent has not been relocated."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:253 libparted/fs/hfs/reloc_plus.c:309
+msgid ""
+"A reference to an extent comes from a place it should not. You should check "
+"the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:383
+msgid "This HFS volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:477
+msgid "This HFS volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:519 libparted/fs/hfs/reloc_plus.c:670
+msgid ""
+"The extents overflow file should not contain its own extents! You should "
+"check the file system."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:576 libparted/fs/hfs/reloc_plus.c:849
+#, fuzzy
+msgid "Could not cache the file system in memory."
+msgstr "Không nhận ra hệ thống tập tin."
+
+#: libparted/fs/hfs/reloc.c:637 libparted/fs/hfs/reloc_plus.c:910
+msgid "Bad blocks list could not be loaded."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:651 libparted/fs/hfs/reloc_plus.c:926
+msgid "An error occurred during extent relocation."
+msgstr ""
+
+#: libparted/fs/hfs/reloc_plus.c:497
+msgid "This HFS+ volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc_plus.c:621
+msgid "This HFS+ volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: parted/parted.c:76
+msgid "displays this help message"
+msgstr "hiển thị trợ giúp này"
+
+#: parted/parted.c:77
+msgid "where necessary, prompts for user intervention"
+msgstr "khi cần thiết, hỏi người dùng thao tác cần làm"
+
+#: parted/parted.c:78
+msgid "never prompts for user intervention"
+msgstr "không bao giờ hỏi người dùng"
+
+#: parted/parted.c:79
+msgid "displays the version"
+msgstr "hiển thị phiên bản"
+
+#: parted/parted.c:87
+#, fuzzy
+msgid ""
+"NUMBER is the partition number used by Linux. On MS-DOS disk labels, the "
+"primary partitions number from 1 to 4, logical partitions from 5 onwards.\n"
+msgstr ""
+"MINOR (NHỎ) là số của phân vùng sử dụng bởi Linux. Trên nhãn đĩa msdos, các "
+"phân vùng chính có số từ 1 đến 4, và phân vùng lôgíc từ 5 trở đi.\n"
+
+#: parted/parted.c:90
+msgid "LABEL-TYPE is one of: "
+msgstr "LABEL-TYPE là một trong số: "
+
+#: parted/parted.c:91
+msgid "FLAG is one of: "
+msgstr "FLAG là một trong số: "
+
+#: parted/parted.c:92
+#, fuzzy
+msgid "UNIT is one of: "
+msgstr "FLAG là một trong số: "
+
+#: parted/parted.c:93
+msgid "PART-TYPE is one of: primary, logical, extended\n"
+msgstr "PART-TYPE là một trong số: primary, logical, extended\n"
+
+#: parted/parted.c:95
+msgid "FS-TYPE is one of: "
+msgstr "FS-TYPE là một trong số: "
+
+#: parted/parted.c:96
+#, fuzzy
+msgid ""
+"START and END are disk locations, such as 4GB or 10%. Negative values count "
+"from the end of the disk. For example, -1s specifies exactly the last "
+"sector.\n"
+msgstr "START và END tính theo mêga byte. Giá trị âm đếm từ cuối đĩa.\n"
+
+#: parted/parted.c:99
+msgid "STATE is one of: on, off\n"
+msgstr "STATE là một trong số: on, off\n"
+
+#: parted/parted.c:100
+msgid "DEVICE is usually /dev/hda or /dev/sda\n"
+msgstr "DEVICE thông thường là /dev/hda hay /dev/sda\n"
+
+#: parted/parted.c:101
+msgid "NAME is any word you want\n"
+msgstr "NAME là bất kỳ từ gì theo ý muốn\n"
+
+#: parted/parted.c:102
+msgid "The partition must have one of the following FS-TYPEs: "
+msgstr ""
+
+#: parted/parted.c:105
+msgid "GNU Parted Version information:\n"
+msgstr ""
+
+#: parted/parted.c:107
+#, fuzzy
+msgid ""
+"Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n"
+"This program is free software, covered by the GNU General Public License.\n"
+"\n"
+"This program is distributed in the hope that it will be useful, but WITHOUT "
+"ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
+"FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
+"more details.\n"
+"\n"
+msgstr ""
+"Đăng ký bản quyền (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software "
+"Foundation, Inc.\n"
+"Chương trình này là một phầm mềm miễn phí, theo bản quyền GNU General Public "
+"License.\n"
+"\n"
+"Chương trình này được phát hành với hy vọng rằng nó sẽ trở nên hữu ích, "
+"nhưng nó KHÔNG KÈM THEO BẤT KỲ SỰ BẢO ĐẢM NÀO, ngay cả những đảm bảo ngầm "
+"hiểu về việc THƯƠNG MẠI HÓA hay PHẢI PHÙ HỢP VỚI MỘT MỤC ĐÍCH CỤ THỂ NÀO. "
+"Hãy tham khảo giấy phép GNU General Public License để biết thêm chi tiết.\n"
+"\n"
+
+#: parted/parted.c:152
+#, c-format
+msgid "%0.f%%\t(time left %.2d:%.2d)"
+msgstr "%0.f%%\t(còn lại %.2d:%.2d)"
+
+#: parted/parted.c:170
+#, c-format
+msgid ""
+"Partition %s is being used. You must unmount it before you modify it with "
+"Parted."
+msgstr ""
+
+#: parted/parted.c:187
+#, c-format
+msgid "Partition(s) on %s are being used."
+msgstr "(Các) phân vùng trên %s đang được dùng."
+
+#: parted/parted.c:413 parted/parted.c:594 parted/parted.c:979
+#: parted/parted.c:1059 parted/parted.c:1586 parted/parted.c:1663
+#: parted/parted.c:1707
+msgid "Partition number?"
+msgstr "Số của phân vùng?"
+
+#: parted/parted.c:456
+msgid "Source device?"
+msgstr "Thiết bị nguồn?"
+
+#: parted/parted.c:460
+msgid "Source partition number?"
+msgstr "Số của phân vùng của nguồn?"
+
+#: parted/parted.c:465
+#, fuzzy
+msgid "Can't copy an extended partition."
+msgstr "Không sao chép được phân vùng mở rộng."
+
+#: parted/parted.c:471
+msgid "Destination partition number?"
+msgstr "Số của phân vùng của đích?"
+
+#: parted/parted.c:564
+msgid "New disk label type?"
+msgstr "Dạng nhãn đĩa mới?"
+
+#: parted/parted.c:598
+msgid "File system?"
+msgstr "Hệ thống tập tin?"
+
+#: parted/parted.c:645 parted/parted.c:815
+msgid "Partition type?"
+msgstr "Dạng phân vùng?"
+
+#: parted/parted.c:652 parted/parted.c:822 parted/parted.c:1062
+msgid "Partition name?"
+msgstr "Tên phân vùng?"
+
+#: parted/parted.c:660 parted/parted.c:832
+msgid "File system type?"
+msgstr "Dạng hệ thống tập tin?"
+
+#: parted/parted.c:667 parted/parted.c:834 parted/parted.c:994
+#: parted/parted.c:1544 parted/parted.c:1595
+msgid "Start?"
+msgstr "Đầu?"
+
+#: parted/parted.c:669 parted/parted.c:837 parted/parted.c:997
+#: parted/parted.c:1546 parted/parted.c:1597
+msgid "End?"
+msgstr "Cuối?"
+
+#: parted/parted.c:707 parted/parted.c:875
+#, fuzzy, c-format
+msgid ""
+"You requested a partition from %s to %s.\n"
+"The closest location we can manage is %s to %s. Is this still acceptable to "
+"you?"
+msgstr ""
+"Người dùng đã yêu cầu di chuyển một phân vùng tới %.3f-%.3fMb. Vùng gần nhất "
+"Parted có thể quản lý là %.3f-%.3fMb."
+
+#: parted/parted.c:827
+#, fuzzy
+msgid "An extended partition cannot hold a file system. Did you want mkpart?"
+msgstr "Phân vùng mở rộng không thể có hệ thống tập tin. Bạn muốn mkpart?"
+
+#: parted/parted.c:985
+#, fuzzy
+msgid "Can't move an extended partition."
+msgstr "Không thể di chuyển các phân vùng mở rộng."
+
+#: parted/parted.c:1014
+msgid "Can't move a partition onto itself. Try using resize, perhaps?"
+msgstr ""
+"Không thể di chuyển một phân vùng lên chính nó. Có thể, hãy thử thay đổi "
+"kích thước?"
+
+#: parted/parted.c:1158
+#, c-format
+msgid "Minor: %d\n"
+msgstr "Số nhỏ: %d\n"
+
+#: parted/parted.c:1159
+#, fuzzy, c-format
+msgid "Flags: %s\n"
+msgstr "Cờ: "
+
+#: parted/parted.c:1160
+#, c-format
+msgid "File System: %s\n"
+msgstr "Hệ thống tập tin: %s\n"
+
+#: parted/parted.c:1161
+#, fuzzy, c-format
+msgid "Size: "
+msgstr "Kíchthước: %10.3fMb (%d%%)\n"
+
+#: parted/parted.c:1166
+#, fuzzy, c-format
+msgid "Minimum size: "
+msgstr "Kích thước nhỏ nhất: %10.3fMb (%d%%)\n"
+
+#: parted/parted.c:1169
+#, fuzzy, c-format
+msgid "Maximum size: "
+msgstr "Kích thước lớn nhất: %10.3fMb (%d%%)\n"
+
+#: parted/parted.c:1255
+#, fuzzy, c-format
+msgid "Disk %s: %s\n"
+msgstr "%s %s %s"
+
+#: parted/parted.c:1256
+#, c-format
+msgid "Sector size (logical/physical): %lldB/%lldB\n"
+msgstr ""
+
+#: parted/parted.c:1267
+#, c-format
+msgid "BIOS cylinder,head,sector geometry: %d,%d,%d. Each cylinder is %s.\n"
+msgstr ""
+
+#: parted/parted.c:1273
+#, fuzzy, c-format
+msgid "Partition Table: %s\n"
+msgstr "Tên phân vùng?"
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Number"
+msgstr ""
+
+#: parted/parted.c:1284 parted/parted.c:1287
+#, fuzzy
+msgid "Start"
+msgstr "Đầu?"
+
+#: parted/parted.c:1285 parted/parted.c:1288
+#, fuzzy
+msgid "End"
+msgstr "Cuối?"
+
+#: parted/parted.c:1288
+#, fuzzy
+msgid "Size"
+msgstr "resize"
+
+#: parted/parted.c:1292
+msgid "Type"
+msgstr ""
+
+#: parted/parted.c:1294
+#, fuzzy
+msgid "File system"
+msgstr "Hệ thống tập tin?"
+
+#: parted/parted.c:1297
+#, fuzzy
+msgid "Name"
+msgstr "name"
+
+#: parted/parted.c:1299
+msgid "Flags"
+msgstr "Cờ"
+
+#: parted/parted.c:1352
+msgid "Free Space"
+msgstr ""
+
+#: parted/parted.c:1441
+#, fuzzy, c-format
+msgid ""
+"A %s %s partition was found at %s -> %s. Do you want to add it to the "
+"partition table?"
+msgstr ""
+"Tìm thấy một phân vùng %s %s tại %.3fMb -> %.3fMb. Thêm nó vào bảng phân "
+"vùng?"
+
+#: parted/parted.c:1479
+msgid "searching for file systems"
+msgstr "tìm kiếm hệ thống tập tin"
+
+#: parted/parted.c:1684
+msgid "New device?"
+msgstr "Thiết bị mới?"
+
+#: parted/parted.c:1709
+#, fuzzy
+msgid "Flag to Invert?"
+msgstr "Cờ để thay đổi?"
+
+#: parted/parted.c:1714
+msgid "New state?"
+msgstr "Trạng thái mới?"
+
+#: parted/parted.c:1747
+msgid "Unit?"
+msgstr ""
+
+#: parted/parted.c:1896
+msgid "check"
+msgstr "check"
+
+#: parted/parted.c:1899
+#, fuzzy
+msgid ""
+"check NUMBER do a simple check on the file system"
+msgstr ""
+"check MINOR thực hiện một kiểm tra đơn giản trên hệ thống "
+"tập tin"
+
+#: parted/parted.c:1905
+msgid "cp"
+msgstr "cp"
+
+#: parted/parted.c:1908
+#, fuzzy
+msgid ""
+"cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another "
+"partition"
+msgstr ""
+"cp [FROM-DEVICE] FROM-MINOR TO-MINOR sao chép hệ thống tập tin tới phân "
+"vùng khác"
+
+#: parted/parted.c:1914
+msgid "help"
+msgstr "help"
+
+#: parted/parted.c:1917
+#, fuzzy
+msgid ""
+"help [COMMAND] prints general help, or help on "
+"COMMAND"
+msgstr ""
+"help [COMMAND] in trợ giúp chung, hoặc trợ giúp trên câu lệnh "
+"COMMAND"
+
+#: parted/parted.c:1923
+msgid "mklabel"
+msgstr "mklabel"
+
+#: parted/parted.c:1926
+#, fuzzy
+msgid ""
+"mklabel LABEL-TYPE create a new disklabel (partition "
+"table)"
+msgstr "mklabel LABEL-TYPE tạo một nhãn đĩa mới (bảng phân vùng)"
+
+#: parted/parted.c:1932
+msgid "mkfs"
+msgstr "mkfs"
+
+#: parted/parted.c:1935
+#, fuzzy
+msgid ""
+"mkfs NUMBER FS-TYPE make a FS-TYPE file system on "
+"partititon NUMBER"
+msgstr ""
+"mkfs MINOR FS-TYPE tạo một hệ thống tập tin dạng FS-TYPE trên "
+"phân vùng MINOR"
+
+#: parted/parted.c:1941
+msgid "mkpart"
+msgstr "mkpart"
+
+#: parted/parted.c:1944
+#, fuzzy
+msgid "mkpart PART-TYPE [FS-TYPE] START END make a partition"
+msgstr "mkpart PART-TYPE [FS-TYPE] START END tạo một phân vùng"
+
+#: parted/parted.c:1950
+msgid ""
+"mkpart makes a partition without creating a new file system on the "
+"partition. FS-TYPE may be specified to set an appropriate partition ID.\n"
+msgstr ""
+"mkpart tạo một phân vùng và không tạo một hệ thống tập tin mới trên phân "
+"vùng đó. Có thể chỉ ra FS-TYPE để đặt một ID phân vùng thích hợp.\n"
+
+#: parted/parted.c:1955
+msgid "mkpartfs"
+msgstr "mkpartfs"
+
+#: parted/parted.c:1958
+#, fuzzy
+msgid ""
+"mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system"
+msgstr ""
+"mkpartfs PART-TYPE FS-TYPE START END tạo một phân vùng với một hệ thống "
+"tập tin"
+
+#: parted/parted.c:1964
+msgid "move"
+msgstr "move"
+
+#: parted/parted.c:1967
+#, fuzzy
+msgid "move NUMBER START END move partition NUMBER"
+msgstr "move MINOR START END di chuyển phân vùng MINOR"
+
+#: parted/parted.c:1972
+msgid "name"
+msgstr "name"
+
+#: parted/parted.c:1975
+#, fuzzy
+msgid "name NUMBER NAME name partition NUMBER as NAME"
+msgstr "name MINOR NAME đặt tên phân vùng MINOR bằng tên NAME"
+
+#: parted/parted.c:1980
+msgid "print"
+msgstr "print"
+
+#: parted/parted.c:1983
+#, fuzzy
+msgid ""
+"print [free|NUMBER|all] display the partition table, a "
+"partition, or all devices"
+msgstr ""
+"print [MINOR] hiển thị bảng phân vùng, hoặc một phân vùng"
+
+#: parted/parted.c:1987
+#, fuzzy
+msgid ""
+"Without arguments, print displays the entire partition table. With 'free'\n"
+"argument, information about free space will be displayed otherwise if a\n"
+"partition number is given, then more detailed information is displayed\n"
+"about that partition. If the 'all' argument is passed instead, partition\n"
+"information for all devices will be displayed."
+msgstr ""
+"Khi không có tham số, print hiển thị toàn bộ bảng phân vùng. Nếu đưa\n"
+"ra số của bảng phân vùng, thì hiển thị thông tin chi tiết hơn về phân vùng\n"
+"đó.\n"
+
+#: parted/parted.c:1995
+msgid "quit"
+msgstr "quit"
+
+#: parted/parted.c:1998
+#, fuzzy
+msgid "quit exit program"
+msgstr "quit thoát khỏi chương trình"
+
+#: parted/parted.c:2003
+msgid "rescue"
+msgstr "rescue"
+
+#: parted/parted.c:2006
+#, fuzzy
+msgid ""
+"rescue START END rescue a lost partition near START "
+"and END"
+msgstr ""
+"rescue START END phục hồi một phân vùng đã mất cạnh đầu START "
+"và cuối END"
+
+#: parted/parted.c:2012
+msgid "resize"
+msgstr "resize"
+
+#: parted/parted.c:2015
+#, fuzzy
+msgid ""
+"resize NUMBER START END resize partition NUMBER and its "
+"file system"
+msgstr ""
+"resize MINOR START END thay đổi kích thước hệ thống tập tin trên phân "
+"vùng MINOR"
+
+#: parted/parted.c:2023
+msgid "rm"
+msgstr "rm"
+
+#: parted/parted.c:2026
+#, fuzzy
+msgid "rm NUMBER delete partition NUMBER"
+msgstr "rm MINOR xóa bỏ phân vùng MINOR"
+
+#: parted/parted.c:2031
+msgid "select"
+msgstr "select"
+
+#: parted/parted.c:2034
+#, fuzzy
+msgid "select DEVICE choose the device to edit"
+msgstr "select DEVICE chọn thiết bị để thực hiện"
+
+#: parted/parted.c:2039
+msgid "set"
+msgstr "set"
+
+#: parted/parted.c:2042
+#, fuzzy
+msgid ""
+"set NUMBER FLAG STATE change the FLAG on partition NUMBER"
+msgstr "rm MINOR xóa bỏ phân vùng MINOR"
+
+#: parted/parted.c:2048
+msgid "toggle"
+msgstr ""
+
+#: parted/parted.c:2051
+#, fuzzy
+msgid ""
+"toggle [NUMBER [FLAG]] toggle the state of FLAG on "
+"partition NUMBER"
+msgstr "rm MINOR xóa bỏ phân vùng MINOR"
+
+#: parted/parted.c:2057
+#, fuzzy
+msgid "unit"
+msgstr "quit"
+
+#: parted/parted.c:2060
+#, fuzzy
+msgid "unit UNIT set the default unit to UNIT"
+msgstr "quit thoát khỏi chương trình"
+
+#: parted/parted.c:2065
+msgid "version"
+msgstr ""
+
+#: parted/parted.c:2068
+msgid ""
+"version displays the current version of GNU "
+"Parted and copyright information"
+msgstr ""
+
+#: parted/parted.c:2072
+msgid ""
+"version displays copyright and version information corressponding to this "
+"copy of GNU Parted\n"
+msgstr ""
+
+#: parted/parted.c:2158
+msgid "No device found"
+msgstr "Không tìm thấy thiết bị nào"
+
+#: parted/parted.c:2222
+msgid "Don't forget to update /etc/fstab, if necessary.\n"
+msgstr "Đừng quên cập nhật /etc/fstab, nếu cần thiết.\n"
+
+#: parted/ui.c:68
+msgid "Welcome to GNU Parted! Type 'help' to view a list of commands.\n"
+msgstr ""
+
+#: parted/ui.c:71
+#, fuzzy
+msgid ""
+"Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]\n"
+"Apply COMMANDs with PARAMETERS to DEVICE. If no COMMAND(s) are given, run "
+"in\n"
+"interactive mode.\n"
+msgstr ""
+"Sử dụng: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]\n"
+"Áp dụng các câu lệnh COMMAND với các tham số PARAMETERS tới thiết bị "
+"DEVICE. Nếu\n"
+"không có câu lệnh COMMAND nào chạy trong chế độ hỏi đáp.\n"
+
+#: parted/ui.c:76
+#, c-format
+msgid ""
+"\n"
+"\n"
+"You found a bug in GNU Parted! Here's what you have to do:\n"
+"\n"
+"Don't panic! The bug has most likely not affected any of your data.\n"
+"Help us to fix this bug by doing the following:\n"
+"\n"
+"Check whether the bug has already been fixed by checking\n"
+"the last version of GNU Parted that you can find at:\n"
+"\n"
+"\thttp://ftp.gnu.org/gnu/parted/\n"
+"\n"
+"Please check this version prior to bug reporting.\n"
+"\n"
+"If this has not been fixed yet or if you don't know how to check,\n"
+"please visit the GNU Parted website:\n"
+"\n"
+"\thttp://www.gnu.org/software/parted\n"
+"\n"
+"for further information.\n"
+"\n"
+"Your report should contain the version of this release (%s)\n"
+"along with the error message below, the output of\n"
+"\n"
+"\tparted DEVICE unit co print unit s print\n"
+"\n"
+"and additional information about your setup you consider important.\n"
+msgstr ""
+
+#: parted/ui.c:230
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_MAPERR (Address not mapped to object)"
+msgstr ""
+
+#: parted/ui.c:235
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_ACCERR (Invalid permissions for mapped object)"
+msgstr ""
+
+#: parted/ui.c:240
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGSEGV signal was encountered."
+msgstr ""
+
+#: parted/ui.c:258
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTDIV (Integer: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:262
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTOVF (Integer: overflow)"
+msgstr ""
+
+#: parted/ui.c:266
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTDIV (Float: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:270
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTOVF (Float: overflow)"
+msgstr ""
+
+#: parted/ui.c:274
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTUND (Float: underflow)"
+msgstr ""
+
+#: parted/ui.c:278
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTRES (Float: inexact result)"
+msgstr ""
+
+#: parted/ui.c:282
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTINV (Float: invalid operation)"
+msgstr ""
+
+#: parted/ui.c:286
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTSUB (Float: subscript out of range)"
+msgstr ""
+
+#: parted/ui.c:291
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGFPE signal was encountered."
+msgstr ""
+
+#: parted/ui.c:310
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPC (Illegal Opcode)"
+msgstr ""
+
+#: parted/ui.c:314
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPN (Illegal Operand)"
+msgstr ""
+
+#: parted/ui.c:318
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLADR (Illegal addressing mode)"
+msgstr ""
+
+#: parted/ui.c:323
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLTRP (Illegal Trap)"
+msgstr ""
+
+#: parted/ui.c:327
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVOPC (Privileged Opcode)"
+msgstr ""
+
+#: parted/ui.c:331
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVREG (Privileged Register)"
+msgstr ""
+
+#: parted/ui.c:335
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_COPROC (Coprocessor Error)"
+msgstr ""
+
+#: parted/ui.c:339
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_BADSTK (Internal Stack Error)"
+msgstr ""
+
+#: parted/ui.c:343
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGILL signal was encountered."
+msgstr ""
+
+#: parted/ui.c:828
+msgid "Expecting a partition number."
+msgstr "Mong đợi một số của phân vùng."
+
+#: parted/ui.c:837
+msgid "Partition doesn't exist."
+msgstr "Phân vùng không tồn tại."
+
+#: parted/ui.c:857
+msgid "Expecting a file system type."
+msgstr "Mong đợi một dạng hệ thống tập tin."
+
+#: parted/ui.c:863
+#, c-format
+msgid "Unknown file system type \"%s\"."
+msgstr "Dạng hệ thống tập tin không rõ \"%s\"."
+
+#: parted/ui.c:883
+msgid "Expecting a disk label type."
+msgstr "Mong đợi một dạng nhãn đĩa."
+
+#: parted/ui.c:977
+msgid "Can't create any more partitions."
+msgstr "Không tạo được thêm phân vùng nữa."
+
+#: parted/ui.c:987
+msgid "Expecting a partition type."
+msgstr "Mong đợi một dạng phân vùng."
+
+#: parted/ui.c:1115
+msgid "on"
+msgstr "bật"
+
+#: parted/ui.c:1116
+msgid "off"
+msgstr "tắt"
+
+#: parted/ui.c:1227
+msgid "OPTIONs:"
+msgstr "TÙY CHỌN:"
+
+#: parted/ui.c:1230
+msgid "COMMANDs:"
+msgstr "CÂU LỆNH:"
+
+#: parted/ui.c:1238
+#, c-format
+msgid "Using %s\n"
+msgstr "Sử dụng %s\n"
+
+#, fuzzy
+#~ msgid ""
+#~ "This ext2 file system has a rather strange layout! Parted can't resize "
+#~ "this (yet)."
+#~ msgstr ""
+#~ "Hệ thống tập tin ext2 này có bố trí lạ! Parted (tạm thời) không thể thay "
+#~ "đổi kích thước."
+
+#~ msgid "IDE"
+#~ msgstr "IDE"
+
+#, fuzzy
+#~ msgid "Disk geometry for %s: %s - %s\n"
+#~ msgstr "Cấu trúc hình học cho %s: 0.000-%.3f mêga byte\n"
+
+#~ msgid "Disk label type: %s\n"
+#~ msgstr "Dạng nhãn đĩa: %s\n"
+
+#, fuzzy
+#~ msgid "set NUMBER FLAG STATE change a flag on partition NUMBER"
+#~ msgstr "set MINOR FLAG STATE thay đổi cờ trên phân vùng MINOR"
+
+#, fuzzy
+#~ msgid ""
+#~ "The sector size on %s is %d bytes. Parted is known not to work properly "
+#~ "with drives with sector sizes other than %d bytes."
+#~ msgstr ""
+#~ "Kích thước sector trên %s là %d byte. Parted không làm việc chính xác "
+#~ "được với các ổ có kích thước sector không phải %d byte"
+
+#~ msgid ""
+#~ "You found a bug in GNU Parted. Please email a bug report to bug-"
+#~ "parted@gnu.org containing the version (%s), and the following message:\n"
+#~ msgstr ""
+#~ "Bạn tìm thấy một lỗi bug trong GNU Parted. Xin hãy gửi email báo cáo lỗi "
+#~ "tới bug-parted@gnu.org kèm theo phiên bản (%s), và thông báo sau:\n"
+
+#, fuzzy
+#~ msgid ""
+#~ "You requested to create a partition at %s - %s. The closest Parted can "
+#~ "manage is %s - %s."
+#~ msgstr ""
+#~ "Người dùng đã yêu cầu tạo một phân vùng tại %.3f-%.3fMb. Vùng gần nhất "
+#~ "Parted có thể quản lý là %.3f-%.3fMb."
+
+#, fuzzy
+#~ msgid ""
+#~ "You requested to resize the partition to %s - %s. The closest Parted can "
+#~ "manage is %s - %s."
+#~ msgstr ""
+#~ "Người dùng đã yêu cầu thay đổi kích thước một phân vùng thành %.3f-"
+#~ "%.3fMb. Vùng gần nhất Parted có thể quản lý là %.3f-%.3fMb."
+
+#~ msgid "Could not read geometry of %s - %s."
+#~ msgstr "Không đọc được cấu trúc hình học của %s - %s."
+
+#~ msgid "Device %s has dodgey geometry."
+#~ msgstr "Thiết bị %s có cấu trúc hình học khó hiểu."
+
+#~ msgid "SCSI"
+#~ msgstr "SCSI"
+
+#~ msgid "Device %s is neither a SCSI nor IDE drive."
+#~ msgstr "Thiết bị %s không phải là một ổ SCSI hay IDE."
+
+#~ msgid "Error reading %s (%s) to determine if partition is mounted."
+#~ msgstr "Lỗi đọc %s (%s) để xem đã gắn phân vùng hay chưa."
+
+#~ msgid ""
+#~ "Unable to determine if partitions are mounted via /proc/mounts or /etc/"
+#~ "mtab. Make sure you don't attempt to resize or modify mounted file "
+#~ "systems. (Even read-only mounted)"
+#~ msgstr ""
+#~ "Không nhận ra được các phân vùng đã gắn qua /proc/mounts hay /etc/ mtab "
+#~ "hay chưa. Cần kiểm tra lại để chắc chắn là không thay đổi kích thước hay "
+#~ "sửa đổi của hệ thống tập tin đã gắn. (Thậm chí cả khi gắn chỉ đọc)"
+
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. However, the most likely reason is that Linux "
+#~ "detected the BIOS geometry for %s incorrectly. GNU Parted suspects the "
+#~ "real geometry should be %d/%d/%d (not %d/%d/%d). You should check with "
+#~ "your BIOS first, as this may not be correct. You can inform Linux by "
+#~ "adding the parameter %s=%d,%d,%d to the command line. See the LILO or "
+#~ "GRUB documentation for more information. If you think Parted's suggested "
+#~ "geometry is correct, you may select Ignore to continue (and fix Linux "
+#~ "later). Otherwise, select Cancel (and fix Linux and/or the BIOS now)."
+#~ msgstr ""
+#~ "Bảng phân vùng trên %s đã thay đổi. Có nhiều nguyên nhân của sự thay đổi "
+#~ "này. Tuy nhiên, nguyên nhân có khả năng cao nhất là Linux đã nhận ra cấu "
+#~ "trúc hình học của BIOS cho %s bị sai. GNU Parted cho rẳng cấu trúc thực "
+#~ "sự phải là %d/%d/%d (không phải %d/%d/%d). Người dùng cần kiểm tra BIOS "
+#~ "của mình trước. Có thể gửi tới Linux bằng tham số %s=%d,%d,%d trên dòng "
+#~ "lệnh. Hãy xem tài liệu của LILO hay GRUB để biết thêm thông tin. Nếu "
+#~ "người dùng cho rằng cấu trúc Parted đã đề nghị là sai, thì có thể chọn "
+#~ "Ignore (lờ đi) để tiếp tục (và sau đó sửa Linux). Nếu không, hãy chọn "
+#~ "Cancel (Đóng) và sửa Linux và/hoặc BIOS ngay bây giờ."
+
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. Often, the reason is that Linux detected the "
+#~ "BIOS geometry incorrectly. However, this does not appear to be the case "
+#~ "here. It is safe to ignore,but ignoring may cause (fixable) problems "
+#~ "with some boot loaders, and may cause problems with FAT file systems. "
+#~ "Using LBA is recommended."
+#~ msgstr ""
+#~ "Bảng phân vùng trên %s đã thay đổi. Có nhiều nguyên nhân của sự thay đổi "
+#~ "này. Thông thường, nguyên nhân là Linux đã nhận ra cấu trúc hình học của "
+#~ "BIOS bị sai. Tuy nhiên, đây không phải là trường hợp như vậy. Có thể lờ "
+#~ "đi, nhưng lờ đi có thể gây ra vấn đề (có thể sửa) với một số trình khởi "
+#~ "động, và tạo vấn đề với các hệ thống tập tin FAT. Nên sử dụng LBA."
+
+#~ msgid ""
+#~ "Unable to align partition properly. This probably means that another "
+#~ "partitioning tool generated an incorrect partition table, because it "
+#~ "didn't have the correct BIOS geometry. It is safe to ignore,but ignoring "
+#~ "may cause (fixable) problems with some boot loaders."
+#~ msgstr ""
+#~ "Không sắp hàng đúng được các phân vùng. Có thể một công cụ phân khác đã "
+#~ "tạo ra một bảng phân vùng sai, vì nó không có cấu trúc đúng của BIOS. Có "
+#~ "thể lờ đi, nhưng lờ đi có thể sẽ gây vấn đề (có thể sửa) với một số trình "
+#~ "khởi động."
+
+#~ msgid "File system has an invalid signature for a FAT file systems."
+#~ msgstr "Hệ thống tập tin có chữ ký hệ thống tập tin FAT sai."
+
+#~ msgid ""
+#~ "Partition %s is being used. Modifying it while it is in use could cause "
+#~ "severe corruption."
+#~ msgstr "Phân vùng %s đang được dùng. Sửa đổi nó bây giờ có thể gây hỏng."
+
+#~ msgid "Minor Start End "
+#~ msgstr "Sốnhỏ Đầu Cuối "
+
+#~ msgid "Type "
+#~ msgstr "Dạng "
+
+#~ msgid "Filesystem "
+#~ msgstr "Httậptin "
+
+#~ msgid "Name "
+#~ msgstr "Tên "
+
+#~ msgid ""
+#~ " You have Windows FAT partition(s) that are not using LBA. If your BIOS "
+#~ "supports LBA, then you should switch to LBA by setting the LBA flag on "
+#~ "all FAT partitions. Otherwise, make sure the operating system and the "
+#~ "BIOS have the same geometry before resizing any FAT partitions."
+#~ msgstr ""
+#~ " Người dùng có các phân vùng FAT của Windows không sử dụng LBA. Nếu "
+#~ "BIOS hỗ trợ LBA, thì cần chuyển tới LBA bằng thiết lập cờ LBA trên tất cả "
+#~ "các phân vùng FAT. Nếu không, cần chắc là hệ điều hành và BIOS có cùng "
+#~ "cấu trúc hình học của đĩa trước khi thay đổi kích thước bất kỳ phân vùng "
+#~ "FAT nào."
+
+#~ msgid ""
+#~ "The operating system thinks the geometry on %s is %d/%d/%d. Therefore, "
+#~ "cylinder 1024 ends at %.3fM.%s"
+#~ msgstr ""
+#~ "Hệ điều hành nghĩ là hình học trên %s là %d/%d/%d. Tuy nhiên, cylinder "
+#~ "số 1024 kết thúc tại %.3fM.%s"
+
+#~ msgid "The operating system thinks the geometry on %s is %d/%d/%d.%s"
+#~ msgstr "Hệ điều hành nghĩ là hình học trên %s là %d/%d/%d.%s"
diff --git a/po/zh_CN.po b/po/zh_CN.po
new file mode 100644
index 0000000..8c16730
--- /dev/null
+++ b/po/zh_CN.po
@@ -0,0 +1,2403 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) 2003 Free Software Foundation, Inc.
+# Wang Li <charles@linux.net.cn>, 2003.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: parted 1.6.6-pre2\n"
+"Report-Msgid-Bugs-To: bug-parted@gnu.org\n"
+"POT-Creation-Date: 2006-04-21 21:20+0200\n"
+"PO-Revision-Date: 2003-07-25 15:26+0800\n"
+"Last-Translator: Wang Li <charles@linux.net.cn>\n"
+"Language-Team: Chinese (simplified) <i18n-translation@lists.linux.net.cn>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=gb2312\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: libparted/arch/linux.c:284
+#, c-format
+msgid "Could not stat device %s - %s."
+msgstr "޷豸 %s - %s stat "
+
+#: libparted/arch/linux.c:390
+#, c-format
+msgid ""
+"Could not determine sector size for %s: %s.\n"
+"Using the default sector size (%lld)."
+msgstr ""
+
+#: libparted/arch/linux.c:401
+#, c-format
+msgid ""
+"Device %s has a logical sector size of %lld. Not all parts of GNU Parted "
+"support this at the moment, and the working code is HIGHLY EXPERIMENTAL.\n"
+msgstr ""
+
+#: libparted/arch/linux.c:441
+#, fuzzy, c-format
+msgid "Unable to determine the size of %s (%s)."
+msgstr "޷ȷ %s (%s) ĴС"
+
+#: libparted/arch/linux.c:530
+#, c-format
+msgid "Could not get identity of device %s - %s"
+msgstr "޷ȡ豸 %s - %s ıʶ"
+
+#: libparted/arch/linux.c:539
+msgid "Generic IDE"
+msgstr ""
+
+#: libparted/arch/linux.c:556
+#, c-format
+msgid ""
+"Device %s has multiple (%d) logical sectors per physical sector.\n"
+"GNU Parted supports this EXPERIMENTALLY for some special disk label/file "
+"system combinations, e.g. GPT and ext2/3.\n"
+"Please consult the web site for up-to-date information."
+msgstr ""
+
+#: libparted/arch/linux.c:726
+#, c-format
+msgid "Error initialising SCSI device %s - %s"
+msgstr "ʼ SCSI 豸 %s - %s "
+
+#: libparted/arch/linux.c:781
+#, fuzzy, c-format
+msgid ""
+"The device %s has zero length, and can't possibly store a file system or "
+"partition table. Perhaps you selected the wrong device?"
+msgstr ""
+"豸 %s ijΪ㣬޷ļϵͳѡ˴豸"
+
+#: libparted/arch/linux.c:829
+msgid ""
+"Unable to determine geometry of file/device. You should not use Parted "
+"unless you REALLY know what you're doing!"
+msgstr ""
+"޷ȷļ/豸ļνṹȷʵ֪ʲôʹ "
+"Parted"
+
+#: libparted/arch/linux.c:903
+msgid "DAC960 RAID controller"
+msgstr "DAC960 RAID "
+
+#: libparted/arch/linux.c:908
+msgid "Compaq Smart Array"
+msgstr "Compaq "
+
+#: libparted/arch/linux.c:913
+msgid "ATARAID Controller"
+msgstr "ATARAID "
+
+#: libparted/arch/linux.c:918
+msgid "I2O Controller"
+msgstr "I2O "
+
+#: libparted/arch/linux.c:923
+msgid "User-Mode Linux UBD"
+msgstr ""
+
+#: libparted/arch/linux.c:933
+msgid "Unknown"
+msgstr "δ֪"
+
+#: libparted/arch/linux.c:940
+msgid "ped_device_new() Unsupported device type"
+msgstr "ped_device_new() ֵ֧豸"
+
+#: libparted/arch/linux.c:1041 libparted/arch/gnu.c:264
+#, c-format
+msgid "Error opening %s: %s"
+msgstr " %s %s"
+
+#: libparted/arch/linux.c:1052 libparted/arch/gnu.c:274
+#, c-format
+msgid "Unable to open %s read-write (%s). %s has been opened read-only."
+msgstr ""
+
+#: libparted/arch/linux.c:1160 libparted/arch/linux.c:1228
+#: libparted/arch/gnu.c:452 libparted/arch/gnu.c:550 libparted/arch/gnu.c:678
+#, c-format
+msgid "%s during read on %s"
+msgstr "ڶȡ %2$s ڼ %1$s"
+
+#: libparted/arch/linux.c:1199
+#, c-format
+msgid "%s during seek for read on %s"
+msgstr "Ϊȡ %2$s seek ʱ %1$s"
+
+#: libparted/arch/linux.c:1270 libparted/arch/linux.c:1355
+#: libparted/arch/linux.c:1413 libparted/arch/gnu.c:587
+#: libparted/arch/gnu.c:632 libparted/arch/gnu.c:709
+#, c-format
+msgid "%s during write on %s"
+msgstr "д %2$s ʱ %1$s"
+
+#: libparted/arch/linux.c:1297 libparted/arch/gnu.c:512
+#, c-format
+msgid "Can't write to %s, because it is opened read-only."
+msgstr " %s ֻʽ򿪵ģ޷д롣"
+
+#: libparted/arch/linux.c:1321
+#, c-format
+msgid "%s during seek for write on %s"
+msgstr "Ϊд %2$s seek ʱ %1$s"
+
+#: libparted/arch/linux.c:1798
+#, fuzzy, c-format
+msgid ""
+"Error informing the kernel about modifications to partition %s -- %s. This "
+"means Linux won't know about any changes you made to %s until you reboot -- "
+"so you shouldn't mount it or use it in any way before rebooting."
+msgstr ""
+"֪ͨں˹ڷ %s - %s ޸ʱζ Linux ֮ǰ޷֪"
+" %s κ޸ - Ҳ֮ǰػκηʽʹ"
+
+#: libparted/arch/linux.c:1879
+#, fuzzy, c-format
+msgid ""
+"The kernel was unable to re-read the partition table on %s (%s). This means "
+"Linux won't know anything about the modifications you made until you "
+"reboot. You should reboot your computer before doing anything with %s."
+msgstr ""
+"ں޷¶ȡ %s (%s) ϵķζ Linux ֮ǰ޷֪"
+"κ޸ġӦڶ %s κβ ֮ǰļ"
+
+#: libparted/arch/gnu.c:97
+#, c-format
+msgid "Unable to open %s."
+msgstr "޷ %s"
+
+#: libparted/arch/gnu.c:117
+msgid "Unable to probe store."
+msgstr "޷̽洢豸"
+
+#: libparted/arch/gnu.c:355
+#, fuzzy
+msgid ""
+"The partition table cannot be re-read. This means you need to reboot before "
+"mounting any modified partitions. You also need to reinstall your boot "
+"loader before you reboot (which may require mounting modified partitions). "
+"It is impossible do both things! So you'll need to boot off a rescue disk, "
+"and reinstall your boot loader from the rescue disk. Read section 4 of the "
+"Parted User documentation for more information."
+msgstr ""
+"޷¶ͬڼκ޸˵ķ֮ǰҪ"
+"֮ǰ°װ (Ҫ޸˵ķ)ͬʱ"
+"DzܵģҪӼӼ°װ"
+" Parted ûĵĵĽڡ"
+
+#: libparted/arch/gnu.c:372
+#, fuzzy, c-format
+msgid ""
+"The partition table on %s cannot be re-read (%s). This means the Hurd knows "
+"nothing about any modifications you made. You should reboot your computer "
+"before doing anything with %s."
+msgstr ""
+"%s (%s) ϵķζ Hurd ֪κ޸ġӦڶ %s "
+"β֮ǰļ"
+
+#: libparted/arch/gnu.c:383 parted/parted.c:2215
+msgid ""
+"You should reinstall your boot loader before rebooting. Read section 4 of "
+"the Parted User documentation for more information."
+msgstr ""
+"Ӧ֮ǰ°װĶ Parted ûĵĵ"
+"ڡ"
+
+#: libparted/arch/gnu.c:774
+#, c-format
+msgid "%s trying to sync %s to disk"
+msgstr "%s ͼ %s ͬ"
+
+#: libparted/disk.c:183
+#, c-format
+msgid "Unable to open %s - unrecognised disk label."
+msgstr "޷ %s - ޷ʶĴ̱ǩ"
+
+#: libparted/disk.c:452
+#, c-format
+msgid ""
+"This libparted doesn't have write support for %s. Perhaps it was compiled "
+"read-only."
+msgstr " libparted ֶ֧ %s дǰֻʽġ"
+
+#: libparted/disk.c:579
+#, fuzzy, c-format
+msgid "Partition %d is %s, but the file system is %s."
+msgstr " %d Ϊ %.3fMbļϵͳΪ %.3fMb"
+
+#: libparted/disk.c:1056
+#, c-format
+msgid "%s disk labels do not support extended partitions."
+msgstr "%s ̱ǩ֧չ"
+
+#: libparted/disk.c:1616
+#, c-format
+msgid "%s disk labels don't support logical or extended partitions."
+msgstr "%s ̱ǩ֧߼չ"
+
+#: libparted/disk.c:1629
+#, fuzzy
+msgid "Too many primary partitions."
+msgstr ""
+
+#: libparted/disk.c:1638
+#, c-format
+msgid ""
+"Can't add a logical partition to %s, because there is no extended partition."
+msgstr "ûչ޷߼ӵ %s"
+
+#: libparted/disk.c:1662
+#, fuzzy, c-format
+msgid "Can't have more than one extended partition on %s."
+msgstr "%s ϲܺжһչ"
+
+#: libparted/disk.c:1672
+msgid "Can't have logical partitions outside of the extended partition."
+msgstr "߼ܴչ֮⡣"
+
+#: libparted/disk.c:1697
+#, c-format
+msgid "Can't have a logical partition outside of the extended partition on %s."
+msgstr "%s ϵ߼ܴչ֮⡣"
+
+#: libparted/disk.c:1707 libparted/disk.c:1761 libparted/disk.c:1927
+#, fuzzy
+msgid "Can't have overlapping partitions."
+msgstr "ص"
+
+#: libparted/disk.c:1715
+msgid "Can't have a primary partition inside an extended partition."
+msgstr "չвܺ"
+
+#: libparted/disk.c:2123
+msgid "metadata"
+msgstr "Ԫ"
+
+#: libparted/disk.c:2125
+msgid "free"
+msgstr "пռ"
+
+#: libparted/disk.c:2127 parted/ui.c:968 parted/ui.c:996
+msgid "extended"
+msgstr "չ"
+
+#: libparted/disk.c:2129 parted/ui.c:972 parted/ui.c:1000
+msgid "logical"
+msgstr "߼"
+
+#: libparted/disk.c:2131 parted/ui.c:964 parted/ui.c:992
+msgid "primary"
+msgstr ""
+
+#: libparted/disk.c:2147
+msgid "boot"
+msgstr ""
+
+#: libparted/disk.c:2149
+msgid "root"
+msgstr ""
+
+#: libparted/disk.c:2151
+msgid "swap"
+msgstr "Ի"
+
+#: libparted/disk.c:2153
+msgid "hidden"
+msgstr "ط"
+
+#: libparted/disk.c:2155
+msgid "raid"
+msgstr "raid"
+
+#: libparted/disk.c:2157
+msgid "lvm"
+msgstr "lvm"
+
+#: libparted/disk.c:2159
+msgid "lba"
+msgstr "lba"
+
+#: libparted/disk.c:2161
+msgid "hp-service"
+msgstr ""
+
+#: libparted/disk.c:2163
+msgid "palo"
+msgstr ""
+
+#: libparted/disk.c:2165
+#, fuzzy
+msgid "prep"
+msgstr ""
+
+#: libparted/disk.c:2167
+msgid "msftres"
+msgstr ""
+
+#: libparted/disk.c:2173
+#, c-format
+msgid "Unknown partition flag, %d."
+msgstr ""
+
+#: libparted/labels/rdb.c:177
+#, c-format
+msgid "%s : Bad checksum on block %llu of type %s."
+msgstr ""
+
+#: libparted/labels/rdb.c:510
+#, c-format
+msgid "%s : Didn't find rdb block, should never happen."
+msgstr ""
+
+#: libparted/labels/rdb.c:595
+#, c-format
+msgid "%s : Loop detected at block %d."
+msgstr ""
+
+#: libparted/labels/rdb.c:614
+#, c-format
+msgid "%s : The %s list seems bad at block %s."
+msgstr ""
+
+#: libparted/labels/rdb.c:703
+#, c-format
+msgid "%s : Failed to list bad blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:711
+#, c-format
+msgid "%s : Failed to list partition blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:719
+#, c-format
+msgid "%s : Failed to list file system blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:727
+#, c-format
+msgid "%s : Failed to list boot blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:750
+#, c-format
+msgid "Failed to write partition block at %d."
+msgstr ""
+
+#: libparted/labels/rdb.c:1053 libparted/labels/bsd.c:505
+#: libparted/labels/dos.c:1942 libparted/labels/dvh.c:772
+#: libparted/labels/gpt.c:1365 libparted/labels/loop.c:251
+#: libparted/labels/mac.c:1318 libparted/labels/pc98.c:764
+#: libparted/labels/sun.c:704
+msgid "Unable to satisfy all constraints on the partition."
+msgstr "޷ơ"
+
+#: libparted/labels/rdb.c:1081
+#, fuzzy
+msgid "Unable to allocate a partition number."
+msgstr "Ҫš"
+
+#: libparted/labels/bsd.c:530
+#, fuzzy
+msgid "Unable to allocate a bsd disklabel slot."
+msgstr "ȡλ bsd ̱ǩ"
+
+#: libparted/labels/dos.c:812
+#, fuzzy, c-format
+msgid "Invalid partition table on %s -- wrong signature %x."
+msgstr "%s ϵķЧ - ǩ %x"
+
+#: libparted/labels/dos.c:840
+#, c-format
+msgid "Invalid partition table - recursive partition on %s."
+msgstr "Чķ - %s ֵݹ"
+
+#: libparted/labels/dos.c:1300
+msgid "Extended partitions cannot be hidden on msdos disk labels."
+msgstr ""
+
+#: libparted/labels/dos.c:1926
+msgid "Parted can't resize partitions managed by Windows Dynamic Disk."
+msgstr ""
+
+#: libparted/labels/dvh.c:192
+#, fuzzy, c-format
+msgid "%s has no extended partition (volume header partition)."
+msgstr "%s ûչ (ͷ)ԣɾ"
+
+#: libparted/labels/dvh.c:315
+msgid "Checksum is wrong, indicating the partition table is corrupt."
+msgstr "Уʹ󣬱𻵡"
+
+#: libparted/labels/dvh.c:616
+msgid "Only primary partitions can be root partitions."
+msgstr "ֻǸ"
+
+#: libparted/labels/dvh.c:630
+msgid "Only primary partitions can be swap partitions."
+msgstr "ֻǶԻ"
+
+#: libparted/labels/dvh.c:644
+msgid "Only logical partitions can be a boot file."
+msgstr "ֻ߼ļ"
+
+#: libparted/labels/dvh.c:723
+msgid "Only logical partitions (boot files) have a name."
+msgstr "ֻ߼ (ļ) ӵ֡"
+
+#: libparted/labels/dvh.c:814
+msgid "Too many primary partitions"
+msgstr ""
+
+#: libparted/labels/gpt.c:433
+#, fuzzy, c-format
+msgid ""
+"%s contains GPT signatures, indicating that it has a GPT table. However, it "
+"does not have a valid fake msdos partition table, as it should. Perhaps it "
+"was corrupted -- possibly by a program that doesn't understand GPT partition "
+"tables. Or perhaps you deleted the GPT table, and are now using an msdos "
+"partition table. Is this a GPT partition table?"
+msgstr ""
+"%s GPT ǩ GPT ȻӦõЧα "
+"msdos Ѿ - Dz GPT ijµġɾ"
+" GPT ʹ msdos GPT "
+
+#: libparted/labels/gpt.c:625
+#, c-format
+msgid ""
+"The format of the GPT partition table is version %x, which is newer than "
+"what Parted can recognise. Please tell us! bug-parted@gnu.org"
+msgstr ""
+"GPT ĸʽ汾Ϊ %x Parted ʶİ汾Ҫ¡ǣbug-"
+"parted@gnu.org"
+
+#: libparted/labels/gpt.c:747
+msgid ""
+"The backup GPT table is not at the end of the disk, as it should be. This "
+"might mean that another operating system believes the disk is smaller. Fix, "
+"by moving the backup to the end (and removing the old backup)?"
+msgstr ""
+" GPT Ӧõڴ̵ĩβζϵͳŴС"
+"һЩͨƶĩβ (ɾɱ) "
+
+#: libparted/labels/gpt.c:782
+#, fuzzy
+msgid ""
+"The primary GPT table is corrupt, but the backup appears OK, so that will be "
+"used."
+msgstr " GPT 𻵣ƺȷģʹñݡ"
+
+#: libparted/labels/gpt.c:790
+#, fuzzy
+msgid ""
+"Both the primary and backup GPT tables are corrupt. Try making a fresh "
+"table, and using Parted's rescue feature to recover partitions."
+msgstr ""
+" GPT ͱ GPT ˡͼ±ʹ Parted ļȹ޸"
+""
+
+#: libparted/labels/mac.c:167
+#, c-format
+msgid "Invalid signature %x for Mac disk labels."
+msgstr "Ч Mac ̱ǩǩ %x"
+
+#: libparted/labels/mac.c:212
+msgid "Partition map has no partition map entry!"
+msgstr "ӳ䲻зӳĿ"
+
+#: libparted/labels/mac.c:259
+#, c-format
+msgid "%s is too small for a Mac disk label!"
+msgstr "%s Mac ̱ǩ˵̫Сˣ"
+
+#: libparted/labels/mac.c:490
+#, c-format
+msgid "Partition %d has an invalid signature %x."
+msgstr " %d Чǩ %x"
+
+#: libparted/labels/mac.c:508
+#, c-format
+msgid "Partition %d has an invalid length of 0 bytes!"
+msgstr " %d Чij 0 ֽڣ"
+
+#: libparted/labels/mac.c:536
+#, fuzzy
+msgid "The data region doesn't start at the start of the partition."
+msgstr "δӷ㿪ʼ"
+
+#: libparted/labels/mac.c:553
+#, fuzzy
+msgid "The boot region doesn't start at the start of the partition."
+msgstr "δӷ㿪ʼ"
+
+#: libparted/labels/mac.c:567
+msgid "The partition's boot region doesn't occupy the entire partition."
+msgstr "δռ"
+
+#: libparted/labels/mac.c:577
+msgid "The partition's data region doesn't occupy the entire partition."
+msgstr "δռ"
+
+#: libparted/labels/mac.c:631
+#, c-format
+msgid ""
+"Weird block size on device descriptor: %d bytes is not divisible by 512."
+msgstr "豸гֹŹֵĿС%d ֽڲܱ 512 "
+
+#: libparted/labels/mac.c:644
+#, c-format
+msgid ""
+"The driver descriptor says the physical block size is %d bytes, but Linux "
+"says it is %d bytes."
+msgstr "СΪ %d ֽڣ Linux Ϊ %d ֽڡ"
+
+#: libparted/labels/mac.c:692
+msgid "No valid partition map found."
+msgstr "ҲЧķӳ䡣"
+
+#: libparted/labels/mac.c:744
+#, fuzzy, c-format
+msgid ""
+"Conflicting partition map entry sizes! Entry 1 says it is %d, but entry %d "
+"says it is %d!"
+msgstr "ӳĿСͻĿ 1 ˵ %dĿ %d ˵ %d"
+
+#: libparted/labels/mac.c:771
+#, fuzzy
+msgid "Weird! There are 2 partitions map entries!"
+msgstr " - ӳĿ"
+
+#: libparted/labels/mac.c:1257
+msgid ""
+"Changing the name of a root or swap partition will prevent Linux from "
+"recognising it as such."
+msgstr "ıԻƽ Linux ޷ʶ"
+
+#: libparted/labels/mac.c:1353
+#, fuzzy
+msgid "Can't add another partition -- the partition map is too small!"
+msgstr "޷һ - ӳС"
+
+#: libparted/labels/pc98.c:357
+#, fuzzy, c-format
+msgid "Invalid partition table on %s."
+msgstr "%s ķЧ"
+
+#: libparted/labels/pc98.c:409 libparted/labels/pc98.c:487
+#, fuzzy, c-format
+msgid ""
+"Partition %d isn't aligned to cylinder boundaries. This is still "
+"unsupported."
+msgstr " %d δ뵽߽硣ҪӶ֧֡"
+
+#: libparted/labels/pc98.c:796
+msgid "Can't add another partition."
+msgstr "޷"
+
+#: libparted/labels/sun.c:143
+msgid "Corrupted Sun disk label detected."
+msgstr "⵽˵ Sun ̱ǩ"
+
+#: libparted/labels/sun.c:264
+#, fuzzy, c-format
+msgid ""
+"The disk CHS geometry (%d,%d,%d) reported by the operating system does not "
+"match the geometry stored on the disk label (%d,%d,%d)."
+msgstr ""
+" CHS νṹ (%d,%d,%d) ڱڴ̱ǩ (%d,%d,%d) еļνṹƥ䡣"
+
+#: libparted/labels/sun.c:286
+#, c-format
+msgid "The disk label describes a disk bigger than %s."
+msgstr "̱ǩĴ̴ %s"
+
+#: libparted/labels/sun.c:440
+#, c-format
+msgid "The disk has %d cylinders, which is greater than the maximum of 65536."
+msgstr ""
+
+#: libparted/labels/sun.c:736
+msgid ""
+"The Whole Disk partition is the only available one left. Generally, it is "
+"not a good idea to overwrite this partition with a real one. Solaris may "
+"not be able to boot without it, and SILO (the sparc boot loader) appreciates "
+"it as well."
+msgstr ""
+
+#: libparted/labels/sun.c:751
+msgid "Sun disk label is full."
+msgstr "Sun ̱ǩ"
+
+#: libparted/filesys.c:386
+msgid "Could not detect file system."
+msgstr "޷ļϵͳ"
+
+#: libparted/filesys.c:397
+#, fuzzy
+msgid "The file system is bigger than its volume!"
+msgstr "ļϵͳľ"
+
+#: libparted/filesys.c:405
+#, c-format
+msgid "Support for opening %s file systems is not implemented yet."
+msgstr "ڴ %s ļϵͳ֧δʵ֡"
+
+#: libparted/filesys.c:447
+#, c-format
+msgid "Support for creating %s file systems is not implemented yet."
+msgstr "ڴ %s ļϵͳ֧δʵ֡"
+
+#: libparted/filesys.c:508
+#, c-format
+msgid "Support for checking %s file systems is not implemented yet."
+msgstr "ڼ %s ļϵͳ֧δʵ֡"
+
+#: libparted/filesys.c:574
+msgid "raw block copying"
+msgstr "ԭʼ鸴"
+
+#: libparted/filesys.c:585
+msgid "growing file system"
+msgstr "ļϵͳ"
+
+#: libparted/filesys.c:625
+msgid "Can't copy onto an overlapping partition."
+msgstr "޷Ƶصķ"
+
+#: libparted/filesys.c:647
+#, fuzzy, c-format
+msgid ""
+"Direct support for copying file systems is not yet implemented for %s. "
+"However, support for resizing is implemented. Therefore, the file system "
+"can be copied if the new partition is at least as big as the old one. So, "
+"either shrink the partition you are trying to copy, or copy to a bigger "
+"partition."
+msgstr ""
+" %s ˵вֱ֧ӵļϵͳơָ֧ıСˣֻҪ·ԭ"
+"󣬾ܹļϵͳԣСͼƵķƵϴķ"
+
+#: libparted/filesys.c:661
+#, c-format
+msgid "Support for copying %s file systems is not implemented yet."
+msgstr "ڸ %s ļϵͳ֧δʵ֡"
+
+#: libparted/filesys.c:699
+#, c-format
+msgid "Support for resizing %s file systems is not implemented yet."
+msgstr "ı %s ļϵͳ֧δʵ֡"
+
+#: libparted/exception.c:78
+msgid "Information"
+msgstr "Ϣ"
+
+#: libparted/exception.c:79
+msgid "Warning"
+msgstr ""
+
+#: libparted/exception.c:80
+msgid "Error"
+msgstr ""
+
+#: libparted/exception.c:81
+msgid "Fatal"
+msgstr ""
+
+#: libparted/exception.c:82
+msgid "Bug"
+msgstr "Bug"
+
+#: libparted/exception.c:83
+msgid "No Implementation"
+msgstr "δʵ"
+
+#: libparted/exception.c:87
+msgid "Fix"
+msgstr ""
+
+#: libparted/exception.c:88
+msgid "Yes"
+msgstr ""
+
+#: libparted/exception.c:89
+msgid "No"
+msgstr ""
+
+#: libparted/exception.c:90
+msgid "OK"
+msgstr "ȷ"
+
+#: libparted/exception.c:91
+msgid "Retry"
+msgstr ""
+
+#: libparted/exception.c:92
+msgid "Ignore"
+msgstr ""
+
+#: libparted/exception.c:93
+msgid "Cancel"
+msgstr ""
+
+#: libparted/exception.c:133
+#, fuzzy, c-format
+msgid ""
+"A bug has been detected in GNU Parted. Refer to the web site of parted "
+"http://www.gnu.org/software/parted/parted.html for more informations of what "
+"could be useful for bug submitting! Please email a bug report to bug-"
+"parted@gnu.org containing at least the version (%s) and the following "
+"message: "
+msgstr ""
+" GNU Parted е bug뽫а汾 (%s) Ϣ bug 淢͵ bug-"
+"parted@gnu.org"
+
+#: libparted/cs/geom.c:162
+msgid "Can't have the end before the start!"
+msgstr "޷ڿʼ֮ǰ"
+
+#: libparted/cs/geom.c:169
+msgid "Can't have a partition outside the disk!"
+msgstr "޷÷̣"
+
+#: libparted/cs/geom.c:303
+#, fuzzy, c-format
+msgid "Attempt to read sectors %ld-%ld outside of partition on %s."
+msgstr "ͼȡ %3$s Ϸ֮ %1$ld-%2$ld"
+
+#: libparted/cs/geom.c:373
+#, fuzzy, c-format
+msgid "Attempt to write sectors %ld-%ld outside of partition on %s."
+msgstr "ͼд %3$s Ϸ֮ %1$ld-%2$ld"
+
+#: libparted/cs/geom.c:413 libparted/fs/linux_swap/linux_swap.c:353
+msgid "checking for bad blocks"
+msgstr "黵"
+
+#: libparted/libparted.c:286 libparted/libparted.c:306
+msgid "Out of memory."
+msgstr "ڴľ"
+
+#: libparted/unit.c:139
+msgid "Cannot get unit size for special unit 'COMPACT'."
+msgstr ""
+
+#: libparted/unit.c:382
+#, c-format
+msgid "\"%s\" has invalid syntax for locations."
+msgstr ""
+
+#: libparted/unit.c:390
+#, c-format
+msgid "The maximum head value is %d."
+msgstr ""
+
+#: libparted/unit.c:397
+#, c-format
+msgid "The maximum sector value is %d."
+msgstr ""
+
+#: libparted/unit.c:409 libparted/unit.c:540
+#, c-format
+msgid "The location %s is outside of the device %s."
+msgstr ""
+
+#: libparted/unit.c:522
+msgid "Invalid number."
+msgstr ""
+
+#: libparted/fs/ext2/ext2.c:87 libparted/fs/ext2/ext2.c:112
+msgid "Inconsistent group descriptors!"
+msgstr "һµ"
+
+#: libparted/fs/ext2/ext2.c:91 libparted/fs/ext2/ext2.c:116
+#, fuzzy
+msgid "File system full!"
+msgstr "ļϵͳ"
+
+#: libparted/fs/ext2/ext2.c:750
+#, fuzzy
+msgid "Invalid superblock. Are you sure this is an ext2 file system?"
+msgstr "Чij顣ȷһ ext2 ļϵͳ"
+
+#: libparted/fs/ext2/ext2.c:764 libparted/fs/ext2/ext2_resize.c:597
+#, fuzzy
+msgid "File system has errors! You should run e2fsck."
+msgstr "ļϵͳӦ e2fsck"
+
+#: libparted/fs/ext2/ext2.c:775
+#, fuzzy
+msgid ""
+"File system was not cleanly unmounted! You should run e2fsck. Modifying an "
+"unclean file system could cause severe corruption."
+msgstr ""
+"ļϵͳûбɾжأӦ e2fsck޸IJɾļϵͳص"
+"𻵡"
+
+#: libparted/fs/ext2/ext2.c:795
+#, fuzzy
+msgid "File system has an incompatible feature enabled."
+msgstr "ļϵͳ˲ݵĹ"
+
+#: libparted/fs/ext2/ext2.c:806
+msgid "Error allocating buffer cache."
+msgstr "仺 cache "
+
+#: libparted/fs/ext2/ext2.c:848
+msgid ""
+"A resize operation on this file system will use EXPERIMENTAL code that MAY "
+"CORRUPT it (although it hasn't done so yet).You should at least backup your "
+"data and run 'e2fsck -f' afterwards."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:114
+#, fuzzy
+msgid ""
+"Found an inode with a incorrect link count. Better go run e2fsck first!"
+msgstr "ҵдӼ inode e2fsck"
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:487
+msgid "Not enough free inodes!"
+msgstr "û㹻Ŀ inodes"
+
+#: libparted/fs/ext2/ext2_resize.c:224
+#, fuzzy
+msgid "File system is too full to remove a group!"
+msgstr "ļϵͳռ޷ɾ飡"
+
+#: libparted/fs/ext2/ext2_resize.c:233
+#, fuzzy
+msgid "File system has too many allocated inodes to remove a group!"
+msgstr "ļϵͳʹõ inode ޷ɾ飡"
+
+#: libparted/fs/ext2/ext2_resize.c:493
+msgid "adding groups"
+msgstr ""
+
+#: libparted/fs/ext2/ext2_resize.c:530
+#, fuzzy, c-format
+msgid "Your file system is too full to resize it to %i blocks. Sorry."
+msgstr "ļϵͳռ޷ĴСıΪ %i 顣Ǹ"
+
+#: libparted/fs/ext2/ext2_resize.c:540
+#, fuzzy, c-format
+msgid ""
+"Your file system has too many occupied inodes to resize it to %i blocks. "
+"Sorry."
+msgstr ""
+"ļϵͳʹõ inode ޷СıΪ %i 顣Ǹ"
+
+#: libparted/fs/ext2/ext2_resize.c:554 libparted/fs/hfs/hfs.c:243
+#: libparted/fs/hfs/hfs.c:624
+msgid "shrinking"
+msgstr "С"
+
+#: libparted/fs/ext2/ext2_resize.c:605
+#, fuzzy
+msgid "File system was not cleanly unmounted! You should run e2fsck."
+msgstr "ļϵͳûиɾжأӦ e2fsck"
+
+#: libparted/fs/ext2/ext2_resize.c:614
+msgid ""
+"The file system has the 'dir_index' feature enabled. Parted can only resize "
+"the file system if it disables this feature. You can enable it later by "
+"running 'tune2fs -O dir_index DEVICE' and then 'e2fsck -fD DEVICE'."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_block_relocator.c:198
+#, fuzzy
+msgid "Cross-linked blocks found! Better go run e2fsck first!"
+msgstr "ֽӿ飡 e2fsck"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:537
+#, fuzzy, c-format
+msgid "Block %i has no reference? Weird."
+msgstr " %i ûã"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:738
+#, c-format
+msgid "Block %i shouldn't have been marked!"
+msgstr " %i Ӧѱǣ"
+
+#: libparted/fs/ext2/interface.c:188
+#, fuzzy
+msgid ""
+"The ext2 file system passed a basic check. For a more comprehensive check, "
+"use the e2fsck program."
+msgstr "ext2 ļϵͳͨ顣ڸصļ飬ʹ e2fsck "
+
+#: libparted/fs/ext2/interface.c:205
+msgid "Sorry, can't move the start of ext2 partitions yet!"
+msgstr "޷ƶ ext2 㣡"
+
+#: libparted/fs/ext2/ext2_buffer.c:82
+msgid "Couldn't flush buffer cache!"
+msgstr "޷ˢ» cache"
+
+#: libparted/fs/ext2/ext2_mkfs.c:162
+msgid "writing per-group metadata"
+msgstr "дÿ鶼еԪ"
+
+#: libparted/fs/ext2/ext2_mkfs.c:565
+msgid "File system too small for ext2."
+msgstr " ext2 ˵ļϵͳС"
+
+#: libparted/fs/fat/calc.c:134
+#, fuzzy, c-format
+msgid ""
+"You need %s of free disk space to shrink this partition to this size. "
+"Currently, only %s is free."
+msgstr ""
+"Ҫ %dM Ŀпռ˷һС (Ŀǰֻ %dM Ŀпռ)"
+
+#: libparted/fs/fat/context.c:55
+#, c-format
+msgid ""
+"Cluster start delta = %d, which is not a multiple of the cluster size %d."
+msgstr "ʼƫ = %dǴشС %d "
+
+#: libparted/fs/fat/fat.c:312
+#, fuzzy, c-format
+msgid "Partition too big/small for a %s file system."
+msgstr " %s ļϵͳ˵С"
+
+#: libparted/fs/fat/fat.c:478
+msgid ""
+"The FATs don't match. If you don't know what this means, then select "
+"cancel, run scandisk on the file system, and then come back."
+msgstr ""
+"FAT ƥ䡣㲻֪ĺ壬ѡļϵͳ scandisk"
+"ڻص"
+
+#: libparted/fs/fat/fat.c:518
+msgid "There are no possible configurations for this FAT type."
+msgstr "ڴ FAT ûпܵá"
+
+#: libparted/fs/fat/fat.c:530
+#, c-format
+msgid ""
+"File system doesn't have expected sizes for Windows to like it. Cluster "
+"size is %dk (%dk expected); number of clusters is %d (%d expected); size of "
+"FATs is %d sectors (%d expected)."
+msgstr ""
+"ļϵͳĴС Windows ϣġشСΪ %dk ( %dk)Ϊ %d ("
+" %d)FAT ĴСΪ %d ( %d)"
+
+#: libparted/fs/fat/fat.c:553
+#, c-format
+msgid ""
+"File system is reporting the free space as %d clusters, not %d clusters."
+msgstr "ļϵͳпռΪ %d أ %d ء"
+
+#: libparted/fs/fat/fat.c:878
+#, fuzzy
+msgid ""
+"GNU Parted was miscompiled: the FAT boot sector should be 512 bytes. FAT "
+"support will be disabled."
+msgstr "GNU parted FAT ӦΪ 512 ֽڡFAT ֽ֧رա"
+
+#: libparted/fs/fat/resize.c:158
+#, fuzzy
+msgid ""
+"There's not enough room in the root directory for all of the files. Either "
+"cancel, or ignore to lose the files."
+msgstr "Ŀ¼ûбļ㹻ռ䡣ʧļΪۺԡ"
+
+#: libparted/fs/fat/resize.c:299
+msgid "Error writing to the root directory."
+msgstr "дĿ¼"
+
+#: libparted/fs/fat/resize.c:484
+#, fuzzy
+msgid "If you leave your file system as FAT16, then you will have no problems."
+msgstr "ļϵͳͱ FAT16 䣬ôͲ⡣"
+
+#: libparted/fs/fat/resize.c:487
+msgid ""
+"If you convert to FAT16, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual)."
+msgstr ""
+"תΪ FAT16 MS Windows װô°װ MS "
+"Windows ôӦò Parted ֲ (ķа"
+"ֲ)"
+
+#: libparted/fs/fat/resize.c:495
+msgid ""
+"If you leave your file system as FAT32, then you will not introduce any new "
+"problems."
+msgstr "ļϵͳΪ FAT32 䣬ôκ⡣"
+
+#: libparted/fs/fat/resize.c:499
+msgid ""
+"If you convert to FAT32, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual). Also, "
+"converting to FAT32 will make the file system unreadable by MS DOS, MS "
+"Windows 95a, and MS Windows NT."
+msgstr ""
+"תΪ FAT32 MS Windows װô°װ MS "
+"Windows Ӧò Parted ֲ (ķ"
+"аֲ)⣬ļϵͳתΪ FAT32ļϵͳͲܹ MS DOSMS "
+"Windows 95a MS Windows NT ˡ"
+
+#: libparted/fs/fat/resize.c:513
+#, c-format
+msgid "%s %s %s"
+msgstr "%s %s %s"
+
+#: libparted/fs/fat/resize.c:514
+msgid "Would you like to use FAT32?"
+msgstr "ǷԸʹ FAT32"
+
+#: libparted/fs/fat/resize.c:541 libparted/fs/fat/resize.c:557
+#, c-format
+msgid "%s %s"
+msgstr "%s %s"
+
+#: libparted/fs/fat/resize.c:542
+msgid ""
+"The file system can only be resized to this size by converting to FAT16."
+msgstr "ļϵͳĴСֻͨתΪ FAT16 ı䵽һС"
+
+#: libparted/fs/fat/resize.c:558
+msgid ""
+"The file system can only be resized to this size by converting to FAT32."
+msgstr "ļϵͳĴСֻͨתΪ FAT32 ı䵽һС"
+
+#: libparted/fs/fat/resize.c:571
+#, fuzzy
+msgid ""
+"GNU Parted cannot resize this partition to this size. We're working on it!"
+msgstr "GNU Parted ޷˷תһСʵ"
+
+#: libparted/fs/fat/bootsector.c:48 libparted/fs/fat/bootsector.c:55
+msgid "File system has an invalid signature for a FAT file system."
+msgstr "ļϵͳЧ FAT ļϵͳǩ"
+
+#: libparted/fs/fat/bootsector.c:62
+msgid "File system has an invalid sector size for a FAT file system."
+msgstr "ļϵͳС FAT ļϵͳ˵Ч"
+
+#: libparted/fs/fat/bootsector.c:69
+msgid "File system has an invalid cluster size for a FAT file system."
+msgstr "ļϵͳĴشС FAT ļϵͳ˵Ч"
+
+#: libparted/fs/fat/bootsector.c:76
+#, fuzzy
+msgid ""
+"File system has an invalid number of reserved sectors for a FAT file system."
+msgstr "ļϵͳı FAT ļϵͳ˵Ч"
+
+#: libparted/fs/fat/bootsector.c:83
+#, fuzzy
+msgid "File system has an invalid number of FATs."
+msgstr "ļϵͳ FATS Ч"
+
+#: libparted/fs/fat/bootsector.c:138
+#, c-format
+msgid ""
+"This file system has a logical sector size of %d. GNU Parted is known not "
+"to work properly with sector sizes other than 512 bytes."
+msgstr ""
+"ļϵͳ߼СΪ %dGNU Parted С 512 ֽڵ"
+"ȷ"
+
+#: libparted/fs/fat/bootsector.c:163
+#, c-format
+msgid ""
+"The file system's CHS geometry is (%d, %d, %d), which is invalid. The "
+"partition table's CHS geometry is (%d, %d, %d). If you select Ignore, the "
+"file system's CHS geometry will be left unchanged. If you select Fix, the "
+"file system's CHS geometry will be set to match the partition table's CHS "
+"geometry."
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:209
+msgid "FAT boot sector says logical sector size is 0. This is weird. "
+msgstr "FAT ߼ĴСΪ㡣֡"
+
+#: libparted/fs/fat/bootsector.c:215
+msgid "FAT boot sector says there are no FAT tables. This is weird. "
+msgstr "FAT û FAT ֡"
+
+#: libparted/fs/fat/bootsector.c:221
+msgid "FAT boot sector says clusters are 0 sectors. This is weird. "
+msgstr "FAT ֡"
+
+#: libparted/fs/fat/bootsector.c:231
+#, fuzzy
+msgid "File system is FAT12, which is unsupported."
+msgstr "ļϵͳΪ FAT12֧֡"
+
+#: libparted/fs/fat/bootsector.c:407
+#, c-format
+msgid ""
+"The information sector has the wrong signature (%x). Select cancel for now, "
+"and send in a bug report. If you're desperate, it's probably safe to ignore."
+msgstr ""
+"Ϣǩ (%x)ѡ bug 档һУѡ"
+"пǡȫġ"
+
+#: libparted/fs/fat/count.c:149
+#, c-format
+msgid "Bad directory entry for %s: first cluster is the end of file marker."
+msgstr "%s Ŀ¼Ŀ󣺵һؾļ־Ľ"
+
+#: libparted/fs/fat/count.c:162
+#, c-format
+msgid ""
+"Bad FAT: unterminated chain for %s. You should run dosfsck or scandisk."
+msgstr " FAT%s δֹӦ dosfsck scandisk"
+
+#: libparted/fs/fat/count.c:171
+#, fuzzy, c-format
+msgid ""
+"Bad FAT: cluster %d outside file system in chain for %s. You should run "
+"dosfsck or scandisk."
+msgstr ""
+" FAT%2$s У %1$d ļϵͳ֮⡣Ӧ dosfsck "
+"scandisk"
+
+#: libparted/fs/fat/count.c:181
+#, c-format
+msgid ""
+"Bad FAT: cluster %d is cross-linked for %s. You should run dosfsck or "
+"scandisk."
+msgstr " FAT %d ͬ %s ˡӦ dosfsck scandisk"
+
+#: libparted/fs/fat/count.c:200
+#, c-format
+msgid "%s is %dk, but it has %d clusters (%dk)."
+msgstr "%s Ϊ %dk %d (%dk)"
+
+#: libparted/fs/fat/count.c:263
+#, c-format
+msgid ""
+"The file %s is marked as a system file. This means moving it could cause "
+"some programs to stop working."
+msgstr "ļ %s ΪϵͳļζƶܵijЩֹͣ"
+
+#: libparted/fs/fat/table.c:138
+#, c-format
+msgid ""
+"FAT %d media %x doesn't match the boot sector's media %x. You should "
+"probably run scandisk."
+msgstr ""
+"FAT %d ý %x ڵý %x ƥ䡣Ӧ scandisk"
+
+#: libparted/fs/fat/table.c:268
+#, fuzzy, c-format
+msgid "fat_table_set: cluster %ld outside file system"
+msgstr "fat_table_set %ld ļϵͳ֮"
+
+#: libparted/fs/fat/table.c:296
+#, fuzzy, c-format
+msgid "fat_table_get: cluster %ld outside file system"
+msgstr "fat_table_get %ld ļϵͳ֮"
+
+#: libparted/fs/fat/table.c:334
+msgid "fat_table_alloc_cluster: no free clusters"
+msgstr "fat_table_alloc_clusterûпд"
+
+#: libparted/fs/linux_swap/linux_swap.c:236
+#, c-format
+msgid "Unrecognised linux swap signature '%10s'."
+msgstr "޷ʶ linux Իǩ%10s"
+
+#: libparted/fs/linux_swap/linux_swap.c:312
+msgid "Too many bad pages."
+msgstr "Ļҳ"
+
+#: libparted/fs/hfs/advfs.c:123 libparted/fs/hfs/advfs_plus.c:125
+#: libparted/fs/hfs/reloc.c:416 libparted/fs/hfs/reloc.c:510
+#: libparted/fs/hfs/reloc_plus.c:541 libparted/fs/hfs/reloc_plus.c:660
+#: libparted/fs/hfs/reloc_plus.c:774
+msgid "The file system contains errors."
+msgstr ""
+
+#: libparted/fs/hfs/advfs_plus.c:290
+msgid "Bad blocks could not be read."
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:139
+#, c-format
+msgid ""
+"Trying to register an extent starting at block 0x%X, but another one already "
+"exists at this position. You should check the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:216
+#, c-format
+msgid ""
+"Trying to move an extent from block Ox%X to block Ox%X, but another one "
+"already exists at this position. This should not happen!"
+msgstr ""
+
+#: libparted/fs/hfs/file.c:145
+#, c-format
+msgid "Could not update the extent cache for HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:182
+#, c-format
+msgid "Trying to read HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:192 libparted/fs/hfs/file.c:222
+#, c-format
+msgid "Could not find sector %lli of HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:212
+#, c-format
+msgid "Trying to write HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:159
+#, c-format
+msgid "Could not update the extent cache for HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:203
+#, c-format
+msgid "Trying to read HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:214 libparted/fs/hfs/file_plus.c:256
+#, c-format
+msgid "Could not find sector %lli of HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:245
+#, c-format
+msgid "Trying to write HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:225
+msgid "Sorry, HFS cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:255 libparted/fs/hfs/hfs.c:636
+msgid "Data relocation has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:274
+msgid "Data relocation left some data in the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:313
+#, fuzzy
+msgid "writing HFS Master Directory Block"
+msgstr "дĿ¼"
+
+#: libparted/fs/hfs/hfs.c:461
+msgid "No valid HFS[+X] signature has been found while opening."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:471
+#, c-format
+msgid "Version %d of HFS+ isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:482
+#, c-format
+msgid "Version %d of HFSX isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:667
+msgid "Data relocation left some data at the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:715
+#, fuzzy
+msgid "Error while writing the allocation file."
+msgstr "дĿ¼"
+
+#: libparted/fs/hfs/hfs.c:730
+msgid "Error while writing the compatibility part of the allocation file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:745
+msgid "writing HFS+ Volume Header"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:845
+msgid "An error occurred while looking for the mandatory bad blocks file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:899
+msgid ""
+"It seems there is an error in the HFS wrapper: the bad blocks file doesn't "
+"contain the embedded HFS+ volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:930
+msgid "Sorry, HFS+ cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:965
+msgid "shrinking embedded HFS+ volume"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:981
+msgid "Resizing the HFS+ volume has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:988
+#, fuzzy
+msgid "shrinking HFS wrapper"
+msgstr "С"
+
+#: libparted/fs/hfs/hfs.c:997
+msgid "Updating the HFS wrapper has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:1099 libparted/fs/hfs/hfs.c:1184
+#, c-format
+msgid ""
+"This is not a real %s check. This is going to extract special low level "
+"files for debugging purposes."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:156
+msgid "Bad block list header checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:169
+#, c-format
+msgid ""
+"Invalid size of a transaction block while replaying the journal (%i bytes)."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:261
+msgid ""
+"Journal stored outside of the volume are not supported. Try to desactivate "
+"the journal and run Parted again."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:272
+#, fuzzy
+msgid "Journal offset or size is not multiple of the sector size."
+msgstr "ʼƫ = %dǴشС %d "
+
+#: libparted/fs/hfs/journal.c:290
+msgid "Incorrect magic values in the journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:299
+msgid "Journal size mismatch between journal info block and journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:311
+#, fuzzy
+msgid "Some header fields are not multiple of the sector size."
+msgstr "ʼƫ = %dǴشС %d "
+
+#: libparted/fs/hfs/journal.c:320
+msgid ""
+"The sector size stored in the journal is not 512 bytes. Parted only "
+"supports 512 bytes length sectors."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:332
+msgid "Bad journal checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:350
+msgid ""
+"The journal is not empty. Parted must replay the transactions before "
+"opening the file system. This will modify the file system."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:378
+msgid ""
+"The volume header or the master directory block has changed while replaying "
+"the journal. You should restart Parted."
+msgstr ""
+
+#: libparted/fs/hfs/probe.c:52
+#, c-format
+msgid ""
+"Parted can't use HFS file systems on disks with a sector size not equal to %"
+"d bytes."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:153 libparted/fs/hfs/reloc_plus.c:157
+msgid "An extent has not been relocated."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:253 libparted/fs/hfs/reloc_plus.c:309
+msgid ""
+"A reference to an extent comes from a place it should not. You should check "
+"the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:383
+msgid "This HFS volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:477
+msgid "This HFS volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:519 libparted/fs/hfs/reloc_plus.c:670
+msgid ""
+"The extents overflow file should not contain its own extents! You should "
+"check the file system."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:576 libparted/fs/hfs/reloc_plus.c:849
+#, fuzzy
+msgid "Could not cache the file system in memory."
+msgstr "޷ļϵͳ"
+
+#: libparted/fs/hfs/reloc.c:637 libparted/fs/hfs/reloc_plus.c:910
+msgid "Bad blocks list could not be loaded."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:651 libparted/fs/hfs/reloc_plus.c:926
+msgid "An error occurred during extent relocation."
+msgstr ""
+
+#: libparted/fs/hfs/reloc_plus.c:497
+msgid "This HFS+ volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc_plus.c:621
+msgid "This HFS+ volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: parted/parted.c:76
+msgid "displays this help message"
+msgstr "ʾϢ"
+
+#: parted/parted.c:77
+msgid "where necessary, prompts for user intervention"
+msgstr "ڱҪʱʾû"
+
+#: parted/parted.c:78
+msgid "never prompts for user intervention"
+msgstr "Ӳʾû"
+
+#: parted/parted.c:79
+msgid "displays the version"
+msgstr "ʾ汾"
+
+#: parted/parted.c:87
+#, fuzzy
+msgid ""
+"NUMBER is the partition number used by Linux. On MS-DOS disk labels, the "
+"primary partitions number from 1 to 4, logical partitions from 5 onwards.\n"
+msgstr ""
+"MINOR Linux ʹõķš msdos ǩУΪ 1 - 4"
+"߼ 5 ʼ\n"
+
+#: parted/parted.c:90
+msgid "LABEL-TYPE is one of: "
+msgstr "ǩ͡һ"
+
+#: parted/parted.c:91
+msgid "FLAG is one of: "
+msgstr "־һ"
+
+#: parted/parted.c:92
+#, fuzzy
+msgid "UNIT is one of: "
+msgstr "־һ"
+
+#: parted/parted.c:93
+msgid "PART-TYPE is one of: primary, logical, extended\n"
+msgstr "͡߼չ֮һ\n"
+
+#: parted/parted.c:95
+msgid "FS-TYPE is one of: "
+msgstr "ļϵͳ͡һ"
+
+#: parted/parted.c:96
+#, fuzzy
+msgid ""
+"START and END are disk locations, such as 4GB or 10%. Negative values count "
+"from the end of the disk. For example, -1s specifies exactly the last "
+"sector.\n"
+msgstr "ʼ㡱ֹ͡㡱ΪλֵʾӴĩοʼ\n"
+
+#: parted/parted.c:99
+msgid "STATE is one of: on, off\n"
+msgstr "״̬Ϊ\n"
+
+#: parted/parted.c:100
+msgid "DEVICE is usually /dev/hda or /dev/sda\n"
+msgstr "DEVICE ͨΪ /dev/hda /dev/sda\n"
+
+#: parted/parted.c:101
+msgid "NAME is any word you want\n"
+msgstr "NAME Ҫκε\n"
+
+#: parted/parted.c:102
+msgid "The partition must have one of the following FS-TYPEs: "
+msgstr ""
+
+#: parted/parted.c:105
+msgid "GNU Parted Version information:\n"
+msgstr ""
+
+#: parted/parted.c:107
+#, fuzzy
+msgid ""
+"Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n"
+"This program is free software, covered by the GNU General Public License.\n"
+"\n"
+"This program is distributed in the hope that it will be useful, but WITHOUT "
+"ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
+"FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
+"more details.\n"
+"\n"
+msgstr ""
+"Ȩ (C) 1998, 1999, 2000, 2001, 2002, 2003 ᡣ\n"
+"Ϊ GNU ͨù֤С\n"
+"\n"
+"бϣܹãûκεʺض"
+";ı֤μ GNU ͨù֤\n"
+
+#: parted/parted.c:152
+#, c-format
+msgid "%0.f%%\t(time left %.2d:%.2d)"
+msgstr "%0.f%%\t(ʣʱ %.2d:%.2d)"
+
+#: parted/parted.c:170
+#, c-format
+msgid ""
+"Partition %s is being used. You must unmount it before you modify it with "
+"Parted."
+msgstr ""
+
+#: parted/parted.c:187
+#, c-format
+msgid "Partition(s) on %s are being used."
+msgstr "ʹ %s ϵķ"
+
+#: parted/parted.c:413 parted/parted.c:594 parted/parted.c:979
+#: parted/parted.c:1059 parted/parted.c:1586 parted/parted.c:1663
+#: parted/parted.c:1707
+msgid "Partition number?"
+msgstr "ţ"
+
+#: parted/parted.c:456
+msgid "Source device?"
+msgstr "Դ豸"
+
+#: parted/parted.c:460
+msgid "Source partition number?"
+msgstr "Դţ"
+
+#: parted/parted.c:465
+#, fuzzy
+msgid "Can't copy an extended partition."
+msgstr "ֻչ"
+
+#: parted/parted.c:471
+msgid "Destination partition number?"
+msgstr "Ŀţ"
+
+#: parted/parted.c:564
+msgid "New disk label type?"
+msgstr "µĴ̱ǩͣ"
+
+#: parted/parted.c:598
+msgid "File system?"
+msgstr "ļϵͳ"
+
+#: parted/parted.c:645 parted/parted.c:815
+msgid "Partition type?"
+msgstr "ͣ"
+
+#: parted/parted.c:652 parted/parted.c:822 parted/parted.c:1062
+msgid "Partition name?"
+msgstr "ƣ"
+
+#: parted/parted.c:660 parted/parted.c:832
+msgid "File system type?"
+msgstr "ļϵͳͣ"
+
+#: parted/parted.c:667 parted/parted.c:834 parted/parted.c:994
+#: parted/parted.c:1544 parted/parted.c:1595
+msgid "Start?"
+msgstr "ʼ㣿"
+
+#: parted/parted.c:669 parted/parted.c:837 parted/parted.c:997
+#: parted/parted.c:1546 parted/parted.c:1597
+msgid "End?"
+msgstr "㣿"
+
+#: parted/parted.c:707 parted/parted.c:875
+#, fuzzy, c-format
+msgid ""
+"You requested a partition from %s to %s.\n"
+"The closest location we can manage is %s to %s. Is this still acceptable to "
+"you?"
+msgstr "󽫷ƶ %.3f - %.3fMbɹķΪ %.3f - %.3fMB"
+
+#: parted/parted.c:827
+#, fuzzy
+msgid "An extended partition cannot hold a file system. Did you want mkpart?"
+msgstr "չܺļϵͳҪ mkpart ɣ"
+
+#: parted/parted.c:985
+#, fuzzy
+msgid "Can't move an extended partition."
+msgstr "޷ƶչ"
+
+#: parted/parted.c:1014
+msgid "Can't move a partition onto itself. Try using resize, perhaps?"
+msgstr "޷ƶøıСܣ"
+
+#: parted/parted.c:1158
+#, c-format
+msgid "Minor: %d\n"
+msgstr "Minor%d\n"
+
+#: parted/parted.c:1159
+#, fuzzy, c-format
+msgid "Flags: %s\n"
+msgstr "־"
+
+#: parted/parted.c:1160
+#, c-format
+msgid "File System: %s\n"
+msgstr "ļϵͳ%s\n"
+
+#: parted/parted.c:1161
+#, fuzzy, c-format
+msgid "Size: "
+msgstr "С %10.3fMb (%d%%)\n"
+
+#: parted/parted.c:1166
+#, fuzzy, c-format
+msgid "Minimum size: "
+msgstr "Сߴ磺 %10.3fMb (%d%%)\n"
+
+#: parted/parted.c:1169
+#, fuzzy, c-format
+msgid "Maximum size: "
+msgstr "ߴ磺 %10.3fMb (%d%%)\n"
+
+#: parted/parted.c:1255
+#, fuzzy, c-format
+msgid "Disk %s: %s\n"
+msgstr "%s %s %s"
+
+#: parted/parted.c:1256
+#, c-format
+msgid "Sector size (logical/physical): %lldB/%lldB\n"
+msgstr ""
+
+#: parted/parted.c:1267
+#, c-format
+msgid "BIOS cylinder,head,sector geometry: %d,%d,%d. Each cylinder is %s.\n"
+msgstr ""
+
+#: parted/parted.c:1273
+#, fuzzy, c-format
+msgid "Partition Table: %s\n"
+msgstr "ƣ"
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Number"
+msgstr ""
+
+#: parted/parted.c:1284 parted/parted.c:1287
+#, fuzzy
+msgid "Start"
+msgstr "ʼ㣿"
+
+#: parted/parted.c:1285 parted/parted.c:1288
+#, fuzzy
+msgid "End"
+msgstr "㣿"
+
+#: parted/parted.c:1288
+#, fuzzy
+msgid "Size"
+msgstr "resize"
+
+#: parted/parted.c:1292
+msgid "Type"
+msgstr ""
+
+#: parted/parted.c:1294
+#, fuzzy
+msgid "File system"
+msgstr "ļϵͳ"
+
+#: parted/parted.c:1297
+#, fuzzy
+msgid "Name"
+msgstr "name"
+
+#: parted/parted.c:1299
+msgid "Flags"
+msgstr "־"
+
+#: parted/parted.c:1352
+msgid "Free Space"
+msgstr ""
+
+#: parted/parted.c:1441
+#, fuzzy, c-format
+msgid ""
+"A %s %s partition was found at %s -> %s. Do you want to add it to the "
+"partition table?"
+msgstr ""
+" %3$.3fMb -> %4$.3fMb ҵһ %1$s %2$s ϣӵ"
+""
+
+#: parted/parted.c:1479
+msgid "searching for file systems"
+msgstr "ļϵͳ"
+
+#: parted/parted.c:1684
+msgid "New device?"
+msgstr "豸"
+
+#: parted/parted.c:1709
+#, fuzzy
+msgid "Flag to Invert?"
+msgstr "Ҫ޸ĵı־"
+
+#: parted/parted.c:1714
+msgid "New state?"
+msgstr "״̬"
+
+#: parted/parted.c:1747
+msgid "Unit?"
+msgstr ""
+
+#: parted/parted.c:1896
+msgid "check"
+msgstr ""
+
+#: parted/parted.c:1899
+#, fuzzy
+msgid ""
+"check NUMBER do a simple check on the file system"
+msgstr " MINOR ļϵͳһ򵥵ļ"
+
+#: parted/parted.c:1905
+msgid "cp"
+msgstr "cp"
+
+#: parted/parted.c:1908
+#, fuzzy
+msgid ""
+"cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another "
+"partition"
+msgstr "cp [FROM-DEVICE] FROM-MINOR TO-MINOR ļϵͳƵһ"
+
+#: parted/parted.c:1914
+msgid "help"
+msgstr "help"
+
+#: parted/parted.c:1917
+#, fuzzy
+msgid ""
+"help [COMMAND] prints general help, or help on "
+"COMMAND"
+msgstr "help [COMMAND] ӡͨϢ COMMAND Ϣ"
+
+#: parted/parted.c:1923
+msgid "mklabel"
+msgstr "mklabel"
+
+#: parted/parted.c:1926
+#, fuzzy
+msgid ""
+"mklabel LABEL-TYPE create a new disklabel (partition "
+"table)"
+msgstr "mklabel ǩ µĴ̱ǩ ()"
+
+#: parted/parted.c:1932
+msgid "mkfs"
+msgstr "mkfs"
+
+#: parted/parted.c:1935
+#, fuzzy
+msgid ""
+"mkfs NUMBER FS-TYPE make a FS-TYPE file system on "
+"partititon NUMBER"
+msgstr ""
+"mkfs MINOR ļϵͳ MINOR Ϊļϵͳ͡ļϵͳ"
+
+#: parted/parted.c:1941
+msgid "mkpart"
+msgstr "mkpart"
+
+#: parted/parted.c:1944
+#, fuzzy
+msgid "mkpart PART-TYPE [FS-TYPE] START END make a partition"
+msgstr "mkpart [ļϵͳ] ʼ ֹ һ"
+
+#: parted/parted.c:1950
+msgid ""
+"mkpart makes a partition without creating a new file system on the "
+"partition. FS-TYPE may be specified to set an appropriate partition ID.\n"
+msgstr ""
+"mkpart ڷϴļϵͳļϵͳ͡ʵ"
+"ʶ\n"
+
+#: parted/parted.c:1955
+msgid "mkpartfs"
+msgstr "mkpartfs"
+
+#: parted/parted.c:1958
+#, fuzzy
+msgid ""
+"mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system"
+msgstr ""
+"mkpartfs ļϵͳ ʼ ֹ һļϵͳķ"
+
+#: parted/parted.c:1964
+msgid "move"
+msgstr "move"
+
+#: parted/parted.c:1967
+#, fuzzy
+msgid "move NUMBER START END move partition NUMBER"
+msgstr "move MINOR ʼ ֹ ƶΪ MINOR ķ"
+
+#: parted/parted.c:1972
+msgid "name"
+msgstr "name"
+
+#: parted/parted.c:1975
+#, fuzzy
+msgid "name NUMBER NAME name partition NUMBER as NAME"
+msgstr "name MINOR Ϊ MINOR ķΪơ"
+
+#: parted/parted.c:1980
+msgid "print"
+msgstr "print"
+
+#: parted/parted.c:1983
+#, fuzzy
+msgid ""
+"print [free|NUMBER|all] display the partition table, a "
+"partition, or all devices"
+msgstr "print [MINOR] ӡ߷"
+
+#: parted/parted.c:1987
+#, fuzzy
+msgid ""
+"Without arguments, print displays the entire partition table. With 'free'\n"
+"argument, information about free space will be displayed otherwise if a\n"
+"partition number is given, then more detailed information is displayed\n"
+"about that partition. If the 'all' argument is passed instead, partition\n"
+"information for all devices will be displayed."
+msgstr ""
+"print ʾ\n"
+"˷ʾ\n"
+"ڷϸϢ\n"
+
+#: parted/parted.c:1995
+msgid "quit"
+msgstr "quit"
+
+#: parted/parted.c:1998
+#, fuzzy
+msgid "quit exit program"
+msgstr "quit ˳"
+
+#: parted/parted.c:2003
+msgid "rescue"
+msgstr "rescue"
+
+#: parted/parted.c:2006
+#, fuzzy
+msgid ""
+"rescue START END rescue a lost partition near START "
+"and END"
+msgstr ""
+"rescue ʼ ֹ ٽʼ㡱ֹ㡱ʧķ"
+
+#: parted/parted.c:2012
+msgid "resize"
+msgstr "resize"
+
+#: parted/parted.c:2015
+#, fuzzy
+msgid ""
+"resize NUMBER START END resize partition NUMBER and its "
+"file system"
+msgstr ""
+"resize MINOR ʼ ֹ ıλڱΪ MINOR ķļϵͳĴС"
+
+#: parted/parted.c:2023
+msgid "rm"
+msgstr "rm"
+
+#: parted/parted.c:2026
+#, fuzzy
+msgid "rm NUMBER delete partition NUMBER"
+msgstr "rm MINOR ɾΪ MINOR ķ"
+
+#: parted/parted.c:2031
+msgid "select"
+msgstr "select"
+
+#: parted/parted.c:2034
+#, fuzzy
+msgid "select DEVICE choose the device to edit"
+msgstr "select 豸 ѡҪ༭豸"
+
+#: parted/parted.c:2039
+msgid "set"
+msgstr "set"
+
+#: parted/parted.c:2042
+#, fuzzy
+msgid ""
+"set NUMBER FLAG STATE change the FLAG on partition NUMBER"
+msgstr "rm MINOR ɾΪ MINOR ķ"
+
+#: parted/parted.c:2048
+msgid "toggle"
+msgstr ""
+
+#: parted/parted.c:2051
+#, fuzzy
+msgid ""
+"toggle [NUMBER [FLAG]] toggle the state of FLAG on "
+"partition NUMBER"
+msgstr "rm MINOR ɾΪ MINOR ķ"
+
+#: parted/parted.c:2057
+#, fuzzy
+msgid "unit"
+msgstr "quit"
+
+#: parted/parted.c:2060
+#, fuzzy
+msgid "unit UNIT set the default unit to UNIT"
+msgstr "quit ˳"
+
+#: parted/parted.c:2065
+msgid "version"
+msgstr ""
+
+#: parted/parted.c:2068
+msgid ""
+"version displays the current version of GNU "
+"Parted and copyright information"
+msgstr ""
+
+#: parted/parted.c:2072
+msgid ""
+"version displays copyright and version information corressponding to this "
+"copy of GNU Parted\n"
+msgstr ""
+
+#: parted/parted.c:2158
+msgid "No device found"
+msgstr "ûҵ豸"
+
+#: parted/parted.c:2222
+msgid "Don't forget to update /etc/fstab, if necessary.\n"
+msgstr "ҪҪǸ /etc/fstab\n"
+
+#: parted/ui.c:68
+msgid "Welcome to GNU Parted! Type 'help' to view a list of commands.\n"
+msgstr ""
+
+#: parted/ui.c:71
+#, fuzzy
+msgid ""
+"Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]\n"
+"Apply COMMANDs with PARAMETERS to DEVICE. If no COMMAND(s) are given, run "
+"in\n"
+"interactive mode.\n"
+msgstr ""
+"÷parted [ѡ]... [豸 [ []...]...]\n"
+"СӦڡ豸ûиԽģʽ"
+"С\n"
+
+#: parted/ui.c:76
+#, c-format
+msgid ""
+"\n"
+"\n"
+"You found a bug in GNU Parted! Here's what you have to do:\n"
+"\n"
+"Don't panic! The bug has most likely not affected any of your data.\n"
+"Help us to fix this bug by doing the following:\n"
+"\n"
+"Check whether the bug has already been fixed by checking\n"
+"the last version of GNU Parted that you can find at:\n"
+"\n"
+"\thttp://ftp.gnu.org/gnu/parted/\n"
+"\n"
+"Please check this version prior to bug reporting.\n"
+"\n"
+"If this has not been fixed yet or if you don't know how to check,\n"
+"please visit the GNU Parted website:\n"
+"\n"
+"\thttp://www.gnu.org/software/parted\n"
+"\n"
+"for further information.\n"
+"\n"
+"Your report should contain the version of this release (%s)\n"
+"along with the error message below, the output of\n"
+"\n"
+"\tparted DEVICE unit co print unit s print\n"
+"\n"
+"and additional information about your setup you consider important.\n"
+msgstr ""
+
+#: parted/ui.c:230
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_MAPERR (Address not mapped to object)"
+msgstr ""
+
+#: parted/ui.c:235
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_ACCERR (Invalid permissions for mapped object)"
+msgstr ""
+
+#: parted/ui.c:240
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGSEGV signal was encountered."
+msgstr ""
+
+#: parted/ui.c:258
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTDIV (Integer: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:262
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTOVF (Integer: overflow)"
+msgstr ""
+
+#: parted/ui.c:266
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTDIV (Float: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:270
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTOVF (Float: overflow)"
+msgstr ""
+
+#: parted/ui.c:274
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTUND (Float: underflow)"
+msgstr ""
+
+#: parted/ui.c:278
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTRES (Float: inexact result)"
+msgstr ""
+
+#: parted/ui.c:282
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTINV (Float: invalid operation)"
+msgstr ""
+
+#: parted/ui.c:286
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTSUB (Float: subscript out of range)"
+msgstr ""
+
+#: parted/ui.c:291
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGFPE signal was encountered."
+msgstr ""
+
+#: parted/ui.c:310
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPC (Illegal Opcode)"
+msgstr ""
+
+#: parted/ui.c:314
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPN (Illegal Operand)"
+msgstr ""
+
+#: parted/ui.c:318
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLADR (Illegal addressing mode)"
+msgstr ""
+
+#: parted/ui.c:323
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLTRP (Illegal Trap)"
+msgstr ""
+
+#: parted/ui.c:327
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVOPC (Privileged Opcode)"
+msgstr ""
+
+#: parted/ui.c:331
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVREG (Privileged Register)"
+msgstr ""
+
+#: parted/ui.c:335
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_COPROC (Coprocessor Error)"
+msgstr ""
+
+#: parted/ui.c:339
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_BADSTK (Internal Stack Error)"
+msgstr ""
+
+#: parted/ui.c:343
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGILL signal was encountered."
+msgstr ""
+
+#: parted/ui.c:828
+msgid "Expecting a partition number."
+msgstr "Ҫš"
+
+#: parted/ui.c:837
+msgid "Partition doesn't exist."
+msgstr "ڡ"
+
+#: parted/ui.c:857
+msgid "Expecting a file system type."
+msgstr "Ҫļϵͳ͡"
+
+#: parted/ui.c:863
+#, c-format
+msgid "Unknown file system type \"%s\"."
+msgstr "δ֪ļϵͳ͡%s"
+
+#: parted/ui.c:883
+msgid "Expecting a disk label type."
+msgstr "Ҫ̱ǩ͡"
+
+#: parted/ui.c:977
+msgid "Can't create any more partitions."
+msgstr "޷"
+
+#: parted/ui.c:987
+msgid "Expecting a partition type."
+msgstr "Ҫ͡"
+
+#: parted/ui.c:1115
+msgid "on"
+msgstr ""
+
+#: parted/ui.c:1116
+msgid "off"
+msgstr ""
+
+#: parted/ui.c:1227
+msgid "OPTIONs:"
+msgstr "ѡ"
+
+#: parted/ui.c:1230
+msgid "COMMANDs:"
+msgstr ""
+
+#: parted/ui.c:1238
+#, c-format
+msgid "Using %s\n"
+msgstr "ʹ %s\n"
+
+#, fuzzy
+#~ msgid ""
+#~ "This ext2 file system has a rather strange layout! Parted can't resize "
+#~ "this (yet)."
+#~ msgstr " ext2 ļϵͳIJ൱֣Parted ޷ıĴС"
+
+#~ msgid "IDE"
+#~ msgstr "IDE"
+
+#, fuzzy
+#~ msgid "Disk geometry for %s: %s - %s\n"
+#~ msgstr "%s Ĵ̼νṹ0.000-%.3f ֽ\n"
+
+#~ msgid "Disk label type: %s\n"
+#~ msgstr "̱ǩͣ%s\n"
+
+#, fuzzy
+#~ msgid "set NUMBER FLAG STATE change a flag on partition NUMBER"
+#~ msgstr "set MINOR ־ ״̬ ıΪ MINOR ķı־"
+
+#, fuzzy
+#~ msgid ""
+#~ "The sector size on %s is %d bytes. Parted is known not to work properly "
+#~ "with drives with sector sizes other than %d bytes."
+#~ msgstr ""
+#~ "%s ϵСΪ %d ֽڡĿǰ Parted С %d ֽڵĴ"
+#~ "ȷ"
+
+#~ msgid ""
+#~ "You found a bug in GNU Parted. Please email a bug report to bug-"
+#~ "parted@gnu.org containing the version (%s), and the following message:\n"
+#~ msgstr ""
+#~ "ҵ GNU Parted bug뽫а汾 (%s) Ϣ bug 淢͵ "
+#~ "bug-parted@gnu.org\n"
+
+#, fuzzy
+#~ msgid ""
+#~ "You requested to create a partition at %s - %s. The closest Parted can "
+#~ "manage is %s - %s."
+#~ msgstr ""
+#~ "Ҫ %.3f - %.3fMb λôɹΪ %.3f-%.3fMb"
+
+#, fuzzy
+#~ msgid ""
+#~ "You requested to resize the partition to %s - %s. The closest Parted can "
+#~ "manage is %s - %s."
+#~ msgstr ""
+#~ "Ҫ󽫷ıС浽 %.3f - %.3fMbɹӽķΪ %.3f - "
+#~ "%.3fMb"
+
+#~ msgid "SCSI"
+#~ msgstr "SCSI"
+
+#~ msgid "File system has an invalid signature for a FAT file systems."
+#~ msgstr "ļϵͳЧ FAT ļϵͳǩ"
+
+#~ msgid "Minor Start End "
+#~ msgstr "Minor ʼ ֹ "
+
+#~ msgid "Type "
+#~ msgstr " "
+
+#~ msgid "Filesystem "
+#~ msgstr "ļϵͳ "
+
+#~ msgid "Name "
+#~ msgstr " "
+
+#~ msgid "Device %s is neither a SCSI nor IDE drive."
+#~ msgstr "豸 %s SCSI Ҳ IDE ̡"
+
+#~ msgid "Error reading %s (%s) to determine if partition is mounted."
+#~ msgstr "ΪȷǷضȡ %s (%s) ʱ"
+
+#~ msgid ""
+#~ "Unable to determine if partitions are mounted via /proc/mounts or /etc/"
+#~ "mtab. Make sure you don't attempt to resize or modify mounted file "
+#~ "systems. (Even read-only mounted)"
+#~ msgstr ""
+#~ "޷ȷǷͨ /proc/mounts /etc/mtab صġȷͼ"
+#~ "ıļϵͳĴС޸ļصļϵͳ(ʹֻʽҲ)"
+
+#~ msgid ""
+#~ "Partition %s is being used. Modifying it while it is in use could cause "
+#~ "severe corruption."
+#~ msgstr "ʹ÷ %sʹʱ޸صƻ"
+
+#~ msgid "Could not read geometry of %s - %s."
+#~ msgstr "޷ȡ %s - %s ļνṹ"
+
+#~ msgid "Device %s has dodgey geometry."
+#~ msgstr "豸 %s ļνṹ֡"
+
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. However, the most likely reason is that Linux "
+#~ "detected the BIOS geometry for %s incorrectly. GNU Parted suspects the "
+#~ "real geometry should be %d/%d/%d (not %d/%d/%d). You should check with "
+#~ "your BIOS first, as this may not be correct. You can inform Linux by "
+#~ "adding the parameter %s=%d,%d,%d to the command line. See the LILO or "
+#~ "GRUB documentation for more information. If you think Parted's suggested "
+#~ "geometry is correct, you may select Ignore to continue (and fix Linux "
+#~ "later). Otherwise, select Cancel (and fix Linux and/or the BIOS now)."
+#~ msgstr ""
+#~ "%s ϵķЭԭܶࡣȻܵԭ Linux "
+#~ " BIOS %s ļνṹǴġGNU Parted ʵʵļνṹΪ %d/%"
+#~ "d/%d ( %d/%d/%d)Ϊ BIOS ܲȷӦȼ BIOS"
+#~ "ͨӲ %s=%d,%d,%d ֪ͨ Linuxμ LILO "
+#~ "GRUB ĵΪ Parted ļνṹȷģԺԲ "
+#~ "(Ժ Linux)ѡ ( Linux / BIOS)"
+
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. Often, the reason is that Linux detected the "
+#~ "BIOS geometry incorrectly. However, this does not appear to be the case "
+#~ "here. It is safe to ignore,but ignoring may cause (fixable) problems "
+#~ "with some boot loaders, and may cause problems with FAT file systems. "
+#~ "Using LBA is recommended."
+#~ msgstr ""
+#~ "%s ϵķЭܵԭкܶࡣͨԭ Linux "
+#~ " BIOS νṹǴġȻƺǰȫģ"
+#~ "ǺԿܵijЩ (޸)ܵ FAT ļϵͳ"
+#~ "⡣ʹ LBA"
+
+#~ msgid ""
+#~ "Unable to align partition properly. This probably means that another "
+#~ "partitioning tool generated an incorrect partition table, because it "
+#~ "didn't have the correct BIOS geometry. It is safe to ignore,but ignoring "
+#~ "may cause (fixable) problems with some boot loaders."
+#~ msgstr ""
+#~ "޷ȷضζûеõȷ BIOS ν"
+#~ "˴ķǰȫģԿܵijЩֿ"
+#~ "⡣"
+
+#~ msgid ""
+#~ " You have Windows FAT partition(s) that are not using LBA. If your BIOS "
+#~ "supports LBA, then you should switch to LBA by setting the LBA flag on "
+#~ "all FAT partitions. Otherwise, make sure the operating system and the "
+#~ "BIOS have the same geometry before resizing any FAT partitions."
+#~ msgstr ""
+#~ "ʹ˲ʹ LBA Windows FAT BIOS ֧ LBAôӦ"
+#~ "ͨ FAT LBA ־л LBA ģʽڸıκ FAT "
+#~ "Сʱȷϲϵͳ BIOS ʹͬļνṹ"
+
+#~ msgid ""
+#~ "The operating system thinks the geometry on %s is %d/%d/%d. Therefore, "
+#~ "cylinder 1024 ends at %.3fM.%s"
+#~ msgstr ""
+#~ "ϵͳΪ %s ļνṹΪ %d/%d/%dˣ 1024 %.3fM.%s"
+
+#~ msgid "The operating system thinks the geometry on %s is %d/%d/%d.%s"
+#~ msgstr "ϵͳΪ %s ļνṹ %d/%d/%d.%s"
diff --git a/po/zh_TW.po b/po/zh_TW.po
new file mode 100644
index 0000000..2133e2a
--- /dev/null
+++ b/po/zh_TW.po
@@ -0,0 +1,2413 @@
+# Traditional Chinese Messages for parted
+# Copyright (C) 2003, 05 Free Software Foundation, Inc.
+# Wang Li <charles@linux.net.cn>, 2003
+# Wei-Lun Chao <chaoweilun@pcmail.com.tw>, 2005
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: parted 1.6.6\n"
+"Report-Msgid-Bugs-To: bug-parted@gnu.org\n"
+"POT-Creation-Date: 2006-04-21 21:20+0200\n"
+"PO-Revision-Date: 2005-06-09 15:34+0800\n"
+"Last-Translator: Wei-Lun Chao <chaoweilun@pcmail.com.tw>\n"
+"Language-Team: Chinese (traditional) <zh-l10n@linux.org.tw>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+#: libparted/arch/linux.c:284
+#, c-format
+msgid "Could not stat device %s - %s."
+msgstr "無法對設備 %s - %s 進行 stat 操作。"
+
+#: libparted/arch/linux.c:390
+#, c-format
+msgid ""
+"Could not determine sector size for %s: %s.\n"
+"Using the default sector size (%lld)."
+msgstr ""
+
+#: libparted/arch/linux.c:401
+#, c-format
+msgid ""
+"Device %s has a logical sector size of %lld. Not all parts of GNU Parted "
+"support this at the moment, and the working code is HIGHLY EXPERIMENTAL.\n"
+msgstr ""
+
+#: libparted/arch/linux.c:441
+#, fuzzy, c-format
+msgid "Unable to determine the size of %s (%s)."
+msgstr "無法確定 %s (%s) 的大小"
+
+#: libparted/arch/linux.c:530
+#, c-format
+msgid "Could not get identity of device %s - %s"
+msgstr "無法獲取設備 %s - %s 的標識"
+
+#: libparted/arch/linux.c:539
+msgid "Generic IDE"
+msgstr ""
+
+#: libparted/arch/linux.c:556
+#, c-format
+msgid ""
+"Device %s has multiple (%d) logical sectors per physical sector.\n"
+"GNU Parted supports this EXPERIMENTALLY for some special disk label/file "
+"system combinations, e.g. GPT and ext2/3.\n"
+"Please consult the web site for up-to-date information."
+msgstr ""
+
+#: libparted/arch/linux.c:726
+#, c-format
+msgid "Error initialising SCSI device %s - %s"
+msgstr "初始化 SCSI 設備 %s - %s 出錯"
+
+#: libparted/arch/linux.c:781
+#, fuzzy, c-format
+msgid ""
+"The device %s has zero length, and can't possibly store a file system or "
+"partition table. Perhaps you selected the wrong device?"
+msgstr ""
+"設備 %s 的長度為零,因此無法保存檔案系統或分割區表。可能您選擇了錯誤的設備?"
+
+#: libparted/arch/linux.c:829
+msgid ""
+"Unable to determine geometry of file/device. You should not use Parted "
+"unless you REALLY know what you're doing!"
+msgstr ""
+"無法確定檔案/設備的幾何結構。除非您確實知道您在做什麼,否則您不該使用 "
+"Parted!"
+
+#: libparted/arch/linux.c:903
+msgid "DAC960 RAID controller"
+msgstr "DAC960 RAID 控制器"
+
+#: libparted/arch/linux.c:908
+msgid "Compaq Smart Array"
+msgstr "Compaq 智慧型陣列"
+
+#: libparted/arch/linux.c:913
+msgid "ATARAID Controller"
+msgstr "ATARAID 控制器"
+
+#: libparted/arch/linux.c:918
+msgid "I2O Controller"
+msgstr "I2O 控制器"
+
+#: libparted/arch/linux.c:923
+msgid "User-Mode Linux UBD"
+msgstr ""
+
+#: libparted/arch/linux.c:933
+msgid "Unknown"
+msgstr "未知"
+
+#: libparted/arch/linux.c:940
+msgid "ped_device_new() Unsupported device type"
+msgstr "ped_device_new() 不支援的設備類型"
+
+#: libparted/arch/linux.c:1041 libparted/arch/gnu.c:264
+#, c-format
+msgid "Error opening %s: %s"
+msgstr "開啟 %s 出錯:%s"
+
+#: libparted/arch/linux.c:1052 libparted/arch/gnu.c:274
+#, c-format
+msgid "Unable to open %s read-write (%s). %s has been opened read-only."
+msgstr "無法開啟 %s 以讀寫 (%s)。%s 已用唯讀的方式開啟。"
+
+#: libparted/arch/linux.c:1160 libparted/arch/linux.c:1228
+#: libparted/arch/gnu.c:452 libparted/arch/gnu.c:550 libparted/arch/gnu.c:678
+#, c-format
+msgid "%s during read on %s"
+msgstr "在讀取 %2$s 期間 %1$s"
+
+#: libparted/arch/linux.c:1199
+#, c-format
+msgid "%s during seek for read on %s"
+msgstr "在為讀取 %2$s 而呼叫 seek 時 %1$s"
+
+#: libparted/arch/linux.c:1270 libparted/arch/linux.c:1355
+#: libparted/arch/linux.c:1413 libparted/arch/gnu.c:587
+#: libparted/arch/gnu.c:632 libparted/arch/gnu.c:709
+#, c-format
+msgid "%s during write on %s"
+msgstr "在寫入 %2$s 時 %1$s"
+
+#: libparted/arch/linux.c:1297 libparted/arch/gnu.c:512
+#, c-format
+msgid "Can't write to %s, because it is opened read-only."
+msgstr "由於 %s 是以唯讀方式開啟的,因此無法寫入。"
+
+#: libparted/arch/linux.c:1321
+#, c-format
+msgid "%s during seek for write on %s"
+msgstr "在為寫入 %2$s 呼叫 seek 時 %1$s"
+
+#: libparted/arch/linux.c:1798
+#, fuzzy, c-format
+msgid ""
+"Error informing the kernel about modifications to partition %s -- %s. This "
+"means Linux won't know about any changes you made to %s until you reboot -- "
+"so you shouldn't mount it or use it in any way before rebooting."
+msgstr ""
+"通知核心關於分割區 %s - %s 的修改時出錯。這意味著 Linux 在重新啟動之前無法知"
+"道您針對 %s 所作的任何修改 - 所以您也不能在重新啟動之前掛載或以任何方式使用"
+"它。"
+
+#: libparted/arch/linux.c:1879
+#, fuzzy, c-format
+msgid ""
+"The kernel was unable to re-read the partition table on %s (%s). This means "
+"Linux won't know anything about the modifications you made until you "
+"reboot. You should reboot your computer before doing anything with %s."
+msgstr ""
+"核心無法重新讀取 %s (%s) 上的分割區表。這意味這 Linux 在您重新啟動之前無法知"
+"道任何修改。您應該在對 %s 做任何操作 之前重新啟動您的電腦。"
+
+#: libparted/arch/gnu.c:97
+#, c-format
+msgid "Unable to open %s."
+msgstr "無法開啟 %s。"
+
+#: libparted/arch/gnu.c:117
+msgid "Unable to probe store."
+msgstr "無法偵測儲存設備。"
+
+#: libparted/arch/gnu.c:355
+#, fuzzy
+msgid ""
+"The partition table cannot be re-read. This means you need to reboot before "
+"mounting any modified partitions. You also need to reinstall your boot "
+"loader before you reboot (which may require mounting modified partitions). "
+"It is impossible do both things! So you'll need to boot off a rescue disk, "
+"and reinstall your boot loader from the rescue disk. Read section 4 of the "
+"Parted User documentation for more information."
+msgstr ""
+"無法重新讀入分割區表,同樣,您必須在掛載任何修改過的分割區之前重新啟動。您還"
+"需要在您重新啟動之前重新安裝開機載入程式 (它可能需要掛載修改過的分割區)。同時"
+"做這兩件事是不可能的!所以您就需要從回復碟片啟動,並從回復碟片重新安裝您的開"
+"機載入程式。更多詳情請參閱 Parted 使用者文件的第四節。"
+
+#: libparted/arch/gnu.c:372
+#, fuzzy, c-format
+msgid ""
+"The partition table on %s cannot be re-read (%s). This means the Hurd knows "
+"nothing about any modifications you made. You should reboot your computer "
+"before doing anything with %s."
+msgstr ""
+"%s (%s) 上的分割區表。這意味著 Hurd 不知道任何您所作的修改。您應該在對 %s 做"
+"任何操作之前重新啟動您的電腦。"
+
+#: libparted/arch/gnu.c:383 parted/parted.c:2215
+msgid ""
+"You should reinstall your boot loader before rebooting. Read section 4 of "
+"the Parted User documentation for more information."
+msgstr ""
+"您應該在重新啟動之前重新安裝您的開機載入程式。詳情請閱讀 Parted 使用者文件的"
+"第四節。"
+
+#: libparted/arch/gnu.c:774
+#, c-format
+msgid "%s trying to sync %s to disk"
+msgstr "%s 試圖將 %s 同步到磁碟上"
+
+#: libparted/disk.c:183
+#, c-format
+msgid "Unable to open %s - unrecognised disk label."
+msgstr "無法開啟 %s - 無法識別的磁碟標籤。"
+
+#: libparted/disk.c:452
+#, c-format
+msgid ""
+"This libparted doesn't have write support for %s. Perhaps it was compiled "
+"read-only."
+msgstr "這個 libparted 不支援對 %s 的寫入操作。可能它是以唯讀方式編譯的。"
+
+#: libparted/disk.c:579
+#, fuzzy, c-format
+msgid "Partition %d is %s, but the file system is %s."
+msgstr "分割區 %d 為 %.3fMb,但檔案系統為 %.3fMb。"
+
+#: libparted/disk.c:1056
+#, c-format
+msgid "%s disk labels do not support extended partitions."
+msgstr "%s 磁碟標籤不支援擴充分割區。"
+
+#: libparted/disk.c:1616
+#, c-format
+msgid "%s disk labels don't support logical or extended partitions."
+msgstr "%s 磁碟標籤不支援邏輯或擴充分割區。"
+
+#: libparted/disk.c:1629
+#, fuzzy
+msgid "Too many primary partitions."
+msgstr "過多的主分割區"
+
+#: libparted/disk.c:1638
+#, c-format
+msgid ""
+"Can't add a logical partition to %s, because there is no extended partition."
+msgstr "由於沒有擴充分割區,無法將邏輯分割區添加到 %s。"
+
+#: libparted/disk.c:1662
+#, fuzzy, c-format
+msgid "Can't have more than one extended partition on %s."
+msgstr "%s 上不能含有多於一個擴充分割區"
+
+#: libparted/disk.c:1672
+msgid "Can't have logical partitions outside of the extended partition."
+msgstr "邏輯分割區不能處於擴充分割區之外。"
+
+#: libparted/disk.c:1697
+#, c-format
+msgid "Can't have a logical partition outside of the extended partition on %s."
+msgstr "%s 上的邏輯分割區不能處於擴充分割區之外。"
+
+#: libparted/disk.c:1707 libparted/disk.c:1761 libparted/disk.c:1927
+#, fuzzy
+msgid "Can't have overlapping partitions."
+msgstr "分割區不能重疊"
+
+#: libparted/disk.c:1715
+msgid "Can't have a primary partition inside an extended partition."
+msgstr "擴充分割區中不能含有主分割區。"
+
+#: libparted/disk.c:2123
+msgid "metadata"
+msgstr "中繼資料"
+
+#: libparted/disk.c:2125
+msgid "free"
+msgstr "自由空間"
+
+#: libparted/disk.c:2127 parted/ui.c:968 parted/ui.c:996
+msgid "extended"
+msgstr "擴充分割區"
+
+#: libparted/disk.c:2129 parted/ui.c:972 parted/ui.c:1000
+msgid "logical"
+msgstr "邏輯分割區"
+
+#: libparted/disk.c:2131 parted/ui.c:964 parted/ui.c:992
+msgid "primary"
+msgstr "主分割區"
+
+#: libparted/disk.c:2147
+msgid "boot"
+msgstr "啟動"
+
+#: libparted/disk.c:2149
+msgid "root"
+msgstr "根"
+
+#: libparted/disk.c:2151
+msgid "swap"
+msgstr "交換分割區"
+
+#: libparted/disk.c:2153
+msgid "hidden"
+msgstr "隱藏分割區"
+
+#: libparted/disk.c:2155
+msgid "raid"
+msgstr "raid"
+
+#: libparted/disk.c:2157
+msgid "lvm"
+msgstr "lvm"
+
+#: libparted/disk.c:2159
+msgid "lba"
+msgstr "lba"
+
+#: libparted/disk.c:2161
+msgid "hp-service"
+msgstr "hp-服務"
+
+#: libparted/disk.c:2163
+msgid "palo"
+msgstr ""
+
+#: libparted/disk.c:2165
+msgid "prep"
+msgstr ""
+
+#: libparted/disk.c:2167
+msgid "msftres"
+msgstr ""
+
+#: libparted/disk.c:2173
+#, fuzzy, c-format
+msgid "Unknown partition flag, %d."
+msgstr "未知的分割區旗標,%d。"
+
+#: libparted/labels/rdb.c:177
+#, c-format
+msgid "%s : Bad checksum on block %llu of type %s."
+msgstr ""
+
+#: libparted/labels/rdb.c:510
+#, c-format
+msgid "%s : Didn't find rdb block, should never happen."
+msgstr ""
+
+#: libparted/labels/rdb.c:595
+#, c-format
+msgid "%s : Loop detected at block %d."
+msgstr ""
+
+#: libparted/labels/rdb.c:614
+#, c-format
+msgid "%s : The %s list seems bad at block %s."
+msgstr ""
+
+#: libparted/labels/rdb.c:703
+#, c-format
+msgid "%s : Failed to list bad blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:711
+#, c-format
+msgid "%s : Failed to list partition blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:719
+#, c-format
+msgid "%s : Failed to list file system blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:727
+#, c-format
+msgid "%s : Failed to list boot blocks."
+msgstr ""
+
+#: libparted/labels/rdb.c:750
+#, c-format
+msgid "Failed to write partition block at %d."
+msgstr ""
+
+#: libparted/labels/rdb.c:1053 libparted/labels/bsd.c:505
+#: libparted/labels/dos.c:1942 libparted/labels/dvh.c:772
+#: libparted/labels/gpt.c:1365 libparted/labels/loop.c:251
+#: libparted/labels/mac.c:1318 libparted/labels/pc98.c:764
+#: libparted/labels/sun.c:704
+msgid "Unable to satisfy all constraints on the partition."
+msgstr "無法滿足分割區的所有限制。"
+
+#: libparted/labels/rdb.c:1081
+#, fuzzy
+msgid "Unable to allocate a partition number."
+msgstr "需要分割區編號。"
+
+#: libparted/labels/bsd.c:530
+#, fuzzy
+msgid "Unable to allocate a bsd disklabel slot."
+msgstr "無法定位 bsd 磁碟標籤槽"
+
+#: libparted/labels/dos.c:812
+#, fuzzy, c-format
+msgid "Invalid partition table on %s -- wrong signature %x."
+msgstr "%s 上的分割區表無效 - 錯誤的簽名 %x"
+
+#: libparted/labels/dos.c:840
+#, c-format
+msgid "Invalid partition table - recursive partition on %s."
+msgstr "無效的分割區表 - %s 出現遞歸分割區。"
+
+#: libparted/labels/dos.c:1300
+msgid "Extended partitions cannot be hidden on msdos disk labels."
+msgstr ""
+
+#: libparted/labels/dos.c:1926
+msgid "Parted can't resize partitions managed by Windows Dynamic Disk."
+msgstr ""
+
+#: libparted/labels/dvh.c:192
+#, fuzzy, c-format
+msgid "%s has no extended partition (volume header partition)."
+msgstr "%s 沒有擴充分割區 (卷頭分割區)。如果您忽略,將刪除所有啟動卷冊。"
+
+#: libparted/labels/dvh.c:315
+msgid "Checksum is wrong, indicating the partition table is corrupt."
+msgstr "總和檢查錯誤,標明分割區表已損壞。"
+
+#: libparted/labels/dvh.c:616
+msgid "Only primary partitions can be root partitions."
+msgstr "只有主分割區可以做為根分割區。"
+
+#: libparted/labels/dvh.c:630
+msgid "Only primary partitions can be swap partitions."
+msgstr "只有主分割區可以是交換分割區。"
+
+#: libparted/labels/dvh.c:644
+msgid "Only logical partitions can be a boot file."
+msgstr "只有邏輯分割區可以是個開機檔案。"
+
+#: libparted/labels/dvh.c:723
+msgid "Only logical partitions (boot files) have a name."
+msgstr "只有邏輯分割區 (開機檔案) 擁有名字。"
+
+#: libparted/labels/dvh.c:814
+msgid "Too many primary partitions"
+msgstr "過多的主分割區"
+
+#: libparted/labels/gpt.c:433
+#, fuzzy, c-format
+msgid ""
+"%s contains GPT signatures, indicating that it has a GPT table. However, it "
+"does not have a valid fake msdos partition table, as it should. Perhaps it "
+"was corrupted -- possibly by a program that doesn't understand GPT partition "
+"tables. Or perhaps you deleted the GPT table, and are now using an msdos "
+"partition table. Is this a GPT partition table?"
+msgstr ""
+"%s 含有 GPT 簽名,標明它含有 GPT 表。然而,它並不像應該的那樣含有有效的偽 "
+"msdos 分割區表。可能它已經損壞 - 可能是不理解 GPT 分割區表的程式導致的。或者"
+"您刪除了 GPT 表,而現在使用 msdos 分割區表。這是 GPT 分割區表嗎?"
+
+#: libparted/labels/gpt.c:625
+#, c-format
+msgid ""
+"The format of the GPT partition table is version %x, which is newer than "
+"what Parted can recognise. Please tell us! bug-parted@gnu.org"
+msgstr ""
+"GPT 分割區表的格式版本為 %x,它比 Parted 所能識別的版本要新。請告訴我們!bug-"
+"parted@gnu.org"
+
+#: libparted/labels/gpt.c:747
+msgid ""
+"The backup GPT table is not at the end of the disk, as it should be. This "
+"might mean that another operating system believes the disk is smaller. Fix, "
+"by moving the backup to the end (and removing the old backup)?"
+msgstr ""
+"備份 GPT 表不像應該的那樣出現在磁碟的末尾。這可能意味者其它操作系統相信磁碟小"
+"一些。經由將備份移動到末尾 (並刪除舊備份) 來修正它?"
+
+#: libparted/labels/gpt.c:782
+#, fuzzy
+msgid ""
+"The primary GPT table is corrupt, but the backup appears OK, so that will be "
+"used."
+msgstr "主 GPT 表損壞,但備份似乎是正確的,所以使用備份。"
+
+#: libparted/labels/gpt.c:790
+#, fuzzy
+msgid ""
+"Both the primary and backup GPT tables are corrupt. Try making a fresh "
+"table, and using Parted's rescue feature to recover partitions."
+msgstr ""
+"主 GPT 和備份 GPT 都損壞了。試圖建立新表並使用 Parted 的回復功能以重建分割區"
+"表。"
+
+#: libparted/labels/mac.c:167
+#, c-format
+msgid "Invalid signature %x for Mac disk labels."
+msgstr "無效的 Mac 磁碟標籤簽名 %x。"
+
+#: libparted/labels/mac.c:212
+msgid "Partition map has no partition map entry!"
+msgstr "分割區映射不含有分割區映射條目!"
+
+#: libparted/labels/mac.c:259
+#, c-format
+msgid "%s is too small for a Mac disk label!"
+msgstr "%s 對 Mac 磁碟標籤來說太小了!"
+
+#: libparted/labels/mac.c:490
+#, c-format
+msgid "Partition %d has an invalid signature %x."
+msgstr "分割區 %d 含有無效的簽名 %x。"
+
+#: libparted/labels/mac.c:508
+#, c-format
+msgid "Partition %d has an invalid length of 0 bytes!"
+msgstr "分割區 %d 含有無效的長度 0 位元組!"
+
+#: libparted/labels/mac.c:536
+#, fuzzy
+msgid "The data region doesn't start at the start of the partition."
+msgstr "資料區並未從分割區的起點開始"
+
+#: libparted/labels/mac.c:553
+#, fuzzy
+msgid "The boot region doesn't start at the start of the partition."
+msgstr "啟動區域並未從分割區的起點開始"
+
+#: libparted/labels/mac.c:567
+msgid "The partition's boot region doesn't occupy the entire partition."
+msgstr "分割區的啟動區域並未佔用整個分割區。"
+
+#: libparted/labels/mac.c:577
+msgid "The partition's data region doesn't occupy the entire partition."
+msgstr "分割區的資料區域並未佔用整個分割區。"
+
+#: libparted/labels/mac.c:631
+#, c-format
+msgid ""
+"Weird block size on device descriptor: %d bytes is not divisible by 512."
+msgstr "設備描述中出現古怪的區塊大小:%d 位元組不能被 512 整除。"
+
+#: libparted/labels/mac.c:644
+#, c-format
+msgid ""
+"The driver descriptor says the physical block size is %d bytes, but Linux "
+"says it is %d bytes."
+msgstr "磁碟描述表明物理區塊大小為 %d 位元組,但 Linux 認為它是 %d 位元組。"
+
+#: libparted/labels/mac.c:692
+msgid "No valid partition map found."
+msgstr "找不到有效的分割區映射。"
+
+#: libparted/labels/mac.c:744
+#, fuzzy, c-format
+msgid ""
+"Conflicting partition map entry sizes! Entry 1 says it is %d, but entry %d "
+"says it is %d!"
+msgstr "分割區映射條目大小衝突!條目 1 說它是 %d,但條目 %d 說它是 %d!"
+
+#: libparted/labels/mac.c:771
+#, fuzzy
+msgid "Weird! There are 2 partitions map entries!"
+msgstr "奇怪 - 兩個分割區映射條目!"
+
+#: libparted/labels/mac.c:1257
+msgid ""
+"Changing the name of a root or swap partition will prevent Linux from "
+"recognising it as such."
+msgstr "改變根分割區或交換分割區的名稱將導致 Linux 無法識別它。"
+
+#: libparted/labels/mac.c:1353
+#, fuzzy
+msgid "Can't add another partition -- the partition map is too small!"
+msgstr "無法添加另一個分割區 - 分割區映射過小!"
+
+#: libparted/labels/pc98.c:357
+#, fuzzy, c-format
+msgid "Invalid partition table on %s."
+msgstr "%s 的分割區表無效"
+
+#: libparted/labels/pc98.c:409 libparted/labels/pc98.c:487
+#, fuzzy, c-format
+msgid ""
+"Partition %d isn't aligned to cylinder boundaries. This is still "
+"unsupported."
+msgstr "分割區 %d 並未對齊到磁柱邊界。需要添加對它的支援。"
+
+#: libparted/labels/pc98.c:796
+msgid "Can't add another partition."
+msgstr "無法添加其它分割區。"
+
+#: libparted/labels/sun.c:143
+msgid "Corrupted Sun disk label detected."
+msgstr "偵測到損壞了的 Sun 磁碟標籤。"
+
+#: libparted/labels/sun.c:264
+#, fuzzy, c-format
+msgid ""
+"The disk CHS geometry (%d,%d,%d) reported by the operating system does not "
+"match the geometry stored on the disk label (%d,%d,%d)."
+msgstr ""
+"磁碟 CHS 幾何結構 (%d,%d,%d) 與保存在磁碟標籤 (%d,%d,%d) 中的幾何結構不符合。"
+
+#: libparted/labels/sun.c:286
+#, c-format
+msgid "The disk label describes a disk bigger than %s."
+msgstr "磁碟標籤描述的磁碟大於 %s。"
+
+#: libparted/labels/sun.c:440
+#, c-format
+msgid "The disk has %d cylinders, which is greater than the maximum of 65536."
+msgstr ""
+
+#: libparted/labels/sun.c:736
+msgid ""
+"The Whole Disk partition is the only available one left. Generally, it is "
+"not a good idea to overwrite this partition with a real one. Solaris may "
+"not be able to boot without it, and SILO (the sparc boot loader) appreciates "
+"it as well."
+msgstr ""
+"整個磁碟分割區是惟一還留下可用的區塊。一般而言,以真實的區塊來覆寫這塊分割區 "
+"並不是個好主意。沒有了它,Solaris 也許就無法開機,並且 SILO (sparc 開機載入程"
+"式) 也會因此而感激的。"
+
+#: libparted/labels/sun.c:751
+msgid "Sun disk label is full."
+msgstr "Sun 磁碟標籤已滿。"
+
+#: libparted/filesys.c:386
+msgid "Could not detect file system."
+msgstr "無法偵測檔案系統。"
+
+#: libparted/filesys.c:397
+#, fuzzy
+msgid "The file system is bigger than its volume!"
+msgstr "檔案系統比它的卷冊還大!"
+
+#: libparted/filesys.c:405
+#, c-format
+msgid "Support for opening %s file systems is not implemented yet."
+msgstr "開啟 %s 檔案系統的支援尚未實作。"
+
+#: libparted/filesys.c:447
+#, c-format
+msgid "Support for creating %s file systems is not implemented yet."
+msgstr "建立 %s 檔案系統的支援尚未實作。"
+
+#: libparted/filesys.c:508
+#, c-format
+msgid "Support for checking %s file systems is not implemented yet."
+msgstr "檢查 %s 檔案系統的支援尚未實作。"
+
+#: libparted/filesys.c:574
+msgid "raw block copying"
+msgstr "原始區塊複製"
+
+#: libparted/filesys.c:585
+msgid "growing file system"
+msgstr "正在擴大檔案系統"
+
+#: libparted/filesys.c:625
+msgid "Can't copy onto an overlapping partition."
+msgstr "無法複製到重疊的分割區。"
+
+#: libparted/filesys.c:647
+#, fuzzy, c-format
+msgid ""
+"Direct support for copying file systems is not yet implemented for %s. "
+"However, support for resizing is implemented. Therefore, the file system "
+"can be copied if the new partition is at least as big as the old one. So, "
+"either shrink the partition you are trying to copy, or copy to a bigger "
+"partition."
+msgstr ""
+"對 %s 來說尚不直接支援它的檔案系統複製。然而,改變大小的支援已實作完成。因"
+"此,只要新分割區比舊分割區大,就能夠複製檔案系統。所以,縮小您試圖複製的分割"
+"區,或是複製到較大的分割區。"
+
+#: libparted/filesys.c:661
+#, c-format
+msgid "Support for copying %s file systems is not implemented yet."
+msgstr "複製 %s 檔案系統的支援尚未實作。"
+
+#: libparted/filesys.c:699
+#, c-format
+msgid "Support for resizing %s file systems is not implemented yet."
+msgstr "改變 %s 檔案系統的支援尚未實作。"
+
+#: libparted/exception.c:78
+msgid "Information"
+msgstr "資訊"
+
+#: libparted/exception.c:79
+msgid "Warning"
+msgstr "警告"
+
+#: libparted/exception.c:80
+msgid "Error"
+msgstr "錯誤"
+
+#: libparted/exception.c:81
+msgid "Fatal"
+msgstr "致命錯誤"
+
+#: libparted/exception.c:82
+msgid "Bug"
+msgstr "臭蟲"
+
+#: libparted/exception.c:83
+msgid "No Implementation"
+msgstr "未實作"
+
+#: libparted/exception.c:87
+msgid "Fix"
+msgstr "修正"
+
+#: libparted/exception.c:88
+msgid "Yes"
+msgstr "是"
+
+#: libparted/exception.c:89
+msgid "No"
+msgstr "否"
+
+#: libparted/exception.c:90
+msgid "OK"
+msgstr "確認"
+
+#: libparted/exception.c:91
+msgid "Retry"
+msgstr "重試"
+
+#: libparted/exception.c:92
+msgid "Ignore"
+msgstr "忽略"
+
+#: libparted/exception.c:93
+msgid "Cancel"
+msgstr "取消"
+
+#: libparted/exception.c:133
+#, fuzzy, c-format
+msgid ""
+"A bug has been detected in GNU Parted. Refer to the web site of parted "
+"http://www.gnu.org/software/parted/parted.html for more informations of what "
+"could be useful for bug submitting! Please email a bug report to bug-"
+"parted@gnu.org containing at least the version (%s) and the following "
+"message: "
+msgstr ""
+"發現 GNU Parted 中的程式錯誤。請將含有版本 (%s) 和以下資訊的錯誤報告發送到 "
+"bug-parted@gnu.org:"
+
+#: libparted/cs/geom.c:162
+msgid "Can't have the end before the start!"
+msgstr "無法在開始之前結束!"
+
+#: libparted/cs/geom.c:169
+msgid "Can't have a partition outside the disk!"
+msgstr "無法讓分割區超出磁碟!"
+
+#: libparted/cs/geom.c:303
+#, fuzzy, c-format
+msgid "Attempt to read sectors %ld-%ld outside of partition on %s."
+msgstr "試圖讀取 %3$s 上分割區之外的扇區 %1$ld-%2$ld"
+
+#: libparted/cs/geom.c:373
+#, fuzzy, c-format
+msgid "Attempt to write sectors %ld-%ld outside of partition on %s."
+msgstr "試圖寫入 %3$s 上分割區之外的扇區 %1$ld-%2$ld"
+
+#: libparted/cs/geom.c:413 libparted/fs/linux_swap/linux_swap.c:353
+msgid "checking for bad blocks"
+msgstr "檢查壞區塊"
+
+#: libparted/libparted.c:286 libparted/libparted.c:306
+msgid "Out of memory."
+msgstr "記憶體耗盡。"
+
+#: libparted/unit.c:139
+msgid "Cannot get unit size for special unit 'COMPACT'."
+msgstr ""
+
+#: libparted/unit.c:382
+#, c-format
+msgid "\"%s\" has invalid syntax for locations."
+msgstr ""
+
+#: libparted/unit.c:390
+#, c-format
+msgid "The maximum head value is %d."
+msgstr ""
+
+#: libparted/unit.c:397
+#, c-format
+msgid "The maximum sector value is %d."
+msgstr ""
+
+#: libparted/unit.c:409 libparted/unit.c:540
+#, c-format
+msgid "The location %s is outside of the device %s."
+msgstr ""
+
+#: libparted/unit.c:522
+msgid "Invalid number."
+msgstr ""
+
+#: libparted/fs/ext2/ext2.c:87 libparted/fs/ext2/ext2.c:112
+msgid "Inconsistent group descriptors!"
+msgstr "不一致的群組描述符號!"
+
+#: libparted/fs/ext2/ext2.c:91 libparted/fs/ext2/ext2.c:116
+#, fuzzy
+msgid "File system full!"
+msgstr "檔案系統已滿!"
+
+#: libparted/fs/ext2/ext2.c:750
+#, fuzzy
+msgid "Invalid superblock. Are you sure this is an ext2 file system?"
+msgstr "無效的超區塊。您確信它是一個 ext2 檔案系統?"
+
+#: libparted/fs/ext2/ext2.c:764 libparted/fs/ext2/ext2_resize.c:597
+#, fuzzy
+msgid "File system has errors! You should run e2fsck."
+msgstr "檔案系統錯誤!您應該執行 e2fsck。"
+
+#: libparted/fs/ext2/ext2.c:775
+#, fuzzy
+msgid ""
+"File system was not cleanly unmounted! You should run e2fsck. Modifying an "
+"unclean file system could cause severe corruption."
+msgstr ""
+"檔案系統沒有被乾淨地卸載!您應該執行 e2fsck。修改不乾淨的檔案系統可能導致嚴重"
+"的損壞。"
+
+#: libparted/fs/ext2/ext2.c:795
+#, fuzzy
+msgid "File system has an incompatible feature enabled."
+msgstr "檔案系統啟用了不相容的功能"
+
+#: libparted/fs/ext2/ext2.c:806
+msgid "Error allocating buffer cache."
+msgstr "分配緩衝區快取時發生錯誤。"
+
+#: libparted/fs/ext2/ext2.c:848
+msgid ""
+"A resize operation on this file system will use EXPERIMENTAL code that MAY "
+"CORRUPT it (although it hasn't done so yet).You should at least backup your "
+"data and run 'e2fsck -f' afterwards."
+msgstr ""
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:114
+#, fuzzy
+msgid ""
+"Found an inode with a incorrect link count. Better go run e2fsck first!"
+msgstr "找到帶有錯誤連結計數的 inode。最好先執行 e2fsck。"
+
+#: libparted/fs/ext2/ext2_inode_relocator.c:487
+msgid "Not enough free inodes!"
+msgstr "沒有足夠的自由 inodes!"
+
+#: libparted/fs/ext2/ext2_resize.c:224
+#, fuzzy
+msgid "File system is too full to remove a group!"
+msgstr "檔案系統被過度佔用,以致無法刪除整組!"
+
+#: libparted/fs/ext2/ext2_resize.c:233
+#, fuzzy
+msgid "File system has too many allocated inodes to remove a group!"
+msgstr "檔案系統中已使用的 inode 過多,以致無法刪除整組!"
+
+#: libparted/fs/ext2/ext2_resize.c:493
+msgid "adding groups"
+msgstr "添加群組"
+
+#: libparted/fs/ext2/ext2_resize.c:530
+#, fuzzy, c-format
+msgid "Your file system is too full to resize it to %i blocks. Sorry."
+msgstr "您的檔案系統被過度佔用,以致無法將它的大小改變為 %i 個區塊。抱歉。"
+
+#: libparted/fs/ext2/ext2_resize.c:540
+#, fuzzy, c-format
+msgid ""
+"Your file system has too many occupied inodes to resize it to %i blocks. "
+"Sorry."
+msgstr ""
+"您的檔案系統中已使用的 inode 過多,以致無法將其大小改變為 %i 個區塊。抱歉。"
+
+#: libparted/fs/ext2/ext2_resize.c:554 libparted/fs/hfs/hfs.c:243
+#: libparted/fs/hfs/hfs.c:624
+msgid "shrinking"
+msgstr "正在縮小"
+
+#: libparted/fs/ext2/ext2_resize.c:605
+#, fuzzy
+msgid "File system was not cleanly unmounted! You should run e2fsck."
+msgstr "檔案系統沒有乾淨地卸載!您應該執行 e2fsck。"
+
+#: libparted/fs/ext2/ext2_resize.c:614
+msgid ""
+"The file system has the 'dir_index' feature enabled. Parted can only resize "
+"the file system if it disables this feature. You can enable it later by "
+"running 'tune2fs -O dir_index DEVICE' and then 'e2fsck -fD DEVICE'."
+msgstr ""
+"檔案系統已啟用「dir_index」的特殊功能。只有當此特性停用時,Parted 才能改變檔"
+"案系統的大小。您可以在稍後利用執行「tune2fs -O dir_index DEVICE」來啟用它,然"
+"後接著「e2fsck -fD DEVICE」。"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:198
+#, fuzzy
+msgid "Cross-linked blocks found! Better go run e2fsck first!"
+msgstr "發現交叉連結區塊!最好先執行 e2fsck!"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:537
+#, fuzzy, c-format
+msgid "Block %i has no reference? Weird."
+msgstr "區塊 %i 沒有被參照?奇怪"
+
+#: libparted/fs/ext2/ext2_block_relocator.c:738
+#, c-format
+msgid "Block %i shouldn't have been marked!"
+msgstr "區塊 %i 不應該已被標記!"
+
+#: libparted/fs/ext2/interface.c:188
+#, fuzzy
+msgid ""
+"The ext2 file system passed a basic check. For a more comprehensive check, "
+"use the e2fsck program."
+msgstr "ext2 檔案系統通過了基本檢查。至於更完整的檢查,請使用 e2fsck 程式。"
+
+#: libparted/fs/ext2/interface.c:205
+msgid "Sorry, can't move the start of ext2 partitions yet!"
+msgstr "抱歉,尚無法移動 ext2 分割區的起點!"
+
+#: libparted/fs/ext2/ext2_buffer.c:82
+msgid "Couldn't flush buffer cache!"
+msgstr "無法排空緩衝區快取!"
+
+#: libparted/fs/ext2/ext2_mkfs.c:162
+msgid "writing per-group metadata"
+msgstr "寫入個別群組的中繼資料"
+
+#: libparted/fs/ext2/ext2_mkfs.c:565
+msgid "File system too small for ext2."
+msgstr "對 ext2 來說檔案系統過小。"
+
+#: libparted/fs/fat/calc.c:134
+#, fuzzy, c-format
+msgid ""
+"You need %s of free disk space to shrink this partition to this size. "
+"Currently, only %s is free."
+msgstr ""
+"您需要 %dM 的自由空間來將此分割區收縮到這一大小 (您目前只有 %dM 的自由空間)"
+
+#: libparted/fs/fat/context.c:55
+#, c-format
+msgid ""
+"Cluster start delta = %d, which is not a multiple of the cluster size %d."
+msgstr "磁簇起始偏移 = %d,不是磁簇大小 %d 的整數倍。"
+
+#: libparted/fs/fat/fat.c:312
+#, fuzzy, c-format
+msgid "Partition too big/small for a %s file system."
+msgstr "對於 %s 檔案系統來說,分割區過大或過小"
+
+#: libparted/fs/fat/fat.c:478
+msgid ""
+"The FATs don't match. If you don't know what this means, then select "
+"cancel, run scandisk on the file system, and then come back."
+msgstr ""
+"FAT 不相符合。如果你不知道它的含義,請選擇取消,並對檔案系統執行 scandisk,然"
+"後再回到這裡來。"
+
+#: libparted/fs/fat/fat.c:518
+msgid "There are no possible configurations for this FAT type."
+msgstr "對於此 FAT 類型沒有可能的配置。"
+
+#: libparted/fs/fat/fat.c:530
+#, c-format
+msgid ""
+"File system doesn't have expected sizes for Windows to like it. Cluster "
+"size is %dk (%dk expected); number of clusters is %d (%d expected); size of "
+"FATs is %d sectors (%d expected)."
+msgstr ""
+"檔案系統的大小不是 Windows 所希望的。磁簇大小為 %dk (期望 %dk);磁簇數量為 %"
+"d (期望 %d);FAT 的大小為 %d 扇區 (期望 %d)。"
+
+#: libparted/fs/fat/fat.c:553
+#, c-format
+msgid ""
+"File system is reporting the free space as %d clusters, not %d clusters."
+msgstr "檔案系統報告自由空間為 %d 磁簇,而不是 %d 磁簇。"
+
+#: libparted/fs/fat/fat.c:878
+#, fuzzy
+msgid ""
+"GNU Parted was miscompiled: the FAT boot sector should be 512 bytes. FAT "
+"support will be disabled."
+msgstr "GNU parted 編譯錯誤:FAT 啟動扇區應為 512 位元組。FAT 支援將被關閉。"
+
+#: libparted/fs/fat/resize.c:158
+#, fuzzy
+msgid ""
+"There's not enough room in the root directory for all of the files. Either "
+"cancel, or ignore to lose the files."
+msgstr "根目錄下沒有保存所有檔案的足夠空間。取消或者以損失檔案為代價忽略它。"
+
+#: libparted/fs/fat/resize.c:299
+msgid "Error writing to the root directory."
+msgstr "寫入根目錄時錯誤。"
+
+#: libparted/fs/fat/resize.c:484
+#, fuzzy
+msgid "If you leave your file system as FAT16, then you will have no problems."
+msgstr "如果將您的檔案系統類型保持 FAT16 不變,那麼你就不會有問題。"
+
+#: libparted/fs/fat/resize.c:487
+msgid ""
+"If you convert to FAT16, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual)."
+msgstr ""
+"如果您轉換為 FAT16,並將 MS Windows 安裝到這個分割區,那麼您必須重新安裝 MS "
+"Windows 開機載入程式。如果您打算這麼做,您應該參閱 Parted 的手冊 (或您的發行"
+"版手冊)。"
+
+#: libparted/fs/fat/resize.c:495
+msgid ""
+"If you leave your file system as FAT32, then you will not introduce any new "
+"problems."
+msgstr "如果您保持檔案系統類型為 FAT32 不變,那麼您將不會遇到任何新問題。"
+
+#: libparted/fs/fat/resize.c:499
+msgid ""
+"If you convert to FAT32, and MS Windows is installed on this partition, then "
+"you must re-install the MS Windows boot loader. If you want to do this, you "
+"should consult the Parted manual (or your distribution's manual). Also, "
+"converting to FAT32 will make the file system unreadable by MS DOS, MS "
+"Windows 95a, and MS Windows NT."
+msgstr ""
+"如果您轉換為 FAT32,並且 MS Windows 安裝在這個分割區,那麼您必須重新安裝 MS "
+"Windows 的開機載入程式。如果您打算這樣作,您應該參閱 Parted 的手冊 (或者您的"
+"發行版手冊)。此外,將檔案系統轉換為 FAT32,檔案系統就不能夠被 MS DOS、MS "
+"Windows 95a 和 MS Windows NT 所存取。"
+
+#: libparted/fs/fat/resize.c:513
+#, c-format
+msgid "%s %s %s"
+msgstr "%s %s %s"
+
+#: libparted/fs/fat/resize.c:514
+msgid "Would you like to use FAT32?"
+msgstr "您是否願意使用 FAT32?"
+
+#: libparted/fs/fat/resize.c:541 libparted/fs/fat/resize.c:557
+#, c-format
+msgid "%s %s"
+msgstr "%s %s"
+
+#: libparted/fs/fat/resize.c:542
+msgid ""
+"The file system can only be resized to this size by converting to FAT16."
+msgstr "檔案系統的大小只能經由轉換為 FAT16 改變到這一大小。"
+
+#: libparted/fs/fat/resize.c:558
+msgid ""
+"The file system can only be resized to this size by converting to FAT32."
+msgstr "檔案系統的大小只能經由轉換為 FAT32 改變到這一大小。"
+
+#: libparted/fs/fat/resize.c:571
+#, fuzzy
+msgid ""
+"GNU Parted cannot resize this partition to this size. We're working on it!"
+msgstr "GNU Parted 無法將此分割區轉換到這一大小。我們正在努力中!"
+
+#: libparted/fs/fat/bootsector.c:48 libparted/fs/fat/bootsector.c:55
+msgid "File system has an invalid signature for a FAT file system."
+msgstr "檔案系統含有無效的 FAT 檔案系統簽名。"
+
+#: libparted/fs/fat/bootsector.c:62
+msgid "File system has an invalid sector size for a FAT file system."
+msgstr "檔案系統的扇區大小對 FAT 檔案系統來說無效。"
+
+#: libparted/fs/fat/bootsector.c:69
+msgid "File system has an invalid cluster size for a FAT file system."
+msgstr "檔案系統的磁簇大小對 FAT 檔案系統來說無效。"
+
+#: libparted/fs/fat/bootsector.c:76
+#, fuzzy
+msgid ""
+"File system has an invalid number of reserved sectors for a FAT file system."
+msgstr "檔案系統的保留扇區數對 FAT 檔案系統來說無效。"
+
+#: libparted/fs/fat/bootsector.c:83
+#, fuzzy
+msgid "File system has an invalid number of FATs."
+msgstr "檔案系統的 FATS 數量無效。"
+
+#: libparted/fs/fat/bootsector.c:138
+#, c-format
+msgid ""
+"This file system has a logical sector size of %d. GNU Parted is known not "
+"to work properly with sector sizes other than 512 bytes."
+msgstr ""
+"此檔案系統的邏輯扇區大小為 %d。GNU Parted 無法在扇區大小不是 512 位元組的情況"
+"下正確工作。"
+
+#: libparted/fs/fat/bootsector.c:163
+#, c-format
+msgid ""
+"The file system's CHS geometry is (%d, %d, %d), which is invalid. The "
+"partition table's CHS geometry is (%d, %d, %d). If you select Ignore, the "
+"file system's CHS geometry will be left unchanged. If you select Fix, the "
+"file system's CHS geometry will be set to match the partition table's CHS "
+"geometry."
+msgstr ""
+
+#: libparted/fs/fat/bootsector.c:209
+msgid "FAT boot sector says logical sector size is 0. This is weird. "
+msgstr "FAT 啟動扇區聲稱邏輯扇區的大小為零。這很奇怪。"
+
+#: libparted/fs/fat/bootsector.c:215
+msgid "FAT boot sector says there are no FAT tables. This is weird. "
+msgstr "FAT 啟動扇區聲稱沒有 FAT 表。這很奇怪。"
+
+#: libparted/fs/fat/bootsector.c:221
+msgid "FAT boot sector says clusters are 0 sectors. This is weird. "
+msgstr "FAT 啟動扇區聲稱磁簇具有零扇區。這很奇怪。"
+
+#: libparted/fs/fat/bootsector.c:231
+#, fuzzy
+msgid "File system is FAT12, which is unsupported."
+msgstr "檔案系統為 FAT12,不支援。"
+
+#: libparted/fs/fat/bootsector.c:407
+#, c-format
+msgid ""
+"The information sector has the wrong signature (%x). Select cancel for now, "
+"and send in a bug report. If you're desperate, it's probably safe to ignore."
+msgstr ""
+"資訊扇區的簽名錯誤 (%x)。現在選擇取消,並發送程式錯誤報告。如果您不顧一切,選"
+"擇忽略有可能是「安全」的。"
+
+#: libparted/fs/fat/count.c:149
+#, c-format
+msgid "Bad directory entry for %s: first cluster is the end of file marker."
+msgstr "%s 的目錄條目不當:第一個磁簇就是檔案標記的結束。"
+
+#: libparted/fs/fat/count.c:162
+#, c-format
+msgid ""
+"Bad FAT: unterminated chain for %s. You should run dosfsck or scandisk."
+msgstr "不當的 FAT:%s 的鏈結未結束。您應該執行 dosfsck 或 scandisk。"
+
+#: libparted/fs/fat/count.c:171
+#, fuzzy, c-format
+msgid ""
+"Bad FAT: cluster %d outside file system in chain for %s. You should run "
+"dosfsck or scandisk."
+msgstr ""
+"不當的 FAT:在%2$s 的鏈結中,磁簇 %1$d 處於檔案系統之外。您應該執行 dosfsck "
+"或 scandisk。"
+
+#: libparted/fs/fat/count.c:181
+#, c-format
+msgid ""
+"Bad FAT: cluster %d is cross-linked for %s. You should run dosfsck or "
+"scandisk."
+msgstr "不當的 FAT:磁簇 %d 與 %s 的鏈結交叉。您應該執行 dosfsck 或 scandisk。"
+
+#: libparted/fs/fat/count.c:200
+#, c-format
+msgid "%s is %dk, but it has %d clusters (%dk)."
+msgstr "%s 為 %dk,但含有 %d 個磁簇 (%dk)。"
+
+#: libparted/fs/fat/count.c:263
+#, c-format
+msgid ""
+"The file %s is marked as a system file. This means moving it could cause "
+"some programs to stop working."
+msgstr "檔案 %s 被標記為系統檔案。這意味著移動它可能導致某些程式停止工作。"
+
+#: libparted/fs/fat/table.c:138
+#, c-format
+msgid ""
+"FAT %d media %x doesn't match the boot sector's media %x. You should "
+"probably run scandisk."
+msgstr ""
+"FAT %d 媒體 %x 和啟動扇區所在的媒體 %x 不符合。您可能應該執行 scandisk。"
+
+#: libparted/fs/fat/table.c:268
+#, fuzzy, c-format
+msgid "fat_table_set: cluster %ld outside file system"
+msgstr "fat_table_set:磁簇 %ld 處於檔案系統之外"
+
+#: libparted/fs/fat/table.c:296
+#, fuzzy, c-format
+msgid "fat_table_get: cluster %ld outside file system"
+msgstr "fat_table_get:磁簇 %ld 處於檔案系統之外"
+
+#: libparted/fs/fat/table.c:334
+msgid "fat_table_alloc_cluster: no free clusters"
+msgstr "fat_table_alloc_cluster:沒有自由磁簇"
+
+#: libparted/fs/linux_swap/linux_swap.c:236
+#, c-format
+msgid "Unrecognised linux swap signature '%10s'."
+msgstr "無法識別的 linux 交換簽名「%10s」。"
+
+#: libparted/fs/linux_swap/linux_swap.c:312
+msgid "Too many bad pages."
+msgstr "過多的不當分頁。"
+
+#: libparted/fs/hfs/advfs.c:123 libparted/fs/hfs/advfs_plus.c:125
+#: libparted/fs/hfs/reloc.c:416 libparted/fs/hfs/reloc.c:510
+#: libparted/fs/hfs/reloc_plus.c:541 libparted/fs/hfs/reloc_plus.c:660
+#: libparted/fs/hfs/reloc_plus.c:774
+msgid "The file system contains errors."
+msgstr ""
+
+#: libparted/fs/hfs/advfs_plus.c:290
+msgid "Bad blocks could not be read."
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:139
+#, c-format
+msgid ""
+"Trying to register an extent starting at block 0x%X, but another one already "
+"exists at this position. You should check the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/cache.c:216
+#, c-format
+msgid ""
+"Trying to move an extent from block Ox%X to block Ox%X, but another one "
+"already exists at this position. This should not happen!"
+msgstr ""
+
+#: libparted/fs/hfs/file.c:145
+#, c-format
+msgid "Could not update the extent cache for HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:182
+#, c-format
+msgid "Trying to read HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:192 libparted/fs/hfs/file.c:222
+#, c-format
+msgid "Could not find sector %lli of HFS file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file.c:212
+#, c-format
+msgid "Trying to write HFS file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:159
+#, c-format
+msgid "Could not update the extent cache for HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:203
+#, c-format
+msgid "Trying to read HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:214 libparted/fs/hfs/file_plus.c:256
+#, c-format
+msgid "Could not find sector %lli of HFS+ file with CNID %X."
+msgstr ""
+
+#: libparted/fs/hfs/file_plus.c:245
+#, c-format
+msgid "Trying to write HFS+ file with CNID %X behind EOF."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:225
+msgid "Sorry, HFS cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:255 libparted/fs/hfs/hfs.c:636
+msgid "Data relocation has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:274
+msgid "Data relocation left some data in the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:313
+#, fuzzy
+msgid "writing HFS Master Directory Block"
+msgstr "寫入根目錄時錯誤。"
+
+#: libparted/fs/hfs/hfs.c:461
+msgid "No valid HFS[+X] signature has been found while opening."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:471
+#, c-format
+msgid "Version %d of HFS+ isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:482
+#, c-format
+msgid "Version %d of HFSX isn't supported."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:667
+msgid "Data relocation left some data at the end of the volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:715
+#, fuzzy
+msgid "Error while writing the allocation file."
+msgstr "寫入根目錄時錯誤。"
+
+#: libparted/fs/hfs/hfs.c:730
+msgid "Error while writing the compatibility part of the allocation file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:745
+msgid "writing HFS+ Volume Header"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:845
+msgid "An error occurred while looking for the mandatory bad blocks file."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:899
+msgid ""
+"It seems there is an error in the HFS wrapper: the bad blocks file doesn't "
+"contain the embedded HFS+ volume."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:930
+msgid "Sorry, HFS+ cannot be resized that way yet."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:965
+msgid "shrinking embedded HFS+ volume"
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:981
+msgid "Resizing the HFS+ volume has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:988
+#, fuzzy
+msgid "shrinking HFS wrapper"
+msgstr "正在縮小"
+
+#: libparted/fs/hfs/hfs.c:997
+msgid "Updating the HFS wrapper has failed."
+msgstr ""
+
+#: libparted/fs/hfs/hfs.c:1099 libparted/fs/hfs/hfs.c:1184
+#, c-format
+msgid ""
+"This is not a real %s check. This is going to extract special low level "
+"files for debugging purposes."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:156
+msgid "Bad block list header checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:169
+#, c-format
+msgid ""
+"Invalid size of a transaction block while replaying the journal (%i bytes)."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:261
+msgid ""
+"Journal stored outside of the volume are not supported. Try to desactivate "
+"the journal and run Parted again."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:272
+#, fuzzy
+msgid "Journal offset or size is not multiple of the sector size."
+msgstr "磁簇起始偏移 = %d,不是磁簇大小 %d 的整數倍。"
+
+#: libparted/fs/hfs/journal.c:290
+msgid "Incorrect magic values in the journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:299
+msgid "Journal size mismatch between journal info block and journal header."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:311
+#, fuzzy
+msgid "Some header fields are not multiple of the sector size."
+msgstr "磁簇起始偏移 = %d,不是磁簇大小 %d 的整數倍。"
+
+#: libparted/fs/hfs/journal.c:320
+msgid ""
+"The sector size stored in the journal is not 512 bytes. Parted only "
+"supports 512 bytes length sectors."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:332
+msgid "Bad journal checksum."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:350
+msgid ""
+"The journal is not empty. Parted must replay the transactions before "
+"opening the file system. This will modify the file system."
+msgstr ""
+
+#: libparted/fs/hfs/journal.c:378
+msgid ""
+"The volume header or the master directory block has changed while replaying "
+"the journal. You should restart Parted."
+msgstr ""
+
+#: libparted/fs/hfs/probe.c:52
+#, c-format
+msgid ""
+"Parted can't use HFS file systems on disks with a sector size not equal to %"
+"d bytes."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:153 libparted/fs/hfs/reloc_plus.c:157
+msgid "An extent has not been relocated."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:253 libparted/fs/hfs/reloc_plus.c:309
+msgid ""
+"A reference to an extent comes from a place it should not. You should check "
+"the file system!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:383
+msgid "This HFS volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:477
+msgid "This HFS volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:519 libparted/fs/hfs/reloc_plus.c:670
+msgid ""
+"The extents overflow file should not contain its own extents! You should "
+"check the file system."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:576 libparted/fs/hfs/reloc_plus.c:849
+#, fuzzy
+msgid "Could not cache the file system in memory."
+msgstr "無法偵測檔案系統。"
+
+#: libparted/fs/hfs/reloc.c:637 libparted/fs/hfs/reloc_plus.c:910
+msgid "Bad blocks list could not be loaded."
+msgstr ""
+
+#: libparted/fs/hfs/reloc.c:651 libparted/fs/hfs/reloc_plus.c:926
+msgid "An error occurred during extent relocation."
+msgstr ""
+
+#: libparted/fs/hfs/reloc_plus.c:497
+msgid "This HFS+ volume has no catalog file. This is very unusual!"
+msgstr ""
+
+#: libparted/fs/hfs/reloc_plus.c:621
+msgid "This HFS+ volume has no extents overflow file. This is quite unusual!"
+msgstr ""
+
+#: parted/parted.c:76
+msgid "displays this help message"
+msgstr "顯示此求助資訊"
+
+#: parted/parted.c:77
+msgid "where necessary, prompts for user intervention"
+msgstr "在必要時,提示使用者介入"
+
+#: parted/parted.c:78
+msgid "never prompts for user intervention"
+msgstr "從不提示使用者介入"
+
+#: parted/parted.c:79
+msgid "displays the version"
+msgstr "顯示版本"
+
+#: parted/parted.c:87
+#, fuzzy
+msgid ""
+"NUMBER is the partition number used by Linux. On MS-DOS disk labels, the "
+"primary partitions number from 1 to 4, logical partitions from 5 onwards.\n"
+msgstr ""
+"MINOR 是 Linux 使用的分割區編號。在 msdos 磁碟標籤中,主分割區編號為 1 - 4,"
+"邏輯分割區從 5 開始。\n"
+
+#: parted/parted.c:90
+msgid "LABEL-TYPE is one of: "
+msgstr "LABEL-TYPE 是以下任意一項:"
+
+#: parted/parted.c:91
+msgid "FLAG is one of: "
+msgstr "FLAG 是以下任意一項:"
+
+#: parted/parted.c:92
+#, fuzzy
+msgid "UNIT is one of: "
+msgstr "FLAG 是以下任意一項:"
+
+#: parted/parted.c:93
+msgid "PART-TYPE is one of: primary, logical, extended\n"
+msgstr "PART-TYPE 是主分割區、邏輯分割區、擴充分割區之一\n"
+
+#: parted/parted.c:95
+msgid "FS-TYPE is one of: "
+msgstr "FS-TYPE 是以下任意一項:"
+
+#: parted/parted.c:96
+#, fuzzy
+msgid ""
+"START and END are disk locations, such as 4GB or 10%. Negative values count "
+"from the end of the disk. For example, -1s specifies exactly the last "
+"sector.\n"
+msgstr "START 和 END 以 MB 為單位。負值表示從磁碟末段開始計數。\n"
+
+#: parted/parted.c:99
+msgid "STATE is one of: on, off\n"
+msgstr "STATE 為:開、關\n"
+
+#: parted/parted.c:100
+msgid "DEVICE is usually /dev/hda or /dev/sda\n"
+msgstr "DEVICE 通常為 /dev/hda 或 /dev/sda\n"
+
+#: parted/parted.c:101
+msgid "NAME is any word you want\n"
+msgstr "NAME 是您需要的任何單詞\n"
+
+#: parted/parted.c:102
+msgid "The partition must have one of the following FS-TYPEs: "
+msgstr ""
+
+#: parted/parted.c:105
+msgid "GNU Parted Version information:\n"
+msgstr ""
+
+#: parted/parted.c:107
+#, fuzzy
+msgid ""
+"Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n"
+"This program is free software, covered by the GNU General Public License.\n"
+"\n"
+"This program is distributed in the hope that it will be useful, but WITHOUT "
+"ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
+"FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
+"more details.\n"
+"\n"
+msgstr ""
+"版權所有 (C) 1998, 1999, 2000, 2001, 2002, 2003 自由軟體基金會。\n"
+"本程式為自由軟體,按 GNU 通用公共許可證發行。\n"
+"\n"
+"發行本程式是希望它能夠有用,但沒有任何擔保;甚至不包括隱含的適銷和適合特定用"
+"途的保證。詳情請參見 GNU 通用公共許可證。\n"
+
+#: parted/parted.c:152
+#, c-format
+msgid "%0.f%%\t(time left %.2d:%.2d)"
+msgstr "%0.f%%\t(剩餘時間 %.2d:%.2d)"
+
+#: parted/parted.c:170
+#, c-format
+msgid ""
+"Partition %s is being used. You must unmount it before you modify it with "
+"Parted."
+msgstr ""
+
+#: parted/parted.c:187
+#, c-format
+msgid "Partition(s) on %s are being used."
+msgstr "正在使用 %s 上的分割區。"
+
+#: parted/parted.c:413 parted/parted.c:594 parted/parted.c:979
+#: parted/parted.c:1059 parted/parted.c:1586 parted/parted.c:1663
+#: parted/parted.c:1707
+msgid "Partition number?"
+msgstr "分割區編號?"
+
+#: parted/parted.c:456
+msgid "Source device?"
+msgstr "來源設備?"
+
+#: parted/parted.c:460
+msgid "Source partition number?"
+msgstr "來源分割區編號?"
+
+#: parted/parted.c:465
+#, fuzzy
+msgid "Can't copy an extended partition."
+msgstr "不能複製擴充分割區。"
+
+#: parted/parted.c:471
+msgid "Destination partition number?"
+msgstr "目標分割區編號?"
+
+#: parted/parted.c:564
+msgid "New disk label type?"
+msgstr "新的磁碟標籤類型?"
+
+#: parted/parted.c:598
+msgid "File system?"
+msgstr "檔案系統?"
+
+#: parted/parted.c:645 parted/parted.c:815
+msgid "Partition type?"
+msgstr "分割區類型?"
+
+#: parted/parted.c:652 parted/parted.c:822 parted/parted.c:1062
+msgid "Partition name?"
+msgstr "分割區名稱?"
+
+#: parted/parted.c:660 parted/parted.c:832
+msgid "File system type?"
+msgstr "檔案系統類型?"
+
+#: parted/parted.c:667 parted/parted.c:834 parted/parted.c:994
+#: parted/parted.c:1544 parted/parted.c:1595
+msgid "Start?"
+msgstr "起始點?"
+
+#: parted/parted.c:669 parted/parted.c:837 parted/parted.c:997
+#: parted/parted.c:1546 parted/parted.c:1597
+msgid "End?"
+msgstr "結束點?"
+
+#: parted/parted.c:707 parted/parted.c:875
+#, fuzzy, c-format
+msgid ""
+"You requested a partition from %s to %s.\n"
+"The closest location we can manage is %s to %s. Is this still acceptable to "
+"you?"
+msgstr ""
+"您要求將分割區移動到 %.3f - %.3fMb。可管理最接近的分割區為 %.3f - %.3fMB。"
+
+#: parted/parted.c:827
+#, fuzzy
+msgid "An extended partition cannot hold a file system. Did you want mkpart?"
+msgstr "擴充分割區不能含有檔案系統。您是要用 mkpart 吧?"
+
+#: parted/parted.c:985
+#, fuzzy
+msgid "Can't move an extended partition."
+msgstr "無法移動擴充分割區。"
+
+#: parted/parted.c:1014
+msgid "Can't move a partition onto itself. Try using resize, perhaps?"
+msgstr "無法將分割區移動到它自身。也許試試改變大小?"
+
+#: parted/parted.c:1158
+#, c-format
+msgid "Minor: %d\n"
+msgstr "Minor:%d\n"
+
+#: parted/parted.c:1159
+#, fuzzy, c-format
+msgid "Flags: %s\n"
+msgstr "旗標:"
+
+#: parted/parted.c:1160
+#, c-format
+msgid "File System: %s\n"
+msgstr "檔案系統:%s\n"
+
+#: parted/parted.c:1161
+#, fuzzy, c-format
+msgid "Size: "
+msgstr "大小: %10.3fMb (%d%%)\n"
+
+#: parted/parted.c:1166
+#, fuzzy, c-format
+msgid "Minimum size: "
+msgstr "最小尺寸: %10.3fMb (%d%%)\n"
+
+#: parted/parted.c:1169
+#, fuzzy, c-format
+msgid "Maximum size: "
+msgstr "最大尺寸: %10.3fMb (%d%%)\n"
+
+#: parted/parted.c:1255
+#, fuzzy, c-format
+msgid "Disk %s: %s\n"
+msgstr "%s %s %s"
+
+#: parted/parted.c:1256
+#, c-format
+msgid "Sector size (logical/physical): %lldB/%lldB\n"
+msgstr ""
+
+#: parted/parted.c:1267
+#, c-format
+msgid "BIOS cylinder,head,sector geometry: %d,%d,%d. Each cylinder is %s.\n"
+msgstr ""
+
+#: parted/parted.c:1273
+#, fuzzy, c-format
+msgid "Partition Table: %s\n"
+msgstr "分割區名稱?"
+
+#: parted/parted.c:1284 parted/parted.c:1287
+msgid "Number"
+msgstr ""
+
+#: parted/parted.c:1284 parted/parted.c:1287
+#, fuzzy
+msgid "Start"
+msgstr "起始點?"
+
+#: parted/parted.c:1285 parted/parted.c:1288
+#, fuzzy
+msgid "End"
+msgstr "結束點?"
+
+#: parted/parted.c:1288
+#, fuzzy
+msgid "Size"
+msgstr "resize"
+
+#: parted/parted.c:1292
+msgid "Type"
+msgstr ""
+
+#: parted/parted.c:1294
+#, fuzzy
+msgid "File system"
+msgstr "檔案系統?"
+
+#: parted/parted.c:1297
+#, fuzzy
+msgid "Name"
+msgstr "name"
+
+#: parted/parted.c:1299
+msgid "Flags"
+msgstr "旗標"
+
+#: parted/parted.c:1352
+msgid "Free Space"
+msgstr ""
+
+#: parted/parted.c:1441
+#, fuzzy, c-format
+msgid ""
+"A %s %s partition was found at %s -> %s. Do you want to add it to the "
+"partition table?"
+msgstr ""
+"在 %3$.3fMb -> %4$.3fMb 處找到一個 %1$s %2$s 分割區。您希望將其添加到分割區表"
+"中嗎?"
+
+#: parted/parted.c:1479
+msgid "searching for file systems"
+msgstr "正在搜索檔案系統"
+
+#: parted/parted.c:1684
+msgid "New device?"
+msgstr "新設備?"
+
+#: parted/parted.c:1709
+#, fuzzy
+msgid "Flag to Invert?"
+msgstr "要修改的旗標?"
+
+#: parted/parted.c:1714
+msgid "New state?"
+msgstr "新狀態?"
+
+#: parted/parted.c:1747
+msgid "Unit?"
+msgstr ""
+
+#: parted/parted.c:1896
+msgid "check"
+msgstr "檢查"
+
+#: parted/parted.c:1899
+#, fuzzy
+msgid ""
+"check NUMBER do a simple check on the file system"
+msgstr "檢查 MINOR 對檔案系統進行一個簡單的檢查"
+
+#: parted/parted.c:1905
+msgid "cp"
+msgstr "cp"
+
+#: parted/parted.c:1908
+#, fuzzy
+msgid ""
+"cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another "
+"partition"
+msgstr "cp [FROM-DEVICE] FROM-MINOR TO-MINOR 將檔案系統複製到另一個分割區"
+
+#: parted/parted.c:1914
+msgid "help"
+msgstr "help"
+
+#: parted/parted.c:1917
+#, fuzzy
+msgid ""
+"help [COMMAND] prints general help, or help on "
+"COMMAND"
+msgstr "help [命令] 印出一般求助資訊,或關於「命令」的資訊"
+
+#: parted/parted.c:1923
+msgid "mklabel"
+msgstr "mklabel"
+
+#: parted/parted.c:1926
+#, fuzzy
+msgid ""
+"mklabel LABEL-TYPE create a new disklabel (partition "
+"table)"
+msgstr "mklabel 標籤類型 建立新的磁碟標籤 (分割區表)"
+
+#: parted/parted.c:1932
+msgid "mkfs"
+msgstr "mkfs"
+
+#: parted/parted.c:1935
+#, fuzzy
+msgid ""
+"mkfs NUMBER FS-TYPE make a FS-TYPE file system on "
+"partititon NUMBER"
+msgstr ""
+"mkfs MINOR 檔案系統類型 在 MINOR 建立類型為「檔案系統類型」的檔案系統"
+
+#: parted/parted.c:1941
+msgid "mkpart"
+msgstr "mkpart"
+
+#: parted/parted.c:1944
+#, fuzzy
+msgid "mkpart PART-TYPE [FS-TYPE] START END make a partition"
+msgstr "mkpart 分割區類型 [檔案系統類型] 起始點 結束點 建立一個分割區"
+
+#: parted/parted.c:1950
+msgid ""
+"mkpart makes a partition without creating a new file system on the "
+"partition. FS-TYPE may be specified to set an appropriate partition ID.\n"
+msgstr ""
+"mkpart 建立分割區而不在分割區上建立新檔案系統。「檔案系統類型」可以用於設置適"
+"當的分割區識別號。\n"
+
+#: parted/parted.c:1955
+msgid "mkpartfs"
+msgstr "mkpartfs"
+
+#: parted/parted.c:1958
+#, fuzzy
+msgid ""
+"mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system"
+msgstr ""
+"mkpartfs 分割區類型 檔案系統類型 起始點 結束點 建立一個帶有檔案系統的分割區"
+
+#: parted/parted.c:1964
+msgid "move"
+msgstr "move"
+
+#: parted/parted.c:1967
+#, fuzzy
+msgid "move NUMBER START END move partition NUMBER"
+msgstr "move MINOR 起始點 結束點 移動編號為 MINOR 的分割區"
+
+#: parted/parted.c:1972
+msgid "name"
+msgstr "name"
+
+#: parted/parted.c:1975
+#, fuzzy
+msgid "name NUMBER NAME name partition NUMBER as NAME"
+msgstr "name MINOR 名稱 將編號為 MINOR 的分割區命名為「名稱」"
+
+#: parted/parted.c:1980
+msgid "print"
+msgstr "print"
+
+#: parted/parted.c:1983
+#, fuzzy
+msgid ""
+"print [free|NUMBER|all] display the partition table, a "
+"partition, or all devices"
+msgstr "print [MINOR] 顯示分割區表,或者分割區"
+
+#: parted/parted.c:1987
+#, fuzzy
+msgid ""
+"Without arguments, print displays the entire partition table. With 'free'\n"
+"argument, information about free space will be displayed otherwise if a\n"
+"partition number is given, then more detailed information is displayed\n"
+"about that partition. If the 'all' argument is passed instead, partition\n"
+"information for all devices will be displayed."
+msgstr ""
+"若無引數,print 顯示整個分割區表。如果指定了分割區表,就顯示更多\n"
+"關於分割區的詳細資訊。\n"
+
+#: parted/parted.c:1995
+msgid "quit"
+msgstr "quit"
+
+#: parted/parted.c:1998
+#, fuzzy
+msgid "quit exit program"
+msgstr "quit 離開程式"
+
+#: parted/parted.c:2003
+msgid "rescue"
+msgstr "rescue"
+
+#: parted/parted.c:2006
+#, fuzzy
+msgid ""
+"rescue START END rescue a lost partition near START "
+"and END"
+msgstr ""
+"rescue 起始點 結束點 挽救臨近「起始點」、「結束點」的遺失的分割區"
+
+#: parted/parted.c:2012
+msgid "resize"
+msgstr "resize"
+
+#: parted/parted.c:2015
+#, fuzzy
+msgid ""
+"resize NUMBER START END resize partition NUMBER and its "
+"file system"
+msgstr ""
+"resize MINOR 起始點 結束點 改變位於編號為 MINOR 的分割區中檔案系統的大小"
+
+#: parted/parted.c:2023
+msgid "rm"
+msgstr "rm"
+
+#: parted/parted.c:2026
+#, fuzzy
+msgid "rm NUMBER delete partition NUMBER"
+msgstr "rm MINOR 刪除編號為 MINOR 的分割區"
+
+#: parted/parted.c:2031
+msgid "select"
+msgstr "select"
+
+#: parted/parted.c:2034
+#, fuzzy
+msgid "select DEVICE choose the device to edit"
+msgstr "select 設備 選擇要編輯的設備"
+
+#: parted/parted.c:2039
+msgid "set"
+msgstr "set"
+
+#: parted/parted.c:2042
+#, fuzzy
+msgid ""
+"set NUMBER FLAG STATE change the FLAG on partition NUMBER"
+msgstr "rm MINOR 刪除編號為 MINOR 的分割區"
+
+#: parted/parted.c:2048
+msgid "toggle"
+msgstr ""
+
+#: parted/parted.c:2051
+#, fuzzy
+msgid ""
+"toggle [NUMBER [FLAG]] toggle the state of FLAG on "
+"partition NUMBER"
+msgstr "rm MINOR 刪除編號為 MINOR 的分割區"
+
+#: parted/parted.c:2057
+#, fuzzy
+msgid "unit"
+msgstr "quit"
+
+#: parted/parted.c:2060
+#, fuzzy
+msgid "unit UNIT set the default unit to UNIT"
+msgstr "quit 離開程式"
+
+#: parted/parted.c:2065
+msgid "version"
+msgstr ""
+
+#: parted/parted.c:2068
+msgid ""
+"version displays the current version of GNU "
+"Parted and copyright information"
+msgstr ""
+
+#: parted/parted.c:2072
+msgid ""
+"version displays copyright and version information corressponding to this "
+"copy of GNU Parted\n"
+msgstr ""
+
+#: parted/parted.c:2158
+msgid "No device found"
+msgstr "沒有找到設備"
+
+#: parted/parted.c:2222
+msgid "Don't forget to update /etc/fstab, if necessary.\n"
+msgstr "如果必要,不要忘記更新 /etc/fstab。\n"
+
+#: parted/ui.c:68
+msgid "Welcome to GNU Parted! Type 'help' to view a list of commands.\n"
+msgstr ""
+
+#: parted/ui.c:71
+#, fuzzy
+msgid ""
+"Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]\n"
+"Apply COMMANDs with PARAMETERS to DEVICE. If no COMMAND(s) are given, run "
+"in\n"
+"interactive mode.\n"
+msgstr ""
+"用法:parted [選項]... [設備 [命令 [參數]...]...]\n"
+"將帶有「參數」的命令應用於「設備」。如果沒有指定「命令」,則以交談模式執"
+"行。\n"
+
+#: parted/ui.c:76
+#, c-format
+msgid ""
+"\n"
+"\n"
+"You found a bug in GNU Parted! Here's what you have to do:\n"
+"\n"
+"Don't panic! The bug has most likely not affected any of your data.\n"
+"Help us to fix this bug by doing the following:\n"
+"\n"
+"Check whether the bug has already been fixed by checking\n"
+"the last version of GNU Parted that you can find at:\n"
+"\n"
+"\thttp://ftp.gnu.org/gnu/parted/\n"
+"\n"
+"Please check this version prior to bug reporting.\n"
+"\n"
+"If this has not been fixed yet or if you don't know how to check,\n"
+"please visit the GNU Parted website:\n"
+"\n"
+"\thttp://www.gnu.org/software/parted\n"
+"\n"
+"for further information.\n"
+"\n"
+"Your report should contain the version of this release (%s)\n"
+"along with the error message below, the output of\n"
+"\n"
+"\tparted DEVICE unit co print unit s print\n"
+"\n"
+"and additional information about your setup you consider important.\n"
+msgstr ""
+
+#: parted/ui.c:230
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_MAPERR (Address not mapped to object)"
+msgstr ""
+
+#: parted/ui.c:235
+#, c-format
+msgid ""
+"\n"
+"Error: SEGV_ACCERR (Invalid permissions for mapped object)"
+msgstr ""
+
+#: parted/ui.c:240
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGSEGV signal was encountered."
+msgstr ""
+
+#: parted/ui.c:258
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTDIV (Integer: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:262
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_INTOVF (Integer: overflow)"
+msgstr ""
+
+#: parted/ui.c:266
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTDIV (Float: divide by zero)"
+msgstr ""
+
+#: parted/ui.c:270
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTOVF (Float: overflow)"
+msgstr ""
+
+#: parted/ui.c:274
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTUND (Float: underflow)"
+msgstr ""
+
+#: parted/ui.c:278
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTRES (Float: inexact result)"
+msgstr ""
+
+#: parted/ui.c:282
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTINV (Float: invalid operation)"
+msgstr ""
+
+#: parted/ui.c:286
+#, c-format
+msgid ""
+"\n"
+"Error: FPE_FLTSUB (Float: subscript out of range)"
+msgstr ""
+
+#: parted/ui.c:291
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGFPE signal was encountered."
+msgstr ""
+
+#: parted/ui.c:310
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPC (Illegal Opcode)"
+msgstr ""
+
+#: parted/ui.c:314
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLOPN (Illegal Operand)"
+msgstr ""
+
+#: parted/ui.c:318
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLADR (Illegal addressing mode)"
+msgstr ""
+
+#: parted/ui.c:323
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_ILLTRP (Illegal Trap)"
+msgstr ""
+
+#: parted/ui.c:327
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVOPC (Privileged Opcode)"
+msgstr ""
+
+#: parted/ui.c:331
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_PRVREG (Privileged Register)"
+msgstr ""
+
+#: parted/ui.c:335
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_COPROC (Coprocessor Error)"
+msgstr ""
+
+#: parted/ui.c:339
+#, c-format
+msgid ""
+"\n"
+"Error: ILL_BADSTK (Internal Stack Error)"
+msgstr ""
+
+#: parted/ui.c:343
+#, c-format
+msgid ""
+"\n"
+"Error: A general SIGILL signal was encountered."
+msgstr ""
+
+#: parted/ui.c:828
+msgid "Expecting a partition number."
+msgstr "需要分割區編號。"
+
+#: parted/ui.c:837
+msgid "Partition doesn't exist."
+msgstr "分割區不存在。"
+
+#: parted/ui.c:857
+msgid "Expecting a file system type."
+msgstr "需要檔案系統類型。"
+
+#: parted/ui.c:863
+#, c-format
+msgid "Unknown file system type \"%s\"."
+msgstr "未知的檔案系統類型「%s」。"
+
+#: parted/ui.c:883
+msgid "Expecting a disk label type."
+msgstr "需要磁碟標籤類型。"
+
+#: parted/ui.c:977
+msgid "Can't create any more partitions."
+msgstr "無法建立更多分割區。"
+
+#: parted/ui.c:987
+msgid "Expecting a partition type."
+msgstr "需要分割區類型。"
+
+#: parted/ui.c:1115
+msgid "on"
+msgstr "開"
+
+#: parted/ui.c:1116
+msgid "off"
+msgstr "關"
+
+#: parted/ui.c:1227
+msgid "OPTIONs:"
+msgstr "選項:"
+
+#: parted/ui.c:1230
+msgid "COMMANDs:"
+msgstr "命令:"
+
+#: parted/ui.c:1238
+#, c-format
+msgid "Using %s\n"
+msgstr "使用 %s\n"
+
+#, fuzzy
+#~ msgid ""
+#~ "This ext2 file system has a rather strange layout! Parted can't resize "
+#~ "this (yet)."
+#~ msgstr "該 ext2 檔案系統的佈局相當奇怪!Parted (尚)無法改變它的大小。"
+
+#~ msgid "IDE"
+#~ msgstr "IDE"
+
+#, fuzzy
+#~ msgid "Disk geometry for %s: %s - %s\n"
+#~ msgstr "%s 的磁碟幾何結構:0.000-%.3f 百萬位元組\n"
+
+#~ msgid "Disk label type: %s\n"
+#~ msgstr "磁碟標籤類型:%s\n"
+
+#, fuzzy
+#~ msgid "set NUMBER FLAG STATE change a flag on partition NUMBER"
+#~ msgstr "set MINOR 旗標 狀態 改變編號為 MINOR 的分割區的旗標"
+
+#, fuzzy
+#~ msgid ""
+#~ "The sector size on %s is %d bytes. Parted is known not to work properly "
+#~ "with drives with sector sizes other than %d bytes."
+#~ msgstr ""
+#~ "%s 上的區段大小為 %d 位元組。目前 Parted 不能在區段大小不是 %d 位元組的磁"
+#~ "碟上正確工作。"
+
+#~ msgid ""
+#~ "You found a bug in GNU Parted. Please email a bug report to bug-"
+#~ "parted@gnu.org containing the version (%s), and the following message:\n"
+#~ msgstr ""
+#~ "您找到了 GNU Parted 的程式錯誤。請將含有版本 (%s) 和以下資訊的程式錯誤報告"
+#~ "發送到 bug-parted@gnu.org:\n"
+
+#, fuzzy
+#~ msgid ""
+#~ "You requested to create a partition at %s - %s. The closest Parted can "
+#~ "manage is %s - %s."
+#~ msgstr ""
+#~ "您要求在 %.3f - %.3fMb 的位置建立分割區。可管理的最接近分割區為 %.3f-"
+#~ "%.3fMb。"
+
+#, fuzzy
+#~ msgid ""
+#~ "You requested to resize the partition to %s - %s. The closest Parted can "
+#~ "manage is %s - %s."
+#~ msgstr ""
+#~ "您要求將分割區改變大小並保存到 %.3f - %.3fMb。可管理最接近的分割區為 %.3f "
+#~ "- %.3fMb。"
+
+#~ msgid "Could not read geometry of %s - %s."
+#~ msgstr "無法讀取 %s - %s 的幾何結構。"
+
+#~ msgid "Device %s has dodgey geometry."
+#~ msgstr "設備 %s 的幾何結構很奇怪。"
+
+#~ msgid "SCSI"
+#~ msgstr "SCSI"
+
+#~ msgid "Device %s is neither a SCSI nor IDE drive."
+#~ msgstr "設備 %s 既不是 SCSI 磁碟也不是 IDE 磁碟。"
+
+#~ msgid "Error reading %s (%s) to determine if partition is mounted."
+#~ msgstr "為確定分割區是否掛載而讀取 %s (%s) 時出錯。"
+
+#~ msgid ""
+#~ "Unable to determine if partitions are mounted via /proc/mounts or /etc/"
+#~ "mtab. Make sure you don't attempt to resize or modify mounted file "
+#~ "systems. (Even read-only mounted)"
+#~ msgstr ""
+#~ "無法確定分割區是否是經由 /proc/mounts 或 /etc/mtab 掛載的。請確認您不會試"
+#~ "圖改變檔案系統的大小或者修改掛載的檔案系統。(即使以唯讀方式掛載也不行)"
+
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. However, the most likely reason is that Linux "
+#~ "detected the BIOS geometry for %s incorrectly. GNU Parted suspects the "
+#~ "real geometry should be %d/%d/%d (not %d/%d/%d). You should check with "
+#~ "your BIOS first, as this may not be correct. You can inform Linux by "
+#~ "adding the parameter %s=%d,%d,%d to the command line. See the LILO or "
+#~ "GRUB documentation for more information. If you think Parted's suggested "
+#~ "geometry is correct, you may select Ignore to continue (and fix Linux "
+#~ "later). Otherwise, select Cancel (and fix Linux and/or the BIOS now)."
+#~ msgstr ""
+#~ "%s 上的分割區不協調。產生這種情況的原因很多。然而,最可能的原因是 Linux 偵"
+#~ "測到 BIOS 關於 %s 的幾何結構是錯誤的。GNU Parted 懷疑實際的幾何結構為 %d/%"
+#~ "d/%d (而不是 %d/%d/%d)。因為 BIOS 可能不正確,您應該首先檢查您的 BIOS。您"
+#~ "可以經由在命令列中添加參數 %s=%d,%d,%d 來通知 Linux。詳情請參見 LILO 或 "
+#~ "GRUB 的文件。如果您認為 Parted 所建議的幾何結構是正確的,您可以忽略並繼續 "
+#~ "(並在以後修正 Linux)。否則,選擇取消 (並馬上修正 Linux 以及/或者 BIOS)。"
+
+#~ msgid ""
+#~ "The partition table on %s is inconsistent. There are many reasons why "
+#~ "this might be the case. Often, the reason is that Linux detected the "
+#~ "BIOS geometry incorrectly. However, this does not appear to be the case "
+#~ "here. It is safe to ignore,but ignoring may cause (fixable) problems "
+#~ "with some boot loaders, and may cause problems with FAT file systems. "
+#~ "Using LBA is recommended."
+#~ msgstr ""
+#~ "%s 上的分割區表不協調。可能導致這種情況的原因有很多。通常,原因是 Linux 偵"
+#~ "測到的 BIOS 幾何結構是錯誤的。然而,現在似乎並不是這種情況。忽略是安全的,"
+#~ "但是忽略可能導致某些開機載入程式的問題 (可修復的),還可能導致 FAT 檔案系統"
+#~ "出現問題。建議使用 LBA。"
+
+#~ msgid ""
+#~ "Unable to align partition properly. This probably means that another "
+#~ "partitioning tool generated an incorrect partition table, because it "
+#~ "didn't have the correct BIOS geometry. It is safe to ignore,but ignoring "
+#~ "may cause (fixable) problems with some boot loaders."
+#~ msgstr ""
+#~ "無法正確地對齊分割區。這可能意味著其它分割區工具由於沒有得到正確的 BIOS 幾"
+#~ "何結構而產生了錯誤的分割區表。忽略是安全的,但忽略可能導致某些開機載入程式"
+#~ "出現 (可修復的) 問題。"
+
+#~ msgid "File system has an invalid signature for a FAT file systems."
+#~ msgstr "檔案系統含有無效的 FAT 檔案系統簽名。"
+
+#~ msgid ""
+#~ "Partition %s is being used. Modifying it while it is in use could cause "
+#~ "severe corruption."
+#~ msgstr "正在使用分割區 %s。在使用時修改它將導致嚴重的損壞。"
+
+#~ msgid "Minor Start End "
+#~ msgstr "Minor 起始點 結束點 "
+
+#~ msgid "Type "
+#~ msgstr "類型 "
+
+#~ msgid "Filesystem "
+#~ msgstr "檔案系統 "
+
+#~ msgid "Name "
+#~ msgstr "名稱 "
+
+#~ msgid ""
+#~ " You have Windows FAT partition(s) that are not using LBA. If your BIOS "
+#~ "supports LBA, then you should switch to LBA by setting the LBA flag on "
+#~ "all FAT partitions. Otherwise, make sure the operating system and the "
+#~ "BIOS have the same geometry before resizing any FAT partitions."
+#~ msgstr ""
+#~ "您具有不使用 LBA 的 Windows FAT 分割區。如果您的 BIOS 支援 LBA,那麼您應該"
+#~ "經由在所有 FAT 分割區上設置 LBA 旗標以切換到 LBA 模式。否則,在改變任何 "
+#~ "FAT 分割區大小的時候確認作業系統和 BIOS 使用相同的幾何結構。"
+
+#~ msgid ""
+#~ "The operating system thinks the geometry on %s is %d/%d/%d. Therefore, "
+#~ "cylinder 1024 ends at %.3fM.%s"
+#~ msgstr ""
+#~ "作業系統認為 %s 的幾何結構為 %d/%d/%d。因此,柱面 1024 結束於 %.3fM.%s"
+
+#~ msgid "The operating system thinks the geometry on %s is %d/%d/%d.%s"
+#~ msgstr "作業系統認為 %s 的幾何結構為 %d/%d/%d.%s"
diff --git a/scripts/data/abi/baseline_symbols.txt b/scripts/data/abi/baseline_symbols.txt
new file mode 100644
index 0000000..5672d89
--- /dev/null
+++ b/scripts/data/abi/baseline_symbols.txt
@@ -0,0 +1,450 @@
+FUNC:__efi_crc32
+FUNC:_amiga_add_id
+FUNC:_amiga_free_ids
+FUNC:_amiga_id_in_list
+FUNC:_copy_hidden_sectors
+FUNC:_fini
+FUNC:_init
+FUNC:_ped_device_probe
+FUNC:_ped_disk_alloc
+FUNC:_ped_disk_free
+FUNC:_ped_partition_alloc
+FUNC:_ped_partition_attempt_align
+FUNC:_ped_partition_free
+FUNC:_update_stats
+FUNC:abs_mod
+FUNC:amiga_find_part
+FUNC:ext2_bcache_deinit
+FUNC:ext2_bcache_dump
+FUNC:ext2_bcache_flush
+FUNC:ext2_bcache_flush_range
+FUNC:ext2_bcache_init
+FUNC:ext2_bcache_sync
+FUNC:ext2_bcreate
+FUNC:ext2_block_relocate
+FUNC:ext2_bread
+FUNC:ext2_brelse
+FUNC:ext2_close
+FUNC:ext2_commit_metadata
+FUNC:ext2_copy_block
+FUNC:ext2_destroy_dev_handle
+FUNC:ext2_do_inode
+FUNC:ext2_find_free_block
+FUNC:ext2_find_free_inode
+FUNC:ext2_get_block_state
+FUNC:ext2_get_inode_offset
+FUNC:ext2_get_inode_state
+FUNC:ext2_inode_relocate
+FUNC:ext2_is_group_sparse
+FUNC:ext2_make_dev_handle_from_parted_geometry
+FUNC:ext2_metadata_push
+FUNC:ext2_mkfs
+FUNC:ext2_move_blocks
+FUNC:ext2_open
+FUNC:ext2_read_blocks
+FUNC:ext2_read_inode
+FUNC:ext2_resize_fs
+FUNC:ext2_set_block_state
+FUNC:ext2_set_inode_state
+FUNC:ext2_sync
+FUNC:ext2_write_blocks
+FUNC:ext2_write_inode
+FUNC:ext2_zero_blocks
+FUNC:ext2_zero_inode
+FUNC:extended_euclid
+FUNC:fat_alloc
+FUNC:fat_alloc_buffers
+FUNC:fat_boot_sector_analyse
+FUNC:fat_boot_sector_generate
+FUNC:fat_boot_sector_probe_type
+FUNC:fat_boot_sector_read
+FUNC:fat_boot_sector_set_boot_code
+FUNC:fat_boot_sector_write
+FUNC:fat_calc_align_sectors
+FUNC:fat_calc_resize_sizes
+FUNC:fat_calc_sizes
+FUNC:fat_check
+FUNC:fat_check_resize_geometry
+FUNC:fat_clobber
+FUNC:fat_close
+FUNC:fat_cluster_to_frag
+FUNC:fat_cluster_to_sector
+FUNC:fat_collect_cluster_info
+FUNC:fat_copy
+FUNC:fat_create
+FUNC:fat_create_fat16
+FUNC:fat_create_fat32
+FUNC:fat_dir_entry_get_first_cluster
+FUNC:fat_dir_entry_get_length
+FUNC:fat_dir_entry_get_name
+FUNC:fat_dir_entry_has_first_cluster
+FUNC:fat_dir_entry_is_active
+FUNC:fat_dir_entry_is_directory
+FUNC:fat_dir_entry_is_file
+FUNC:fat_dir_entry_is_null_term
+FUNC:fat_dir_entry_is_system_file
+FUNC:fat_dir_entry_set_first_cluster
+FUNC:fat_duplicate_clusters
+FUNC:fat_frag_to_cluster
+FUNC:fat_frag_to_sector
+FUNC:fat_free
+FUNC:fat_free_buffers
+FUNC:fat_get_cluster_flag
+FUNC:fat_get_cluster_usage
+FUNC:fat_get_copy_constraint
+FUNC:fat_get_create_constraint_fat16
+FUNC:fat_get_create_constraint_fat32
+FUNC:fat_get_fragment_flag
+FUNC:fat_get_resize_constraint
+FUNC:fat_info_sector_generate
+FUNC:fat_info_sector_read
+FUNC:fat_info_sector_write
+FUNC:fat_is_fragment_active
+FUNC:fat_is_sector_in_clusters
+FUNC:fat_max_cluster_count
+FUNC:fat_max_cluster_size
+FUNC:fat_min_cluster_count
+FUNC:fat_min_cluster_size
+FUNC:fat_min_reserved_sector_count
+FUNC:fat_op_context_create_initial_fat
+FUNC:fat_op_context_destroy
+FUNC:fat_op_context_map_cluster
+FUNC:fat_op_context_map_fragment
+FUNC:fat_op_context_map_static_cluster
+FUNC:fat_op_context_map_static_fragment
+FUNC:fat_op_context_new
+FUNC:fat_open
+FUNC:fat_probe
+FUNC:fat_probe_fat16
+FUNC:fat_probe_fat32
+FUNC:fat_read_cluster
+FUNC:fat_read_clusters
+FUNC:fat_read_fragment
+FUNC:fat_read_fragments
+FUNC:fat_recommend_min_cluster_size
+FUNC:fat_resize
+FUNC:fat_sector_to_cluster
+FUNC:fat_sector_to_frag
+FUNC:fat_set_frag_sectors
+FUNC:fat_table_alloc_check_cluster
+FUNC:fat_table_alloc_cluster
+FUNC:fat_table_clear
+FUNC:fat_table_compare
+FUNC:fat_table_count_stats
+FUNC:fat_table_destroy
+FUNC:fat_table_duplicate
+FUNC:fat_table_entry_size
+FUNC:fat_table_get
+FUNC:fat_table_is_active
+FUNC:fat_table_is_available
+FUNC:fat_table_is_bad
+FUNC:fat_table_is_empty
+FUNC:fat_table_is_eof
+FUNC:fat_table_new
+FUNC:fat_table_read
+FUNC:fat_table_set
+FUNC:fat_table_set_avail
+FUNC:fat_table_set_bad
+FUNC:fat_table_set_cluster_count
+FUNC:fat_table_set_eof
+FUNC:fat_table_write
+FUNC:fat_table_write_all
+FUNC:fat_traverse_begin
+FUNC:fat_traverse_complete
+FUNC:fat_traverse_directory
+FUNC:fat_traverse_entries_per_buffer
+FUNC:fat_traverse_mark_dirty
+FUNC:fat_traverse_next_dir_entry
+FUNC:fat_write_cluster
+FUNC:fat_write_clusters
+FUNC:fat_write_fragment
+FUNC:fat_write_fragments
+FUNC:fat_write_sync_cluster
+FUNC:fat_write_sync_clusters
+FUNC:fat_write_sync_fragment
+FUNC:fat_write_sync_fragments
+FUNC:findit
+FUNC:geom_dal_create
+FUNC:geom_dal_free
+FUNC:geom_dal_reopen
+FUNC:hfs_and_wrapper_probe
+FUNC:hfs_btree_search
+FUNC:hfs_file_close
+FUNC:hfs_file_open
+FUNC:hfs_file_read_sector
+FUNC:hfs_file_write_sector
+FUNC:hfs_find_start_pack
+FUNC:hfs_free_bad_blocks_list
+FUNC:hfs_get_empty_end
+FUNC:hfs_is_bad_block
+FUNC:hfs_pack_free_space_from_block
+FUNC:hfs_probe
+FUNC:hfs_read_bad_blocks
+FUNC:hfs_update_mdb
+FUNC:hfsc_cache_add_extent
+FUNC:hfsc_cache_move_extent
+FUNC:hfsc_cache_search_extent
+FUNC:hfsc_can_use_geom
+FUNC:hfsc_delete_cache
+FUNC:hfsc_new_cache
+FUNC:hfsj_replay_journal
+FUNC:hfsj_update_jib
+FUNC:hfsj_update_jl
+FUNC:hfsplus_btree_search
+FUNC:hfsplus_file_close
+FUNC:hfsplus_file_open
+FUNC:hfsplus_file_read
+FUNC:hfsplus_file_write
+FUNC:hfsplus_find_start_pack
+FUNC:hfsplus_free_bad_blocks_list
+FUNC:hfsplus_get_empty_end
+FUNC:hfsplus_get_min_size
+FUNC:hfsplus_is_bad_block
+FUNC:hfsplus_pack_free_space_from_block
+FUNC:hfsplus_probe
+FUNC:hfsplus_read_bad_blocks
+FUNC:hfsplus_update_vh
+FUNC:hfsx_probe
+FUNC:mac_alloc
+FUNC:ped_alignment_align_down
+FUNC:ped_alignment_align_nearest
+FUNC:ped_alignment_align_up
+FUNC:ped_alignment_destroy
+FUNC:ped_alignment_duplicate
+FUNC:ped_alignment_init
+FUNC:ped_alignment_intersect
+FUNC:ped_alignment_is_aligned
+FUNC:ped_alignment_new
+FUNC:ped_assert
+FUNC:ped_calloc
+FUNC:ped_constraint_any
+FUNC:ped_constraint_destroy
+FUNC:ped_constraint_done
+FUNC:ped_constraint_duplicate
+FUNC:ped_constraint_exact
+FUNC:ped_constraint_init
+FUNC:ped_constraint_intersect
+FUNC:ped_constraint_is_solution
+FUNC:ped_constraint_new
+FUNC:ped_constraint_new_from_max
+FUNC:ped_constraint_new_from_min
+FUNC:ped_constraint_new_from_min_max
+FUNC:ped_constraint_solve_max
+FUNC:ped_constraint_solve_nearest
+FUNC:ped_debug
+FUNC:ped_debug_set_handler
+FUNC:ped_device_begin_external_access
+FUNC:ped_device_check
+FUNC:ped_device_close
+FUNC:ped_device_destroy
+FUNC:ped_device_end_external_access
+FUNC:ped_device_free_all
+FUNC:ped_device_get
+FUNC:ped_device_get_constraint
+FUNC:ped_device_get_next
+FUNC:ped_device_is_busy
+FUNC:ped_device_open
+FUNC:ped_device_probe_all
+FUNC:ped_device_read
+FUNC:ped_device_sync
+FUNC:ped_device_sync_fast
+FUNC:ped_device_write
+FUNC:ped_disk_add_partition
+FUNC:ped_disk_amiga_done
+FUNC:ped_disk_amiga_init
+FUNC:ped_disk_bsd_done
+FUNC:ped_disk_bsd_init
+FUNC:ped_disk_check
+FUNC:ped_disk_clobber
+FUNC:ped_disk_clobber_exclude
+FUNC:ped_disk_commit
+FUNC:ped_disk_commit_to_dev
+FUNC:ped_disk_commit_to_os
+FUNC:ped_disk_delete_all
+FUNC:ped_disk_delete_partition
+FUNC:ped_disk_destroy
+FUNC:ped_disk_duplicate
+FUNC:ped_disk_dvh_done
+FUNC:ped_disk_dvh_init
+FUNC:ped_disk_extended_partition
+FUNC:ped_disk_get_last_partition_num
+FUNC:ped_disk_get_max_partition_geometry
+FUNC:ped_disk_get_max_primary_partition_count
+FUNC:ped_disk_get_partition
+FUNC:ped_disk_get_partition_by_sector
+FUNC:ped_disk_get_primary_partition_count
+FUNC:ped_disk_gpt_done
+FUNC:ped_disk_gpt_init
+FUNC:ped_disk_loop_done
+FUNC:ped_disk_loop_init
+FUNC:ped_disk_mac_done
+FUNC:ped_disk_mac_init
+FUNC:ped_disk_maximize_partition
+FUNC:ped_disk_minimize_extended_partition
+FUNC:ped_disk_msdos_done
+FUNC:ped_disk_msdos_init
+FUNC:ped_disk_new
+FUNC:ped_disk_new_fresh
+FUNC:ped_disk_next_partition
+FUNC:ped_disk_pc98_done
+FUNC:ped_disk_pc98_init
+FUNC:ped_disk_print
+FUNC:ped_disk_probe
+FUNC:ped_disk_remove_partition
+FUNC:ped_disk_set_partition_geom
+FUNC:ped_disk_sun_done
+FUNC:ped_disk_sun_init
+FUNC:ped_disk_type_check_feature
+FUNC:ped_disk_type_get
+FUNC:ped_disk_type_get_next
+FUNC:ped_div_round_to_nearest
+FUNC:ped_div_round_up
+FUNC:ped_exception_catch
+FUNC:ped_exception_fetch_all
+FUNC:ped_exception_get_option_string
+FUNC:ped_exception_get_type_string
+FUNC:ped_exception_leave_all
+FUNC:ped_exception_rethrow
+FUNC:ped_exception_set_handler
+FUNC:ped_exception_throw
+FUNC:ped_file_system_amiga_done
+FUNC:ped_file_system_amiga_init
+FUNC:ped_file_system_check
+FUNC:ped_file_system_clobber
+FUNC:ped_file_system_close
+FUNC:ped_file_system_copy
+FUNC:ped_file_system_create
+FUNC:ped_file_system_ext2_done
+FUNC:ped_file_system_ext2_init
+FUNC:ped_file_system_fat_done
+FUNC:ped_file_system_fat_init
+FUNC:ped_file_system_get_copy_constraint
+FUNC:ped_file_system_get_create_constraint
+FUNC:ped_file_system_get_resize_constraint
+FUNC:ped_file_system_hfs_done
+FUNC:ped_file_system_hfs_init
+FUNC:ped_file_system_jfs_done
+FUNC:ped_file_system_jfs_init
+FUNC:ped_file_system_linux_swap_done
+FUNC:ped_file_system_linux_swap_init
+FUNC:ped_file_system_ntfs_done
+FUNC:ped_file_system_ntfs_init
+FUNC:ped_file_system_open
+FUNC:ped_file_system_probe
+FUNC:ped_file_system_probe_specific
+FUNC:ped_file_system_reiserfs_done
+FUNC:ped_file_system_reiserfs_init
+FUNC:ped_file_system_resize
+FUNC:ped_file_system_type_get
+FUNC:ped_file_system_type_get_next
+FUNC:ped_file_system_type_register
+FUNC:ped_file_system_type_unregister
+FUNC:ped_file_system_ufs_done
+FUNC:ped_file_system_ufs_init
+FUNC:ped_file_system_xfs_done
+FUNC:ped_file_system_xfs_init
+FUNC:ped_free
+FUNC:ped_geometry_check
+FUNC:ped_geometry_destroy
+FUNC:ped_geometry_duplicate
+FUNC:ped_geometry_init
+FUNC:ped_geometry_intersect
+FUNC:ped_geometry_map
+FUNC:ped_geometry_new
+FUNC:ped_geometry_read
+FUNC:ped_geometry_set
+FUNC:ped_geometry_set_end
+FUNC:ped_geometry_set_start
+FUNC:ped_geometry_sync
+FUNC:ped_geometry_sync_fast
+FUNC:ped_geometry_test_equal
+FUNC:ped_geometry_test_inside
+FUNC:ped_geometry_test_overlap
+FUNC:ped_geometry_test_sector_inside
+FUNC:ped_geometry_write
+FUNC:ped_get_version
+FUNC:ped_greatest_common_divisor
+FUNC:ped_malloc
+FUNC:ped_partition_destroy
+FUNC:ped_partition_flag_get_by_name
+FUNC:ped_partition_flag_get_name
+FUNC:ped_partition_flag_next
+FUNC:ped_partition_get_flag
+FUNC:ped_partition_get_name
+FUNC:ped_partition_get_path
+FUNC:ped_partition_is_active
+FUNC:ped_partition_is_busy
+FUNC:ped_partition_is_flag_available
+FUNC:ped_partition_new
+FUNC:ped_partition_print
+FUNC:ped_partition_set_flag
+FUNC:ped_partition_set_name
+FUNC:ped_partition_set_system
+FUNC:ped_partition_type_get_name
+FUNC:ped_realloc
+FUNC:ped_register_disk_type
+FUNC:ped_round_down_to
+FUNC:ped_round_to_nearest
+FUNC:ped_round_up_to
+FUNC:ped_set_architecture
+FUNC:ped_timer_destroy
+FUNC:ped_timer_destroy_nested
+FUNC:ped_timer_new
+FUNC:ped_timer_new_nested
+FUNC:ped_timer_reset
+FUNC:ped_timer_set_state_name
+FUNC:ped_timer_touch
+FUNC:ped_timer_update
+FUNC:ped_unit_format
+FUNC:ped_unit_format_byte
+FUNC:ped_unit_format_custom
+FUNC:ped_unit_format_custom_byte
+FUNC:ped_unit_get_by_name
+FUNC:ped_unit_get_default
+FUNC:ped_unit_get_name
+FUNC:ped_unit_get_size
+FUNC:ped_unit_parse
+FUNC:ped_unit_parse_custom
+FUNC:ped_unit_set_default
+FUNC:ped_unregister_disk_type
+FUNC:raw_part_parse
+NOTYPE:__bss_start
+NOTYPE:_edata
+NOTYPE:_end
+OBJECT:12:linux_disk_ops
+OBJECT:16:_affs0_type
+OBJECT:16:_affs1_type
+OBJECT:16:_affs2_type
+OBJECT:16:_affs3_type
+OBJECT:16:_affs4_type
+OBJECT:16:_affs5_type
+OBJECT:16:_affs6_type
+OBJECT:16:_affs7_type
+OBJECT:16:_amufs0_type
+OBJECT:16:_amufs1_type
+OBJECT:16:_amufs2_type
+OBJECT:16:_amufs3_type
+OBJECT:16:_amufs4_type
+OBJECT:16:_amufs5_type
+OBJECT:16:_amufs_type
+OBJECT:16:_apfs1_type
+OBJECT:16:_apfs2_type
+OBJECT:16:_asfs_type
+OBJECT:16:fat16_type
+OBJECT:16:fat32_type
+OBJECT:1:fat16
+OBJECT:24:ops
+OBJECT:324:xfsstats
+OBJECT:4:ext2_buffer_cache_pool_size
+OBJECT:4:ext2_hash_bits
+OBJECT:4:ext2_relocator_pool_size
+OBJECT:4:hfs_block
+OBJECT:4:hfs_block_count
+OBJECT:4:hfsp_block
+OBJECT:4:hfsp_block_count
+OBJECT:4:ped_alignment_any
+OBJECT:4:ped_alignment_none
+OBJECT:4:ped_architecture
+OBJECT:4:ped_exception
+OBJECT:8:_bitmap
+OBJECT:8:ped_linux_arch
diff --git a/scripts/extract_symvers b/scripts/extract_symvers
new file mode 100755
index 0000000..8a74db9
--- /dev/null
+++ b/scripts/extract_symvers
@@ -0,0 +1,67 @@
+#!/bin/sh
+
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+#
+# This file is part of the GNU ISO C++ Library. This library is free
+# software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this library; see the file COPYING. If not, write to the Free
+# Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+# USA.
+#
+# As a special exception, you may use this file as part of a free software
+# library without restriction. Specifically, if other files instantiate
+# templates or use macros or inline functions from this file, or you compile
+# this file and link it with other files to produce an executable, this
+# file does not by itself cause the resulting executable to be covered by
+# the GNU General Public License. This exception does not however
+# invalidate any other reasons why the executable file might be covered by
+# the GNU General Public License.
+
+
+if test ${#} -lt 2 || test $1 = '--help'; then
+ echo "Usage: extract_symvers shared_lib output_file" 1>&2
+ exit 1
+fi
+
+lib=$1
+output=$2
+
+# GNU binutils, somewhere after version 2.11.2, requires -W/--wide to avoid
+# default line truncation. -W is not supported and truncation did not occur
+# by default before that point.
+readelf="readelf --symbols"
+if readelf --help | grep -- --wide > /dev/null; then
+ readelf="$readelf --wide"
+fi
+
+# This avoids weird sorting problems later.
+LC_ALL=C
+export LC_ALL
+LANG=C
+export LANG
+
+tmp=extract.$$
+
+${readelf} ${lib} | sed '/\.dynsym/,/^$/p;d' | egrep -v ' (LOCAL|UND) ' |\
+awk '{ if ($4 == "FUNC" || $4 == "NOTYPE")
+ printf "%s:%s\n", $4, $8;
+ else if ($4 == "OBJECT")
+ printf "%s:%s:%s\n", $4, $3, $8;
+ }' | sort | uniq > $tmp 2>&1
+# else printf "Huh? What is %s?\n", $8;
+
+
+# I think we'll be doing some more with this file, but for now, dump.
+mv $tmp $output
+
+exit 0
diff --git a/scripts/release/tarball_upload.sh b/scripts/release/tarball_upload.sh
new file mode 100755
index 0000000..26f14ac
--- /dev/null
+++ b/scripts/release/tarball_upload.sh
@@ -0,0 +1,157 @@
+#!/bin/sh
+
+#set -x
+
+SRCDIR=.
+
+cd $SRCDIR
+
+# release GNU Parted (without tagging).
+# (C)2005, 2006 Leslie Patrick Polzer <polzer@gnu.org>
+
+
+message()
+{
+ echo '====================================================='
+ echo "$1"
+ echo '====================================================='
+}
+
+
+correct_version()
+{
+ grep $1 $2 >/dev/null
+ if [ $? -eq 0 ]; then
+ return 0
+ fi
+ return 1;
+}
+
+
+check_for_program()
+{
+ which $1
+ if [ $? -ne 0 ]; then
+ echo "not found, exiting."
+ exit
+ fi
+}
+
+
+echo "* checking for programs that might be missing..."
+for p in gpg curl upx statifier; do
+ echo -en "\t$p: "
+ check_for_program $p
+done
+
+[[ ./autogen.sh ]] || return 1
+[[ ./configure ]] || return 1
+
+VERSION=$(grep ' VERSION' config.h | awk '{print $3}' | tr -d '"')
+
+message "* checking for correct version in files"
+for f in ChangeLog NEWS; do
+ echo -n -e "\t$f: "
+ correct_version $VERSION $f
+ if [ $? -eq 0 ]; then
+ echo OK
+ else
+ echo "-> WARNING: version mismatch"
+ fi
+done
+
+
+correct_version $VERSION Doxyfile
+if [ $? -ne 0 ]; then
+ echo "-> WARNING: version not updated in Doxygen configuration!"
+fi
+
+message '* checking whether code compiles: '
+make -s
+if [ $? -ne 0 ]; then
+ echo no; exit
+fi
+echo OK
+
+# FIXME
+# echo "running regression tests"
+
+message 'RELEASE SANITY TESTS SUCCESSFULLY FINISHED!
+I hope you tagged the release beforehand!
+Hit <RETURN> to continue with "make dist".'
+read
+
+message '* creating tarballs...'
+for f in gzip bzip2; do
+ echo -n "dist-$f: "
+ make dist-$f
+ if [ $? -ne 0 ]; then
+ echo FAILED; exit
+ fi
+ echo success
+done
+
+set -x
+# set up gpg-agent
+GPGAENV=$(gpg-agent --daemon -s)
+GPGAPID=$(echo $GPGAENV | cut -d ':' -f 2)
+eval "$GPGAENV"
+set +x
+
+for EXT in gz bz2; do
+
+TARBALL=parted-$VERSION.tar.$EXT
+
+message "* signing $TARBALL to detached signature file $TARBALL.sig"
+gpg --use-agent -b $TARBALL
+if [ $? -ne 0 ]; then
+ kill $GPGAPID echo "\t-> FAILED"; exit
+fi
+echo -e "\t-> success"
+
+
+DIRECTIVE=$TARBALL.directive
+message "* creating and clearsigning directive file to $DIRECTIVE.asc"
+echo -n 'Directory: parted' > $DIRECTIVE
+if [ $? -ne 0 ]; then
+ kill $GPGAPID; echo creation FAILED; exit
+fi
+echo -e "\t-> created "
+gpg --use-agent --clearsign $DIRECTIVE
+if [ $? -ne 0 ]; then
+ kill $GPGAPID; echo ", but signing failed"; exit
+fi
+echo -e "\t-> signed"
+
+
+message "* deleting $DIRECTIVE."
+rm $DIRECTIVE
+
+done
+
+#kill $GPGAPID
+
+
+# do all uploading work
+message "! Ready! Hit <RETURN> to start upload."
+read
+
+message "* uploading files to ftp-upload.gnu.org..."
+for EXT in gz bz2; do
+ TARBALL=parted-$VERSION.tar.$EXT
+ SIG=parted-$VERSION.tar.$EXT.sig
+ DIRECTIVE=$TARBALL.directive
+ for f in $TARBALL $SIG $DIRECTIVE.asc; do
+ curl --upload-file $PWD/$f \
+ 'ftp://ftp-upload.gnu.org/incoming/ftp/'
+
+ if [ $? -eq 0 ]; then
+ echo "-> successfully uploaded $f."
+ else
+ echo "-> upload of $f FAILED, exiting."
+ fi
+ done
+done
+
+message "* all files uploaded."
+
diff --git a/stamp-h1 b/stamp-h1
new file mode 100644
index 0000000..4547fe1
--- /dev/null
+++ b/stamp-h1
@@ -0,0 +1 @@
+timestamp for config.h