Thursday, June 14, 2012

mount in ubuntu

在 ubuntu 上, mount fat32 與 ntfs 的磁碟

1) 首先, 先看目前已經找到的磁碟區, 透過
>fdisk -l

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc05fc05f

Device Boot Start End Blocks Id System
/dev/sda1 * 1 2550 20482843+ 7 HPFS/NTFS
/dev/sda2 2551 9728 57657285 f W95 Ext'd (LBA)
/dev/sda5 2551 6374 30716248+ b W95 FAT32
/dev/sda6 6375 9728 26940973+ b W95 FAT32

Disk /dev/sdb: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x2527a2c7

Device Boot Start End Blocks Id System
/dev/sdb1 1 3916 31455238+ 7 HPFS/NTFS
/dev/sdb2 3917 9729 46692922+ 7 HPFS/NTFS

2) mount 磁碟區

mkdir /tmp/sda1 /tmp/sda5 /tmp/sda6 /tmp/sdb1 /tmp/sdb2
mount -t ntfs-3g /dev/sda1 /tmp/sda1
mount -t vfat -o iocharset=utf8 /dev/sda5 /tmp/sda5
mount -t vfat -o iocharset=utf8 /dev/sda6 /tmp/sda6
mount -t ntfs-3g /dev/sdb1 /tmp/sdb1
mount -t ntfs-3g /dev/sdb2 /tmp/sdb2

其中,
mount as ntfs, 在 ubuntu 或 samba, 閱讀中文沒有問題
mount as vfat, 必須指定 iocharset=utf8, 在 ubuntu 或 samba, 才能閱讀中文

No comments: