Archive for the ‘tips’ Category

« [35016.649727] EXT4-fs (sdb1): couldn’t mount RDWR because of unsupported optional features (400) »

Did you get this message when trying to format your 2To usb disk into ext4 ?
Well that’s normal, you can’t… but you can in ext3 !

As root, just delete the MBR :
dd if=/dev/zero of=/dev/sdX bs=512 count=1 (X = probably b but make sure you know what you delete !!)
Then :
parted /dev/sdX mklabel msdos

And launch gparted to do as usual… with ext3.
This will work from now on as a regular usb hard drive with GNU/Linux.

French/Français :

En root :
1) Détruire la MBR existante : dd if=/dev/zero of=/dev/sdX bs=512 count=1
(J’ai mis X pour pas que vous ne fassiez d’erreurs !! Choisissez bien la partition du disque dur externe !!)
2) Refaire une MBR propre : parted /dev/sdX mklabel msdos
3) Et enfin faire une partition nouvelle en ext3 avec gparted

Ensuite votre disque dur fonctionnera comme n’importe quel autre…

Read Full Post »

I’m a little oldschool so I log in debian using startx… but for some reason, a few months ago, I lost the french keymap ‘fr’ in tty but not in X11.

If you want to know how to make it work in X11, check out my .xinitrc file.

Otherwise read on.

When I do ‘loadkeys defkeymap’ as root I get : /usr/share/keymaps/i386/qwerty/defkeymap.kmap.gz

Wrong answer when I would be expecting : /usr/share/keymaps/i386/azerty/defkeymap.kmap.gz

So I tried Google… where you are asked to dpkg-reconfigure console-data, console-setup or keyboard-configuration. But it failed for me and quite a few other users…

You know that you’ll have do : ‘loadkeys fr’ after each boot… Soooo… why not add it to /etc/rc.local ? Just before ‘exit 0’…

Reboot… Works like a charm.

Now for some other reason, it seems that if you uninstall console-data (with console-common) there is no more /usr/share/keymaps/ directory… and no more problem either…

So there you have it… 2 ways to bypass the problem permanently.

Read Full Post »

  1. ~$ apt-get install syslinux (en root)
  2. ~$ isohybrid /chemin_vers/image.iso (en user)
  3. lsblk pour identifier le device cible :
    • ~$ lsblk (en user)
    • Avec comme réponse pour sdb : sdb1, sdb2…
  4. ~$ umount /media/clé_usb (en user) si nécessaire
  5. ~$ dd if=/chemin_vers/image.iso of=/dev/sdb (en root)
    Avec comme résultat ~ :

    • 1435648+0 enregistrements lus
    • 1435648+0 enregistrements écrits
    • 735051776 octets (735 MB) copiés, 143,125 s, 5,1 MB/s
    Attention :

  • La commande dd efface tout donc choisissez bien votre device cible !! (surtout en root)
  • Cette cible, c’est bien le chemin vers la clé usb /dev/sdb et pas une partition /dev/sdb1 ou 2 !!
  • Utilisez une clé de petite capacité (<4Go) car ce n’est pas possible d’y réserver une partition (/dev/sdb2 par exemple) pour y travailler en fat32/ntfs ou ext3/4. Toute la clé sera consacrée au système d’exploitation + boot. Du moins, je n’ai pas réussi à faire autrement… à vous de voir.

Read Full Post »

As root :
vim /etc/hostname : change localhost to debian for example.
Do the same here : vim /etc/hosts (to anything that would have localhost in its name).
And finally : /etc/init.d/hostname.sh start
When you’ll reboot, the changes will have taken place.

Read Full Post »

For some reason fdisk -l as root doesn’t show my Samsung Galaxy Ace anymore…
[Android 2.3.6 and Kernel with Linux debian 3.12-1-686-pae #1 SMP Debian 3.12.6-2 (2013-12-29) i686 GNU/Linux]
Usually I have to go through this step in order to mount the device once back in user mode…
But now I must run fdisk -l /dev/sdb in order to show :
/dev/sdb1 8192 7954431 3973120 b W95 FAT32
Then, and only then, can I exit root and mount the device as user with a simple mount /media/vfat/

Read Full Post »

Before using rsync I used the following :
tar czvf "/media/extHD/BACKUPS/$(date +%Y%m%d)_HOME_DATAS.tgz" ~/ --exclude=~/.thumbnails/ /datas/ --exclude=/datas/PHOTOS/

This created a zipped archive to the present date into my external hard drive.
It backs up my home directory and /datas/ excluding files or directories as shown.
Of course I excluded more than just these two but for the purpose of this article I simplified the command line.

I was happy with this a long time but some clusters on the hard drive became defective so I am worried a whole enormous file like these backups would get corrupted as well… and lose everything.
So the only other way, using the exclude option, was rsync…

So here goes :
rsync -av --exclude-from exclude-list.txt . ../media/extHD/BACKUPS /"$(date +%Y%m%d)_HOME_DATAS/"

I put this in a file and used chmod u+x as user to execute it when necessary.
You’ve got to write your exclude list in a file called exclude-list.txt as follows :


Again, this is a short list but you can make it as long as you wish. No need for exact paths, just key-words will do. Don’t forget to add everything you don’t want !
In my example the backup will start from / so if you don’t want /etc, /bin, /share etc… in your archive write them down in your exclude file.
It’s easy, just copy and paste ‘ls’ and edit a little… Make sure both files ‘exclude-list.txt’ and your script are in the same running directory /.

Edit 06/01/2015 :
Now I do this : rsync -zivar --exclude-from exclude-list.txt --delete --progress /home/dir1 /media/ext3/dir1

Read Full Post »

The following is a little « grub hack » in order to reinstall on an old debian.

A friend gave me back a laptop with a 3+ years debian installed on it. I just couldn’t get apt-get update and dist-upgrade running… I tried a long time before giving up… Its BIOS doesn’t allow the boot from usb (key/cdrom) and the cdrom drive is out of order…

I finally stumbled upon this link and found a way out…

I downloaded linux and initrd.gz files from debian’s netboot/debian-installer pages into the /boot/grub directory and modified a pre-existant grub menu.list as follows :

  • title newinstall
  • root(hd0,0)
  • kernel /boot/grub/linux
  • initrd /boot/grub/initrd.gz

When rebooting, the grub prompt lets you select newinstall in its menu… The rest is easy if you are used to installing debian. Of course you will have to format the partition where your /boot/grub actually is ! But this doesn’t matter anymore, since what you need to proceed is loaded in the ram memory…

But think twice before doing all of this, since it’s a one shot situation !!

Another thing… unplug all your usb cables/drives when doing this operation. There can be a little confusion between hda/hdb -> sda/sdb and you risk the kernel panic while rebooting !! I’ll get back to this part in a few days…

Read Full Post »

Did you get one of these messages ?

Error opening terminal: rxvt-256color.
Cannot find terminfo entry for ‘rxvt-256color’.

Not to worry… All you have to do is make a ~/terminfo directory and paste the rxvt-256color file into it.

mkdir ~/.terminfo
cp /usr/share/terminfo/r/rxvt-256color ~/.terminfo/r/rxvt-256color

If you don’t have the rxvt-256color file at this address (/usr/share/terminfo/r/rxvt-256color) on your remote system, you’ll have to upload it from home and then ssh freely.

Read Full Post »