how to check that all other disks except the OS disks are not with partitions











up vote
0
down vote

favorite












I want to check that all other disks except the OS disks are not with partitions by bash script



for example



we can see that sdb is with two internal partitions - sdb1 and sdb2



NAME             MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
fd0 2:0 1 4K 0 disk
sda 8:0 0 150G 0 disk
├─sda1 8:1 0 500M 0 part /boot
└─sda2 8:2 0 149.5G 0 part
├─vg00-lww_root 253:0 0 40G 0 lvm /
├─vg00-lww_swap 253:1 0 7.7G 0 lvm [SWAP]
└─vg00-lww_var 253:2 0 100.9G 0 lvm /var
sdb 8:16 0 20G 0 disk
├─sdb1 8:1 0 500M 0 part
└─sdb2 8:2 0 500M 0 part
sdc 8:32 0 20G 0 disk


with which command or syntax we can verify that disk is without partitions as sdc? ( so with this command I will use it in my bash script )



according to our example - sdc disk , is without partitions










share|improve this question
























  • This question would probably be clearer if you split it into listing the OS disks (which you're already asking about) and the detecting whether the remaining disks are unpartitioned (which could be the core of this question).
    – n.st
    Nov 25 at 15:55















up vote
0
down vote

favorite












I want to check that all other disks except the OS disks are not with partitions by bash script



for example



we can see that sdb is with two internal partitions - sdb1 and sdb2



NAME             MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
fd0 2:0 1 4K 0 disk
sda 8:0 0 150G 0 disk
├─sda1 8:1 0 500M 0 part /boot
└─sda2 8:2 0 149.5G 0 part
├─vg00-lww_root 253:0 0 40G 0 lvm /
├─vg00-lww_swap 253:1 0 7.7G 0 lvm [SWAP]
└─vg00-lww_var 253:2 0 100.9G 0 lvm /var
sdb 8:16 0 20G 0 disk
├─sdb1 8:1 0 500M 0 part
└─sdb2 8:2 0 500M 0 part
sdc 8:32 0 20G 0 disk


with which command or syntax we can verify that disk is without partitions as sdc? ( so with this command I will use it in my bash script )



according to our example - sdc disk , is without partitions










share|improve this question
























  • This question would probably be clearer if you split it into listing the OS disks (which you're already asking about) and the detecting whether the remaining disks are unpartitioned (which could be the core of this question).
    – n.st
    Nov 25 at 15:55













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I want to check that all other disks except the OS disks are not with partitions by bash script



for example



we can see that sdb is with two internal partitions - sdb1 and sdb2



NAME             MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
fd0 2:0 1 4K 0 disk
sda 8:0 0 150G 0 disk
├─sda1 8:1 0 500M 0 part /boot
└─sda2 8:2 0 149.5G 0 part
├─vg00-lww_root 253:0 0 40G 0 lvm /
├─vg00-lww_swap 253:1 0 7.7G 0 lvm [SWAP]
└─vg00-lww_var 253:2 0 100.9G 0 lvm /var
sdb 8:16 0 20G 0 disk
├─sdb1 8:1 0 500M 0 part
└─sdb2 8:2 0 500M 0 part
sdc 8:32 0 20G 0 disk


with which command or syntax we can verify that disk is without partitions as sdc? ( so with this command I will use it in my bash script )



according to our example - sdc disk , is without partitions










share|improve this question















I want to check that all other disks except the OS disks are not with partitions by bash script



for example



we can see that sdb is with two internal partitions - sdb1 and sdb2



NAME             MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
fd0 2:0 1 4K 0 disk
sda 8:0 0 150G 0 disk
├─sda1 8:1 0 500M 0 part /boot
└─sda2 8:2 0 149.5G 0 part
├─vg00-lww_root 253:0 0 40G 0 lvm /
├─vg00-lww_swap 253:1 0 7.7G 0 lvm [SWAP]
└─vg00-lww_var 253:2 0 100.9G 0 lvm /var
sdb 8:16 0 20G 0 disk
├─sdb1 8:1 0 500M 0 part
└─sdb2 8:2 0 500M 0 part
sdc 8:32 0 20G 0 disk


with which command or syntax we can verify that disk is without partitions as sdc? ( so with this command I will use it in my bash script )



according to our example - sdc disk , is without partitions







linux partition disk lsblk






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 25 at 15:32









Jeff Schaller

37k1052121




37k1052121










asked Nov 25 at 13:24









yael

2,3321955




2,3321955












  • This question would probably be clearer if you split it into listing the OS disks (which you're already asking about) and the detecting whether the remaining disks are unpartitioned (which could be the core of this question).
    – n.st
    Nov 25 at 15:55


















  • This question would probably be clearer if you split it into listing the OS disks (which you're already asking about) and the detecting whether the remaining disks are unpartitioned (which could be the core of this question).
    – n.st
    Nov 25 at 15:55
















This question would probably be clearer if you split it into listing the OS disks (which you're already asking about) and the detecting whether the remaining disks are unpartitioned (which could be the core of this question).
– n.st
Nov 25 at 15:55




This question would probably be clearer if you split it into listing the OS disks (which you're already asking about) and the detecting whether the remaining disks are unpartitioned (which could be the core of this question).
– n.st
Nov 25 at 15:55















active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f484035%2fhow-to-check-that-all-other-disks-except-the-os-disks-are-not-with-partitions%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f484035%2fhow-to-check-that-all-other-disks-except-the-os-disks-are-not-with-partitions%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Morgemoulin

Scott Moir

Souastre