This shows you the differences between two versions of the page.
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 ' | + | Использование parted для разметки диска |
+ | |||
+ | ====== | ||
+ | |||
+ | Instead of using a whole device for linux software RAID, use a partitioned device which mean the device has an easily read ' | ||
==== 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. | ||
- | < | + | < |
+ | # parted -a optimal /dev/sdf | ||
</ | </ | ||
Create a legacy master boot record (MBR) partition table | Create a legacy master boot record (MBR) partition table | ||
- | < | + | < |
+ | (parted) **mklabel msdos ** | ||
</ | </ | ||
+ | |||
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). | ||
- | < | + | < |
+ | (parted) **mkpart** Partition type? primary/ | ||
Start? **2048s** End? **-1** | Start? **2048s** End? **-1** | ||
</ | </ | ||
+ | |||
Mark the partition as a software raid partition | Mark the partition as a software raid partition | ||
- | < | + | < |
- | ** | + | (parted) set 1 raid on |
</ | </ | ||
+ | |||
Verify the partition is aligned | Verify the partition is aligned | ||
- | < | + | < |
+ | (parted) align-check alignment type(min/ | ||
1 aligned | 1 aligned | ||
</ | </ | ||
+ | |||
Show the device | Show the device | ||
- | < | + | < |
+ | (parted) **print** Model: ATA WDC WD3202ABYS-0 (scsi) | ||
Disk /dev/sdf: 320GB | Disk /dev/sdf: 320GB | ||
Sector size (logical/ | Sector size (logical/ | ||
Line 40: | Line 52: | ||
| | ||
</ | </ | ||
+ | |||
Add the device to the Linux software RAID volume: | Add the device to the Linux software RAID volume: | ||
- | < | + | < |
+ | # mdadm --add /dev/md1 /dev/sdf1 | ||
</ | </ | ||