How to add a new HDD in ubuntu 16.04
Solution 1
Try this:
Open a terminal,
Press Ctrl+Alt+T
Run it:
exec sudo -i
apt-get update
apt-get dist-upgrade
apt-get install --reinstall gparted
In gparted select the drive Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Creates a new msdos partition table.
In unallocated space, create an ext4 file system partition.
Apply the changes and close gparted to continue running:
blkid /dev/sda1
This command will give you a output similar to this:
/dev/sda1: UUID="1532e85b-0337-412d-9644-ef6ad282efdb" TYPE="ext4" PARTUUID="ab6eab6e-01"
Write down the UUID, and continue running:
mkdir /media/data *--- Change this directory as you wish*
nano etc/fstab
In the open file add these lines:
# /media/data was on /dev/sda1
UUID=1532e85b-0337-412d-9644-ef6ad282efdb /boot ext4 defaults 0 2
Ctrl+O Save file
Ctrl+X Close nano
Continue running:
mount -a
chmod -Rf 777 /media/data
exit
This is all. Your disk should be mounted and ready to use.
Remember to change /media/data by as you wish
Solution 2
It depends how you intend to use it. I have an extra hard disk drive with a data partition, where I keep my own data (instead of in the home directory). This makes it very straightforward to separate the backup of the system from the backup of my own data (documents, own program code, pictures, music, video clips etc).
It is not necessary to have this partition in fstab, but I have it there, because it is convenient. It will always be mounted (unless I unmount it). Earlier I dual booted with Windows, so I had the NTFS file system, but now I have an ext file system since several years. It has an ext3 file system, but if I would make it now, I would use the ext4 file system. This is the corresponding line in fstab:
UUID=d3f3e5a3-3deb-4e43-8e1a-c2f0de792f90 /media/multimed-2 ext3 defaults 0 2
People recommend to create a mountpoint in the /mnt directory, for example
/mnt/data (instead of /media/multimed-2, which I use for historical reasons).
-o-
Another common way to use a second drive is the create a home partition, copy (move) the content of your home directory to it and mount it as /home (in fstab).
-o-
Edit: I suggest that you use gparted to create one or more partitions with suitable file systems.
Related videos on Youtube
Comments
-
Firefog over 1 year
How can I add a 2nd HDD to my Ubuntu 16.04
Here is my FSTAB
# /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # # <file system> <mount point> <type> <options> <dump> <pass> /dev/mapper/wagedata--vg-root / ext4 errors=remount-ro 0 1 # /boot was on /dev/sdb2 during installation UUID=2fabd94d-0e1c-4f78-bed5-64fc35b711ea /boot ext2 defaults 0 2 # /boot/efi was on /dev/sdb1 during installation UUID=BC1B-47F9 /boot/efi vfat umask=0077 0 1 /dev/mapper/wagedata--vg-swap_1 none swap sw 0 0
When I run
sudo blkid
I see bellow coderoot@wagedata:/home/rabbani# sudo blkid /dev/sdb1: UUID="BC1B-47F9" TYPE="vfat" PARTUUID="3e2c33a8-6b21-421c-88ae-c02b45832f25" /dev/sdb2: UUID="2fabd94d-0e1c-4f78-bed5-64fc35b711ea" TYPE="ext2" PARTUUID="1791ed17-9592-491f-98d7-59200354e0d7" /dev/sdb3: UUID="94LT0V-Wrye-Rl9A-QLnr-uYT9-ngoF-Ae92vU" TYPE="LVM2_member" PARTUUID="58282528-5179-4157-a789-e5b63e23d94d" /dev/mapper/wagedata--vg-root: UUID="dc8296fa-0527-4c17-acc6-14e38472acab" TYPE="ext4" /dev/mapper/wagedata--vg-swap_1: UUID="9175a4d8-8fe5-4ef2-803e-e7648dd40898" TYPE="swap" /dev/sda: PTUUID="514c954f" PTTYPE="dos"
Here
/dev/sda: PTUUID="514c954f" PTTYPE="dos"
might be my new HDDand here is the result of
fdisk -l
root@wagedata:/home/rabbani# sudo fdisk -l Disk /dev/ram0: 64 MiB, 67108864 bytes, 131072 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 /dev/ram1: 64 MiB, 67108864 bytes, 131072 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 /dev/ram2: 64 MiB, 67108864 bytes, 131072 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 /dev/ram3: 64 MiB, 67108864 bytes, 131072 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 /dev/ram4: 64 MiB, 67108864 bytes, 131072 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 /dev/ram5: 64 MiB, 67108864 bytes, 131072 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 /dev/ram6: 64 MiB, 67108864 bytes, 131072 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 /dev/ram7: 64 MiB, 67108864 bytes, 131072 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 /dev/ram8: 64 MiB, 67108864 bytes, 131072 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 /dev/ram9: 64 MiB, 67108864 bytes, 131072 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 /dev/ram10: 64 MiB, 67108864 bytes, 131072 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 /dev/ram11: 64 MiB, 67108864 bytes, 131072 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 /dev/ram12: 64 MiB, 67108864 bytes, 131072 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 /dev/ram13: 64 MiB, 67108864 bytes, 131072 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 /dev/ram14: 64 MiB, 67108864 bytes, 131072 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 /dev/ram15: 64 MiB, 67108864 bytes, 131072 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 /dev/sda: 931.5 GiB, 1000204886016 bytes, 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 Disklabel type: dos Disk identifier: 0x514c954f Disk /dev/sdb: 465.8 GiB, 500107862016 bytes, 976773168 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 Disklabel type: gpt Disk identifier: 424B06DE-0537-4C74-9BEB-AC001CEFD96F Device Start End Sectors Size Type /dev/sdb1 2048 1050623 1048576 512M EFI System /dev/sdb2 1050624 2050047 999424 488M Linux filesystem /dev/sdb3 2050048 976771071 974721024 464.8G Linux LVM Disk /dev/mapper/wagedata--vg-root: 85.2 GiB, 91486158848 bytes, 178683904 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 /dev/mapper/wagedata--vg-swap_1: 7.9 GiB, 8510242816 bytes, 16621568 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
My New Disk is (1TB) so How I can create a directory and add this HDD
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 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 Disklabel type: dos Disk identifier: 0x514c954f
-
vembutech over 7 yearsYou need command to format and mount?
-
-
Firefog over 7 years
Creates a new msdos partition table. In unallocated space, create an ext4 file system partition. Apply the changes and close gparted to continue running:
please add this command in your answer -
KevinDTimm about 6 yearsstrange that this was accepted because this is how you add a root disk, not a 2nd disk