LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-09-2007, 05:39 AM   #1
ic_torres
Member
 
Registered: Nov 2005
Location: ABAP
Distribution: slackware 12.0, Vector Linux STD 6.0 and 5.8, ZenWalk 4.6.1, OpenBSD 3.9
Posts: 389

Rep: Reputation: 34
copying files to /proc/bus/usb


hi. i got a usb hardisk (enclosure) 80G that is partition into 4 of 20G. it was read by /proc/bus/usb.. owned by root :

[root@vector/proc/bus/usb]# ls -l
total 0
dr-xr-xr-x 2 root root 0 2007-10-09 16:12 001/
dr-xr-xr-x 2 root root 0 2007-10-09 16:12 002/
dr-xr-xr-x 2 root root 0 2007-10-09 16:12 003/
dr-xr-xr-x 2 root root 0 2007-10-09 16:12 004/
-r--r--r-- 1 root root 0 2007-10-09 16:12 devices


the problem is. . . i cannot copy files from it..

samples :

[root@vector/proc/bus/usb/001]# mkdir test
mkdir: cannot create directory `test': Operation not permitted

attempted to copy a file from my windows partition :

[root@vector/mnt/winbak]# cp lilo_vect5.8 /proc/bus/usb/001/
cp: cannot create regular file `/proc/bus/usb/001/lilo_vect5.8': Permission denied

do i have to configure something else? i google some sites.. i read some articles that usb hard disk should have an fs? is this true? because im also using my usb hd in windows. . .

i thought that this is just the same when using a usb flash drive. .

Last edited by ic_torres; 10-09-2007 at 05:41 AM.
 
Old 10-09-2007, 05:42 AM   #2
ghostdancer
Member
 
Registered: Apr 2002
Distribution: Slackware
Posts: 266

Rep: Reputation: 30
Err... You are not suppose to that. You should try to understand what is the function of /proc/

Quote:
The Linux kernel has two primary functions: to control access to physical devices on the computer and to schedule when and how processes interact with these devices. The /proc/ directory contains a hierarchy of special files which represent the current state of the kernel — allowing applications and users to peer into the kernel's view of the system.

Within the /proc/ directory, one can find a wealth of information detailing the system hardware and any processes currently running. In addition, some of the files within the /proc/ directory tree can be manipulated by users and applications to communicate configuration changes to the kernel.

From: http://www.redhat.com/docs/manuals/l...e/ch-proc.html
Check your 'dmesg' output, if your USB disk is detected successfully, it should display as sdX (X is either a, b, c, ... depend on your system configuration).

Last edited by ghostdancer; 10-09-2007 at 05:43 AM.
 
Old 10-09-2007, 06:03 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Simpler yet - enter (as root) "fdisk -l" in a terminal.
It'll tell you all the disks/partitions you have available to you.

Leave /proc alone - there are some writeable files there, but not what you're trying to do.
 
Old 10-09-2007, 06:04 AM   #4
ic_torres
Member
 
Registered: Nov 2005
Location: ABAP
Distribution: slackware 12.0, Vector Linux STD 6.0 and 5.8, ZenWalk 4.6.1, OpenBSD 3.9
Posts: 389

Original Poster
Rep: Reputation: 34
oh i see.. im sorry

here is the output of /var/log/messages :

Oct 9 19:10:30 darkstar kernel: usb 1-4: new high speed USB device using ehci_hcd and address 58
Oct 9 19:10:31 darkstar kernel: usb 1-4: new high speed USB device using ehci_hcd and address 59
Oct 9 19:10:31 darkstar kernel: usb 1-4: new high speed USB device using ehci_hcd and address 60
Oct 9 19:10:32 darkstar kernel: usb 1-4: new high speed USB device using ehci_hcd and address 61
Oct 9 19:10:32 darkstar kernel: usb 1-4: new high speed USB device using ehci_hcd and address 62


_____________________________________________

results of mount command :

