Add new hard drive in Debian

Its unfortunely that my disk array (RAID 5 with 4 hard drive) degraded because of a hard drive failed. For data safty issue, I have to back up all data and rebuild it again!

After rebuilt, I have to re-mount it again as new hard drive into my system.

Here is the procedure for notes.

At first, make sure the disk is the one I want to re-mount.
$ sudo fdisk -l /dev/sdc
Disk /dev/sdc: 1500.0 GB, 1499999502336 bytes
64 heads, 32 sectors/track, 1430511 cylinders, total 2929686528 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: 0x00000000 
Disk /dev/sdc doesn't contain a valid partition table
Its lucky I found it! And I'll create a new partition on it.
$sudo cfdisk /dev/sdc
Just follow those steps below...

  1. New -> Primary -> specify size in MB
  2. Write
  3. Quit

After that, I can see following message when success!
Disk has been changed. 
WARNING: If you have created or modified any
DOS 6.x partitions, please see the cfdisk manual
page for additional information.
Then, I have to format it before mounting.
$ sudo mkfs.ext4 /dev/sdc1
mke2fs 1.42.5 (29-Jul-2012)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
91553792 inodes, 366210812 blocks
18310540 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
11176 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
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
Okay, mount it now.
$ sudo mount -t ext4 /dev/sdc1 /data
Let's check it again.
$ mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=764821,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=613144k,mode=755)
/dev/disk/by-uuid/62ac81e4-1ecc-4370-9628-25a3a831c5c8 on / type ext4 (rw,relatime,errors=remount-ro,user_xattr,acl,barrier=1,data=ordered)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=2397420k)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
/dev/sda3 on /home type ext4 (rw,relatime,user_xattr,acl,barrier=1,data=ordered)
/dev/sdb1 on /srv type ext4 (rw,relatime,user_xattr,acl,barrier=1,data=ordered)
rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)
nfsd on /proc/fs/nfsd type nfsd (rw,relatime)
/dev/sdc1 on /data type ext4 (rw,relatime,user_xattr,barrier=1,data=ordered)
There is still a important thing must be done before we reboot or exist system -- Write back to /etc/fstab!
UUID=ac708cd1-3eee-4667-a881-71203bee93fc /data           ext4    defaults        0       2
Finally,it's done and I can restore data now!

Comments

Popular posts from this blog

How to construct a B+ tree with example

How to show only month and year fields in android Date-picker?

Visitor Counter Script Using PHP