UbuntuThis forum is for the discussion of Ubuntu Linux.
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.
Testdisk is often capable of identifying all the partitions on the drive and recovering the partition table.
Since sda1 is now identified as a Linux partition (not swap) if you run fsck on it you should be able to recover the superblock and restore the structure. Once this is done it shouldn't be hard to find the second partition and restore the partition table.
Testdisk is often capable of identifying all the partitions on the drive and recovering the partition table.
Since sda1 is now identified as a Linux partition (not swap) if you run fsck on it you should be able to recover the superblock and restore the structure. Once this is done it shouldn't be hard to find the second partition and restore the partition table.
I am going to run testdisk now and see what it looks like. I can't mount it and see the files, do I need to reboot? It may have just been screwed up by lack of knowledge on my part. I will post the testdisk analysis as soon as it is done.
I think I did do something wrong between last night and now. I am not seeing anything except an empty partition, and old DesktopBSD partition and a small linux partition I think was DreamLinux. I am going to copy all of this thread and refer to it if this ever happens again, also to learn from it.
OH WAIT, lol. I forgot to do something with testdisk, it is searching it now. All I can say is Duh on my part, lol. I will show the results shortly.
I am not seeing what I saw before. The first Linux on the list below is the current one and is empty, except for the lost and found folder. The last two are the smaller Linux (Knoppix or DreamLinux.) I did notice two on the top of the list as it was searching but it didn't list it when it was done like it did before. Did something get screwed up then, something I did?
* Linux 0 1 1 16214 254 63 260493912
P FreeBSD 16215 0 1 17744 254 63 24579450
D Linux 17745 0 1 19456 254 63 27503280
D Linux 17867 0 1 19456 254 63 25543350
Alright. At least mkswap didn't resize sda1; sda2 is still present at the back of the volume.
Try running e2fsck with an alternate superblock, since the front superblock appears to have had the files removed (I wondered if mkswap would do that).
First we need to find where the alternate superblocks are. First, unmount the drive, then enter:
mke2fs -n
This will list the location of the alternate superblocks on the partition. Then, enter this:
e2fsck -f -b ##### /dev/sda1
where ##### is the number of an alternate superblock.
Presuming that not all the superblocks have been cleared (they haven't been because if they had been probably the files would be gone too) then one of the alternates should yield your entire directory structure and recover the information.
Before I go to far here is the output of mke2fs -n
sudo mke2fs -n /dev/sda1
mke2fs 1.40-WIP (14-Nov-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
16285696 inodes, 32561739 blocks
1628086 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
994 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
I am not seeing what I saw before. The first Linux on the list below is the current one and is empty, except for the lost and found folder. The last two are the smaller Linux (Knoppix or DreamLinux.) I did notice two on the top of the list as it was searching but it didn't list it when it was done like it did before. Did something get screwed up then, something I did?
* Linux 0 1 1 16214 254 63 260493912
P FreeBSD 16215 0 1 17744 254 63 24579450
D Linux 17745 0 1 19456 254 63 27503280
D Linux 17867 0 1 19456 254 63 25543350
So you did have 4 partitions? If so it found them. It says sda2 is a FreeBSD partition. Is this right?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.