Skip to Content

Adding A Disk To Ubuntu 8 Hardy For Zimbra

These are the steps for creating a new file system under Ubuntu 8.04 Hardy.

1) Add a disk device or create a virtual disk device if using VMWare.

2) Create a partition on the new device.
fdisk /dev/sdb
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-256, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-256, default 256):
Using default value 256
Command (m for help): p

Disk /dev/sdb: 268 MB, 268435456 bytes
64 heads, 32 sectors/track, 256 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Disk identifier: 0xfded2e28

Device Boot Start End Blocks Id System
/dev/sdb1 1 256 262128 83 Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

3) Create the file system on the new partition. I'm using EXT3.
mkfs.ext3 -b "4096" /dev/sdb1

4) Create a directory for the disk mount point.
mkdir /opt/zimbra/index2
5) Mount the new file system and set permissions.
mount -t ext3 /dev/sdb1 /opt/zimbra/index2
chown -R zimbra:zimbra /opt/zimbra/index2

6) Switch to user Zimbra and test write
su - zimbra
touch /opt/zimbra/index2/test
ls -la /opt/zimbra/index2
rm -rf /opt/zimbra/index2/test

7) Get device UUID for /etc/fstab
ls -la /dev/disk/by-uuid
total 0
drwxr-xr-x 2 root root 120 2009-01-29 17:17 .
drwxr-xr-x 5 root root 100 2009-01-29 17:17 ..
lrwxrwxrwx 1 root root 10 2009-01-29 17:17 168bcec4-20cb-4636-ac3c-3148d7c27c1d -> ../../sdb1
lrwxrwxrwx 1 root root 31 2009-01-29 17:17 50ed2671-0712-473a-bdd7-0a2c75c6102f -> ../../mapper/ubu08.zmb.moc-root
lrwxrwxrwx 1 root root 10 2009-01-29 17:17 91ef4890-49bc-4329-9236-6ce4d429c5fe -> ../../sda1
lrwxrwxrwx 1 root root 33 2009-01-29 17:17 d13a6422-ce11-460e-8fa0-b765333d371e -> ../../mapper/ubu08.zmb.moc-swap_1

8) Edit /etc/fstab
# /etc/fstab: static file system information.
#
#
proc /proc proc defaults 0 0
# /dev/mapper/ubu08.zmb.moc-root
UUID=50ed2671-0712-473a-bdd7-0a2c75c6102f / ext3 relatime,errors=remount-ro 0 1
# /dev/sda1
UUID=91ef4890-49bc-4329-9236-6ce4d429c5fe /boot ext3 relatime 0 2
# /dev/sdb1
UUID=168bcec4-20cb-4636-ac3c-3148d7c27c1d /opt/zimbra/index2 ext3 relatime 0 2
# /dev/mapper/ubu08.zmb.moc-swap_1
UUID=d13a6422-ce11-460e-8fa0-b765333d371e none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0

References
https://help.ubuntu.com/community/Fstab
http://ubuntuforums.org/printthread.php?t=283131