summaryrefslogtreecommitdiffstats
path: root/fdisk
Commit message (Collapse)AuthorAgeFilesLines
* fdisk: (and cfdisk) fix to be consistent about maximum headsChris Webb2009-05-192-2/+2
| | | | | | | | | | | | | | | Fix fdisk and cfdisk to be consistent about maximum heads Without this patch, fdisk allows up to 256 heads to be set via the menu, but only up to 255 heads by command line -H. Similarly, cfdisk's -H option also enforces heads <= 255 instead of heads <= 256. The strange limit of 256 comes about because (heads - 1) should fit in a single byte for legacy CHS. Geometries of 256 heads and 32 sectors are seen in disks from other operating systems where cylinder-aligned partitions which are also aligned to a 4MB boundary are wanted. Signed-off-by: Chris Webb <chris@arachsys.com>
* sfdisk: fix possible buffer overflowKarel Zak2009-04-291-4/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: fix max. ptnameKarel Zak2009-04-291-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: fix "cannot seek on disk drive" bugKarel Zak2009-04-281-1/+1
| | | | | Addresses-Debian-Bug: #511161 Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: add is_whole_disk() from fdisk codeKarel Zak2009-03-115-33/+6Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: support "-b 4096" optionKarel Zak2009-03-092-2/+2
| | | | | | | | The fdisk code is more ready for 4kB sectors and it makes sense to support such sectr size for "-b" option. Address-Red-Hat-Bugzilla: #218915 Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: (and partx) remove BLKGETLASTSECTKarel Zak2009-02-261-39/+1Star
| | | | | | This odd ioctl is unsupported in the current 2.4 and 2.6 mainline. Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: use real sector size in verify() and warn_cylinders()Karel Zak2009-02-261-15/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | 4KiB-sector disk: Note: sector size is 4096 (not 512) Disk /dev/sdb: 8 MB, 8388608 bytes 8 heads, 32 sectors/track, 8 cylinders, total 2048 sectors Units = sectors of 1 * 4096 = 4096 bytes Disk identifier: 0x6aad54da Device Boot Start End Blocks Id System /dev/sdb1 32 2047 8064 83 Linux old version (mix 512 and real sectors): Command (m for help): v 14367 unallocated sectors new version: Command (m for help): v 31 unallocated 4096-byte sectors Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: doesn't handle large (4KiB) sectors properlyEric Sandeen2009-02-261-5/+5
| | | | | | | | | fdisk (at least with the -u option) does not handle sector sizes other than 512. Address-Red-Hat-Bugzilla: #487227 Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: cleanup _PATH_DEV_* macrosKarel Zak2009-02-062-6/+3Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: add 0xaf HFS / HFS partition typeKarel Zak2009-02-041-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: remove unnecessary gettext callKarel Zak2008-12-121-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: rename ENABLE_CMDTAGQ macroKarel Zak2008-11-261-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: fix man page typoKarel Zak2008-11-251-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: accept yes/no as fallbackMatthias Koenig2008-11-141-2/+4
| | | | | | | | | | | Accept "yes" or "no" as fallback in case the question has not been translated. [kzak@redhat.com: note that rpmatch(3) looks at only the first character of response, but we need have to check the full yes/no string.] Signed-off-by: Matthias Koenig <mkoenig@suse.de>
* fdisk: add some missing includesMatthias Koenig2008-11-131-0/+4
| | | | | | | | | | | Currently these missing includes prevent that HDIO_GETGEO is defined, so is_probably_full_disk always uses the "silly heuristic" method. [kzak@redhat.com: add also unistd.h] Signed-off-by: Matthias Koenig <mkoenig@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: support +cylinder notationKarel Zak2008-11-131-2/+4
| | | | | | | | Currently fdisk does not support +cylinder notation and reports "Unsupported suffix: ''". Reported-by: Matthias Koenig <mkoenig@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: read /proc/partitions in more robust wayKarel Zak2008-11-131-4/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: cannot create partition with starting beyond 1 TBKarel Zak2008-11-131-1/+1
| | | | | | | | fdisk(8) uses "unsigned long long" for all internal calculations -- let use it for start of partition too. Address-Red-Hat-Bugzilla: #471369 Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: fix Compilation ErrorCAI Qian2008-10-231-1/+1
| | | | | | This patch fixes a compilation error in the latest tree. Signed-off-by: CAI Qian <caiqian@cclom.cn>
* fdisk: suggest partprobe(8) and kpartx(8) when BLKRRPART failedVincent Deffontaines2008-10-066-25/+33
| | | | | | Signed-off-by: Vincent Deffontaines <vincent@gryzor.com> Signed-off-by: Karel Zak <kzak@redhat.com> Co-Author: Karel Zak <kzak@redhat.com>
* fdisk: several strings without gettext callsPedro Ribeiro2008-10-034-9/+9
| | | | | Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: round reported sizes rather than truncateKarel Zak2008-08-201-4/+8
| | | | | | | | | | | | | Exmaples (-old, +new): - Disk /dev/mapper/bar: 266.6 GB, 266666666496 bytes + Disk /dev/mapper/bar: 266.7 GB, 266666666496 bytes - WARNING: The size of this disk is 2.1 TB (2199023255552 bytes). + WARNING: The size of this disk is 2.2 TB (2199023255552 bytes). Reported-by: Stepan Kasal <skasal@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: don't check for GPT when asked for disk size onlyKarel Zak2008-08-191-1/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: warn users about 2.2TB dos partition limitKarel Zak2008-08-191-0/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: remove obsolete information from man pageKarel Zak2008-08-181-20/+10Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: print version should end with a newlineDenis ChengRq2008-08-081-1/+1
| | | | Signed-off-by: Denis ChengRq <crquan@gmail.com>
* fdisk: exit(3) needs stdlib.h includemaximilian attems2008-07-281-0/+1
| | | | | | partitiontype.c:57: warning: incompatible implicit declaration of built-in function ‘exit’ Signed-off-by: maximilian attems <max@stro.at>
* fdisk: non-linux support (BLK* and HDIO_*)Samuel Thibault2008-07-246-4/+30
| | | | | | | | | | BLK* and HDIO_* are not available on all platform. Work around this in a few places. [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>
* fdisk: don't use get_linux_version() for non-linuxSamuel Thibault2008-07-242-2/+9
| | | | | | | | | | The get_linux_version() function is Linux-specific. Work around it in a few places. [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>
* fdisk: doesn't recognize the VMware ESX partitionsKarel Zak2008-05-191-0/+2
| | | | | | | | The fdisk programs do not recognize the partition types used by VMware ESX. They show up as "unknown". Addresses-Red-Hat-Bugzilla: #447023 Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: ignore a bunch of generated files, mostly binariesJames Youngman2008-04-141-0/+3
| | | | | Signed-off-by: James Youngman <jay@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: message tweakKarel Zak2008-04-141-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: use ncursesw (wide version) when possibeKarel Zak2008-03-201-1/+1
| | | | | | | | | | Detect ncursesw and use it in place of ncurses when possible (default). Allow people to use classic (non-wide) version by --with-ncurses or disable all ncurses/ncursesw support by --without-ncurses. Co-Author: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: add --enable-static-programsStepan Kasal2008-02-181-0/+12
| | | | | | | | Add support for static versions of mount, umount, losetup, fdisk, and sfdisk. Co-Author: Karel Zak <kzak@redhat.com> Signed-off-by: Stepan Kasal <skasal@redhat.com>
* fdisk: use more readable "GPT" name rather than "EFI GPT"Robert Millan2008-02-181-1/+1
| | | | | | | | | | | Although GPT is defined in EFI spec, it is widely used without EFI, as it reserves space for the MBR and works fine on PC/BIOS systems provided the bootloader supports it. This is in fact the way everyone seems to be following to overcome the 2 TiB limitation with MSDOS partition table. Signed-off-by: Robert Millan <rmh@aybabtu.com>
* fdisk: better fallback for get_random_id()H. Peter Anvin2008-01-281-1/+4
| | | | | | | | When /dev/urandom is not available, we have to use some kind of a hack to generate a random MBR identifier. Use a better fallback that incorporates the clock down to microsecond granularity. Signed-off-by: H. Peter Anvin" <hpa@zytor.com>
* fdisk: calculate +size{K,M,G} in 2^NKarel Zak2008-01-141-23/+49
| | | | | | | | | | | | | | | | | | | | fdisk(8) does not calculate partition size (+sizeM or +sizeG) in MiB or GiB correctly. It uses 10^N instead 2^N. This patch cleanups +sizeX to: +sizeK -- KiB (2^10) +sizeKB -- KB (10^3) +sizeM -- MiB (2^20) +sizeMB -- MB (10^6) +sizeG -- GB (10^9) +sizeGB -- GiB (2^30) This patch also fixes the "Last cylinder..." hint message. The "+number" without any suffix is not a size at all. It's number of cylinders/sectors. Note, the 10^N suffixes are not proposed to end-uses in the hint message. Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: define portable {DEFAULT,ALTERNATE}_DEVICESamuel Thibault2008-01-031-0/+8
| | | | | | Set DEFAULT_DEVICE and ALTERNATE_DEVICE for GNU/Hurd and FreeBSD Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* fdisk: use swab macros from bitops.hKarel Zak2007-12-171-20/+2Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: fix building for AVR32 and CRISImre Kaloz2007-12-171-1/+3
| | | | | | | The following simple patch fixes fdisk compilation for the AVR32 and CRIS architectures. Signed-off-by: Imre Kaloz <kaloz@openwrt.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: use dist_man_MANS instead of man_MANSStepan Kasal2007-12-171-4/+4
| | | | Signed-off-by: Stepan Kasal <skasal@redhat.com>
* sfdisk: allow partitioning drives of over 2^31 sectors.Kunihiko IMAI2007-12-041-1/+2
| | | | | | | sfdisk would incorrectly complain that there was no room when partitioning a drive over 2^31 sectors in size. Signed-off-by: LaMont Jones <lamont@mmjgroup.com>
* fdisk: non-linux support (use standard uintxy_t instead __uxy)Samuel Thibault2007-12-038-91/+90Star
| | | | | | | | - #include <linux/types.h> is turned into #include <stdint.h>, much more   portable, and __uxy were turned into uintxy_t. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: remove unnecessary linux/unistd.hSamuel Thibault2007-11-281-1/+0Star
| | | | | Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: cleanup usage of linux/major.hSamuel Thibault2007-11-282-1/+5
| | | | | | | | The utils like fdisk or login are usable on non-linux systems. This patch allows to compile on systems without linux/major.h. Signed-off-by: Karel Zak <kzak@redhat.com> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* fdisk: non-linux support (MAXPATHLEN)Karel Zak2007-11-261-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: display cylinders beyond 1024Peter Breitenlohner2007-11-261-6/+6
| | | | | | | | There is absolutely no reason why cfdisk should not display cylinders beyond 1024. The number of cylinders needs to be truncated only for the CHS field. Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* sfdisk: use get_linux_version()Karel Zak2007-11-081-17/+2Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: cleanup BLK* ioctls usageKarel Zak2007-11-0710-158/+57Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>