Solved

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

Posted on 2013-12-18
11
375 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
  • 4
  • 4
  • 2
  • +1
11 Comments
 
LVL 118
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 118
ID: 39726578
ls -al (list contents)

cd - (change directory)
0
 
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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

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 118
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 118

Accepted Solution

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

'/dev/sdb1 is mounted as /store
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article will show you how to create an ISO CD-ROM/DVD-ROM image (*.iso), and MD5 checksum signature, for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5). It's a good idea to compare checksums, because many installations fail because of a corr…
In this article, I show you step by step with screenshots to assist you - HOW TO: Deploy and Install the VMware vCenter Server Appliance 6.5 (VCSA 6.5), with some helpful tips along the way.
Teach the user how to configure vSphere clusters to support the VMware FT feature Open vSphere Web Client: Verify vSphere HA is enabled: Verify netowrking for vMotion and FT Logging is in place or create it: Turn On FT for a virtual machine: Verify …
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

920 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now