Only Mount relative to Written disklabel.

This commit is contained in:
Poul-Henning Kamp 1994-11-07 00:41:38 +00:00
parent ae7d223f92
commit c4f1695923
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=4220

View file

@ -568,6 +568,10 @@ DiskLabel()
break;
case 'm': case 'M':
if (memcmp(lbl, Dlbl[diskno], sizeof *lbl)) {
yip = "Please (W)rite changed partition information first";
break;
}
j = AskWhichPartition("Mountpoint of which partition ? ");
if (j < 0) {
yip = "Invalid partition";
@ -606,17 +610,13 @@ DiskLabel()
Dlbl[diskno]->d_magic2 = DISKMAGIC;
Dlbl[diskno]->d_checksum = 0;
Dlbl[diskno]->d_checksum = dkcksum(Dlbl[diskno]);
*lbl= *Dlbl[diskno];
flag=1;
if (ioctl(Dfd[diskno], DIOCWLABEL, &flag) < 0)
Fatal("Couldn't enable writing of labels");
*lbl = *Dlbl[diskno];
enable_label(Dfd[diskno]);
if (ioctl(Dfd[diskno], DIOCSDINFO, Dlbl[diskno]) == -1)
Fatal("Couldn't set label: %s", strerror(errno));
if (ioctl(Dfd[diskno], DIOCWDINFO, Dlbl[diskno]) == -1)
Fatal("Couldn't write label: %s", strerror(errno));
flag=0;
if (ioctl(Dfd[diskno], DIOCWLABEL, &flag) < 0)
Fatal("Couldn't disable writing of labels");
disable_label(Dfd[diskno]);
yip = "Label written successfully.";
break;