Linux : HDD Failed _ Backup Your Data

Power up sekejap pastu access guna ssh dan tak lama kemudian tak leh access…dah kene usung aku nye LCD pegi kat testbed plug-in,pastu tgk….






cant detect /dev/hda….I/O error….kernel panic….WTF….habis data aku (dah mula cuak)….


dah mula terbayang nak beli HDD baru…takpe….cek mane2 yang patut…tapi…apa yang penting…data aku mesti diselamatkan…dalam dunia IT, yang paling penting sekali adalah data…kalau ticket tu kita letak TOP la…senang….papehal…data mesti diselamatkan dulu…tanpa data, tak bermakna semua sistem2 yang ada skang ini…






cek2 tgk, sistem tak dapatkan nak aktifkan VG aku…thats why kernel panic…root FS cant be mount…






ok…kat bawah cara2 nak aktifkan balik VG secara manual….supaya error kernal panic ilang dan root filesystem boleh mount dan OS buleh di boot dengan sempurna…dan yang paling penting, data aku selamat…






### Boot live ubuntu cd pastu jadi root









ubuntu@ubuntu:~$ sudo su









### cek la hdd yang failed tu os detect tak, kat sini aku plugin lagi satu HDD untuk store data yang hendak aku backup, 160GB tu…









root@ubuntu:/home/ubuntu# fdisk -l








Disk /dev/sda: 20.5 GB, 20547841536 bytes



255 heads, 63 sectors/track, 2498 cylinders



Units = cylinders of 16065 * 512 = 8225280 bytes



Disk identifier: 0x0f800000








   Device Boot      Start         End      Blocks   Id System



/dev/sda1   *           1          13      104391   83 Linux



/dev/sda2              14        2498    19960762+ 8e Linux LVM








Disk /dev/sdb: 200.0 GB, 200049647616 bytes



255 heads, 63 sectors/track, 24321 cylinders



Units = cylinders of 16065 * 512 = 8225280 bytes



Disk identifier: 0x00000000








   Device Boot      Start         End      Blocks   Id System



/dev/sdb1               1       24321   195358401   83 Linux








Disk /dev/sdc: 160.0 GB, 160041885696 bytes



255 heads, 63 sectors/track, 19457 cylinders



Units = cylinders of 16065 * 512 = 8225280 bytes



Disk identifier: 0xe71a9a5b








   Device Boot      Start         End      Blocks   Id System



/dev/sdc1   *           1         523     4200966   83 Linux



/dev/sdc2             524         589      530145   82 Linux swap / Solaris



/dev/sdc3             590       19457   151557210   83 Linux






###Pastu run command untuk create dir backup




root@ubuntu:/home/ubuntu# mkdir /mnt/backup






### Run untuk mount filesystem yang hendak dibackup




root@ubuntu:/home/ubuntu# mkdir /mnt/linux






### Ni error sebab tak install lvm2 package, mane leh mount mcm tu je beb




root@ubuntu:/home/ubuntu# mount /dev/sdb1 /mnt/linux/



mount: unknown filesystem type ‘LVM2member’






### Install dulu package lvm2




root@ubuntu:/home/ubuntu# apt-get install lvm2



Reading package lists… Done



Building dependency tree     



Reading state information… Done



The following extra packages will be installed:



watershed



The following NEW packages will be installed:



lvm2 watershed



0 upgraded, 2 newly installed, 0 to remove and 265 not upgraded.



Need to get 380kB of archives.



After this operation, 1069kB of additional disk space will be used.



Do you want to continue [Y/n]? y



Get:1 http://gb.archive.ubuntu.com jaunty/main watershed 4 [10.9kB]



Get:2 http://gb.archive.ubuntu.com jaunty/main lvm2 2.02.39-0ubuntu9 [369kB]



Fetched 380kB in 9s (39.5kB/s)                                                            



Selecting previously deselected package watershed.



(Reading database … 103509 files and directories currently installed.)



