[ale] parted and logical partition

Todor Fassl fassl.tod at gmail.com
Thu May 11 17:23:04 EDT 2017


I have a virtual disk with some free space. Rather than try to resize 
the root partition, I thought I'd just create a new partition and mount 
it on /opt. But when I created a new primary partition, it lost 
/dev/sda5 (the root partition). So then I used parted to rescue it. It 
is back except that it is no longer listed as lvm. It now just says 
ext4. I don't care about losing the lvm capabilities. I am worried about 
what will happen when I reboot.

Here is the original output from parted:
# parted /dev/sda print free
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 37.6GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type      File system  Flags
         32.3kB  1049kB  1016kB            Free Space
  1      1049kB  256MB   255MB   primary   ext2         boot
         256MB   257MB   1048kB            Free Space
  2      257MB   21.5GB  21.2GB  extended
  5      257MB   21.5GB  21.2GB  logical                lvm
         21.5GB  37.6GB  16.1GB            Free Space

Here is what it looked like after I create a new primary partition. Note 
that /dev/sda5 is missing:
# parted /dev/sda print
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 37.6GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type      File system  Flags
  1      1049kB  256MB   255MB   primary   ext2         boot
  2      257MB   21.5GB  21.2GB  extended
  3      21.5GB  37.6GB  16.1GB  primary

Here is what it looks like now, after I used parted to rescue the 
partition between 257MB and 21.5GB. Note the type has changed from lvm 
to ext4 and there is some free space at the end.

# parted /dev/sda print free
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 37.6GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type      File system  Flags
         32.3kB  1049kB  1016kB            Free Space
  1      1049kB  256MB   255MB   primary   ext2         boot
         256MB   257MB   1048kB            Free Space
  2      257MB   21.5GB  21.2GB  extended
  5      257MB   20.9GB  20.7GB  logical   ext4
         20.9GB  21.5GB  556MB             Free Space
  3      21.5GB  37.6GB  16.1GB  primary



# parted /dev/sda print free
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 37.6GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type      File system  Flags
         32.3kB  1049kB  1016kB            Free Space
  1      1049kB  256MB   255MB   primary   ext2         boot
         256MB   257MB   1048kB            Free Space
  2      257MB   21.5GB  21.2GB  extended
  5      257MB   21.5GB  21.2GB  logical                lvm
         21.5GB  37.6GB  16.1GB            Free Space


More information about the Ale mailing list