Too little space moving to a new server

Status
Not open for further replies.
Joined
Nov 9, 2016
Messages
2
To day I am running an Ubuntu server with four disks in a RAID 5 configuration.
I am setting up an new NAS, new hardware and new disks plus some of the old. My aim is to end up with a FreeNAS RAID-Z2 on six disks.
Either (2+1) (2+1) or (4+2) all disks 3 TB. (I lean towards (4+2)

The problem is that I do not have enough space to make the switch. I have just enough to keep the most precious data but not all of it. More precicely I am 3 TB short.

I have bought 4 new disks and want to take two disks from the old server. The RAID 5 configuration on the old server can take that one disk is missing, but not two.

So how can I get around this, eny clever manouver with ZFS can make this happen?

Is it possible to set up a RAID-Z2 in degredaded state on just five disks and add the sixth after all the data has been copied to new server?


Please advise
 

nojohnny101

Wizard
Joined
Dec 3, 2015
Messages
1,478
Is it possible to set up a RAID-Z2 in degredaded state on just five disks and add the sixth after all the data has been copied to new server?
Unfortunately no. If I was in your position, I would find a place where to store all the data so you can setup the raidz2 with 6 disks properly.

Options I can think of:
- go out and just buy a USB external disk (1 or 2) whatever is cheaper, that can house all of your data
- ask people you know if there was a way they could hold your data for a day or two

Either (2+1) (2+1) or (4+2) all disks 3 TB. (I lean towards (4+2)
You're thinking about it wrong. Raidz2 is just simply 6 disks. That's it, period.

Good luck.

P.S. Out of curiosity, have you read the manual, hardware recommendations, noob slideshow, and zfs primer resources?
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419
You can partition 3 of the 3TB disks into 2 partitions of 1.5TB each, build the array with 6 partitions.

Giving you 6TB.

Then copy your data.

Then replace the partitions with disks.

When you get to a single partition on a disk, you offline the partition, wipe the disk and replace with itself
 
Joined
Nov 9, 2016
Messages
2
Interesting approach. I have dome some tests in VMWare trying this out. I want to be sure of how to do this when I have got live data in a real system.
I created a virtual machine with 7 disks, one system disk 2GB and 6 disks of 4GB for storage.

The storage disks are named: ada0,ada1,ada2,ada3,ada4,ada5

The I created partition tables for all disks:
gpart create -s gpt ada0
..
..
gpart create -s gpt ada5


Then I created two partitions for ada0, ada1 & ada2 giving me ada0p1, ada0p2 etc
gpart add -b2048 -t freebsd-zfs -s 3988480 ada0
gpart add -t freebsd-zfs -s 3988480 ada0


The I created the pool "data"
zpool create -m /mnt/data data raidz2 ada0p1 ada0p2 ada1p1 ada1p2 ada2p1 ada2p2

Then I exported the pool, and imported it. Export for freenas to find it and then I got errors when trying to replacing things, an import seems to help.
zpool export data
zpool import data

zpool replace data ada0p1 ada3
zpool replace data ada0p2 ada4
zpool replace data ada1p1 ada0
zpool replace data ada1p2 ada5
zpool replace data ada2p1 ada1


Then I got unsure how to replace the last partitions with its own disk. I googled and did some test and soon got in a state where I just had to start over.

The simplest approach did not work, which I can understand....
[root@freenas ~]# zpool replace data ada2p2 ada2
cannot replace ada2p2 with ada2: no such pool or dataset


So, could I get some help crossing the finishing line?
What are the commands needed too complete this maneuver?

This is the zpool status printout:

[root@freenas ~]# zpool status data
pool: data
state: ONLINE
scan: resilvered 31K in 0h0m with 0 errors on Fri Nov 11 05:49:33 2016
config:

NAME STATE READ WRITE CKSUM
data ONLINE 0 0 0
raidz2-0 ONLINE 0 0 0
ada3 ONLINE 0 0 0
ada4 ONLINE 0 0 0
ada0 ONLINE 0 0 0
ada5 ONLINE 0 0 0
ada1 ONLINE 0 0 0
ada2p2 ONLINE 0 0 0

errors: No known data errors
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419
D3,4,5 are free
D0,1,2 are partitioned

Replace d0p0 with d3
Replace d0p1 with d4
d0 is now free
Replace d1p0 with d0
Replace d1p1 with d5
d1 is now free
Replace d2p0 with d1

Here comes the trick

Offline d2p1, this reduces redundancy to a single disk.

Wipe d2.

D2 is now free.

Replace d2p1 with d2.

Tada.

To do this properly you need to research how to create a pool with gptids like FreeNAS does, and with the right features.

@Dusan has an informative post

Apologies, I tapped this out on a phone.

BTW, after creating the pool, the replacing and wiping (to free a drive) can all be done from the GUI.
 
Last edited:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
There's a lot of weirdness that can be done from the CLI, but there's a bit of risk involved, since it bypasses all the safeguards of the FreeNAS GUI. A method I haven't seen mentioned in this thread that might be less hack-ish (though still hack-ish) is creating an intentionally degraded pool. More complete instructions are elsewhere, but here's the process in brief:
  • Partition five of your disks the way FreeNAS wants them--2GB swap partition first, then the rest as ZFS, and whatever other details I'm not thinking of right now. Store your data on the sixth disk.
  • Create a 3 TB sparse file on your boot pool: dd if=/dev/zero of=/sparsefile bs=1m count=3m. Yes, it will fit--zeroes are highly compressible.
  • Create the pool: zpool create tank raidz2 gptid/blah gptid/blah gptid/blah gptid/blah gptid/blah /sparsefile As noted above, you'll need to figure out how to ascertain the gptids of the correct partitions.
  • Immediately offline the sparse file: zpool offline tank /sparsefile
  • Export the pool: zpool export tank
  • Import the pool through the web GUI. It will be degraded, with one device offline. Set up whatever datasets, shares, etc. you want, and put your data onto the pool.
  • Once your data is migrated to the pool, using the GUI and following the instructions in the manual, replace the /sparsefile device with your last 3 TB disk. The system will add it to the pool and recompute all the parity that should be there.
 
Status
Not open for further replies.
Top