Interupted dd Copy

About an hour ago, I tried to backup one of several partition on my notebook to my external disk. I chose dd command to do backup. As far as I know, dd command do the backup bit per bit – it copy everything from the low level filesystem. When the backup running, I shuted the computer down by pressing the power button. I did it because my Ubuntu became not responsive (may be because high load)….it was amazed me that Linux can hanging like that – remind me to Windows of course.

After boot, I found a ghost file on my disk. That file supposed to be my backup file, but it didn’t completed yet. I wasn’t able to delete it. See the logs below :

tedy@tedy-laptop:/media/tedy-wd/backup-winc$ ls -ltr
ls: cannot access winc.tar: Input/output error
total 0
-????????? ? ? ? ?                ? winc.tar
tedy@tedy-laptop:/media/tedy-wd/backup-winc$ rm -f winc.tar
rm: cannot remove `winc.tar': Input/output error
tedy@tedy-laptop:/media/tedy-wd/backup-winc$

Then I tried to do fsck on my external disk, but I just realize that fsck cannot be applied on disk that using NTFS partition. Looking good clue on the Internet, I read the article here. Somebody suggested to use ntfsresize to simulate NTFS disk check. And here is the result :

tedy@tedy-laptop:~$ sudo ntfsresize --no-action --force -s 110G /dev/sdb1
ntfsresize v2.0.0
Device name        : /dev/sdb1
NTFS volume version: 3.1
Cluster size       : 4096 bytes
Current volume size: 250056704512 bytes (250057 MB)
Current device size: 250056705024 bytes (250057 MB)
New volume size    : 109999993344 bytes (110000 MB)
Checking filesystem consistency ...
100.00 percent completed
Accounting clusters ...
Cluster accounting failed at 879939 (0xd6d43): extra cluster in $Bitmap
Cluster accounting failed at 879940 (0xd6d44): extra cluster in $Bitmap
Cluster accounting failed at 879941 (0xd6d45): extra cluster in $Bitmap
Cluster accounting failed at 879942 (0xd6d46): extra cluster in $Bitmap
Cluster accounting failed at 879943 (0xd6d47): extra cluster in $Bitmap
Cluster accounting failed at 879944 (0xd6d48): extra cluster in $Bitmap
Cluster accounting failed at 879945 (0xd6d49): extra cluster in $Bitmap
Cluster accounting failed at 879946 (0xd6d4a): extra cluster in $Bitmap
Cluster accounting failed at 879947 (0xd6d4b): extra cluster in $Bitmap
Cluster accounting failed at 879948 (0xd6d4c): extra cluster in $Bitmap
Filesystem check failed! Totally 1012766 cluster accounting mismatches.
ERROR: NTFS is inconsistent. Run chkdsk /f on Windows then reboot it TWICE!
The usage of the /f parameter is very IMPORTANT! No modification was
and will be made to NTFS by this software until it gets repaired.
tedy@tedy-laptop:~$ 

Unfortunately ntfsresize command gave up and suggest me to perform disk check on the Windows machine. So here is the result when I executed chkdsk on Windows XP :

C:\Documents and Settings\Tedy Tirtawidjaja>chkdsk /f E:
 The type of the file system is NTFS.
Volume label is tedy-wd.

CHKDSK is verifying files (stage 1 of 3)...
Deleting corrupt file record segment 37330.
File verification completed.
Deleting orphan file record segment 37331.
Deleting orphan file record segment 37332.
Deleting orphan file record segment 37333.
Deleting orphan file record segment 37334.
Deleting orphan file record segment 37335.
Deleting orphan file record segment 37336.
Deleting orphan file record segment 37337.
Deleting orphan file record segment 37338.
Deleting orphan file record segment 37339.
Deleting orphan file record segment 37340.
CHKDSK is verifying indexes (stage 2 of 3)...
Deleting an index entry from index $O of file 25.
Deleting an index entry from index $O of file 25.
Deleting index entry winc.tar in index $I30 of file 37329.
Index verification completed.
CHKDSK is verifying security descriptors (stage 3 of 3)...
Security descriptor verification completed.
Correcting errors in the uppercase file.
CHKDSK discovered free space marked as allocated in the
master file table (MFT) bitmap.
CHKDSK discovered free space marked as allocated in the volume bitmap.
Windows has made corrections to the file system.

244196000 KB total disk space.
211528444 KB in 35171 files.
9676 KB in 1284 indexes.
0 KB in bad sectors.
114780 KB in use by the system.
65536 KB occupied by the log file.
32543100 KB available on disk.

4096 bytes in each allocation unit.
61049000 total allocation units on disk.
8135775 allocation units available on disk.

C:\Documents and Settings\Tedy Tirtawidjaja>

I did disk check twice, once more after I restarting Windows.

C:\Documents and Settings\Tedy Tirtawidjaja>chkdsk /f E:
 The type of the file system is NTFS.
Volume label is tedy-wd.

CHKDSK is verifying files (stage 1 of 3)...
File verification completed.
CHKDSK is verifying indexes (stage 2 of 3)...
Index verification completed.
CHKDSK is verifying security descriptors (stage 3 of 3)...
Security descriptor verification completed.
Windows has checked the file system and found no problems.

 244196000 KB total disk space.
211528444 KB in 35171 files.
9676 KB in 1284 indexes.
0 KB in bad sectors.
114780 KB in use by the system.
65536 KB occupied by the log file.
32543100 KB available on disk.

4096 bytes in each allocation unit.
61049000 total allocation units on disk.
8135775 allocation units available on disk.

C:\Documents and Settings\Tedy Tirtawidjaja>

As you can see, chkdsk did his job perfectly. I removed back my external disk to Ubuntu and everything back to normal now. No more ghost file in my external disk.

tedy@tedy-laptop:/media/TEMP$ ls -ltr backup-winc/
total 0
tedy@tedy-laptop:/media/TEMP$

Valueable lesson for me : don’t ever to try to interupt dd process again. And learn how to write in English better than this post ;))

HSDPA Di Ubuntu (part 3)

Ini tulisan ketiga saya tentang modem HSDPA (tulisan sebelumnya ada di sini dan di sini). Modem dalam foto di bawah ini milik rekan saya Andi, modem ZTE MF636 yang di-bundle dengan paket broadband internetnya Indosat. Hitung-hitung ini modem HSDPA yang saya coba.

Dapat petunjuk instalasinya dari sini, lebih mudah daripada modem Option yang pernah saya bahas sebelumnya. Langkah-langkah instalasinya seperti berikut ini :

1. Deteksi dulu modemnya dengan perintah lsusb. Modem ZTE ini terdeteksi dengan idVendor 19d2 dan idProduct 0031.

tedy@tedy-laptop:~$ lsusb
Bus 007 Device 003: ID 19d2:0031
Bus 007 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 002: ID 08ff:2580 AuthenTec, Inc. AES2501 Fingerprint Sensor
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 003: ID 046d:09b2 Logitech, Inc.
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 15ca:00c3 Textech International Ltd. Mini Optical Mouse
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
tedy@tedy-laptop:~$

tedy@tedy-laptop:~$ lsusb -v

Bus 007 Device 003: ID 19d2:0031
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x19d2
idProduct 0x0031
bcdDevice 0.00
iManufacturer 2 ZTE, Incorporated
iProduct 1 ZTE CDMA Technologies MSM
iSerial 3 1234567890ABCDEF
bNumConfigurations 1

2. Kita perlu menginstal paket  libusb-dev terlebih dahulu :

tedy@tedy-laptop:~/bin$ sudo apt-get install libusb-dev
[sudo] password for tedy:
Reading package lists... Done
Building dependency tree
Reading state information... Done
libusb-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
tedy@tedy-laptop:~/bin$

3. Untuk membuat Ubuntu mengenali modem ini bukan sebagai USB drive biasa, kita perlu menambahkan rules seperti berikut ini :

tedy@tedy-laptop:~$ cat /etc/udev/rules.d/65-zte-mf628-modem.rules
ACTION!="add", GOTO="ZTE_End"
#
SUBSYSTEM=="usb", SYSFS{idProduct}=="0031",
SYSFS{idVendor}=="19d2", GOTO="ZTE_Modem"
#
LABEL="ZTE_Modem"
RUN+="/sbin/modprobe usbserial vendor=0x19d2 product=0x0031",
MODE="660", GROUP="dialout"
#
LABEL="ZTE_End"
tedy@tedy-laptop:~$

4. Ada file yang perlu kita modifikasi juga yaitu file /usr/share/hal/fdi/information/10freedesktop/10-modem.fdi. Yang harus dimodifikasi adalah baris yang berisi "@info.parent:usb.vendor_id" dan "@info.parent:usb.product_id" Ganti default value yang ada dengan idVendor dan idProduct dengan hasil yang ditampilkan oleh perintah  lsusb.

tedy@tedy-laptop:~$ cat /usr/share/hal/fdi/information/10freedesktop/10-modem.fdi | egrep "0031|19d2"
<match key="@info.parent:usb.vendor_id" int="0x19d2">
<match key="@info.parent:usb.product_id" int="0x0031">
tedy@tedy-laptop:~$

5. Reboot komputernya tapi jangan pasangkan modem sampai proses reboot selesai.

6. Setelah reboot, Ubuntu sukses mengenali modem ZTE ini. Saya tinggal membuat koneksi baru dengan Network Manager (yang ada di sisi kanan atas desktop). Langkah-langkahnya persis seperti yang sudah pernah saya tulis di  https://blog.tedytirta.info/2009/03/28/hsdpa-di-ubuntu-part-2/ (lihat bagian setelah langkah ke-10; yang menampilkan gambar-gambar hasil screenshot). Yang perlu diperhatikan mungkin adalah parameter authentifikasinya seperti berikut ini :

username = indosat
password = indosatc
APN = indosat3g

Saat saya coba menggunakan modem ini, saya juga sempat menampilkan output dari sistem lewat file /var/adm/messages seperti berikut ini :

tedy@tedy-laptop:~$ tail -f /var/log/messages
Mar 31 18:31:26 tedy-laptop pppd[14811]: Plugin /usr/lib/pppd/2.4.4/nm-pppd-plugin.so loaded.
Mar 31 18:31:26 tedy-laptop pppd[14811]: pppd 2.4.4 started by root, uid 0
Mar 31 18:31:26 tedy-laptop pppd[14811]: Using interface ppp0
Mar 31 18:31:26 tedy-laptop pppd[14811]: Connect: ppp0 <--> /dev/ttyUSB1
Mar 31 18:31:26 tedy-laptop pppd[14811]: CHAP authentication succeeded
Mar 31 18:31:26 tedy-laptop pppd[14811]: CHAP authentication succeeded
Mar 31 18:31:26 tedy-laptop pppd[14811]: Terminating on signal 15
Mar 31 18:31:26 tedy-laptop pppd[14811]: Connection terminated.
Mar 31 18:31:28 tedy-laptop pppd[14811]: Exit.
Mar 31 18:31:34 tedy-laptop pppd[14824]: Plugin /usr/lib/pppd/2.4.4/nm-pppd-plugin.so loaded.
Mar 31 18:31:34 tedy-laptop pppd[14824]: pppd 2.4.4 started by root, uid 0
Mar 31 18:31:34 tedy-laptop pppd[14824]: Using interface ppp0
Mar 31 18:31:34 tedy-laptop pppd[14824]: Connect: ppp0 <--> /dev/ttyUSB1
Mar 31 18:31:35 tedy-laptop pppd[14824]: CHAP authentication succeeded
Mar 31 18:31:35 tedy-laptop pppd[14824]: CHAP authentication succeeded
Mar 31 18:31:37 tedy-laptop pppd[14824]: Could not determine remote IP address: defaulting to 10.64.64.64
Mar 31 18:31:37 tedy-laptop pppd[14824]: local IP address 10.173.6.216
Mar 31 18:31:37 tedy-laptop pppd[14824]: remote IP address 10.64.64.64
Mar 31 18:31:37 tedy-laptop pppd[14824]: primary DNS address 124.195.15.100
Mar 31 18:31:37 tedy-laptop pppd[14824]: secondary DNS address 124.195.15.98
Mar 31 18:32:34 tedy-laptop pppd[14824]: Terminating on signal 15
Mar 31 18:32:34 tedy-laptop pppd[14824]: Connect time 1.0 minutes.
Mar 31 18:32:34 tedy-laptop pppd[14824]: Sent 15056 bytes, received 160671 bytes.
Mar 31 18:32:34 tedy-laptop pppd[14824]: Connection terminated.
Mar 31 18:32:34 tedy-laptop pppd[14824]: Exit.
Mar 31 18:32:47 tedy-laptop kernel: [ 4671.587486] usb 7-1: USB disconnect, address 4
Mar 31 18:32:47 tedy-laptop kernel: [ 4671.588489] generic ttyUSB0: generic converter now disconnected from ttyUSB0
Mar 31 18:32:47 tedy-laptop kernel: [ 4671.588522] usbserial_generic 7-1:1.2: device disconnected
Mar 31 18:32:47 tedy-laptop kernel: [ 4671.591605] generic ttyUSB1: generic converter now disconnected from ttyUSB1
Mar 31 18:32:47 tedy-laptop kernel: [ 4671.591655] usbserial_generic 7-1:1.3: device disconnected

Ketika saya coba berinternet dengan modem ini, koneksinya buruk sekali. Ah tapi mungkin itu karena tangkapan sinyal yang buruk waktu itu. Waktu itu saya coba di kantor, tidak dipinjam untuk dibawa pulang soalnya 😀 Berharap ada yang mau meminjamkan modem HSDPA tipe-tipe lainnya, supaya saya bisa punya pengalaman lain lagi & bisa melanjutkan seri tulisan “HSDPA di Ubuntu” ini :-p

Dipilih Dipilih Dipilih

In picture : 2 Fujitsu Lifebook S6410, 1 Lenovo Ideapad S9, 1 Compaq Presario CQ40, 1 Compaq Presario V300.

Yang mana yang saya pilih? Yang pasti bukan Compaq Presario CQ40….notebook yang menyusahkan X-(

*** Saya akan jelaskan alasannya nanti di tulisan selanjutnya.***