LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Mnt folder (https://www.linuxquestions.org/questions/linux-general-1/mnt-folder-485940/)

Gins 09-22-2006 05:01 AM

Mnt folder
 
[nissanka@c83-250-110-112 ~]$ su root
Password:
[root@c83-250-110-112 nissanka]# cd /mnt
[root@c83-250-110-112 mnt]# ls
cdrom/ floppy/ win_c/ win_d/
[root@c83-250-110-112 mnt]# cd cdrom
[root@c83-250-110-112 cdrom]# ls
[root@c83-250-110-112 cdrom]#


I just burnt or rather copied some files using the CD burner.

The ls command doesn't show the files inside the CD.

What the heck is this?
How can I read the files there?
Your help is appreciated.
------------------------------------------------------------
Here win_c means the windows side of my computer. When the computer starts I could go select Windows XP.It works beautifully.

[root@c83-250-110-112 mnt]# cd win_c
[root@c83-250-110-112 win_c]# ls
acrocrashlog.html* CONFIG.SYS* hpfr5600.log* NTDETECT.COM* Program Files/
AUTOEXEC.BAT* cygwin/ IO.SYS* ntldr* RECYCLER/
boot.ini* Documents and Settings/ Kpcms/ pagefile.sys* System Volume Information/
Compression Tools AIO/ hiberfil.sys* MSDOS.SYS* PGP/ WINDOWS/
[root@c83-250-110-112 win_c]#

Nylex 09-22-2006 05:18 AM

You need to mount the CD.

Nathanael 09-22-2006 05:21 AM

either your cd drive is not mounted or it is mounted to another location (/media/cdrom has become somewhat common on some distros)

as i am unfamiliar with mandrake i could not tell you where your cd drive usually should be mounted to.

but if you run 'mount' the commands output will give you enough info
in this output you will also see if the cd drive is mounted at all

if not mounted run 'mount /dev/cdrom' or 'mount /dev/cdrom /mnt/cdrom'
that should do the trick

win_c will also me mentioned in the output of 'mount'
as if the partition was not mounted, /mnt/win_c would be an empty directory just lik /mnt/cdrom

EDIT: 3 mins too slow :-P

Gins 09-22-2006 05:21 AM

Thanks Nylex

Then I don't have to mount the Windows side to read the files there.

Nylex 09-22-2006 05:24 AM

Your Windows partition is most likely automatically mounted at boot time, because that's what's specified in your /etc/fstab.

Gins 09-22-2006 05:37 AM

Thanks Nylex and Nathan for the replies.

Why didn't following work?

[nissanka@c83-250-110-112 ~]$ su root
Password:
[root@c83-250-110-112 nissanka]# #mount /dev/hda -t iso9660 -r /cdrom
[root@c83-250-110-112 nissanka]# cd /mnt
[root@c83-250-110-112 mnt]# ls
cdrom/ floppy/ win_c/ win_d/
[root@c83-250-110-112 mnt]# cd cdrom
[root@c83-250-110-112 cdrom]# ls
[root@c83-250-110-112 cdrom]#

----------------------------
It accepted the mount command; however it was hollow.


---------------------------

[root@c83-250-110-112 cdrom]# mount /dev/cdrom /mnt/cdrom
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@c83-250-110-112 cdrom]# ls
[root@c83-250-110-112 cdrom]#


What does the above implie?

Nylex 09-22-2006 05:40 AM

You mounted to /cdrom and not /mnt/cdrom.

Gins 09-22-2006 05:44 AM

When it mounts read-only, you should be able to read the files. I mean the ls command should work and I should be able to copy files too.

Gins 09-22-2006 06:03 AM

I badly need your help. I want to read and copy some files from the CD I burnt.

Nathanael 09-22-2006 06:11 AM

run
Code:

umount /dev/hda
mount -t iso9660 /dev/hda /mnt/cdrom

that is if you are sure /dev/hda is your cd drive...
often /dev/cdrom is mapped to the device of your cd drive...

Gins 09-22-2006 06:54 AM

Thanks Nathan

