帮助我理解 lvm 初始设置循环设备

帮助我理解 lvm 初始设置循环设备

我对 lvm 有一个(非常)粗略的了解,但我发现掌握循环设备有点困难。无论如何,这是我的问题:

有人为我运行了 Ubuntu 服务器安装,可能使用了所提供的任何默认 lvm 设置。我现在需要修复这个问题。该服务器有两个 146GB 的物理驱动器。最初的意图是在一个分区上设置一个大约 100GB 空间的 raid-1。

相反,我得整理一下乱七八糟的东西。以下是一些信息:

fdisk -l (不是很清楚,见下文):

Disk /dev/sda: 146.8 GB, 146778685440 bytes
255 heads, 63 sectors/track, 17844 cylinders, total 286677120 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0006e6c2

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      499711      248832   83  Linux
/dev/sda2          501758   286676991   143087617    5  Extended
/dev/sda5          501760   286676991   143087616   8e  Linux LVM

Disk /dev/mapper/nmk203-root: 77.8 GB, 77791756288 bytes
255 heads, 63 sectors/track, 9457 cylinders, total 151937024 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/nmk203-root doesn't contain a valid partition table

Disk /dev/mapper/nmk203-swap_1: 68.7 GB, 68706893824 bytes
255 heads, 63 sectors/track, 8353 cylinders, total 134193152 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/nmk203-swap_1 doesn't contain a valid partition table

Disk /dev/mapper/loop0p1: 20.0 GB, 19998967808 bytes
255 heads, 63 sectors/track, 2431 cylinders, total 39060484 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/loop0p1 doesn't contain a valid partition table

Disk /dev/mapper/loop0p2: 1023 MB, 1023410176 bytes
255 heads, 63 sectors/track, 124 cylinders, total 1998848 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/loop0p2 doesn't contain a valid partition table

Disk /dev/mapper/loop2p1: 20.0 GB, 19998967808 bytes
255 heads, 63 sectors/track, 2431 cylinders, total 39060484 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/loop2p1 doesn't contain a valid partition table

Disk /dev/mapper/loop2p2: 1023 MB, 1023410176 bytes
255 heads, 63 sectors/track, 124 cylinders, total 1998848 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/loop2p2 doesn't contain a valid partition table

parted /dev/sda 打印全部:

Model: HP LOGICAL VOLUME (scsi)
Disk /dev/sda: 147GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End    Size   Type      File system  Flags
 1      1049kB  256MB  255MB  primary   ext2         boot
 2      257MB   147GB  147GB  extended
 5      257MB   147GB  147GB  logical                lvm


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/loop2p2: 1023MB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End     Size    File system     Flags
 1      0.00B  1023MB  1023MB  linux-swap(v1)


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/loop2p1: 20.0GB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End     Size    File system  Flags
 1      0.00B  20.0GB  20.0GB  ext4


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/loop0p2: 1023MB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End     Size    File system     Flags
 1      0.00B  1023MB  1023MB  linux-swap(v1)


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/loop0p1: 20.0GB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End     Size    File system  Flags
 1      0.00B  20.0GB  20.0GB  ext4


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/nmk203-swap_1: 68.7GB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End     Size    File system     Flags
 1      0.00B  68.7GB  68.7GB  linux-swap(v1)


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/nmk203-root: 77.8GB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End     Size    File system  Flags
 1      0.00B  77.8GB  77.8GB  ext4

fstab:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
/dev/mapper/nmk203-root /               ext4    errors=remount-ro 0       1
# /boot was on /dev/sdb1 during installation
UUID=26b5157b-8db8-47f3-a8ec-398e92d5e4cf /boot           ext2    defaults        0       2
/dev/mapper/nmk203-swap_1 none            swap    sw              0       0

山:

/dev/mapper/nmk203-root on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
cgroup on /sys/fs/cgroup type tmpfs (rw,relatime,mode=755)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu type cgroup (rw,relatime,cpu)
cgroup on /sys/fs/cgroup/cpuacct type cgroup (rw,relatime,cpuacct)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,relatime,memory)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,relatime,freezer)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,relatime,blkio)
/dev/sda1 on /boot type ext2 (rw)
/dev/dm-2 on /tmp/tmpq2vQ64 type ext4 (rw)
/dev/dm-4 on /tmp/tmptlvPgg type ext4 (rw)

DF-H:

Filesystem                    Size  Used Avail Use% Mounted on
/dev/mapper/nmk203-root   72G  5.1G   63G   8% /
udev                           32G  4.0K   32G   1% /dev
tmpfs                          13G  316K   13G   1% /run
none                          5.0M     0  5.0M   0% /run/lock
none                           32G     0   32G   0% /run/shm
cgroup                         32G     0   32G   0% /sys/fs/cgroup
/dev/sda1                     228M   54M  162M  25% /boot
/dev/loop1                     19G  630M   17G   4% /tmp/tmpq2vQ64
/dev/loop3                     19G  630M   17G   4% /tmp/tmptlvPgg

所以我的第一个问题是。这些循环设备安装在 /tmp 文件夹中是什么?我可以简单地删除它们并使用 / 中的空间吗(或者不是因为交换等)?我该如何减少其他分区以向 / 添加空间(并最终进入原始 raid-1 计划)?我宁愿避免此时重新安装(如果可能的话)。

提前致谢

相关内容