Stalled scp file transfer session will happen when the network connection is unstable. You can see the status of the session at the message shown at your stdout like below:
file1 3% 136MB 0.0KB/s - stalled -
To continue back the file transfer, you can use this command at a new terminal, but make sure both the server and client have rsync installed:
$ rsync --partial --progress --rsh=ssh username@server:/path/to/remote-file /path/to/local-file
For example, if the transfer of file1 is stalled for user abu:
$ rsync --partial --progress --rsh=ssh abu@master:/home/abu/file1 /home/abu/file1
The scp transfer process will continue transferring the file
file1 4% 136MB 300.0KB/s 2:03:17 ETA
Tuesday, January 5, 2010
Continue stalled scp file transfer session
Saturday, November 14, 2009
Creating specific sized file
To create a specific sized file, dd command can be used. Example below will create a file named output with 10M size:
-rw-r--r-- 1 user user 10M 2009-11-14 06:21 outputFriday, November 13, 2009
Splitting big files
To split big files, split command can be used. Below is command used to split 400MB file named bigfile into 100MB chunk files named smallfile0*
Tuesday, September 29, 2009
Restore GRUB
GRUB is a boot loader commonly used with linux operating system. It can be used to managed dual boot environment where linux and windows can coexist easily in a same machine without problem provided you install the windows OS first so that when you install linux, GRUB will overwrite Windows boot loader and automatically detect and manage both operating system the next time you boot your computer. Problems will happen if you alter your partitions outside the knowledge of GRUB, for example, you create new partition in your hard drive using windows. This will cause GRUB to automatically go into GRUB shell when boot. To restore back your GRUB is very simple, just follow easy steps below:
1. find in which partition does GRUB store its configuration file, which is your /boot partition. (hd0,2) means third partition of the first hard drive
grub> find /boot/grub/stage1
(hd0,2)
2. set the root for GRUB to be (hd0,2)
grub> root (hd0,2)
3. write GRUB to the Master boot record(MBR) of your hard drive. Change (hd0) to (hd0,2) to write GRUB to your /boot partition instead
grub> setup (hd0)
4. Reboot machine
grub> reboot
All those steps can also be used using livecd, if let say the grub shell did not come out but you cannot boot your machine or you cannot boot your linux due to messed up GRUB. just boot from livecd, open a terminal, and type "grub" as a superuser to go to GRUB shell
Thursday, August 6, 2009
Mounting Windows shared folder on linux
Mounting windows shared folder on linux is very easy provided you know the ip of the windows machine, the name of the folder that is being shared, the username and password of the windows machine. As far as I know, there are 2 ways you can mount your windows shared folder on your linux machine.
The first way:
For gnome user, type Ctrl+F2, and type smb://windows_machine_ip/shared_folder_name. For example, see below picture
You can access the folder from Places
The second way:
Using command line;
sudo mount -t cifs //windows_machine_ip/shared_folder_name /directory_to_mount -o username=username,password=userpassword
example for mounting a shared folder named MP3 on 192.168.1.110 using windows username usin and password 123456 to /home/user/mp3:
$ sudo mount -t cifs //192.168.1.110/MP3 /home/user/mp3 -o username=usin,password=123456
Your shared folder now can be accessed from /home/user/mp3
That's all friends :)