[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [OT?] LVM questions - I have seriously screwed my system



Thanks for the reply and explanation. I understand better now. Are you
sure that Debian takes care of mounting the new LVM share on boot? It
didn't work for me. From what I have read online you have to create
your own startup script.

I had LVM set up successfully on my new HD, copied all the data over
from the old one and then tried to extend LVM to include the new one.
Unfortunately I made one typo and now I think I have screwed things
up. Here is what I did:
...................................................................
NOTE - sda = old HD, sdb = new HD set up with LVM
.................................................................

$ pvcreate /dev/sda2
  Physical volume "/dev/sda2" successfully created

$ vgextend media_vg /dev/sda2
  Volume group "media_vg" successfully extended

.... Then I tried to set up sda according to instructions on a web
site, but I wrote the wrong device without noticing....

$ fdisk /dev/sdb

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)

Command (m for help): p

Disk /dev/sdb: 251.0 GB, 251000193024 bytes
255 heads, 63 sectors/track, 30515 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       30515   245111706   8e  Linux LVM

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device
or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.



So, am I totally screwed or can I recover the data and save
everything? The situation before, was that the data was mirrored on
both sda and sdb (sdb mounted as LVM at /mnt/media). But I now see
that I inadvertantly changed the partition type of sdb (when I
intended sda). So I assume that is a lost cause. (?)

Is there anything I can do now to recover?

Craig



Reply to: