summaryrefslogtreecommitdiff
path: root/sbin/disklabel
AgeCommit message (Collapse)Author
2007-05-29Updated disklabel format to support larger disks and partitions. WeOtto Moerbeek
free room in struct partition by packing fragment size and fragments/block more tighlty and use the resulting space to make offset and size 48 bits. For the disk part we use spare fields in struct disklabel. Kernel converts in-mem copy of the on-disk label if needed, disklabel(8) writes new version. We are careful to only change fields not used by bootloaders. Conception of basic scheme by deraadt. ok deraadt@ krw@
2007-05-24Make 'disklabel -w -d <disk>' work. i.e. write the default disklabelKenneth R Westerback
onto disk. More elegant than "dd if=/dev/zero of= ..." to clear out an old disklabel. Think of it as treating the spoofed disklabel created by readdisklabel() like an automatically generated disktab entry. Makes some install scripts (macppc to start) easier.
2007-05-13Sync editit() with sendbug.Ray Lai
OK krw@.
2007-04-29fix rounding in the modify case; ok millert@ miod@Otto Moerbeek
2007-04-26includes that are not needed anymoreTheo de Raadt
2007-04-26Eliminate CPU_BIOS from userland and wd(4) by always using the BIOSKenneth R Westerback
geometry in the disklabel when there is a BIOS geometry to provide. This removes the option to set a disklabel to 'BIOS' geometry via the 'g b' command in the editor. Makes reported geometry more consistant and moves MD code to MD land where it should be. Doc help from jmc@, Feedback from millert@, marco@, weingart@, kettenis@. ok deraadt@
2007-04-26Copy sendbug's editit() to disklabel.Ray Lai
OK krw@.
2007-03-18Check for zero divisor _before_ dividing; do not use floatingOtto Moerbeek
point arithmetic to round to a cylinder boundary when a simple integer expression can do the job as well. ok millert@ miod@
2007-03-13Refactor & fix computation of offset for next partition. Now theOtto Moerbeek
code is almost readable. Keep in mind that the starting offset is inclusive, but the ending offset is exclusive. I heard rumors that disklabel was misbehaving in some cases before, but espie@ was the only one to provide me with enough details to actually find the problem. ok millert@ tom@
2007-03-02If a default label has been created with the -d command line option orKenneth R Westerback
the 'D' editor command and has not been written to disk when the user issues the 'q' editor command, ask if the label should be written to disk before exiting.
2007-02-24Correct comment calling FILE *f a file descriptor.Ray Lai
OK krw@.
2007-02-22Always write the disklabel to disk when asked, even if it appears toKenneth R Westerback
be unchanged. Fixes PR#5209. Proper behaviour of 'q'uit still under discussion. ok ray@ millert@ ckuethe@ nick@
2007-02-20Change hard coded numbers to sizeof(buf). Also change someRay Lai
sizeof(buf) - 1 to sizeof(buf), since fgets takes the whole buffer size. Based on diff from Charles Longeau <chl at tuxfamily dot org> long ago. OK millert@.
2006-10-14Friends don't let friends look for disklabels in Free/NetBSD MBRKenneth R Westerback
partitions since the kernel doesn't put them or look for them there anymore.
2006-10-14Friends don't let friends look for disklabels in Free/NetBSD MBRKenneth R Westerback
partitions since the kernel doesn't put them or look for them there anymore.
2006-10-12Should be correct for landisk.Dale Rahn
2006-09-27Oops. Missed a line. Fix so disklabel(8) compiles again.Kenneth R Westerback
2006-09-26Zap D_REMOVABLE flag from disklabel. If you didn't already know thatKenneth R Westerback
floppies and cd's were removable, displaying that fact in disklabel output was unlikely to help. And the display in disklabel was the only use of D_REMOVABLE in the tree. ok marco@
2006-09-24Eliminate D_CHAIN, D_ECC and D_RAMDISK flags from disklabel. They wereKenneth R Westerback
not being used in the tree for anything obviously useful. Get it done early so we can find if there are non-obvious uses out there. ok deraadt@ beck@
2006-07-11Let armish and cats recognize MBR partitioning, to come up with properMiod Vallat
disklabel bounds in disklabel -E; while there, sort of sort the architectures.
2006-07-01Eliminate redundant get_le() in favour of letoh32(). Add letoh32()Kenneth R Westerback
calls in alpha, hppa, hppa64 and mips63 when accessing the two DOS MBR u_int32_t fields dp_size and dp_start. No functional change.
2006-05-16change only use of slice to 'partition letter' to be consistent withKevin Steves
use of partition everywhere else; ok jmc@
2006-04-26man page is gzip'd, should store as unsigned char array.Theo de Raadt
2006-04-14Remove duplicate code, okay ray@Pedro Martelletto
2005-12-05Avoid an out-of-bounds array access in editor_delete() for invalid partitionMiod Vallat
name; spotted by Laurent Coustet (ed, debian-fr net) ok deraadt@ otto@
2005-11-16Fix conversion of K units to handle case where sector size > 1024. e.g.Kenneth R Westerback
Sony Hi-MD usb drive. ok millert@
2005-11-13missing fclose(); from dhill@mindcry.orgTheo de Raadt
2005-11-12use snprintf; ok cloder dhill@mindcry.orgTheo de Raadt
2005-08-30Get the start of the A6 partition from fdisk. Fixes wrong suggestion ofUwe Stuehler
offset 0 for the start of slice a. ok deraadt@
2005-04-30Better header at the top:Theo de Raadt
# Inside MBR partition 3: type A6 start 2570463 size 75569697
2005-04-01will do disklabels like hppaTheo de Raadt
2005-03-07more macro simplification;Jason McIntyre
2005-02-16Prevent gzip from storing mtime and filename in the header so weTodd C. Miller
get identical binaries.
2005-01-13be aware of zaurusTheo de Raadt
2005-01-07Print disk size and free space in requested unit. Some refactoring toOtto Moerbeek
avoid code duplication as well. ok marco@ deraadt@
2004-12-11A compare function for heapsort(3) should not just subtract twoOtto Moerbeek
offsets, it does not work if the difference is large. Problem found by Jean-Gerard Pailloncyi who had false warnings of overlapping partitions. ok millert@ tedu@
2004-11-06update -DSEEALSO for alpha and cats, remove arc and amiga. ok miod@Otto Moerbeek
2004-11-06gzip embedded man pages, and pipe through gunzip when viewing.Otto Moerbeek
ok deraadt@
2004-10-25typo, from Nathan RickerbyOtto Moerbeek
2004-10-04Allow one more char for fstype, to avoid truncation of ISO9660 fstype.Otto Moerbeek
spotted by and ok krw@
2004-10-01add some missing $, ok djm@ 'That looks fine to me' millert@Jonathan Gray
2004-09-28Tidy disklabel output for todays big disks. Based on a diff from fOtto Moerbeek
at obiit dot org in PR 3847. ok tedu@ deraadt@ millert@
2004-09-18remove unused var, and then fix the code to watch for waitpid() errorsTheo de Raadt
ok otto millert
2004-08-08spacingTheo de Raadt
2004-08-03Handle geometry parameters as unsigned quantities, getting rid ofOtto Moerbeek
negative number of sectors on large disks and other similar problems. Also make reading of ASCII disk labels more robust by using strtonum(3) instead of atoi(3). ok millert@ deraadt@
2004-05-20Typo from Jared Yanovich phirerunner@comcast.netMarco Peereboom
2004-05-03Remove OpenBSD/pegaos, this has been announced before but delayed untilDale Rahn
the tree was stable. No point in code supporting a company which screws its employees being in the OpenBSD tree.
2004-04-07Remove those option letters from the getopt string which do not have a caseAaron Campbell
handler below. millert@ ok
2004-02-25correct NOMAN= caseTheo de Raadt
2004-01-28Repair build links for pegosos, and also build for amd64Theo de Raadt