运行内存有限的mke2fs

我正在使用内存很less的计算机(128MB) – 对于我的应用程序,我需要格式化大型驱动器(4TB)

我能够格式化大于2TB的磁盘,高达2.5TB,但除此之外,我给了下面

mke2fs 1.42-WIP (16-Oct-2011) /dev/sda1: Memory allocation failed while setting up superblock 

我知道我真的在那里合理 – 有没有什么窍门? (块大小等)

任何想法如何我可以得到非常大的磁盘格式?

添加一些交换: http : //www.cyberciti.biz/faq/linux-add-a-swap-file-howto/

 dd if=/dev/zero of=/swapfile1 bs=1024 count=524288 mkswap /swapfile1 swapon /swapfile1 

这将使512MB的交换,并启用它。 不过,您需要编辑/etc/fstab ,以便在重新启动后保留它。

更好的方法是使用-D标志。 从手册页:

  Use direct I/O when writing to the disk. This avoids mke2fs dirtying a lot of buffer cache memory, which may impact other applications running on a busy server. This option will cause mke2fs to run much more slowly, however, so there is a tradeoff to using direct I/O. 

initramfs和512MB为我工作。