summaryrefslogtreecommitdiff
path: root/disk-utils
AgeCommit message (Collapse)AuthorFilesLines
2009-05-22build-sys: cleanup libuuid stuffKarel Zak1-3/+10
Supported scenarios: * internal libuuid (--enable-libuuid, default) * external libuuid (--disable-libuuid) - systems without pkg-config - systems with pkg-config * systems without libuuid at all (the library is optional for u-l-ng) Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-22build-sys: fix headers in mkswap and libblkidKarel Zak1-1/+5
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-04-29blockdev: fix possible buffer overflowKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-03-13mkswap: clean up man pageKarel Zak1-73/+58
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-03-12mkswap: zap bootbitsKarel Zak2-1/+46
/dev/sdb1 originally initialized by cryptsetup: and OLD mkswap: # vol_id /dev/sdb1 | grep TYPE ID_FS_TYPE=swap # blkid -s TYPE /dev/sdb1 /dev/sdb1: TYPE="crypt_LUKS" So, we have two different *valid* signatures on the device now! NEW mkswap: # blkid -s TYPE /dev/sdb1 /dev/sdb1: TYPE="swap" # /lib/udev/vol_id /dev/sdb1 | grep TYPE ID_FS_TYPE=swap the bootbits (first 1024 bytes) was erased. We shouldn't zap disk labels (BSD, SUN, ...) and boot loaders (on whole disk): # mkswap /dev/sdb2 mkswap: /dev/sdb2: warning: don't erase bootbits sectors (BSD partition table detected). Use -f to force. Setting up swapspace version 1, size = 4348 KiB no label, UUID=69d87cef-71ac-4fb0-a689-ce3e930dea17 # mkswap /dev/sdb mkswap: /dev/sdb: warning: don't erase bootbits sectors on whole disk. Use -f to force. Setting up swapspace version 1, size = 8188 KiB no label, UUID=97757ad7-8a84-43d9-bcb4-16fefd93a2ac Signed-off-by: Karel Zak <kzak@redhat.com>
2009-03-11mkswap: remove v0 swap space supportKarel Zak2-167/+33
The kernel has not supported v0 swap space format since 2.5.22. The new version v1 is supported since 2.1.117. Signed-off-by: Karel Zak <kzak@redhat.com>
2009-02-27mkswap: handle 2^32 pagesHugh Dickins1-15/+17
mkswap (when built 32-bit) could not quite support the maximum size of swap area (2^32 pages): change unsigned long pagecounts to unsigned long long pagecounts, and fix maxpages for the case when more is asked. Signed-off-by: Hugh Dickins <hugh@veritas.com>
2009-02-26blockdev: add note that the StartSec is in 512-byte sectorsKarel Zak1-0/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-02-05mkfs.minix: remove local implementation of {set,clr}bitKarel Zak4-69/+8
We needn't to duplicate stuff from <sys/param.h>. Signed-off-by: Karel Zak <kzak@redhat.com>
2009-02-04fsck.cramfs: segfault with INCLUDE_FS_TESTS and no -x optionKarel Zak1-2/+3
The current implementation causes a segmentation fault if INCLUDE_FS_TESTS is defined, but the -x option is not specified. The error is caused by the extract_dir variable being null. Reported-by: Roy Peled <the.roy.peled@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2009-02-04mkfs.cramfs: lower memory requirements for layouts with duplicate filesRoy Peled1-8/+9
mkfs.cramfs allocates memory based on a calculated upper-bound of required filesystem size. If there are duplicate files or hard links, the current implementation unnecessarily increases the upper-bound per each copy of the file, even though cramfs does not store copies of contents of identical files. This patch improves the calculation of fslen_ub, the upper bound of required filesystem size, by making the upper bound aware of duplicate files. This is very helpful for layouts that hold a lot of hard links, which are seen as duplicate files by mkfs.cramfs. For example, this drastically reduces the memory requirements for creating a standard Busybox layout. Signed-off-by: Roy Peled <the.roy.peled@gmail.com>
2009-02-04mkfs.cramfs: add endianness support to cramfs toolsSigned-off-by: Roy Peled5-18/+210
cramfs is an endianness dependent file system. So far, the cramfs utilities did not support cramfs images of different endianness than the host machine. A separate utility, cramfsswap, was required in order to change the endianness of the image before and after using cramfs utilities. The extra utility introduced extra maintenance and an additional step in the process. This patch adds endianness support to mkfs.cramfs and fsck.cramfs. fsck.cramfs now automatically detects the image endianness, and can work on images of either endianness. mkfs.cramfs now accepts a new optional parameter (-N) that allows creating the cramfs image in either endianness. Signed-off-by: Roy Peled <the.roy.peled@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2008-12-26raw: default to /dev/raw/rawctlKarel Zak1-11/+9
The raw devices are in the raw/ subdirectory. It makes sense to use the same subdirectory also for the control file. The old /dev/rawctl is also supported as a fallback. The #ifdef OLD_RAW_DEVS (/dev/raw<N>) is unsupported from now. Signed-off-by: Karel Zak <kzak@redhat.com>
2008-12-05mkfs.minix: (and fsck) rename bitops.hKarel Zak4-6/+6
This patch renames bitops.h to minix_bitops.h to avoid possible collisions with global include/bitops.h file. Signed-off-by: Karel Zak <kzak@redhat.com>
2008-12-05include: move swapheader.h to includeMatthias Koenig2-20/+1
[kzak@redhat.com: add ifndef _SWAPHEADER_H] Signed-off-by: Matthias Koenig <mkoenig@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
2008-11-13mkfs.minix: fix size detectionMatthias Koenig1-2/+7
blkdev_get_size returns size in bytes, so BLOCKS has to be calculated accordingly. Use stat value for size if device is not a block device. Signed-off-by: Matthias Koenig <mkoenig@suse.de>
2008-10-03raw: add NLS supportPedro Ribeiro1-35/+40
[kzak@redhat.com: - add setlocale(), ... - remove tailing white spaces] Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2008-10-03mkfs.cramfs: several strings without gettext callsPedro Ribeiro1-2/+2
Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2008-10-03fsck.cramfs: add NLS supportPedro Ribeiro1-56/+60
[kzak@redhat.com: - add setlocale(), ...] Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2008-10-03elvtune: add NLS supportPedro Ribeiro1-5/+9
[kzak@redhat.com: - add missing setlocale(), ...] Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-29fsck.cramfs: fix compiler warningKarel Zak1-1/+1
fsck.cramfs.c: In function ‘main’: fsck.cramfs.c:676 warning: ‘length’ may be used uninitialized in this function Signed-off-by: Karel Zak <kzak@redhat.com>
2008-07-30use getpagesize()maximilian attems3-7/+3
getpagesize() is said to be more portable than sysconf(_SC_PAGESIZE) to anything Linux. this patch helps klibc porting effort as the sysconf multiplex API is not supported there. also remove comment of the switch to sysconf in mkswap.c. Signed-off-by: maximilian attems <max@stro.at>
2008-07-28disk-utils: include fcntl.h directly (mkfs.cramfs, raw)maximilian attems2-2/+2
helps klibc support, glibc compile tested. Signed-off-by: maximilian attems <max@stro.at>
2008-07-28disk-utils: s/MOUNTED/_PATH_MOUNTED/maximilian attems3-4/+7
no longer use deprecated alias. helps compiling util-linux-ng against klibc. add pathnames.h include, where _PATH_MOUNTED is defined. Signed-off-by: maximilian attems <max@stro.at>
2008-07-24disk-utils: clean up code, use blkdev_* functionsSamuel Thibault4-56/+24
[kzak@redhat.com: split the original patch to small patches] Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Karel Zak <kzak@redhat.com>
2008-07-24mkswap: non-linux supportSamuel Thibault2-2/+10
GNU/Hurd uses linux-like swapspace, so mkswap makes sense on non-linux platforms too. [kzak@redhat.com: split the original patch to small patches] Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Karel Zak <kzak@redhat.com>
2008-07-01selinux: is_selinux_enabled() returns 0, 1 and -1Karel Zak1-1/+1
Unfortunately, the current libselinux implementation of is_selinux_enabled() returns -1 on error. This behavior is undocumented. The proper solution is to use "if (is_selinux_enabled() > 0)". Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-16mkswap: set errno=0 in write_all()Karel Zak1-1/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-15mkswap: when writing the signature page, handle EINTR returnsKarel Zak1-3/+22
If the signature page write bumps into EINTR, it should finish the write, instead of dying. Addresses-Ubuntu-Bug: 206113 Signed-off-by: LaMont Jones <lamont@canonical.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-14build-sys: update .gitignore filesKarel Zak1-0/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-14build-sys: ignore a bunch of generated files, mostly binariesJames Youngman1-0/+10
Signed-off-by: James Youngman <jay@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-08fsck.minix: reset the terminal state if we are killed by a fatal signalJames Youngman1-2/+33
[kzak@redhat.com: remove unnecessary volatile type qualifier] Signed-off-by: James Youngman <jay@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-08mkfs.cramfs: switch on localization.Benno Schulenberg1-0/+4
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2008-04-08fsck.minix: correct the error message given when we can't open the deviceJames Youngman1-3/+13
Don't actually print %s in the error message, print the device name, as was obviously intended. Also, print the error message corresponding to the errno value. [kzak@redhat.com: add __attribute__, coding style cleanups] Signed-off-by: James Youngman <jay@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
2008-03-20mkfs.minix: clean up gcc warningsKarel Zak1-31/+0
mkfs.minix.c:199: warning: ‘count_blocks’ defined but not used Signed-off-by: Karel Zak <kzak@redhat.com>
2008-03-20mkswap: fix compiler warningsKarel Zak1-1/+1
mkswap.c:529: warning: pointer targets in assignment differ in signedness mkswap.c:531: warning: pointer targets in assignment differ in signedness mkswap.c:550: warning: pointer targets in passing argument 1 of `uuid_parse' differ in signedness Signed-off-by: Karel Zak <kzak@redhat.com>
2008-03-04fdformat: install to /usr/sbin instead to /usr/binKarel Zak1-1/+2
It should be in usrsbinexecdir, since formatting is usually a privileged util-linux operation (like mkfs). Reported-By: Jan Engelhardt <jengelh@computergmbh.de> Signed-off-by: Karel Zak <kzak@redhat.com>
2008-02-15mkswap: set UUID for swap space (add -U option)Martin Schulze2-3/+22
A friend of mine is looking into the possibility of cloning Debian (and other) systems automatically and stomped over swap partitions getting assigned new UUIDs every time the new harddisk is partitioned and swap is created. It's essential when partitions are to be recognised by their uuid and not by their old device path anymore. Addresses-Ubuntu-Bug: #66637 Signed-off-by: LaMont Jones <lamont@debian.org> Signed-off-by: Karel Zak <kzak@redhat.com>
2007-12-17build-sys: use dist_man_MANS instead of man_MANSStepan Kasal1-4/+4
Signed-off-by: Stepan Kasal <skasal@redhat.com>
2007-11-28blockdev: add --getsz to blockdev.8Karel Zak1-2/+7
This patch also marks --getsize as deprecated option. Signed-off-by: Karel Zak <kzak@redhat.com>
2007-11-21build-sys: cleanup disk-utils/Makefile.am (use $utils_common)Karel Zak1-2/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-11-21mkfs.minix: device size cleanupMatthias Koenig1-36/+14
Use blkdev_get_size() function and some size related cleanup. Signed-off-by: Matthias Koenig <mkoenig@suse.de>
2007-11-21mkfs.minix: add sectorsize checkMatthias Koenig2-3/+13
Minix filesystem until version 2 has a fixed blocksize of 1024 bytes. If you try to create a filsystem on a device with a physical sectorsize larger than 1024 bytes, this resulting minix fs cannot be mounted, because the physical sectorsize must be smaller than the filesystem blocksize. This patch adds a check for this and will refuse to create a filesystem if the sectorsize is bigger than the blocksize. Signed-off-by: Matthias Koenig <mkoenig@suse.de>
2007-11-08build-sys: non-linux supportSamuel Thibault1-2/+7
Here is a patch that disables linux-specific tools on non-linux targets. Signed-Off-By: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-Off-By: Karel Zak <kzak@redhat.com>
2007-11-07elvtune: use get_linux_version()Karel Zak2-23/+5
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-11-07blockdev: use lib/blkdev.c, fix --reportKarel Zak2-83/+10
This patch replaces duplicate code with blkdev_ functions from lib/blkdev.c. The patch also fix the output from "blockdev --report". The Size field was in 512-byte sectors instead in real size in bytes. Signed-off-by: Karel Zak <kzak@redhat.com>
2007-11-07mkswap: cleanup kB vs. KiB usage in error messagesKarel Zak1-7/+7
mkswap(8) man page is talking about KiB (2^10), but the mkswap binary uses kB (10^3) in error messages. That's strange. Let's use KiB everywhere. Signed-off-by: Karel Zak <kzak@redhat.com>
2007-11-07mkswap: BLKGETSIZE cleanupKarel Zak2-15/+7
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-11-06mkswap: linux_version() code consolidationKarel Zak2-20/+5
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-11-06mkfs.cramfs: remove unused header filelizf1-1/+0
Remove including of assert.h Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>