Using a Laptop Drive as a Huge USB Thumb Drive

huge-thumbIf you have an old laptop with a decent size spinning disk, you can pick yourself up a USB hard drive enclosure for under $10, remove the laptop drive, stick it in the enclosure, and use it to transfer large amounts of data (e.g. your mp3 collection) between computers quickly and easily. Once you get the drive formatted properly, it will act like a really large thumb drive.

Using Linux, it’s fairly easy to prepare the drive:

  1. Plug it in to a USB port
  2. Run dmesg and look for the device name in the log. For example, on my machine, the first USB drive is mounted as /dev/sdb1
  3. Unmount the partition. E.g.: sudo umount /dev/sdb1
  4. Run fdisk on the master device: sudo fdisk /dev/sdb
    • Note that the 1 is intentionally omitted
  5. Issue the p command to see the existing partitions on the drive
  6. If you are sure there’s nothing you need on any of the partitions, you can delete them all by running the d command repeatedly
  7. Create a new partition with the a command, and give it the entire disk
  8. Write the new partition table and exit fdisk with the w command
  9. Create an NTFS file system on the drive: sudo mkfs.ntfs -f /dev/sdb1
    • Note that you can use ext3 if you don’t need to use the drive from Windows

You can verify the size of the drive by mounting it:

  1. Create a mount point directory. E.g.: sudo mkdir /media/disk
  2. Mount the drive: sudo mount /dev/sdb1 /media/disk
  3. Run: df -h
  4. Unmount the drive when done: sudo umount /dev/sdb1

The output of df -h will look something like this:

Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb1       150G   70M  149G   1% /media/disk

About jimbelton

I'm a software developer, and a writer of both fiction and non-fiction, and I blog about movies, books, and philosophy. My interest in religious philosophy and the search for the truth inspires much of my writing.
This entry was posted in systems administration and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s