Partitionieren unter Linux mit parted

2

Ich versuche, eine neue Partition in Linux mit parted zu erstellen. Ich fange wie folgt an.

# parted -a optimal /dev/sda

Unten finden Sie die aktuelle Partitionstabelle.

Number  Start   End     Size    Type      File system     Flags
 1      1049kB  211MB   210MB   primary   ext4            boot
 2      211MB   10.7GB  10.5GB  primary   ext4
 3      10.7GB  15.9GB  5243MB  primary   linux-swap(v1)
 4      15.9GB  150GB   134GB   extended                  lba

Beim Erstellen der Partition wird die folgende Warnung angezeigt.

(parted) mkpart extended 10957 149504
Warning: You requested a partition from 11.0GB to 150GB.
The closest location we can manage is 15.9GB to 150GB.
Is this still acceptable to you?
Yes/No? yes
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda (Device or resource busy).  As a result, it may not reflect all of your changes until after reboot.
(parted) mkpart logical ext4 10957 149504
Warning: You requested a partition from 11.0GB to 150GB.
The closest location we can manage is 15.9GB to 150GB.
Is this still acceptable to you?
Yes/No? yes
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel?

Warum wird nicht mit der optimalen Ausrichtung getrennt. Hilfe wird sehr geschätzt.

Indika K
quelle

Antworten:

1

Versuchen Sie diesen Weg:

[root@localhost ~]# fdisk /dev/sda

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): n
First cylinder (2905-10011, default 2905): 
Using default value 2905
Last cylinder, +cylinders or +size{K,M,G} (2905-10011, default 10011): +20M

Command (m for help): t
Partition number (1-6): 6
Hex code (type L to list codes): 83

Command (m for help): p

Disk /dev/sda: 82.3 GB, 82348277760 bytes
255 heads, 63 sectors/track, 10011 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0001501c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          26      204800   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              26        2637    20971520   83  Linux
/dev/sda3            2637        2898     2097152   82  Linux swap / Solaris
/dev/sda4            2898       10011    57138861+   5  Extended
/dev/sda5            2898        2904       51852+  83  Linux
/dev/sda6            2905        2908       32098+  83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.

Woher:

  • sda ist deine Festplatte

  • n bedeutet eine neue Partition hinzufügen

  • t bedeutet, die System-ID einer Partition zu ändern

  • p bedeutet drucken Sie die Partitionstabelle

  • w bedeutet, schreiben Sie die Tabelle auf die Festplatte und beenden

max
quelle