I rebooted the computer and tried the command you suggested.

----------------------------------------
[nissanka@c83-250-110-112 ~]$ su root
Password:
[root@c83-250-110-112 nissanka]# mount -t iso9660 /dev/hda /mnt/cdrom
mount: /dev/hda already mounted or /mnt/cdrom busy
[root@c83-250-110-112 nissanka]# cd /mnt
[root@c83-250-110-112 mnt]# ls
cdrom/ floppy/ win_c/ win_d/
[root@c83-250-110-112 mnt]# cd cdrom
[root@c83-250-110-112 cdrom]# ls
[root@c83-250-110-112 cdrom]#
----------------------------------------------

What the heck is this?

Nathanael 09-22-2006 07:10 AM

ok - just post the output of 'sfdisk -l' 'mount' and 'cat /etc/fstab'

and please note my sig.

Gins 09-22-2006 07:48 AM

Thanks Nathanael



[root@c83-250-110-112 nissanka]# sfdisk -l

Disk /dev/hda: 24321 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End #cyls #blocks Id System
/dev/hda1 * 0+ 4560 4561- 36636201 7 HPFS/NTFS
/dev/hda2 4561 24320 19760 158722200 f W95 Ext'd (LBA)
start: (c,h,s) expected (1023,254,63) found (1023,0,1)
/dev/hda3 0 - 0 0 0 Empty
/dev/hda4 0 - 0 0 0 Empty
/dev/hda5 4561+ 14263 9703- 77939316 b W95 FAT32
start: (c,h,s) expected (1023,254,63) found (1023,1,1)
/dev/hda6 14264+ 24128 9865- 79240581 83 Linux
start: (c,h,s) expected (1023,254,63) found (1023,1,1)
/dev/hda7 24129+ 24320 192- 1542208+ 82 Linux swap / Solaris
start: (c,h,s) expected (1023,254,63) found (1023,1,1)
[root@c83-250-110-112 nissanka]#

-------------------------------------------------------


