Growing UFS beyond 2 TB

Nick Gustas freebsd-fs at tychl.net
Thu May 24 23:57:10 UTC 2007


Richard Noorlandt wrote:
> I have been on this list for only a few days now, so I don't know 
> anything
> about these growfs patches. But I'll guess I can find them somewhere. 
> Unless
> they're scattered all over the place ;-)
>
> I run 6.2-RELEASE by the way. What's the easiest way to get the right 
> growfs
> version with the necessary patches?
>
>
> Meddling with a FS that has data on it is always scary, no matter what 
> tools
> you use. But your detailed description helps a lot. So once I updated 
> growfs
> I'll try this approach myself.
>
> Best regards,
>
> Richard



I did a diff between the growfs.c from a 6.2-STABLE machine and what I 
have now from list patches and GCC error fixing.  *WARNING* it appears 
to work, and compiles clean, but doesn't actually make a correct 
filesystem! I don't know enough C to get past this, though I suspect 
it's close and some study might get me there.

http://masq.tychl.net/growfs.patch

I don't have more than 2TB of free space handy at the moment, so I used 
a md device, you absolutely need to try this on a _TEST_ machine with a 
copy of real disk/data first.


AMD64# mdconfig -a -t swap -s 3T
md0
AMD64# gpt create md0
AMD64# gpt show md0
       start        size  index  contents
           0           1         PMBR
           1           1         Pri GPT header
           2          32         Pri GPT table
          34  6442450877         
  6442450911          32         Sec GPT table
  6442450943           1         Sec GPT header

AMD64# gpt add -s 4000000000 md0
md0p1 added

AMD64# gpt show md0
       start        size  index  contents
           0           1         PMBR
           1           1         Pri GPT header
           2          32         Pri GPT table
          34  4000000000      1  GPT part - FreeBSD UFS/UFS2
  4000000034  2442450877        
  6442450911          32         Sec GPT table
  6442450943           1         Sec GPT header

about 1.8T

AMD64# newfs -b 65536 -f 8192 /dev/md0p1
/dev/md0p1: 1953125.0MB (4000000000 sectors) block size 65536, fragment 
size 8192
        using 658 cylinder groups of 2969.06MB, 47505 blks, 95232 inodes.
