Linux NTFS: Difference between revisions

From miki
Jump to navigation Jump to search
(→‎NTFSClone: restore a partition)
Line 8: Line 8:
* http://ubuntuforums.org/archive/index.php/t-1072025.html
* http://ubuntuforums.org/archive/index.php/t-1072025.html


'''Mounting an NTFS partition using file <tt>/etc/fstab</tt>'''
All you have to do is edit your /etc/fstab file (note: <tt>ntfs</tt> is actually equivalent to <tt>ntfs-3g</tt> since <tt>/sbin/mount.ntfs</tt> is symlinked to <tt>/sbin/mount.ntfs-3g</tt>):
* First get the UUID of the partition to mount
<source lang="bash">
{{pl2|<source lang="bash" enclose="prevalid">sudo blkid</source>}}
$ sudo blkid # Get the UUID of the partition to mount
$ gksudo gedit /etc/fstab # Edit the file
* Edit '''/etc/fstab''' accordingly:
{{pl2|<source lang="text">UUID=XXXXXXXXXXXXXXXXXXXXX /media/windows ntfs defaults,umask=007,gid=46 0 1</source>}}
:Note that '''gid=46''' refers to '''plugdev''' group.
* Now the partition can be mounted with:
{{pl2|<source lang="bash" enclose="prevalid">sudo mount /media/windows</source>}}


'''Mounting a NTFS partition using command <tt>mount</tt>'''
# Add a line similar to:
* To mount an NTFS partition '''/dev/sda1''' to mount point '''/media/windows''':
UUID=XXXXXXXXXXXXXXXXXXXXX /media/windows ntfs defaults,umask=007,gid=46 0 1
{{pl2|<source lang="bash">sudo mount -t ntfs -o defaults,umask=007,gid=46 /dev/sda1 /media/windows</source>}}

$ sudo mount -a
</source>
Note that '''gid=46''' refers to '''plugdev''' group.


== NTFSResize ==
== NTFSResize ==

Revision as of 17:06, 22 March 2010

This page is part of the Linux Disk Management pages.

Mounting

References

Mounting an NTFS partition using file /etc/fstab

  • First get the UUID of the partition to mount
sudo blkid
  • Edit /etc/fstab accordingly:
UUID=XXXXXXXXXXXXXXXXXXXXX /media/windows ntfs defaults,umask=007,gid=46 0 1
Note that gid=46 refers to plugdev group.
  • Now the partition can be mounted with:
sudo mount /media/windows

Mounting a NTFS partition using command mount

  • To mount an NTFS partition /dev/sda1 to mount point /media/windows:
sudo mount -t ntfs -o defaults,umask=007,gid=46 /dev/sda1 /media/windows

NTFSResize

Change the size of an existing NTFS partition

$ fdisk -l /dev/sda                               # List information on partitions on /dev/sda
$ ntfsresize --info /dev/sda1
$ ntfsresize --no-action --size 20152M /dev/sda1  # Testing
$ ntfsresize --no-action --size 20151M /dev/sda1  # Testing
$ ntfsresize --size 20151M /dev/sda1
$ ntfsresize --size 20000M /dev/sda1

NTFSClone

Backup an NTFS partition to a file

sudo ntfsclone --save-image -o - /dev/sda1 | gzip -c > backup-20090908.img.gz

Restore an NTFS partition from a file

gzip -d -c backup-20090908.img.gz | sudo ntfsclone --restore-image --overwrite /dev/sda1 -