LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Partitioning my USB. (https://www.linuxquestions.org/questions/linux-software-2/partitioning-my-usb-4175603161/)

hack3rcon 04-04-2017 08:48 AM

Partitioning my USB.
 
Hello.
I used "GParted" and partitioning my USB to two partitions:
Code:

Disk /dev/sde: 7.4 GiB, 7969177600 bytes, 15564800 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x697a1dae

Device    Boot  Start      End Sectors  Size Id Type
/dev/sde1          2048  8388607 8386560    4G  6 FAT16
/dev/sde2      8388608 15564799 7176192  3.4G  6 FAT16

But, when I plug it to Windows OS then I just see one drive!!! Why?

Thank you.

yancek 04-04-2017 08:51 AM

That's because windows will only see/read the first partition on a usb/flash drive which is by design of microsoft. It also doesn't matter what the filesystem type is. Why is a question only microsoft can answer.

MensaWater 04-04-2017 08:53 AM

For anything larger than 2 TB you need to use the GPT partition table type. Your output shows you are using the DOS partition table type.

You can use parted and "mklabel gpt" to do that.

You may also which to change the partitions themselves from FAT16 to NTFS.

MensaWater 04-04-2017 08:55 AM

Quote:

Originally Posted by yancek (Post 5692421)
That's because windows will only see/read the first partition on a usb/flash drive which is by design of microsoft. It also doesn't matter what the filesystem type is. Why is a question only microsoft can answer.

I'm not sure that is correct. It seems to me my home USB WD drive has 2 partitions on it and both my Windows 7 and my Windows 10 laptops can see both partitions. Its been a while since I did anything with it so I won't swear to that but my original setup was to allow backups to separate partitions from the 2 laptops.

jefro 04-04-2017 04:38 PM

Most flash drives are reported to the OS as removable flash drives. Some along with almost all modern usb hard drives report differently so one can assign and read multiple partitions.

Think there is a program out there that can set the bit so that it reports as the hard drive and not flash drive. Flipbit ?? I think but there are other ways as I recall in windows to fix it.

yancek 04-04-2017 06:51 PM

Quote:

t seems to me my home USB WD drive has 2 partitions on it and both my Windows 7 and my Windows 10 laptops can see both partitions.
Are you referring to an actual flash/pen drive or a WD (Western Digital) usb hard drive? If you have actually created a multi-partition flash drive with more than one windows partition recognized from windows that would surprise and make a lot of windows users happy. Particularly if you explain how you managed it. I'm not much of a windows user but would be interested in how it was achieved?

If you do an online search you will see many links, almost all of which are on windows forums and almost all coming to the same conclusion. It may be possible by hacking the registry or using specialized third party tools as I have seen that claim at some sites but it seems to be hit or miss and a convoluted process to do something so basic.

I've seen posts on the software referred to above (Flipbit) and it doesn't seem to work, at least for the posts I've seen.

jefro 04-04-2017 09:17 PM

Because no two flash drives seem to have the same controller and the newer larger usb drives may not report the same. Yes, you can destroy a usb flash drive trying to write to it's controller.

Anyways, more on that whole deal here. https://www.tenforums.com/drivers-ha...ash-drive.html

MensaWater 04-05-2017 08:12 AM

The OP never said "flash" just "usb".

The size made me assume it wasn't a flash drive but rather a usb attached hard drive like the WD drives I've used on both Windows and Linux.

I've never tried to partition a "flash" drive but definitely have "usb attached hard drives".

yancek 04-05-2017 09:01 AM

Quote:

The size made me assume it wasn't a flash drive but rather a usb attached hard drive
His output shows a 7.4GB drive which is why I found your original comment regarding "2TB" drives a bit confusing. The link posted by jefro above goes into some detail on it and I think that being seen as a "removable" drive has some impact on it for windows. I don't know enough about the hardware to know why this is a problem for windows but one can easily create and use multiple partitions on Linux regardless of the filesystem type and have them be accessilbe/usable.

Boot windows with a flash drive with multiple partitions and you should see all the partitions in Disk Management but will not be able to do anything with them, other than the first ntfs/vfat partition. You can't create a drive letter and all the other options other than delete are greyed.

MensaWater 04-05-2017 10:55 AM

Quote:

Originally Posted by yancek (Post 5692930)
His output shows a 7.4GB drive which is why I found your original comment regarding "2TB" drives a bit confusing.

D'oh! I misread the 3.4G on second partition as 3.4T somehow.

dave@burn-it.co.uk 04-05-2017 05:47 PM

It depends on how the Flash is set up.
Some flash have a single "partition" with no partition table and cannot be resized though they can be formatted to a different file format
Some have a partition table and cannot be changed without flipping the "fixed" bit - which may be protected.
Some have the fixed bit set which makes the behave like USB HARD drives which can be repartitioned.

The first thing I do with any flash is try to set the fixed bit so I can get control over it and the second is to enable write buffering so that writing is a reasonable speed - though that does mean having to take care when removing by EJECTING the drive from the OS.

yancek 04-06-2017 08:48 AM

Quote:

Some flash have a single "partition" with no partition table and cannot be resized though they can be formatted to a different file format
Some have a partition table and cannot be changed without flipping the "fixed" bit - which may be protected.
Some have the fixed bit set which makes the behave like USB HARD drives which can be repartitioned.
Interesting information but I'm not sure of the relevance to this post which is why the same usb device can have multiple partitions with windows filesystems which are accessible/usable from Linux but only the first one is accessible/usable from windows. Based on the output in the initial post, the OP has two partitions but just can't access the second from windows. This has been my experience with multiple partition flash drives also and from the perspective of microsoft, it makes perfect sense.

dave@burn-it.co.uk 04-06-2017 10:07 AM

The relevance is that Windows will see all of them if the FIXED bit is set and will only see the first if it is not.

yancek 04-06-2017 03:52 PM

Quote:

The relevance is that Windows will see all of them if the FIXED bit is set and will only see the first if it is not.
And does this make the second, third, etc. partitions not just viewable from windows but accessible/writeable?
I've never done this myself as I rarely use windows. On flash drives with multiple partitions, the partitions are accessible and writeable for me from Linux and are all seen from windows Disk Management but not writeable, other than the first partition.

I'm curious because the link to the tenforums posted above discusses this and whatever software the posters were using did not seem to work.

What is it about windows that requires this when Linux doesn't?

dave@burn-it.co.uk 04-06-2017 04:25 PM

Of course they are Writable if that is how they are set up. As I said Windows treats them as Disks.

There are all sorts of combinations of features available and I doubt whether I have tried them ALL but with all the ones I have tried Linux treats them exactly the same way as Windows does and vice versa.

There are also many different ways the USB controllers in Flash drives work - and as far as I know no standard- so the things you can change varies from make to make and even within drives of the same make.


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