`
jimlaren
  • 浏览: 42225 次
文章分类
社区版块
存档分类
最新评论

How Do I Access My Windows Partitions?

阅读更多

If you are running Ubuntu on a computer with a Windows disk, you may want to read and write to the disk. Ubuntu can safely read the Windows NT NTFS partitions and can read and write to Windows 95/98/2000 FAT32 partitions.

First, load a terminal, and use the fdisk command to know what partitions you currently have:

foo@bar:~$ sudo fdisk -l

The output should be similar to this:

Disk /dev/hda: 81.9 GB
Device Boot Start End Blocks Id System
/dev/hda1 * 1 1306 10490413+ 7 HPFS/NTFS
/dev/hda2 1307 1311 40162+ 83 Linux
/dev/hda3 1312 1344 265072+ 82 Linux swap
/dev/hda4 1345 9964 69240150 f W95 Ext'd (LBA)
/dev/hda5 1345 1606 2104483+ b W95 FAT32
/dev/hda6 1607 2852 10008463+ 83 Linux
...

In this output, the /dev/hda1 partition (the first partition on the first disk) is a 10GB Windows NTFS partition (probably called C:) and /dev/hda5 is a 2GB FAT32 partition (probably called D:).

When you access a disk, you need to mount it first. To mount it, you need to indicate a directory where the files from the disk are accessedthis is called a mount point. Create mount points in /media for the Windows partitions. It is good to use /media/C for C: and /media/D for D:, etc. to make things easy to remember.

foo@bar:~$ sudo mkdir /media/C /media/D

To make the disks accessible when you boot the computer, you need to add a few lines to /etc/fstab. This file indicates which disks are available. Add the following two lines:

/dev/hda1     /media/C     ntfs     nls=utf8,umask=0222    0     0
/dev/hda5 /media/D vfat defaults,umask=0000 0 0

The fourth column lets you specify options for mounting the partition, and nls=utf8,umask=0222 means that any user can read the NTFS partition.

To mount the two partitions without restarting, run the following command:

foo@bar:~$ sudo mount -a

The two partitions are now available and will be automatically mounted the next time Ubuntu is restarted.

评论

相关推荐

Global site tag (gtag.js) - Google Analytics