Results 1 to 10 of 10

Thread: How do I fsck the fs that's on a USB key?

  1. #1
    Junior Member
    Join Date
    Jun 2013
    Posts
    14

    How do I fsck the fs that's on a USB key?

    Recently, I decided to create a new Knoppix USB key to use for debugging, but in the process of updating various packages, I somehow created a file which is listed as having zero links. Because of the file's (non)existence, Synaptic/dpkg can't replace it or delete it, and won't allow any more updates until I do. I've tried deleting it at a command prompt, I've tried linking it to another name, but every approach I try causes complaints either that it doesn't exist, or that it already exists. I think running fsck would fix it, but these files apparently aren't stored in an actual *nix filesystem, but rather in a file in the USB key's FAT filesystem. How can I mount this pseudo-filesystem from another CD or USB key version of Knoppix to run a fsck on it? I'd really like to avoid starting from scratch and redoing all the configuration that I've already done to this USB key.

    [Note that my question has nothing to do with fixing another OS (as many people, including myself, use Knoppix USB keys for); what I'm talking about right now is fixing the Knoppix installation on the USB key itself.]

    [Also, if it matters, I used pendrivelinux.com to make this USB key instead of Knoppix's own "copy to USB" scripts, so that I wouldn't have to burn a DVD as an intermediate step, when I'd only need to use the DVD once to create the USB.]

  2. #2
    Moderator Moderator
    Join Date
    Nov 2010
    Location
    Germany/ Dietzenbach
    Posts
    1,124
    I somehow created a file which is listed as having zero links. Because of the file's (non)existence, Synaptic/dpkg can't replace it or delete it, and won't allow any more updates until I do.
    Tell us all about this file.

  3. #3
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631
    @soubeagi

    The directory .gvfs which may occur inside /home/knoppix is such a 'file'.
    A forum search of gvfs will give you seven threads which discuss (in a few comments)
    some this peculiarity of Debian-derived linuxes. Perhaps you've found something similar(?).
    Last edited by utu; 06-03-2013 at 04:33 PM.

  4. #4
    Junior Member
    Join Date
    Jun 2013
    Posts
    14
    Quote Originally Posted by Werner P. Schulz View Post
    Tell us all about this file.
    -=-=- From package install attempt:
    E: /var/cache/apt/archives/iptables_1.4.14-3.1_i386.deb: unable to make backup link of `./lib/libip4tc.so.0.1.0' before installing new version: No such file or directory
    -=-=- and

    Selecting previously unselected package iptables.
    (Reading database ... 443739 files and directories currently installed.)
    Preparing to replace iptables 1.4.14-2 (using .../iptables_1.4.14-3.1_i386.deb) ...
    Unpacking replacement iptables ...
    dpkg: error processing /var/cache/apt/archives/iptables_1.4.14-3.1_i386.deb (--unpack):
    unable to make backup link of `./lib/libip4tc.so.0.1.0' before installing new version: No such file or directory
    dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
    Processing triggers for man-db ...
    Errors were encountered while processing:
    /var/cache/apt/archives/iptables_1.4.14-3.1_i386.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    A package failed to install. Trying to recover:
    -=-=- From package removal attempt:
    E: iptables: unable to securely remove '/sbin/xtables-multi': No such file or directory
    -=-=- and
    (Reading database ... 443738 files and directories currently installed.)
    Removing iptables ...
    dpkg: error processing iptables (--remove):
    unable to securely remove '/sbin/xtables-multi': No such file or directory
    Errors were encountered while processing:
    iptables
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    A package failed to install. Trying to recover:
    -=-=- From terminal:
    knoppix@Microknoppix:~$ su
    root@Microknoppix:/home/knoppix# ls -l /sbin
    lrwxrwxrwx 1 root root 13 Jun 3 14:38 /sbin -> /UNIONFS/sbin
    root@Microknoppix:/home/knoppix# ls -l /UNIONFS/sbin
    total 12896
    -rwxr-xr-x 1 root root 3104 Dec 2 2009 acpi_available
    -rwxr-xr-x 2 root root 26684 Sep 14 2012 agetty
    -rwxr-xr-x 1 root root 3404 Dec 2 2009 apm_available
    -=-=- . . . yadda yadda yadda
    -rwxr-xr-x 1 root root 953968 Nov 17 2012 wpa_supplicant
    -rwxr-xr-x 1 root root 535368 Jun 22 2012 xfs_repair
    -rwxr-xr-x 0() root root 81024 Jun 11 2012 xtables-multi
    root@Microknoppix:/home/knoppix# cd /UNIONFS/sbin
    root@Microknoppix:/UNIONFS/sbin# ln xtables-multi xtables-temp
    ln: failed to create hard link `xtables-temp' => `xtables-multi': No such file or directory

  5. #5
    Moderator Moderator
    Join Date
    Nov 2010
    Location
    Germany/ Dietzenbach
    Posts
    1,124
    You can try to start Knoppix without activating the persistent memory (cheatcode: knoppix noimage)
    If you have the persistent memory within knoppix-data.img start in a terminal
    Code:
    su
    mkdir /mnt/repair
    losetup /dev/loop1 /mnt-system/KNOPPIX/knoppix-data.img
    mount /dev/loop1 /mnt/repair
    Perhaps you can now remove the disturbing file-entry. After this proceed with
    Code:
    umount /dev/loop1
    losetup -d /dev/loop1
    reboot

  6. #6
    Junior Member
    Join Date
    Jun 2013
    Posts
    14
    Quote Originally Posted by Werner P. Schulz View Post
    You can try to start Knoppix without activating the persistent memory (cheatcode: knoppix noimage)
    That seems to have worked; I'll let you know for sure once I reboot. For now I just want to document what happened when I followed your instructions.

    knoppix@Microknoppix:~$
    su
    root@Microknoppix:/home/knoppix# mkdir /mnt/repair
    root@Microknoppix:/home/knoppix# losetup /dev/loop1 /mnt-system/KNOPPIX/knoppix-data.img
    root@Microknoppix:/home/knoppix# mount /dev/loop1 /mnt/repair
    root@Microknoppix:/home/knoppix# ls -l /mnt/repair/sbin
    total 1340
    -rwxr-xr-x 1 root root 22156 Mar 21 01:18 badblocks
    -=-=- . . . yadda yadda
    -rwxr-xr-x 1 root root 67648 Mar 21 01:18 tune2fs
    -rwxr-xr-x 0 root root 81024 Jun 11 2012 xtables-multi
    root@Microknoppix:/home/knoppix# rm /mnt/repair/sbin/xtables-multi
    rm: remove regular file `/mnt/repair/sbin/xtables-multi'? y
    root@Microknoppix:/home/knoppix# ls -l /mnt/repair/sbin
    total 1256
    -rwxr-xr-x 1 root root 22156 Mar 21 01:18 badblocks
    -=-=- . . . yadda yadda
    -rwxr-xr-x 1 root root 67648 Mar 21 01:18 tune2fs
    root@Microknoppix:/home/knoppix# umount /dev/loop1
    root@Microknoppix:/home/knoppix# losetup -d /dev/loop1
    root@Microknoppix:/home/knoppix# rmdir /mnt/repair # I added this myself
    root@Microknoppix:/home/knoppix#

  7. #7
    Junior Member
    Join Date
    Jun 2013
    Posts
    14
    Well, for one thing, it took forever to reboot; I typed 'reboot', walked away to do something else for five minutes, came back, and found it still on the shutdown screen. When it finally restarted, I checked and found that the weird file was finally gone:

    knoppix@Microknoppix:~$ su
    root@Microknoppix:/home/knoppix# ls -l /UNIONFS/sbin
    -=-=- . . . yadda
    -rwxr-xr-x 1 root root 535368 Jun 22 2012 xfs_repair
    root@Microknoppix:/home/knoppix#

    Next, I started Synaptic and found that 'iptables' was still tagged for removal, so i let it try:

    E: iptables: unable to securely remove '/sbin/nfnl_osf': No such file or directory
    -=-=- and

    (Reading database ... 443738 files and directories currently installed.)
    Removing iptables ...
    dpkg: error processing iptables (--remove):
    unable to securely remove '/sbin/nfnl_osf': No such file or directory
    Errors were encountered while processing:
    iptables
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    A package failed to install. Trying to recover:

    Next, I tried to reinstall the package:

    E: /var/cache/apt/archives/iptables_1.4.14-3.1_i386.deb: unable to make backup link of `./lib/libip4tc.so.0.1.0' before installing new version: No such file or directory
    -=-=- and

    Selecting previously unselected package iptables.
    (Reading database ... 443739 files and directories currently installed.)
    Preparing to replace iptables 1.4.14-2 (using .../iptables_1.4.14-3.1_i386.deb) ...
    Unpacking replacement iptables ...
    dpkg: error processing /var/cache/apt/archives/iptables_1.4.14-3.1_i386.deb (--unpack):
    unable to make backup link of `./lib/libip4tc.so.0.1.0' before installing new version: No such file or directory
    dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
    Processing triggers for man-db ...
    Errors were encountered while processing:
    /var/cache/apt/archives/iptables_1.4.14-3.1_i386.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    A package failed to install. Trying to recover:

    I scrolled back thru the terminal output and found this:

    -rwxr-xr-x 0 root root 9672 Jun 11 2012 nfnl_osf

    Argh. Looks like I'm rebooting again.

  8. #8
    Junior Member
    Join Date
    Jun 2013
    Posts
    14
    Okay, after going through the motions again with this new messed-up file, I finally managed to get it to properly remove and reinstall the package in question.

    Next question: I noticed when updating the list of packages that this info is coming from ftp.de.debian.org, which seems wrong for me (I'm in the US) - but when I select Settings | Repositories from the menu, it goes directly to a "Repositories changed" infobox, without ever giving me a chance to actually change repositories. What, if anything, am I doing wrong here?

  9. #9
    Moderator Moderator
    Join Date
    Nov 2010
    Location
    Germany/ Dietzenbach
    Posts
    1,124
    Wheezy is stable
    The packages have a ride on the merry-go-round
    old stable - stable - testing - experimental - squeeze -wheezy - lenny -sid

    If you really need to upgrade a package, do it one by one and carefully comparing the version and version-#

    Why not wait for Knoppix 7.2?

  10. #10
    Junior Member
    Join Date
    Jun 2013
    Posts
    14
    Quote Originally Posted by Werner P. Schulz View Post
    Why not wait for Knoppix 7.2?
    I wasn't aware that there was going to be a new Knoppix release in the near future; I don't follow the goings-on in the Debian world all that closely. I just looked on knopper.net, saw that the current version being offered there was significantly newer than the one I had been using, and decided to update.

    -=-=-

    And, for the benefit of those who might in the future see the heading of this thread and expect to get a straightforward answer to the question posed there: it's here, it's just a little buried, so here's a "no brainer" version of how to do it:

    1. Boot the Knoppix installation in question by typing "knoppix noimage" at the "boot:" prompt.
    2. When it's finished booting, open a terminal window and type the following series of commands, one by one:
    Code:
     
    su
    
    losetup /dev/loop1 /mnt-system/KNOPPIX/knoppix-data.img
    
    fsck /dev/loop1
    Note that this assumes that the problem you're trying to correct came into being in the process of using the USB key, and didn't already exist in the CD or DVD image that you used to make the USB key. (That is to say, this will only repair changes to the filesystem that were made while using it, and will not change anything from the way it was originally created.)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Apple Macintosh PowerBook 180 Vintage Laptop | Retro Computer picture

Apple Macintosh PowerBook 180 Vintage Laptop | Retro Computer

$149.95



Apple Macintosh Performa 466 Vintage Computer | SKU 146754 picture

Apple Macintosh Performa 466 Vintage Computer | SKU 146754

$149.95



Apple 800K External Drive M0131 for vintage Macintosh Japan picture

Apple 800K External Drive M0131 for vintage Macintosh Japan

$20.00



Vintage Apple M2980 AppleDesign Keyboard - Tested and working - Good condition picture

Vintage Apple M2980 AppleDesign Keyboard - Tested and working - Good condition

$19.75



VINTAGE APPLE MACINTOSH POWERBOOK G3 UNTESTED NO POWER CORD picture

VINTAGE APPLE MACINTOSH POWERBOOK G3 UNTESTED NO POWER CORD

$64.99



Vintage Apple Macintosh MAC PC MATSUSHITA CR-587-C 24x CD-ROM Drive SCSI 1998 picture

Vintage Apple Macintosh MAC PC MATSUSHITA CR-587-C 24x CD-ROM Drive SCSI 1998

$39.99



Vintage Apple III Brochure for BPI Accounting Series, very nice condition picture

Vintage Apple III Brochure for BPI Accounting Series, very nice condition

$50.00



Vintage Apple Macintosh PowerBook 190 Series -  NO POWER FOR PARTS picture

Vintage Apple Macintosh PowerBook 190 Series - NO POWER FOR PARTS

$69.99



Vintage Apple A2M6016 12

Vintage Apple A2M6016 12" Monochrome Monitor

$25.00



Vintage Apple Macintosh PowerBook G3 M4753 w/ Power Adapter picture

Vintage Apple Macintosh PowerBook G3 M4753 w/ Power Adapter

$149.00