LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   disk formats, getting the information and potentially changing it (https://www.linuxquestions.org/questions/linux-newbie-8/disk-formats-getting-the-information-and-potentially-changing-it-676038/)

Bill Shankley 10-13-2008 07:12 AM

disk formats, getting the information and potentially changing it
 
Hi,

Say i plug a usb disk in and want to see what format it is i.e. FAT32, NTFS etc how would i do that?

I've used sfdisk which is useful for onboard hard drives but what about usb sticks and usb hard drives?

Also how would i then go on to change the format from one to the other.

Newbie question i know but that's exactly what i am.

Thanks, Bill

i92guboj 10-13-2008 07:48 AM

fdisk -l should list them all.

To change the format you need to reformat, except for a few concrete cases. For example, you can mount a ext3 drive as ext2, and vice-versa. You can also mount ext3 as ext4, but if you have any ext4-only feature enabled then you can't mount it back as ext3 anymore once you write to it.

But, as said, the general rule is that to change from one format to another, you need to reformat.

syg00 10-13-2008 07:58 AM

Quote:

Originally Posted by i92guboj (Post 3308651)
fdisk -l should list them all.

That will only list what type the partition was created with. Not necessarily the same as what the filesystem is created as.
I prefer to use "file -s /dev/<partition>"

Check "man mkfs" for making a filesystem (i.e. reformat a partition).

jschiwal 10-13-2008 09:52 AM

You can also use the udevinfo command. It will tell you the filesystem, label, uuid and other information.

example:
udev -q env -n /dev/sdd1

You can run udevinfo as a normal user.

Bill Shankley 10-13-2008 10:25 AM

thanks syg00, that's exactly what i was looking for, mkfs was bang on too.

Reformatting a drive to get a different format kind of speaks for itself really, i know what i want to do just not always how to do it!

Thanks for all your help.

Bill

syg00 10-13-2008 05:02 PM

You might find "apropos" useful - "man apropos" (even "man man" might be a good place to start).
To some extent you need to know what you're looking for - try "apropos filesystem" for example.


All times are GMT -5. The time now is 09:29 PM.