➜ ~ ssh corvo@192.168.xxx.yyy corvo@192.168.xxx.yyy's password: Linux HomeFN 6.12.18-trim #5 SMP PREEMPT_DYNAMIC Thu Mar 27 10:30:00 CST 2025 x86_64 Last login: Sun May 18 11:06:10 2025 from 192.168.101.221 corvo@HomeFN:~$
在第一次登录之后, 我发现每次输入密码麻烦就加了公钥到机器上, 可以自行添加这个目录以及文件
1 2
corvo@HomeFN:~$ ls ~/.ssh/authorized_keys /home/corvo/.ssh/authorized_keys
切换root用户
也可以切换到root用户, 正常输入密码就可以了
1 2 3
corvo@HomeFN:~$ sudo su - root [sudo] password for corvo: root@HomeFN:~# # 已经切换到了root用户
Welcome to fdisk (util-linux 2.38.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command.
GPT PMBR size mismatch (12582911 != 16777215) will be corrected by write. The backup GPT table is not on the end of the device. This problem will be corrected by write. This disk is currently in use - repartitioning is probably a bad idea. It's recommended to umount all file systems, and swapoff all swap partitions on this disk. Command (m for help): p Disk /dev/sdc: 8 GiB, 8589934592 bytes, 16777216 sectors Disk model: QEMU HARDDISK Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: FA6EEB5E-CA1C-4B0D-A7B3-F5CE97C59BC7 Device Start End Sectors Size Type /dev/sdc1 2048 12580863 12578816 6G Linux RAID Command (m for help): d Selected partition 1 Partition 1 has been deleted. Command (m for help): n Partition number (1-128, default 1): First sector (34-16777182, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-16777182, default 16775167): Created a new partition 1 of type 'Linux filesystem' and of size 8 GiB. Partition #1 contains a linux_raid_member signature. Do you want to remove the signature? [Y]es/[N]o: N # 一定要保留当前签名 Command (m for help): t Selected partition 1 Partition type or alias (type L to list all): 42 Changed type of partition 'Linux filesystem' to 'Linux RAID'. Command (m for help): w The partition table has been altered. Syncing disks.
查看调整结果:
1 2 3 4 5 6
root@HomeFN:/usr/trim/etc# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sdc 8:32 0 8G 0 disk └─sdc1 8:33 0 8G 0 part # 分区变为了8G └─md1 9:1 0 6G 0 raid1 └─trim_fc35013f_f739_4592_942f_d054200d2a3a-0 253:1 0 6G 0 lvm /vol2
调整raid
1 2 3 4 5 6 7 8
root@HomeFN:/usr/trim/etc# mdadm --grow /dev/md1 --size=max mdadm: component size of /dev/md1 has been set to 8381440K root@HomeFN:/usr/trim/etc# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sdc 8:32 0 8G 0 disk └─sdc1 8:33 0 8G 0 part └─md1 9:1 0 8G 0 raid1 # raid变为了8G └─trim_fc35013f_f739_4592_942f_d054200d2a3a-0 253:1 0 6G 0 lvm /vol2
调整lvm卷
1 2 3 4 5 6 7 8 9 10
root@HomeFN:/usr/trim/etc# lvresize /dev/trim_fc35013f_f739_4592_942f_d054200d2a3a/0 -l +100%FREE Size of logical volume trim_fc35013f_f739_4592_942f_d054200d2a3a/0 changed from 5.99 GiB (1534 extents) to 7.99 GiB (2046 extents). Logical volume trim_fc35013f_f739_4592_942f_d054200d2a3a/0 successfully resized.
root@HomeFN:/usr/trim/etc# btrfs filesystem resize max /vol2/ Resize device id 1 (/dev/mapper/trim_fc35013f_f739_4592_942f_d054200d2a3a-0) from 5.99GiB to max