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. |
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? |
suggestion: read mount's man page
you do this by running 'man mount' |
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? |
You're "in" the directory. If you cd to another directory, you'll be able to unmount.
|
Quote:
|
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. |
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 |
The end of dmesg is the important bit, all the stuff that talks about USB.
|
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]# |
/dev/sda1 is what you need to mount. You don't need to worry about dmesg now.
|
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? |
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]# |
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. |
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. |
All times are GMT -5. The time now is 11:47 PM. |