I can't find my files on hdb partly formated by linux
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I can't find my files on hdb partly formated by linux
HI
When I installed linux on hda, linux formated also hdb and created 3 partitions automatically.
The problem is I had personnal datas on hdb that I created on windows XP. I think I lost all files but I have a doubt ; When I see Gparted, it says that hdb sizes 20 GB and the total size of the linux partitions is 12.79 GB. I'm just wondering if the difference contain my datas.
How can I check that point ?
About HELIX, Dd, Testdisk, Photorec, Foremost and coats of paint...
Repartitioning a drive is like replacing name plates at the front door. Formatting a partition is like putting up a new coat of paint on the fence (if you scratch when the paint is dry you might find the other coats of paint ;-p).
(Part of) the data may still be recoverable. In short:
- mount disks readonly,
- make backup,
- try restoring the old partition table.
- else carve files from backup.
You'll need:
- HELIX, a Live CD with tools we need.
- another piece of physical storage, like an internal harddisk or external USB harddisk, of a bigger size than hdb (!).
- common sense, like not saving the HELIX .iso to a hdb partition for burning or booting HELIX before adding internal storage devices;-p
0. Start by making sure no further changes can be made to the disk by making the partitions readonly by booting the Live CD. It should mount partitions readonly (do check).
1. Add your extra storage device and (re)format it to have one ext2 partition. Make a mountpoint ('mkdir /rescue') and mount the partition ('mount /dev/sda1 /rescue').
2. Make a copy of hdb (using dd defaults): 'dd if=/dev/hdb of=/rescue/hdb.dd'. If backup fails do not continue.
3. Run 'testdisk' (read the docs) and see if it can find the original partitions. Write to disk. See if you can actually read files.
4. If unsuccesful, run 'photorec' (do read the docs) or 'foremost' in test mode to see if it can find the files. Please note that finding files is no guarantee they will be readable.
5. If you're satisfied it can find the files then you need storage to write to. Depending on how large the files are (also see photorec's advanced settings) then if you have no other physical disk to write to, then since we have a backup we can mount hdb in write mode, then repartition and mount it to save files there.
I can imagine you have questions before you dive into this. But whatever you do you must guard against further deterioration before doing anything else by remounting hdb partitions readonly. If unsure just shut down the system now, then ask questions, then work on it.
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,521
Rep:
home@debian:/home/sam # /sbin/fdisk -l /dev/hdb
Is there an NTFS partition?
If yes,
home@debian:/home/sam # mkdir /mnt/ntfs_volume
home@debian:/home/sam # mount /dev/hdbx /mnt/ntfs_volume
x is the partition number (/dev/hdb1, 2, 3, 4, etc.)
Also:
home@debian:/home/sam # ls /dev/hdb*
shows partitions on hdb.
If you cannot mount the partition, you might not have NTFS support configured in the kernel config, Kconfig. You can download Knoppix, and burn it to a CD. Boot with Knoppix, and save any files you can recover to CD. Use k3b CD creator. If you can't use k3b, copy the files with:
knoppix@root: # mount /mnt/hdbx (NTFS partition)
knoppix@root: # mount /mnt/hdax (/home)
knoppix@root: # rsync -rv /mnt/hdbx /mnt/hdax/
Files will scroll by in the terminal. Wait until it stops.
Shut down Knoppix and reboot. All your files will be in /home/<user>/hdbx.
When I installed linux on hda, linux formated also hdb and created 3 partitions automatically.
The problem is I had personnal datas on hdb that I created on windows XP. I think I lost all files but I have a doubt ; When I see Gparted, it says that hdb sizes 20 GB and the total size of the linux partitions is 12.79 GB. I'm just wondering if the difference contain my datas.
How can I check that point ?
Thanks
In your other thread, I asked you for the output of "fdisk -l". We need to confirm exactly what your setup is.
I went back to Gparted to recount the size of my partitions on hdb and it appears that my HDD was totally formated in 2 parts : hdb1 and hdb2 (previously, I didn't count hdb1, that's why I thougt there was a difference). As you told me, I did also fdisk -l on the terminal and it confirmes the same thing.
Is there any possibility to recover my files ? I write nothing on hdb
OK, we need to know what was installed on which partition. I assume you are running from Linux installed on hda. Please post the contents of /etc/fstab. This will tell us what partitions are being mounted and to which location on the directory tree.
Again, don't do anything which would cause a write to disk.
First, sorry to have created a new thread, but I couldn't find my previous thread anymore in the list.
I can't find any files in /etc/fstab. I'm trying my best because I don't know the basics of linux commands except for cd.
root@1[Didier]# cd /etc
root@1[etc]# cd /fstab
bash: cd: /fstab: No such file or directory
root@1[etc]#
See what I find with fdisk :
255 heads, 63 sectors/track, 5005 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 1275 10241437 83 Linux
/dev/hda2 1276 1403 1028160 82 Linux swap / Solaris
/dev/hda3 1404 5005 28933065 83 Linux
Disk /dev/hdb: 20.0 GB, 20020396032 bytes
255 heads, 63 sectors/track, 2434 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hdb1 * 1 764 6136798+ 83 Linux
/dev/hdb2 765 2434 13414275 5 Extended
/dev/hdb5 765 827 506016 82 Linux swap / Solaris
/dev/hdb6 828 2434 12908196 83 Linux
I can't find any files in /etc/fstab. I'm trying my best because I don't know the basics of linux commands except for cd.
root@1[Didier]# cd /etc
root@1[etc]# cd /fstab
bash: cd: /fstab: No such file or directory
root@1[etc]#
"/etc/fstab" means the file (or directory, in this case it's a file) called "fstab" in the directory "/etc" and similarly, "/etc" means the file/directory called "etc" in the directory "/", which is the root of the file system tree. You can read fstab with a pager like more or less (e.g. "less /etc/fstab"), a utility called cat or any text editor like vi, pico, Emacs, etc.
I am very puzzled about how a normal installation could have created all those Linux partitions---including 2 swap partitions. Hopefully, fstab will give us a clue.
In re commands:
I strongly recommend taking afew minutes to get comfortable with just a few:
cd
ls
ls -l
ls -al
more (followed by a file name)
pwd
man (followed by the name of a command)---eg "man ls" tells you all about ls
man -k (followed by a keyword)---eg "man -k file" gives you all the commands relating to files
Your Linux install appears to be on hda1, hda2, and hda3. When it runs, it detects the Linux partitions on hdb and creates mountpoints in the "/mnt" directory. (It also creates mountpoints in /media for your cd devices and floppy.) Note that none of these partitions gets mounted automatically. This means that--if you look in the folders (AKA directories), you will find nothing there.
Why are there Linux partitions on hdb? Again GUESSING: Perhaps these were created in an earlier installation of Linux (or partial installation).
First, try mounting /dev/hdb1 and see what's there. Based on how fstab is setup, you should be able to mount it by simply entering "mount /mnt/hdb1". Then "cd /mnt/hdb1" and then "ls" to see the contents. The same procedure will allow you to mount /dev/hdb6.
If you find things on hdb which are similar to what is in hda, then it appears that you actually installed Linux twice. In this case, the chances of recovering Windows files are not so good.
Let us know what you find.....
More on mounting:
This can be confusing. All partitions must be mounted (connected) to the filesystem tree in order to read or write their contents. In the boot process, one partition must always be designated to mount at "/" (aka the root node of the tree). If no other partitions are mounted then all data will get written to that one partition. At any time, another partition can be mounted to some point in the tree. This is called a "mountpoint", but is simply a directory (one of the standard ones--or one created for the purpose). If data has been written to that directory, it will be hidden after a new partition is mounted there. If the partition is later UNmounted, then the original data will again be accessible.
root@2[Didier]# mount /mnt/hdb1
mount: /dev/hdb1 already mounted or /mnt/hdb1 busy
mount: according to mtab, /dev/hdb1 is already mounted on /mnt/hdb1
root@2[Didier]# cd /mnt/hdb1
root@2[hdb1]# ls
bin dev halt initrd mnt proc sbin tmp var
boot etc home lib opt root sys usr
root@2[hdb1]# mount /mnt/hdb6
mount: /dev/hdb6 already mounted or /mnt/hdb6 busy
mount: according to mtab, /dev/hdb6 is already mounted on /mnt/hdb6
root@2[hdb1]# cd /mnt/hdb6
root@2[hdb6]# ls
rio
It looks like these partitions are automatically mounted!!
About hdb6, I don't know what's inside the directory "rio" which is my name ; I wrote nothing in this partition. How do I get inside on terminal ? I can see by graphical window (KFIND) that there are 2 directories in "rio" : desktop and photos (pictures) and other hidden files related to KDE and GNOME...
Besides, these partitions were created at the same time I installed linux on hda
It looks like 2 linux are installed in my 2 HDD. I remember when I tried to install linux, I first tried with Mandriva One but it failed at the launching of th CD. I guess something was wrong with the CD. So I downloaded the last version on the official site of Mandriva ; then when I lauched the CD, the system asked me for localhost login and password which I didn't have, so I couldn't install this version. Then I tried Simply Mepis 6.5. I did not have problems with the installation Which was supposed to be effective on hda (as the system gave me the choice). So I don't know what happened really. As information in KDiskfree, 27.5 % of hdb1 is used, probably with the second linux system and hdb6 is totally free.
If you confirm this, do you think there is a chance to recover old files on hdb with special tools as unSpawn suggested ?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.