Solved Zpool

I have second HD as ada1p3 and I have zpool called zroot
I want to add ada1p3 to zroot pool but to specific path /usr/home/ not to entire first HD happened to be "ssd" . So here is the command I did but doesn't work
zpool add zroot -f /usr/home ada1p3
I know if I type
zpool add zroot ada1p3 will add to entire first HD

what is the best to do this?
My first HD is an SSD.

Thanks
 
Last edited by a moderator:
Why would you want to add HD to your SSD zpool? Your SSD speed will be reduced to HD speed. It's better to create another separate pool for HD.
Yes, I know I thought about that but I am stuck with lack of knowledge
I have tried like this
Code:
root@bsdhome02:/usr/home/andis # zpool create tank ada1p3
here is the status
Code:
root@bsdhome02:/usr/home/andis # zpool status
  pool: tank
 state: ONLINE
  scan: none requested
config:

   NAME        STATE     READ WRITE CKSUM
   tank        ONLINE       0     0     0
     ada1p3    ONLINE       0     0     0
How do I add this to /usr/home?
Do I mount if yes how to do that?

I have tried
"attach [-f] <pool> <device> <new-device> "
#zpool attach tank stripe /usr/home or zpool attach tank /usr/home ada1p3
I don't get it . Or should I type
#mount /tank /usr/home or mount -t /dev/da1p3 /usr/home
I still don't understand can you help?

I am still struggling understanding "zpool" with separate single disk


Thanks
 
Last edited by a moderator:
You should probably try and read up on ZFS as the commands you are trying are nonsense and you're only going to get yourself into trouble at some point.

When you ran the zpool create command, you created a new zpool containing the one disk, as shown in your status output
Code:
pool: tank
state: ONLINE
scan: none requested
config:

NAME STATE READ WRITE CKSUM
tank ONLINE 0 0 0
ada1p3 ONLINE 0 0 0

When a pool is created, a single ZFS filesystem (called a dataset in ZFS terms) is created. This will be called tank, and is mounted on /tank. You should be able to see this clearly by running zfs list. (this is the command to list ZFS datasets).

You can easily change the mountpoint of a dataset to put it where you want. You'd do the following to mount the tank dataset on /usr/home:
Code:
zfs set mountpoint=/usr/home tank

Personally I would probably do the following:

1) Create a new dataset on the new pool for your home data
Code:
zfs create tank/home
By default this will be mounted on /tank/home. You can check mount output to confirm this.

2) Copy any existing data from /usr/home to /tank/home in order to move your data to the new disk

3) Change the mountpoint for the new dataset to /usr/home*
Code:
zfs set mountpoint=/usr/home tank/home

*Note that if there's already a dataset on your root pool mounted on /usr/home, you should ideally unmount that and stop it mounting before trying to mount the new dataset there. Seeing the zfs list output would confirm that.
Code:
zfs umount rootpool/usr/home
zfs set canmount=no rootpool/usr/home
Once you're sure you no longer need the old home dataset you can delete it
Code:
zfs destroy rootpool/usr/home
 
Yes that's helpful.
You should probably try and read up on ZFS as the commands you are trying are nonsense and you're only going to get yourself into trouble at some point.

When you ran the zpool create command, you created a new zpool containing the one disk, as shown in your status output
Code:
pool: tank
state: ONLINE
scan: none requested
config:

NAME STATE READ WRITE CKSUM
tank ONLINE 0 0 0
ada1p3 ONLINE 0 0 0

When a pool is created, a single ZFS filesystem (called a dataset in ZFS terms) is created. This will be called tank, and is mounted on /tank. You should be able to see this clearly by running zfs list. (this is the command to list ZFS datasets).

You can easily change the mountpoint of a dataset to put it where you want. You'd do the following to mount the tank dataset on /usr/home:
Code:
zfs set mountpoint=/usr/home tank

Personally I would probably do the following:

1) Create a new dataset on the new pool for your home data
Code:
zfs create tank/home
By default this will be mounted on /tank/home. You can check mount output to confirm this.

2) Copy any existing data from /usr/home to /tank/home in order to move your data to the new disk

3) Change the mountpoint for the new dataset to /usr/home*
Code:
zfs set mountpoint=/usr/home tank/home

*Note that if there's already a dataset on your root pool mounted on /usr/home, you should ideally unmount that and stop it mounting before trying to mount the new dataset there. Seeing the zfs list output would confirm that.
Code:
zfs umount rootpool/usr/home
zfs set canmount=no rootpool/usr/home
Once you're sure you no longer need the old home dataset you can delete it
Code:
zfs destroy rootpool/usr/home
Thanks, that's what I need, I understand it now.
This is is my home network so I can make any mistake before I do it on production.

I learn from making mistakes sometimes .
 
Last edited by a moderator:
Back
Top