在 Linux 开发机器中对 TB 驱动器进行分区的最佳方法是什么?

发布于 2024-07-04 07:57:02 字数 1476 浏览 11 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

两人的回忆 2024-07-11 07:57:02

我总是在 Linux 上设置 LVM,并使用以下布局开始:

/ = 10GB
交换空间 = 4GB
/启动= 100MB
/var = 5GB
/home = 10GB 或驱动器的剩余部分。

然后,以后如果我需要更多空间,我可以根据需要简单地增加 /home、/var 或 / 。 由于我经常使用 XEN 虚拟机,因此我倾向于保留剩余空间,以便可以快速为 XEN 虚拟机创建 LVM 卷。

I always setup LVM on Linux, and use the following layout to start with:

/ = 10GB
swap = 4GB
/boot = 100MB
/var = 5GB
/home = 10GB OR remainder of drive.

And then, later on if I need more space, I could simply increase /home, /var or / as needed. Since I work a lot with XEN Virtual Machines, I tend to leave the remaining space open so that I can quickly create LVM volumes for the XEN virtual machines.

小耗子 2024-07-11 07:57:02

我会选择 1 GB 用于 /boot,100 GB 用于 /,其余用于 /home。 1 GB 对于 /boot 来说可能太高了,但您不会错过它。 100 GB 对于家庭以外的所有东西来说似乎很多,直到您开始摆弄数据库并意识到 MySQL 将数据库保存在 /var 中。 最好在该领域留出一些成长空间。 我建议为 /home 使用单独的分区的原因是,当您想要完全切换发行版时,或者如果您选择的发行版上的升级选项由于某种原因不起作用,或者您只想从从头开始并进行全新的系统安装,您只需格式化 / 和 /boot,然后带着所有用户数据完好无损地离开家。

I would go with a 1 GB for /boot, 100 GB for /, and the rest for /home. 1 GB is probably too high for /boot, but it's not like you'll miss it. 100 GB might seem like a lot for everything outside home, until you start messing around with Databases and realize that MySQL keeps databases in /var. Best to leave some room to grow in that area. The reason that I recommend using a separtate partition for /home, is that when you want to completely switch distros, or if the upgrade option on your distro of choice, for whatever reason doesn't work, or if you just want to start from scratch and do a clean system install, you can just format / and /boot, and leave home with all the user data intact.

末蓝 2024-07-11 07:57:02

您是否知道 1TB 的 fsck 很容易需要半个小时才能完成? 工作站通常比服务器更频繁地崩溃和重新启动,因此这会变得非常烦人。 您真的需要那么多空间吗?

Did you know 1TB can easily take up to half an hour to fsck? Workstations usually crash and reboot more often than servers, so that can get quite annoying. Do you really need all that space?

胡大本事 2024-07-11 07:57:02

如果您使用 LVM 对驱动器进行分区,您将不必担心任何单独的分区未来空间不足。 只需根据需要移动空间即可。

If you partition your drive using LVM you won't have to worry about any individual partition running out of space in the future. Just move space around as necessary.

我不会写诗 2024-07-11 07:57:02

我对普通“实用”盒子的标准策略是给它们一个两倍于 RAM 大小的交换分区、一个 1GB /boot 分区,并将其余部分保留为一个大分区。 虽然我明白为什么有些人想要单独的 /var、单独的 /home 等,但如果我只有可信用户并且没有运行某些生产服务,我认为迄今为止我听到的原因并不适用。 相反,我会尽力避免任何大小调整,或任何分区变得太小 - 这最好通过一个巨大的分区来实现。

至于交换区和 /boot 的大小 - 如果你的机器有 4GB 内存,你可能不希望交换区有两倍的内存。 尽管如此,至少拥有一些还是明智的。 即使您仍然有双硬盘,您也总共使用了 9GB,占新驱动器的 0.9%。 /boot 可以小于 1GB,这只是我的标准“永远不会变满”大小。

My standard strategy for normal "utility" boxes is to give them a swap partition twice the size of their RAM, a 1GB /boot partition and leave the rest as one vast partition. Whilst I see why some people want a separate /var, separate /home, etc., if I only have trusted users and I'm not running some production service, I don't think the reasons I've heard to date apply. Instead, I do my best to avoid any resizing, or any partition becoming too small - which is best achieved with one huge partition.

As for the size of swap and /boot - if your machine has 4GB memory, you may not want to have double that in swap. It's nonetheless wise to at least have some. Even if you nonetheless have double, you're using a total of 9GB, for 0.9% of your new drive. /boot can be smaller than 1GB, this is just my standard "will not become full, ever" size.

我恋#小黄人 2024-07-11 07:57:02

如果你想要一个经典的设置,我会选择一个 50GB 的“/”分区,以满足你所有的应用程序需求,并将其余部分分配给用户,或者为单个用户分配完整的 950GB。 无尽的磁盘空间!

If you want a classic setup, I'd go for a 50GB "/" partition, for all your application goodness, and split the rest across users, or a full 950GB for a single user. Endless diskspace galore!

゛时过境迁 2024-07-11 07:57:02

@wvdschel:

不要为每个用户创建单独的分区。 每个分区上未使用的空间都被浪费了。

相反,为所有用户创建一个分区。 如果需要限制每个用户的空间,请使用quota。 它比分区或 LVM 灵活得多。

OTOH,一个巨大的分区通常会慢一点,具体取决于文件系统。

@wvdschel:

Don't create separate partitions for each user. Unused space on each partition is wasted.

Instead create one partition for all users. Use quota if necessary to limit each user's space. It's much more flexible than partitioning or LVM.

OTOH, one huge partition is usually a bit slower, depending on the file system.

新一帅帅 2024-07-11 07:57:02

请告诉我您对 /boot 做了什么,您需要超过 64MB 的空间? 除非你从来不打算清洁它,否则更多的都是浪费空间。 内核映像 + initrd + System.map 不会占用超过 10MB(可能更少 - 我的重量为 5MB),并且您实际上不需要保留两个以上的备用。

以当前 RAM 的价格 - 如果您需要交换,购买更多内存会更好。 保留 1GB 用于交换,并用一些东西来监控它的使用情况(根本不交换是个坏主意,因为当可用内存耗尽时,机器可能会锁定)。

Please tell me what are you doing to /boot that you need more than 64MB on it? Unless you never intend to clean it, anything more is a waste of space. Kernel image + initrd + System.map won't take more than 10MB (probably less - mine weight 5MB) and you really don't need to keep more than two spares.

And with the current prices of RAM - if you are needing swap, you'll be much better off buying more memory. Reserve 1GB for swap and have something monitoring it's usage (no swap at all is bad idea because the machine might lock up when it runs out of free memory).

GRAY°灰色天空 2024-07-11 07:57:02

我给 / 40GB,然后我有多少内存,我给 /swap 相同的内存,然后剩下的给 /home

i give 40gb to / then how ever much ram i have i give the same to /swap then the rest to /home

千秋岁 2024-07-11 07:57:02

我会有两个分区。 安装在 / 上的一个小程序(~20 GB)将存储您的所有程序,然后在 /home 上安装一个大程序。 许多人提到了 /boot 的分区,但这并不是真正必要的。 如果您担心调整大小,请使用 LVM。

I would have two partitions. A small one (~20 GB) mounted on / would store all your programs, and then have a large one on /home. Many people have mentioned a partition for /boot but that is not really necessary. If you are worried about resizing, use LVM.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文