Problem with /app

Hi folks,

i have a problem with my /app directory on solaris 10.It is mounted under rpool root and sometimes it increase dimension bringing root out of space.I want to mount /app under different position, maybe under secondary hardisk for which i have created a mount point with zfs pool...How can i mount /app under secondary disk using zpool?is it possible?are there any problems?

thank you in advance,

Matt

If /app is a part of rpool, then mounting it in a different location won't help you. If I understand you right, your rpool is running out if space from time to time.

What you can do, is set a reservation on the root filesystem. For example:

# zfs set reservation=15g rpool/ROOT/opensolaris

After this, the root Filesystem may grow up to 15G without interference from other datasets in the same pool.

You must find out the dataset name of the root filesystem for this:

# zfs list /
NAME                     USED  AVAIL  REFER  MOUNTPOINT
rpool/ROOT/opensolaris  6,90G   123G  6,78G  /

You create a zpool using that disk.

zpool create mypool <disk goes here>

Be sure to check if you need to make a mirror or raid array to protect your data from single disk failure.

After that, you will want to create a zfs filesystem in that zpool with :

zfs create -o mountpoint=/app mypool/app

And add the quotas, compression or any other zfs property to it.

Hope that helps
Regards
Peasant.

Thank you guys,

i'll try to describe in a better way my situation..
I have my DB and other applications under /app that is mounted under root pool.
I wonder if there exists a way to migrate /app under different pool (maybe under one mounted on a secondary HD, i have already one pool of that kind!), or to stop /app increasing and stealing space from ROOT. Now i have about 1GB left on root!

hergp, the solution you have given to me is the second one, rigth?

Is there another way to add more space only for /app or for root pool by using the secondary disk for example?

thanks

You can add more disks to a pool with the zpool add command without service interruption. But as Peasant pointed out, make sure, all data is redundant.

You can also migrate a complete ZFS filesystem with zfs send and zfs receive . But for that you need some downtime.

Regarding the first solution, what do you mean for data redundant?In my situation i ll add the second disk to the Root pool, so that it can expand using second disk, is it correct?

thanks

How many disks does your rpool use currently? If the pool is defined on a single disk and this disk fails, your server is dead.

If the pool is created on a pair of disks for redundancy and you add a single disk., then one part of your data is redundant and the other is not, which makes the pool vulnerable to a single disk fault.

only one, for the moment..A new order has been dispatched in order to have other 2 disk...When they'll arrive i ll try to redudant each disk.
So, to sum up the better solution for now is :

  • Add a new disk to root rpool in order to increase space;
  • Redudant disk when new disks will come;

For that second issue is there a simple command as the one you gave me to add a new disk, to redudand the data on new disks?

And do have i to eliminate currently pool mounted on second disk in order to add it to the root pool ?(i have a pool named pool1 on the second disk, do i have to eliminate it and then add second disk to the root pool?)

thanks

To create a mirror using the new disk, use:

zpool attach rpool existingdevice newdevice

This is a bad practice.
You don't put databases (or anything) in root pool (or volume group for that matter).

What you need to do is

  1. Create a new zpool with at least 2 mirrored disks (or without protection if you have FC disks which have redudancy on storage side).
  2. Create zfs filesystem inside it.
  3. Plan for downtime.
  4. Using send - receive migrate the data to new zfs filesystem.
  5. Profit.

Depends on your layout, you might even destroy the old zfs filesystem (mounted on /app) and mount the new (migrated) one on same location.

Be sure to test the send - receive before removing anything.
Exercise caution with zfs/zpool destroy command, since there is no 'Are you sure' questions.

Hope that helps.

Regards.
Peasant.

thanks heargp and peasent for your support,

the situation it's clear but for now i cannot operate in this way because i don't have many disks but only a primary disk, a secondary disk (on witch exist a zfs pool) and an external hd.
So this is the plan i have in mind according with all of your advices and tips, tell me if it can be a TEMPORANY patch for that situation :
1) Move all the content of the secondary disk to the external usb drive;
2) Expand the space of the root pool on the primary disk with zpool add command
3) Once more space has been added to the root pool, set a reservation for the root pool

Question_1) Can this plan be good enough as temporany solution?
Question_2) Between 1 and 2, have i to eliminate the pool i have setted on secondary disk?

thanks to all :slight_smile: