Programming :: Delete Gaps In Directory In A Ext2 File System?
Nov 1, 2010
Directories(-entries) are in a EXT2 file system
managed in a singly linked list.
Delete files in the directory causes Gaps or holes to appear in
the linked list of the directory.How does a C-source code look like,
which would reorganize this list and remove the gaps or Holes.
My Redhat Enterprise Linux 4 with 6x partitions (/, /boot,/home, /usr, /var, /tmp) of 6.0 GB IDE Hardisk was working quite fine. I decided to create LVM on /home and /var partitions but due to some errors occured and I delete the /home partitions. That's why partition table altered. I then delete 4,5,and 6th partitions (/home, /var, /tmp) partitions and now try to create one by one but following error is coming:-
The Super block could not be read or do not describe a clear ext2 file system. E2fsck b 8193 <device> I have tried following commands,but could not successful:- e2fsck -p /dev/hda7 (where hda7 was created but afterthat it was deleted) e2fsck -a /dev/hda7
Some say because the record is not in a fixed length so rec_len is the real record length. Why is the length of the array `name' not fixed? I thought C arrays like this should be fixed length. C99 has variable-length arrays, does this structure count on C99?
I just rebuild the kernel for slackware 13, everything works, but root file system which is ext3 is mounted as ext2. Normally I've build ext3, ext4 and so on as modules, not in the kernel... but if I do this, then the kernel mounts the file system as ext2, which is build in the kernel. I also modified rc.modules so I can make sure that ext3,ext4,jbd are loaded, but it doesnt work.
I have dual boot system..i.e, windows XP and ubuntu 9.10(insatlled side by side). when i try to boot ubuntu, Im gettin sh:grub > prompt
I am getting something like this.. root mount file system failed.. ext2 ext3 ext4 ....... kernel panic message and hanged at kenelthreadhelpper+ what can i do.. I cant reinstall ubuntu again.. Because I have installed nany application there..
I had to install a new disk drive in my PC a week ago because the old drive died. The new drive is a 160 gig drive. First I installed Win XP with S/P 3 and everything was fine. Then I installed Ubuntu 8.04 and the troubles began. Ubuntu resized the Windows partition down to 8.81 gig and used the other 137.44 gig for Ubuntu. When I booted into Windows I started getting nasty little messages about "not enough disk space". SOOoooo....... I booted using the Ubuntu install CD and ran "sudo gparted" in a terminal window. I tried to resize the ext2 partition but got an unknown error.
Then I ran fixmbr in Windows to get rid of grub. Then I tried running gparted again to delete the ext2 partition. Got an error that said "can't delete the partition because it's mounted". So I tried to unmount the partition but got a message that the command "unmount" could not be found. After that I installed Partition Magic in Windows and tried that. It sees the ext2 partition but says it's unsupported when I try to delete or resize it.
I ran fdisk but it doesn't see the Linux partitions either, so I can't delete them in that program. I finally tried to format the disk but now I have a 9 gig drive with nothing on it. How do I get those Linux partitions off the drive so I will have a 160 gig drive that I can start over with? I've spent 6 days this week reinstalling XP and all of my programs, and now everything is gone because Ubuntu decided to be a disk hog.
I am relatively new to ubuntu/linux and although I have made some good progress on my server I'm struggling with a few points. I am sure what I'm about to ask has been covered in some other thread/guide but I just cant pick out the missing piece hence my direct question;I have 2 computers; a server and mediacenter.on the server I have installed nfs:
Code: sudo apt-get install nfs-kernel-server nfs-common portmap then
I am facing a problem in Windows due to a virus called Newfolder.exe which creats files with the same name as it's parent directory and an extension .exe and this happens for every directory in the entire hierarchy in the infected pen drive. The antivirus detects them, but is sucking slow. So I thought this is a good opportunity to use the concepts of the all mighty shell script to remove those as they follow the same pattern. Say my complete path is
The virus would have created an file with complete paths
If fol1 has two more directories fol11 and fol12 Then there would be two more .exe(virus created) in the following path
I was transferring some files from my laptop (running FC6) to a server at my work (don't know what kind) with "scp -rpC" and it stalled, don't know why. Now when I try to delete the files from the server so I can start again I get the following error message
I am trying to add a command to my backup script to delete the oldest file in the destination folder before adding a new .tar.gz file.I found this information at .html which I thought would work fine and added the following line to my backup script:ls -t -r -l /backups/Scalix_Backup* | head --lines 1 | xargs rmHowever when I tried this I get an error:rm: invalid option -- wTry `rm --help' for more information
I installed wine and now i get the option to open some files with notepad. I know I can delete this entry when I go to the properties of a document and delete it in the tab "open witth". Is there a way to delete notepad for every file in the system?
When I boot up my Ubuntu system I get the following error message:Install Problem The configuration defaults for Gnome Power Management have been installed incorrectlyI found the following posting and this describes what also happesystemhttps://answers.launchpad.net/ubuntu...uestion/111256I've created a recovery disk by using a memory stick from which I can boot. I can mount the old filesystem (HD). When I navigate, with the file browser, into one of the folder on the the HD and try to delete messages I get the following error message - 'Error removing file: Permission denied'.I guess I need to log / tell those files the root password from the system installation as per the version on the HD. But how do I do this?
I would like to delete a single line from a file that contains many lines passing through the same values as the two parameters. Again, I would like to delete a single line and not all those that contain parameters. How can I make bash?
I am using Subversion version1.2 and need one favour. I have written code to delete particular revision from SVN Repository. Unfortunately, i couldn't delete particular version from repository. Any one can response me.. how to delete?
Quote:Originally Posted by topcatI would like to know how i can write a shell script to delete a line if a particular pattern exists?E.g. I have a text file with multiple lines. Say 1000s. in the following pattern.
If the firstname.lastname@example.org exists then the line "email@example.com:18.104.22.168:1 should be deleted from the file.I have a very similar question but I need to delete one line in a file which matches one very precise instance of a string only. Let's assume I have a file composed of thousands of lines and let's call the file chap-secrets. Let's take the following sample entries:
Code: #USERNAME SERVER PASSWORD IP pp pptpd blahblah *
Order of these lines are random... So I cannot delete line #19, for example... And you can see that top four lines I want to delete are pairs. So there might be some clever way to detect the lines, if a line has both "1.9" and "1.11", then delete the line... I am new to perl language. The following is the code I have now... I think I just need to write some code inside the while loop checking if I want to delete the line $dotline before I write to a NEW file.
I have a file with three consecutive blank lines. I want to delete two and keep one.Also, if anyone could direct me towards a guide on regular expressions particularly as they apply to sed, I would be grateful. I am having a hell of a time figuring out the syntax.
I am using F14 Xfce and i have installed awn so i do not need my desktop icons anymore, ie home,bin and file system, is there any way to delete/remove them? i have installed gconf-editor and unchecked them in apps-->nautilus-->desktop, but they are still there?
I have some very confidental files on my computer that I store such as credit reports, and other things. I always encrypt them with GPG, but there still is that original non-encrypted file left that needs to be deleted. I looked into tools like wipe, and shred but they all say that it really doesn't help on journaling filesystems directly on their man page.
I am not asking how to wipe the whole drive with dd or anything, but I am simply asking if there is a tool that'll delete a single file securely.
I use Markdown to store all of my source documents. Unfortunately, the .md extension maps to application/x-genesis-rom under Ubuntu. I'm not sure why that would be a system default MIME type, but I'd like to change it.
I've tried using:
Code: gksu assogiate
to modify my file type cache. Unfortunately, even as the SU, I can't modify the entry for this file type. The "Remove" button is inactivated for the entry. (See attachment.)
How can I get rid of this (obsolete?) file association? Alternatively, how can I make my new one (text/x-markdown) take precedence?
I have the cowon iAudio7 music player with vfat file system and increasingly running into permission problems when I try to delete files. Unsurprisingly I am now running out of space. I am figuring if I could somehow mount it onto a folder in my home partition I will have full permissions. The problem is the drives name which is exactly with space: So even if try to delete files in the terminal I don't know how to cd into:
Code: /media/I AUDIO7 note the space between I & AUDIO7.