136 篇技术文章 · Linux · 数据库 · 网络 · Docker · 更多
Ubuntu LVM 系统盘剩余容量扩充到 root 分区
1. 问题场景 安装 Ubuntu Server 时,如果安装程序使用了 LVM 默认配置,通常只会分配磁盘的一部分给 root 逻辑卷(Logical Volume),剩余空间留在 Volume Group 中未使用。例如: 磁盘总容量 200GB root 分区仅分配了 98.5GB VG 中还有 98.5GB 空闲 此时需要将剩余空间在线扩充到 / 分区,无需重启、无需卸载。 2. 前置知识 在动手之前,理解 LVM 的三层抽象有助于你排查更复杂的场景: 层 组件 类比 PV (Physical Volume) /dev/sda3 一块硬盘原料 VG (Volume Group) ubuntu-vg 一个"存储池",由若干 PV 组成 LV (Logical Volume) ubuntu-lv 从池中切出的"虚拟分区",格式化后挂载 扩容的本质就是:池(VG)里有空闲空间 → 划给虚拟分区(LV)→ 通知文件系统去用新空间。 PE (Physical Extent) 是 LVM 的最小分配单位,默认 4MiB。lvextend -l +100%FREE 中的 -l 就是以 PE 为单位分配——+100%FREE 表示"把 VG 中所有空闲 PE 全给这个 LV"。 ...
走遍美国(Family Album U.S.A.)第10课:Smell the Flowers(享受生活)
课文原文(双语) Good morning, Susan. 早安,Susan。 Good morning, Sam. 早安,Sam。 What’s the schedule today? 今天的工作是怎么安排的? Ten o’clock, telephone FAO Schwarz about the new twin baby dolls. 十点钟,打电话给FAO Schwarz谈关于双胞娃娃玩具的事。 OK. 好的。 Telephone Mrs. Zaskey at the advertising agency. 打电话给广告代理Zaskey夫人。 I did that. Go on. 我已经打了。继续说。 Eleven o’clock, approve the sketches for the toy spaceship. 十一点钟,批示玩具太空船的草图。 Where are they? 草图在哪儿? Right here. 就在这里。 Did you look at them? 你看过了吗? Yes, I did. 是的,我看过了。 ...
走遍美国(Family Album U.S.A.)第11课:A Place of Our Own(自己的家)
课文原文(双语) Ellen, I’d like your opinion. Ellen,我想听听你的意见。 About what? 关于什么? Well, Richard and I feel that with a baby coming we need to have our own place to live. 嗯,Richard和我觉得孩子快要出生了,我们应该有自己的房子。 Oh. 噢。 Well, what do you think about Richard and me looking for a small house or an apartment at this point in our lives? 那么,你觉得我和Richard找一个小住宅或公寓在这个时候怎么样? We love having you here, and there is room, and … and when the baby comes, the baby can stay in your room for a while. 我们喜欢你们住这里,这里有地方,而且……而且婴儿出生以后,可以住在你们房间一段时间。 ...
走遍美国(Family Album U.S.A.)第12课:Grandpa's New Job(爷爷的新工作)
课文原文(双语) Is that you, Susan? 是你吗,Susan? It’s me, Grandpa. 是我,爷爷。 Am I glad to see you! 我看到你真的很高兴! And am I glad to see you! 我看见你才高兴呢! I am also glad to be here. 我很高兴来这里。 How are things? 近况如何? I have been talking to a group of salesmen since ten this morning, and I’m real exhausted. 我一直在与一群推销人员谈话,从今天上午十点起,我实在是精疲力竭了。 Well, you look good. 嗯,你看起来蛮好的。 What’s Harry doing tonight? Harry今晚做什么? He and Michelle are visiting relatives in New Jersey today. 他和Michelle今天去New Jersey拜访亲戚去了。 ...
走遍美国(Family Album U.S.A.)第13课:Welcome Home, Max(欢迎回家,Max)
课文原文(双语) There’s nothing more joyous than the arrival of a new baby. 没有任何事能比新生儿的到来更令人喜悦的了。 I am so excited. Mother! 我好兴奋,妈妈! Just imagine–Marilyn and Richard must be thrilled! 想像得出——Marilyn和Richard一定乐坏了! Oh, a new baby! 噢,一个新生儿! Max … Max … Max. Max……Max……Max。 Oh, it’s a sweet-sounding name for a sweet little boy. 噢,好一个甜美悦耳的名字,配个甜美的小孩。 My first grandchild. 我的第一个孙子。 And my first nephew. 我的第一个侄子。 Isn’t he just adorable? 他真是太可爱了! He looks a lot like you, Mom. He does. 他像你,妈妈。他像你。 ...
走遍美国(Family Album U.S.A.)第14课:求婚与游戏
课文原文(双语对话) Susan: You like living in New York, don’t you? / 你喜欢住在纽约,是吗? Harry: Oh, I love it. It’s so convenient. I can take the bus to work … or the subway … or a taxi. And there’s so much to do. Lots of movie houses, and the theater. / 噢,我喜欢住在纽约。一切都很方便,我可以坐公共汽车上班……或者搭地铁……或者坐计程车。而且这里总是有许多事可做。很多电影院,还有剧院。 Susan: I know what you mean. / 我懂得你的意思。 Harry: I’d like to live in the city, but living in New Jersey and the suburbs is better for Michelle. Trees, grass. / 我也喜欢住在城里,但住在New Jersey的郊区对Michelle要好些。有绿树,有草地。 ...
走遍美国(Family Album U.S.A.)第15课:结婚纪念日惊喜
课文原文(双语对话) Richard: What’s this for? / 为什么要送我花? Marilyn: Just because. How’s the baby? / 没有原因。孩子好吗? Richard: Fast asleep. I’m sorry I missed him. I had to work late. / 正熟睡着呢。很抱歉我错过了他醒着的时候。我必须工作到很晚。 Marilyn: What are the flowers for, Richard? / 究竟为什么送花,Richard? Richard: Five years of happiness. Happy anniversary. / 为了五年的幸福。祝你结婚周年快乐! Marilyn: But our anniversary isn’t until Saturday. / 但是要到星期六才是我们结婚周年呀。 Richard: I couldn’t wait. Besides, we are not going to be here Saturday. / 我迫不及待啦。另外,我们星期六将不在这里了。 ...
走遍美国(Family Album U.S.A.)第16课:五十年重逢与惊喜
课文原文(双语对话) Robbie: The mailman just dropped some mail in our box, Grandpa. / 邮差刚刚塞进一些信件在我们的信箱里,爷爷。 Grandpa: Probably a lot of advertising and bills. / 大概是一大堆广告和帐单。 Robbie: You were right, Grandpa. Advertising, bills, bills, advertising. / 给你说对了,爷爷。广告、帐单、帐单、广告。 Grandpa: Nothing interesting. / 没有什么有趣的。 Robbie: You won’t believe it, Grandpa, but there’s a letter here addressed to you, Mr. Malcolm Stewart, and it looks like a personal letter. / 你绝不会相信,爷爷,这里确实有一封信是寄给你的,Malcolm Stewart先生收,而且看来是一封私人信件。 Grandpa: Oh, it must be a bill. / 噢,还不是帐单。 ...
走遍美国(Family Album U.S.A.)第17课:摄影集出版之路
课文原文(双语对话) Marilyn: What are you doing? / 你在干什么? Richard: I think I’ve got them. / 我想我已经拍齐了。 Marilyn: You think you’ve got what? / 你想你已经拍齐了什么? Richard: Performing arts—performing arts centers. I think I’ve got them all, but I’m not sure. / 表演艺术——表演艺术中心。我想我都已经拍齐了,但我不能肯定。 Marilyn: I think you have got it, Richard. Lincoln Center, home of the Metropolitan Opera, the New York City Ballet, the New York Philharmonic. Shubert Alley, center of the theater on Broadway. And Carnegie Hall. And the Kennedy Center for the Performing Arts in Washington. And the Music Center in Los Angeles. And the others. I do have it all. / 我想你已完成了,Richard。林肯中心——大都会歌剧团、纽约市芭蕾舞团、纽约爱乐的大本营。Shubert Alley——百老汇戏剧中心。还有卡奈基音乐厅。还有位于华盛顿的甘乃迪表演艺术中心。还有位于洛杉矶的音乐中心。还有其他的。我确实拍齐了。 ...
走遍美国(Family Album U.S.A.)第18课:竞选校董会
课文原文(双语对话) Ellen: I don’t believe it! / 我简直难以相信! Philip: What’s wrong? / 怎么了? Ellen: Carter Boswell! / Carter Boswell! Philip: Who’s Carter Boswell? / 谁是Carter Boswell? Ellen: He’s running for the school board. The election’s next month. / 他正在竞选联合校董会董事。选举就在下个月。 Philip: What’s wrong with wanting to be on the school board? / 想进入联合校董会有什么错? Ellen: Nothing. But he wants to cut the school budget! / 没有什么。但他想削减学校的预算! Philip: Maybe it needs cutting. / 也许真需要削减呢。 ...