15/11/14

nov 9, 2014 ext3, ext4: liberar espacio reservado con tune2fs

http://rm-rf.es/ext3-ext4-liberar-espacio-reservado-con-tune2fs/

Usage: tune2fs [-c max_mounts_count] [-e errors_behavior] [-g group]
        [-i interval[d|m|w]] [-j] [-J journal_options] [-l]
        [-m reserved_blocks_percent] [-o [^]mount_options[,...]]
        [-r reserved_blocks_count] [-u user] [-C mount_count] [-L volume_label]
        [-M last_mounted_dir] [-O [^]feature[,...]]
        [-E extended-option[,...]] [-T last_check_time] [-U UUID]
        [ -I new_inode_size ] device




# tune2fs -l /dev/sda2 | grep "^Reserved"
Reserved block count:     3011283      
Reserved GDT blocks:      1009
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
 
 
Como podéis ver tenemos reservados 3011283 para el usuario root. Cada 
bloque son 4096 bytes por lo que tenemos reservados 11GB 
aproximadamente.
 
 
Para modificar el número de bloques reservados debemos ejecutar tune2fs con el parámetro -m seguido del nuevo porcentaje de bloques a reservar. En este caso vamos a reducir el número de bloques al 3%:

# tune2fs -m 3 /dev/sda2
 
 
# tune2fs -l /dev/sda2 | grep "^Reserved"
Reserved block count:     1806769      
Reserved GDT blocks:      1009
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root) 
 
 
 
Otra fuente sugiere usar 
 
 
# tune2fs -r 0 /dev/sda2

How to umount when the device is busy


http://z9.io/2008/02/13/how-to-umount-when-the-device-is-busy/

It happens all the time doesn’t it? You need to unmount a CD or you want to pack away the external drive but when you try to umount it you get the dreaded “device is busy” message. Wouldn’t it be great if Linux actually told you what was keeping the drive busy? Here we are in 2008, I’m using Ubuntu Gutsy, and that message hasn’t changed in all the years I’ve used Linux.
# umount /media/disk/
umount: /media/disk: device is busy
umount: /media/disk: device is busy
First thing you’ll do will probably be to close down all your terminals and xterms but here’s a better way. You can use the fuser command to find out which process was keeping the device busy:
# fuser -m /dev/sdc1
/dev/sdc1: 538
# ps auxw|grep 538
donncha 538 0.4 2.7 219212 56792 ? SLl Feb11 11:25 rhythmbox
Rhythmbox is the culprit! Close that down and umount the drive. Problem solved!