fdisk fails to create new partitions on an SSD drive
by JockVSJock from LinuxQuestions.org on (#5B361)
Using RHEL7, I'm trying to create partitions on a SMART 512 GB SSD Drive.
The drive is detected by dmesg/lsblk, but there are some errors output under lsblk.
Code:root@foo /]# dmesg | grep -i 'sdb'
[ 5.384722] sd 1:0:0:0: [sdb] 1000236416 512-byte logical blocks: (512 GB/476 GiB)
[ 5.385284] sd 1:0:0:0: [sdb] Write Protect is off
[ 5.385597] sd 1:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[ 5.385627] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 5.386539] sd 1:0:0:0: [sdb] Attached SCSI disk
[ 146.065507] sd 1:0:0:0: [sdb] FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 146.065526] sd 1:0:0:0: [sdb] Sense Key : Illegal Request [current] [descriptor]
[ 146.065530] sd 1:0:0:0: [sdb] Add. Sense: Unaligned write command
[ 146.065553] sd 1:0:0:0: [sdb] CDB: Write(10) 2a 00 00 00 00 00 00 00 08 00
Code:[root@gungan /]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdb 8:16 0 477G 0 diskFor some reason, if I try to wipe the drive first with dd before trying to create partitions, it doesn't complete and the process is still running in the background:
Code:dd if=/dev/zero of=/dev/sdb bs=512 status=progress
I can do a quick wipe and that works fine
Code:[root@foo /]# dd if=/dev/urandom of=/dev/sdb bs=1M count=2 status=progress
2+0 records in
2+0 records out
2097152 bytes (2.1 MB) copied, 0.257616 s, 8.1 MB/sIf I try to create a boot partition with fdisk, using the following commands:
- n for new
- p for primary
- 1 for partition number
- first sector is default 2048
- last sector is +1024 MB
type p to view the partition
type a for toggle bootable flag
for system ID, I'm unable to set it to W95 FAT32 (LBA), for some reason it continues to default to 83
When selecting print I see "Partition 1 does not end on cylinder boundary."
When selecting W, this is the output:
Code:Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Error closing file
I've notice that dmesg is outputting a ton or I/O errors (I can post those if those, however there is a ton of output).
Also I've run smartctl -a against /dev/sdb and doesn't output any immediate errors
Code:[root@foo /]# smartctl -a /dev/sdb
smartctl 6.2 2017-02-27 r4394 [x86_64-linux-3.10.0-693.el7.x86_64] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Device Model: HRAA2S0512ZILM1
Serial Number: 6G000J93
Firmware Version: T4Q1011I
User Capacity: 512,121,044,992 bytes [512 GB]
Sector Size: 512 bytes logical/physical
Rotation Rate: Solid State Device
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: ACS-2 (minor revision not indicated)
SATA Version is: SATA 3.1, 6.0 Gb/s (current: 1.5 Gb/s)
Local Time is: Tue Dec 1 10:54:21 2020 EST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
General SMART Values:
Offline data collection status: (0x02) Offline data collection activity
was completed without error.
Auto Offline Data Collection: Disabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 0) seconds.
Offline data collection
capabilities: (0x71) SMART execute Offline immediate.
No Auto Offline data collection support.
Suspend Offline collection upon new
command.
No Offline surface scan supported.
Self-test supported.
Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0002) Does not save SMART data before
entering power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 1) minutes.
Extended self-test routine
recommended polling time: ( 1) minutes.
Conveyance self-test routine
recommended polling time: ( 1) minutes.
SMART Attributes Data Structure revision number: 1
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x0000 100 100 000 Old_age Offline - 0
5 Reallocated_Sector_Ct 0x0000 100 100 000 Old_age Offline - 0
9 Power_On_Hours 0x0000 100 100 000 Old_age Offline - 29
12 Power_Cycle_Count 0x0000 100 100 000 Old_age Offline - 45
160 Unknown_Attribute 0x0000 100 100 000 Old_age Offline - 0
161 Unknown_Attribute 0x0000 100 100 000 Old_age Offline - 125
163 Unknown_Attribute 0x0000 100 100 000 Old_age Offline - 40
164 Unknown_Attribute 0x0000 100 100 000 Old_age Offline - 11934
165 Unknown_Attribute 0x0000 100 100 000 Old_age Offline - 7
166 Unknown_Attribute 0x0000 100 100 000 Old_age Offline - 0
167 Unknown_Attribute 0x0000 100 100 000 Old_age Offline - 5
168 Unknown_Attribute 0x0000 100 100 000 Old_age Offline - 3000
169 Unknown_Attribute 0x0000 100 100 000 Old_age Offline - 100
177 Wear_Leveling_Count 0x0000 100 100 050 Old_age Offline - 0
178 Used_Rsvd_Blk_Cnt_Chip 0x0000 100 100 000 Old_age Offline - 0
181 Program_Fail_Cnt_Total 0x0000 100 100 000 Old_age Offline - 0
182 Erase_Fail_Count_Total 0x0000 100 100 000 Old_age Offline - 0
192 Power-Off_Retract_Count 0x0000 100 100 000 Old_age Offline - 4
194 Temperature_Celsius 0x0000 100 100 000 Old_age Offline - 40 (0 101 0 225 0)
195 Hardware_ECC_Recovered 0x0000 100 100 000 Old_age Offline - 79
196 Reallocated_Event_Count 0x0000 100 100 016 Old_age Offline - 0
197 Current_Pending_Sector 0x0000 100 100 000 Old_age Offline - 0
198 Offline_Uncorrectable 0x0000 100 100 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0000 100 100 050 Old_age Offline - 0
232 Available_Reservd_Space 0x0000 100 100 000 Old_age Offline - 100
241 Total_LBAs_Written 0x0000 100 100 000 Old_age Offline - 89396
242 Total_LBAs_Read 0x0000 100 100 000 Old_age Offline - 62801
245 Unknown_Attribute 0x0000 100 100 000 Old_age Offline - 95472
SMART Error Log Version: 1
No Errors Logged
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Extended offline Completed without error 00% 29 -
# 2 Extended offline Completed without error 00% 29 -
SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
7 0 65535 Read_scanning was completed without error
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.With all of this info, I'm at a loss as to why I'm unable to use dd against this hard drive or create new partitions with fdisk.


