1

TL;DR

Linux scan disk (for example /dev/sdc) and add files to address partitions on that disk (for example /dev/sdc1) - how can I tell Linux to not do that for some disk?

Long story:

I used VM (QEMU+KVM) to install other OS on physical HDD - "/dev/sdc" (different from host, of course). Before installation disk was cleared (all partitions removed). First installation has failed. I have stop VM and launched GParted on host and it showed warning about corrupted file-systems on that disk. I noticed that in "/dev/" appeared "sdc1" and etc. Next installation succeed, and I noticed that there was no "sdc1" and etc. Host side GParted showed warning that partitions on "/dev/sdc" is not mapped. So I came to conclusion that linux partition mapping may be reason for corrupted file-system in this case. How can I temporary disable that feature?

closed as unclear what you're asking by goldilocks, Anthon, jasonwryan, Braiam, polym Jul 30 '14 at 0:00

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Your question is a bit hard to follow, but if you are under the impression that /dev/sdc1 is a file added to the disk /dev/sdc, it's not. It's a device node and does not exist on any disk; scanning a disk for partitions does not alter it. The corrupted filesystems in the first instance are likely due to the failed installation. – goldilocks Jul 29 '14 at 19:26
1

Linux shows you device files for partitions when the disk has partitions. If the disk has partitions, there's no point in telling Linux not to show them to you: whatever problem you're having, this could only hide the problem, not solve it.

If you change the partition table while the disk is connected, the kernel might not notice and might keep acting on old data. After changing the partition table in any way, run the command partprobe /dev/sdc to re-read the partition table on /dev/sdc. You may need to unmount volumes that made use of the old partition table before doing this. The disk corruption you saw may have been a result of different parts of the system using conflicting information about the disk because you didn't run partprobe.

There's rarely a good reason to create a filesystem directly on a disk device, rather than create a partition on the disk and a filesystem on the partition. So run gparted or fdisk or gdisk, create a partition, make sure that partprobe is called, and re-do the installation starting from a consistent view of the disk.

Not the answer you're looking for? Browse other questions tagged or ask your own question.