Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a CentOS 6.3 with Lighttpd and MySQL installed. I'm using Amazon Cloud (EC2) and I have no idea how to properly mount permanently another drive, so I can move DB to it.

I'm really lost in LINUX os-es, please help!

[root@ip-10-246-135-238 ec2-user]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/xvde1            5.0G  1.5G  3.3G  32% /
tmpfs                 828M     0  828M   0% /dev/shm
/dev/xvde2            5.0G  1.5G  3.3G  32% /media/ephemeral0
/dev/xvde2            5.0G  1.5G  3.3G  32% /
/dev/xvdj             5.0G  1.5G  3.3G  32% /
/dev/xvde2            147G  3.3G  137G   3% /mnt/driveb
share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

When you add anouther volume to the instance (using amazon's web gui "attach volume") it's as if you plugged it into the machine. You should see the new drive using fdisk -l

You'll need a filesystem on it. Lets say the new volume appears as /dev/xvdg, so mkfs.ext4 /dev/xvdg - (this is assuming you don't want to upt partitions on that volume, that's a whole other topic).

You'll then need to mount it, either once off or long term. To do it long term, make a directory, and put an entry (a new line) in /etc/fstab. It'll look something like:

/dev/xvdg /mnt/point/you/made ext4 defaults 0 0

save the file, then try mounting with mount /mnt/point/you/made - doing it in this order makes sure the mount command uses the fstab file for its information, which ensures the fstab file is ok.

It goes without saying, don't mess these steps up (like formatting the wrong disk!), or you can lose data. In particular, don't reboot until you've made sure your fstab file is ok, or your machine may not reboot properly. (you can fix it, but it's a real pain, particually in amazon ec2).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.