mkpart primary 1GB 1.5GB
The parted command (when I print the details) outputs something like below:
1 2048MB .......
what I want to bring in your notice that only 1 row came showing the complete size of the disk (detachable device) although I created 2 partitions with fdisk command.
The output of the below differs from above
It outputs 2 rows as I created 2 partitions. Why then parted command doesn't show it and shows the total size of the disk.
My other question :
When I put a fresh pendrive (without partitioning) it shows as one. (I mean it doesn't show that there are any partitions as I havent created any which is fine). Now when I create a partition say /dev/sdb1 (of /dev/sdb) then the output of fdisk shows sdb1. What about the remaining space. Now after creating a partition (sdb1), why then only sdb1 can be mounted and not the other part. Because earlier when there was no partition , it had mounted the complete disk.
1) Why don't you show the entire output of all relevant commands so we can compare and then, hopefully, conclude the reasons for any strange behaviour?
2) I think that all pen drives come "preformatted" as one large disk/partition, so you can "mount the complete disk". As soon as you interfere yourself with partition tools, you are responsible for the result, i.e. you have to partition the space (and create a file system) you want to access.