Solved

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

Posted on 2013-12-18
11
374 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 117
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 117
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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

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

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

This is an issue that we can get adding / removing permissions in the vCSA 6.0. We can also have issues searching for users / groups in the AD (using your identify sources). This is how one of the ways to handle this issues and fix it.
Last article we focus in how to VMware: How to create and use VMs TAGs – Part 1 so before follow this article and perform the next tasks, you should read the first article how to create the TAG before using them in Veeam Backup Jobs.
Teach the user how to rename, unmount, delete and upgrade VMFS datastores. Open vSphere Web Client: Rename VMFS and NFS datastores: Upgrade VMFS-3 volume to VMFS-5: Unmount VMFS datastore: Delete a VMFS datastore:
Teach the user how to use configure the vCenter Server storage filters Open vSphere Web Client:  Navigate to vCenter Server Advanced Settings: Add the four vCenter Server storage filters: Review the advanced settings: Modify the values of the four v…

705 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

18 Experts available now in Live!

Get 1:1 Help Now