LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-16-2009, 12:19 AM   #1
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Rep: Reputation: 31
Question about fdisk command


Hi i am trying to do partition in my SD card. for that i tried

my device name is sdb1. but it says

Code:
ariem@ariem-desktop:/dev$ fdisk /dev/sdb1

Unable to open /dev/sdb1
I dont know what will be the problem. Please help me
 
Old 12-16-2009, 12:25 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,038

Rep: Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912
/dev/sdb - fdisk deals with devices.
Probably need sudo on Ubuntu.
 
Old 12-16-2009, 12:32 AM   #3
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Original Poster
Rep: Reputation: 31
Yes thank you. Now it works fine. I partitionaed my SD card. ANd it shows the out for "print the partition table" is

Code:
Disk identifier: 0x00000000

     Device Boot      Start         End      Blocks   Id  System
/dev/sdb1p1               1           4        8032+  83  Linux
/dev/sdb1p2               5          11       14112   83  Linux
/dev/sdb1p3              12         956     1905120   83  Linux

Command (m for help):
Now in what file system this partitions are. And how to change the file system of each partition.
When i open /media/disk i am not seeing any partitioned part. Just it shows all the things. what is wrong?
 
Old 12-16-2009, 12:44 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
"unable to open" means you need to be root---or use sudo.

Once you have the right privileges and try to do fdisk on a partition, THEN it will tell you--among other things--that there are no partitions. (I don't know what would happen if you attempted to create some.----On my system, it's acting like it is quite willing to try.....)
 
Old 12-16-2009, 12:46 AM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
After creating partitions, you then have to create a filesystem on each one using mkfs. Then, you have to mount the partitions to use them.
 
Old 12-16-2009, 12:50 AM   #6
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Original Poster
Rep: Reputation: 31
That command i know. But i am confused how to use that.
Sorry i partitioned only one partion into three. Now i partitoned the whole disk into three partition
Now i partitoned the whole disk. see the partition table

Code:
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1           4        8032+  83  Linux
/dev/sdb2               5          11       14112   83  Linux
/dev/sdb3              12         957     1907136   83  Linux
Now how to change the file system for each partion?
i want to change
first partition as RAW
Second partition as FAT32
Third as EXT3
What are the command i have to give change the file system of each partition. I am confused. Please help me
 
Old 12-16-2009, 01:09 AM   #7
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Original Poster
Rep: Reputation: 31
I think i changed the file system sdc2 and sdc3 partitions. see the output. is this changed
Code:
root@ariem-desktop:/dev# mkfs.ext3 /dev/sdc3
mke2fs 1.41.4 (27-Jan-2009)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
119280 inodes, 476784 blocks
23839 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=490733568
15 block groups
32768 blocks per group, 32768 fragments per group
7952 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912

Writing inode tables: done                            
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 31 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
root@ariem-desktop:/dev# mkfs.vfat /dev/sdc2
mkfs.vfat 3.0.1 (23 Nov 2008)
root@ariem-desktop:/dev#
But i am getting my disk in /media. just i am geeting my device names in /dev file system. why it is like this?is there any wrong?
 
Old 12-16-2009, 01:09 AM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
To create filesystems on your partitions: "mkfs"

"man mkfs" for details

Is "RAW" a filesystem?? (Never seen that before)
 
Old 12-16-2009, 01:14 AM   #9
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Devices are in /dev

To access a device, you have to mount it. The typical locations are /mnt and /media, but you can pretty much mount a device anywhere you want.

Suppose you have sda3 (formatted with a standard filesystem) and you wnat to access it using a new node named "/media/mystick":
Code:
cd media
mkdir mystick
mount /dev/sda3 mystick
cd mystick
ls     ## to see what's there
 
Old 12-16-2009, 01:35 AM   #10
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Original Poster
Rep: Reputation: 31
Simple thing. Now i have 2Gb SD card. I want to make 3 partitions in that and i have to change the file system of each partition. 2nd partion as FAT32 and 3rd partion as EXT#. 1st partion no need to change the file system. now what are all the commands used to create and change the partition file system. Now my device name is /dev/sdd
 
Old 12-16-2009, 09:13 AM   #11
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Your question has already been answered here!!!

Did you look at the man page for "mkfs"?
 
Old 12-16-2009, 09:29 AM   #12
sumeet inani
Member
 
Registered: Oct 2008
Posts: 898
Blog Entries: 26

Rep: Reputation: 49
Why don't you use gparted utility to create desired partitions.

In ubuntu you can run
$sudo apt-get install gparted
For fedora
#yum install gparted

Run gparted as superuser to see all devices & their corresponding filesystem detected that is
#gparted &
It would be another case if you insist on using basic commands.

Just trying to help.If you find this post useful then thank me by pressing thumbs up button.Thank You.

Last edited by sumeet inani; 12-16-2009 at 10:00 AM.
 
1 members found this post helpful.
Old 12-16-2009, 09:50 AM   #13
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
At one point, the OP said that he already HAD partitions and just wanted to format with filesystems.

Regardless, this thread now contains complete instructions for partitioning AND formatting....
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
fdisk command kaushalsingh Linux - Newbie 1 11-20-2009 04:12 AM
About fdisk command satimis Linux - Software 5 04-05-2006 12:29 PM
fdisk command - can't get it to work!! sknarf Linux - Software 4 06-23-2004 02:59 AM
fdisk command thefetus Linux - Newbie 5 11-19-2003 03:15 PM
fdisk not a command? toob Linux - Newbie 11 04-26-2003 11:56 PM


All times are GMT -5. The time now is 06:57 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration