@Zhmak

Почему parted не может удалить раздел?

Есть устройство /dev/mapper/6_web, созданное multipathd
На нем есть GPT раздел:
partprobe -d -s /dev/mapper/6_web
/dev/mapper/6_web: gpt partitions 2


Пытаюсь его удалить:
parted /dev/mapper/6_web
(parted) print
Model: Linux device-mapper (multipath) (dm)
Disk /dev/mapper/6_web: 1207GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start  End    Size    File system  Name  Flags
 2      121GB  181GB  60.3GB  ext3         2

(parted) rm 2
Error: Partition /dev/mapper/6_webp2 is being used. You must unmount it before you modify it with Parted.


Казалось бы, надо размонтировать. Но:
umount  /dev/mapper/6_webp2
umount: /dev/mapper/6_webp2: not mounted


В LVM этот том так же не замечен.

Что его держит?
  • Вопрос задан
  • 999 просмотров
Решения вопроса 1
@Zhmak Автор вопроса
Шалил Device Mapper. Глючил parted.
Через gdisk удалил раздел с /dev/mapper/6_webp2

gdisk /dev/mapper/6_web
GPT fdisk (gdisk) version 0.8.5

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/mapper/6_web: 2357198848 sectors, 1.1 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): 75A8F088-8F7F-4127-B809-F458AAE91D57
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 2357198814
Partitions will be aligned on 2048-sector boundaries
Total free space is 2239340477 sectors (1.0 TiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   2       235720704       353579007   56.2 GiB    0700  2

Command (? for help): d 2
Using 2

Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/mapper/6_web.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot.
The operation has completed successfully.


При этом:
parted /dev/mapper/6_webp2
GNU Parted 2.3
Using /dev/mapper/6_webp2
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/6_webp2: 60.3GB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End     Size    File system  Flags
 1      0.00B  60.3GB  60.3GB  ext3


Device mapper её породил,
dmsetup info /dev/mapper/6_webp2
Name:              6_webp2
State:             ACTIVE
Read Ahead:        256
Tables present:    LIVE
Open count:        0
Event number:      0
Major, minor:      253, 2
Number of targets: 1

он же её и убьёт:
dmsetup remove /dev/mapper/6_webp2

Проверяем:
dmsetup info /dev/mapper/6_webp2
Device does not exist.
Command failed


Проверяем open count у 6_web:
dmsetup info /dev/mapper/6_web
Name:              6_web
State:             ACTIVE
Read Ahead:        256
Tables present:    LIVE
Open count:        0
Event number:      1
Major, minor:      253, 1
Number of targets: 1
UUID: mpath-360080e500029f9a00000142d5c51434e


А вот сюрприз:
ls /dev/mapper/ | grep 6_web
6_web  6_webp2


Но dmsetup ls говорит, что всё хорошо:
dmsetup ls
6_web   (253:1)
... и прочие, не связанные с ним
Ответ написан
Пригласить эксперта
Ответы на вопрос 2
@sash999
просто админ из деревни
sudo lsof | grep -E "/dev/mapper/6_webp2"
Ответ написан
take
@take
я люблю любить
может из-за /dev/mapper ?
"The devices in /dev/mapper are Logical Volumes. These are virtual block devices carved out of storage space allocated to one or more Volume Groups. The Volume Groups in turn are created from a number of Physical Volumes, which can be entire block devices or partitions."

в общем, если я не ошибаюсь, надо удалять запись о его членстве в LVM -- LVMa может уже и не быть, а GPT -- говорит, что есть... и не дает. Такое соображение.

Еще одно --> zfs ?
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы