is it possible to capture the UUID number before creating file system on disk

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












is it possible to capture the UUID number before creating file system on disk?



if yes how - by which command ?



blkid ( before run mkfs.ext4 on sdb disk )

<no output>


blkid ( after run mkfs.ext4 on sdb disk )

/dev/sdb: UUID="9bb52cfa-0070-4824-987f-23dd63efe120" TYPE="ext4"


Goal - we want to capture the UUID number on the Linux machines disks before creation the file system







share|improve this question






















  • 1. I recommend using partitions, not raw disks. Even if there's only ever going to be one partition spanning the entire disk. 2. An unformatted disk (or partition) won't have a UUID. If it has a partition table, it should have a PTUUID. If it is a partition, it should have a PARTUUID.
    – cas
    Jan 5 at 7:20










  • so final answer is no?
    – yael
    Jan 5 at 7:21






  • 1




    well, you can't capture a UUID if it doesn't exist.
    – cas
    Jan 5 at 7:22














up vote
0
down vote

favorite












is it possible to capture the UUID number before creating file system on disk?



if yes how - by which command ?



blkid ( before run mkfs.ext4 on sdb disk )

<no output>


blkid ( after run mkfs.ext4 on sdb disk )

/dev/sdb: UUID="9bb52cfa-0070-4824-987f-23dd63efe120" TYPE="ext4"


Goal - we want to capture the UUID number on the Linux machines disks before creation the file system







share|improve this question






















  • 1. I recommend using partitions, not raw disks. Even if there's only ever going to be one partition spanning the entire disk. 2. An unformatted disk (or partition) won't have a UUID. If it has a partition table, it should have a PTUUID. If it is a partition, it should have a PARTUUID.
    – cas
    Jan 5 at 7:20










  • so final answer is no?
    – yael
    Jan 5 at 7:21






  • 1




    well, you can't capture a UUID if it doesn't exist.
    – cas
    Jan 5 at 7:22












up vote
0
down vote

favorite









up vote
0
down vote

favorite











is it possible to capture the UUID number before creating file system on disk?



if yes how - by which command ?



blkid ( before run mkfs.ext4 on sdb disk )

<no output>


blkid ( after run mkfs.ext4 on sdb disk )

/dev/sdb: UUID="9bb52cfa-0070-4824-987f-23dd63efe120" TYPE="ext4"


Goal - we want to capture the UUID number on the Linux machines disks before creation the file system







share|improve this question














is it possible to capture the UUID number before creating file system on disk?



if yes how - by which command ?



blkid ( before run mkfs.ext4 on sdb disk )

<no output>


blkid ( after run mkfs.ext4 on sdb disk )

/dev/sdb: UUID="9bb52cfa-0070-4824-987f-23dd63efe120" TYPE="ext4"


Goal - we want to capture the UUID number on the Linux machines disks before creation the file system









share|improve this question













share|improve this question




share|improve this question








edited Jan 5 at 7:13

























asked Jan 5 at 7:07









yael

2,0091145




2,0091145











  • 1. I recommend using partitions, not raw disks. Even if there's only ever going to be one partition spanning the entire disk. 2. An unformatted disk (or partition) won't have a UUID. If it has a partition table, it should have a PTUUID. If it is a partition, it should have a PARTUUID.
    – cas
    Jan 5 at 7:20










  • so final answer is no?
    – yael
    Jan 5 at 7:21






  • 1




    well, you can't capture a UUID if it doesn't exist.
    – cas
    Jan 5 at 7:22
















  • 1. I recommend using partitions, not raw disks. Even if there's only ever going to be one partition spanning the entire disk. 2. An unformatted disk (or partition) won't have a UUID. If it has a partition table, it should have a PTUUID. If it is a partition, it should have a PARTUUID.
    – cas
    Jan 5 at 7:20










  • so final answer is no?
    – yael
    Jan 5 at 7:21






  • 1




    well, you can't capture a UUID if it doesn't exist.
    – cas
    Jan 5 at 7:22















