LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-05-2021, 02:02 AM   #1
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,176

Rep: Reputation: 233Reputation: 233Reputation: 233
README_RAID.TXT unexpectedly clones disk identifier


The command provided for convenience to clone partitions of member disks:
Code:
Now that /dev/sda is partitioned as appropriate, copy the partitions to all
the other drives to be used in your RAID arrays.
   
An easy way to do this is:
  sfdisk -d /dev/sda | sfdisk --Linux /dev/sdb

This will destroy all partitions on /dev/sdb, and replicate /dev/sda's
partition setup onto it.
also clones the disk identifier, which causes management problems. It would be nice to add a command here to reset the disk identifier to some other random value, or just don't clone that.
 
Old 03-05-2021, 09:25 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
AFAIK that sfdisk command just copies the MBR partition table in the first block of the disk, which does not contain any identifiers. It will not work for GPT disks. Please explain what identifier you are seeing.
 
Old 03-05-2021, 11:08 AM   #3
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,176

Original Poster
Rep: Reputation: 233Reputation: 233Reputation: 233
Quote:
Originally Posted by smallpond View Post
//snip
Please explain what identifier you are seeing.
By "Disk Identifier" I mean
Code:
# fdisk -l /dev/sda

Disk /dev/sda: 479.6 GB, 479559942144 bytes, 936640512 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes
Disk label type: dos
Disk identifier: 0x000bf03e

   Device Boot      Start         End      Blocks   Id  System
"Disk identifier" here, 0x000bf03e for example.
 
Old 03-07-2021, 09:36 AM   #4
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
I was wrong, Looks like there can be an identifier in the MBR. It seems totally unexpected that copying the partition table would also copy the identifier. Seems like a bug in sfidsk as it's not stated on the sfdisk man page.
 
Old 03-07-2021, 02:05 PM   #5
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
The workaround is to dump into a file, edit the identifier and use this file to set up the other drive.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] bash: export: `=': not a valid identifier - bash: export: `0': not a valid identifier PClOStinspace Linux - General 4 01-24-2014 01:11 PM
Machine shutdown unexpectedly unexpectedly pinga123 Linux - Newbie 1 02-25-2011 03:48 PM
what is "Disk Identifier"? m4rtin Linux - General 9 09-05-2010 09:15 AM
cat onelinefile.txt >> newfile.txt; cat twofile.txt >> newfile.txt keep newline? tmcguinness Programming 4 02-12-2009 06:38 AM
How can read from file.txt C++ where can save this file(file.txt) to start reading sam_22 Programming 1 01-11-2007 05:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration