Warn the user if the partition to be created exceeds limits
imposed by the DOS partition table, which is:
* partition has to start on sector < 2^32
* partition size has to be < 2^32 sectors
For 512-byte logical sector size, these limits are ~2.2 TiB.
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
Unsigned long is only 4 bytes long on i586, which is not enough to
represent sector number on todays large disks. Use unsigned long long,
which is 8 bytes long, to store the sector numbers internally, so that
we could later make some sanity checks and warn the user if the sector
numbers exceed the limits imposed by DOS partition table format.
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
unsigned long is 4 bytes long on i586, which is not enough for big
HDD's with 512B sectors. Use unsigned long long, which is 8 bytes.
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
If the specified format is not cylinders, make the cylinder boundary
check only print a warning and proceed anyways.
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* 'docs-dir' of https://github.com/kerolasa/lelux-utiliteetit:
docs: remove duplicated text
docs: require kernel support before accepting use of it
docs: note about independent super block structs
docs: add libmount & libblkid debug instructions
Documentation: add debugging doc
arch: start using arch as a usage() example
docs: new file Documentation/release-schedule.txt
docs: move setuid information from reame to hwclock.8
docs: clean up old readme files
docs: copy contributors from legacy files to AUTHORS
docs: new file Documentation/howto-man-page.txt
docs: new file Documentation/source-code-management.txt
docs: new file Documentation/howto-contribute.txt
docs: new file Documentation/howto-compilation.txt
docs: tell what the Documentation/ is about
docs: add usage() howto for contributors
docs: Documentation directory added
docs: remove README.clear
This adds a welcome message with util-linux version number, information
about fdisk behaviour that doesn't write to disk after a command (unlike
gparted) and a warning about possible data loss.
The message appears just before the first command prompt.
Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
This patch makes the following tests/actions conditional to "!Linux":
- Force cylinders as format instead of MB, even if user asked for MB.
This solves a bug where if you use "-L -uM", set 1 as starting MB
and the disk is larger than a certain size (about 1GB) the partition
would start at sector 1 instead of 1MB due to cyl rounding.
- Warn about partitions not starting/ending on cyl boundaries.
- Check if CHS is ok.
I used the "!Linux" notation since it was already used elsewhere in
the code.
Signed-off-by: Giulio Orsero <giulioo@pobox.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Use dates without the day, use the full month name, put "util-linux" in
the lower left corner, and "User Commands" or "System Administration"
at the top center.
Also improve here and there the one-line program description.
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Also fix some erratic formatting, indent the third example too, drop
the trailing % prompt in examples, add a blank line before and after,
and improve the wording here and there.
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Move readme, licence, change log, relese notes and other
supplementary files to a Documentation directory. This commit
does not change contents of any other but few Makefile.am files.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Using a variable for each supported partition table type doesn't seem necessary.
This fixes also a minor bug in switching from SGI label to SUN label: the expert
menu isn't available as sgi_label variable remains set to true.
Code a bit more clear as *_label names have similarity with names such as
"sgilabel", "struct sun_label".
Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
The style in the file is really horrible and unreadable. This patch
uses:
indent -linux -i4 -psl -brf sfdisk.c
to fix the style. The ideal solution is to call the indent with only
-linux option, but it's too invasive...
Signed-off-by: Karel Zak <kzak@redhat.com>
cfdisk.c: In function ‘fp_printf’:
cfdisk.c:1760:12: warning: variable ‘x’ set but not used [-Wunused-but-set-variable]
Signed-off-by: Karel Zak <kzak@redhat.com>
The default response is 'p' until three primary partitions are created,
then 'e'.
The original idea is from Karel Zak.
Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
Mainly this appends a colon for the prompt, reverses order of the list,
reports the number of primary partitions used and unused.
Old version:
Command action
e extended
p primary partition (1-4)
p
New version:
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select: p
Old version:
Command action
l logical (5 or over)
p primary partition (1-4)
l
New version:
Partition type:
p primary (0 primary, 1 extended, 3 free)
l logical (numbered from 5)
Select: l
Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
Make sfdisk(8) return non-zero value on failed BLKRRPART ioctl().
This will happen for either partition table re-reads after partition
changes or on explicit use of -R switch.
The function reread_disk_partition() was changed from 'void' to 'int'
and now returns a result to let the calling functions decide to exit(1).
Signed-off-by: Andrea Galbusera <gizero@gmail.com>