Announcement

Collapse
No announcement yet.

RESCUE Partitions & Data

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    RESCUE Partitions & Data

    Data Rescue Links & Comments & Tips

    -- Simple, basic methods anyone can use for many basic problems:
    TestDisk -- PhotoRec -- Knoppix (or other Live CDs)
    =>=> Update: More DETAILS on using PhotoRec: See Reply #5 below
    Focus of this brief guide ...
    is to point you in the direction of TestDisk & Photorec & Knoppix
    for restoring lost partitions, lost/damaged MBR, or deleted files
    Links: See References here at the end

    =>=> Update: More DETAILS on using PhotoRec: See Reply #5 below.
    Another way to install/use PhotoRec/TestDisk: into a personal directory

    =>=> Reply #6: sidux Live Persistent Flash Drive
    -- an excellent medium for conducting rescue/repair work
    -- the post also serves a sa guide to preparing/using bootable flash drives
    -- many useful topics that apply to Kubuntu live flash drives

    - - - - -
    OVERVIEW

    Use TestDisk to recover deleted partitions, deleted partition tables, or deleted MBRs.
    Use PhotoRec to recover lost/deleted files, even after reformatting the partition.
    =>=> Update: More DETAILS on using PhotoRec: See Reply #5 below
    Use Knoppix live CD to rescue data from a bad disk drive.
    My personal experience
    Tips
    TECHNICAL Notes
    REFERENCES

    - - - - - - - - - - - - - - -
    ----- TestDisk (newer versions also include PhotoRec)

    --- My experience with TestDisk was great: fixing deleted partitions; deleted MBR.

    -- I deleted a data partition (using GParted, then re-boot); TestDisk found it and restored it to the partition table (in its original position as a Logical partition sdc5 on an external USB HDD among nine partitions sdc1-sdc9).
    -- I (twice) deleted my partition table for the hard drive (which contained Kubuntu 7.10, swap, home, and 6 other partitions, including Extended). TestDisk correctly restored the partition table to the Master Boot Record. Upon re-booting, TestDisk correctly detected an installation of GRUB to the * boot sector * of the Kubuntu partition and booted into Kubuntu with no problems.
    -- I messed up the partition table terribly; then used TestDisk to Analyze, then Search deeper, then put it back together right.
    -- I ran other basic tests, experimenting with the menus.

    --- Getting started with TestDisk

    The TestDisk documentation is good and I can not improve upon it; and you should read all of it as there are various, useful facts to be aware of. Having said that, in my opinion, for many cases, I think you could skip the reading, jump right in, start TestDisk, and use it successfully to fix your problem. But I don't recommend it.


    --- Installing & starting TestDisk (newer versions include PhotoRec)

    -- To run testdisk, open Konsole and type sudo testdisk , then press Enter.
    => You must use sudo so TestDisk gives you a full and accurate listing of your drives.

    TestDisk is included with many Live CDs; for the list see “TestDisk Live cd” on the site. In particular, it is on GParted, Knoppix, and System Rescue CD. However, a live CD may not have a current version, as I noticed with Knoppix. That may not, though, be a limitation.

    I tested TestDisk from the following installations:
    > On Knoppix
    > Installed to Kubuntu 7.10 on a hard drive in the PC
    > Installed to a Live persistent Kubuntu flash drive
    > Installed during a live Kubuntu CD session (and so installed to ramdisk in RAM and therefore not permanent--after ending the live CD session, TestDisk is gone, along with the live Kubuntu).

    Tips:
    -- To install: Use K > System > Adept Manager, enter testdisk in the Adept window, click the “>” sign, Request Install, Apply. (Applies to installation on: hard disk, flash drive, or in a live Kubuntu CD session.) (If you have problems starting Adept, close it, then at Konsole run sudo dpkg --configure -a and sudo apt-get -f install; then open Adept Manager again.)
    -- On GParted's main window, right-click, then select testdisk.
    -- On Knoppix, open Konsole and run sudo testdisk. (See more Knoppix tips below.)

    --- If a deleted partition is not found yet, but the Structure says OK, you can press Enter to tentatively accept an intermediate or partial result, then Search deeper, then, hopefully, the lost partition is found and you are able to Write a final partition table. Along the way, in the menus, you can list the partition contents, change the partition type, indicate Add or Delete partition, and other choices. You back out of a menu screen by pressing q (or selecting Quit). And you do not have to make any permanent changes to the MBR partition table unless you select Enter then Write.

    --- AFTER running TestDisk: check fstab, filesystems, and GRUB
    => However, you MAY not have to do any of this!!!

    fstab: If you changed the partitions or their order, you must edit /etc/fstab (in your affected Kubuntu), using the correct UUIDs for each partition. To get UUIDs:
    From Live CD and HDD: ls /dev/disk/by-uuid/ -alh
    From HDD: blkid

    filesystem: If you have to repair Kubuntu filesystems, see this reference for complete tips on doing this using fsck:
    http://users.bigpond.net.au/hermanzone/p10.htm

    GRUB
    If you used TestDisk to repair the partition table or Master Boot Record (MBR), when you re-boot, TestDisk will try to help you boot into your Kubuntu OS. IF GRUB had been installed * to the boot sector * of your Kubuntu partition, TestDisk will find it and boot you into Kubuntu. If not, then TestDisk, upon re-boot, presents you with this: 1234F. Type 1 and TestDisk will try the first partition boot sector; 2 for the second partition boot sector; etc.; F for floppy boot. If you can't boot into Kubuntu, you must use Super Grub Disk or GRUB methods to re-install GRUB to the MBR of the correct boot drive. See References.

    > TECHNICAL NOTE: Installing GRUB everywhere!

    This is one of many reasons I always install GRUB everywhere: to the main MBR, to other MBRs as appropriate, and to Kubuntu boot sector(s). Doing so often comes in handy.
    -- Example Suppose Kubuntu is on sdb1 = (hd1,0), and your PC boots from the MBR on sda = (hd0). Then, from Konsole in Kubuntu or from live CD, you may install GRUB to the sdb MBR, to the sdb1 boot sector, and to the sda MBR as follows (do the sda MBR AFTER doing the sdb MBR!):
    sudo grub
    grub> root (hd1,0)
    grub> setup (hd1,0)
    grub> setup (hd1)
    grub> setup (hd0)
    grub> quit
    $exit

    --- More Technical Notes: -- See this section at the end --


    - - - - - - - - - - - - - - -
    ----- PhotoRec (PhotoRec is included with recent versions of TestDisk)

    =>=> Update: More DETAILS on using PhotoRec: See Reply #5 below.

    --- To start PhotoRec, open K > System > Konsole, and type:
    sudo photorec

    My experience:
    On both hard drive and flash drives, PhotoRec successfully recovered various types of files that I had deleted recently: .doc, .jpg, .wmv, .mpg, .pdf, .odt, .txt, and others. In all but one case, the recovered wmv/mpg movie file played without damage. It worked even after I loaded a partition with files, deleted those files, and reformatted the partition using GParted and re-booted. In a few cases, it failed to return all my lost files but always got most of them in good condition.

    PhotoRec recovers files with 180+ file extensions from FAT, NTFS, EXT2/EXT3 filesystem, HFS+. It will do so even if the partition has been reformatted.

    Tips:

    > STOP! As soon as you notice that files are missing or accidentally deleted, STOP working in that Kubuntu partition; do not cause any more writes/saves to be made there. Boot into another partition or into a Live CD and run PhotoRec against the partition containing the lost files.
    > After running PhotoRec, if you don't see all your files, run it again, perhaps restricting the search to just one or two file extension types.
    > After running PhotoRec, you will have to sort out the results! It names the files it finds differently from how you named them; e.g., PhotoRec may return names like 2ebn45fg.jpg. It may return duplicates. It may return files that are NOT lost or deleted. You must sort this out! See the site for tips & references. You can do it manually if you don't mind the work, and if there are not too many files.


    - - - - - - - - - - - - - - -
    ----- Knoppix Live CD (and other live CDs)

    --- Use: To recover your data from hard drives and flash drives

    Knoppix contains TestDisk, PhotoRec, GParted, dd command, dd_rescue, and a thousand+ other programs. You can use Knoppix to copy data off a hard drive and onto another drive or flash drive. You can use Knoppix to go into another drive/partition and fix GRUB, fstab, and other things.

    --- List of applications included on the Knoppix Live CD:
    On the introductory page (of the Live CD), click “Overview of installed packages”
    You can save the list to the Desktop or to a flash drive.

    --- Root Password: There isn't any. However, if you are asked for such (as I was when opening Adept Manager), then make one up yourself: Knoppix Menu -> Configure -> Set password for root.

    --- Disk drives and flash drives are shown as icons on the Knoppix Desktop. They are mounted as RO (Read Only). By right-clicking on an icon you can Mount and you can Actions > Change read/write mode; thus, you can copy data off one drive and onto another drive or a flash drive.

    --- Knoppix may contain older versions of programs, e.g., TestDisk. For Knoppix 5.1, to run testdisk at Konsole, you must first run the following command to fix a symlink:
    ln -s libntfs.so.10 /usr/lib/libntfs.so.9

    ==>> You can use your Kubuntu Live CD to conduct rescue operations just as one would use Knoppix!
    ==>> You can use a Live persistent Kubuntu flash drive to do the same.


    = = = = = = = = = =

    TECHNICAL SECTION


    ----- BE PREPARED for recovery

    In the best of all possible worlds, you should prepare for recovery BEFORE the need arises, and this brief guide points you in the right direction.

    ==> At the very least, have a live Kubuntu CD handy, perhaps have a recent copy of Knoppix handy, and make a note of some useful links (like this guide and the TestDisk & Knoppix sites).

    ==> Backup your bookmarks so you'll have them in any operating system you are using:
    You should bookmark useful sites for emergencies, then save a current copy of your bookmarks to a flash drive.

    -- How-to copy bookmarks in Firefox and then use them in any Firefox:
    Open your /home/your_name folder in Konqueror or Dolphin; View > Show hidden files; click the hidden folder .mozilla; then click firefox; your profile folder is named with a string of 8 random characters followed by .default extension, like XXXXXXXX.default; click on it; look for bookmarks.html and copy that file off to a flash drive.
    > RESTORE as follows: In any Firefox browser you are using, click Bookmarks | Organize Bookmarks, then File > Import > Import from File, then select the file (by clicking to navigate to the flash drive as a Storage media), and finally select Open. You can make restore easier by first copying the bookmark file off the flash drive and onto the Desktop.


    ----- COMMANDS to have handy when messing with your disk drives & MBRs

    -- Save a link to useful commands (or copy/print a command guide). See References for my How-To: Commands at Konsole: Beginners. Note especially commands for mounting a flash drive, a hard drive, and commands to change ownership and permissions (chown; chmod), especially for flash drives.

    -- To list your hard drives and partitions:
    sudo fdsik -lu
    df -h -T

    -- Backup your MBR
    To copy the MBR on sdc to a file called mbr.backup (in your current working directory):
    sudo dd if=/dev/sdc of=mbr.backup bs=512 count=1
    To restore:
    sudo dd if=mbr.backup of=/dev/sdc bs=512 count=1
    > You should have a copy of the MBR saved where it will be useful in an emergency; e.g., save it to a flash drive.

    -- To see the MBR on your screen:
    sudo dd if=/dev/sdc bs=512 count=1 | hexdump -C

    NOTE about your MBR contents:
    The first 446 bytes are the IPL (initial program loader code; e.g., GRUB or LILO);
    The next 64 bytes are four 16-byte partitions and comprise the “partition table”;
    The final 2 bytes comprise the endfile signature 55 aa.

    -- For experimenting: Writing zeros to the MBR
    To write zeros to the MBR on drive sdc:
    sudo dd if=/dev/zero of=/dev/sdc bs=512 count=1

    To write zeros only to the partition table of the MBR on drive sdc:
    sudo dd if=/dev/zero of=/dev/sdc bs=1 count=64 seek=446
    => An excellent way to get GRUB Error 5: Partition table invalid or corrupt!

    To write zeros only to the partition table and the 2-byte endfile of the MBR on drive sdc:
    sudo dd if=/dev/zero of=/dev/sdc bs=1 count=66 seek=446

    To write zeros only to the IPL (eg GRUB) of the MBR on drive sdc:
    sudo dd if=/dev/zero of=/dev/sdc bs=1 count=446


    ----- TECHNICAL NOTE: Deciding What Type of Rescue to Conduct: Decision Tree
    Where to go from where you are:
    How TestDisk, PhotoRec, and Knoppix (or live CDs) fit into the picture

    1 If there is no physical damage to the drive (and you can access the drive), go to 2.

    => If there is a physical problem, then you'll have to chase it down:

    “Bad sectors” is classified as a physical problem (and you can determine such by running a drive diagnostic utility; e.g., Seagate's SeaTools CD).
    => If the drive is damaged and will not operate, you must contact a special data recovery lab and hope they can help.
    => If the drive will not operate, check the easy stuff first: are the cables connected well (power cable from the power supply to the drive? data cable from the motherboard to the drive?); if so, can you change the cables for new cables and try it? if it is a defective motherboard, can you remove the drive to a functioning system and try it there?
    => If you manage to get the drive running, then you must immediately copy your data off the bad drive onto a good drive, and then attempt to rescue your data from the good-drive copy using the methods of 2 below. (You will have to read the TestDisk docs carefully for dealing with an image file.)
    -- Make an image of the bad drive: Two free Linux methods anyone can use to copy the bad drive's contents off to a good drive are the dd command and its DoD version, dcfldd (and the Helix Live CD that includes dcfldd). In both cases, run the dd command using the conv=noerror option so the command will continue to copy data even if it runs into errors.

    2 What's the problem? Three possibilities:

    > If the partition table is damaged or deleted, or if you've deleted partition(s), then use TestDisk.
    (If the MBR is damaged, you may have to also re-install the bootloader's IPL.) Then you may have to edit/fix /etc/fstab and/or GRUB.
    > If you've deleted some data files, use PhotoRec.
    > To simply rescue data off a hard drive, use Knoppix (or another live CD).


    = = = = = = = = = =

    REFERENCES

    TestDisk
    http://www.cgsecurity.org/wiki/TestDisk

    PhotoRec
    http://www.cgsecurity.org/wiki/PhotoRec

    Knoppix download:
    http://www.knopper.net/knoppix/index-en.html
    Knoppix info:
    http://www.knopper.net/knoppix-info/index-en.html
    Knoppix as a rescue CD
    http://www.knoppix.net/wiki/Rescue_FAQ

    Filesystem checking and repair:
    http://users.bigpond.net.au/hermanzone/p10.htm

    UFD persistent Live K710
    Build a LIVE Kubuntu Flash Drive, How-To
    http://kubuntuforums.net/forums/inde...089474.new#new
    -- with Persistence: Reply #7

    Commands at Konsole: Beginners
    http://kubuntuforums.net/forums/inde...opic=3091607.0
    (Especially for mounting drives and changing ownershoip & permissions using chown & chmod)

    dd Command
    http://kubuntuforums.net/forums/inde...opic=3090824.0
    (Links for Helix Live CD and dcfldd command are there)

    How To GRUB Methods - Toolkit
    http://kubuntuforums.net/forums/inde...opic=3081671.0
    (Re-install/fix GRUB)

    Super Grub Disk, new site: http://supergrub.forjamari.linex.org/

    GParted: http://gparted.sourceforge.net/

    *****
    => IMPORTANT:

    For more complicated cases, or quirky BIOSes/systems, you may need the following reference. The TestDisk site also includes some tips for dealing with different geometries.

    Starman's work; start here and follow his many excellent links--
    MUST reading for setting geometry parameters for older/nonstandard hard drives/BIOS, CHS settings, LBA mappings, hard drives, MBRs:
    http://www.geocities.com/thestarman3...taRecovery.htm
    and especially his MBR main index (to disks, partitions, booting, MBRs and all related subjects) @
    http://www.geocities.com/thestarman3/asm/mbr/index.html


    >>> EDITED to include more details: 2-27-07, 2-28-08
    An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

    #2
    Re: RESCUE Partitions & Data

    Thanks Mike. I have used Photorec as well. It works.

    Mike
    http://monte48lowes.blogspot.com

    Comment


      #3
      Re: RESCUE Partitions & Data

      Hi Mike & Thanks.
      If you should think of any tips, please include them in a post here.
      The only thing I sorta ran into in PhotoRec was searching for all the odt files; I may not have checked the right/best file family; no problems with txt or doc, though.
      Thanks again,
      --Mike

      (I added a more detailed paragraph on TestDisk, searching deeper when a partition is not found initially.)
      An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

      Comment


        #4
        Re: RESCUE Partitions & Data

        HOWTO: Rescue data from hard disk
        http://kubuntuforums.net/forums/index.php?topic=11236.0

        - Two examples: how to rescue data from hard disk with Ddrescue - Data recovery tool.
        - Tried with ext and fat partitions.
        Before you edit, BACKUP !

        Why there are dead links ?
        1. Thread: Please explain how to access old kubuntu forum posts
        2. Thread: Lost Information

        Comment


          #5
          Re: RESCUE Partitions & Data

          Good, Thanks, Rog131.

          ddrescue pops up in several places -- I think it may be the one on Knoppix (? -- a couple of these programs have names that are very similar to each other; Knoppix does have two or three such).

          Main thing I picked up on, if you are copying data off a bad drive, one needs a program that will keep copying and not stop if it encounters errors (which it most certainly will encounter errors if the disk is bad). The classic dd command can be set with conv=noerror as an option, but I've even read where some implementations of dd do not work with noerror correctly (ie, it will stop on error). The DoD dd on Helix Live CD should work well in this regard.

          --Mike
          An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

          Comment


            #6
            Re: RESCUE Partitions & Data

            PhotoRec (Latest version: TestDisk & PhotoRec 6.10 (17 July 2008), Data Recovery)

            Edited (for typos): 2-8-2014

            More guidance/details, recent experience

            Some tips for beginners to keep in mind using PhotoRec to recover your lost data.

            > Successfully recovered family photos (jpg) and documents (OOo Writer).
            Test:
            A Kubuntu partition sdb3 became badly damaged (erased), no access to it, I used PhotoRec from another Kubuntu in sdb2 to recover important family pictures (.jpg files) and some documents in OOo Writer (.odt files).
            Result:
            Successful: All photos were recovered; all odt documents recovered.
            Just one problem: Two documents were saved in Kubuntu as Microsoft .doc documents. I could not recover those. The recovered .doc files would not open or were damaged, although I tried to open them using OOo Writer in Kubuntu (and by changing the extension from odt to doc) and by using Microsoft Word in Windows XP.

            > PhotoRec site:
            http://www.cgsecurity.org/wiki/PhotoRec
            PhotoRec is part of the more general TestDisk download:
            http://www.cgsecurity.org/wiki/TestDisk

            Recovery working from a Kubuntu partition:
            We will assume you will install TestDisk/PhotoRec in a working Kubuntu/Linux OS to use for recovering data in another damaged partition.

            However, these tips apply if you are using TestDisk/PhotoRec from a live CD (a recovery CD, like GParted Live CD, System Rescue CD, or Knoppix). For live CD rescue choices, see:
            http://www.cgsecurity.org/wiki/TestDisk_Livecd


            To get PhotoRec: Three ways

            -- Adept
            You can use Adept Package Manager to get testdisk and it contains photorec.
            After doing that, you would start PhotoRec at Konsole:
            sudo photorec
            and
            sudo testdisk

            Using this method, I had a few quirky things go on with PhotoRec that made it difficult to conduct more than one search in succession.
            A better method would be one of the following two ways of getting PhotoRec.

            Downloading TestDisk/PhotoRec to a personal directory.


            > Create a directory for it:
            Choose a directory to work in. Obvious choices might be your home or Desktop.
            For the example, let's use /home/your_name/Desktop (which is the same as ~/Desktop).
            Navigate to it, and create a subdirectory TestDiskPhotoRec:
            /home/your_name/Desktop/TestDiskPhotoRec
            Next, download TestDisk (and PhotoRec) to that directory.
            Two ways:

            -- Download TestDisk/PhotoRec from the site
            Downloads at:
            http://www.cgsecurity.org/wiki/TestDisk_Download
            Select Linux, the latest kernel version (the first one listed).
            (Download TestDisk; PhotoRec is included with TestDisk)
            Your browser may be set to download to Desktop, or you may be able to select the directory /home/your_name/Desktop/TestDiskPhotoRec for the download. In the former case, drag/Move the downloaded file testdisk-6.10.linux26.tar.bz2 into the TestDiskPhotoRec folder.

            To extract
            the folder (and files) from the tar.bz2 file ...
            > Right click on testdisk-6.10.linux26.tar.bz2 and select Open with Ark, then using Action or the Extract icon in ARK, Extract and navigate to the TestDiskPhotoRec folder as the extraction target.
            > Or, simply right-click on testdisk-6.10.linux26.tar.bz2 (which is already in the folder TestDiskPhotoRec), then Extract here.

            => You want to keep everything—the tar.bz2 and the extracted folder/files-- in the folder TestDiskPhotoRec because it will be simpler to manage and contained where you can work with it. It is also the folder you probably want PhotoRec to save the recovered files to.

            Explore it briefly to find the PhotoRec executable (program), photorec_static:
            Click on the folder /home/your_name/Desktop/TestDiskPhotoRec/testdisk-6.10, then the folder linux, to see the executable (program) photorec_static. That's the program you'll run.

            The third way to get PhotoRec:
            -- Download TestDisk/PhotoRec using Konsole
            To download and run TestDisk 6.10 (and/or PhotoRec) under Linux:
            Change into the directory:
            cd /home/your_name/Desktop/TestDiskPhotoRec
            Then:
            wget http://www.cgsecurity.org/testdisk-6.10.linux26.tar.bz2
            Extract the files using
            tar xvjf testdisk-6.10.linux26.tar.bz2
            Or, to extract, you can navigate in GUI using Konqueror or Dolphin to TestDiskPhotoRec and extract the TestDisk folder and files using ARK as explained above.
            (Then, to run TestDisk or PhotoRec from there:
            cd testdisk-6.10/linux
            sudo ./testdisk_static
            Or,
            sudo ./photorec_static
            where the leading dot slash ./ means “the current working directory”)


            Using PhotoRec

            -- Starting PhotoRec
            After downloading TestDisk/PhtotoRec from the site, to run PhotoRec, use the command
            sudo /home/your_name/Desktop/TestDiskPhotoRec/testdisk-6.10/linux/photorec_static
            which is the same as
            sudo ~/Desktop/TestDiskPhotoRec/testdisk-6.10/linux/photorec_static
            Or, you can change into the linux directory and do this:
            cd TestDiskPhotoRec/testdisk-6.10/linux
            sudo ./photorec_static
            (note the period slash: ./)

            Log file
            Forensics users can use the parameter /log to create a log file named photorec.log; it records the location of the files recovered by PhotoRec.
            Example:
            cd ~/NEWtestdisk-6.10/testdisk-6.10/linux
            sudo ./photorec_static /log

            PhotoRec Step By Step Keep this link handy, it is good:
            http://www.cgsecurity.org/wiki/PhotoRec_Step_By_Step
            ... and beyond that, a few tips I noticed:

            Other tips for using PhotoRec
            Working through the menus

            > Select a media: Select the disk to search for files to recover. To accept Proceed or Quit, use the arrow keys, then Enter.

            > Select the partition table type. To search your Windows or Linux data or operating system partitions, select Intel.

            > Then highlight the partition you wish to search, but do NOT press Enter yet until you have examined the options at the bottom. Use Right-Arrow key to highlight File Opt and press Enter. Select the file types you want to search for: To clear all, type s. Highlight the type, then type an “x.”

            =>
            Open Office odt files Place an x next to:
            Zip archive including OpenOffice and MSOffice2007

            When done selecting file types, make sure Quit is highlighted and press Enter. Your partition selection should be highlighted, press Left-Arrow key to highlight Search, then press Enter.

            > The filesystem type: ext2/ext3/ext4 (to search the damaged Kubuntu partition).

            > Please choose if all space need to be analyzed:
            [ Free ] Scan for file from ext2/ext3 unallocated space only
            [ Whole ] Extract files from whole partition

            If you only deleted some files and want to find them, select [Free]; if you damaged the entire partition, select [Whole] (as was my case in this example).

            > Do you want to save recovered files in /home/your_name/Desktop/TestDiskPhotoRec/testdisk-6.10/linux ? [Y/N]
            This is important. If you want to save the recovered files elsewhere, you must use the Up/Down Arrow keys to navigate to that location. Note the two dots .. means the parent directory of the current directory; use it repeatedly to navigate up the filesystem, select a final location, then type “y” to accept it.

            > You'll get three passes Pass 0, 1, 2, until it finishes with the results.
            You may then conduct another search by navigating back to the menu
            [Search] [Options] [File Opt] [Quit]
            and select [File Opt] to change the file types to search for, and repeat your search.

            Finish message You'll get something like this:
            629 files saved in /home/your_name/Desktop/TestDiskPhotoRec/testdisk-6.10/linux/recup_dir directory.
            Recovery completed.
            zip: 629 recovered

            Sorting the results
            If you have a large number of files, see the PhotoRec site for tips on sorting the results.
            If you have a smaller, manageable number of files, navigate to the directory containing the results (/home/your_name/Desktop/TestDiskPhotoRec/testdisk-6.10/linux/ in this example) where you'll see one or more directories recup_dir.1, recup_dir.2, etc. In Konqueror/Dolphin open each directory, View > View Mode > Detailed List View, then sort by size or file type.

            Locked folders: If you can't get access to some folders/files or can't delete them or move them, open Konqueror/Dolphin as root and try again:
            In 8.10: kdesudo konqueror (or kdesudo dolphin)
            In 8.04: kdesu konqueror (or kdesu dolphin)


            Diskspace! Be careful! Managing large deletions

            If you conduct several searches, you'll accumulate the recovered folders recup_dir.x, so you must be certain that you have the available space, and, for example, do not run low on your /home partition. You may have to move the recovered folders to a flash drive (or another such drive). Furthermore, you may have difficulty deleting the folders recup_dir.x, especially large quantities, and/or they may not go to the Trash and/or you can't Empty Trash.

            Empty Trash at Konsole
            It sometimes happens that you are unable to “Empty Trash Bin.” Or, you delete something, but it doesn't appear in the Trash Bin. Such items are here:
            /home/your_name/.local/share/Trash
            where you will see two folders: files and info. The directory called files contains deleted folders/files; and info contains information about such deleted items. You can manually empty files and info as follows:
            cd /home/your_name/.local/share/Trash
            ls
            files info
            sudo rm -r files/*
            sudo rm -r info/*

            In fact, you may remove the entire folders files and info and they will be re-created as they are needed; i.e., as you delete items:
            sudo rm -r files
            sudo rm -r info

            Empty Trash
            rm -r recup_dir.1
            rm -r recup_dir.2

            Deleting folders and files at Konsole
            Similarly, if you can't delete a folder or file using Konqueror/Dolphin, you can do so at the command line. Navigate at Konsole to the directory containing the file or folder you want to delete.
            To delete a file:
            rm file
            (or sudo rm file)
            To delete afolder:
            rm -r folder
            (or sudo rm -r folder)
            - - - - -

            See Part 3 of this:
            Commands at Konsole: Beginners
            http://kubuntuforums.net/forums/inde...opic=3091607.0
            In 3 parts, new/improved, complete basic tutorial.
            Last edited by Qqmike; Feb 08, 2014, 09:31 AM.
            An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

            Comment


              #7
              sidux live UFD: Re: RESCUE Partitions & Data

              sidux Live Persistent Flash Drive
              -- an excellent medium for conducting rescue/repair work


              Perfect candidate conducting rescue/repair work and for personal/fun use. It's compact, loads up quickly, is snappy, has many apps included, has excellent facility for accessing disks and partitions (Storage Media), has an excellent Manual and web site, is very easy to use, and has an excellent installer (install-sidux-to-usb). We will run it with the persistent capability and so can store personal settings, data, and updates to programs as well as personal programs.

              sidux is continually changing, so check the site for the latest Manual references and links.
              I did this with: sidux-2009-01-ouranos-kde-lite-i386-200902151242.iso (450 MB)


              SUMMARY of Steps to Get Your Flash Drive Going
              A Table of Contents

              -- Prepare the flash drive
              partitioning, format ext2, set Label and boot flag
              Recommended: Zero-out the MBR (see below for how-to)
              -- Install sidux to the flash drive using the sidux live CD:
              K > System > install-sidux-to-usb
              -- Set up your applications; examples (see below)
              For non-free, edit your sources.list.
              -- Set up special applications for system rescue and repair
              GParted: included with sidux (check version/updates)
              TestDisk: included with sidux (check version/updates)
              See below for another neat way to do TestDisk/PhotoRec.
              Midnight Commander: Included with sidux (as root)
              rsync: Included with sidux
              rdiff: Included with sidux
              Virus and Rootkit Scanners
              See the Manual, System Administration > Virus and Rootkit Scanners
              http://manual.sidux.com/en/vir-rkits-en.htm#virus-rkits
              Anything else you might want (Partimage, etc.)
              dd: included with sidux
              dcfldd: install it with apt-get install dfcldd
              -- Disk Full!
              Running out of space on your flash drive -- issues, tips to avoid/fix problems
              How much space is available for your personal data/settings/apps?
              Fixing it when your disk is full: The goal is to delete data, free-up space
              Fixing the filesystem
              Ways to keep your flash drive clean and plenty of free space available
              -- TestDisk and PhotoRec -- another good way to set these up in a personal directory
              -- dd & dcfldd
              -- Cloning your live persistent flash drive
              -- Troubleshooting tips in sidux live

              -- REFERENCES

              -- APPENDIX 1 Flash Drive Notes: Following the bytes as a % used
              Capacities: Binary (e.g., GiB) and decimal (GB)
              Different utilities report capacities differently
              Monitoring your flash drive capacity after set up and loading sidux
              Flash drive sidux files: your personal home and menu.lst
              Boot parameters; What does boot=fll mean?
              Flash drive wear-out: comments and links
              Rx for wear-out worry: Use ext2, clone it, and use backups

              -- APPENDIX 2: APT Commands, SUMMARY Sheet
              Searching, listing packages
              Repairing APT

              ********************
              ********************

              Prepare the flash drive
              partitioning, format ext2, set Label and boot flag
              Recommended: Zero-out the MBR

              You have many choices how to do this. Two ways are: You may do this in GParted Live CD (then re-boot into sidux live CD to install); or you may do this in sidux live CD, then install. We'll address both ways.

              -- Using GParted Live CD
              Unplug the flash drive.
              Put the GParted CD in the CD tray and reboot your PC.
              Let GParted boot up. View your device (drive) list: Click GParted > Devices or click the drop-down list on the upper right of the screen to see the list of drives detected by GParted.
              Plug the flash drive in.
              Click GParted > Refresh Devices. Then view your device (drive) list again to see how GParted detects your flash drive. If it doesn't come up, do again this: GParted > Refresh Devices.

              Open Terminal in GParted (double click on the Terminal icon, top row of the Desktop screen). Using sudo for root, type:
              sudo fdisk -lu
              You should see the flash drive in the list (sda, sdb, sdc, etc.). This tells you how the flash drive is seen in Linux terms.
              => Assume the flash drive is seen as sdX.

              The Master Boot Record (MBR) is the first 512 bytes of the flash drive; that's the first sector of the flash drive. (A sector is 512 bytes.) Your MBR may be empty or it may have some past bootloader code in it or just some useless data. When GRUB is used, sectors following the MBR are also used for GRUB code. And when partitioning is done, usually the first partition starts at sector 63--after all this other stuff. Thus, to be safe, let's clear out (zero-out) the first 63 sectors of your flash drive by writing zeros to it, and that will restore it to its factory-new state.

              CAUTION: The following dd command will write zeros to the MBR of drive sdX, so make sure you put the correct device name in for sdX! (Where do you think dd got its nickname of "data destroyer"?)

              Still in the GParted Terminal, using sudo for root in GParted, zero-out the MBR and 62 more sectors:
              sudo dd if=/dev/zero of=/dev/sdX bs=512 count=63

              Optional: Zero-out the entire flash drive if it has been used a lot and if you wish to clear it:
              sudo dd if=/dev/zero of=/dev/sdX
              Let it run to completion; it takes awhile (e.g., 10-20 minutes for 4 GB); and you will not get a progress report as it goes along (but you'll see the blinking LED on your flash drive).
              (NOTE: The special version of dd called dcfldd does give a progress report. See below.)

              When finished zeroing-out out the flash drive, exit the Terminal by typing exit.

              Partitioning:
              NOTE: sidux must go on the FIRST partition.

              If it is not open, open the GParted panel (double-click GParted icon at the top).
              Highlight the unallocated space, then use Partition > New, create a partition, ext2, then click Apply.
              set a Label (Partition > Label, then Apply; make up a word for your Label, e.g., sidux-UFD (where UFD = USB Flash Drive))
              set a boot flag (Partition > Manage Flags, checkmark the boot box, then click Apply)

              Re-boot into sidux Live CD, leaving the flash drive inserted, as follows:
              GParted > Quit. Double-click the red Exit icon at the top, select Reboot from the menu.
              When prompted, remove the GParted Live CD, insert the sidux live CD, leave the flash drive inserted, close the tray, press Enter.
              (NOTE: This assumes your BIOS is set to boot first from the CD drive. If not, when your PC reboots and presents the Power-On Self Test (POST), enter BIOS setup and set it to boot from the CD.)
              Reboot into sidux live CD.

              (Troubleshooting: If you don't make it, are dropped to a prompt, but there are no error messages, type at the prompt startx, press Enter.)

              Next:
              ]Skip to: Install sidux to the flash drive.


              -- Doing all this work in sidux live CD, outline:
              Unplug the flash drive.
              Boot the sidux live CD.
              Open Konsole (K > System > Konsole--Terminal Program). You must be root to do this work (to run both fdisk and dd):
              sux
              fdisk -lu
              See how your drive(s) are denoted (e.g., sda, sdb, etc.). Keep Konsole open (as root, sux).
              Plug in the flash drive, let it be recognized, say OK to open it, then close it (File > Quit or click the x at upper right). Find out what it is called as follows:
              fdisk -lu
              => Assume the flash drive is seen as sdX (e.g., sdb, sdc, sdd, etc.).
              Zero-out the MBR and 62 more sectors (see above for discussion):
              dd if=/dev/zero of=/dev/sdX bs=512 count=63
              Optional: Zero-out the entire flash drive -- See above.
              When dd is done, type exit (twice ) to quit Konsole.

              Partitioning:
              NOTE: sidux must go on the FIRST partition.
              Open gparted (K > System > Partition Editor).
              Highlight the unallocated space, using Partition > New, create a partition, ext2, then click Apply.
              set a Label (Partition > Label, then Apply; make up a word for your Label, e.g., sidux-UFD (where UFD = USB Flash Drive))
              set a boot flag (Partition > Manage Flags, checkmark the boot box, then click Apply)
              The exit gparted (GParted > Quit).

              Next:
              See below: Install sidux to the flash drive.

              ********************

              Install sidux to the flash drive

              In the sidux Live CD session,
              K > System > install-sidux-to-usb
              Follow the instructions, which will require you to know how the flash drive is seen (from the USB Device drop-down list, select sda, sdb, sdc, sdd, etc.); if you want persistence, be sure to check the box labeled "persist." Click Apply to start the installation.
              Finish, then K > Exit > Re-boot.

              (Troubleshooting: If you are dropped to a prompt, restart manually as root:
              sux, then shutdown -r now)

              When prompted, remove the sidux live CD, leave the flash drive plugged in, let the PC re-boot, when you see the BIOS POST, enter BIOS setup, and set your BIOS to boot from the flash drive (Enable USB booting; adjust your list of drives according to your BIOS instructions; Save settings and reboot).

              (Troubleshooting: You may have to re-boot again to get your BIOS to cooperate.)

              Notes:

              POST = Power On Self Test

              BIOS:
              Every PC BIOS is slightly different, and you must take time to study how yours works. Your BIOS must support "Boot from USB"!

              Example:
              Intel motherboard 915GAVL. To enter BIOS setup, you press F2. Cursor right to the Tab called Boot, highlight Enable USB Booting and press Enter. Then, still in Boot menu, highlight List of Drives and bump the flash drive to the top of the list. It will then also appear at the top of the Boot Order list. Save & re-boot to boot from the flash drive. In the future, when a bootable flash drive is plugged in, BIOS should see it and boot from it. If it fails to do so, do one or both of two things: enter BIOS setup again and reset everything to boot from the flash drive in the list of drives; and/or re-boot the PC and hope BIOS catches the flash drive properly. It works fine, just not perfectly every time.
              => Investigate your BIOS to see how it works.

              ********************

              Set up your applications

              Examples: This depends on you and what you need and want in your live sidux flash drive sessions. To give you some idea how to proceed, here are some personal examples.

              NOTE: sux
              In a given Konsole session, you only need to invoke root one time using the command
              sux
              In the examples that follow, I have included sux before key commands; in practice, you only need to do it once.

              NOTE: apt-get
              See the sidux Manual for using apt-get.
              Based on the Manual, I've prepared a summary sheet of commands to keep handy--see Appendix 2 of this how-to.

              Boot into your live-persistent sidux flash drive.

              Set up Iceweasel (Firefox), flashplugin, Icedove (Thunderbird)
              Open K > System > Konsole, then root console:
              sux
              apt-get update
              (Then to search for correct package names: apt-cache search firefox, apt-cache search thunderbird, apt-cache search flashplugin. apt-cache search iceweasel, etc.)

              apt-get install iceweasel
              (Then import bookmarks.html; get NoScript add-on)
              apt-get install icedove
              (Then bring in address books from a saved profile: abook.mab and history.mab.)

              Word processor? spell checker? If you want one, you have to install it.
              Otherwise, simply create and use text files (right-click in your home or Desktop, Create New > Text File).
              Example:
              apt-get install openoffice.org-writer
              For spell checker (USA):
              apt-get install myspell-en-us
              (or search: apt-cache search myspell; apt-get search spell checker)

              Nonfree: Update the sources (/etc/apt/sources.list.d/*.list.) to include non-free sources
              See the sidux Manual, the chapter "dist-upgrade and package management", the "Sources List" section, in the introductory paragraphs find the links to non-free sources sidux.list and debian.lst.
              Example:
              > sidux.list:
              http://sidux.com/files/misc/sources.list.d/sidux.list

              # sidux e.V., Germany
              deb http://sidux.com/debian/ sid main contrib non-free fix.main fix.contrib fix.non-free
              #deb-src http://sidux.com/debian/ sid main contrib non-free fix.main fix.contrib fix.non-free
              > debian.list:
              http://sidux.com/files/misc/sources.list.d/debian.list

              deb http://ftp.us.debian.org/debian/ unstable main contrib non-free
              #deb-src http://ftp.us.debian.org/debian/ unstable main contrib non-free

              #deb http://ftp.us.debian.org/debian/ testing main contrib non-free
              #deb-src http://ftp.us.debian.org/debian/ testing main contrib non-free

              #deb http://ftp.us.debian.org/debian/ experimental main contrib non-free
              #deb-src http://ftp.us.debian.org/debian/ experimental main contrib non-free

              => As root, add these to your /etc/apt/sources.list.d/*.list.
              => Run the update, as root:
              sux
              apt-get update

              Install any nonfree packages
              First do as root:
              sux
              apt-get update

              Examples: flashplugin-nonfree and libarts1-xine
              To watch YouTube,
              apt-get install flashplugin-nonfree
              For Konqueror thumbnails (of pics and movies):
              apt-get install libarts1-xine

              ********************

              Set up rescue/repair packages; check version information for updates
              Examples, notes

              -- GParted
              It is included with sidux (K > System > Partition Editor)
              Open it, see if it is the version you want. To check for updates,
              sux
              apt-get install gparted

              -- TestDisk
              (includes PhotoRec)
              Included with sidux.
              Open a root console, enter sux, type testdisk, check the version (e.g., 6.10).
              Also, run
              after sux
              apt-get install testdisk
              to check for updates.
              => See below for another way to install and run TestDisk and PhotoRec.

              -- dcfldd
              (a modified version of dd, very useful; give progress reports; verification)
              sux
              apt-cache search dcfldd
              apt-get install dcfldd
              Manual:
              man dd
              man dcfldd
              (See below, "Using dcfldd")

              See the sidux K menu -- there are many apps included:
              -- Midnight Commander: Included with sidux (as root)
              -- rsync: Included with sidux
              -- rdiff: Included with sidux
              -- Virus and Rootkit Scanners
              See the Manual, System Administration > Virus and Rootkit Scanners
              http://manual.sidux.com/en/vir-rkits-en.htm#virus-rkits
              -- The sidux Manual
              -- sidux-browser-Generic (Konqueror)
              Tip: In Konqueror, gg:searchstring will call a google search for searchstring.
              Tip: K > System > File Manager > Superuser Mode (Konqueror)
              -- ELinks WWW browser (lightweight)
              -- Kate, KWrite: Utilities > Editors
              -- Many apps under K > Debian > Applications:
              Shells: Bash, Dash, Python, Sh; Terminal Emulators: Konsole, Xterm

              Install anything else you might want (e.g., Partimage).
              For ideas, See SystemRescueCD:
              http://www.sysresccd.org/Main_Page
              (System-tools, left side bar)
              (btw, SystemRescueCD also has a live USB install option)

              ********************

              TestDisk and PhotoRec ... another good way to set these up
              => Downloading TestDisk/PhotoRec to a personal directory.
              (Thanks to Christophe GRENIER for this tip, TestDisk dev)
              In this case, you will probably want to remove the existing testdisk to save space:
              Konsole:
              sux
              apt-get remove testdisk


              -- How to set up and run TestDisk & PhotoRec from a personal directory:
              > Create a directory for it:
              Choose a directory to work in. Obvious choices might be your home or Desktop.
              For the example, let's use /home/your_name/Desktop (which is the same as ~/Desktop, where ~ is the same as your personal home: home/your_name).
              Navigate to it, and create a subdirectory TestDiskPhotoRec, so you now have
              /home/your_name/Desktop/ TestDiskPhotoRec
              Next, download TestDisk (PhotoRec comes with TestDisk) to that directory.
              > Download TestDisk/PhotoRec
              Downloads at:
              http://www.cgsecurity.org/wiki/TestDisk_Download
              Select Linux, the latest kernel version (the first one listed). (Download TestDisk; PhotoRec is included with TestDisk.) Your browser may be set to download to Desktop, or you may be able to select the directory /home/your_name/Desktop/ TestDiskPhotoRec for the download. In the former case, drag/Move the downloaded file (e.g., testdisk-6.10.linux26.tar.bz2) into the TestDiskPhotoRec folder.
              > To extract the folder (and files) from the tar.bz2 file ...
              Right click on testdisk-6.10.linux26.tar.bz2 and select Open with Ark, then using Action or the Extract icon in ARK, Extract and navigate to the TestDiskPhotoRec folder as the extraction target. Or, another way, simply right-click on testdisk-6.10.linux26.tar.bz2 (which is already in the folder TestDiskPhotoRec), then Extract here.
              => You want to keep everything—the tar.bz2 and the extracted folder/files-- in the folder TestDiskPhotoRec because it will be simpler to manage and contained where you can work with it. It is also the folder you probably want PhotoRec to save the recovered files to, BUT READ the section below: Disk Full!
              > Explore it briefly to find the PhotoRec executable (program), photorec_static:
              Click on the folder /home/your_name/Desktop/TestDiskPhotoRec/testdisk-6.10, then the folder linux, to see the executable (program) photorec_static. That's the program you'll run.
              > To run the programs
              Change into the directory (cd) and issue the command, like so:
              cd /home/your_name/Desktop/testdisk-6.10/linux
              sux
              ./testdisk_static
              Or,
              sux
              ./photorec_static
              where the leading dot slash ./ means “the current working directory."

              ********************

              dd & dcfldd
              dcfldd is based on dd and is an enhanced version of dd. was developed at USA Dept. of Defense. dcfldd is no longer available on free Helix CD as of Feb 2009. dcfldd includes progress reporting and verification, as well as various methods for ensuring accuracy and speed.

              To get dcfldd:
              sux
              apt-get install dcfldd
              man dcfldd
              Syntax and many command-line options are the same as for dd.

              dcfldd: references
              > dcfldd(1) - Linux man page
              http://linux.die.net/man/1/dcfldd
              > See also, dev notes re verify:
              http://www.networksecurityarchive.or.../msg00004.html
              > dcfldd - Latest version 1.3.4-1
              http://dcfldd.sourceforge.net/

              ********************

              Disk Full!
              Running out of space on your flash drive -- issues, and tips to avoid and fix problems

              Avoid filling up your flash drive!
              You will want to maintain as much free space on your flash drive as possible so you'll have enough room to store new data and apps. Also, if your sidux partition becomes too full, you will not be able to log into your KDE. Ditto for kdm: you may encounter log-in looping, not able to log in. The recommendation, to be safe, is to maintain 85% free space.
              See the sidux Manual:
              Window Managers > Login problems to the system under KDE.
              http://manual.sidux.com/en/wm-kde-en.htm#kde-login

              -- How much space is available?
              As explained in the sidux Manual, you can continue adding persistent data to the flash drive until there is no more room left on the sidux partition. sidux must occupy the first partition of the flash drive, it is to be formatted FAT32 or preferably ext2 (or ext3). The persistent file will continue to fill up until the flash drive is full.
              See the Manual, Installation Options > Boot "fromiso", and the section
              General information on fromiso with persist
              http://manual.sidux.com/en/hd-instal...en.htm#fromiso
              Quote:
              ext2/3 file systems
              With ext2/3 the full partition will be used, the current root is taken and a directory /fll is created which is used for the persist allowing the usage of all free place in the device for the persist system.
              [End quote]

              Example: Do NOT try this yet!!! Not until you read this entire section.
              I installed sidux USB to a 4 GB flash drive, configured a few things, and had 18% used space, 92% free space. Then I used the following command to create a file TestFile and fill it with zeros.
              sux
              dd if=/dev/zero of=TestFile
              The output of the dd command was this:
              dd: writing to `TestFile': No space left on device
              6163049+0 records in
              6163048+0 records out
              3155480576 bytes (3.2 GB) copied, 568.907 s, 5.5 MB/s
              As you can see, it wrote 3.2 GB of zeros into the persistent area of the live sidux partition. At that point, working in sidux became impossible as there was no space left for anything, and upon re-booting, I was not able to log in. (The file TestFile kept accepting zeros and growing until it took up all available space on the flash drive.)
              => Thus, you can store as much data/apps as your flash drive sidux partition will hold. (That is, the size of your persistent file in not arbitrarily fixed but will expand until the entire sidux USB partition is full.)

              -- What to do if your partition becomes "full."
              Don't panic just yet.
              Manual reference:
              Login problems to the system under KDE
              http://manual.sidux.com/en/wm-kde-en.htm#kde-login

              Overview (quick summary)
              -- Full partition -- 4 ways to fix it
              1 You can try to log in using either KDE or the lighter-weight Fluxbox, then clean out any unused/unnecessary files and re-boot.
              2 Or, when you are dropped to a prompt, you can work at the command line to explore your partition and remove files using cd, ls -al, and rm (rm file and rm -r directory).
              3 Or, you can chroot into the partition using a Live CD and clean out your flash drive.
              4 Or, you can boot into another OS on your PC, insert the sidux flash drive, and clean out the flash drive sidux partition. You may do so at Konsole as root or open Konqueror as root.
              5 After cleaning up, you may also have to fix the sidux-partition filesystem and/or start with a new /.kde.

              Tools (quick summary)
              To see your drives:
              sux and then fdisk -lu
              Open Konqueror as root:
              sux and then konqueror; or:
              kdesu konqueror
              To see all your mounted filesystems: df -hT
              To see space used/available: du -sh * (or, just du -sh)
              Then, for more detail: du -h * (or, just du -h)
              Dropped to a prompt
              Use commands cd, pwd, ls -al, and rm (rm file or or rm -r dir)
              To get a terminal: Ctrl+Alt+F1
              Check/fix the filesystem
              FIRST UNMOUNT sdX1 !!!
              First sux, then fsck -vt /dev/sdX1
              and/or, for ext2/3: e2fsck -vt /dev/sdX1
              Set a root password: passwd
              Rename your KDE folder (called /,kde):
              mv /home/sidux/.kde /home/sidux/kdesaved
              Then get a graphical log-in screen by pressing Ctrl+Alt+F7

              Check these (see below for details, tips):
              kcontrol
              If you have booted into sidux live flash drive, run: kcontrol
              click Privacy, Clean
              As root (sux), apt-get clean
              Thunderbird: Compact Folders
              Trash: Empty it.
              The home directory of root: /root
              PhotoRec -- see Tips below


              Detailed Decision Tree

              Step 1 Rescue your data
              If the data stored on the flash drive is important to you, copy it off now. Boot into a live CD or any OS on your hard drive. Plug in your sidux flash drive, access/mount it, copy your data to a safe location.
              Example: Your flash drive may show up as /dev/sdc1, mounted as /media/disk. Your personal data and settings are located in the following directory:
              /media/disk/fll/cow/home/sidux

              Mounting at CLI; using Konqueror as root
              > To mount the flash drive manually, plug it in, open Konsole, get root by typing sux, then type fdisk -lu to see how it comes up (e.g., sdc1, sdd1, etc.). Suppose it appears as sdX1. Then (continuing as root--sux):
              mkdir /media/disk
              mount /dev/sdX1 /media/disk
              where X is your device (X= a, b, c, d, etc.)
              When you are done working, unmount it and exit:
              sudo umount /dev/sdX1 /media/disk
              exit
              > You may have to open Konqueror as root to do some/all this work:
              Open a regular user terminal, then
              sux
              konqueror
              (or, you can do: kdesu konqueror)

              -- Next Steps

              Step 2: Are you able to boot into the sidux flash drive? If not, go to Step 3.
              If you able to boot into the sidux flash drive, then:
              Boot into it. Find the folders/files containing your data, delete/remove any data you don't need.

              Tools at Konsole: df and du
              Help (Manual pages):
              man df
              man du

              Try df:
              df -hT
              to see all your mounted filesystems

              Better, du:
              First, change directory into the directory you would like to check out.
              For example, you might try your home directory:
              cd ~
              (Your home in sidux live flash drive will be designated as "user name" = sidux, NOT your name, but it is your home.)
              Then (s = summary):
              du -sh *
              (or, just du -sh)
              Then, for more detail:
              du -h *
              (or, just du -h)

              Note about root's home: /root
              Root's home is designated by /root.
              Often, it is the culprit. Inadvertently, data--stuff--may have ended up there (e.g., from PhotoRec or from running dd as root or other commands as root). Thus, you must access /root as root, by using sux at Konsole, or a root terminal, or opening Konqueror as root. After identifying the data you feel you can safely delete/remove, do so.

              KDE: kcontrol
              If you have booted into sidux live flash drive, you may also run at Konsole
              kcontrol
              click Privacy, then Clean (the button at lower right)

              APT: clean
              At Konsole, run sux and then apt-get clean

              Thunderbird:
              Highlight Local Folders, then File > Compact Folders (See below.)

              Trash:
              Empty it. (See below.)

              More ideas: See below

              Step 2 is completed now
              Run df -hT and du -h (or du -sh or du -h * or du -sh *)
              See if your efforts to free up space were successful.
              Re-boot your sidux flash drive; hope for the best.


              Step 3: If you are NOT able to boot into your sidux flash drive.
              Now, this is a problem, but it is often solvable.
              Symptoms
              When you try to boot into sidux live flash drive, you get strange error messages. (Popular ones are "No write access to /home/sidux/.ICEauthority"; "Could not start ksnserver"; or "Disk full" messages). Or, you hit the log-in screen but are bounced back to a blank blue screen or to the log-in screen again (log-in looping).

              Solutions
              Remove excess data from the flash drive
              As in Step 2, you must try to delete/remove as much unneeded data as possible from the flash drive. But since you can't log into sidux live flash drive, you'll have to do the work using a live CD or by booting into another operating system (e.g., sidux on your hard drive). In either case, you must access the flash drive from where you are, and that simply means you must boot into an OS (on disk or a live CD), plug the flash drive in, let it be recognized, perhaps run (as sux) fdisk -lu, then mount it if it is not automatically mounted, then click on the flash drive (icon) to open it and see the files on it.

              Dropped to a prompt: Perhaps you can almost log in, but can't, and you are dropped to a prompt or are able to get a prompt (e.g., Ctrl+Alt+F1). In this case, you may be able to do the work at the command line, using commands like cd, pwd, ls -al, and rm (or rm -r dir).

              See the tips in Step 1 (above), namely:
              > Mounting the flash drive;
              > Checking your personal files in home:
              -- When you are in another OS (on a hard drive or live CD) viewing the live sidux flash drive ]filesystem, your personal data and settings are located in the following directory: /fll/cow/home/sidux;
              -- When you are booted into a live sidux flash drive session, your personal data and settings are located in the following directory: /home/sidux;
              > To open Konqueror as root: (first, sux) konqueror (or kdesu konqueror);
              > Check also the home directory of root: /root;
              > Use these commands (perhaps changing into /home/sidux first) to see the used space:
              df -hT
              du -h (or du -h *)
              du -sh (or du -sh *)
              > Remove as much data as you can;

              Try now to re-boot into the flash drive
              If you can, you are done!
              If not, perhaps something got damaged and must be fixed. Continue:

              Check/repair the filesystem
              Find out how your flash drive is seen by running
              sux
              fdisk -lu
              Let's say it is sdX1 (e.g., sda1, sdb1, sdc1)
              First, Unmount the flash drive!!! <= VERY IMPORTANT!!!
              (using sux, umount /media/<mount point> or umount /dev/sdX1)
              Then (continuing as root using sux):
              fsck -vt /dev/sdX1
              And/or, for ext2/3:
              sudo e2fsck -vt /dev/sdX1

              After that's done, re-boot to test the flash drive.
              If that works, your are done!
              If not, continue:

              KDE settings damaged
              Re-boot, try to get to the log-in screen. If you can't get that far and you've done all the above, you will have to try something else--this guide will not help you further. Post the issue at a forum. See tips below, too.
              If you can get to the log-in screen:
              At the log-in screen, get a virtual console by pressing Ctrl+Alt+F1.
              You may have to log in by typing root or sidux.
              If you are asked for a password, set a new one:
              passwd
              then make one up; re-type it if asked. Hopefully, you'll get in.
              Rename your KDE folder (called /.kde):
              mv /home/sidux/.kde /home/sidux/kdesaved
              Get a graphical log-in screen by pressing Ctrl+Alt+F7.
              You may get a KDE wizard to help you build a new KDE configuration and/or a new /.kde folder will be constructed for you and you'll be booted into sidux live.
              Try re-booting.

              >>> From dibl:
              Top 20 Kubuntu FAQ
              http://kubuntuforums.net/forums/inde...opic=3099811.0
              FAQ#16. Out of disk space, filesystem full, how can I tell where it went, etc. etc.
              Also, to learn which directory is holding an unusual amount (number or size) of files, use
              Code:
              du -h --max-depth=1 | sort -n
              first at the "/", or root directory, and then change to whichever directory appears to have an unusually large size, and use it again to see which sub-directory is unusually large.

              >>> From Rog131:
              FAQ: Free Disk Space
              http://kubuntuforums.net/forums/inde...opic=3086353.0

              >>> From Herman:
              Fixing filesystems, damaged superblock:
              Filesystems and Mounting (and fixing):
              http://users.bigpond.net.au/hermanzone/p10.htm


              Ways to keep your flash drive clean and plenty of free space available

              -- Run the command (as root, using sux): apt-get clean
              This is especially important in sidux where APT is used for package management (and downloads).
              => The option "clean" clears out the local repository of retrieved package files. It removes everything but the lock file from /var/cache/apt/archives/ and /var/cache/apt/archives/partial/. When APT is used as a dselect(8) method, clean is run automatically. Those who do not use dselect will likely want to run apt-get clean from time to time to free up disk space. See man apt-get.

              -- PhotoRec
              Be careful! It can fill up your disk quickly with files it finds.
              Recovered files are written in recup_dir.1, recup_dir.2... sub-directories. It's possible to access the files even if the recovery is not finished.
              Carefully decide where to direct PhotoRec output. If you direct the output to the live sidux flash drive, remember to clean it up afterwards as it can easily fill up the flash drive rather quickly.
              >>> Tips on using PhotoRec:
              In the last step of PhotoRec, you are asked, Do you want to save recovered files in /root? [Y,N]
              If yes, then the home of root on the flash drive will be used to store the directories recup_dir.n.
              Instead, you can choose other locations on a hard drive or an external USB HD or another flash drive.
              If you use another flash drive or an external USB HD, you should first plug them in before opening PhotoRec, let sidux recognize them, open them, close them, then open PhotoRec and PhotoRec will also see them. You select the location for saving recovered files in the last step of PhotoRec by using up and down arrow keys to select a directory (one dot . is the current directory, two dots .. is the parent of the directory you are in). To select a directory you have highlighted, press the right arrow key. Continue until you are satisfied, then press Y to accept the destination for saving recovered files.

              -- Thunderbird email: Compact your folders! IMPORTANT!
              That's because when you delete email and empty the Trash, you don't physically delete the email--they are only hidden. These hidden e-mails are physically removed only when the folder is compacted. If you don't compact your mail folders periodically, they can grow very large, and erratic program behavior may occur.
              How to COMPACT email folders:
              Open Thunderbird, highlight Local Folders, then File > Compact Folders.
              To set Thunderbird to automatically compact your email folders, Edit > Preferences > Advanced > Network & Disk Space > Disk Space > check the box Compact folders when it will save over 100 KB.

              -- Empty Trash at Konsole or in Konqueror
              It sometimes happens that you are unable to “Empty Trash Bin.” Or, you delete something, but it doesn't appear in the Trash Bin. Such items are here:
              /home/your_name/.local/share/Trash/files and /home/your_name/.local/share/Trash/info.
              where you will see two folders: files and info. The directory called files contains deleted folders and deleted files; and info contains information about such deleted items. You can manually empty files and info as follows:
              cd /home/your_name/.local/share/Trash
              ls
              files info
              rm -r files
              rm -r info
              The folders files and info will be re-created as they are needed.
              >>> Use Konqueror: You can do the same thing in the GUI, using Konqueror.

              -- Deleting folders and files at Konsole
              If you can't delete a folder or file using Konqueror, you can do so at the command line. Navigate at Konsole to the directory containing the file or folder you want to delete.
              If you need to be root, type sux at Konsole before proceeding.
              > To delete a file:
              rm file
              > To delete a folder (and its contents):
              rm -r folder
              > To delete only the contents of a folder (not the folder itself):
              rm -r folder/*

              Caution: To be certain that the remove command (rm) used with the wild card * removes hidden files, you might run it this way:
              shopt -s dotglob
              rm -r folder/*
              (or sudo rm -r folder/*)
              You can configure your BASH file to do this automatically:
              Edit the file
              ~/.bashrc
              to include the following:
              # This ensures that * includes hidden folders and files when using cp and rm
              shopt -s dotglob
              (Then File > Save, File > Quit)

              -- Other files to delete
              For many more places to look to delete unwanted files, see
              Privacy Cleanup 101
              http://kubuntuforums.net/forums/inde....msg115011#new
              (aka: Qqmike; written for Kubuntu, but many ideas apply to sidux)

              ********************

              Cloning your live persistent flash drive
              Boot into an OS (e.g., sidux on your hard drive or a live sidux CD), plug in your live sidux flash drive and plug in an empty flash drive of the same size (GBs); Suppose these are seen as sdc and sdd, respectively. (To know this, run sux and then fdisk -lu.)
              To clone sdc, run, as root (using sux), the following:
              sux
              dd if=/dev/sdc of=/dev/sdd bs=4096 conv=notrunc,noerror
              The dd copies everything--including GRUB bootloader, the MBR, the partitioning, and the formatted filesystems; the flash drive sdd is now ready to boot up: Test it.


              ********************

              Troubleshooting tips

              -- While booting up the live sidux CD, if you don't make it, are dropped to a prompt, but there are no error messages, type at the prompt startx, press Enter.

              -- If you have problems re-booting after ending a live sidux CD session, when you are dropped to a prompt, restart manually as root:
              sux
              shutdown -r now

              -- Password problems in live sidux
              If you get stuck in a live session and it seems you need a password, then make one up:
              Open a console
              sux
              passwd
              Then, if needed
              startx

              This from the sidux manual:
              Live Mode root password -- working as root in live session
              http://manual.sidux.com/en/live-mode-en.htm#rootpw
              Partitioning tools may request a root password, type sux. On a Live-ISO none is set just press 'enter' or type sux.

              ****************************************
              REFERENCES

              sidux (always lower case "s")
              http://sidux.com/

              sidux Manual (15 languages as of March 2009)
              http://manual.sidux.com/

              TestDisk (to recover lost/deleted partitions, recover MBR)
              http://www.cgsecurity.org/wiki/TestDisk
              PhotoRec (to recover lost/deleted documents, pictures, movies)
              http://www.cgsecurity.org/wiki/PhotoRec

              How To Make GRUB Thumb Drive
              http://kubuntuforums.net/forums/inde...opic=3081748.0
              A toolkit for working with flash drives

              Privacy Cleanup 101
              http://kubuntuforums.net/forums/inde....msg115011#new
              (Places to look to delete unneeded files.)

              dd Command
              http://kubuntuforums.net/forums/inde...opic=3090824.0

              RESCUE Partitions & Data
              Data Rescue Links & Comments & Tips
              TestDisk -- PhotoRec -- Knoppix (or other Live CDs)
              http://kubuntuforums.net/forums/inde...opic=3091847.0

              Commands at Konsole: Beginners
              http://kubuntuforums.net/forums/inde...opic=3091607.0
              In 3 parts, new/improved, complete basic tutorial.

              How To GRUB Methods - Toolkit
              http://kubuntuforums.net/forums/inde...opic=3081671.0
              GRUB ERRORS: See Reply #23


              ****************************************
              APPENDIX 1 Flash Drive Notes: Following the bytes as a % used

              UFD = USB Flash Drive

              Some Miscellaneous Flash Drive Issues and Notes
              Flash drive capacity (GB and GiB as seen from different utilities)
              Flash drive setup and loaded with
              sidux-2009-01-ouranos-kde-lite-i386-200902151242.iso (450 MB)
              Flash drive sidux files (home and menu.lst)
              Flash drive wear-out (comments and links--as of March 2009)

              NOTE: GB and GiB (Source: http://en.wikipedia.org/wiki/GiB)
              -- getting the prefixes correct

              Gibibyte (a contraction of giga binary byte) abbreviated GiB.
              1 gibibyte = 2**30 bytes = 1,073,741,824 bytes = 1024 mebibytes
              Thus:
              ----------
              decimal kilobyte = 1000 bytes
              binary Kibibyte = 1024 bytes (2**10)
              ----------
              decimal Megabyte = 1000*1000 = 10**6 =1,000,000 bytes = MB (or M)
              binary Mebibyte = 1024*1024 = 2**20 = 1,048,576 bytes = MiB (or Mi)
              ----------
              decimal Gigabyte = Megabyte * 1000 = 10**9 = 1,000,000,000 bytes = GB (or G)
              binary Gibibyte = Mebibyte * 1024 = 2**30 = 1,073,741,824 bytes = GiB (or Gi)


              Flash drive capacity (GB and GiB as seen from different utilities)

              You will notice that quantities reported by various utilities may be approximate, rounded, and/or express in either binary (MiB's) or decimal (MB's). It's best not to get too obsessed trying to follow every single byte, but simply to keep an eye on the percent of space used on the flash drive. Also, be aware that of the total physical device you purchased, space is reserved on it for the controller (of the flash drive device) and for extra space for repairs (bad cells). Space is also required for partitioning and formatting.

              Example Kingston 4 GB DataTraveler (DTI)

              -- Zero-out the flash drive; check the capacity

              This was done in GParted Live CD at Terminal using the following dd command (where the UFD is seen as sdc):
              sudo dd if=/dev/zero of=/dev/sdc
              Output of the dd comand:
              7936001+0 records in
              7936000+0 records out
              4,063,232,000 bytes (4.1 GB)
              1546.11 s, 2.6 MB/s [so, it ran 1546.11 seconds, almost 26 minutes]

              NOTE: With this dd statement, 1 record = 512 bytes since the default block size was used (bs=512).
              Writable or accessible capacity:
              In the GParted Live CD session, the capacity of the writable space on the flash drive was noted using dd, GParted, and TestDisk (right-click on the GParted desktop to open testdisk). Thus:

              dd 4,063,232,000 bytes (4.1 GB)
              TestDisk 4063 MB/3875 MiB (and so rounded to about 4,063,000,000)
              GParted 4,055,063,552 bytes (3.78 GiB)
              Note: In GParted, right-click on the space (unallocated), select Information; 1 sector =512 bytes.


              Next step:
              Flash drive setup and loaded with
              sidux-2009-01-ouranos-kde-lite-i386-200902151242.iso (450 MB)

              After setting up the partition, there is 2% used space.
              Details:
              After using dd to zero out the flash drive, still in the Live GParted CD session, an ext2 partition was made, with Label sidux-USB, and the boot flag set on that partition. GParted then reported 68.29 MiB used => 68.29 MiB * 1,048,576 bytes/MiB = 71,607,255 bytes used to set up the partition => 2% used (as reported by GParted).

              Next step:
              Install sidux on the flash drive. That took (on my setup) about 4 minutes. Afterwards, GParted reported 14% used (about 535.67 MiB used).


              Flash drive sidux files (home and menu.lst)

              When you are in sidux installed on your hard drive and plug in the live sidux UFD, you will see this:
              /fll/cow/home/sidux/Desktop and your other personal (home) files under /fll/cow/home/sidux.
              When you are in a live sidux flash drive session, your will access your personal home files simply under /home/sidux/. Thus, the user name for your home is "sidux."

              You might also wish to have a look at the GRUB boot menu, /boot/grub/menu.lst:
              ##ISO boot
              title sidux (USB) 2.6.28-5.slh.3-sidux-686
              kernel (hd0,0)/boot/vmlinuz-2.6.28-5.slh.3-sidux-686 boot=fll fromhd=UUID=cfc9149d-02ee-4a6e-b7ff-5af85a360239 fromiso nointro quiet persist lang=us vga=791
              initrd (hd0,0)/boot/initrd.img-2.6.28-5.slh.3-sidux-686

              The boot parameters are explained in the Manual:
              Cheat codes
              http://manual.sidux.com/en/cheatcodes-en.htm

              What does boot=fll mean?
              Answer (from a forum post):
              fll (two ell's, not ones) is our fll-live-initramfs script, it is what sets up the modified 'live' mode of the sidux media. The boot= parameter lets the initramfs-tools init script know what boot script to execute. See initramfs-tools (man initramfs-tools).

              Flash drive wear-out (comments and links--as of March 2009)
              I am not treating the subject of flash drive wear-out except to offer these personal observations and some good links to get you started. Wear-out is a real possibility, but my reading suggests that in most realistic applications, wear-out would occur long after the useful life of the flash drive is reached (after the warranty period)--a matter of several years. Anecdotal evidence (hearsay) suggests that people have used their live flash drives as their main OS for two years or more. Remember, too, that internal hard drives and external USB drives also have a finite useful life and are also subject to random failures.

              Rx: If you are worried about wear-out, do three things:
              1 Use the ext2 filesystem to format your sidux partition (instead of the journaling filesystem ext3).
              2 Clone you live sidux flash drive, and do so from time to time, keeping the clone as your backup.
              3 Maintain timely backups of all important data kept on the flash drive; back up your data to another medium (e.g., another flash drive, a CD/DVD, an external USB HDD, or to an internal hard drive folder).

              Start with these references to learn more and decide for yourself how important wear-out is to you:

              Flash memory, wear-out, leveling, bad cells, etc.:
              Crucial FAQ:
              http://www.crucial.com/kb/answer.aspx?qid=4088
              From Cosair:
              https://www.corsairmemory.com/_faq/F...r_leveling.pdf
              Kingston:
              Kingston.com/flash_memory_guide
              Samsung defends flash reliability in solid-state drives
              http://news.cnet.com/8301-13924_3-9876557-64.html


              ****************************************
              APPENDIX 2

              APT Commands A Summary Sheet

              Some of this information comes from the sidux Manual:
              A small APT-Guide Cookbook
              http://manual.sidux.com/en/sys-admin...n.htm#apt-cook

              sidux uses APT, not a GUI (Adept or Synaptic)
              APT is "Advanced Packaging Tool "

              Help
              apt-get help
              man apt-get

              Root: run the APT commands below using root ; i.e., by first typing
              sux

              Sources (of packages)
              /etc/apt/sources.list –> where to look for and get packages
              http://packages.debian.org/stable/allpackages.html – all Debian packages

              All packages on your system: dpkg -l
              Print this list to a file: dpkg -l > MyListDebian.txt

              apt-get update
              Run this after editing source.list and before using apt-get.
              Run this before running apt-get install.

              More on searching for packages and version information
              Run apt-get update, then:
              > Search: apt-cache search package_name
              > find out which packages have new/newer versions (first install apt-show-versions):
              apt-show-versions -u
              > list of all packages, that contain or address "sidux" and "manual" is obtained by:
              apt-cache search sidux manual
              > for more information on a particular package, you can use (e.g., for package sidux-manual-en):
              apt-cache show sidux-manual-en
              > All installable versions of a package (they depend on your sources.list) can be listed by typing (e.g., for package sidux-manual-en):
              apt-cache policy sidux-manual-en


              General:
              First: apt-get update
              Search: apt-cache search package_name
              Install: apt-get install package_name
              Remove: apt-get remove package_name
              apt-get --purge remove package_name
              (--purge: deletes config files, too)
              Clean: apt-get clean
              (cleans /var/cache/apt/archives where packages are first downloaded)
              apt-get autoclean
              (removes old package files, out of date, no longer useful)
              Find: Start at root: cd / && sudo find -name name_of_file
              Start at directory dir: cd / && sudo find -name dir name_of_file

              .deb
              Installing .deb packages that are already downloaded to you:
              dpkg -i package.deb

              Repair APT

              This may be a “best” choice:
              apt-get -f install

              There are two separate commands:
              dpkg –configure or dpkg –configure -a
              (configures unconfigured packages)
              dpkg-reconfigure or dpkg-reconfigure -a
              (reconfigure already configured packages)
              -a option
              with the -a option, both commands will configure all packages that meet the criteria
              (dpkg-reconfigure -a may take a while)

              Usual scenarios where you want to use them:
              dpkg --configure -a
              When upgrade has been interrupted by errors or crash, to complete the installation of packages
              dpkg-reconfigure <package_name>
              When you want to change the package behavior, it will ask debconf questions (again)
              so you can change your answers and modify the configuration.

              An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

              Comment


                #8
                Flash drives: Re: RESCUE Partitions &amp; Data

                The above how-to post, sidux Live Persistent Flash Drive, has undergone a major revision, expansion, and improvement.

                The Summary--Table of Contents will give you a quick idea what is included.

                Lots of good stuff that applies in general to Kubuntu (e.g., avoiding "Disk full," and what to do if your disk/partition is full).

                Also serves as a guide to using flash drives: preparing, zero-out, partition/format, booting.
                Use of apt-get.
                Using GParted Live CD.
                Flash drive wear-out (Appendix 1)

                and more



                This will apply also to putting Kubuntu on a live persistent flash drive (using usb-creator) for rescue/repair -- see the REFERENCES.
                (More on Kubuntu later on.)
                An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                Comment


                  #9
                  Edited Post #6 (on Photorec) for typos (in some filename paths):

                  https://www.kubuntuforums.net/showth...l=1#post161927
                  An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                  Comment


                    #10
                    Fix UEFI+GPT with Testdisk & gdisk -- Deleted partitions & damaged GPT structure


                    https://www.kubuntuforums.net/showth...l=1#post372417

                    The present how-to, Rescue Data and Partitions, contains a lot of useful stuff, but it needs to be updated. I'm placing the GPT-repair work under GRUB 2 along with other UEFI+GPT information.
                    Last edited by Qqmike; May 14, 2015, 02:17 PM.
                    An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                    Comment

                    Working...
                    X