LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   fdisk / mount / format / help! (https://www.linuxquestions.org/questions/linux-newbie-8/fdisk-mount-format-help-723171/)

cynicalpsycho 05-02-2009 12:02 PM

fdisk / mount / format / help!
 
The Situation:
I'm trying to format a flashdrive so I can set up a certain linux distro (backtrack4beta) to boot from the drive with persistent changes.


The Method:
1. The method I've been using involves first formating the drive then making the 1st partition (the boot partition) be fat32 which will house the ISO and also making a 2nd partition which will house all of the changes.
2. Then I will use Unetbootin to install the my ISO.
3. Then I will make changes necessary in the syslinux.cfg file to enable persistent changes.


The Problem:
The problem is I've yet to make it past step 1 of the method. I've done this in the past but I can't seem to get it to work on this new USB flashdrive.

Here's what I've done:
I've went through the process with fdisk you know n, p, filled in all the right sizes and I got this as a result:
Code:

Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xc2c310c6

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1              1        132    1060258+  b  W95 FAT32
/dev/sdb2            133      14593  116157982+  83  Linux

That's the way it should look... I think...

But the when I try to unplug and plug it back in, the flash doesn't seem to want to mount like it should. and I've tried using the mount command but this is all i get.
Code:

root@ubuntu:/home/cynicalpsycho# mount /mnt/sdb
mount: can't find /mnt/sdb in /etc/fstab or /etc/mtab

I get the same if I try mount sdb1 or sdb2

However when I boot up my other flashdrive that i've already installed backtrack to (using THIS method)... both of the partitions pop right up...

does anyone have any idea where my problem is here?

Nylex 05-02-2009 12:34 PM

The problem is that because you don't have fstab entries for your partitions, mount doesn't know where to mount them, or what filesystem types they have. So, you can specify these things on the command line, with e.g.

mount -t vfat /dev/sdb1 /mnt/tmp

which will mount /dev/sdb1 (with filesystem type vfat, i.e. FAT32) on /mnt/tmp. Read the man page for mount for more info about the available options.

cynicalpsycho 05-02-2009 01:05 PM

Quote:

Originally Posted by Nylex (Post 3527846)
The problem is that because you don't have fstab entries for your partitions, mount doesn't know where to mount them, or what filesystem types they have. So, you can specify these things on the command line, with e.g.

mount -t vfat /dev/sdb1 /mnt/tmp

which will mount /dev/sdb1 (with filesystem type vfat, i.e. FAT32) on /mnt/tmp. Read the man page for mount for more info about the available options.

Code:

root@ubuntu:/mnt# mount -t vfat /dev/sdb1 /mnt/tmp
mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
      missing codepage or helper program, or other error
      In some cases useful info is found in syslog - try
      dmesg | tail  or so

ahmm.... ?

And besides "you don't have fstab entries" that makes no since, because if that were the case, why am i able to load my other flash drives that use that same entry sdb (when plugged in first)?

hurry_hui 05-02-2009 01:12 PM

If I am not mistaken, you create the 1-Gib boot partition with FAT32 on missing directory.

The problem perhaps you have not created (mkdir) /mnt/tmp. You can check it by 'ls /mnt/tmp'.

cynicalpsycho 05-02-2009 01:30 PM

Quote:

Originally Posted by hurry_hui (Post 3527872)
If I am not mistaken, you create the 1-Gib boot partition with FAT32 on missing directory.

The problem perhaps you have not created (mkdir) /mnt/tmp. You can check it by 'ls /mnt/tmp'.

...
no... if that were the case I would have gotten the error i get in this example:

Code:

root@ubuntu:/home/cynicalpsycho# mount -t vfat /dev/sdb1 /mnt/dofus
mount: mount point /mnt/dofus does not exist

(which I did at first until I created the tmp file, then i got the other error...)

valencequark 05-02-2009 01:42 PM

Quote:

Originally Posted by cynicalpsycho (Post 3527831)
The Situation:
I'm trying to format a flashdrive so I can set up a certain linux distro (backtrack4beta) to boot from the drive with persistent changes.


The Method:
1. The method I've been using involves first formating the drive then making the 1st partition (the boot partition) be fat32 which will house the ISO and also making a 2nd partition which will house all of the changes.
2. Then I will use Unetbootin to install the my ISO.
3. Then I will make changes necessary in the syslinux.cfg file to enable persistent changes.


The Problem:
The problem is I've yet to make it past step 1 of the method. I've done this in the past but I can't seem to get it to work on this new USB flashdrive.

Here's what I've done:
I've went through the process with fdisk you know n, p, filled in all the right sizes and I got this as a result:
Code:

Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xc2c310c6

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1              1        132    1060258+  b  W95 FAT32
/dev/sdb2            133      14593  116157982+  83  Linux

That's the way it should look... I think...

But the when I try to unplug and plug it back in, the flash doesn't seem to want to mount like it should. and I've tried using the mount command but this is all i get.
Code:

root@ubuntu:/home/cynicalpsycho# mount /mnt/sdb
mount: can't find /mnt/sdb in /etc/fstab or /etc/mtab

I get the same if I try mount sdb1 or sdb2

However when I boot up my other flashdrive that i've already installed backtrack to (using THIS method)... both of the partitions pop right up...

does anyone have any idea where my problem is here?

unless i am missing something, fdisk is just a partitioner. you still have to make filesystems on your partitions. (mke2fs, et cetera).

one you have filesystems then you should be able to mount.

cynicalpsycho 05-02-2009 01:51 PM

Quote:

Originally Posted by valencequark (Post 3527894)
unless i am missing something, fdisk is just a partitioner. you still have to make filesystems on your partitions. (mke2fs, et cetera).

one you have filesystems then you should be able to mount.

That's not my understanding of fdisk.... when I was using fdisk, I specified the filesystems by using the "t" option. as you can see by the OP:
Code:

Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xc2c310c6

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1              1        132    1060258+  b  W95 FAT32
/dev/sdb2            133      14593  116157982+  83  Linux

and upon further review of mke2fs, it only seems to be used to make additional ext2 filesystems.

tommylovell 05-02-2009 02:23 PM

Both Nylex and valencequark are correct.

valencequark is correct in that you need to mkfs.vfat on your sdb1, and mke2fs on your sdb2 (mke2fs for ext2 or mkfs.ext3 for ext3).

fdisk simply manipulates the partition table, ie. says where each partition starts, ends, and what type it is. Then you need to format a filesystem on each partition (unless there is already one sitting there coincidentally from a prior use of the usb drive - but I would never rely on that).

Nylex is correct in that you need to specify type, device, and mountpoint if there is no matching entry in fstab.
But there needs to be a valid filesystem there that can be mounted. (If you have an automounter service running, it will mount filesystems for you, but if there are no valid filesystems on the device, it will take no action.)

custangro 05-02-2009 02:31 PM

Quote:

Originally Posted by cynicalpsycho (Post 3527902)
That's not my understanding of fdisk.... when I was using fdisk, I specified the filesystems by using the "t" option.

Then your understanding of fdisk is incorrect.

Fdisk just sets up your partitions...the "t" option just "labels" the partition...it doesn't format it.

You still need to format...something like this...

Code:

root@host# mkfs.vfat /dev/sdb1
How 'bout you try it instead of telling everyone they're wrong? ;)

H_TeXMeX_H 05-02-2009 04:06 PM

I don't really like fdisk, use cfdisk if you have it, the layout is more intuitive.

cynicalpsycho 05-02-2009 04:23 PM

Quote:

Originally Posted by custangro (Post 3527932)
Then your understanding of fdisk is incorrect.

Fdisk just sets up your partitions...the "t" option just "labels" the partition...it doesn't format it.

You still need to format...something like this...

Code:

root@host# mkfs.vfat /dev/sdb1
How 'bout you try it instead of telling everyone they're wrong? ;)

fair enough, I'll post back w/ my results.

cynicalpsycho 05-02-2009 04:56 PM

quick question...
does anyone know if gparted would do the same thing as me using:mkfs.vfat /dev/sdb1?

cynicalpsycho 05-02-2009 04:58 PM

nvm it does, and thanks people for clarifying my misconceptions! :D
My apologies if I seemed assholish... it's just who i am :P

custangro 05-02-2009 05:17 PM

Quote:

Originally Posted by cynicalpsycho (Post 3528022)
nvm it does, and thanks people for clarifying my misconceptions! :D
My apologies if I seemed assholish... it's just who i am :P

No problem...Linux is a learning experience :D


All times are GMT -5. The time now is 05:53 AM.