2013年12月30日 星期一

Howto apply patch

====generate a patch file======

diff -Naurp old_file new_file > production.patch
產生patch file是用diff指令,至於要下哪些參數可以
參考diff --help來使用


====apply patch file======
patch
-p之後接數字代表要patch(更新)的file目
錄檔案從哪邊開始可以參考patch file的
第一行所寫的路經

patch -p數字 < patch_file_path

還原:
 patch -R <  patch_file_path

2013年12月29日 星期日

mount NTFS fs

linux cmd:

1. check partition information and make sure what partition you wan to mount:
               fdisk -l
    ex:
[root@adamlee adam]# fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xe84788aa

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        3919    31479336    7  HPFS/NTFS
/dev/sda2            3920       19457   124808985    f  W95 Ext'd (LBA)
/dev/sda5            3920       11752    62918541    7  HPFS/NTFS
/dev/sda6   *       11753       11778      204799+  83  Linux
/dev/sda7           11778       18305    52428799+  83  Linux
/dev/sda8           18305       18827     4194303+  82  Linux swap / Solaris

Disk /dev/sdb: 4027 MB, 4027580416 bytes
117 heads, 29 sectors/track, 2318 cylinders
Units = cylinders of 3393 * 512 = 1737216 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1        2318     3932113    c  W95 FAT32 (LBA)

2. mount:
              mount -t ntfs /dev/sda1  /media/NTFSpartition

3. umount
              umount -t ntfs /dev/sda1