User Tools

Site Tools


parted

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
parted [2019/08/02 15:07]
rb created
parted [2020/07/08 18:20] (current)
Line 1: Line 1:
-====== +======   ======
-Использование parted для разметки диска  ======+
  
-Instead of using a whole device for linux software RAID, use a partitioned device which mean the device has an easily read 'label' This means I can determine that it is a RAID member disk (as a against a standalone disk) just by looking at the partition table. However it can introduce alignment issues, which are mitigated by starting the partion at offset 1MB.+Использование parted для разметки диска 
 + 
 +======   ====== 
 + 
 +Instead of using a whole device for linux software RAID, use a partitioned device which mean the device has an easily read 'label'. This means I can determine that it is a RAID member disk (as a against a standalone disk) just by looking at the partition table. However it can introduce alignment issues, which are mitigated by starting the partion at offset 1MB.
  
 ==== Steps ==== ==== Steps ====
Line 8: Line 11:
 Run parted as root to create a partition table and raid partition. Run parted as root to create a partition table and raid partition.
  
-<code># parted -a optimal /dev/sdf+<code> 
 +# parted -a optimal /dev/sdf
 </code> </code>
  
 Create a legacy master boot record (MBR) partition table Create a legacy master boot record (MBR) partition table
  
-<code>(parted) **mklabel msdos **+<code> 
 +(parted) **mklabel msdos **
 </code> </code>
 +
 Create a partition that is optimally alligned starts at 1MB into the disk (2048 sectors) and ends at the end of the disk (-1). Create a partition that is optimally alligned starts at 1MB into the disk (2048 sectors) and ends at the end of the disk (-1).
  
-<code>(parted) **mkpart** Partition type?  primary/extended? **primary** File system type?  [ext2]?+<code> 
 +(parted) **mkpart** Partition type?  primary/extended? **primary** File system type?  [ext2]?
 Start? **2048s** End? **-1** Start? **2048s** End? **-1**
 </code> </code>
 +
 Mark the partition as a software raid partition Mark the partition as a software raid partition
  
-<code>(parted) **set 1 raid on +<code> 
-**+(parted) set 1 raid on
 </code> </code>
 +
 Verify the partition is aligned Verify the partition is aligned
  
-<code>(parted) **align-check** alignment type(min/opt)  [optimal]/minimal? **optimal** Partition number? 1+<code> 
 +(parted) align-check alignment type(min/opt)  [optimal]/minimal? optimal Partition number? 1
 1 aligned 1 aligned
 </code> </code>
 +
 Show the device Show the device
  
-<code>(parted) **print** Model: ATA WDC WD3202ABYS-0 (scsi)+<code> 
 +(parted) **print** Model: ATA WDC WD3202ABYS-0 (scsi)
 Disk /dev/sdf: 320GB Disk /dev/sdf: 320GB
 Sector size (logical/physical): 512B/512B Sector size (logical/physical): 512B/512B
Line 40: Line 52:
    1049kB  320GB  320GB  primary               raid    1049kB  320GB  320GB  primary               raid
 </code> </code>
 +
 Add the device to the Linux software RAID volume: Add the device to the Linux software RAID volume:
  
-<code># mdadm --add /dev/md1 /dev/sdf1+<code> 
 +# mdadm --add /dev/md1 /dev/sdf1
 </code> </code>
  
  
parted.1564747651.txt.gz · Last modified: 2020/07/08 18:20 (external edit)