You are not logged in.

#1 2007-07-15 03:55:22

peets
Member
From: Montreal
Registered: 2007-01-11
Posts: 936
Website

making a device removable

Hi,

I have an external hard drive that plugs in through usb. A few months ago I redid the filesystem a few times (tried to install a liveUSB distro, and Arch too I think) using different machines (linux, windows, mac). In the end, I had a single empty vfat filesystem on it.

However, the drive is no longer recognized as 'removable' by windows or mac or linux (pmount says it's not removable). I'm wondering how to make the hard drive recognized as removable media once again. Is there some kind of flag I can toggle while making a new filesystem?

To quote Florin from these forums 2 years ago, "Any reply or any RTFM re-dirrectioning is appreciated."

Thanks.

Last edited by peets (2007-07-15 03:55:56)

Offline

#2 2007-07-16 03:17:12

bsdson.tw
Member
From: Taiwan
Registered: 2005-05-06
Posts: 161

Re: making a device removable

[bsdson@henrylee Desktop]$ cat /etc/pmount.allow
# /etc/pmount.allow
# pmount will allow users to additionally mount all devices that are
# listed here.
/dev/sda1
/dev/sda2
/dev/sda3
/dev/sda4
/dev/sda5
/dev/sdb1
/dev/sdb2
/dev/sdb3
/dev/sdb4
/dev/sdb5
/dev/sdc1
/dev/sdc2
/dev/sdc3
/dev/sdc4
/dev/sdc5
[bsdson@henrylee Desktop]$

man pmount and try to setup this file accordingly.
cheers

Offline

#3 2007-07-18 02:08:14

peets
Member
From: Montreal
Registered: 2007-01-11
Posts: 936
Website

Re: making a device removable

I guess... but if I decide to plug in another device into the same usb hub, doen't it get the same device name? And this will not make my hard drive appear 'removable' to other OSs. Maybe my question is fake and every OS needs to be told how to handle such and such a device ...? I'll do some more experimentation.

EDIT: I plugged in the usb hard drive into a windows computer at work. It got treated as an internal hard drive (shows up in the 'Hard Disk Drives' section of 'My Computer' instead of the 'Devices with Removable Storage', and windows writes "System Volume Information" to it, which it doesn't do with removable media (I think? Understanding Windows is too hard, that's why I use linux!))

So it seems like there really exists some information on the hard-drive itself that will identify it as 'removable', and I somehow changed that information without knowing what I was doing. How do I set it back to removable?

Last edited by peets (2007-07-18 14:03:37)

Offline

#4 2007-07-18 14:18:34

ionflux
Member
From: Boston, MA
Registered: 2007-06-20
Posts: 18

Re: making a device removable

Hi Peets,

I have been struggling with the same problem and found the solution proposed by bsdson.tw to be an excellent idea.
I know very little about linux, but my understanding is that - yes - the os will give a different name to the device depending on the order in which you plug it in, but all possible names are captured in the file pmount.allow.

All you have to do is use its label as an identifier: pmount /dev/disk/by-label/<label of your USB HD>.
You will then find it in /media/<label>

Hope I am not wrong.  Anybody has other suggestions?

Offline

#5 2007-07-19 03:02:37

peets
Member
From: Montreal
Registered: 2007-01-11
Posts: 936
Website

Re: making a device removable

Thanks for your suggestions, bsdson.tw and ionflux, but it's not really what I'm looking for. I use computers in different places, have different OSs, etc. so I'd really like this to be machine-independent (actually edit some settings on the removable hard drive). I've done some more reading and found this little bit of info:

I haven't found how to toggle it, but at least I now know for sure that there is a 'removable' flag. There is actually a file called "removable" containing either a '0' or a '1'!

[peets@myhost sys]$ grep '\w' /sys/block/sdb/*
/sys/block/sdb/dev:8:16
/sys/block/sdb/range:16
/sys/block/sdb/removable:0
/sys/block/sdb/size:234441648
/sys/block/sdb/stat:      29       73      354      268        0        0        0        0        0      216      268
[peets@myhost sys]$

Here's something that probably won't work: I'll try change the file 'readable' to '1', then plug in the hard drive at work tomorrow (under windows) and see what happens. I have very strong doubts, but I have nothing to lose (hooray for backups!)

EDIT: d'uh, as was to be expected: file is read-only for everyone, even the superuser.

Last edited by peets (2007-07-19 03:32:30)

Offline

#6 2007-07-19 09:43:24

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: making a device removable

peets wrote:

EDIT: d'uh, as was to be expected: file is read-only for everyone, even the superuser.

But it must belong to a user or group which you've got access too, doesn't it? So you can set it to read-write.

Offline

#7 2007-07-21 20:03:18

peets
Member
From: Montreal
Registered: 2007-01-11
Posts: 936
Website

Re: making a device removable

I just sent this request for support to Western Digital. They say they'll answer within the next business day, I guess monday or tuesday. We'll see how that goes! I hope they don't just answer something like, "We don't support linux. Just never use it, and everything will be fine." Here's the message:

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

Hi,

I purchased this hard drive in december 2006. It works surprisingly well. I've been using it extensively and am very happy with it.

However, there's one annoyance that I would like your help on solving.

When I first bought the hard drive, it was considered by as a 'removable device' by all computers/OSs (I used it on linux, windows and mac). A few months ago, I repartitioned the drive and created a new filesystem on it. For a while I had an ext2 partition and a FAT32 one. Then I repartitionned to a single partition with a FAT32 filesystem, which is how the hard drive was when I first bought it.

Now, after this process (the repartitionning and formatting was done using tools from mac, windows and linux), the hard drive is no longer recognized as a removable device. On windows, it shows up as an internal hard drive, and windows XP writes "System Volume Information" files to it. This is annoying. On linux. I cannot use pmount to mount the drive. I also get this information from sysfs, using the command "cat /sys/block/sdb/removable", I get the output "0". If I use a similar command with, say, a USB flash drive, that file reads "1".

I know of no tools that will let me toggle that 'removable' flag on my hard drive. How do I change it back to true, and how can I avoid making it false when I partition/mkfs/format the hard drive?

Thank you in advance,

Pierre-Paul Paquin

P.S. a simple RTFM redirection would be appreciated, as I really didn't find any information about this anywhere on the net.

P.P.S. The fact that it's not recognized as removable doesn't hinder me from using it. Everything else works perfectly, and I use the hard drive regularly.

Offline

#8 2007-07-31 23:04:04

peets
Member
From: Montreal
Registered: 2007-01-11
Posts: 936
Website

Re: making a device removable

Ah dang, I got this reply today:

Dear Pierre-Paul,

Thank you for contacting Western Digital Customer Service and Support.

I apologize but I am unable to help you because this is a software issue that is outside the range of Western Digital's standard support. Please contact the Microsoft or RedHat vendor for assistance.

Sincerely,
Don S.
Western Digital Service and Support
http://support.wdc.com


O.K. I will ask Microsoft for support!

Offline

Board footer

Powered by FluxBB