Solved

How do I see the contents of a drive in Debian command line?

Posted on 2013-12-18
11
378 Views
Last Modified: 2013-12-18
I want to see what is on a drive so I can satisfy myself that it can be disconnected (unmounted?).
This is a vm on ESXi with 3 datastores - first is the ESXi local storage, second is a nfs share on a NAS drive (that I want to remove), third is another nfs share on a 2nd NAS drive.
I have found that the Debian vm will run fine with the 1st NAS drive disconnected from the network, but will not reboot in that state.
I assume I need to unmount the drive concerned then remove datastore2 from the ESXi server. However I don't want to do this to find I have to retrace my steps. I expect to find that datastore2 contains nothing but redundant data that was copied to datastore3 when it was added, but I would like to be able to 'browse' it first.
Cheers, Gordon
0
Comment
Question by:tangerine27
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 2
  • +1
11 Comments
 
LVL 120
ID: 39726423
You want to check the VMFS ESXi host datastore?

Select the datastore, right click and select browse?

see Step 2 in my EE Article

HOW TO: Clone or Copy a virtual machine in VMware vSphere Hypervisor ESX/ESXi 4.x or ESXi 5.0
0
 

Author Comment

by:tangerine27
ID: 39726535
No. That just shows a folder containing 2 vmdk files. I want to browse the files from within the Debian vm. I simply do not know how to do this. If it was a windows vm I would open the 'e' drive and have a look. How do i do that from the command line in Debian?
0
 
LVL 120
ID: 39726578
ls -al (list contents)

cd - (change directory)
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 31

Expert Comment

by:farzanj
ID: 39726579
ls    (LS for list)
0
 
LVL 8

Expert Comment

by:Surrano
ID: 39726640
Are you referring to a virtual disk that is mounted in a Debian VM?
"mount" will tell you what volumes are mounted
"df -h" will tell you the allocation of the volumes
"ls -l /path/to/my/dir" tells you the contents of a directory (including mounts)

Are you interested in checking vmdk contents from outside the vm where it belongs to? (I assume not -- makes no sense if question is whether you can unmount)
Try VDDK: https://www.vmware.com/support/developer/vddk/
0
 

Author Comment

by:tangerine27
ID: 39726642
OK I think we are getting to the nub of the problem.

I don't know how to 'get to' the right drive so that I can run the ls -al command in the right place.

I have run df -h and can see the result is the filesystem. I can see:

Filesystem /dev/sdb1 mounted on /store
Filesystem /dev/sdc1 mounted on /store2

I want to list/browse the first one as this is the one I want to remove.
0
 
LVL 120
ID: 39726704
okay, can you change to the folder /store

using cd /store
0
 

Author Comment

by:tangerine27
ID: 39726712
Thanks. So is the folder 'store' the same as the drive '/dev/sdb1' i.e. by definition the only content of drive '/dev/sdb1' is the folder 'store' and its contents?
0
 
LVL 31

Expert Comment

by:farzanj
ID: 39726727
Issue this command

mount


This will show you which device (dev) is mounted to with folder (mount point).


Unlike Windows, in Linux you have all the devices under the same tree / (slash).  Any device, like drive, etc. has to mount under the same /
0
 

Author Comment

by:tangerine27
ID: 39726799
I already got that information by using the command df -h and posted above.
Can someone tell me if my previous comment is correct?

So is the folder 'store' the same as the drive '/dev/sdb1' i.e. by definition the only content of drive '/dev/sdb1' is the folder 'store' and its contents?

If it is then I can simply look at the content of the folder 'store' and see the entire content of drive 'sdb1'.
0
 
LVL 120

Accepted Solution

by:
Andrew Hancock (VMware vExpert / EE MVE^2) earned 500 total points
ID: 39726810
Yes, that's correct.

'/dev/sdb1 is mounted as /store
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Windows 10 linux VM 30 92
Migrating C:\ only in a VM to another VMDK disk ? 8 143
increase vmfs datastore 4 70
How to change ESXi 6.5 NIC E1000 to vmxnet3 9 90
HOW TO: Connect to the VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere (HTML5 Web) Host Client 6.5, and perform a simple configuration task of adding a new VMFS 6 datastore.
In this article we will learn how to backup a VMware farm using Nakivo Backup & Replication. In this tutorial we will install the software on a Windows 2012 R2 Server.
Teach the user how to install and configure the vCenter Orchestrator virtual appliance Open vSphere Web Client: Deploy vCenter Orchestrator virtual appliance OVA file: Verify vCenter Orchestrator virtual appliance boots successfully: Connect to the …
Advanced tutorial on how to run the esxtop command to capture a batch file in csv format in order to export the file and use it for performance analysis. He demonstrates how to download the file using a vSphere web client (or vSphere client) and exp…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question