super-block backups (for fsck -b #) at:
 256, 6080896, 12161536, 18242176, 24322816, 30403456, 36484096, 
42564736, 48645376, 54726016, 60806656, 66887296, 72967936,
 79048576, 85129216, 91209856, 97290496, 103371136, 109451776, 
115532416, 121613056, 127693696, 133774336, 139854976,
*snip*
 3940254976, 3946335616, 3952416256, 3958496896, 3964577536, 3970658176, 
3976738816, 3982819456, 3988900096, 3994980736


AMD64# mount /dev/md0p1 /mnt
AMD64# df -h /mnt
Filesystem    Size    Used   Avail Capacity  Mounted on
/dev/md0p1    1.8T     16K    1.7T     0%    /mnt

AMD64# umount /dev/md0p1
AMD64# gpt remove -i 1 md0
md0p1 removed
AMD64# gpt add md0
md0p1 added
AMD64# gpt show md0
       start        size  index  contents
           0           1         PMBR
           1           1         Pri GPT header
           2          32         Pri GPT table
          34  6442450877      1  GPT part - FreeBSD UFS/UFS2
  6442450911          32         Sec GPT table
  6442450943           1         Sec GPT header


AMD64# ./growfs /dev/md0p1
We strongly recommend you to make a backup before growing the Filesystem

 Did you backup your data (Yes/No) ? Yes
new file systemsize is: 402653179 frags
Warning: 3053104 sector(s) cannot be allocated.
growfs: 3144237.2MB (6439397760 sectors) block size 65536, fragment size 
8192
        using 1059 cylinder groups of 2969.06MB, 47505 blks, 95232 inodes.
super-block backups (for fsck -b #) at:
 4001061376, 4007142016, 4013222656, 4019303296, 4025383936, 4031464576, 
4037545216, 4043625856, 4049706496, 4055787136,
 4061867776, 4067948416, 4074029056, 4080109696, 4086190336, 4092270976, 
4098351616, 4104432256, 4110512896, 4116593536,
 4122674176, 4128754816, 4134835456, 4140916096, 4146996736, 4153077376, 
4159158016, 4165238656, 4171319296, 4177399936,
 4183480576, 4189561216, 4195641856, 4201722496, 4207803136, 4213883776, 
4219964416, 4226045056, 4232125696, 4238206336,
 4244286976, 4250367616, 4256448256, 4262528896, 4268609536, 4274690176, 
4280770816, 4286851456, 4292932096, 4299012736,
 4305093376, 4311174016, 4317254656, 4323335296, 4329415936, 4335496576, 
4341577216, 4347657856, 4353738496, 4359819136,
 4365899776, 4371980416, 4378061056, 4384141696, 4390222336, 4396302976, 
4402383616, 4408464256, 4414544896, 4420625536,
 4426706176, 4432786816, 4438867456, 4444948096, 4451028736, 4457109376, 
4463190016, 4469270656, 4475351296, 4481431936,
 4487512576, 4493593216, 4499673856, 4505754496, 4511835136, 4517915776, 
4523996416, 4530077056, 4536157696, 4542238336,
 4548318976, 4554399616, 4560480256, 4566560896, 4572641536, 4578722176, 
4584802816, 4590883456, 4596964096, 4603044736,
 4609125376, 4615206016, 4621286656, 4627367296, 4633447936, 4639528576, 
4645609216, 4651689856, 4657770496, 4663851136,
 4669931776, 4676012416, 4682093056, 4688173696, 4694254336, 4700334976, 
4706415616, 4712496256, 4718576896, 4724657536,
 4730738176, 4736818816, 4742899456, 4748980096, 4755060736, 4761141376, 
4767222016, 4773302656, 4779383296, 4785463936,
 4791544576, 4797625216, 4803705856, 4809786496, 4815867136, 4821947776, 
4828028416, 4834109056, 4840189696, 4846270336,
 4852350976, 4858431616, 4864512256, 4870592896, 4876673536, 4882754176, 
4888834816, 4894915456, 4900996096, 4907076736,
 4913157376, 4919238016, 4925318656, 4931399296, 4937479936, 4943560576, 
4949641216, 4955721856, 4961802496, 4967883136,
 4973963776, 4980044416, 4986125056, 4992205696, 4998286336, 5004366976, 
5010447616, 5016528256, 5022608896, 5028689536,
 5034770176, 5040850816, 5046931456, 5053012096, 5059092736, 5065173376, 
5071254016, 5077334656, 5083415296, 5089495936,
 5095576576, 5101657216, 5107737856, 5113818496, 5119899136, 5125979776, 
5132060416, 5138141056, 5144221696, 5150302336,
 5156382976, 5162463616, 5168544256, 5174624896, 5180705536, 5186786176, 
5192866816, 5198947456, 5205028096, 5211108736,
 5217189376, 5223270016, 5229350656, 5235431296, 5241511936, 5247592576, 
5253673216, 5259753856, 5265834496, 5271915136,
 5277995776, 5284076416, 5290157056, 5296237696, 5302318336, 5308398976, 
5314479616, 5320560256, 5326640896, 5332721536,
 5338802176, 5344882816, 5350963456, 5357044096, 5363124736, 5369205376, 
5375286016, 5381366656, 5387447296, 5393527936,
 5399608576, 5405689216, 5411769856, 5417850496, 5423931136, 5430011776, 
5436092416, 5442173056, 5448253696, 5454334336,
 5460414976, 5466495616, 5472576256, 5478656896, 5484737536, 5490818176, 
5496898816, 5502979456, 5509060096, 5515140736,
 5521221376, 5527302016, 5533382656, 5539463296, 5545543936, 5551624576, 
5557705216, 5563785856, 5569866496, 5575947136,
 5582027776, 5588108416, 5594189056, 5600269696, 5606350336, 5612430976, 
5618511616, 5624592256, 5630672896, 5636753536,
 5642834176, 5648914816, 5654995456, 5661076096, 5667156736, 5673237376, 
5679318016, 5685398656, 5691479296, 5697559936,
 5703640576, 5709721216, 5715801856, 5721882496, 5727963136, 5734043776, 
5740124416, 5746205056, 5752285696, 5758366336,
 5764446976, 5770527616, 5776608256, 5782688896, 5788769536, 5794850176, 
5800930816, 5807011456, 5813092096, 5819172736,
 5825253376, 5831334016, 5837414656, 5843495296, 5849575936, 5855656576, 
5861737216, 5867817856, 5873898496, 5879979136,
 5886059776, 5892140416, 5898221056, 5904301696, 5910382336, 5916462976, 
5922543616, 5928624256, 5934704896, 5940785536,
 5946866176, 5952946816, 5959027456, 5965108096, 5971188736, 5977269376, 
5983350016, 5989430656, 5995511296, 6001591936,
 6007672576, 6013753216, 6019833856, 6025914496, 6031995136, 6038075776, 
6044156416, 6050237056, 6056317696, 6062398336,
 6068478976, 6074559616, 6080640256, 6086720896, 6092801536, 6098882176, 
6104962816, 6111043456, 6117124096, 6123204736,
 6129285376, 6135366016, 6141446656, 6147527296, 6153607936, 6159688576, 
6165769216, 6171849856, 6177930496, 6184011136,
 6190091776, 6196172416, 6202253056, 6208333696, 6214414336, 6220494976, 
6226575616, 6232656256, 6238736896, 6244817536,
 6250898176, 6256978816, 6263059456, 6269140096, 6275220736, 6281301376, 
6287382016, 6293462656, 6299543296, 6305623936,
 6311704576, 6317785216, 6323865856, 6329946496, 6336027136, 6342107776, 
6348188416, 6354269056, 6360349696, 6366430336,
 6372510976, 6378591616, 6384672256, 6390752896, 6396833536, 6402914176, 
6408994816, 6415075456, 6421156096, 6427236736, 6433317376


AMD64# mount /dev/md0p1 /mnt
AMD64# df -h /mnt
Filesystem    Size    Used   Avail Capacity  Mounted on
/dev/md0p1    3.0T     16K    2.7T     0%    /mnt


proper output, looks like it works, but, run fsck...

AMD64# umount /dev/md0p1
AMD64# fsck_ufs -y /dev/md0p1
** /dev/md0p1
** Last Mounted on /mnt
** Phase 1 - Check Blocks and Sizes
322311525761044 BAD I=62663420
77308202712 BAD I=62663420
322414604976148 BAD I=62663420
77308202720 BAD I=62663420
322517684191252 BAD I=62663420
77308202728 BAD I=62663420
322620763406356 BAD I=62663420
77308202736 BAD I=62663420
322723842621460 BAD I=62663420
17178660600 BAD I=62663420
77308202704 BAD I=62663420
EXCESSIVE BAD BLKS I=62663420
CONTINUE? yes

322311525761044 BAD I=62866824
77308202712 BAD I=62866824
322414604976148 BAD I=62866824
77308202720 BAD I=62866824
322517684191252 BAD I=62866824
77308202728 BAD I=62866824
322620763406356 BAD I=62866824
77308202736 BAD I=62866824
322723842621460 BAD I=62866824
17178660600 BAD I=62866824
77308202704 BAD I=62866824
EXCESSIVE BAD BLKS I=62866824
CONTINUE? yes

 etc etc etc etc etc


Hopefully someone can go from here and fix what I'm missing.





More information about the freebsd-fs mailing list