1. I recommend using partitions, not raw disks. Even if there's only ever going to be one partition spanning the entire disk. 2. An unformatted disk (or partition) won't have a UUID. If it has a partition table, it should have a PTUUID. If it is a partition, it should have a PARTUUID.
– cas
Jan 5 at 7:20




1. I recommend using partitions, not raw disks. Even if there's only ever going to be one partition spanning the entire disk. 2. An unformatted disk (or partition) won't have a UUID. If it has a partition table, it should have a PTUUID. If it is a partition, it should have a PARTUUID.
– cas
Jan 5 at 7:20












so final answer is no?
– yael
Jan 5 at 7:21




so final answer is no?
– yael
Jan 5 at 7:21




1




1




well, you can't capture a UUID if it doesn't exist.
– cas
Jan 5 at 7:22




well, you can't capture a UUID if it doesn't exist.
– cas
Jan 5 at 7:22










1 Answer
1






active

oldest

votes

















up vote
7
down vote



accepted










No and yes.



The command to create the filesystem is the one that generates the UUID. So, before running it there is no UUID to use to name the filesystem.



However, it is posible to use an specific UUID to create the filesystem:



$ uuid=$(uuidgen)
$ echo "$uuid"
9a7d78e5-bc6c-4b19-94da-291122af9cf5
$ mkfs.ext4 -U "$uuid"


The uuidgen program which is part of the e2fsprogs package






share|improve this answer






















  • excellent answer thank you so much
    – yael
    Jan 5 at 7:23










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: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
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%2f414932%2fis-it-possible-to-capture-the-uuid-number-before-creating-file-system-on-disk%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
7
down vote



accepted










No and yes.



The command to create the filesystem is the one that generates the UUID. So, before running it there is no UUID to use to name the filesystem.



However, it is posible to use an specific UUID to create the filesystem:



$ uuid=$(uuidgen)
$ echo "$uuid"
9a7d78e5-bc6c-4b19-94da-291122af9cf5
$ mkfs.ext4 -U "$uuid"


The uuidgen program which is part of the e2fsprogs package






share|improve this answer






















  • excellent answer thank you so much
    – yael
    Jan 5 at 7:23














up vote
7
down vote



accepted










No and yes.



The command to create the filesystem is the one that generates the UUID. So, before running it there is no UUID to use to name the filesystem.



However, it is posible to use an specific UUID to create the filesystem:



$ uuid=$(uuidgen)
$ echo "$uuid"
9a7d78e5-bc6c-4b19-94da-291122af9cf5
$ mkfs.ext4 -U "$uuid"


The uuidgen program which is part of the e2fsprogs package






share|improve this answer






















  • excellent answer thank you so much
    – yael
    Jan 5 at 7:23












up vote
7
down vote



accepted







up vote
7
down vote



accepted






No and yes.



The command to create the filesystem is the one that generates the UUID. So, before running it there is no UUID to use to name the filesystem.



However, it is posible to use an specific UUID to create the filesystem:



$ uuid=$(uuidgen)
$ echo "$uuid"
9a7d78e5-bc6c-4b19-94da-291122af9cf5
$ mkfs.ext4 -U "$uuid"


The uuidgen program which is part of the e2fsprogs package






share|improve this answer














No and yes.



The command to create the filesystem is the one that generates the UUID. So, before running it there is no UUID to use to name the filesystem.



However, it is posible to use an specific UUID to create the filesystem:



$ uuid=$(uuidgen)
$ echo "$uuid"
9a7d78e5-bc6c-4b19-94da-291122af9cf5
$ mkfs.ext4 -U "$uuid"


The uuidgen program which is part of the e2fsprogs package







share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 5 at 7:24

























answered Jan 5 at 7:21









Isaac

6,8011834




6,8011834











  • excellent answer thank you so much
    – yael
    Jan 5 at 7:23
















  • excellent answer thank you so much
    – yael
    Jan 5 at 7:23















excellent answer thank you so much
– yael
Jan 5 at 7:23




excellent answer thank you so much
– yael
Jan 5 at 7:23












 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f414932%2fis-it-possible-to-capture-the-uuid-number-before-creating-file-system-on-disk%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?