On Fri, Jul 10, 2015, at 09:15 PM, Vijay Sankar wrote: > > Quoting Eric Furman <[email protected]>: > > > On Fri, Jul 10, 2015, at 01:57 PM, Vijay Sankar wrote: > >> Quoting Otto Moerbeek <[email protected]>: > >> > >> > On Fri, Jul 10, 2015 at 04:04:04PM +0000, Vijay Sankar wrote: > >> > > >> >> My objective for this weekend was to follow the new dpb and build ports > >> >> without using sudo. So I was hoping to upgrade to the latest > >> snapshot on a > >> >> system that I use for tests. > >> >> > >> >> The test system has a 2TB drive and it had two 300GB partitions in it > >> >> for > >> >> ports and vm; and a 120GB SSD for the OS and used to look as follows: > >> >> > >> >> Filesystem Size Used Avail Capacity Mounted on > >> >> /dev/sd1a 1005M 55.0M 900M 6% / > >> >> /dev/sd1k 64.5G 20.9G 40.3G 34% /home > >> >> /dev/sd1d 3.9G 10.0K 3.7G 0% /tmp > >> >> /dev/sd1f 2.0G 966M 946M 51% /usr > >> >> /dev/sd1g 1005M 191M 764M 20% /usr/X11R6 > >> >> /dev/sd1h 9.8G 2.9G 6.5G 31% /usr/local > >> >> /dev/sd1j 2.0G 2.0K 1.9G 0% /usr/obj > >> >> /dev/sd1i 2.0G 827M 1.1G 43% /usr/src > >> >> /dev/sd1e 13.5G 26.5M 12.8G 0% /var > >> >> /dev/sd0h 298G 176G 107G 62% /ports > >> >> /dev/sd0f 298G 19.6G 263G 7% /vm > >> >> > >> >> My /etc/fstab was > >> >> > >> >> 4f0cd8b5e7fd8f6a.b none swap sw > >> >> 4f0cd8b5e7fd8f6a.a / ffs rw 1 1 > >> >> 4f0cd8b5e7fd8f6a.k /home ffs rw,nodev,nosuid 1 2 > >> >> 4f0cd8b5e7fd8f6a.d /tmp ffs rw,nodev,nosuid 1 2 > >> >> 4f0cd8b5e7fd8f6a.f /usr ffs rw,nodev 1 2 > >> >> 4f0cd8b5e7fd8f6a.g /usr/X11R6 ffs rw,nodev 1 2 > >> >> 4f0cd8b5e7fd8f6a.h /usr/local ffs rw,nodev 1 2 > >> >> 4f0cd8b5e7fd8f6a.j /usr/obj ffs rw,nodev,nosuid 1 2 > >> >> 4f0cd8b5e7fd8f6a.i /usr/src ffs rw,nodev,nosuid 1 2 > >> >> 4f0cd8b5e7fd8f6a.e /var ffs rw,nodev,nosuid 1 2 > >> >> 4d43e3389228e319.h /ports ffs rw,nodev,nosuid 1 2 > >> >> 4d43e3389228e319.f /vm ffs rw,nodev,nosuid 1 2 > >> >> > >> >> I am not sure what happened -- but when I rebooted the system > >> this morning > >> >> /ports and /vm would not mount; so I commented out the last two lines in > >> >> /etc/fstab and rebooted. After reboot disklabel seems to have changed > >> >> completely and it currently looks like this: > >> >> > >> >> # disklabel sd0 > >> >> # /dev/rsd0c: > >> >> type: SCSI > >> >> disk: SCSI disk > >> >> label: ST2000DM001-1CH1 > >> >> duid: 0000000000000000 > >> >> flags: > >> >> bytes/sector: 512 > >> >> sectors/track: 63 > >> >> tracks/cylinder: 255 > >> >> sectors/cylinder: 16065 > >> >> cylinders: 503 > >> >> total sectors: 8089950 > >> >> boundstart: 0 > >> >> boundend: 8089950 > >> >> drivedata: 0 > >> >> > >> >> 16 partitions: > >> >> # size offset fstype [fsize bsize cpg] > >> >> c: 8089950 0 unused > >> >> > >> >> > >> >> Is there any way fix the disklabel or is this an error that is > >> impossible to > >> >> recover from? duid used to show up as 4d43e3389228e319 and not > >> >> 0000000000000000. > >> >> > >> >> Please let me know if you have any suggestions. > >> > > >> > Get your old label from /var/backups and try to restore it with > >> > disklabel -R. You don't tell what your platform is, it might be that > >> > you also need to do fdisk work first to restore the mbr partition > >> > table. > >> > > >> > But of course, it is also interesting to know what happened to you > >> > disk. But since you do not tell us what you did you are on your own > >> > here. > >> > > >> > -Otto > >> > >> Thank you very much. I am running an older snapshot OpenBSD 5.7 > >> -current as of Mar 19, 2015. I thought of -R with disklabel but since > >> the drive seems to show itself as a 3950MB drive instead of a 2TB > >> drive, I was not sure how to do this. > >> > >> The problem truly is I am not sure what I did to cause all this > >> problem!!! The sequence of actions were as follows. Since I had not > >> looked at this box for a while I was just logging in to look at where > >> I had kept everything. I did a cd /ports/packages/amd64/all and got an > >> input error when I tried to edit a file. So I did a shutdown -h now; > > > > --------------------------------------------------------------------------------------------------------------------- > >> opened the 3.5" and 2.5" hotswap drive bays and pulled both drives out > >> and pushed them back in. Powered the system on at which point I was > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > > > I am very curious to know why you did this. > > What am I missing here? > > --------------------------------------------------------------------------------------------------------------------- > > > >> dropped into the shell because /vm and /ports had errors. So I tried > >> to do a fsck_ffs and that failed. At that point I looked at disklabel > >> and noticed that the duid was gone. fdisk sd0 does not show anything > >> other than: > >> > >> # fdisk sd0 > >> Disk: sd0 geometry: 503/255/63 [8089950 Sectors] > >> > >> I tried the disklabel -R as you suggested; > >> > >> # disklabel -R sd0 disklabel.sd0.current > >> disklabel: partition a: partition extends past end of unit > >> disklabel: partition c: partition extends past end of unit > >> disklabel: partition d: offset past end of unit > >> disklabel: partition d: partition extends past end of unit > >> disklabel: partition e: offset past end of unit > >> disklabel: partition e: partition extends past end of unit > >> disklabel: partition f: offset past end of unit > >> disklabel: partition f: partition extends past end of unit > >> disklabel: partition g: offset past end of unit > >> disklabel: partition g: partition extends past end of unit > >> disklabel: partition h: offset past end of unit > >> disklabel: partition h: partition extends past end of unit > >> disklabel: partition i: offset past end of unit > >> disklabel: partition i: partition extends past end of unit > >> > >> Also tried > >> # fdisk -i sd0 > >> Do you wish to write new MBR and partition table? [n] y > >> Writing MBR at offset 0. > >> fdisk: error writing MBR: Input/output error > >> > >> Not sure whether there is any other option but Thanks very much for > >> the help and advice. > >> > >> Vijay > >> -- > >> Vijay Sankar, M.Eng., P.Eng. > >> ForeTell Technologies Limited > >> [email protected] > >> > > Hi Eric, > > I good at making major stupid mistakes especially when I am tired. The > past couple of days have been difficult because of some personal > problems -- my Mom in India is going through some major medical issues > and I am unable to be there due to various work and other reasons. So > I have been on the phone constantly at night and working during the > day. So not a good combination. > > Anyways, this machine was built by a local vendor with removable 3.5" > and 2.5" drives. I thought this would allow me to keep multiple > versions of OpenBSD and associated packages separated neatly. On one > occasion, the i/o error was because the 3.5" drive was not inserted > all the way through. Even though it is supposed to be hotswappable > drives, I have always shutdown the system and replaced the drives > instead of a hotswap. In hindsight I should have backed everything up > before shutting the system down, I guess. > > So, once fdisk cannot determine the right geometry or fdisk -i does > not work, does it indicate that it is a physical problem that cannot > be fixed? Is there something like disklabel -R for fdisk? > > Thanks very much for any suggestions you may have and for reading my > help request.
Really sorry to hear about your mom. Ah, I see now. You got an i/o error and thought maybe the drives weren't seated properly. Hmm, I'm no expert, but I suspect that if a drive is not seated properly you won't get an i/o error it just won't work at all. I suspect that your i/o errors were a sign that your disk was about to fail. Which seems is what has happened. I could be wrong. I'll send this back to Misc@. Hopefully someone who knows more than I can help you. I was just curious as to why you were fiddling with the physical drives. :)

