3

I have a (very) rough understanding of what lvm is, I'm finding it a little hard to grasp loop devices however. Anyway here's my issue:

Someone ran an Ubuntu server install for me and probably went with whatever default lvm setup was offered. And I am now needing to fix this. The server has two 146GB physical drives. The original intention was to set a raid-1 with roughly 100GB space on one partition.

Instead I have a mess to sort out. Here's some information:

fdisk -l (not very clear, see next) :

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 print all :

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

mount:

/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

So my first question is. What are these loop devices mounted in the /tmp folder? Can I simply remove them and use that space in / (or not because of swap etc.. etc..)? How would I go about reducing other paritions to add space to / (and eventually work my way into the original raid-1 plan)? I'd rather avoid a reinstall at this point (if possible).

Thanks in advance

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.