1.04.2015

Install a new hard drive

Got it from here.
1. Partition disk
samdc@mango:/dev$ sudo fdisk /dev/sdc

Welcome to fdisk (util-linux 2.25.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xb73af669.

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

Created a new partition 1 of type 'Linux' and of size 931.5 GiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

2. Format disk
samdc@mango:/dev$ sudo mkfs -t ext4 /dev/sdc1
mke2fs 1.42.10 (18-May-2014)
Creating filesystem with 244190390 4k blocks and 61054976 inodes
Filesystem UUID: 6dba4379-83fa-4288-b390-98574bc24bb2
Superblock backups stored on blocks: 
 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
 102400000, 214990848

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done     

3. Modify reserved space
samdc@mango:/dev$ sudo tune2fs -m 1 /dev/sdc1
tune2fs 1.42.10 (18-May-2014)
Setting reserved blocks percentage to 1% (2441903 blocks)

4. Label disk
samdc@mango:/dev$ sudo e2label /dev/sdc1 DataDisk2

5. Create mount point
samdc@mango:/dev$ sudo mkdir /data2

6. Mount the drive
Automatic mount at boot:
root@mango:/dev# vim /etc/fstab
Add this line (find out UUID of the disk via blkid):
UUID=6dba4379-83fa-4288-b390-98574bc24bb2 /data2           ext4    defaults 0       2
For changes to take effect:
root@mango:/dev# mount -a

Manually mount/unmount:
sudo mount /dev/sdc1 /data2
sudo umount /data2
==============================================
hostname:mango, os:Ubuntu 14.10 Utopic Unicorn
==============================================
ASRock Z97 Extreme6 LGA 1150 Intel Z97 HDMI SATA 6Gb/s USB 3.0 ATX Intel Motherboard
Intel Core i7-4790 Haswell Quad-Core 3.6GHz LGA 1150 84W Desktop Processor Intel HD Graphics 4600
Team Xtreme 16GB (2 x 8GB) 240-Pin DDR3 SDRAM DDR3 2400 Desktop Memory
OCZ ARC 100 ARC100-25SAT3-240G 2.5" 240GB SATA III MLC Internal Solid State Drive
Western Digital WD Blue WD10EZEX 1TB 7200 RPM 64MB Cache SATA 6.0Gb/s 3.5" Internal Hard Drive
ENERMAX Ostrog GT ECA3280A-BR Black / Red Steel / Plastic ATX Mid Tower Computer Case

No comments:

Post a Comment