/dev/hdc5 on / type reiserfs (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/hdc6 on /boot type ext3 (rw)
/dev/hdc8 on /tmp type reiserfs (rw)
/dev/hdc9 on /var type reiserfs (rw)
/dev/hdc10 on /usr type reiserfs (rw)
/dev/hdc11 on /home type reiserfs (rw)
/dev/hda1 on /mnt/windows type vfat (rw)
/dev/hda5 on /mnt/winback type vfat (rw)


_________________________________________________

when i type dmesg the same output shows :

dmesg | grep usb
usb 1-4: new high speed USB device using ehci_hcd and address 49
usb 1-4: new high speed USB device using ehci_hcd and address 50
usb 1-4: new high speed USB device using ehci_hcd and address 51
usb 1-4: new high speed USB device using ehci_hcd and address 52
usb 1-4: new high speed USB device using ehci_hcd and address 53
usb 1-4: new high speed USB device using ehci_hcd and address 54
usb 1-4: new high speed USB device using ehci_hcd and address 55
usb 1-4: new high speed USB device using ehci_hcd and address 56
usb 1-4: new high speed USB device using ehci_hcd and address 57
usb 1-4: new high speed USB device using ehci_hcd and address 58
usb 1-4: new high speed USB device using ehci_hcd and address 59
 
Old 10-09-2007, 06:07 AM   #5
ic_torres
Member
 
Registered: Nov 2005
Location: ABAP
Distribution: slackware 12.0, Vector Linux STD 6.0 and 5.8, ZenWalk 4.6.1, OpenBSD 3.9
Posts: 389

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by syg00 View Post
Simpler yet - enter (as root) "fdisk -l" in a terminal.
It'll tell you all the disks/partitions you have available to you.

Leave /proc alone - there are some writeable files there, but not what you're trying to do.

sir the results :



Code:
fdisk -l

Disk /dev/hda: 41.1 GB, 41110142976 bytes
255 heads, 63 sectors/track, 4998 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1        2449    19671561    c  W95 FAT32 (LBA)
/dev/hda2            2450        4998    20474842+   f  W95 Ext'd (LBA)
/dev/hda5            2450        4998    20474811    b  W95 FAT32

Disk /dev/hdc: 80.0 GB, 80026361856 bytes
16 heads, 63 sectors/track, 155061 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdc1               1       19376     9765472+  a6  OpenBSD
/dev/hdc2           19377       38752     9765504   83  Linux
/dev/hdc3           38753       58128     9765504   83  Linux
/dev/hdc4           58129      155061    48854232    5  Extended
/dev/hdc5           58129       62003     1952968+  83  Linux
/dev/hdc6           62004       62197       97744+  83  Linux
/dev/hdc7           62198       64135      976720+  82  Linux swap
/dev/hdc8           64136       66073      976720+  83  Linux
/dev/hdc9           66074       68011      976720+  83  Linux
/dev/hdc10          68012       77699     4882720+  83  Linux
/dev/hdc11          77700       97075     9765472+  83  Linux
/dev/hdc12         125998      155061    14648224+  83  Linux
/dev/hdc13          97076      125997    14576656+  83  Linux

Partition table entries are not in disk order
root@darkstar:~#
 
Old 10-09-2007, 06:25 AM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Erk - maybe the udev rules aren't right. Have a look at dmesg, and look for the device that gets allocated - probably sda. Should also show the partitions on the device.
Make some mountpoints and mount the partitions manually.
 
Old 10-09-2007, 06:37 AM   #7
ic_torres
Member
 
Registered: Nov 2005
Location: ABAP
Distribution: slackware 12.0, Vector Linux STD 6.0 and 5.8, ZenWalk 4.6.1, OpenBSD 3.9
Posts: 389

Original Poster
Rep: Reputation: 34
just wondering.. .when im using my usb flash disk. .the files resides at /mnt/vl-hot/sda/vol1

but when i tested the usb hd --- /mnt/vl-hot/sda/vol1 does not have any contents. . .
 
Old 10-09-2007, 06:48 AM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
What does "df -hT" look like ???. After the flash is inserted, and after the USB is inserted.
 
Old 10-09-2007, 06:56 AM   #9
ic_torres
Member
 
Registered: Nov 2005
Location: ABAP
Distribution: slackware 12.0, Vector Linux STD 6.0 and 5.8, ZenWalk 4.6.1, OpenBSD 3.9
Posts: 389

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by syg00 View Post
What does "df -hT" look like ???. After the flash is inserted, and after the USB is inserted.

Code:
USB hd  inserted --slackware 12.0

Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/hdc5 reiserfs    1.9G  489M  1.4G  26% /
/dev/hdc6     ext3     93M   22M   66M  25% /boot
/dev/hdc8 reiserfs    954M   36M  919M   4% /tmp
/dev/hdc9 reiserfs    954M   58M  896M   7% /var
/dev/hdc10
          reiserfs    4.7G  3.3G  1.5G  70% /usr
/dev/hdc11
          reiserfs    9.4G  3.1G  6.3G  33% /home
/dev/hda1     vfat     19G   14G  5.1G  74% /mnt/windows
/dev/hda5     vfat     20G   12G  7.9G  60% /mnt/winback


my USB flash disk works with VL so here it is:

df -hT
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/hdc12
          reiserfs     14G  6.1G  8.0G  43% /
none         tmpfs    506M     0  506M   0% /dev/shm
/dev/hda1     vfat     19G   14G  5.1G  74% /mnt/windows
/dev/hda5     vfat     20G   12G  7.9G  60% /mnt/winbak
/dev/sda1     vfat    499M  176M  324M  36% /mnt/vl-hot/sda/vol1


USB hd using VL :

df -hT
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/hdc12
          reiserfs     14G  6.1G  8.0G  43% /
none         tmpfs    506M     0  506M   0% /dev/shm
/dev/hda1     vfat     19G   14G  5.1G  74% /mnt/windows
/dev/hda5     vfat     20G   12G  7.9G  60% /mnt/winbak

Last edited by ic_torres; 10-09-2007 at 07:11 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
where is /proc/bus/usb/devices???? mrchaos Linux - Software 4 12-04-2005 10:26 PM
/proc/bus/usb problem arunka Linux - Hardware 0 11-07-2005 06:54 AM
MDK 10.2: No USB at all (/proc/bus/usb/devices missing) shrodi Mandriva 5 07-01-2005 11:28 AM
No USB at all (/proc/bus/usb/devices missing) shrodi Linux - Hardware 1 05-26-2005 04:07 AM
/proc/bus/usb busy Commish66 Linux - General 2 09-18-2003 05:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration