LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 07-29-2009, 11:37 AM   #1
siawash
Member
 
Registered: Jun 2004
Location: Ireland
Distribution: Zorin 6
Posts: 589

Rep: Reputation: 32
repartitioning & format


Hello, can anyone show me how to repartition and format my external drives. To date, I have only done this when reinstalling the OS.

I have two external usb drives, sdb and sdc. sdb is using ext3 and the other unpartitioned. I want to repartition the latter with ext3. Could someone show me how to do this?

***********************************************************************

siawash@linux-s53f:~> sudo /sbin/fdisk -l

Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x294599de

Device Boot Start End Blocks Id System
/dev/sda1 1 1402 11261533+ 12 Compaq diagnostics
/dev/sda2 1403 15918 116592640 7 HPFS/NTFS
/dev/sda3 15919 16403 3895762+ 82 Linux swap / Solaris
/dev/sda4 * 16404 30401 112438935 83 Linux

Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000b66d6

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 19457 156288321 83 Linux

Disk /dev/sdc: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000bbebb

Device Boot Start End Blocks Id System
/dev/sdc1 2 38913 312560640 f W95 Ext'd (LBA)
/dev/sdc5 2 38913 312560608+ 83 Linux
siawash@linux-s53f:~>
siawash@linux-s53f:~>
*************************************************************************
 
Old 07-29-2009, 11:41 AM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
If you have a gui available, GParted is a good tool and you can just graphically do it.

Or you can use cfdisk.
 
Old 07-29-2009, 12:06 PM   #3
siawash
Member
 
Registered: Jun 2004
Location: Ireland
Distribution: Zorin 6
Posts: 589

Original Poster
Rep: Reputation: 32
Thanks for the reply. I am currently using OpenSUSE. It cannot find gparted in it's repositories nor is it installed.

I managed to get cfdisk up but it does not show the external drives at all. Only showing sda. I am using sudo

sudo /sbin/cfdisk

I am trying to learn so I prefer non graphic utilities.
 
Old 07-29-2009, 12:24 PM   #4
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
Try sudo /sbin/cfdisk /dev/sdc.
 
Old 07-29-2009, 12:41 PM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
After creating an ext3 partition using fdisk you will need to format it with ext3 using the command mkfs.ext3
 
Old 07-29-2009, 01:02 PM   #6
siawash
Member
 
Registered: Jun 2004
Location: Ireland
Distribution: Zorin 6
Posts: 589

Original Poster
Rep: Reputation: 32
Thanks pljvaldez. cfdisk repartitioned my drive with type 83 as general Linux fs. There was no option to for ext3 specifically.

catkin, that command mkfs.ext3 is not showing which drive we are referring to. Is it :

mkfs.ext3 /dev/sdc ???

Thanks
 
Old 07-29-2009, 01:15 PM   #7
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by siawash View Post
Thanks pljvaldez. cfdisk repartitioned my drive with type 83 as general Linux fs. There was no option to for ext3 specifically.

catkin, that command mkfs.ext3 is not showing which drive we are referring to. Is it :

mkfs.ext3 /dev/sdc ???

Thanks
Not quite correct but on the right lines. mkfs.ext3 /dev/sdc1 (or whatever the name of the new partition was as shown by cfdisk). /dev/sdc is the whole disk, /dev/sdc<n> are the partitions on the disk, so you used cfdisk /dev/sdc because you wanted to work with that whole disk but you want to create the file system in one of its partitions.
 
Old 07-29-2009, 01:15 PM   #8
siawash
Member
 
Registered: Jun 2004
Location: Ireland
Distribution: Zorin 6
Posts: 589

Original Poster
Rep: Reputation: 32
OK, i managed to format the sdc using mkfs.ext3 /dev/sdc.

Now when I check the partitions with

sudo /sbin/fdisk -l

I get

Disk /dev/sdc doesn't contain a valid partition table
 
Old 07-29-2009, 01:18 PM   #9
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by siawash View Post
OK, i managed to format the sdc using mkfs.ext3 /dev/sdc.

Now when I check the partitions with

sudo /sbin/fdisk -l

I get

Disk /dev/sdc doesn't contain a valid partition table
You would not normally format a whole drive---just a partition. I think maybe you wanted:
mkfs.ext3 /dev/sdc1
 
Old 07-29-2009, 01:25 PM   #10
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
Do yourself a favor and download PartedMagic:

http://partedmagic.com/

It's a linux livecd that specializes in gparted and other useful utilities. It greatly simplifies partitioning operations and is a useful cd to have in your kit.
 
Old 07-29-2009, 01:25 PM   #11
siawash
Member
 
