Thursday, December 23, 2010

Mounting ntfs partitions

Ubuntu is capable of reading and writing files stored on Windows formatted partitions. These partitions are normally formatted with NTFS, but are sometimes formatted with FAT32. You will also see FAT16 on other devices.

To check what your partition is formatted as you can run from terminal:
sudo fdisk -l

Output must be something like:
flaca@anneke:~$ sudo fdisk -l

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 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: 0x61553235

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         914     7340032    7  HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2             914       23036   177689854    7  HPFS/NTFS
/dev/sda3           23036       38914   127539201    5  Extended
/dev/sda5           38264       38914     5222400   82  Linux swap / Solaris
/dev/sda6           23036       26683    29295616   83  Linux
/dev/sda7           26683       38263    93018112   83  Linux

Partition table entries are not in disk order

The ntfs-3g driver is used in linux to read and write NTFS partitions.

NTFS (New Technology File System) is a file system developed by Microsoft and used by Windows computers (Windows 2000 and later). Until 2007, linux was not able to write to this type of filesystem, it could only read from it. The stable ntfs-3g driver now allows linux systems to read and write NTFS formatted partitions.

The ntfs-3g packages comes pre-installed in currently supported versions of Ubuntu and most NTFS devices should work out of the box without further configuration.

Manual Configuration

First you need to find the device location of the NTFS partition(s) you want to mount. In terminal, run:
sudo fdisk -l | grep NTFS | awk '{print $1}'

flaca@anneke:~$ sudo fdisk -l | grep NTFS | awk '{print $1}'

The name of each partition should be something like /dev/hdxn or /dev/sdxn, where x is an alphabetical letter (ranges from a to z) and n is a number (e.g. /dev/hda1).

If the drive is internal, you will now need to edit your file systems table configuration file, /etc/fstab. If the drive is an external USB or firewire drive, hal should automount it. Now, be sure to save a backup of fstab first, then open the file for editing:
sudo cp -p /etc/fstab /etc/fstab.orig
sudo vi /etc/fstab

Find the line that matches the device location you just found and change it to the following. If there is no entry yet, add a new line like the following:
<your partition> /media/<mount point> ntfs-3g defaults,user,locale=en_US.utf8 0 0
/dev/sda2    /media/windows    ntfs-3g    defaults,user,locale=en_US.utf8 0 0

NOTE: If it displays your NTFS partition with a UUID, you can check the relevant device location by running one of the following commands. It is OK (and even advisable) to keep the UUID setup if that is what already exists.
sudo blkid
ls -l /dev/disk/by-uuid/

Replace <your partition> with the name of the partition you identified earlier. Replace <mount point> with the location you would like the partition to be mounted at, so you have something like /media/windows or /media/documents for that column.

Note: you can also change your locale option (ex: locale=fr_FR.utf8). Execute locale -a in a terminal to know which ones are supported on your system.

Save and close the file. You will now need to create the mount point for each NTFS partition before you can actually mount them:
sudo mkdir -p /media/<mount point>

Now remount each partition with
sudo umount <your partition>
sudo mount /media/<mount point>

If you want to revert to your previous configuration, run:
sudo cp -p /etc/fstab.orig /etc/fstab
sudo umount /media/<mount point>

Known Issues
The present limitations of this driver are:

  • Writing files encrypted or compressed at the filesystem level (does not include .zip, .gz, .rar files since they are compressed on the file, not the file system level)
  • Changing NTFS file ownership and access rights

Custom Kernel
It is unknown if this issue still exists. Please remove this line if you can confirm that it does.
If you compiled your own kernel, you probably will not have fuse installed. You can get the source with
sudo apt-get install fuse-source

and have a look at /usr/share/doc/fuse-source/README.Debian for instructions on how to compile it.

Wednesday, December 22, 2010

Text boot and disabling GDM in Ubuntu

This is something that I made several times, but I always forget how to do it, so now I'll take note to help a bit to my mind...

If you for some reason don’t want graphical login (GDM, KDM, etc) when booting Ubuntu, here’s how to do it. This also shows how to get rid of the splash image when booting, if you would rather have the good old black screen with the whole boot process shown.

This applies to Ubuntu 10.04 (Lucid), 10.10 (Maverick) and possibly some earlier versions. Here we have an easy way:

To disable GDM/KDM/etc, do the following:

vi /etc/default/grub

and change the line:


To show boot messages and disable the splash image, remove quiet splash from GRUB_CMDLINE_LINUX_DEFAULT so that it reads GRUB_CMDLINE_LINUX_DEFAULT="" (If you want the splash image and some text, use splash).

sudo update-grub

Now boot, and try it ;)

Tuesday, December 21, 2010

Welcome To The Unix Jungle

Hi fellows! How is world around there?
As you can see, this is my new blog were I'm going to talk about all related to Unix platforms. I'll post things that can help you and can help me and my weak memory. ;)
In here we will find posts about Linux (Debian, Ubuntu, Red Hat, Slackware, and so forth) and another platforms such as Solaris, HP-UX and AIX. I hope we can learn all together about this awesome creation that's Unix :)
In addition, we can have some freedom and talk about good music ;) Not just GPL and Free Software means freedom for our mind, doesn't it? ;)
I created this blog thanks to my Best Friend: Bucles (A Great Unix SA and amazing person), and I'll try to grow in Unix with her, for our constant knowledge and satisfaction. I have to say thanks to her, for all support.
Please, feel free to ask, comment and help us with this project.
Cheer to the world, from some lost point in Argentina! ;)
Stay Heavy, folks,