DEV Community

Cover image for Detached EBS volume from your local Linux system.
Md Abu Musa
Md Abu Musa

Posted on

Detached EBS volume from your local Linux system.

To safely remove the detached EBS volume from your local Linux system, follow these steps:


Step 1: Unmount the Volume

First, ensure the volume is unmounted to prevent any data corruption or access conflicts.

umount /new_directory
Enter fullscreen mode Exit fullscreen mode
  • umount: Unmounts the filesystem from the specified directory.
  • /new_directory: Replace with the actual mount point used for the volume.

Step 2: Verify the Volume is Unmounted

Run the following commands to confirm the volume is no longer in use:

Check Mounted Filesystems:

df -hT
Enter fullscreen mode Exit fullscreen mode

The detached volume's mount point (/new_directory) should no longer appear in the output.

Check Block Devices:

lsblk
Enter fullscreen mode Exit fullscreen mode

Ensure the detached volume (/dev/xvdb, for example) is no longer listed.


Step 3: Remove the Mount Directory (Optional)

If you no longer need the directory used for mounting the volume, you can delete it:

rmdir /new_directory
Enter fullscreen mode Exit fullscreen mode
  • rmdir: Removes an empty directory.

Step 4: Clean Up Filesystem Entries (If Applicable)

If the volume was previously added to the /etc/fstab file for automatic mounting, remove the corresponding entry to prevent errors during boot:

  1. Open the /etc/fstab file:
   nano /etc/fstab
Enter fullscreen mode Exit fullscreen mode
  1. Locate and remove the line related to the detached volume.

  2. Save and exit (Ctrl+O, Enter, Ctrl+X).


Step 5: Verify Cleanup

Reboot the system or manually check to ensure no traces of the detached volume remain.


These steps ensure the EBS volume is safely and completely removed from your local Linux system after detaching it from AWS.

Image of AssemblyAI

Automatic Speech Recognition with AssemblyAI

Experience near-human accuracy, low-latency performance, and advanced Speech AI capabilities with AssemblyAI's Speech-to-Text API. Sign up today and get $50 in API credit. No credit card required.

Try the API

Top comments (0)

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay