Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using Arch linux. I have a sata HDD that i use as storage disk. It's always off until i need it. Then i plug it into (running) computer and with Windows 7 it's easy - i just go to the "Management" and "Rescan disks" -> voila! My disk is ready for use.

Is there a (simple) way to do something like that in Arch? To just plug my sata hdd whenever i need it, run some simple program that will detect my disk and later just unmount it and unplug it without ever reseting / logout?


share|improve this question
up vote 2 down vote accepted

In Linux, SATA disks should be detected automatically, without having to rescan them explicitly – check the kernel log in dmesg for details.

When the disk is detected, use mount and umount, or their GUI alternatives (such as GNOME Disk Utility), to mount the filesystems contained in that disk.

If necessary, you could try triggerring a manual rescan of SCSI & SATA devices with:

echo "0 0 0" | tee /sys/class/scsi_host/host*/scan

Check the Linux ATA pages Driver status and Hardware features if something does not work.

Make sure your SATA controller is actually running in AHCI mode instead of "IDE compatibility".

Also make sure you are running the same kernel as is installed. If you install a newer kernel but forget to reboot, the old kernel will be unable to load new modules if they become necessary.

share|improve this answer
No, my disk is not automatically recognized (not even by Gnome disk utility). When i try to execute above cmd i get "tee: /sys/class/scsi_host/host0/scan: Permission denied" even if i run it as root... :\ I don't even see new "sdc" (i allready have sda and sdb) device in my /dev folder! – guest86 Aug 30 '12 at 18:36
.....Are you running sudo echo or sudo tee? There's a difference. – grawity Aug 30 '12 at 19:00
Dear God! I did it like a noob! :S Yeah, "sudo tee" did it :))) Thank you! :) – guest86 Aug 30 '12 at 19:11

Linux has the mount and umount commands which are used to make a filesystem available to the OS then gracefully disconnect the filesystem when you're done.

EDIT: Be sure to umount the device when you're done with it. If you don't data corruption is possible because the OS maybe in the middle of updating the filesystem and not complete the write before disconnecting.

share|improve this answer
I can't mount it because when i plug it in it's not even listed in "/dev" folder... Like never happened. After plugin "dmesg" is unchanged. – guest86 Aug 30 '12 at 18:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .