summaryrefslogtreecommitdiffstats
path: root/disk-utils
Commit message (Collapse)AuthorAgeFilesLines
* build-sys: use dist_man_MANS instead of man_MANSStepan Kasal2007-12-171-4/+4
| | | | Signed-off-by: Stepan Kasal <skasal@redhat.com>
* blockdev: add --getsz to blockdev.8Karel Zak2007-11-281-2/+7
| | | | | | This patch also marks --getsize as deprecated option. Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: cleanup disk-utils/Makefile.am (use $utils_common)Karel Zak2007-11-211-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mkfs.minix: device size cleanupMatthias Koenig2007-11-211-36/+14Star
| | | | | | Use blkdev_get_size() function and some size related cleanup. Signed-off-by: Matthias Koenig <mkoenig@suse.de>
* mkfs.minix: add sectorsize checkMatthias Koenig2007-11-212-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>
* build-sys: non-linux supportSamuel Thibault2007-11-081-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>
* elvtune: use get_linux_version()Karel Zak2007-11-072-23/+5Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: use lib/blkdev.c, fix --reportKarel Zak2007-11-072-83/+10Star
| | | | | | | | | | 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>
* mkswap: cleanup kB vs. KiB usage in error messagesKarel Zak2007-11-071-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>
* mkswap: BLKGETSIZE cleanupKarel Zak2007-11-072-15/+7Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mkswap: linux_version() code consolidationKarel Zak2007-11-062-20/+5Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mkfs.cramfs: remove unused header filelizf2007-11-061-1/+0Star
| | | | | | Remove including of assert.h Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
* blockdev: fix: opened file leaving unclosedlizf2007-10-262-0/+6
| | | | Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
* docs: tweak a few messages for clarityBenno Schulenberg2007-10-261-3/+3
| | | | | | | | Add a missing period, a missing space, a comma and a word for clarity, plus a period and an uppercase letter to match surrounding messages. Further add a missing call to gettext, and undo an unneeded linewrap. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* mkswap: possible to crash with SELinux relabeling supportKaiGai Kohei2007-10-251-6/+9
| | | | | | | | | | | | | | | | | | When fgetfilecon() is failed with -ENODATA, this process does not exit. However, "oldcontext" is not initialized in this case, so context_new() will be called with uninitialized "oldcontext" at the next. Finally, it makes a segmentation fault, because context_new() have to refer an incorrect memory region. The attached patch fixes this matter using matchpathcon(). If we cannot obtain actual file context due to -ENODATA, a context which is returned by matchpathcon() is applied as oldcontext. Then, the type of the context is relabeled to "swapfile_t" explicitly. Signed-off-by: KaiGai Kohei <kaigai@kaigai.gr.jp> Signed-off-by: Karel Zak <kzak@redhat.com>
* mkfs.cramfs: clean up gcc warningsRandy Dunlap2007-10-111-24/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * clean up code, gcc warnings (try compilation with "-Wall -Wp,-D_FORTIFY_SOURCE=2") Builds cleanly on x86_32 and x86_64. mkfs.cramfs.c:211: warning: pointer targets in passing argument 2 of 'MD5Update' differ in signedness mkfs.cramfs.c:336: warning: format '%u' expects type 'unsigned int', but argument 4 has type 'size_t' mkfs.cramfs.c:355: warning: pointer targets in assignment differ in signedness mkfs.cramfs.c:448: warning: pointer targets in passing argument 1 of '__builtin___strncpy_chk' differ in signedness mkfs.cramfs.c:448: warning: pointer targets in passing argument 1 of '__strncpy_ichk' differ in signedness mkfs.cramfs.c:450: warning: pointer targets in passing argument 1 of '__builtin___strncpy_chk' differ in signedness mkfs.cramfs.c:450: warning: pointer targets in passing argument 1 of '__strncpy_ichk' differ in signedness mkfs.cramfs.c:490: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness mkfs.cramfs.c:620: warning: pointer targets in passing argument 1 of 'compress' differ in signedness mkfs.cramfs.c:620: warning: pointer targets in passing argument 3 of 'compress' differ in signedness mkfs.cramfs.c:671: warning: pointer targets in passing argument 3 of 'do_compress' differ in signedness mkfs.cramfs.c:824: warning: format '%Ld' expects type 'long long int', but argument 4 has type 'loff_t' mkfs.cramfs.c:872: warning: format '%d' expects type 'int', but argument 3 has type 'ssize_t' mkfs.cramfs.c:880: warning: format '%d' expects type 'int', but argument 3 has type 'ssize_t' mkfs.cramfs.c:885: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int' mkfs.cramfs.c:889: warning: pointer targets in passing argument 2 of 'crc32' differ in signedness mkfs.cramfs.c:896: warning: format '%Ld' expects type 'long long int', but argument 4 has type 'loff_t' mkfs.cramfs.c:896: warning: format '%d' expects type 'int', but argument 5 has type 'ssize_t' mkfs.cramfs.c:909: warning: format '%d' expects type 'int', but argument 4 has type 'ssize_t' mkfs.cramfs.c:909: warning: format '%d' expects type 'int', but argument 5 has type 'ssize_t' Co-Author: Karel Zak <kzak@redhat.com> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* mkfs.minix: clean up gcc warningsRandy Dunlap2007-10-111-1/+4
| | | | | | | | | | | | * clean up code, gcc warnings (try compilation with "-Wall -Wp,-D_FORTIFY_SOURCE=2") Builds cleanly on x86_32 and x86_64. mkfs.minix.c:595: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck.cramfs: clean up gcc warningsRandy Dunlap2007-10-031-1/+2
| | | | | | | | | | | * clean up code, gcc warnings (try compilation with "-Wall -Wp,-D_FORTIFY_SOURCE=2") Builds cleanly on x86_32 and x86_64. fsck.cramfs.c:235: warning: ignoring return value of 'read', declared with attribute warn_unused_result Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
* pg: fix segfault on searchRajeev V. Pillai2007-10-031-1/+1
| | | | | | | | | Run pg(1) and type '/<CR>' which is supposed to forward search for the previously remembered search string. pg(1) will segfault after printing "No remembered search string:". Signed-off-by: Rajeev V. Pillai <rajeevvp@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: remove hardcoded _GNU_SOURCEKarel Zak2007-09-201-1/+0Star
| | | | | | We have AC_GNU_SOURCE, so we needn't any extra hardcoded _GNU_SOURCE. Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: add missing description about option --report in manpageLi Zefan2007-09-191-0/+8
| | | | | | The manpage does not mention the option --report. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
* po: gettextizing some overlooked messages.Benno Schulenberg2007-08-142-8/+8
| | | | | | | | Gettextize three new strings, make two strings indentical to two others, and gettextize three strings that are already gettextized elsewhere. Signed-off-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* mkfs: remove nonsense from man pageKarel Zak2007-08-021-6/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: use LU and LLU for BLKGETSIZE and BLKGETSIZE64Karel Zak2007-08-011-2/+28
| | | | | | | | | | | The "blkockdev --getsize" returns negative numbers on i386 for 1Tb devices. The BLKGETSIZE and BLKGETSIZE64 have to use unsigned long and unsigned long long. $ blockdev --getsize /dev/mapper/huge -2147483648 Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: fix "blockdev --getsz" for large devicesKarel Zak2007-08-011-2/+5
| | | | | | | The "blockdev --getsz" command doesn't try to use BLKGETSIZE64 when previous BLKGETSIZE failed with EFBIG. This patch fixes this problem. Signed-off-by: Karel Zak <kzak@redhat.com>
* disk-utils: let mkfs tools open with O_EXCLMatthias Koenig2007-07-273-6/+17
| | | | | | | | | | | | | Let mkswap, mkfs.bfs, mkfs.minix open with O_EXCL if used on block devices to prevent writing to the device even if they are busy (mounted). Unfortunately, O_EXCL has zero effect for 2.4 kernels where in-kernel code doesn't use O_EXCL-like access locks. (Tested on RHEL3.) Signed-off-by: Matthias Koenig <mkoenig@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* remove hardcoded package name from some utilsKarel Zak2007-07-271-2/+2
| | | | | | | We have PACKAGE_STRING in config.h that includes package name and version. It's better to use this macro that hardcoded strings. Signed-off-by: Karel Zak <kzak@redhat.com>
* mkswap: fix signedness problems and remove obsolete codeKarel Zak2007-07-251-22/+2Star
| | | | | | The UUID is unsigned char * Signed-off-by: Karel Zak <kzak@redhat.com>
* mkswap: default to V1 in any caseMatthias Koenig2007-07-242-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mkswap(8) enforces to use v0 swap format when pagesize > 16kB. (use case might be ppc64 with CONFIG_PPC_64K_PAGES). As version 0 swap is not supported anymore by recent kernels, the behaviour in this case is rather strange. Here is a testcase: for i in 4 8 16 32 64; do mkswap -p `expr $i \* 1024` ./swap.file; done Setting up swapspace version 1, size = 4294963 kB Using user-specified page size 8192, instead of the system values 4096/4096 Setting up swapspace version 1, size = 4294959 kB Using user-specified page size 16384, instead of the system values 4096/4096 Setting up swapspace version 1, size = 4294950 kB Using user-specified page size 32768, instead of the system values 4096/4096 Setting up swapspace version 0, size = 4294934 kB Using user-specified page size 65536, instead of the system values 4096/4096 Setting up swapspace version 0, size = 4294901 kB Signed-off-by: Matthias Koenig <mkoenig@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* man pages: add "AVAILABILITY" sectionKarel Zak2007-07-039-1/+25
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: cleanup usage() and update man pageKarel Zak2007-06-292-8/+32
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: add BLKFRAGET/BLKFRASET ioctlsKarel Zak2007-06-292-0/+14
| | | | | | | | | | | | | | In Linux 2.6 the BLKRASET ioctl has the desired effect for mounted file-systems. In Linux 2.4 it appears to set the number of blocks to read-ahead on the *device* as opposed to within a *file*, and the maximum value of this number is 255. As a result the invocation of blockdev will fail on Linux 2.4 for any usefully large value of READAHEAD, and will not in any case have the desired affect for fragmented files. (Based on the blockdev-getfra-setfra.patch Debian patch.) Signed-off-by: Karel Zak <kzak@redhat.com>
* mkfs.cramfs: cleanup HAVE_ macros usageKarel Zak2007-06-141-6/+9
| | | | | | | It's bad to use any HAVE_* macros for anything other than for build-system (autotools) stuff. Signed-off-by: Karel Zak <kzak@redhat.com>
* disk-utils: fix libuuid usage in mkswapMatthias Koenig2007-05-161-4/+4
| | | | | | Fix libuuid usage in mkswap. Signed-off-by: Matthias Koenig <mkoenig@suse.de>
* build-sys: do not build convenience libraries in lib/Stepan Kasal2007-05-161-2/+2
| | | | | | | Build lib/*.c individually for each project which uses it, so that the right set of flags is applied each time. Signed-off-by: Stepan Kasal <skasal@redhat.com>
* mkfs.cramfs: fix a way how mkfs works with empty filesKarel Zak2007-02-271-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mkfs.cramfs: remove hardcoded limit for directoriesKarel Zak2007-02-271-9/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mkswap: automatically add selinux label to swapfileKarel Zak2007-02-082-6/+54
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mkswap: avoid mkswap usage on already mounted deviceKarel Zak2007-02-071-2/+37
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mkswap: gcc happy: unsigned long usageKarel Zak2007-02-071-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Clean up pagesize/PAGE_SIZE usage.Karel Zak2007-02-061-36/+20Star
| | | | | | | | | Now all code in util-linux uses sysconf(_SC_PAGESIZE) that is standardized and preferred way of querying page size. The asm/page.h file is not included to the code anymore. (This patch doesn't change mount's FS detection code which will be removed later). Signed-off-by: Karel Zak <kzak@redhat.com>
* raw: move the raw command to /sbinKarel Zak2007-01-261-1/+1
| | | | | | The raw command could be used from udev scripts. Signed-off-by: Karel Zak <kzak@redhat.com>
* raw: don't accept raw0 as a target nameKarel Zak2007-01-261-6/+28
| | | | | | | The raw0 is rawctl and cannot be used as a normal raw device. The patch also enlarge range of <N> for raw<N> and improve the query mode. Signed-off-by: Karel Zak <kzak@redhat.com>
* raw: update man page (about dd and O_DIRECT)Karel Zak2007-01-251-3/+10
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: add missing filesKarel Zak2007-01-041-4/+6
| | | | | | | This patch add all missing headers, man pages and README files to automake stuff and "make dist-gzip" produces useful tarball now. Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: remove generated autotools stuff from gitKarel Zak2007-01-031-673/+0Star
| | | | | | | The generated autotools stuff shouldn't be maintained by SCM. After check out from git use ./autogen.sh. For more details see README.devel. Signed-off-by: Karel Zak <kzak@redhat.com>
* Imported from util-linux-2.13-pre6 tarball.Karel Zak2006-12-071-1/+1
|
* Imported from util-linux-2.13-pre5 tarball.Karel Zak2006-12-072-360/+449
|
* Imported from util-linux-2.13-pre4 tarball.Karel Zak2006-12-072-2/+7
|
* Imported from util-linux-2.13-pre3 tarball.Karel Zak2006-12-072-13/+14
|