0

I have a ubuntu server and I am planning to add another harddisk to it.

Currently installed harddisk is iSCSI drive and I can add new SATA2 harddisk using NAS or SAS.

I lack knowledge of linux in windows when a new harddisk is installed it is like a different partition on linux how would it work a partition or add up to current harddisk space automatically? wherein I can continue storing files in /var/www/data

Thank You.

1
  • I think you mean that your currently installed hard disk is SCSI, not iSCSI if it is physically inside of the server.
    – MDMarra
    Jan 15, 2010 at 16:38

1 Answer 1

2

On Unix systems, which includes Linux, partitions are physical space that you dedicate to a path. If you had only one partition, it would necessarily be allocated to '/', since this partition is mandatory.

If you wish to allocate physical space to /var/www/data using a specific partition, here is what you should do:

  1. Create a new partition (on the same disk or another disk) and format it ;
  2. Stop the services using the directory you wish to use as a mount point ;
  3. Move the data in this directory to another place that has enough space ;
  4. Find the identifier of your new partition ;
  5. Mount the new partition on the path you wish to use ;
  6. Put your data back in the directory.
  7. Add the mount configuration in /etc/fstab to make sure your partition is mounted at startup.

Step 3 is important. If you don't do it, this is what will happen:

  • Your data is stored on the original partition (let's say it's /dev/sda1 for example) ;
  • You mount the new partition on top of the directory (let's imagine this is /dev/sdb2 for example) ;
  • You see the directory being empty, because /dev/sdb2 doesn't contain anything. The data are still stored in /dev/sda1, but you can't see them or remove them anymore, unless you unmount /dev/sdb2 first.

This is why it's important to clean the directory before you mount a partition on it.

You can find more informations on using partitions on Linux on this page.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .