UBUNTU DUMP‎ > ‎

Add Second Hard Drive

posted 2 Jul 2016, 12:52 by Donald Ross   [ updated 28 Apr 2017, 06:23 ]
add second Hard Drive

sudo fdisk -l

Disk /dev/sda: 250.0 GB, 250000000000 bytes
255 heads, 63 sectors/track, 30394 cylinders, total 488281250 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: 0x0006e6f9

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048   471767039   235882496   83  Linux
/dev/sda2       471769086   488280063     8255489    5  Extended
/dev/sda5       471769088   488280063     8255488   82  Linux swap / Solaris

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 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: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1  3907029167  1953514583+  ee  GPT
Partition 1 does not start on physical sector boundary.

WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdc: 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 / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00043ad3

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1  1953525167   976762583+  ee  GPT

Disk /dev/sdd: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 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: 0x00000000

Disk /dev/sdd doesn't contain a valid partition table

-----

sudo mkdir /data3

sudo chmod -R 777 /data3

sudo lsblk -f
NAME   FSTYPE LABEL MOUNTPOINT
sda
├─sda1 ext4         /
├─sda2
└─sda5 swap         [SWAP]
sdb
└─sdb1 ext4         /data
sdc
└─sdc1 ext4         /data2
sdd
sr0

sudo fdisk /dev/sdd

n   add a new partition

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-3907029167, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-3907029167, default 3907029167):
Using default value 3907029167


sudo mkfs.ext4 /dev/sdd1

sudo mount /dev/sdd1 /data3

sudo nano /etc/fstab

/dev/sdd1 /data3 ext4 defaults 0 0

sudo mount -a

df

touch /data3/test

cd /data3

ls -l

total 16
drwx------ 2 root root 16384 Jul  2 20:42 lost+found
-rw-r--r-- 1 root root     0 Jul  2 20:46 test



-------------------Additional Notes---------------------------

---------------------------------------
sudo fdisk -l #list disk
sudo fdisk /dev/sdd #format disk
p #view partitions on disk
d #delete any partitions on disk
n #create new partition
1 #partition 1
accept defaults
w #save and write

sudo mkfs.ext4 /dev/sdd1
--------------------------------------
Auto mount after reboot
sudo mount /dev/sdd1 /data3
sudo nano /etc/fstab
/dev/sdb1 /datadisk1 ext4 defaults 0 0

-------------------------------------


Comments