no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
| — | tech:linux:new_disk [2015/12/05 12:27] (current) – created - external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Add New Disk in Linux ====== | ||
| + | ===== Check Disk is installed ===== | ||
| + | <code bash> | ||
| + | fdisk -l|grep Disk | ||
| + | </ | ||
| + | |||
| + | ===== Partition Disk ===== | ||
| + | Assuming new disk is '' | ||
| + | <code bash> | ||
| + | fdisk /dev/sdc | ||
| + | </ | ||
| + | Commands | ||
| + | < | ||
| + | p - to print the partition table | ||
| + | n - to create new | ||
| + | w - to write | ||
| + | </ | ||
| + | |||
| + | ===== Make file system ===== | ||
| + | Assume you created a single partition on sdc1 | ||
| + | <code bash> | ||
| + | mkfs -t ext4 /dev/sdc1 | ||
| + | </ | ||
| + | |||
| + | ===== Reserve 1% for root ===== | ||
| + | <code bash> | ||
| + | tune2fs -m 1 /dev/sdc1 | ||
| + | </ | ||
| + | |||
| + | ===== Create file system ===== | ||
| + | Create Mount directory | ||
| + | <code bash> | ||
| + | mkdir /home1 | ||
| + | </ | ||
| + | |||
| + | ===== Get Disk UUID ===== | ||
| + | <code bash> | ||
| + | blkid|grep /dev/sdc1 | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Make entry in fstab to automount ===== | ||
| + | < | ||
| + | Add line to /etc/fstab: | ||
| + | # New 2 TB Hard Disk | ||
| + | UUID=d1bff2fd-537b-40fb-8981-cb59bd8e1221 / | ||
| + | </ | ||
| + | |||
| + | Mount with | ||
| + | <code bash> | ||
| + | mount -a | ||
| + | </ | ||
| + | |||
| + | Check with | ||
| + | <code bash> | ||
| + | df -Ph | ||
| + | </ | ||
| + | |||
| + | Test with | ||
| + | <code bash> | ||
| + | dd if=/ | ||
| + | </ | ||
| + | |||