Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I tried to read some posts regarding mounting a new hard drive, but I am facing some problem. My new hard drive is sda1. The output of sudo fdisk -l is:

sudo fdisk -l

Disk /dev/sdb: 999.7 GB, 999653638144 bytes
255 heads, 63 sectors/track, 121534 cylinders, total 1952448512 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00016485

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048  1935822847   967910400   83  Linux
/dev/sdb2      1935824894  1952446463     8310785    5  Extended
/dev/sdb5      1935824896  1952446463     8310784   82  Linux swap / Solaris

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x78dbcdc1

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048  1953521663   976759808    7  HPFS/NTFS/exFAT

What should be done to add this new sda1 hard drive on booting up? What should be added in the /etc/fstab file? I have not performed any partition on the new sda1 drive. I need help on how to proceed from scratch and can't afford to take any risk. Please help!

share|improve this question
    
Do you have a GUI? –  dan08 Jun 4 at 20:27
1  
What type will it be? ext4? ntfs? –  Jacob Vlijm Jun 4 at 21:04
    
Yes I do have a gui! I don't know if it should be ext4 or ntfs as well. –  shank22 Jun 5 at 16:54
    
Don't forget to ping in a comment (@someone) ext4 is linux, ntfs is used by windows. should windows be able to read the disk? –  Jacob Vlijm Jun 5 at 18:09
    
@Jacob: No, I have not dual booted the machine, so only have Ubuntu running on my box. –  shank22 Jun 6 at 23:57

2 Answers 2

A possible recommendation, which will mount sda1 at system startup with read-write permissions for you and your group, and read-only permissions for others, might be adding this line to /etc/fstab:

UUID=<ID-NO-OF-SDA1>   /media/<Your-User-Name>/<Label-Of-SDA1>   ntfs   defaults,auto,nls=utf8,uid=1000,gid=1000,dmask=002,fmask=113   0   0

And if you don't have any plans for a shared use of this drive with Windows, you can prefer using EXT4 format and then add this line instead:

UUID=<ID-NO-OF-SDA1>   /media/<Your-User-Name>/<Label-Of-SDA1>   ext4   nodev,nosuid   0   2

Note: You can get the UUID and Label of SDA1 using GParted.

share|improve this answer
    
No need to enter any command to mount? –  shank22 Jun 5 at 17:01
    
I have important data that I would not like to lose, also I have an existing NFS mount, which got unmounted the last time I tried something like this! –  shank22 Jun 5 at 17:07
    
The command mount is entered in Terminal, fstab entries like this is another way achieving the same result. AFAIK mounting partitions in this way, i.e. via fstab entries (especially using UUIDs instead of Labels) should not normally interfere with each other, and should not cause any data loss other than gaining full or restricted or no access to this or that device. In any case you might also use Clonezilla to backup a partition in a matter of minutes before trying. –  Sadi Jun 5 at 18:52
    
Why ntfs? Like Jacob suggested above, should it be ext4? –  shank22 Jun 6 at 23:56
    
@shank22 : 1) I assumed that you're happy with the existing format of sda1 and would not want to re-format it unless you have a good reason to do so, in which case you should of course use other options for fstab, 2) the existing NTFS format of your sda1 might be more convenient if you intend to use this disk drive from a non-Linux operating system like Windows now or in the future. Otherwise you can of course prefer EXT4 format and perhaps just stick with the defaults in the fstab options. –  Sadi Jun 7 at 10:13

Your new harddrive seems to be formatted as NTFS (Windows format), which is usually the case with new drives. Ubuntu systems nowadays use ext4, which I would prefer if you have no specific reason to use NTFS. NTFS would be needed if you share the disk or partition with Windows.

As general remark, to be 100% save, you should backup essential data before you make any changes to your disk-, mount- or partition configuration.

Having said that, the following should normally not be a risky operation.

Create a mountpoint

First of all, you have to create a mountpoint on your system, to mount the new disk (partition) into:

sudo mkdir /media/newdisk  (of course you can use any name you like)

Now you can test if the disk can be mounted into the new mount point:

sudo mount /dev/sda1 /media/newdisk

Change properties of the disk

That should work, but the disk is still in NTFS format. Now you have to change some properties. The most convenient way is to use GParted, which you may have to install (can be found in the software center).

  • Open GParted, right click on the volume: /dev/sda1 and choose "unmount".
  • Right click again on the volume and choose "format as" > "ext4". Apply the changes.
  • After formatting is finished, right click again (this is the last one) and choose "label". Give the new disk the name you'd like it to have. Apply the changes.

Edit fstab file

Close GParted. Add the following line to your fstab file:

/dev/sda1 /media/newdisk           ext4    defaults        0       2

Now check if all went well by the comand:

sudo mount -a

Your new disk should appear in devices. On restart it will mount automatically.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.