NexusFi: Find Your Edge


Home Menu

 





Shrinking mdadm w/XFS to over-provision SSD


Discussion in Tech Support

Updated
    1. trending_up 2,088 views
    2. thumb_up 0 thanks given
    3. group 0 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread

Shrinking mdadm w/XFS to over-provision SSD

  #1 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,442 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,603

I emailed this to a friend, but thought I would post it here as well as I need some help.


Big Mike
Given now that two drives out of four have failed in a year, I really need to re-provision both of these servers so that they are only using 80% of the SSD space (over-provision). But I cannot figure out a good way to do so.

I don’t know of any utility that would let me shrink a mdadm array with an XFS filesystem. So this means I have to back everything up, then do a secure erase on the SSD to free up the blocks, then re-partition the drives so only 80% is used by mdadm raid, and then restore the backup to that now smaller XFS partition.

But I don’t know how to do this really. I am not sure if a simple tar backup is good enough with all the symlinks everywhere, plus is there data on the file level that describes the total size of the partitions or mdadm array which upon restore would be incorrect?

Any ideas? I definitely do not want to re-create the servers. I just want to do a backup and restore at most. I am very uncomfortable trusting tar because I’ve had so many problems with it in the past with symlinks, and I’ve never tried to tar the entire / and expect it to restore correctly. I am more comfortable using something like CloneZilla to clone an entire partition, assuming that CloneZilla will let you restore to a smaller partition.

After I emailed him, I looked around some more and found some people using GParted and rsync, but this is without mdadm which won't work for me.

Utechu: Cloning Ubuntu to a smaller disk

I also found an article on CloneZilla about restoring a cloned partition to a smaller disk:

Clonezilla restore to smaller hard drive - Spiceworks

Clonezilla - Advanced Mode

The consensus was generally to use the -icds option, and it sounds like it would work. But since these are live production servers I have a lot of testing to do in a VM before I attempt it. Even if it would work, it's still a lot of work and I am unsure how mdadm will complicate things.

If anyone has advice let me know.

If you are unaware of SSD over provisioning, google it. Short version: I need to shrink mdadm and XFS (impossible, so will take backup+restore of some sort) so that only 80% of the drive is addressable by the OS, leaving 20% over-provisioned. To make things more interesting, the only way to gain this on an existing formatted drive would to be to do an SSD Secure Erase after the backup, so that each block is "owned" by the SSD and not addressable by the OS, freeing it up. So that means I had better have a good backup!

If anyone has direct experience with this or cares to do some VM simulations for me let me know. Debian 7 wheezy on kernel 3.12.0, mdadm 3.2.5, (2) disk RAID 1:

 
Code
root@phoenix:~# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sda1[0] sdb[2]
      249926464 blocks super 1.2 [2/2] [UU]
Keep in mind that during all of this futures.io (formerly BMT) would be off-line, so I am looking for a compact/quick method. I can use a local server (NFS or SSH) to store the image at 1Gb link, so that will help.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Exit Strategy
NinjaTrader
REcommedations for programming help
Sierra Chart
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #2 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,442 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,603

Saving this for later.

Technology of Today - Thoughts & Exploration: Using Clonezilla to Clone From a Larger Hard Drive to a Smaller Drive

Also I don't think I mentioned that the filesystem is XFS. Everything I am reading so far is only talking about raw file systems. The issue is when you add in mdadm it seems, not sure on this one...

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,442 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,603


@sam028 recommended


Quoting 
I would use xfsdump, that will dump all the file-system.
In the worst case, a simple dd if=/dev/... can do the job.
All these can be sent to stdout, which can be send on another host using ssh.

And I had looked at xfsdump even before I started this thread, but just afraid to use it on something like / but I guess I will take a look and see if I can make it work in a VM.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote




Last Updated on December 3, 2013


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts