LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Deleting hidden partitions on usb drive (https://www.linuxquestions.org/questions/linux-newbie-8/deleting-hidden-partitions-on-usb-drive-790236/)

ZimMonkey 02-19-2010 01:42 PM

Deleting hidden partitions on usb drive
 
I recently bought a Buffalo 500GB ministation usb with "optional disk encryption". Turns out, I'm having one hell of a time trying to remove the "optional" from the drive. I figured I could just delete the program that is on the disk, and go on my way. That doesn't seem to be the case.

fdisk /dev/sdc1, then "p" showed that there were 4 partitions. So I deleted them one by one. "n" gave me a new partition. "t" I used 87 because I will be using it on windows. Then "w" to write everything.

mkfs -t ntfs /dev/sdc1 - all went well.
fsck -f -y /dev/sdc1 - all went well

Then I took the removed the drive and plugged into Windows only to find that the "optional" is still there. It actually creates a virtual drive with the "optional" software.

So I tried it over again. I tried fdisk only to see that the partitions were back (as if they were never removed). I removed them again, and used primary partition as linux, and wrote to disk. As a hunch, I checked permissions. Can't remember what it said, but I did change them.

chmod 777 /dev/sdc1

Then in a last hope of desperation, before coming to work today, i decided to dd the drive.

dd if=/dev/zero of=/dev/sdc1 bs=4k conv=notrunc

I'll know when I get home from work if any of this helped. Is it possible that the "optional" stuff is actually hard coded onto a chip, or something inside the drive and I may never get rid of it? Am i missing something in my process?

Thanks for your help

Zim

tredegar 02-19-2010 01:57 PM

Quote:

dd if=/dev/zero of=/dev/sdc1 bs=4k conv=notrunc
This is only going to wipe one partition, /dev/sdc1

Better, perhaps, is to try to wipe the entire disk (partition table, MBR & all)
Code:

dd if=/dev/zero of=/dev/sdc bs=1M
Make very sure you sure you are zeroing the correct disk, or you will be sorry.

Then look at it with fdisk /dev/sdc

ZimMonkey 02-19-2010 02:33 PM

tredegar,

Thanks for your quick reply.

I'm just trying to wrap my head around a few things, and could use some clarification.

Code:

dd if=/dev/zero of=/dev/sdc bs=1M
So when i use the dd command, I should be using it as sdc, not sdc1? Why when I mount and use the drive is it accessed through sdc1? Are you saying that sdc1 is a partition of sdc? Does the MBR, and partition table and such exist on sdc, and not sdc1?

Thank you for your help. And as a side note, thanks for the additional reminder to zero the correct disk (it is).

Zim

smoker 02-19-2010 03:36 PM

Quote:

Originally Posted by ZimMonkey (Post 3869740)
tredegar,
Code:

dd if=/dev/zero of=/dev/sdc bs=1M
Why when I mount and use the drive is it accessed through sdc1?

sdc is the disk, sdc1 is the first partition. A disk with only one partition will be accessed as sdc1.

You have to create at least one primary partition on any disk in any OS (that I know of, certainly windows) before you can format it and write to it. Under windows the partition must be marked as active as well.

If you were to write a bootable disk image to a USB disk then you would use similar syntax, because you want the whole of the disk (including the boot sector) to be written as per the image.
dd if=/path/to/image of=/dev/sdx

sd means it's a scsi or SATA drive and also USB are named this way.

sdc means it's the 3rd sata (scsi) disk in the system

sdc1 means the first partition on the 3rd sata (scsi) disk in the system.

Under bsd the conventions are different.


I forgot to say, in your case you want to overwrite the whole disk including all boot sectors and partitions. So the sdc is correct.
Also most new disks come pre-set up, so you don't have to write a partition yourself.

tredegar 02-19-2010 04:08 PM

Quote:

I'm just trying to wrap my head around a few things, and could use some clarification.
OK.

Quote:

So when i use the dd command, I should be using it as sdc, not sdc1?
Yes.

Quote:

Are you saying that sdc1 is a partition of sdc?
Yes.

Quote:

Does the MBR, and partition table and such exist on sdc, and not sdc1?
Yes.


The "disk" is /dev/sdc

This is the raw disk. It refers to your hardware.

Disks are usually split into "partitions", that sub-divide the disk into, well, partitions. The partition table ( a description of how the entire raw, physical, disk is to be divided ) is held in the raw disk's MBR which resides in the first sector of the raw disk. That's /dev/sdx (no number, just a letter).

Raw disks can be partitioned into separate slices. Think of it like a cake, sliced up. The cake is /dev/sdb and the "slices" are /dev/sdb1 /dev/sdb2 etc. Each partition can be allocated space, and formatted as a filesystem, and used as such.

If you want to remove all software from a disk, and return it to its raw state, you need to zero the whole disk ( Eg /dev/sdb but check this carefully) not just the partition ("slice of the cake") like sdb1

Once you have done that you will have to repartition the disk with (as root) fdisk /dev/sdb

menu for help
print the partitions
n to create new partitions
w to write the changes

And remember that /dev/sdb needs to be unmounted when you do this
then follow the prompts.

syg00 02-19-2010 06:01 PM

If it's anything like the Sandisk U3 crap, you cannot remove it using normal tools. For the Sandisk junk you have to trust their tool - and run in under Windoze.

ZimMonkey 02-19-2010 07:56 PM

smoker & tredegar,

Thanks for the help. I'll be trying it out in a few hours. I'll post my progress.

syg00,

Is there a way to find out if it's the same as the Sandisk U3 before spending lots of quality time swearing at it? Or will it be something that I'll just have to find out the hard way? I've seen posts on nonlinux sites trying to figure out how to remove this thing, but so far nothing as to if it's hard wired in somehow, or if anyone's been successful. Progress will be posted, as well as possible cursing :)

Thanks,

Zim

ZimMonkey 02-22-2010 08:32 AM

An update:

I tried tredeager's suggestion. Actually I tried it twice just to make sure. I am unable to remove the software for the "optional" disk encryption. After plugging the device in, I still get a virtual cd showing as one of my drives. Thanks for your help.

thorkelljarl 02-22-2010 09:20 AM

Try Buffalo...

Have you tried the Buffalo support site to see if there is a utility available to manage and remove the unwanted formatting? You may have to run any utility on a Windows system, perhaps after formatting the HDD again with NTFS or VFAT.

Another possibility is, if it is not sealed, to try to open the HDD case, and see who has manufactured the disk itself, then see if the maker has a utility to change the specifications of the disk. A HDD tool such as Seatools or HUTIL has an option to do a low level format of the HDD that may remove what Buffalo has installed.

Some of the Buffalo encryption software has an integrated management tool, but yours has none? It might be necessary to install the software under Windows in order to make any changes.

I assume that the results of the command "lshw" is that the device announces itself as a Buffalo HDD. Buffalo has management programs for their small format USB HDDs, but are they the utility that you need?

http://www.buffalotech.com/support/downloads/

catkin 02-22-2010 10:20 AM

These problems are very similar to the ones posted in this LQ thread. It seems USB HDD vendors are using advanced USB functionality to provide smart "value added" services aimed at the Windows market -- providing features which are unhelpful on Linux.

Hopefully people will contribute to LQ's Linux Hardware Compatibility (HCL) so we can find out which models are not suitable.

I figure the (too damn) smart functionality is in the firmware; unless manufacturers provide firmware which removes the smart stuff and renders the device as a simple USB HDD there is not much we can do. usbsnoop could provide a bit more information about what is going on, as seen from the OS.

tredegar 02-22-2010 01:40 PM

OK, it didn't work (the dd .. of=/dev/sdc )
The "CD ROM" is probably in the firmware on the device. Ignore it. I doubt you could reclaim the space, such as it is, anyway.
If you want to boot linux from one of these drives, you'll probably have to make sure that
the bootloader is installed on the partition and not the MBR.

Mental note to self: Don't ever buy any disks with "optional encryption".
Who trusts their "encryption" anyway ?

worm5252 02-22-2010 03:52 PM

I had a similar problem with a Kingston data traveler USB thumb drive. It didn't want to delete, but eventually I figured it out. I think fdisk actually got it for me.

If my memory serves me correctly you should be able to do the following (assuming you are still using /dev/sdc)
Code:

fdisk /dev/sdc
l
d
1
d
2
d
3
d
4
w

That should delete partitions 1-4 and then write the changes to /dev/sdc/. After that you can go back and create your new ntfs partition.

smeezekitty 02-22-2010 03:55 PM

Whats the point of removing it?

ZimMonkey 02-23-2010 09:32 AM

thorkelljarl,

Thanks for the link. Buffalo doesn't have anything in referrance to removing the software. It does have a download for the original software. That gives me hope that it can be removed.

catkin,

The problem does seem to be the same. I've tried everything I can find to get rid of it and just can't. It's still a functional drive, just with bloat.

tredegar,

Thanks for your help. I 've bought thumb drives with compression software and other crap on it before and had no problem just deleting it. So I didn't think that this would end up being such a problem. I've learned my lesson on that.

worm5252,

That is one of the many things I tried. I've formatted, dd'd, searched, begged and pleaded :)

smeezekitty,

The point of removing it is more out of principle. The drive is totally functional, I just don't like being told that I can't remove software that I don't want. It reminds me too much of Bill Gates.

As a follow up of sorts, I did make an interresting discovery. When using fdisk on /dev/sdc it showed there were 4 partitions. I deleted each one, and wrote that to the drive. I checked the partition table and it showed the amount of space on the drive with no partition. As a fluke I used x as my option, then checked partition again. It showed that there were 4 partitions, 3 of them had zeroes after them, and the top one seemed to be the drive. After that I dd'd with zeroes /dev/sdc. Then I mkfs as ntfs. After that was done I plugged it into a Bill Gates computer and the virtual cd thing showed up again. It seems my persistance is only getting me more annoyed. Is there anything that I might have forgotten?

Thanks,

Zim

Fred Caro 02-23-2010 12:22 PM

usb pain in rear
 
I don't wish to promote any purveyor but Kingston usb sticks come free from annoying software so maybe they do larger items? Maybe a case of buyer beware.

Fred.


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