LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Question about fdisk command (https://www.linuxquestions.org/questions/linux-newbie-8/question-about-fdisk-command-775966/)

shariefbe 12-15-2009 11:19 PM

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

syg00 12-15-2009 11:25 PM

/dev/sdb - fdisk deals with devices.
Probably need sudo on Ubuntu.

shariefbe 12-15-2009 11:32 PM

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?

pixellany 12-15-2009 11:44 PM

"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.....;))

pixellany 12-15-2009 11:46 PM

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.

shariefbe 12-15-2009 11:50 PM

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

shariefbe 12-16-2009 12:09 AM

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?

pixellany 12-16-2009 12:09 AM

To create filesystems on your partitions: "mkfs"

"man mkfs" for details

Is "RAW" a filesystem?? (Never seen that before)

pixellany 12-16-2009 12:14 AM

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


shariefbe 12-16-2009 12:35 AM

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

pixellany 12-16-2009 08:13 AM

Your question has already been answered here!!!

Did you look at the man page for "mkfs"?

sumeet inani 12-16-2009 08:29 AM

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.

pixellany 12-16-2009 08:50 AM

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....


All times are GMT -5. The time now is 02:48 PM.