1 (edited by gedakc 2016-05-04 22:07:16)

Topic: [closed] Formatting disabled

Hello!
I plugged in a USB flash stick but Ubuntu didn't see it, so I reboot the machine and it tried to mount it but failed saying it was NTFS or something and so I had to force mount it with mount -t ntfs-3g /dev/sdb1 /media/swap -o force so then I wanted to format it into a linux format and installed Gparted, but the menu items were disabled so I read that I need to dismount it first, so I dismounted it and it vanished from Gparted. I tried again to remount it in the terminal but got an error saying sdb1 did not exist. So now I am confused to how I am going to format it.

Could there be added a feature to bypass the problem of not being able to format a mounted drive? Just require root to do it or something.

I am totally new to linux so I probably have 1000 ways of formatting the drive that I don't know about, I am born and raised on windows but trying to move to linux, I just wish there were simpler programs to do things like "Right click the drive and say format"

*by the way the usb drive's name was swap because I was using it as a swap on my xp laptop which has little ram and a slow hard disk*

2

Re: [closed] Formatting disabled

USB flash sticks aren't always easy to handle.
Older models don't contain a "hard drive" structure, so GParted can't partition them. In fact, they can't be partitioned. mswindows reporte them as "removable storage units" and till recently it recognised one partition only in these media. Operating system couldn't format them, so manufacturers provided a special formatting software just for these sticks.
Recently, there are models that support partitioning.

It is quite strange to use a usb stick as swap with xp, because the swap function is initialized before the usb ports during xp boot up (this has changed in vista, permitting the use of usb memories as swap file media). Unless you boot normally on hard drive and then you change the location of the swap file to the usb unit (I never tried it).

*** It is highly recommended to backup any important files before doing resize/move operations. ***

3 (edited by cmdr 2008-08-21 01:58:02)

Re: [closed] Formatting disabled

Hi,

"Gparted" is a very good tool for partitioning USB-Sticks ... if they are recognized as harddisks !. "Shipped" by the manufacturer they may be formatted either as "superfloppy" (no MBR) or "ZIP-drive" (less than 63 blocks between existing MBR and PBR (from some few up to 32 blocks), formatted  in FAT16 or FAT32 filesystem ... or as removable harddisks (MBR, first and single Partition Boot Record =PBR at block 63 (0x3F), normally NOT with active bootflag). Note, that NTFS with its "journalling" filesystem (continous read-write processes, even if nothing gets stored) "wears" out memory cells on the stick chips much faster than the above mentioned preferred filesystems. And a second advice in that context is not to do any "defragmentation" on USB-Sticks, because the stick software "fragments" every file to avoid wearing out memory cells too soon, it's the wanted normal state.

You can download a little Win tool by HP (hp usb disk storage format utility), which "converts" every stick to the harddisk format. If you do it under Win XP and do NOT choose the boot option (only Win 98 boot possible), setting the bootflag with "Gparted" will do the same job. Its even the fastest way to get a Linux bootable stick. Just copy the files "GRLDR" and "menu.lst" from "GRUB4DOS" to the root folder of the stick and rename "GRLDR" to "NTLDR". Now the Win XP boot records initialize at boot a Linux boot manager, which is able to start Win (98, 2k, XP / the "original" NTLDR renamed to XPLDR or so, if also necessary on the stick; Vista boots with some specialties) or Linux at your choice ...the easieast way to have an emergency start medium for your machine(s)! Of course, you have to edit and adapt "menu.lst", which is a text file (there is a very good pdf documentation for "GRUB", but not included in "GRUB4DOS" distribution with its few examples!). This is my way of having several versions of "GParted", "PartedMagic" and "Puppy Linux" available on one stick, its my "Swiss pocket knife" or "Leatherman" for partitioning !

I do not know, if it works generally, but I had one USB Stick converted to the harddisk format just by copying the MBR of my harddisk to the sticks first block, deleting all partition table entries but the first (bootable). "GParted" noticed a faulty state and corrected it. It could then be partitioned and formatted. Note, that PBRs for Win filesystems from "GParted" are NEVER bootable and can NOT be set "bootable". You have to reformat the partition under Win and set the PBR bootflag manually (for FAT 32, label MSDOS5.0 or 5.1 : byte 0x...40 from 0x00 to 0x80)

As you might already know, Win 2k and XP do not support partitioned USB-Sticks, whereas Win 98 and ME have no problems at all. But there is a very small driver from Hitachi (hitachi microdrive filter driver), which solves the problem by simulating non-removable harddisks. The only difficulty is to adapt the INF-File, because you have to fill in the individual HardwareID (e.g. USB\VID_xxxx&PID_yyyy) of your stick. If your stick is plugged to your machine, you find it in device manager properties of the stick (details). If the INF-File of the driver is prepared, choose "update driver" in device manager and the location, where both driver and INF-File are stored, then select "Hitachi Microdrive" and discard the usual warnings. That's all. You can even install a complete, working Win XP on such a prepared stick (copy the content of the CD to the first, bootable partition, install it on the second partition, the fastest way. Note: Mark your  HDD temporarily as Linux filesystem / ID 0x83, that it gets not involved; disabling it by the BIOS is NOT sufficient.)!

Bye
cmdr

4 (edited by tonireynolds39 2010-11-10 10:12:09)

Re: [closed] Formatting disabled

Hi, I am a new member. dunno whether i hv to create new thread or not, my prob is- I have to install my ubuntu server again ( I was hacked:(, so replacing the Intrepid Ibex with Lusty Lynx) and have to do it from a usb flash drive as my cd rom doesn't work. I need to know if my system is amd64 (which I think it is, it was built from scratch about 4 years ago or i386. Entering 'uname -r' just gave me numbers like 12.?.? (sorry didn't write it down, now I'm on the Windows computer. But it didn't show amd64 or i386 so I'm wondering how to find out. Thanks.