Unpacking watershed (from …/archives/watershed4amd64.deb) …



Selecting previously deselected package lvm2.



Unpacking lvm2 (from …/lvm22.02.39-0ubuntu9_amd64.deb) …



Processing triggers for man-db …



Setting up watershed (4) …



update-initramfs is disabled since running on read-only media








Setting up lvm2 (2.02.39-0ubuntu9) …



Backing up any LVM2 metadata that may exist…done.



update-initramfs is disabled since running on read-only media









### Run command untuk check physical device mount dalam VG mane, aku punya 2 hdd aku masukkan dalam satu VG iaitu VolGroup00




root@ubuntu:/home/ubuntu# pvs



PV         VG         Fmt Attr PSize   PFree



/dev/sda2 VolGroup00 lvm2 a-    19.03G     0



/dev/sdb1 VolGroup00 lvm2 a-   186.28G 58.28G






### Cek berapa LV ade dalam VG00 tu, ok yang aku punya , LV01 tu lah tempat tersimpan segala khazanah berharga aku, tapi aware dengan LV status tu…akunye tak available…sebab VG tak aktif….




root@ubuntu:/home/ubuntu# lvdisplay /dev/VolGroup00



—- Logical volume —-



LV Name                /dev/VolGroup00/LogVol01



VG Name                VolGroup00



LV UUID                ulhY8G-cBJw-fPsy-X1To-Qbc3-KtMS-oWBZg7



LV Write Access        read/write



LV Status              NOT available



LV Size                117.09 GB



Current LE             3747



Segments               2



Allocation             inherit



Read ahead sectors     auto





—- Logical volume —-



LV Name                /dev/VolGroup00/LogVol00



VG Name                VolGroup00



LV UUID                Gt6VoY-nHvj-1AIw-DqAL-PD5z-o1Lh-vug2Jz



LV Write Access        read/write



LV Status              NOT available



LV Size                1.94 GB



Current LE             62



Segments               1



Allocation             inherit



Read ahead sectors     auto






### Nilah akibat sebab VG tak aktif..kan dah takleh nak mount…




root@ubuntu:/home/ubuntu# mount /dev/VolGroup00/LogVol01 /mnt/linux



mount: special device /dev/VolGroup00/LogVol01 does not exist






### Run command nie untuk aktifkan balik VG secara manual, tgk kat LV status lepas aku run command tu, kan dah available.kemudian mount kan sekali lagi…




root@ubuntu:/home/ubuntu# vgchange -a y VolGroup00



7 logical volume(s) in volume group “VolGroup00” now active



root@ubuntu:/home/ubuntu# lvdisplay /dev/VolGroup00



—- Logical volume —-



LV Name                /dev/VolGroup00/LogVol01



VG Name                VolGroup00



LV UUID                ulhY8G-cBJw-fPsy-X1To-Qbc3-KtMS-oWBZg7



LV Write Access        read/write



LV Status              available



# open                 0



LV Size                117.09 GB



Current LE             3747



Segments               2



Allocation             inherit



Read ahead sectors     auto



- currently set to     256



Block device           252:0





—- Logical volume —-



LV Name                /dev/VolGroup00/LogVol00



VG Name                VolGroup00



LV UUID                Gt6VoY-nHvj-1AIw-DqAL-PD5z-o1Lh-vug2Jz



LV Write Access        read/write



LV Status              available



# open                 0



LV Size                1.94 GB



Current LE             62



Segments               1



Allocation             inherit



Read ahead sectors     auto



- currently set to     256



Block device           252:1








### Lepas dah mount, apelagi…backup la data2 tu…




root@ubuntu:/home/ubuntu# mount /dev/VolGroup00/LogVol01 /mnt/linux






Takkan nak copy data nak aku ajar jugak kot, google la command cp….


damm betul…cau cincau….



Comments

Popular posts from this blog

HP-UX : Server Model and Processor Details.

Android : First Post