The drive is detected by dmesg/lsblk, but there are some errors output under lsblk.
Code:root@foo /]# dmesg | grep -i 'sdb'
[ 5.384722] sd 1:0:0:0: [sdb] 1000236416 512-byte logical blocks: (512 GB/476 GiB)
[ 5.385284] sd 1:0:0:0: [sdb] Write Protect is off
[ 5.385597] sd 1:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[ 5.385627] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 5.386539] sd 1:0:0:0: [sdb] Attached SCSI disk
[ 146.065507] sd 1:0:0:0: [sdb] FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 146.065526] sd 1:0:0:0: [sdb] Sense Key : Illegal Request [current] [descriptor]
[ 146.065530] sd 1:0:0:0: [sdb] Add. Sense: Unaligned write command
[ 146.065553] sd 1:0:0:0: [sdb] CDB: Write(10) 2a 00 00 00 00 00 00 00 08 00
Code:[root@gungan /]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdb 8:16 0 477G 0 diskFor some reason, if I try to wipe the drive first with dd before trying to create partitions, it doesn't complete and the process is still running in the background:
Code:dd if=/dev/zero of=/dev/sdb bs=512 status=progress
I can do a quick wipe and that works fine
Code:[root@foo /]# dd if=/dev/urandom of=/dev/sdb bs=1M count=2 status=progress
2+0 records in
2+0 records out
2097152 bytes (2.1 MB) copied, 0.257616 s, 8.1 MB/sIf I try to create a boot partition with fdisk, using the following commands:
- n for new
- p for primary
- 1 for partition number
- first sector is default 2048
- last sector is +1024 MB
type p to view the partition
type a for toggle bootable flag
for system ID, I'm unable to set it to W95 FAT32 (LBA), for some reason it continues to default to 83
When selecting print I see "Partition 1 does not end on cylinder boundary."
When selecting W, this is the output:
Code:Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Error closing file
I've notice that dmesg is outputting a ton or I/O errors (I can post those if those, however there is a ton of output).
Also I've run smartctl -a against /dev/sdb and doesn't output any immediate errors
Code:[root@foo /]# smartctl -a /dev/sdb
smartctl 6.2 2017-02-27 r4394 [x86_64-linux-3.10.0-693.el7.x86_64] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Device Model: HRAA2S0512ZILM1
Serial Number: 6G000J93
Firmware Version: T4Q1011I
User Capacity: 512,121,044,992 bytes [512 GB]
Sector Size: 512 bytes logical/physical
Rotation Rate: Solid State Device
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: ACS-2 (minor revision not indicated)
SATA Version is: SATA 3.1, 6.0 Gb/s (current: 1.5 Gb/s)
Local Time is: Tue Dec 1 10:54:21 2020 EST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
General SMART Values:
Offline data collection status: (0x02) Offline data collection activity
was completed without error.
Auto Offline Data Collection: Disabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 0) seconds.
Offline data collection
capabilities: (0x71) SMART execute Offline immediate.
No Auto Offline data collection support.
Suspend Offline collection upon new
command.
No Offline surface scan supported.
Self-test supported.
Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0002) Does not save SMART data before
entering power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 1) minutes.
Extended self-test routine
recommended polling time: ( 1) minutes.
Conveyance self-test routine
recommended polling time: ( 1) minutes.
SMART Attributes Data Structure revision number: 1
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x0000 100 100 000 Old_age Offline - 0
5 Reallocated_Sector_Ct 0x0000 100 100 000 Old_age Offline - 0
9 Power_On_Hours 0x0000 100 100 000 Old_age Offline - 29
12 Power_Cycle_Count 0x0000 100 100 000 Old_age Offline - 45
160 Unknown_Attribute 0x0000 100 100 000 Old_age Offline - 0
161 Unknown_Attribute 0x0000 100 100 000 Old_age Offline - 125
163 Unknown_Attribute 0x0000 100 100 000 Old_age Offline - 40
164 Unknown_Attribute 0x0000 100 100 000 Old_age Offline - 11934
165 Unknown_Attribute 0x0000 100 100 000 Old_age Offline - 7
166 Unknown_Attribute 0x0000 100 100 000 Old_age Offline - 0
167 Unknown_Attribute 0x0000 100 100 000 Old_age Offline - 5
168 Unknown_Attribute 0x0000 100 100 000 Old_age Offline - 3000
169 Unknown_Attribute 0x0000 100 100 000 Old_age Offline - 100
177 Wear_Leveling_Count 0x0000 100 100 050 Old_age Offline - 0
178 Used_Rsvd_Blk_Cnt_Chip 0x0000 100 100 000 Old_age Offline - 0
181 Program_Fail_Cnt_Total 0x0000 100 100 000 Old_age Offline - 0
182 Erase_Fail_Count_Total 0x0000 100 100 000 Old_age Offline - 0
192 Power-Off_Retract_Count 0x0000 100 100 000 Old_age Offline - 4
194 Temperature_Celsius 0x0000 100 100 000 Old_age Offline - 40 (0 101 0 225 0)
195 Hardware_ECC_Recovered 0x0000 100 100 000 Old_age Offline - 79
196 Reallocated_Event_Count 0x0000 100 100 016 Old_age Offline - 0
197 Current_Pending_Sector 0x0000 100 100 000 Old_age Offline - 0
198 Offline_Uncorrectable 0x0000 100 100 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0000 100 100 050 Old_age Offline - 0
232 Available_Reservd_Space 0x0000 100 100 000 Old_age Offline - 100
241 Total_LBAs_Written 0x0000 100 100 000 Old_age Offline - 89396
242 Total_LBAs_Read 0x0000 100 100 000 Old_age Offline - 62801
245 Unknown_Attribute 0x0000 100 100 000 Old_age Offline - 95472
SMART Error Log Version: 1
No Errors Logged
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Extended offline Completed without error 00% 29 -
# 2 Extended offline Completed without error 00% 29 -
SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
7 0 65535 Read_scanning was completed without error
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.With all of this info, I'm at a loss as to why I'm unable to use dd against this hard drive or create new partitions with fdisk.