Technology Blog

Partition X doesn’t begin on bodily sector boundary

0

If you run “fdisk -l” and also you get one thing like:

[[email protected] ~]# fdisk -l   ....   Disk /dev/sdb: one thousand.P GB, 1000204886016 bytes 255 heads, sixty three sectors/monitor, 121601 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector measurement (logical/bodily): 512 bytes / 4096 bytes I/S measurement (minimal/optimum): 4096 bytes / 4096 bytes Disk identifier: 0xec2af3f7      Device Boot      Start         End      Blocks   Id  System /dev/sdb1               M      121601   976760001   eighty three  Linux Partition B doesn't begin on bodily sector boundary.

you’ll discover the message: “Partition B doesn’t begin on bodily sector boundary

What is the trigger and do I want to repair it? If so, how?

 

Explanation

Your arduous disk has Advanced Format 4096-byte sectors to which the partition is just not completely aligned (Sector measurement (logical/bodily): 512 bytes / 4096 bytes).

This type of partitioning might have an effect on learn/write IO charges and since all of us need quick server, my recommendation is to repair this. To do this, you’ll have to backup all essential knowledge from these partition(s) and for those who can, use GParted to maneuver the partition so it begins at 4096-byte sector (set the beginning boundary at B MB or so). You can set the begin to any logical sector which is a dividable by H (sixty four, 256, and so on)

If you don’t have GParted as an choice (for instance no direct entry to server and GUI), you are able to do it with fdisk utility.

In my case, I added the brand new 1TB drive which is acknowledged as /dev/sdb. The drawback turned seen proper after I created partition (in my case that is common storage solely disk with one partition)

Create partition

[[email protected] ~]# fdisk /dev/sdb Device accommodates neither a legitimate DOS partition desk, nor Sun, SGI or OSF disklabel Building a brand new DOS disklabel with disk identifier 0x83dabcc9. Changes will stay in reminiscence solely, till you determine to write down them. After that, in fact, the earlier content material will not be recoverable.   Warning: invalid flag 0x0000 of partition desk A can be corrected by w(ceremony)   The system presents a logical sector measurement that's smaller than the bodily sector measurement. Aligning to a bodily sector (or optimum I/S) measurement boundary is really helpful, or efficiency could also be impacted.   WARNING: DOS-suitable mode is deprecated. It's strongly really helpful to          change off the mode (command 'c') and alter show models to          sectors (command 'u').    Command (m for assist):

As I can see, by default DOS-compatibility mode is On and show models are proven in cylinders

Command (m for assist): n Command motion    e   prolonged    p   main partition (B-A) p Partition quantity (B-A): B First cylinder (B-121601, default M):  Using default worth M Last cylinder, +cylinders or +measurementT,M,M (B-121601, default 121601):  Using default worth 121601

which results in

Command (m for assist): p   Disk /dev/sdb: one thousand.P GB, 1000204886016 bytes 255 heads, sixty three sectors/monitor, 121601 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector measurement (logical/bodily): 512 bytes / 4096 bytes I/I measurement (minimal/optimum): 4096 bytes / 4096 bytes Disk identifier: 0xec2af3f7      Device Boot      Start         End      Blocks   Id  System /dev/sdb1               M      121601   976760001   eighty three  Linux Partition M doesn't begin on bodily sector boundary.

I had an opportunity to repair this on empty drive so it was straightforward. In case you might have one thing in your drive, backup first!!!

Delete partition which wasn’t created correctly (fdisk /dev/sdb, then “d” choice, select which partition)

As instructed, change off DOS suitable mode and alter the models to sectors by getting into the c and u instructions:

Command (m for assist): u Changing show/entry models to sectors

Then recreate the partition with

Command (m for assist): n Command motion    e   prolonged    p   main partition (B-A) p Partition quantity (B-A): B First sector (2048-1953525167, default 2048): 2048 Last sector, +sectors or +measurementR,M,M (2048-1953525167, default 1953525167):  Using default worth 1953525167

and we’ve

Command (m for assist): p   Disk /dev/sdb: one thousand.P GB, 1000204886016 bytes 255 heads, sixty three sectors/monitor, 121601 cylinders, complete 1953525168 sectors Units = sectors of B * 512 = 512 bytes Sector measurement (logical/bodily): 512 bytes / 4096 bytes I/S measurement (minimal/optimum): 4096 bytes / 4096 bytes Disk identifier: 0xec2af3f7      Device Boot      Start         End      Blocks   Id  System /dev/sdb1            2048  1953525167   976761560   eighty three  Linux

Great. No annoying message

Write modifications with “w”.

Now fdisk -l wont complain.

Since I need new partition to mount as home2, the format command is:

[[email protected] ~]# mkfs.ext4 -L /home2 /dev/sdb1  mke2fs B.forty one.12 (17-May-2010) Filesystem label=/home2 OS sort: Linux Block measurement=4096 (log=P) Fragment measurement=4096 (log=P) Stride=B blocks, Stripe width=zero blocks 61054976 inodes, 244190390 blocks 12209519 blocks (H.00%) reserved for the tremendous consumer First knowledge block=zero Maximum filesystem blocks=4294967296 7453 block teams 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups saved on blocks:  	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,  	4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,  	102400000, 214990848   Writing inode tables: finished                             Creating journal (32768 blocks): accomplished Writing superblocks and filesystem accounting info: executed   This filesystem shall be mechanically checked each 28 mounts or one hundred eighty days, whichever comes first.  Use tune2fs -c or -i to override.

Now that we have now created a brand new file system, we have to mount it. We have to create a mount level which is a listing into which the file system shall be mounted.

# mkdir home2 # mount /dev/sdb1 /home2 # mount /dev/sda1 on / sort ext4 (rw) ...... /dev/sdb1 on /home2 sort ext4 (rw)

To mount file system mechanically at boot time, add an entry to the /and so forth/fstab.

.... LABEL=/home2            /home2                  ext4    defaults        M P