After you have created and attached your Cloud Block Storage (CBS) Volume you must prepare it for use on your Server. In order to prepare your Volume you must partition, format, and mount it. Once you have successfully completed these steps your Volume will be usable like a drive on your Server.
On This Page:
When you created your Server, you were given a password. You will need that password for this step. If you do not have the password, click the "Actions" button next to the server name and select "Change Password." Find the IP for your Server on the Server Details page. SSH into the Server with its IP address and password.
Input:
MHC03SDV7M:~ user4975$ ssh root@198.61.222.58
root@198.61.222.58's password:
Output:
Linux nosnetdfw 2.6.32-31-server #61-Ubuntu SMP Fri Apr 8 19:44:42 UTC 2011 x86_64 GNU/Linux
Ubuntu 10.04 LTS
Welcome to the Ubuntu Server!
* Documentation: http://www.ubuntu.com/server/doc
Last login: Thu Oct 18 02:26:38 2012 from 70.114.215.201
Once you are logged in, you can list the disks on your Server. Your CBS Volume will typically be listed as the last drive in this list. In this example, our 100 GB drive is attached to /dev/xvdb. (It shows up as 107.4 GB due to how the MB are counted.)
Input:
root@nosnetdfw:~# fdisk -l
Output:
Disk /dev/xvdc: 1073 MB, 1073741824 bytes
127 heads, 3 sectors/track, 5504 cylinders
Units = cylinders of 381 * 512 = 195072 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00029648
Device Boot Start End Blocks Id System
/dev/xvdc1 1 5250 1000000 83 Linux
Disk /dev/xvda: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000dc852
Device Boot Start End Blocks Id System
/dev/xvda1 1 5222 41942016 83 Linux
Disk /dev/xvdb: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/xvdb doesn't contain a valid partition table
Partitioning the disk tells the Server how much space on the drive you want to use. We want to use all of it, so we tell the Server to start at the first cylinder of the drive and go to the last.
Input:
root@nosnetdfw:~# fdisk /dev/xvdb
Output:
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x59a4ec2c.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help):
Enter "n" for new partition:
Input:
Command (m for help): n
Output:
Command action
e extended
p primary partition (1-4)
Enter "p" for primary partition
Input:
p
Output:
Partition number (1-4):
Enter "1"; we are only creating one partition on this disk.
Input:
Partition number (1-4): 1
Output:
First cylinder (1-13054, default 1):
Press the "Enter" key to use the default, which is "1". We are using the entire Volume for our partition, so we start the partition at the beginning.
Input:
<Enter>
Output:
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-13054, default 13054):
We select the last cylinder of the disk for the partiton to use up the entire disk. The last partition is the default, so we just need to press the "Enter" key on the keyboard.
Input:
<Enter>
Ouput:
Using default value 13054
Command (m for help):
Enter "w" to write the partition.
Input:
Command (m for help): w
Output:
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
If we list the disks on our Server again, we see that our CBS Volume is ready as a disk. Remember, it was attached at /dev/xvdb and we created one partition on it. So, now our available drive shows up at /dev/xvdb1.
Input:
root@nosnetdfw:~# fdisk -l
Ouput:
Disk /dev/xvdc: 1073 MB, 1073741824 bytes
127 heads, 3 sectors/track, 5504 cylinders
Units = cylinders of 381 * 512 = 195072 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00029648
Device Boot Start End Blocks Id System
/dev/xvdc1 1 5250 1000000 83 Linux
Disk /dev/xvda: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000dc852
Device Boot Start End Blocks Id System
/dev/xvda1 1 5222 41942016 83 Linux
Disk /dev/xvdb: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x59a4ec2c
Device Boot Start End Blocks Id System
/dev/xvdb1 1 13054 104856223+ 83 Linux
Formatting the drive makes it speak the language of your Server. In this example, we format the drive with ext3.
Input:
root@nosnetdfw:~# mkfs -t ext3 /dev/xvdb1
Output:
mke2fs 1.41.11 (14-Mar-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
6553600 inodes, 26214055 blocks
1310702 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
800 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
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 31 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
You can substitute another file system your installation supports for "ext3" in the command (like ext4).
After partitioning and formatting the disk, you must mount it on the Server. Once the drive is mounted, it is available for use. Here you assign the drive a name for use on your Server. In this example, the drive is called "cbsvolume1".
Input:
root@nosnetdfw:~# mkdir -p /mnt/cbsvolume1
root@nosnetdfw:~# mount /dev/xvdb1 /mnt/cbsvolume1/
Output:
There is no feedback given once the drive is mounted. However, you may check that your drive is ready by running the df command to show your free disk space. Your new drive is listed last in the list of available drives.
Input:
root@nosnetdfw:~# df -h
Output:
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 40G 632M 37G 2% /
none 493M 136K 493M 1% /dev
none 498M 0 498M 0% /dev/shm
none 498M 36K 498M 1% /var/run
none 498M 0 498M 0% /var/lock
none 498M 0 498M 0% /lib/init/rw
none 40G 632M 37G 2% /var/lib/ureadahead/debugfs
/dev/xvdb1 99G 188M 94G 1% /mnt/cbsvolume1
Your drive is ready for use with your Linux Server. However, you may want to add the following step to ensure that your Volume remains persistant after a server reboots.
This is an optional step, but it will keep your Volume attached to your Server after reboots. To make this happen, add your Volume to the static file system information in the fstab file.
Input:
root@nosnetdfw:~# nano /etc/fstab
Output:
#
# /etc/fstab
# Created by anaconda on Tue May 29 20:13:27 2012
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/xvda1 / ext3 defaults,noatime,barrier=0 1 1
/dev/xvdc1 swap swap defaults 0 0
For this example, we add the following line beneath /dev/xvdc1... to add the volume to the static filesystem:
/dev/xvdb1 /mnt/cbsvolume1 ext3 defaults,noatime 0 2
The Volume persists on the Server after reboot.
Note: In the example below, we attach a 100 GB Volume to a Windows Server 2012. The steps taken are similar for all Next Generation Windows Servers.
When you created your Server, you were given a password. You will need that password for this step. If you do not have the password, click the "Actions" button next to the server name and select "Change Password." Find the IP for your Server on the Server Details page. Remote Desktop into the Server as administrator with its IP address and password.
When you first log in and view the "Computer" window, you will not see the Cloud Block Storage Volume that is attached to the Server. In the example below, we only see the Server's C drive.

Click the Server Manager Window. If the Server Manager window is not displayed, right-click on the "Computer" icon and select "Manage". You may also click the "Server Manager" icon at the bottom left of the Windows taskbar.

The Server Manager window:

At the left side of the Server Manager window, select the "File and Storage Services" link:

Select "Disks" in the left-hand panel. Here we see a 100 GB Volume attached to the Server. It is listed as "Offline", it has 100 GB of unallocated space, and its partition size is "Unknown".

For Windows Servers, the Volume is partitioned, formatted, and mounted in the New Volume Wizard. The mounting process--called bringing it Online in Windows terminology--is done automatically.
Under the "Disks" window, right-click the offline drive and select "Bring Online" from the pop-up menu.
Under "Disks", right-click the drive and select "New Volume" from the pop-up menu. In Windows Server 2008, you right-click the unallocated drive and select "New Simple Volume".
The "New Volume Wizard" launches.

Click the "Next" button. Under the "Disk" window, the unformatted CBS Volume displays.

Select the disk and click "Next".If the "Offline or Uninitialized Disk" window displays, click the "OK" button.

Select the drive size, then drive letter, and then format and name. Confirm your settings in the "File System Settings" window. In this example, we have used the disk's full 100GB, assigned it drive letter D, formatted it as NTFS, and named it "My New CBS Volume".

Click the "Create" button to complete the process.

When you display the "My Computer" window, the new CBS drive displays like a regular hard drive.

Your CBS Volume is now ready for use.
© 2011-2013 Rackspace US, Inc.
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License

27 Comments
running mysql on mounted volume doesnt work
are there special mounting instructions or formatting for it to be able to run MySQL
Oct 26 02:15:40 localhost kernel: [ 4284.801641] audit_printk_skb: 15 callbacks suppressed
Oct 26 02:15:40 localhost kernel: [ 4284.801647] type=1400 audit(1351217740.557:43): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=13920 comm="apparmor_parser"
Oct 26 02:15:40 localhost kernel: [ 4284.837539] type=1400 audit(1351217740.593:44): apparmor="DENIED" operation="mknod" parent=1 profile="/usr/sbin/mysqld" name="/mnt/bth-db/mysql/gen-bth02.lower-test" pid=13924 comm="mysqld" requested_mask="c" denied_mask="c" fsuid=0 ouid=0
Oct 26 02:15:40 localhost kernel: [ 4284.837679] type=1400 audit(1351217740.593:45): apparmor="DENIED" operation="mknod" parent=1 profile="/usr/sbin/mysqld" name="/mnt/bth-db/mysql/gen-bth02.lower-test" pid=13924 comm="mysqld" requested_mask="c" denied_mask="c" fsuid=0 ouid=0
Oct 26 02:15:40 localhost kernel: [ 4284.848740] type=1400 audit(1351217740.605:46): apparmor="DENIED" operation="open" parent=1 profile="/usr/sbin/mysqld" name="/mnt/bth-db/mysql/mysql/plugin.frm" pid=13924 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=106 ouid=106
Oct 26 02:15:40 localhost kernel: [ 4284.906724] type=1400 audit(1351217740.661:47): apparmor="DENIED" operation="open" parent=1 profile="/usr/sbin/mysqld" name="/mnt/bth-db/mysql/ibdata1" pid=13924 comm="mysqld" requested_mask="rw" denied_mask="rw" fsuid=106 ouid=106
Oct 26 02:15:40 localhost kernel: [ 4284.914430] init: mysql main process (13924) terminated with status 1
Oct 26 02:15:40 localhost kernel: [ 4284.914485] init: mysql main process ended, respawning
Oct 26 02:15:41 localhost kernel: [ 4285.864986] init: mysql post-start process (13925) terminated with status 1
Oct 26 02:15:41 localhost kernel: [ 4285.885564] type=1400 audit(1351217741.641:48): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=13958 comm="apparmor_parser"
Oct 26 02:15:41 localhost kernel: [ 4285.916757] type=1400 audit(1351217741.673:49): apparmor="DENIED" operation="mknod" parent=1 profile="/usr/sbin/mysqld" name="/mnt/bth-db/mysql/gen-bth02.lower-test" pid=13962 comm="mysqld" requested_mask="c" denied_mask="c" fsuid=0 ouid=0
Oct 26 02:15:41 localhost kernel: [ 4285.916918] type=1400 audit(1351217741.673:50): apparmor="DENIED" operation="mknod" parent=1 profile="/usr/sbin/mysqld" name="/mnt/bth-db/mysql/gen-bth02.lower-test" pid=13962 comm="mysqld" requested_mask="c" denied_mask="c" fsuid=0 ouid=0
Oct 26 02:15:41 localhost kernel: [ 4285.928275] type=1400 audit(1351217741.685:51): apparmor="DENIED" operation="open" parent=1 profile="/usr/sbin/mysqld" name="/mnt/bth-db/mysql/mysql/plugin.frm" pid=13962 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=106 ouid=106
Oct 26 02:15:41 localhost kernel: [ 4285.985635] type=1400 audit(1351217741.741:52): apparmor="DENIED" operation="open" parent=1 profile="/usr/sbin/mysqld" name="/mnt/bth-db/mysql/ibdata1" pid=13962 comm="mysqld" requested_mask="rw" denied_mask="rw" fsuid=106 ouid=106
Oct 26 02:15:41 localhost kernel: [ 4285.993246] init: mysql main process (13962) terminated with status 1
Oct 26 02:15:41 localhost kernel: [ 4285.993303] init: mysql main process ended, respawning
Oct 26 02:15:42 localhost kernel: [ 4286.951042] init: mysql post-start process (13963) terminated with status 1
Oct 26 02:15:42 localhost kernel: [ 4287.074251] init: mysql main process (14000) terminated with status 1
Oct 26 02:15:42 localhost kernel: [ 4287.074304] init: mysql respawning too fast, stopped
solution to Mysql on another drive on Ubuntu 12
/etc/apparmor.d/usr.sbin.mysqld
and add the lines
/mnt/bth-db/mysql/ r,
/mnt/bth-db/mysql/** rwk,
then
service app-armor restart
s/avaialbe/available/
Also, since the Linux section seems aimed at a very general audience, it might be worth mentioning that extra steps are required to make the mount persist across reboots.
RE: s/avaialbe/available/
Thanks for catching that. We've corrected the typo and we'll definitely make note of your suggestion. Thanks again!
-Rae
So, what's the solution when
Re: So, what's the solution when
Check step 5 here: http://www.rackspace.com/knowledge_center/article/prepare-your-cloud-block-storage-volume#prepare_linux
When you add your Volume information to the fstab file, the volume will persist on your Server after reboot.
extend drive
re: extend drive
http://feedback.rackspace.com/forums/71021-product-feedback/suggestions/997213-the-ability-to-choose-amount-of-ram-and-hd-space-s
Auto mount CBS drive
Thanks,
Alex
re: Auto mount CBS drive
Check step 5 here: http://www.rackspace.com/knowledge_center/article/prepare-your-cloud-block-storage-volume#prepare_linux
When you add your Volume information to the fstab file, the volume will persist on your Server after reboot.
fstab example has a typo in
re: typo
auto fdisk upon reboot
there should be instructions of how to fdisk upon boot
re: fdisk
We'll pass this back to the devs to have them check on the fdisk question, just in case.
re: fdisk
Also, at the end of the fstab line for the CBS, the two numbers should really be "0 2" rather than "0 1". The '1' is generally used only for the root filesystem; using the right number '2' will let the automatic fsck check the root filesystem first, as it should be.
man fstab(5)
"The root filesystem should be specified with a fs_passno of 1, and other filesystems should have a fs_passno of 2."
re: fsck
re: fdisk
Like Jered mentioned, fdisk should only be required when you first set up the volume. Can you provide any more details on what checks you are doing regularly with fdisk and what happens when you say it won't mount properly all the time?
Thanks,
Jose
Jose,
When following the steps as indicated, it simply states to type /etc/fstab and 'Permission Denied' is returned in the terminal. The suggested command should be 'nano /etc/fstab' to enter the editor, otherwise it is trying to run /etc/fstab.
Thanks,
Sean
re: editor
ext4 not there for some server images
re: ext4
init: mysql respawning too fast, stopped
root@ubuntu:/media/vdb1# chown -R mysql:mysql /media/vdb1/
lost+found/ mysql-data/ mysql-tmp/
root@ubuntu:/media/vdb1# chown -R mysql:mysql /media/vdb1/
lost+found/ mysql-data/ mysql-tmp/
root@ubuntu:/media/vdb1# chown -R mysql:mysql /media/vdb1/mysql-
mysql-data/ mysql-tmp/
root@ubuntu:/media/vdb1# chown -R mysql:mysql /media/vdb1/mysql-*
root@ubuntu:/media/vdb1# chown -R mysql:mysql /media/vdb1/mysql-*^C
root@ubuntu:/media/vdb1# mysqld
ext3 versus ext4
I tried dropping the block storage completely to start from scratch twice -- and each time it produced the read-only problem. It may be coincidence, but as of this morning using ext4, I haven't had the problem.
re: ext3 vs. ext4
Sorry to change the article on you there, too. We did that because not all of our images include the ext4 tools by default. Using ext3 instead felt like it would take some potential complication out of the tutorial. Guess we might have been wrong on that score...
re: ext3 vs. ext4
script (volume extendable to 14TB)
exit -1;
N=1
yum install -y lvm2
D=$(grep "unknown partition table" /var/log/messages | tail -n 1 | perl -pe 's/.*: ([^:]*): unknown.*/$1/g');
D=/dev/$D
pvcreate $D
vgcreate vg_$N $D
S=$(vgdisplay vg_$N | grep Total | perl -pe 's/[^0-9]+//g')
lvcreate -l $S vg_$N -n lv_$N
mke2fs -t ext4 /dev/vg_"$N"/lv_$N
tune2fs -m 0 /dev/vg_"$N"/lv_$N
mkdir /media/Volume-$N
mount /dev/vg_"$N"/lv_$N /media/Volume-$N
echo -e "/dev/vg_"$N"/lv_"$N"\t\t/media/Volume-"$N"\t\text4\tnoatime\t\t0 2" >> /etc/fstab
re: script
Add new comment