[root@c83-250-110-112 nissanka]# mount
/dev/hda6 on / type ext2 (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /mnt/floppy type supermount (rw,sync,dev=/dev/fd0,fs=ext2:vfat,--)
/dev/hda1 on /mnt/win_c type ntfs (ro,umask=0,nls=iso8859-1)
/dev/hda5 on /mnt/win_d type vfat (rw,umask=0,iocharset=iso8859-1,codepage=850)
none on /proc/bus/usb type usbfs (rw,devmode=0664,devgid=43)
[root@c83-250-110-112 nissanka]#

--------------------------------------------


[root@c83-250-110-112 nissanka]# cat /etc/fstab
# This file is edited by fstab-sync - see 'man fstab-sync' for details
/dev/hda6 / ext2 defaults 1 1
/dev/hdc /mnt/cdrom auto umask=0,user,iocharset=iso8859-1,codepage=850,noauto,ro,exec,users 0 0
none /mnt/floppy supermount dev=/dev/fd0,fs=ext2:vfat,--,umask=0,iocharset=iso8859-1,sync,codepage=850 0 0
/dev/hda1 /mnt/win_c ntfs umask=0,nls=iso8859-1,ro 0 0
/dev/hda5 /mnt/win_d vfat umask=0,iocharset=iso8859-1,codepage=850 0 0
none /proc proc defaults 0 0
/dev/hda7 swap swap defaults 0 0
[root@c83-250-110-112 nissanka]#

Nylex 09-22-2006 07:51 AM

Your CD drive appears to be /dev/hdc and not /dev/hda, so you should be trying to mount /dev/hdc instead. Does /dev/cdrom point to /dev/hdc?

Gins 09-22-2006 08:08 AM

Thanks Nylex
Now it works.
----------------------------
[root@c83-250-110-112 nissanka]# mount -t iso9660 /dev/hdc /mnt/cdrom
mount: block device /dev/hdc is write-protected, mounting read-only
[root@c83-250-110-112 nissanka]# cd /mnt
[root@c83-250-110-112 mnt]# ls
cdrom/ floppy/ win_c/ win_d/
[root@c83-250-110-112 mnt]# cd cdrom
[root@c83-250-110-112 cdrom]#
----------------------------------


[root@c83-250-110-112 mnt]# cd cdrom
[root@c83-250-110-112 cdrom]# ls
Anantayata Yana.mpg
remove1~

anduru reye.DAT
remove11.html~~

antecedent
remove122.html

Anton_Jones_Ratin_Ratata.zip
remove122.html~

Anton Paulovich Chekov(1)
remove2

argument1*
remove2~
argument1~*
remove3.html
argument2*

Gins 09-22-2006 08:11 AM

What is umount command for me? Just ' umount cdrom ' won't work, I think.

What is the correct command for me to mount my USB?
Do I have to mount it too? I mean to save a file on the USB.

Nylex 09-22-2006 09:51 AM

You use "umount /dev/cdrom", "umount /dev/hdc" (assuming /dev/cdrom points to /dev/hdc) or "umount /mnt/cdrom" (assuming that's where you mounted to).

You do need to mount your USB device to be able to write to it. What does dmesg say when you plug it in?

Nathanael 09-22-2006 12:03 PM

suggestion: read mount's man page

you do this by running 'man mount'

Gins 09-22-2006 12:56 PM

I thank both of you for the valuble comments.

------------------------------------




[root@c83-250-110-112 cdrom]# umount /mnt/cdrom
umount: /mnt/cdrom: device is busy
umount: /mnt/cdrom: device is busy
[root@c83-250-110-112 cdrom]# umount /dev/cdrom
umount: /mnt/cdrom: device is busy
umount: /mnt/cdrom: device is busy
[root@c83-250-110-112 cdrom]# umount /dev/hdc
umount: /mnt/cdrom: device is busy
umount: /mnt/cdrom: device is busy
[root@c83-250-110-112 cdrom]#
------------------------------------------

What would be the reason that none of the commands worked?

Nylex 09-22-2006 12:57 PM

You're "in" the directory. If you cd to another directory, you'll be able to unmount.

michaelk 09-22-2006 01:01 PM

Quote:

root@c83-250-110-112 cdrom
You can not unmount a filesystem when its being accessed by an application. When the current working directory is /mnt/cdrom your still accessing the filesystem and therefore the 'device is busy' error message.

Gins 09-22-2006 01:10 PM

Thanks michaelk

I got your point.
So I just went back one step and wrote the command ' umount /dev/hdc '.

It worked.

If you don't unmount,what would be the consquences?'

I can shut down the computer as usual without unmounting.

Gins 09-22-2006 01:26 PM

Nylex
The dmesg command gave me a long list.
What are you interested in?
The some of them are as follows:

-------------------------

Bootdata ok (command line is auto BOOT_IMAGE=linux root=306 resume=/dev/hda7 splash=silent)
Linux version 2.6.12-12mdk (gb@ramanujan.mandriva.com) (gcc version 4.0.1 (4.0.1-5mdk for Mandriva Linux release 2006.0)) #1 Fri Sep 9 17:26:56 CEST 2005
BIOS-provided physical RAM map:
BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
BIOS-e820: 00000000000e8000 - 0000000000100000 (reserved)
BIOS-e820: 0000000000100000 - 000000003ffb0000 (usable)
BIOS-e820: 000000003ffb0000 - 000000003ffc0000 (ACPI data)
BIOS-e820: 000000003ffc0000 - 000000003fff0000 (ACPI NVS)
BIOS-e820: 000000003fff0000 - 0000000040000000 (reserved)
BIOS-e820: 00000000ff7c0000 - 0000000100000000 (reserved)
ACPI: RSDP (v000 ACPIAM ) @ 0x00000000000f98b0
ACPI: RSDT (v001 A M I OEMRSDT 0x08000530 MSFT 0x00000097) @ 0x000000003ffb0000
ACPI: FADT (v001 A M I OEMFACP 0x08000530 MSFT 0x00000097) @ 0x000000003ffb0200
ACPI: MADT (v001 A M I OEMAPIC 0x08000530 MSFT 0x00000097) @ 0x000000003ffb0390
ACPI: OEMB (v001 A M I AMI_OEM 0x08000530 MSFT 0x00000097) @ 0x000000003ffc0040
ACPI: DSDT (v001 K8CBZ K8CBZ231 0x00000231 INTL 0x02002026) @ 0x0000000000000000
On node 0 totalpages: 261967
DMA zone: 3999 pages, LIFO batch:1
Normal zone: 257968 pages, LIFO batch:31
HighMem zone: 0 pages, LIFO batch:1
ACPI: PM-Timer IO Port: 0x808
ACPI: Local APIC address 0xfee00000

Nylex 09-22-2006 01:29 PM

The end of dmesg is the important bit, all the stuff that talks about USB.

Gins 09-22-2006 01:31 PM

The ' fdisk -l ' command is intersting.


[root@c83-250-110-112 nissanka]# fdisk -l

Disk /dev/hda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 4561 36636201 7 HPFS/NTFS
/dev/hda2 4562 24321 158722200 f W95 Ext'd (LBA)
/dev/hda5 4562 14264 77939316 b W95 FAT32
/dev/hda6 14265 24129 79240581 83 Linux
/dev/hda7 24130 24321 1542208+ 82 Linux swap / Solaris

Disk /dev/sda: 1031 MB, 1031798784 bytes
16 heads, 32 sectors/track, 3936 cylinders
Units = cylinders of 512 * 512 = 262144 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 3936 1007600 e W95 FAT16 (LBA)
[root@c83-250-110-112 nissanka]#

Nylex 09-22-2006 01:33 PM

/dev/sda1 is what you need to mount. You don't need to worry about dmesg now.

Gins 09-22-2006 01:42 PM

Nathanael wants me to read the man pages on mount.
That is an uninteresting bunch of details.

The man pages are written in the best unsuitable language for people who wants to learn. I just looked at the man pages on mount. I can't read them.
--------------------------------------------------------------------
All right, what would be the command to mount and unmount the USB?

Gins 09-22-2006 01:44 PM

Here is the end portion of the 'dmesg' .

-------------------------------------------

ID=8 DF PROTO=UDP SPT=5353 DPT=5353 LEN=98
Neighbour table overflow.
Shorewall:net2all:DROP:IN=eth1 OUT= MAC= SRC=83.250.110.112 DST=224.0.0.251 LEN=118 TOS=0x00 PREC=0x00 TTL=255 ID=9 DF PROTO=UDP SPT=5353 DPT=5353 LEN=98
Shorewall:net2all:DROP:IN=eth1 OUT= MAC=00:10:4b:45:5c:12:00:0f:34:7b:dd:63:08:00 SRC=203.222.120.111 DST=83.250.110.112 LEN=513 TOS=0x00 PREC=0x00 TTL=55 ID=57393 PROTO=UDP SPT=31258 DPT=1026 LEN=493
usb 4-8: new high speed USB device using ehci_hcd and address 4
Initializing USB Mass Storage driver...
scsi2 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 4
usb-storage: waiting for device to settle before scanning
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
Vendor: Kingston Model: DataTraveler 2.0 Rev: PMAP
Type: Direct-Access ANSI SCSI revision: 00
SCSI device sda: 2015232 512-byte hdwr sectors (1032 MB)
sda: Write Protect is off
sda: Mode Sense: 23 00 00 00
sda: assuming drive cache: write through
SCSI device sda: 2015232 512-byte hdwr sectors (1032 MB)
sda: Write Protect is off
sda: Mode Sense: 23 00 00 00
sda: assuming drive cache: write through
/dev/scsi/host2/bus0/target0/lun0: p1
Attached scsi removable disk sda at scsi2, channel 0, id 0, lun 0
usb-storage: device scan complete
Shorewall:net2all:DROP:IN=eth1 OUT= MAC= SRC=83.250.110.112 DST=224.0.0.251 LEN=118 TOS=0x00 PREC=0x00 TTL=255 ID=10 DF PROTO=UDP SPT=5353 DPT=5353 LEN=98
Shorewall:net2all:DROP:IN=eth1 OUT= MAC= SRC=83.250.110.112 DST=83.250.111.255 LEN=44 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=32793 DPT=7741 LEN=24
Neighbour table overflow.
Neighbour table overflow.
Neighbour table overflow.
Neighbour table overflow.
Neighbour table overflow.
Neighbour table overflow.
Neighbour table overflow.
Neighbour table overflow.
Neighbour table overflow.
Neighbour table overflow.
Shorewall:net2all:DROP:IN=eth1 OUT= MAC=00:10:4b:45:5c:12:00:0f:34:7b:dd:63:08:00 SRC=64.26.31.126 DST=83.250.110.112 LEN=404 TOS=0x00 PREC=0x00 TTL=114 ID=21286 PROTO=UDP SPT=2644 DPT=1434 LEN=384
Shorewall:net2all:DROP:IN=eth1 OUT= MAC= SRC=83.250.110.112 DST=83.250.111.255 LEN=44 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=32806 DPT=7741 LEN=24
printk: 3064 messages suppressed.
Neighbour table overflow.
Neighbour table overflow.
Neighbour table overflow.
Neighbour table overflow.
Neighbour table overflow.
Neighbour table overflow.
Neighbour table overflow.
Neighbour table overflow.
Neighbour table overflow.
Neighbour table overflow.
[root@c83-250-110-112 nissanka]#

michaelk 09-22-2006 01:44 PM

The shutdown process automatically unmounts all filesystems.

The CD drive is locked so you can not remove the disk until you umount. A filesystem read/write buffers are cached by default so for example if a floppy or usb disk was not unmounted prior to ejecting then its data will be corrupted. If another floppy disk was inserted and data written to it or a umount command was executed then its filesystem will be corrupted too.

Nylex 09-22-2006 01:46 PM

You mount your USB device the same way you'd mount anything else, e.g.

# mount /dev/sda1 /mnt/usb.

Obviously /mnt/usb has to exist before you use it. If mount asks you to specify the filesystem type, you use mount's -t option. I think you use vfat for FAT16 partitions:

# mount /dev/sda1 /mnt/usb -t vfat.

You don't have to use /mnt/usb, of course. Use whatever directory you like. Also be aware that mount has other options you can use as well.

Gins 09-22-2006 01:54 PM

I inserted the USB pin and looked for it. Please read the following:


[nissanka@c83-250-110-112 ~]$ cd /mnt
[nissanka@c83-250-110-112 mnt]$ ls
cdrom/
floppy/
KINGSTON/ '
win_c/
win_d/
[nissanka@c83-250-110-112 mnt]$
---------------------------------------------------------------

The ' KINGSTON ' means the USB pin. In fact, I bought a Kingston memory module.

I just open the word processor and wrote a few sentences and saved in the following manner.

/mnt/KINGSTON/Rotten1001.doc

It worked fine. I could save the file.

So it is not necssary to mount your USB memory when you want to save a document/letter.
Is it always the case? Please tell me.

Gins 09-22-2006 02:03 PM

The following didn't work. Why is it?

---------------------------------------
[root@c83-250-110-112 nissanka]# mount /dev/sda1 /mnt/KINGSTON
mount: /dev/sda1 already mounted or /mnt/KINGSTON busy
mount: according to mtab, /dev/sda1 is already mounted on /mnt/KINGSTON
[root@c83-250-110-112 nissanka]#

Gins 09-22-2006 02:05 PM

I need your help.
Let us say I have a tarball on my system and I want to save it on the USB.

How do I do it?

Nylex 09-22-2006 02:33 PM

As the message tells you, /dev/sda1 is mounted on /mnt/KINGSTON. You don't need to mount the device, since it's already mounted. Just do your reading/writing and then unmount the device before unplugging it (see michaelk's post earlier on about why).

Edit: you can just copy your tarball to /mnt/KINGSTON, e.g. "cp filename.tar.gz /mnt/KINGSTON".

Nathanael 09-22-2006 03:44 PM

i want you to read and learn how to understand man pages so that you can do that whenever you have trouble with other commands...
Quote:

Originally Posted by Gins
[root@c83-250-110-112 cdrom]# umount /mnt/cdrom
umount: /mnt/cdrom: device is busy
umount: /mnt/cdrom: device is busy
[root@c83-250-110-112 cdrom]# umount /dev/cdrom
umount: /mnt/cdrom: device is busy
umount: /mnt/cdrom: device is busy
[root@c83-250-110-112 cdrom]# umount /dev/hdc
umount: /mnt/cdrom: device is busy
umount: /mnt/cdrom: device is busy
[root@c83-250-110-112 cdrom]#
------------------------------------------

What would be the reason that none of the commands worked?

the reason is stated below the command issued: device busy!
all you need to do is read what the app is telling you and in this case it is a pretty simple message ... busy... like calling a phone number and it is 'busy' - it is in use!!

further more the man pages also help to understand how to use a command (e.g. what -t stands for, what you can specify with -t, other options you may need to set, etc, etc)

man pages are setup quite simply, you have different sections talking about different things:
[NAME] name of the command and a brief description
[SYNOPSIS] overview of how to use the command (e.g. in which order parameters need to be passed)
BTW parameters are also called arguments. in your mount command 'mount /dev/cdrom /mnt/cdrom' the arguments would be /dev/cdrom and /mnt/cdrom - basically everything that follows the actual name of the command (though there are exeptions but i will not explain that now)

continuing on the man page layout:
[DESCRIPTION] an into depth description of the command, explaining all you will ever need to know (at this stage)
[OPTIONS] detaild usage of the arguments you may need or have to use and how to use them (ie. -t)
[FILES] this section give you a list of files (inc full path) and what they are for - in correspondance with the actual command (i.e. /etc/fstab - dont muck around with this file as you might 'break' you sys - muck means opening in write mode :-))
[SEE ALSO] other man pages that might contain more information if you still have no answer to you question

[BUGS] problems, notes, etc

there may be a few more sections but these are the basics and usually always available
and nearly always in that same order


so - if you do not know what a command does - you can simply check the man page (man <command>) and read what it says in the NAME section (at the top of the man page)
if you know what the command does and you know you want to use it, just dont know exactly how to and or if you need to for example tell mount that the mounted filesystem should be read only the OPTIONS section is what you want to take a quike look at
you only read what you currently need and if you know you need to use a command but have absolutley know clue whatsoever on how to use it and why and i-dont-know-what, the DESCRIPTION section most certainly is for you - in the case (mount) it is also your section

i hope this give you a good start for reading man pages - assuming you dont mind reading this post and assuming this post is not too much to read

Nathanael 09-22-2006 03:48 PM

Quote:

Originally Posted by Gins
The following didn't work. Why is it?

---------------------------------------
[root@c83-250-110-112 nissanka]# mount /dev/sda1 /mnt/KINGSTON
mount: /dev/sda1 already mounted or /mnt/KINGSTON busy
mount: according to mtab, /dev/sda1 is already mounted on /mnt/KINGSTON
[root@c83-250-110-112 nissanka]#


read the f...... comments underneath the command you issued!
appologies if this should seem a little unpatient - but you do need to read what a program is telling you - in this case it is telling you
Code:

mount: /dev/sda1 already mounted or /mnt/KINGSTON busy
mount: according to mtab, /dev/sda1 is already mounted on /mnt/KINGSTON

learn following: output on your terminal which is not what you have typed is usually about a command or programm giving you information to let you know something as or has not happend - in this case mount is letting you know '/dev/sda1 already mounted'
wow - would you have guessed

Gins 09-23-2006 12:12 PM

It was my understanding that Mandriva is a distro of Linux which is not necessary to mount your CD Rom drive.

I think they market Mandriva by telling it is not necssary to mount your CD.


1. The Windows side of the computer mount by default.

2. The USB pin doesn't need any mounting.

3. The CD Rom needs mounting.

I can't understand the discrepancy among the above.


All times are GMT -5. The time now is 10:06 PM.