Jump to content

pcmcia-hdd access [solved]


Recommended Posts

I have a PCMCIA HD-Drive (it's called "PCMCIA PnPIDE", and 10.1 recognises it as hde). It is normally not mounted following boot, so I have to do this manually, currently with the script

su -c "mount /dev/hde1 /mnt/cardhde" ,

which means having to enter the root-password. I would like the system to do this automatically, if possible, but have no idea how to even begin such an exercise. Any help would be appreciated.

 

Having mounted the device I have full read/write rights in 10.1. Doing EXACTLY the same in 10.2 (I copied the script into 10.2), however, I have no write access. The properties box says that the owner/group is "root" in 10.1 (but still allowing me to write) and "501" in 10.2. Can anyone tell me what this "501" means and how I can overcome this situation?

 

 

 

Moved from 'Software' to 'Terminal Shell Commands, Kernel and Programming' - Artificial Intelligence

Link to comment
Share on other sites

Please post your /etc/fstab(both mdk10.1 and 10.2 if you have both on your box at this time). Also state what filesystem your using on the external hard drive(vfat, ext3, reiserfs, etc).

 

Reason for the above - you should be able to get around having to enter the root password by setting up an appropriate entry in fstab for the removable device and making a mounting icon.

 

There are auto detection/mounting systems for removable mass storage devices in mdk 10.1 and 10.2. The 10.1 ones are not that good but there was a huge improvement/rework of this system in 10.2 which uses a new system called "hal", short for hardware abstraction layer. Hal autogenerates and removes entries in fstab for removable storage devices as they are inserted and removed. Hal works much better than the previous system for usb storage devices; don't know how it works for pcmcia storage devices. At any rate post your fstab for mdk10.2 both with your hd connected and disconnected as I'm curious to see if hal is doing anything in fstab when the device is connected and disconnected. If hal isn't working, it shouldn't be that hard to set up a manual fstab entry for the device that will overide hal and do what you want.

Link to comment
Share on other sites

contents of /etc/fstab (10.1):

/dev/hda7 / ext3 noatime 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 vfat umask=0,iocharset=iso8859-1,codepage=850 0 0

/dev/hda5 /mnt/win_d vfat umask=0,iocharset=iso8859-1,codepage=850 0 0

none /proc proc defaults 0 0

/dev/hda6 swap swap defaults 0 0

/dev/hde5 swap swap defaults 0 0

;**************

contents of /etc/fstab (10.2) WITH pcmcia-hdd:

# This file is edited by fstab-sync - see 'man fstab-sync' for details

/dev/hda8 / ext3 noatime 1 1

/dev/hdc /mnt/cdrom iso9660 user,iocharset=iso8859-1,noauto,ro,exec 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 vfat umask=0,iocharset=iso8859-1,codepage=850 0 0

/dev/hda5 /mnt/win_d vfat umask=0,iocharset=iso8859-1,codepage=850 0 0

none /proc proc defaults 0 0

/dev/hda6 swap swap defaults 0 0

;**************

contents of /etc/fstab (10.2) WITHOUT pcmcia-hdd:

# This file is edited by fstab-sync - see 'man fstab-sync' for details

/dev/hda8 / ext3 noatime 1 1

/dev/hdc /mnt/cdrom iso9660 user,iocharset=iso8859-1,noauto,ro,exec 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 vfat umask=0,iocharset=iso8859-1,codepage=850 0 0

/dev/hda5 /mnt/win_d vfat umask=0,iocharset=iso8859-1,codepage=850 0 0

none /proc proc defaults 0 0

/dev/hda6 swap swap defaults 0 0

;*********************************

 

Hope this helps

Link to comment
Share on other sites

Let's fix fstab first. You have to create an entry for your external hard drive partition in fstab; to do that I need to know what filesystem your using. Fat32 partitions have much different entries in fstab than native linux filesystems. If the partition is FAT32, you would add this line:

 

/dev/hde1 /mnt/cardhde vfat umask=0,iocharset=iso8859-1,codepage=850,user,noauto 0 0

 

for ext3 it would be:

 

/dev/hde1 /mnt/cardhde ext3 noatime,user,noauto 1 2

 

The important additions are the "user" and "noauto" options. "User" allows ordinary users to mount the partition, i.e. you don't have to be root. "Noauto" insures that the system does not attempt to mount the drive on boot. This is normally what you want for a removable drive and is probably necessary in your case because the pcmcia system may not be initialized when the filesystems are mounting at boot.

 

That should fix the mounting as root problem in both 10.1 and 10.2. For the permissions problem in 10.2 post back your filesystem on hde1; permissions are handled differently in FAT32 and native linux filesystems.

 

You also seem to indicate that you want hde1 mounted automatically at boot which is usually not a good idea with removable devices. In kde, it's pretty easy to create mounting icons where when you click the icon the drive is automatically mounted and konqueror opens at the drive mount point. You can also use KwickDisk in kde for much the same purpose. As long as you have the "user" option in the fstab entry, either will work fine in kde.

Link to comment
Share on other sites

Sorry, forgot the filesystem, it's ext3.

I've just tried your suggestion, but it didn't work. The first reboot after modifying fstat failed because I'd forgotten to insert the card (logical, I thought); this CAN happen, of course, but it shouldn't cause the system to hang with the message that "the filesysytem hde could not be found" (or something like that, I can't remember the exact wording). Anyway, I inserted the card and rebooted, with the same result. The filesystem definitely IS ext3 (it's an old hdd with 10.1 installed on it), although, when mounted using the script previously described, KDiskFree indicates the type as '?'. Looks to be a bit more complicated than at first sight. Fortunately I was able to remove the entry in fstat on 10.1 (which always caused a hang-up at boot) via 10.2, so 10.1 works again now.

Link to comment
Share on other sites

It must be a timing issue with pcmcia I suspect. With a normal ide controller, the hde interface is there at boot whether anything is connected to it or not. Your pcmcia controller must be generating a virtual ide interface which is not initialized til later in the boot process. Fstab is read early in the boot process and I believe the system reads that there is suppose to be something on hde which should not be mounted and freaks because it can't find an hde interface. That's my best guess anyway.

 

Only problem with this theory is you have an entry for a swap partition on /dev/hde5 in your 10.1 fstab. I assume you have a swap partition on the external drive and the drive was connected during the install of 10.1 so why isn't it hanging up the boot process? Or will it hang with the drive not connected? At any rate, I'd remove that entry for the hde5 swap partition unless you always boot up with the drive connected.

By the way, the main reason for using the "noauto" option with removable drives is to prevent that hangup on boot if the drive is not connected.

 

Just thought of something, try this entry for hde1 in fstab:

 

/dev/hde1 /mnt/cardhde ext3 noatime,user,noauto 0 0

 

The problem may have been in the trailing "1 2"; this tells the system to perform a filesystem integrity check at boot before mounting. If hde had not been created yet this would surely cause an error message re unable to read superblock or bad superblock, etc and would probably hang the system. The trailing "0 0" tells the system to not perform any checks on the filesystem and should eliminate the problem. Give it a try and see if it works.

 

Your 10.2 permission problem should be easy to fix. Boot into 10.2 and mount the drive as you usually do. Then run as root:

 

# chmod 1777 <mount point for hde1>

 

This must be run with the partition mounted or it won't work and the change should persist on subsequent reboots.

Edited by pmpatrick
Link to comment
Share on other sites

Did just as you suggested and the first bit - auto-mounting hde and hde1 - worked. Many thanks :thumbs: . The 10.2 permission suggestion didn't; however I managed to get write access in 10.2 by changing it - as root - to 'myself'. Now, strangely, write access (but only to the 'myself' folder, thus not allowing me to create sub-folders) is refused in 10.1, where the owner and group are now set to '500'. Don't understand the significance of this '500'. Not very important but an interesting technical problem.

Link to comment
Share on other sites

Try this. With the device mounted run as root:

 

# chown -R <username>:<username> /mnt/<mountpoint>

# chmod 1777 /mnt/<mountpoint>

 

That should recursively change the owner and group of all files on the drive to yourself(the chown command) and give you read/write/execute permissions on all files on the drive(chmod command).

 

By the way, the "500" is probably the user id or "uid" and the group id or "gid". Every user/group created is given a numerical uid or gid and the first nonroot user is usually "500" and the first nonroot group is usually "500" as well.

Edited by pmpatrick
Link to comment
Share on other sites

Did exactly as suggested and it worked. Many thanks again :thumbs: . Interestingly,

however, in 10.1 the owner/group is set to 500/500 which means no write access

to the device at all. VERY STRANGE!! Can only assume that the read/write

properties-access has been significantly recoded from 10.1 to 10.2, thereby

causing this problem which, in fact, constitutes some kind of development fault.

Not important, since I intend to concentrate on 10.2 in future. Once again,

many thanks.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...