D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Formatting external drives etc

 

On Sat, 9 Apr 2011, Neil Winchurst wrote:

Rob Beard wrote:
On 08/04/11 17:45, Neil Winchurst wrote:
I have a USB memory stick and may one day need an external hard drive.
When bought how will they be formatted? And if I would like them to be
formatted to eg EXT4 what would be the best utility to use?

Thanks for any help

Neil

They will most likely be formatted to FAT32.

Personally I tend to leave my USB sticks in FAT32 format, that way I can
transfer them between my notebook, my XBOX360, PS3 and the wifes's PC.

Two points. All the computers at home are Linux so I have no need of Windows at all. Secondly, I thought that with FAT32 you lose permissions. Is that correct?

Yes. And there are issues with long filenames too...

If I do format anything though (my external USB hard drive is EXT4
format) I use mkfs.ext4 in the command line.

I also tend to change the partition type from 6 (or b or c I believe)
which are Windows types to type 83 which is set to Linux.

I must have a look at this, which is new to me. Wouldn't formatting to say EXT4 automatically change the partition type too?

No. Well - Not the standard command-line mkfs command, anyway. Who knows what a graphical tool will do for you.

The partition type is only used as a hint anyway, it's not strictly needed. You can even do away with a parition table - unless you want to make it bootable. You may have to specify filesystem type at mount time though.

e.g.

  # fdisk -l /dev/sdb

  Disk /dev/sdb: 1031 MB, 1031798784 bytes
  16 heads, 32 sectors/track, 3936 cylinders
  Units = cylinders of 512 * 512 = 262144 bytes
  Disk identifier: 0xafe99f91

     Device Boot      Start         End      Blocks   Id  System
  /dev/sdb1   *           1        3936     1007600    e  W95 FAT16 (LBA)

this 1GB drive has one partition - lets make a filesystem with the
entire unit:

  # mkfs -t ext3 /dev/sdb
  mke2fs 1.41.3 (12-Oct-2008)
  /dev/sdb is entire device, not just one partition!
  Proceed anyway? (y,n) y
  ...etc...

  # mount -t ext3 /dev/sdb /mnt
  # df -h /mnt
  Filesystem            Size  Used Avail Use% Mounted on
  /dev/sdb              969M   18M  903M   2% /mnt

  # fdisk -l /dev/sdb

  Disk /dev/sdb: 1031 MB, 1031798784 bytes
  32 heads, 62 sectors/track, 1015 cylinders
  Units = cylinders of 1984 * 512 = 1015808 bytes
  Disk identifier: 0x00000000

  Disk /dev/sdb doesn't contain a valid partition table

Always remember to unmount it rather than just unplugging it.

Gordon

--
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq