Well, this is silly. If you use dd to truncate a file this way you
lose the trailing byte :)

I really want to know : Is there another way to truncate a file in Linux?

This would be a silly way to avoid wasting a byte to truncate a file
to have 2 bytes with dd.

~$ echo 12345 > x
~$ dd if=x skip=1 bs=1 count=1 > t
~$ dd if=t seek=1 of=x count=1 bs=1
~$ cat x
12

Regards,
Nelson.-

On Tue, 15 Mar 2005 12:48:41 -0500, Nelson Castillo <[EMAIL PROTECTED]> wrote:
> On Tue, 15 Mar 2005 18:14:06 +0100, Blaisorblade <[EMAIL PROTECTED]> wrote:
> > On Tuesday 15 March 2005 16:17, itamar wrote:
> > > How to resize a ext3 root_fs ?
> > >
> > > e2fsck -j ext3 filename
> > >
> > > dd if=/dev/zero of=filename bs=1 count=1 seek=newsize conv=notrunc
> > >
> > > resize2fs -p filename
> > >
> > > e2fsck -j ext3 filename
> > >
> > > this works ?
> > IIRC it works well, I just don't remember whether conv=notrunc is needed...
> 
> Hey! I really wanted to know a way to truncate a file!
> 
> It works, but you first have to call "resize2fs" and then  "dd" without 
> notrunc.
> When I first read the itamar's way to do it, I didn't try the "dd" thing
> because he used dd before using resize2fs.
> 
> :P

-- 
Homepage : http://geocities.com/arhuaco

The first principle is that you must not fool yourself
and you are the easiest person to fool.
     -- Richard Feynman.


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
User-mode-linux-user mailing list
User-mode-linux-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user

Reply via email to