Lines Matching defs:disk
121 char *disk;
186 disk = g_device_path(*argv);
187 if (disk == NULL)
192 /* open the disk and read in the existing mbr. Either here or
193 * when reading the block from disk, we do check for the version
196 mbr_size = read_mbr(disk, &mbr, !B_flag);
203 * If we are installing the boot loader, read it from disk and copy the
206 * write back to disk if we are going to do a write.
254 /* write the MBR back to disk */
256 write_mbr(disk, 0, boot0, boot0_size);
266 free(disk);
302 * Read in the MBR of the disk. If it is boot0, then use the version to
307 read_mbr(const char *disk, u_int8_t **mbr, int check_version)
314 if ((fd = open(disk, O_RDONLY)) == -1)
315 err(1, "open %s", disk);
317 err(1, "read %s", disk);
319 errx(1, "%s: short read", disk);
321 errx(1, "%s: bad magic", disk);
325 errx(1, "%s: unknown or incompatible boot code", disk);
329 errx(1, "%s: unable to allocate read buffer", disk);
332 err(1, "%s", disk);
334 errx(1, "%s: short read", disk);
572 " [-o options] [-s slice] [-t ticks] disk");