Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] usb flash disck file system
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
umka69
n00b
n00b


Joined: 31 Mar 2013
Posts: 61

PostPosted: Sat May 04, 2013 3:21 pm    Post subject: [SOLVED] usb flash disck file system Reply with quote

Guys, I deleted all partitions from flash drive device... :?
Code:
 Den ~ # fdisk /dev/sdc
Welcome to fdisk (util-linux 2.22.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Команда (m для справки): p

Disk /dev/sdc: 3933 MB, 3933290496 bytes, 7682208 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x4d411b50

Устр-во Загр     Начало       Конец       Блоки   Id  Система

Команда (m для справки):

So I tried to bring it to life. The task is to make usb flash device again. But there is a problem. What file system type do I need to use?
PS: I also need to us this device with Windows NT too.


Last edited by umka69 on Tue May 07, 2013 1:02 pm; edited 2 times in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 31373
Location: 56N 3W

PostPosted: Sat May 04, 2013 3:24 pm    Post subject: Reply with quote

umka69,

Do you need your data back or just to use the flash drive again?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
umka69
n00b
n00b


Joined: 31 Mar 2013
Posts: 61

PostPosted: Sat May 04, 2013 3:30 pm    Post subject: Reply with quote

I need only to use the flash again.
Hmm... by the way, is it really possible to get the information from there?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 31373
Location: 56N 3W

PostPosted: Sat May 04, 2013 3:54 pm    Post subject: Reply with quote

umka69,

If all you did was to delete the partition table - yes.
Everything is still there but the pointers to your data are gone. Thats what the partition table is.
If you recreate the partition table as it was before, you get your data back too.

As the partition table is outside of your filesystem, you can have a many goes as it takes, to recreate it. It will not damage your data.
On a FLASH disk, there is normally only a single partition as thats all older versions of Windows could read there.

Not all FLASH disks are partitioned. Some are just like big floppies - there is no partition table. The way to tell is to try to treat it like a floppy.
If it fails , there is no harm done.

Try
Code:
mount -t vfat -o ro /dev/sdc /mnt/gentoo
if that works, you have a partitionless flash drive.
You will need vfat support for your kernel.
Post any error messages.

You can also run testdisk on your FLASH drive. One of the things it can do is scan the drive looking for sectors that look like they are the beginning of a partition and optionally, rewrite the partition table.

Both the attempted mount and the testdisk scanning are harmless as neither operations write any data to the flash drive.
Post what tesrdisk shows.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
umka69
n00b
n00b


Joined: 31 Mar 2013
Posts: 61

PostPosted: Sat May 04, 2013 4:50 pm    Post subject: Reply with quote

I got it. Thanks, NeddySeagoon. :)

I tried to mount with vfat file system tipe but it failed.
Code:

Den ~ # mount -t vfat -o ro /dev/sdc /mnt/usb
mount: wrong fs type, bad option, bad superblock on /dev/sdc,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail or so

it seems that vfat is switched on in the kernel
Code:

Den ~ # cat /usr/src/linux/.config | grep VFAT
CONFIG_VFAT_FS=y
Back to top
View user's profile Send private message
SlashBeast
Moderator
Moderator


Joined: 23 May 2006
Posts: 2799

PostPosted: Sat May 04, 2013 6:15 pm    Post subject: Reply with quote

you may need to add offset option, the mbr + possibly align of the partitions. testdisk should be able to find filesystems.
_________________
BitBucket -- better-initramfs to address many usecases and linux's limitations.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 31373
Location: 56N 3W

PostPosted: Sat May 04, 2013 7:16 pm    Post subject: Reply with quote

umka69,

That was a useful test - it confirms that your flash stick should have a partition table.

The next step is to look for lost partitions with testdisk. It sometimes finds false positives - thats real data that looks like the start of a partition but isn't. Once you post the output from testdisk, we can modify the mount command to discover your real filesystem without making a partition table.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
umka69
n00b
n00b


Joined: 31 Mar 2013
Posts: 61

PostPosted: Sat May 04, 2013 8:00 pm    Post subject: Reply with quote

ok. I ran testdisk, chose the flash and got this:
Code:
TestDisk 6.12, Data Recovery Utility, May 2011
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org


Disk /dev/sdc - 3933 MB / 3751 MiB -  USB FLASH DRIVE

Please select the partition table type, press Enter when done.
>[Intel  ] Intel/PC partition
 [EFI GPT] EFI GPT partition map (Mac i386, some x86_64...)
 [Humax  ] Humax partition table
 [Mac    ] Apple partition map
 [None   ] Non partitioned media
 [Sun    ] Sun Solaris partition
 [XBox   ] XBox partition
 [Return ] Return to disk selection




Note: Do NOT select 'None' for media with only a single partition. It's very
rare for a drive to be 'Non-partitioned'.


what a should a choose?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 31373
Location: 56N 3W

PostPosted: Sat May 04, 2013 8:30 pm    Post subject: Reply with quote

umka69,

Code:
>[Intel  ] Intel/PC partition
Is the correct choice.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
umka69
n00b
n00b


Joined: 31 Mar 2013
Posts: 61

PostPosted: Sat May 04, 2013 8:36 pm    Post subject: Reply with quote

after analyzing result is no partitions.
Code:

TestDisk 6.12, Data Recovery Utility, May 2011
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/sdc - 3934 MB / 3752 MiB - CHS 1016 122 62
     Partition               Start        End    Size in sectors






Keys A: add partition, L: load backup, Enter: to continue
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 31373
Location: 56N 3W

PostPosted: Sat May 04, 2013 8:46 pm    Post subject: Reply with quote

umka69,

Tell testdisk to Rebuild a valid FAT boot sector.
This will ask you if you want to write the partition table before it does it.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
umka69
n00b
n00b


Joined: 31 Mar 2013
Posts: 61

PostPosted: Sat May 04, 2013 9:28 pm    Post subject: Reply with quote

I can't find [Rebuild BS] button. :(
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 31373
Location: 56N 3W

PostPosted: Sat May 04, 2013 10:05 pm    Post subject: Reply with quote

umka69,

That page must be out of date :(

Do the quck search, when that completes and finds nothing, the options at the bottom of the screen include Deeper Search.
Thats worth a try.

You only need do this if you want your data back - If you do not need your data, you can make a single partition, then create a vfat filesystem on it. That will be FAT32, which Windows can read. This process will destroy your data. Its the making of the filesystem step thats destructive.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
umka69
n00b
n00b


Joined: 31 Mar 2013
Posts: 61

PostPosted: Tue May 07, 2013 1:02 pm    Post subject: Reply with quote

The problem is solved.
Thanks a lot! :D
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 31373
Location: 56N 3W

PostPosted: Tue May 07, 2013 6:15 pm    Post subject: Reply with quote

umka69,

Please tell what you did - it will help others reading this thread.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
umka69
n00b
n00b


Joined: 31 Mar 2013
Posts: 61

PostPosted: Thu May 09, 2013 8:41 pm    Post subject: Reply with quote

ok... in my situation the solution is just to make a partition on the device, for example by fdisk program. then choose VFAT file system. this way:
Code:
 # fdisk /dev/<your device>
# mkfs -t vfat /dev/<your partition>

PS: partition mast be primary.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum