Linux AHCI Hotswap Tips - Remember To Reread The Partition Table WITHOUT rebooting

From the package "parted" you can use the command "partprobe" to re-read the partition table.  I really hate rebooting, and that's what I loved to hear about AHCI motherboards, that they allow hotswap so you don't have to reboot.  But that's only as good as the OS, if the OS does not reload the partition table you won't be able to do anything with that new drive you attached without rebooting.  Yes, even without re-reading the partiton table Linux will detect and show the new device you attached, but it won't work right (eg. you can't even format it) until you reread the partition table.  Most people would probably say "you have to reboot", but with "partprobe" you don't need to.

Otherwise when trying to format/initialize the drive you'll get annoying and strange errors like this:

mdadm --create /dev/md2 --level=1 --raid-devices=2 missing /dev/sdd2
mdadm: device /dev/sdd2 not suitable for any style of array

And just for fun here it is in action, I'm just excited because I didn't know AHCI enabled hotswap on a consumer grade motherboard.  Back in the 90's and early 2000's we could only dream of hotswap with expensive SCSI arrays.

 

ata3: exception Emask 0x10 SAct 0x0 SErr 0x40d0000 action 0xa frozen
ata3: irq_stat 0x00400040, connection status changed
ata3: SError: { PHYRdyChg CommWake 10B8B DevExch }
ata3: soft resetting link
ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata3.00: ATA-8: ST31000333AS, CC1F, max UDMA/133
ata3.00: 1953525168 sectors, multi 0: LBA48 NCQ (depth 31/32)
ata3.00: configured for UDMA/133
ata3: EH complete
scsi 2:0:0:0: Direct-Access     ATA      ST31000333AS     CC1F PQ: 0 ANSI: 5
sd 2:0:0:0: [sdd] 1953525168 512-byte hardware sectors (1000205 MB)
sd 2:0:0:0: [sdd] Write Protect is off
sd 2:0:0:0: [sdd] Mode Sense: 00 3a 00 00
sd 2:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
sd 2:0:0:0: [sdd] 1953525168 512-byte hardware sectors (1000205 MB)
sd 2:0:0:0: [sdd] Write Protect is off
sd 2:0:0:0: [sdd] Mode Sense: 00 3a 00 00
sd 2:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sdd: unknown partition table
sd 2:0:0:0: [sdd] Attached SCSI disk
sd 2:0:0:0: Attached scsi generic sg3 type 0

I read somewhere but haven't confirmed that you can manually do the partition re-read like this (supposedly this works even if partprobe doesn't do the job):

echo 1 > /sys/block/sdc/device/rescan

 

 


Tags:

linux, ahci, hotswap, reread, partition, rebootingfrom, quot, parted, partprobe, rebooting, motherboards, reboot, os, reload, partiton, detect, eg, format, initialize, ll, errors, mdadm, dev, md, raid, devices, sdd, suitable, array, didn, enabled, consumer, motherboard, scsi, arrays, ata, exception, emask, sact, serr, xa, irq_stat, serror, phyrdychg, commwake, devexch, resetting, sata, gbps, sstatus, scontrol, cc, udma, sectors, multi, lba, ncq, depth, configured, pq, ansi, byte, hardware, mb, mode, cache, doesn, dpo, fua, disk, generic, sg, haven, manually, echo, sys, sdc, rescan,

Latest Articles

  • python 3 pip cannot install mysql module
  • QEMU-KVM won't boot Windows 2016 or 2019 server on an Intel Core i3
  • Virtualbox vbox not starting "No suitable module for running kernel found"
  • Bind / named not responding to queries solution
  • Linux Mint How To Set Desktop Background Image From Bash Prompt CLI
  • ImageMagick Convert PDF Not Authorized
  • ImageMagick Converted PDF to JPEG some files have a black background solution
  • Linux Mint Mate Customize the Lock screen messages and hide username and real name
  • Ubuntu/Gnome/Mint/Centos How To Take a partial screenshot
  • ssh how to verify your host key / avoid MIM attacks
  • Cisco IP Phone CP-8845 8800/8900 Series How To Reset To Factory Settings Instructions
  • ls how to list ONLY directories
  • How to encrypt your SSH private key file id_rsa
  • Linux Mint 18 Disable User Name List from showing on Login Screen
  • Firefox Cannot Hit Enter Key In Address Bar and Location History Not Working
  • Cisco Unified Communications Manager / CUCM IP 8.6,10,12 Install Error Solution
  • Ubuntu Debian Mint Linux SSHD OpenSSH Server Not Starting After Reboot Solution
  • nmap how to scan for all ports and not just the 1000 most common ports
  • Windows 7,8,10 and Server 2008, 2012, 2016, 2019 Read Only Attribute Won't Go Away
  • bind / named how to make a wildcard record and retain defined A records