Registered: Jun 2004
Location: Ireland
Distribution: Zorin 6
Posts: 589

Original Poster
Rep: Reputation: 32
Hi kilgoretrout, I will try partedmagic at the very last resort but I am trying to learn this stuff as well.


I tried mkfs.ext3 /dev/sdc1 and get

**************************************************************************************************** **

mke2fs 1.41.1 (01-Sep-2008)
Could not stat /dev/sdc1 --- No such file or directory

The device apparently does not exist; did you specify it correctly?
siawash@linux-s53f:~>

***************************************************************************************************
But when I do the following it is recognized.:

**************************************************************************************************** *
siawash@linux-s53f:~> sudo /sbin/fdisk -l

Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x294599de

Device Boot Start End Blocks Id System
/dev/sda1 1 1402 11261533+ 12 Compaq diagnostics
/dev/sda2 1403 15918 116592640 7 HPFS/NTFS
/dev/sda3 15919 16403 3895762+ 82 Linux swap / Solaris
/dev/sda4 * 16404 30401 112438935 83 Linux

Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000b66d6

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 19457 156288321 83 Linux

Disk /dev/sdc: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdc1 1 38913 312568641 83 Linux

Last edited by siawash; 07-29-2009 at 01:35 PM.
 
Old 07-29-2009, 01:28 PM   #12
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
If you want to get GParted, here's a good opensuse howto.

Otherwise, do like you did before with sudo /sbin/cfdisk /dev/sdc and then mkfs.ext3 /dev/sdc1 (not sure if mkfs has to be run from sudo also).
 
Old 07-29-2009, 01:58 PM   #13
siawash
Member
 
Registered: Jun 2004
Location: Ireland
Distribution: Zorin 6
Posts: 589

Original Poster
Rep: Reputation: 32
Nope, sorry. I am still getting the same errors as root.

*****************************************************************
linux-s53f:/home/siawash # sudo /sbin/cfdisk /dev/sdc

linux-s53f:/home/siawash # /sbin/mkfs.ext3 /dev/sdc1
mke2fs 1.41.1 (01-Sep-2008)
Could not stat /dev/sdc1 --- No such file or directory

The device apparently does not exist; did you specify it correctly?

***********************************************************************

Does it matter if I make the partition as primary and not logical?

Because i am using only one large primary partition.

Last edited by siawash; 07-29-2009 at 02:00 PM.
 
Old 07-29-2009, 02:16 PM   #14
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by siawash View Post
Nope, sorry. I am still getting the same errors as root.

*****************************************************************
linux-s53f:/home/siawash # sudo /sbin/cfdisk /dev/sdc

linux-s53f:/home/siawash # /sbin/mkfs.ext3 /dev/sdc1
mke2fs 1.41.1 (01-Sep-2008)
Could not stat /dev/sdc1 --- No such file or directory

The device apparently does not exist; did you specify it correctly?

***********************************************************************

Does it matter if I make the partition as primary and not logical?

Because i am using only one large primary partition.
Strange. Your earlier posting showed
Code:
siawash@linux-s53f:~> sudo /sbin/fdisk -l
[snip]
Device    Boot Start End   Blocks    Id System
/dev/sdc1      1     38913 312568641 83 Linux
so /dev/sdc1 existed then.

You do need sudo to run mkfs.ext3.

It does not matter whether the partition is primary or logical.

Try
Code:
sudo mkfs.ext3 /dev/sdc1
and if that doesn't work post the output from
Code:
sudo /sbin/fdisk -l /dev/sdc
ls -l /dev/sd*
Output is easier to read if you put it in CODE tags, that's the word CODE enclosed in [ and ].

Best

Charles
 
Old 07-29-2009, 02:41 PM   #15
siawash
Member
 
Registered: Jun 2004
Location: Ireland
Distribution: Zorin 6
Posts: 589

Original Poster
Rep: Reputation: 32
Hi, here is the output


Code:
linux-s53f:/home/siawash # /sbin/sudo mkfs.ext3 /dev/sdc1
bash: /sbin/sudo: No such file or directory
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Format & Install DSL 3.0.1 talukder Linux - Newbie 1 12-17-2007 03:48 AM
how to format the hard disks(removable & fixed) ? himy Linux - Newbie 11 09-09-2007 06:23 PM
SD card & USB stick format chaos JohnKFT Slackware 5 10-04-2006 06:31 PM
Just installed, How to wipe & format Slave HD newtwolinux Linux - Newbie 1 05-15-2005 07:44 PM
RH7.2 install & 'invalid compression format' ajayn Linux - Software 5 03-16-2002 04:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 03:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration