Difference between revisions of "SUNScholar/Upgrading/Hardware/Add a New Disk"

From Libopedia
Jump to navigation Jump to search
 
(11 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
</center>
 
</center>
  
<center>
+
{{DISCLAIMER}}
<font color="red">
 
'''<big>WE CANNOT ACCEPT RESPONSIBILITY FOR ANY DATA LOSS.<br>DO EXTENSIVE TESTING ON SPARE INFRASTRUCTURE BEFORE PROCEEDING.<br>YOU PROCEED AT YOUR OWN RISK.<br>These guidelines are very brief and require someone with [[SUNScholar/Capacity_Building/Digital_Repository_Systems_Management|Linux experience]] to execute correctly.</big>'''
 
</font>
 
</center>
 
  
 
==Introduction==
 
==Introduction==
Line 47: Line 43:
  
 
Since the new disk will be used for an added asset store, we create the mount folder where DSpace was installed.
 
Since the new disk will be used for an added asset store, we create the mount folder where DSpace was installed.
  sudo mkdir /home/dspace/assetstore/two
+
  sudo mkdir $HOME/assetstore/two
  
 
===Step 5===
 
===Step 5===
Line 53: Line 49:
  
 
The quick way is to type the following;
 
The quick way is to type the following;
  sudo mount /dev/sdb1 /home/dspace/assetstore/two
+
  sudo mount /dev/sdb1 $HOME/assetstore/two
  
 
A better way is to add the disk to the file '''/etc/fstab'''. ''This way the disk will be mounted as a permanent part of the file system, even during server reboots.''
 
A better way is to add the disk to the file '''/etc/fstab'''. ''This way the disk will be mounted as a permanent part of the file system, even during server reboots.''
Line 64: Line 60:
 
  sudo nano /etc/fstab
 
  sudo nano /etc/fstab
 
*Add the following to the bottom of the file, using the disk UUID identified above; ''(You can use copy-and-paste as usual for quick editing)''
 
*Add the following to the bottom of the file, using the disk UUID identified above; ''(You can use copy-and-paste as usual for quick editing)''
  UUID="8b6ec31c-1f41-49f3-82da-d2ab0f0fa312 /home/dspace/assetstore/two    ext4    defaults,user        0      2
+
  UUID="8b6ec31c-1f41-49f3-82da-d2ab0f0fa312 $HOME/assetstore/two    ext4    defaults,user        0      2
  
 
{{NANO}}
 
{{NANO}}
Line 72: Line 68:
  
 
===Step 6===
 
===Step 6===
 +
Make sure the new assetstore has the correct file permissions.
 +
sudo chown dspace.dspace -R $HOME/assetstore/two
 +
 +
sudo chmod -777 -R $HOME/assetstore/two
 +
 +
==Step 7 ==
 
Now add '''assetstore/two''' to your DSpace config file and restart Tomcat.
 
Now add '''assetstore/two''' to your DSpace config file and restart Tomcat.
  
Line 84: Line 86:
 
*https://wiki.archlinux.org/index.php/ext4
 
*https://wiki.archlinux.org/index.php/ext4
 
*https://ext4.wiki.kernel.org/index.php/Ext4_Howto
 
*https://ext4.wiki.kernel.org/index.php/Ext4_Howto
 +
----
 +
*https://en.wikipedia.org/wiki/Chmod
 +
*https://en.wikipedia.org/wiki/Chown
  
 
==Alternative Web Based Methods==
 
==Alternative Web Based Methods==
 +
===Webmin===
 
*http://www.webmin.com/deb.html
 
*http://www.webmin.com/deb.html
 +
''Please note:'' The '''root''' login credentials can be replaced by any authorised '''sudo''' admin user on your [[SUNScholar/DSpace/Why Ubuntu Server|Ubuntu server]].
 +
====Help====
 +
#[http://doxfer.webmin.com/Webmin/PartitionsOnLocalDisks?sortcol=table;up=#Adding_and_formatting_a_new_part Adding partitions to a disk]
 +
#[http://doxfer.webmin.com/Webmin/PartitionsOnLocalDisks?sortcol=table;up=#Creating_a_new_filesystem Formatting partitions on a disk]
 +
#[http://doxfer.webmin.com/Webmin/DiskAndNetworkFilesystems?sortcol=table;up=#Mounting_a_local_ext2_or_ext3_ha Mounting disk partitions to a file system]
 +
 +
===Zentyal===
 
*http://en.wikipedia.org/wiki/Zentyal
 
*http://en.wikipedia.org/wiki/Zentyal
  
Line 93: Line 106:
 
*http://www.ghacks.net/2009/09/10/add-a-second-drive-to-your-ubuntu-server
 
*http://www.ghacks.net/2009/09/10/add-a-second-drive-to-your-ubuntu-server
 
*http://www.howtogeek.com/106873/how-to-use-fdisk-to-manage-partitions-on-linux
 
*http://www.howtogeek.com/106873/how-to-use-fdisk-to-manage-partitions-on-linux
 +
[[Category:System Administration]]

Latest revision as of 11:16, 28 May 2016

Back to Upgrading Hardware

WE CANNOT ACCEPT RESPONSIBILITY FOR ANY DATA LOSS OR CORRUPTION
BEFORE PROCEEDING, DO EXTENSIVE TESTING ON SPARE INFRASTRUCTURE
*** YOU PROCEED AT YOUR OWN RISK ***

Introduction

After installing and running DSpace for some time you realise your disk is getting full, so you arrange to buy a new bigger disk. But how do you use it in Dspace as a new asseststore. Read below for brief how-to.

Manual Terminal Method

Step 1

Determine the kernel hardware label for the new disk.

After connecting the new disk to the server and rebooting, login to the server using a console and type;

sudo fdisk -l

This command will list all the disks attached and the kernel label used.

Step 2

Create a linux partition on the new disk.

Assuming that you identified the new disk as /dev/sdb, from step 1 above, then type the following to create a single linux ext4 partition on the new disk;

sudo -i
parted /dev/sdb mklabel gpt
parted /dev/sdb mkpart primary ext4
parted /dev/sdb print
exit

Step 3

Make a linux filesystem on the new disk.

Step 2 above should have created a single primary linux partition on the disk.

Type the following to create an ext4 file system on the disk;

sudo mkfs.ext4 /dev/sdb1

Step 4

Make a mount point on the linux file system for the new disk.

Since the new disk will be used for an added asset store, we create the mount folder where DSpace was installed.

sudo mkdir $HOME/assetstore/two

Step 5

Mount the new disk to the mount point on the linux file system.

The quick way is to type the following;

sudo mount /dev/sdb1 $HOME/assetstore/two

A better way is to add the disk to the file /etc/fstab. This way the disk will be mounted as a permanent part of the file system, even during server reboots.

  • First we determine the UUID of the new disk.
sudo blkid /dev/sdb1
  • The result may be something like;
/dev/sdb1: UUID="8b6ec31c-1f41-49f3-82da-d2ab0f0fa312" TYPE="ext4"
  • We open the /etc/fstab file for editing;
sudo nano /etc/fstab
  • Add the following to the bottom of the file, using the disk UUID identified above; (You can use copy-and-paste as usual for quick editing)
UUID="8b6ec31c-1f41-49f3-82da-d2ab0f0fa312 $HOME/assetstore/two     ext4    defaults,user        0       2

NANO Editor Help
CTL+O = Save the file and then press Enter
CTL+X = Exit "nano"
CTL+K = Delete line
CTL+U = Undelete line
CTL+W = Search for %%string%%
CTL+\ = Search for %%string%% and replace with $$string$$
CTL+C = Show line numbers

More info = http://en.wikipedia.org/wiki/Nano_(text_editor)


  • Now to mount it type;
sudo mount -a

Step 6

Make sure the new assetstore has the correct file permissions.

sudo chown dspace.dspace -R $HOME/assetstore/two
sudo chmod -777 -R $HOME/assetstore/two

Step 7

Now add assetstore/two to your DSpace config file and restart Tomcat.

Definitions



Alternative Web Based Methods

Webmin

Please note: The root login credentials can be replaced by any authorised sudo admin user on your Ubuntu server.

Help

  1. Adding partitions to a disk
  2. Formatting partitions on a disk
  3. Mounting disk partitions to a file system

Zentyal

References